|
|
@@ -89,6 +89,52 @@ public class FmsLandController extends BaseController
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取基地统计信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:land:top:stat')")
|
|
|
+ @GetMapping(value = "/top/stat")
|
|
|
+ public AjaxResult selectFmsLandTotal(FmsLand fmsLand) {
|
|
|
+ boolean b = SecurityUtils.isValidate();
|
|
|
+ if (b) {
|
|
|
+ //true需要进行权限校验。下拉框基地列表查询需要包含分配的基地以及分配地块所属基地
|
|
|
+ List<String> strings = dataAuthUtil.landListOfBlock();
|
|
|
+ if (strings.isEmpty()) {
|
|
|
+ FmsLandTotalResVo resVo = new FmsLandTotalResVo();
|
|
|
+ resVo.setCount("0");
|
|
|
+ resVo.setLandAreaSum("0");
|
|
|
+ resVo.setLandBlockcountSum("0");
|
|
|
+ resVo.setLandDevcountSum("0");
|
|
|
+ return success(resVo);
|
|
|
+ }
|
|
|
+ fmsLand.setDataFilter(true);
|
|
|
+ fmsLand.setLandIds(strings);
|
|
|
+ }
|
|
|
+ FmsLandTotalResVo resVo = fmsLandService.selectFmsLandTotal(fmsLand);
|
|
|
+ return success(resVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增基地
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('fms:land:add')")
|
|
|
+ @Log(title = "基地", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/add")
|
|
|
+ public AjaxResult add(@RequestBody @Valid FmsLand fmsLand) {
|
|
|
+ /* 判断基地名称不能重复 */
|
|
|
+ FmsLand reqVo = new FmsLand();
|
|
|
+ reqVo.setLandNameEq(fmsLand.getLandName());
|
|
|
+ List<FmsLand> list = fmsLandService.selectFmsLandList(reqVo);
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ return AjaxResult.error(ErrorCode.FMS_LAND_EXIST.getCode(), ErrorCode.FMS_LAND_EXIST.getMessage());
|
|
|
+ }
|
|
|
+ fmsLand.setLandId(fmsLand.getId());
|
|
|
+ fmsLand.setLandDevcount(0L);
|
|
|
+ fmsLand.setLandBlockcount(0L);
|
|
|
+ return toAjax(fmsLandService.insertFmsLand(fmsLand));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('fms:land:select:list')")
|
|
|
@GetMapping("/select/list")
|
|
|
public TableDataInfo selectList(FmsLand fmsLand) {
|
|
|
@@ -135,51 +181,7 @@ public class FmsLandController extends BaseController
|
|
|
return success(fmsLandService.selectFmsLandByLandId(landId, SecurityUtils.getTid()));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取基地统计信息
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('fms:land:top:stat')")
|
|
|
- @GetMapping(value = "/top/stat")
|
|
|
- public AjaxResult selectFmsLandTotal(FmsLand fmsLand) {
|
|
|
- boolean b = SecurityUtils.isValidate();
|
|
|
- if (b) {
|
|
|
- //true需要进行权限校验。下拉框基地列表查询需要包含分配的基地以及分配地块所属基地
|
|
|
- List<String> strings = dataAuthUtil.landListOfBlock();
|
|
|
- if (strings.isEmpty()) {
|
|
|
- FmsLandTotalResVo resVo = new FmsLandTotalResVo();
|
|
|
- resVo.setCount("0");
|
|
|
- resVo.setLandAreaSum("0");
|
|
|
- resVo.setLandBlockcountSum("0");
|
|
|
- resVo.setLandDevcountSum("0");
|
|
|
- return success(resVo);
|
|
|
- }
|
|
|
- fmsLand.setDataFilter(true);
|
|
|
- fmsLand.setLandIds(strings);
|
|
|
- }
|
|
|
- FmsLandTotalResVo resVo = fmsLandService.selectFmsLandTotal(fmsLand);
|
|
|
- return success(resVo);
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 新增基地
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('fms:land:add')")
|
|
|
- @Log(title = "基地", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping(value = "/add")
|
|
|
- public AjaxResult add(@RequestBody @Valid FmsLand fmsLand) {
|
|
|
- /* 判断基地名称不能重复 */
|
|
|
- FmsLand reqVo = new FmsLand();
|
|
|
- reqVo.setLandNameEq(fmsLand.getLandName());
|
|
|
- List<FmsLand> list = fmsLandService.selectFmsLandList(reqVo);
|
|
|
- if (!list.isEmpty()) {
|
|
|
- return AjaxResult.error(ErrorCode.FMS_LAND_EXIST.getCode(), ErrorCode.FMS_LAND_EXIST.getMessage());
|
|
|
- }
|
|
|
- fmsLand.setLandId(fmsLand.getId());
|
|
|
- fmsLand.setTid(fmsLand.getLandId());
|
|
|
- fmsLand.setLandDevcount(0L);
|
|
|
- fmsLand.setLandBlockcount(0L);
|
|
|
- return toAjax(fmsLandService.insertFmsLand(fmsLand));
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 修改基地
|