diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/controller/app/AppTaskController.java b/cxxm/src/main/java/com/ruoyi/cxxm/controller/app/AppTaskController.java index c716f62c..f669f119 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/controller/app/AppTaskController.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/controller/app/AppTaskController.java @@ -51,27 +51,31 @@ public class AppTaskController extends BaseController { @ApiOperation("查询任务列表") @GetMapping("/list") public TableDataInfo list(TaskQuery taskQuery, PageDomain pageDomain) { + // 参数设置 taskQuery.setDeptId(getDeptId()); if (getLoginUser().getUser().getRoles().get(0).getRoleName().equals("外业调查员")) { taskQuery.setToId(getUserId()); } + if (taskQuery.getZjxfqk() == null || taskQuery.getZjxfqk().equals("")) { + taskQuery.setZjxfqk("1"); + } + // 分发 if (Objects.equals(taskQuery.getRwlx(), "1")) { taskQuery.setRwlx(null); ZftkTaskQuery zftkTaskQuery = new ZftkTaskQuery(); - BeanUtils.copyProperties(taskQuery,zftkTaskQuery); + BeanUtils.copyProperties(taskQuery, zftkTaskQuery); Page page = taskService.getPageDistribute(zftkTaskQuery, pageDomain); return getDataTableByPage(page); } else if (Objects.equals(taskQuery.getRwlx(), "2")) { taskQuery.setRwlx(null); ZttbTaskQuery zttbTaskQuery = new ZttbTaskQuery(); - BeanUtils.copyProperties(taskQuery,zttbTaskQuery); + BeanUtils.copyProperties(taskQuery, zttbTaskQuery); Page page = zttbTaskService.getPageDistribute(zttbTaskQuery, pageDomain); return getDataTableByPage(page); - } - else if (Objects.equals(taskQuery.getRwlx(), "0")) { + } else if (Objects.equals(taskQuery.getRwlx(), "0")) { taskQuery.setRwlx(null); ZtTaskQuery ztTaskQuery = new ZtTaskQuery(); - BeanUtils.copyProperties(taskQuery,ztTaskQuery); + BeanUtils.copyProperties(taskQuery, ztTaskQuery); Page page = ztTaskService.getPageDistribute(ztTaskQuery, pageDomain); return getDataTableByPage(page); } @@ -89,7 +93,7 @@ public class AppTaskController extends BaseController { return success(taskService.getTaskDetail(id)); } else if (rwlx.equals("2")) { return success(zttbTaskService.getTaskDetail(id)); - }else if(rwlx.equals("0")){ + } else if (rwlx.equals("0")) { return success(ztTaskService.getTaskDetail(id)); } return success(); @@ -98,24 +102,28 @@ public class AppTaskController extends BaseController { @ApiOperation("查询州级下发任务列表") @GetMapping("/distribute/list") public TableDataInfo distributeList(TaskQuery taskQuery, PageDomain pageDomain) { + // 分发 if (Objects.equals(taskQuery.getRwlx(), "1")) { + // 参数设置 taskQuery.setRwlx(null); ZftkTaskQuery zftkTaskQuery = new ZftkTaskQuery(); - BeanUtils.copyProperties(taskQuery,zftkTaskQuery); + BeanUtils.copyProperties(taskQuery, zftkTaskQuery); Page page = taskService.getPageDistribute(zftkTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); } else if (Objects.equals(taskQuery.getRwlx(), "2")) { + // 参数设置 taskQuery.setRwlx(null); ZttbTaskQuery zttbTaskQuery = new ZttbTaskQuery(); - BeanUtils.copyProperties(taskQuery,zttbTaskQuery); + BeanUtils.copyProperties(taskQuery, zttbTaskQuery); Page page = zttbTaskService.getPageDistribute(zttbTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); - }else if (Objects.equals(taskQuery.getRwlx(), "0")) { + } else if (Objects.equals(taskQuery.getRwlx(), "0")) { + // 参数设置 taskQuery.setRwlx(null); ZtTaskQuery ztTaskQuery = new ZtTaskQuery(); - BeanUtils.copyProperties(taskQuery,ztTaskQuery); + BeanUtils.copyProperties(taskQuery, ztTaskQuery); Page page = ztTaskService.getPageDistribute(ztTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); @@ -141,28 +149,35 @@ public class AppTaskController extends BaseController { */ @ApiOperation("查询本人任务列表") @GetMapping("/my/list") - public TableDataInfo meList(TaskQuery taskQuery, PageDomain pageDomain) { + public TableDataInfo myList(TaskQuery taskQuery, PageDomain pageDomain) { + // 分发 if (Objects.equals(taskQuery.getRwlx(), "1")) { + // 参数设置 taskQuery.setRwlx(null); taskQuery.setToId(getUserId()); + taskQuery.setZjxfqk("1"); ZftkTaskQuery zftkTaskQuery = new ZftkTaskQuery(); - BeanUtils.copyProperties(taskQuery,zftkTaskQuery); + BeanUtils.copyProperties(taskQuery, zftkTaskQuery); Page page = taskService.getPageDistribute2(zftkTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); } else if (Objects.equals(taskQuery.getRwlx(), "2")) { + // 参数设置 taskQuery.setRwlx(null); taskQuery.setToId(getUserId()); + taskQuery.setZjxfqk("1"); ZttbTaskQuery zttbTaskQuery = new ZttbTaskQuery(); - BeanUtils.copyProperties(taskQuery,zttbTaskQuery); + BeanUtils.copyProperties(taskQuery, zttbTaskQuery); Page page = zttbTaskService.getPageDistribute2(zttbTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); - }else if (Objects.equals(taskQuery.getRwlx(), "0")) { + } else if (Objects.equals(taskQuery.getRwlx(), "0")) { + // 参数设置 taskQuery.setRwlx(null); taskQuery.setToId(getUserId()); + taskQuery.setZjxfqk("1"); ZtTaskQuery ztTaskQuery = new ZtTaskQuery(); - BeanUtils.copyProperties(taskQuery,ztTaskQuery); + BeanUtils.copyProperties(taskQuery, ztTaskQuery); Page page = ztTaskService.getPageDistribute2(ztTaskQuery, pageDomain); // 返回查询结果 return getDataTableByPage(page); diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZftkTaskServiceImpl.java b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZftkTaskServiceImpl.java index d91f324d..686ea1d2 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZftkTaskServiceImpl.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZftkTaskServiceImpl.java @@ -98,6 +98,9 @@ public class ZftkTaskServiceImpl extends ServiceImpl i // 解析文件内容 Map map = JSONObject.parseObject(content.toString(), Map.class); Object features = map.get("features"); + if (features == null) { + throw new RuntimeException("文件格式错误,缺少features信息!"); + } List importData = JSONObject.parseObject(features.toString(), List.class); List failList = new ArrayList<>(); @@ -109,14 +112,24 @@ public class ZftkTaskServiceImpl extends ServiceImpl i // 提取并设置图斑空间数据 Object geometry = item.get("geometry"); + if (geometry == null) { + throw new RuntimeException("文件格式错误,缺少geometry信息!"); + } taskGis.setGis(geometry.toString()); // 提取并设置图斑信息 Object properties = item.get("properties"); + if (properties == null) { + throw new RuntimeException("文件格式错误,缺少properties信息!"); + } Map taskMap = JSONObject.parseObject(properties.toString(), Map.class); // 校验必填字段是否存在 String[] requiredFields = new String[]{"NF", "XMC", "XMMC", "DKH", "GNFQ", "DKMJ", "NYDMJ", "GDMJ", "JSYDMJ", "WLYDMJ", "YJJBNTMJ", "DGZT", "X", "Y", "XDM"}; for (String field : requiredFields) { + String fieldLowerCase = field.toLowerCase(); + if (taskMap.containsKey(fieldLowerCase)) { + throw new RuntimeException(StringUtils.format("字段:{}必须使用大写字母,请纠正为{}!", fieldLowerCase, field)); + } if (taskMap.get(field) == null) { throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field)); } @@ -285,6 +298,10 @@ public class ZftkTaskServiceImpl extends ServiceImpl i if (task.getDeptId() == null) { task.setDeptId(SecurityUtils.getLoginUser().getUser().getDeptId()); } + // 默认州级已下发 + if (task.getZjxfqk() == null) { + task.setZjxfqk("1"); + } // 初始化分页对象 Page page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize()); LambdaQueryWrapper queryWrapper = getQueryWrapper(task); diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZtTaskServiceImpl.java b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZtTaskServiceImpl.java index 022ba8ac..4103714c 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZtTaskServiceImpl.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZtTaskServiceImpl.java @@ -99,6 +99,9 @@ public class ZtTaskServiceImpl extends ServiceImpl impleme // 解析文件内容 Map map = JSONObject.parseObject(content.toString(), Map.class); Object features = map.get("features"); + if (features == null) { + throw new RuntimeException("文件格式错误,缺少features信息!"); + } List importData = JSONObject.parseObject(features.toString(), List.class); List failList = new ArrayList<>(); @@ -110,15 +113,25 @@ public class ZtTaskServiceImpl extends ServiceImpl impleme // 提取并设置图斑空间数据 Object geometry = item.get("geometry"); + if (geometry == null) { + throw new RuntimeException("文件格式错误,缺少geometry信息!"); + } taskGis.setGis(geometry.toString()); // 提取并设置图斑信息 Object properties = item.get("properties"); + if (properties == null) { + throw new RuntimeException("文件格式错误,缺少properties信息!"); + } Map taskMap = JSONObject.parseObject(properties.toString(), Map.class); // 校验必填字段是否存在 - String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"}; + String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC", "X", "Y"}; for (String field : requiredFields) { + String fieldLowerCase = field.toLowerCase(); + if (taskMap.containsKey(fieldLowerCase)) { + throw new RuntimeException(StringUtils.format("字段:{}必须使用大写字母,请纠正为{}!", fieldLowerCase,field)); + } if (taskMap.get(field) == null) { throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field)); } @@ -285,6 +298,10 @@ public class ZtTaskServiceImpl extends ServiceImpl impleme if (task.getDeptId() == null) { task.setDeptId(SecurityUtils.getLoginUser().getUser().getDeptId()); } + // 默认州级已下发 + if (task.getZjxfqk() == null) { + task.setZjxfqk("1"); + } // 初始化分页对象 Page page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize()); LambdaQueryWrapper queryWrapper = getQueryWrapper(task); diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZttbTaskServiceImpl.java b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZttbTaskServiceImpl.java index e2ad7c3e..6d9ea8b5 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZttbTaskServiceImpl.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/service/impl/ZttbTaskServiceImpl.java @@ -97,6 +97,9 @@ public class ZttbTaskServiceImpl extends ServiceImpl i // 解析文件内容 Map map = JSONObject.parseObject(content.toString(), Map.class); Object features = map.get("features"); + if (features == null) { + throw new RuntimeException("文件格式错误,缺少features信息!"); + } List importData = JSONObject.parseObject(features.toString(), List.class); List failList = new ArrayList<>(); @@ -108,16 +111,26 @@ public class ZttbTaskServiceImpl extends ServiceImpl i // 提取并设置图斑空间数据 Object geometry = item.get("geometry"); + if (geometry == null) { + throw new RuntimeException("文件格式错误,缺少geometry信息!"); + } taskGis.setGis(geometry.toString()); // 提取并设置图斑信息 Object properties = item.get("properties"); + if (properties == null) { + throw new RuntimeException("文件格式错误,缺少properties信息!"); + } Map taskMap = JSONObject.parseObject(properties.toString(), Map.class); // 校验必填字段是否存在 - String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC"}; + String[] requiredFields = new String[]{"NF", "XMC", "XZMC", "CJDCQ", "JCBH", "XFSJ", "JCMJ", "GDMJ", "XMMC", "X", "Y"}; for (String field : requiredFields) { + String fieldLowerCase = field.toLowerCase(); + if (taskMap.containsKey(fieldLowerCase)) { + throw new RuntimeException(StringUtils.format("字段:{}必须使用大写字母,请纠正为{}!", fieldLowerCase,field)); + } if (taskMap.get(field) == null) { - throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field)); + throw new RuntimeException(StringUtils.format("缺少必须字段:{},请检查导入数据!", field)); } } zttbTask.setRwlx(rwlx); @@ -284,6 +297,10 @@ public class ZttbTaskServiceImpl extends ServiceImpl i if (task.getDeptId() == null) { task.setDeptId(SecurityUtils.getLoginUser().getUser().getDeptId()); } + // 默认州级已下发 + if (task.getZjxfqk() == null) { + task.setZjxfqk("1"); + } // 初始化分页对象 Page page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize()); LambdaQueryWrapper queryWrapper = getQueryWrapper(task); diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 6333c1e4..1fd8960e 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://ruoyi-mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=False&serverTimezone=GMT%2B8 + url: jdbc:mysql://ruoyi-mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 username: root password: 7ZH2jxM1 # 从库数据源 diff --git a/ruoyi-ui/src/components/Map/index.vue b/ruoyi-ui/src/components/Map/index.vue index 5f269fa0..f05ba844 100644 --- a/ruoyi-ui/src/components/Map/index.vue +++ b/ruoyi-ui/src/components/Map/index.vue @@ -3,7 +3,7 @@
- +
测距
测面
清除
@@ -19,7 +19,12 @@ export default { data() { return { map: null, - infoData: {}, + infoData: { + x: "101.51821267418167", + y: "25.053135818719412", + dkh: "", + tbbh: "" + }, recordData: {}, lineTool: null,//测距 polygonTool: null,//侧面 diff --git a/ruoyi-ui/src/views/cxxm/zftkTask/import/index.vue b/ruoyi-ui/src/views/cxxm/zftkTask/import/index.vue index f8e07333..05d3799c 100644 --- a/ruoyi-ui/src/views/cxxm/zftkTask/import/index.vue +++ b/ruoyi-ui/src/views/cxxm/zftkTask/import/index.vue @@ -1,30 +1,30 @@