|
@@ -0,0 +1,111 @@
|
|
|
|
|
+package com.yunfeiyun.agmp.fms.controller;
|
|
|
|
|
+
|
|
|
|
|
+import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.core.page.TableDataInfo;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.exception.BizException;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.utils.SecurityUtils;
|
|
|
|
|
+import com.yunfeiyun.agmp.common.utils.StringUtils;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.domain.FmsBlock;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.domain.FmsLand;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.domain.reqvo.FmsScreenStatReqVo;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.domain.resvo.FmsScreenLandStatResVo;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.domain.resvo.FmsScreenPlanStatResVo;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.service.IFmsBlockService;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.service.IFmsLandService;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.service.IFmsScreenService;
|
|
|
|
|
+import com.yunfeiyun.agmp.fms.util.DataAuthUtil;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+@RestController
|
|
|
|
|
+@RequestMapping("/fms/screen")
|
|
|
|
|
+public class FmsScreenController extends BaseController {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DataAuthUtil dataAuthUtil;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFmsLandService fmsLandService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFmsBlockService fmsBlockService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFmsScreenService fmsScreenService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询基地列表不分页
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:screen:land:all:list')")
|
|
|
|
|
+ @GetMapping("/land/all/list")
|
|
|
|
|
+ public TableDataInfo listNoPage(FmsLand fmsLand) {
|
|
|
|
|
+ boolean b = SecurityUtils.isValidate();
|
|
|
|
|
+ if (b) {
|
|
|
|
|
+ //true需要进行权限校验。基地列表需要分配的基地才能查询
|
|
|
|
|
+ List<String> strings = dataAuthUtil.landList();
|
|
|
|
|
+ if (strings.isEmpty()) {
|
|
|
|
|
+ return getDataTable(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ fmsLand.setDataFilter(true);
|
|
|
|
|
+ fmsLand.setLandIds(strings);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<FmsLand> list = fmsLandService.selectFmsLandList(fmsLand);
|
|
|
|
|
+ return getDataTable(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询所有地块列表 不分页
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:screen:block:all:list')")
|
|
|
|
|
+ @GetMapping("/block/all/list")
|
|
|
|
|
+ public TableDataInfo list(FmsBlock fmsBlock) {
|
|
|
|
|
+ boolean b = SecurityUtils.isValidate();
|
|
|
|
|
+ if (b) {
|
|
|
|
|
+ //true需要进行权限校验。下拉框基地列表查询需要包含分配的基地以及分配地块所属基地
|
|
|
|
|
+ List<String> strings = dataAuthUtil.blockList();
|
|
|
|
|
+ if (strings.isEmpty()) {
|
|
|
|
|
+ return getDataTable(new ArrayList<>());
|
|
|
|
|
+ }
|
|
|
|
|
+ fmsBlock.setDataFilter(true);
|
|
|
|
|
+ fmsBlock.setBlockIds(strings);
|
|
|
|
|
+ }
|
|
|
|
|
+ fmsBlock.setTid(SecurityUtils.getTid());
|
|
|
|
|
+ List<FmsBlock> list = fmsBlockService.selectFmsBlockList(fmsBlock);
|
|
|
|
|
+ return getDataTable(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询所有地块列表 不分页
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:screen:block:all:list')")
|
|
|
|
|
+ @GetMapping("/land/stat/{landId}")
|
|
|
|
|
+ public AjaxResult landStat(@PathVariable("landId") String landId) {
|
|
|
|
|
+ if(StringUtils.isEmpty(landId)){
|
|
|
|
|
+ throw new BizException(ErrorCode.INVALID_PARAMETER.getCode(), "参数异常");
|
|
|
|
|
+ }
|
|
|
|
|
+ FmsScreenLandStatResVo landStat = fmsScreenService.landStat(landId);
|
|
|
|
|
+ return success(landStat);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询所有地块列表 不分页
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:screen:block:all:list')")
|
|
|
|
|
+ @GetMapping("/plan/stat")
|
|
|
|
|
+ public AjaxResult planStat(FmsScreenStatReqVo reqVo) {
|
|
|
|
|
+ String landId = reqVo.getLandId();
|
|
|
|
|
+ if(StringUtils.isEmpty(landId)){
|
|
|
|
|
+ throw new BizException(ErrorCode.INVALID_PARAMETER.getCode(), "参数异常");
|
|
|
|
|
+ }
|
|
|
|
|
+ FmsScreenPlanStatResVo planStatResVo = fmsScreenService.planStat(reqVo);
|
|
|
|
|
+ return success(planStatResVo);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|