Commit 95b1cae3072ae133b0e9f4e08dffe5c31fefbd9c
Merge branch 'master' into dev
Showing
5 changed files
with
61 additions
and
23 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java
| ... | ... | @@ -126,19 +126,28 @@ public class RoadController { |
| 126 | 126 | @Operation(summary = "物联网查询道路") |
| 127 | 127 | @GetMapping("/queryAllRoadList") |
| 128 | 128 | @PermitAll |
| 129 | - public CommonResult<List<SysRoadRespVO>> queryAllRoadList(@RequestParam(required = false)String roadName,@RequestParam(required = false)String deptCode,@RequestParam(required = false)String companyCode) { | |
| 129 | + public Map<String, Object> queryAllRoadList(@RequestParam(required = false) String roadName, @RequestParam(required = false) String deptCode, @RequestParam(required = false) String companyCode) { | |
| 130 | 130 | RoadListReqVO reqVO = new RoadListReqVO(); |
| 131 | 131 | reqVO.setRoadName(roadName); |
| 132 | - reqVO.setCompanyId(Long.valueOf(deptCode)); | |
| 132 | + // 处理deptCode为空的情况 | |
| 133 | + if (deptCode != null && !deptCode.isEmpty()) { | |
| 134 | + reqVO.setCompanyId(Long.valueOf(deptCode)); | |
| 135 | + } | |
| 133 | 136 | reqVO.setBusiLine(companyCode); |
| 134 | 137 | List<RoadDO> roadList = roadService.getRoadList(reqVO); |
| 135 | - List<SysRoadRespVO> deptResps = roadList.stream().map(manager -> { | |
| 136 | - SysRoadRespVO sysDeptResp = new SysRoadRespVO(); | |
| 137 | - sysDeptResp.setRoadCode(manager.getId()+""); | |
| 138 | - sysDeptResp.setRoadName(manager.getRoadName()); | |
| 139 | - return sysDeptResp; | |
| 138 | + List<Map<String, Object>> roadResps = roadList.stream().map(manager -> { | |
| 139 | + Map<String, Object> roadMap = new HashMap<>(); | |
| 140 | + roadMap.put("roadCode", manager.getId() + ""); | |
| 141 | + roadMap.put("roadName", manager.getRoadName()); | |
| 142 | + return roadMap; | |
| 140 | 143 | }).collect(Collectors.toList()); |
| 141 | - return success(deptResps); | |
| 144 | + | |
| 145 | + // 构建返回格式 | |
| 146 | + Map<String, Object> result = new HashMap<>(); | |
| 147 | + result.put("msg", "操作成功"); | |
| 148 | + result.put("code", 200); | |
| 149 | + result.put("data", roadResps); | |
| 150 | + return result; | |
| 142 | 151 | } |
| 143 | 152 | |
| 144 | 153 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
| ... | ... | @@ -159,10 +159,18 @@ public class RoadServiceImpl implements RoadService { |
| 159 | 159 | QueryWrapper<RoadDO> sql = new QueryWrapper<>(); |
| 160 | 160 | sql.select("id", "road_name", "level_id","company_id","dept_id"); |
| 161 | 161 | |
| 162 | - sql.lambda().eq(RoadDO::getCompanyId, reqVO.getCompanyId()) | |
| 163 | - .eq(RoadDO::getLevelId, reqVO.getLevelId()) | |
| 164 | - .eq(RoadDO::getBusiLine, reqVO.getBusiLine()) | |
| 165 | - .likeRight(StringUtils.isNotEmpty(reqVO.getRoadName()), RoadDO::getRoadName, reqVO.getRoadName()); | |
| 162 | + if (reqVO.getCompanyId() != null) { | |
| 163 | + sql.lambda().eq(RoadDO::getCompanyId, reqVO.getCompanyId()); | |
| 164 | + } | |
| 165 | + if (reqVO.getLevelId() != null) { | |
| 166 | + sql.lambda().eq(RoadDO::getLevelId, reqVO.getLevelId()); | |
| 167 | + } | |
| 168 | + if (reqVO.getBusiLine() != null) { | |
| 169 | + sql.lambda().eq(RoadDO::getBusiLine, reqVO.getBusiLine()); | |
| 170 | + } | |
| 171 | + if (StringUtils.isNotEmpty(reqVO.getRoadName())) { | |
| 172 | + sql.lambda().like(RoadDO::getRoadName, reqVO.getRoadName()); | |
| 173 | + } | |
| 166 | 174 | return roadMapper.selectList(sql); |
| 167 | 175 | } |
| 168 | 176 | ... | ... |
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/admin/dept/DeptController.java
| ... | ... | @@ -18,6 +18,9 @@ import org.springframework.web.bind.annotation.*; |
| 18 | 18 | |
| 19 | 19 | import jakarta.annotation.Resource; |
| 20 | 20 | import jakarta.validation.Valid; |
| 21 | + | |
| 22 | +import java.util.HashMap; | |
| 23 | +import java.util.Map; | |
| 21 | 24 | import java.util.List; |
| 22 | 25 | import java.util.stream.Collectors; |
| 23 | 26 | |
| ... | ... | @@ -126,18 +129,24 @@ public class DeptController { |
| 126 | 129 | @Operation(summary = "查询所有组织") |
| 127 | 130 | @GetMapping("/queryAllDeptList") |
| 128 | 131 | @PermitAll |
| 129 | - public CommonResult<List<SysDeptRespVO>> queryAllDeptList(@RequestParam(required = false)String companyCode) { | |
| 132 | + public Map<String, Object> queryAllDeptList() { | |
| 130 | 133 | List<DeptDO> sysDepts = deptService.getSubDeptAllList(); |
| 131 | - List<SysDeptRespVO> deptResps = sysDepts.stream().map(sysDept -> { | |
| 132 | - SysDeptRespVO sysDeptResp = new SysDeptRespVO(); | |
| 133 | - sysDeptResp.setDeptCode(sysDept.getId()+""); | |
| 134 | - sysDeptResp.setDeptName(sysDept.getName()); | |
| 135 | - sysDeptResp.setParentDeptCode(sysDept.getParentId()+""); | |
| 136 | - sysDeptResp.setOrderNum(sysDept.getSort()); | |
| 137 | - sysDeptResp.setStatus(sysDept.getStatus().toString()); | |
| 138 | - return sysDeptResp; | |
| 134 | + List<Map<String, Object>> deptResps = sysDepts.stream().map(sysDept -> { | |
| 135 | + Map<String, Object> deptMap = new HashMap<>(); | |
| 136 | + deptMap.put("deptCode", sysDept.getId() + ""); | |
| 137 | + deptMap.put("deptName", sysDept.getName()); | |
| 138 | + // parentDeptCode为空时返回空字符串 | |
| 139 | + deptMap.put("parentDeptCode", sysDept.getParentId() == null || sysDept.getParentId() == 0 ? "" : sysDept.getParentId() + ""); | |
| 140 | + deptMap.put("orderNum", sysDept.getSort()); | |
| 141 | + return deptMap; | |
| 139 | 142 | }).collect(Collectors.toList()); |
| 140 | - return success(deptResps); | |
| 143 | + | |
| 144 | + // 构建返回格式 | |
| 145 | + Map<String, Object> result = new HashMap<>(); | |
| 146 | + result.put("msg", "操作成功"); | |
| 147 | + result.put("code", 200); | |
| 148 | + result.put("data", deptResps); | |
| 149 | + return result; | |
| 141 | 150 | } |
| 142 | 151 | |
| 143 | 152 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/api/constant/BpmCommonConstant.java
| ... | ... | @@ -181,6 +181,7 @@ public class BpmCommonConstant { |
| 181 | 181 | public static final String AI_DISPATCHER = "AI_dispatcher"; |
| 182 | 182 | /*养护级别-字典key*/ |
| 183 | 183 | public static final String CONSERVE_LEVEL = "conserve_level"; |
| 184 | + | |
| 184 | 185 | public static final String SANHAI_COMPANY = "sanhai_compamys"; |
| 185 | 186 | //--------------------------------------------------------------------------------- |
| 186 | 187 | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
| ... | ... | @@ -305,8 +305,19 @@ public class BpmAIServiceImpl implements BpmAIService{ |
| 305 | 305 | |
| 306 | 306 | @Override |
| 307 | 307 | public boolean isSanhai(Long companyId) { |
| 308 | + List<DictDataRespDTO> dictData = dictDataCommonApi.getDictDataList(SANHAI_COMPANY); | |
| 309 | + if(null == dictData || dictData.size()==0){ | |
| 310 | + throw exception(SANHAI_COMPANY_NOT_EXISTS); | |
| 311 | + } | |
| 308 | 312 | List<Long> sanHaiRoadId = new ArrayList<>(); |
| 309 | - sanHaiRoadId.add(115L); // TODO 目前写死 | |
| 313 | + for(DictDataRespDTO dto:dictData){ | |
| 314 | + try { | |
| 315 | + sanHaiRoadId.add(Long.parseLong(dto.getValue())); | |
| 316 | + }catch (Exception e){ | |
| 317 | + throw exception(SANHAI_COMPANY_NOT_EXISTS); | |
| 318 | + } | |
| 319 | + } | |
| 320 | + //sanHaiRoadId.add(115L); // 目前写死 ,上面改为从字典值获取258 | |
| 310 | 321 | //是否三海路段 |
| 311 | 322 | boolean isSanhai = sanHaiRoadId.contains(companyId); |
| 312 | 323 | return isSanhai; | ... | ... |