feat(module-inspection): 优化巡检计划和任务查询接口
- 新增巡检计划分页查询接口和相关实现 - 重构巡检任务分页查询接口,增加异常状态筛选功能 -优化巡检点历史数据查询接口,采用多线程提高查询效率 - 更新实体类和 Mapper接口以支持新功能
正在显示
17 个修改的文件
包含
139 行增加
和
64 行删除
... | @@ -19,7 +19,6 @@ import com.skua.core.service.IFactoryInfoService; | ... | @@ -19,7 +19,6 @@ import com.skua.core.service.IFactoryInfoService; |
19 | import com.skua.core.util.ConvertUtils; | 19 | import com.skua.core.util.ConvertUtils; |
20 | import com.skua.core.util.DateUtils; | 20 | import com.skua.core.util.DateUtils; |
21 | import com.skua.modules.algorithm.handle.IAlarmLimitCustomService; | 21 | import com.skua.modules.algorithm.handle.IAlarmLimitCustomService; |
22 | import com.skua.modules.algorithm.service.ISysAlgorithmLibraryService; | ||
23 | import com.skua.modules.algorithm.service.ISysAlgorithmStatisticsLibraryService; | 22 | import com.skua.modules.algorithm.service.ISysAlgorithmStatisticsLibraryService; |
24 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsLibraryVO; | 23 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsLibraryVO; |
25 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultChartsVO; | 24 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultChartsVO; |
... | @@ -27,7 +26,6 @@ import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultNumberVO; | ... | @@ -27,7 +26,6 @@ import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultNumberVO; |
27 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultVO; | 26 | import com.skua.modules.algorithm.vo.SysAlgorithmStatisticsResultVO; |
28 | import com.skua.modules.flow.utils.ObjectUtil; | 27 | import com.skua.modules.flow.utils.ObjectUtil; |
29 | import com.skua.modules.flow.utils.StringUtil; | 28 | import com.skua.modules.flow.utils.StringUtil; |
30 | import com.skua.modules.system.datestandard.service.ISysMonitorMetricInfoService; | ||
31 | import com.skua.modules.system.entity.SysDepart; | 29 | import com.skua.modules.system.entity.SysDepart; |
32 | import com.skua.modules.system.entity.SysFactoryInfo; | 30 | import com.skua.modules.system.entity.SysFactoryInfo; |
33 | import com.skua.modules.system.service.ISysDepartService; | 31 | import com.skua.modules.system.service.ISysDepartService; |
... | @@ -45,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -45,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
45 | import org.springframework.jdbc.core.JdbcTemplate; | 43 | import org.springframework.jdbc.core.JdbcTemplate; |
46 | import org.springframework.util.StringUtils; | 44 | import org.springframework.util.StringUtils; |
47 | import org.springframework.web.bind.annotation.*; | 45 | import org.springframework.web.bind.annotation.*; |
48 | |||
49 | import javax.servlet.http.HttpServletRequest; | 46 | import javax.servlet.http.HttpServletRequest; |
50 | import java.math.BigDecimal; | 47 | import java.math.BigDecimal; |
51 | import java.text.NumberFormat; | 48 | import java.text.NumberFormat; |
... | @@ -76,8 +73,6 @@ public class ScreenDataController { | ... | @@ -76,8 +73,6 @@ public class ScreenDataController { |
76 | @Autowired | 73 | @Autowired |
77 | private ISysFactoryInfoService sysFactoryInfoService; | 74 | private ISysFactoryInfoService sysFactoryInfoService; |
78 | @Autowired | 75 | @Autowired |
79 | public ISysAlgorithmLibraryService sysAlgorithmLibraryService; | ||
80 | @Autowired | ||
81 | private IDataCountDayService dataCountDayService; | 76 | private IDataCountDayService dataCountDayService; |
82 | @Autowired | 77 | @Autowired |
83 | private ISysFactoryDeviceService sysFactoryDeviceService; | 78 | private ISysFactoryDeviceService sysFactoryDeviceService; |
... | @@ -134,17 +129,13 @@ public class ScreenDataController { | ... | @@ -134,17 +129,13 @@ public class ScreenDataController { |
134 | 129 | ||
135 | /** | 130 | /** |
136 | * app水量情况 | 131 | * app水量情况 |
137 | * | ||
138 | * @param departId | 132 | * @param departId |
139 | * @param req | ||
140 | * @return | 133 | * @return |
141 | */ | 134 | */ |
142 | @AutoLog(value = "app水量情况") | 135 | @AutoLog(value = "app水量情况") |
143 | @ApiOperation(value = "app水量情况", notes = "app水量情况") | 136 | @ApiOperation(value = "app水量情况", notes = "app水量情况") |
144 | @GetMapping(value = "/getAppSlqk") | 137 | @GetMapping(value = "/getAppSlqk") |
145 | public Result<Map<String, Object>> getAppSlqk(String departId, | 138 | public Result<Map<String, Object>> getAppSlqk(String departId) { |
146 | HttpServletRequest req) { | ||
147 | |||
148 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | 139 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); |
149 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 140 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
150 | NumberFormat numberFormat = NumberFormat.getInstance(); | 141 | NumberFormat numberFormat = NumberFormat.getInstance(); |
... | @@ -188,7 +179,6 @@ public class ScreenDataController { | ... | @@ -188,7 +179,6 @@ public class ScreenDataController { |
188 | Double monthSl = Double.parseDouble(monthMap.get("JSLL").toString()); | 179 | Double monthSl = Double.parseDouble(monthMap.get("JSLL").toString()); |
189 | resultMap.put("本月累计水量", numberFormat.format(monthSl / 10000)); | 180 | resultMap.put("本月累计水量", numberFormat.format(monthSl / 10000)); |
190 | } | 181 | } |
191 | |||
192 | //上月累计水量 | 182 | //上月累计水量 |
193 | String lastMonthStartDate = DateUtils.getLastMonthOfMonth(DateUtils.getTodayOrMonthDate("month")) + "-01"; | 183 | String lastMonthStartDate = DateUtils.getLastMonthOfMonth(DateUtils.getTodayOrMonthDate("month")) + "-01"; |
194 | String lastMonthEndDate = DateUtils.getLastDayOfMonth(DateUtils.getLastMonthOfMonth(DateUtils.getTodayOrMonthDate("month"))); | 184 | String lastMonthEndDate = DateUtils.getLastDayOfMonth(DateUtils.getLastMonthOfMonth(DateUtils.getTodayOrMonthDate("month"))); |
... | @@ -204,7 +194,6 @@ public class ScreenDataController { | ... | @@ -204,7 +194,6 @@ public class ScreenDataController { |
204 | String hb = numberFormat.format((monthSl - lastMonthSl) / 10000); | 194 | String hb = numberFormat.format((monthSl - lastMonthSl) / 10000); |
205 | resultMap.put("环比上月", hb); | 195 | resultMap.put("环比上月", hb); |
206 | } | 196 | } |
207 | |||
208 | } | 197 | } |
209 | result.setSuccess(true); | 198 | result.setSuccess(true); |
210 | result.setResult(resultMap); | 199 | result.setResult(resultMap); |
... | @@ -213,17 +202,13 @@ public class ScreenDataController { | ... | @@ -213,17 +202,13 @@ public class ScreenDataController { |
213 | 202 | ||
214 | /** | 203 | /** |
215 | * 今日水量情况 | 204 | * 今日水量情况 |
216 | * | ||
217 | * @param departId | 205 | * @param departId |
218 | * @param req | ||
219 | * @return | 206 | * @return |
220 | */ | 207 | */ |
221 | @AutoLog(value = "今日水量情况") | 208 | @AutoLog(value = "今日水量情况") |
222 | @ApiOperation(value = "今日水量情况", notes = "今日水量情况") | 209 | @ApiOperation(value = "今日水量情况", notes = "今日水量情况") |
223 | @GetMapping(value = "/getTodaySl") | 210 | @GetMapping(value = "/getTodaySl") |
224 | public Result<Map<String, Object>> getTodaySl(String departId, | 211 | public Result<Map<String, Object>> getTodaySl(String departId) { |
225 | HttpServletRequest req) { | ||
226 | |||
227 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | 212 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); |
228 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 213 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
229 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | 214 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); |
... | @@ -246,20 +231,15 @@ public class ScreenDataController { | ... | @@ -246,20 +231,15 @@ public class ScreenDataController { |
246 | return result; | 231 | return result; |
247 | } | 232 | } |
248 | 233 | ||
249 | |||
250 | /** | 234 | /** |
251 | * 今日水量情况 | 235 | * 今日水量情况 |
252 | * | ||
253 | * @param req GZGSDH | 236 | * @param req GZGSDH |
254 | * @return | 237 | * @return |
255 | */ | 238 | */ |
256 | |||
257 | @AutoLog(value = "各子公司电耗") | 239 | @AutoLog(value = "各子公司电耗") |
258 | @ApiOperation(value = "各子公司电耗", notes = "各子公司电耗") | 240 | @ApiOperation(value = "各子公司电耗", notes = "各子公司电耗") |
259 | @PostMapping(value = "/getFactoryDH") | 241 | @PostMapping(value = "/getFactoryDH") |
260 | public Result<Map<String, Object>> getFactoryDH(@RequestBody JSONObject jsonObject, | 242 | public Result<Map<String, Object>> getFactoryDH(@RequestBody JSONObject jsonObject) { |
261 | HttpServletRequest req) { | ||
262 | |||
263 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | 243 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); |
264 | Map<String, Object> resultMap = new LinkedHashMap<String, Object>(); | 244 | Map<String, Object> resultMap = new LinkedHashMap<String, Object>(); |
265 | //将jsonObject转sysAlgorithmStatisticsLibraryVO对象 | 245 | //将jsonObject转sysAlgorithmStatisticsLibraryVO对象 |
... | @@ -329,7 +309,6 @@ public class ScreenDataController { | ... | @@ -329,7 +309,6 @@ public class ScreenDataController { |
329 | } | 309 | } |
330 | 310 | ||
331 | } | 311 | } |
332 | |||
333 | resultMap.put("d", dList.size()); | 312 | resultMap.put("d", dList.size()); |
334 | resultMap.put("z", zList.size()); | 313 | resultMap.put("z", zList.size()); |
335 | resultMap.put("g", gList.size()); | 314 | resultMap.put("g", gList.size()); |
... | @@ -342,32 +321,23 @@ public class ScreenDataController { | ... | @@ -342,32 +321,23 @@ public class ScreenDataController { |
342 | result.setSuccess(true); | 321 | result.setSuccess(true); |
343 | result.setResult(resultMap); | 322 | result.setResult(resultMap); |
344 | } | 323 | } |
345 | |||
346 | |||
347 | } catch (Exception e) { | 324 | } catch (Exception e) { |
348 | e.printStackTrace(); | 325 | e.printStackTrace(); |
349 | } | 326 | } |
350 | |||
351 | return result; | 327 | return result; |
352 | } | 328 | } |
353 | 329 | ||
354 | |||
355 | /** | 330 | /** |
356 | * 今日水量情况 | 331 | * 今日水量情况 |
357 | * | ||
358 | * @param req GZGSYH | 332 | * @param req GZGSYH |
359 | * @param req GLDSYH | 333 | * @param req GLDSYH |
360 | * @return | 334 | * @return |
361 | */ | 335 | */ |
362 | |||
363 | @AutoLog(value = "各子公司吨水药耗") | 336 | @AutoLog(value = "各子公司吨水药耗") |
364 | @ApiOperation(value = "各子公司吨水药耗", notes = "各子公司吨水药耗") | 337 | @ApiOperation(value = "各子公司吨水药耗", notes = "各子公司吨水药耗") |
365 | @PostMapping(value = "/getFactoryYH") | 338 | @PostMapping(value = "/getFactoryYH") |
366 | public Result getFactoryYH(@RequestBody JSONObject jsonObject, | 339 | public Result getFactoryYH(@RequestBody JSONObject jsonObject) { |
367 | HttpServletRequest req) { | ||
368 | |||
369 | Result result = new Result(); | 340 | Result result = new Result(); |
370 | |||
371 | //将jsonObject转sysAlgorithmStatisticsLibraryVO对象 | 341 | //将jsonObject转sysAlgorithmStatisticsLibraryVO对象 |
372 | SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class); | 342 | SysAlgorithmStatisticsLibraryVO sysAlgorithmStatisticsLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class); |
373 | QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); | 343 | QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); |
... | @@ -433,50 +403,39 @@ public class ScreenDataController { | ... | @@ -433,50 +403,39 @@ public class ScreenDataController { |
433 | newVo.setUnit(unit); | 403 | newVo.setUnit(unit); |
434 | number.put(replace, newVo); | 404 | number.put(replace, newVo); |
435 | } | 405 | } |
436 | |||
437 | } | 406 | } |
438 | resultMap.put("number", number); | 407 | resultMap.put("number", number); |
439 | resultList.add(resultMap); | 408 | resultList.add(resultMap); |
440 | } | 409 | } |
441 | |||
442 | |||
443 | result.setResult(resultList); | 410 | result.setResult(resultList); |
444 | |||
445 | |||
446 | } catch (Exception e) { | 411 | } catch (Exception e) { |
447 | e.printStackTrace(); | 412 | e.printStackTrace(); |
448 | } | 413 | } |
449 | |||
450 | return result; | 414 | return result; |
451 | } | 415 | } |
452 | 416 | ||
453 | 417 | ||
454 | /** | 418 | /** |
455 | * @param departId | 419 | * @param departId |
456 | * @param req | ||
457 | * @return | 420 | * @return |
458 | */ | 421 | */ |
459 | @AutoLog(value = "数字指挥中心-运行负荷率分析") | 422 | @AutoLog(value = "数字指挥中心-运行负荷率分析") |
460 | @ApiOperation(value = "数字指挥中心-运行负荷率分析", notes = "数字指挥中心-运行负荷率分析") | 423 | @ApiOperation(value = "数字指挥中心-运行负荷率分析", notes = "数字指挥中心-运行负荷率分析") |
461 | @GetMapping(value = "/factoryFhl") | 424 | @GetMapping(value = "/factoryFhl") |
462 | public Result<Map<String, Object>> factoryFhl(String departId, String month, | 425 | public Result<Map<String, Object>> factoryFhl(String departId, String month) { |
463 | HttpServletRequest req) { | ||
464 | |||
465 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); | 426 | Result<Map<String, Object>> result = new Result<Map<String, Object>>(); |
466 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 427 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
467 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); | 428 | JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); |
468 | if (org.apache.commons.lang3.StringUtils.isEmpty(departId)) { | 429 | if (ConvertUtils.isEmpty(departId)) { |
469 | departId = BaseContextHandler.getDeparts(); | 430 | departId = BaseContextHandler.getDeparts(); |
470 | QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); | 431 | // QueryWrapper<SysDepart> sysDepartQueryWrapper = new QueryWrapper<>(); |
471 | sysDepartQueryWrapper.eq("del_flag", 1).eq("depart_type", 1).in("id", Lists.newArrayList(departId.split(","))) | 432 | // sysDepartQueryWrapper.eq("del_flag", 1).eq("depart_type", 1).in("id", Lists.newArrayList(departId.split(","))) |
472 | .select("id,depart_name"); | 433 | // .select("id,depart_name"); |
473 | List<Map<String, Object>> departMapList = sysDepartService.listMaps(sysDepartQueryWrapper); | 434 | // List<Map<String, Object>> departMapList = sysDepartService.listMaps(sysDepartQueryWrapper); |
474 | departId = departMapList.stream().map(map -> | 435 | // departId = departMapList.stream().map(map -> |
475 | String.valueOf(map.get("id")) | 436 | // String.valueOf(map.get("id")) |
476 | ).collect(Collectors.joining(",")); | 437 | // ).collect(Collectors.joining(",")); |
477 | } | 438 | } |
478 | String thisMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); | ||
479 | String startDate = DateUtils.getTodayOrMonthDate("day") + " 00:00:00"; | ||
480 | List<Map<String, Object>> fhlMaps = screenDataService.beforeTodayAvgFhl(departId, month, masterDB); | 439 | List<Map<String, Object>> fhlMaps = screenDataService.beforeTodayAvgFhl(departId, month, masterDB); |
481 | //如果是当月,处理水量加上当天小时数据和实时数据 | 440 | //如果是当月,处理水量加上当天小时数据和实时数据 |
482 | if (!CollectionUtil.isEmpty(fhlMaps)) { | 441 | if (!CollectionUtil.isEmpty(fhlMaps)) { |
... | ... |
... | @@ -43,7 +43,6 @@ public class InspectionPlanController { | ... | @@ -43,7 +43,6 @@ public class InspectionPlanController { |
43 | * @param inspectionPlan 巡检计划对象 | 43 | * @param inspectionPlan 巡检计划对象 |
44 | * @param pageNo 页码 | 44 | * @param pageNo 页码 |
45 | * @param pageSize 每页大小 | 45 | * @param pageSize 每页大小 |
46 | * @param req | ||
47 | * @author Xie Chao,2021-08-11 13:56 | 46 | * @author Xie Chao,2021-08-11 13:56 |
48 | */ | 47 | */ |
49 | @AutoLog(value = "巡检计划-分页列表查询") | 48 | @AutoLog(value = "巡检计划-分页列表查询") |
... | @@ -51,14 +50,11 @@ public class InspectionPlanController { | ... | @@ -51,14 +50,11 @@ public class InspectionPlanController { |
51 | @GetMapping(value = "/list") | 50 | @GetMapping(value = "/list") |
52 | public Result<IPage<InspectionPlan>> queryPageList(InspectionPlan inspectionPlan, | 51 | public Result<IPage<InspectionPlan>> queryPageList(InspectionPlan inspectionPlan, |
53 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 52 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
54 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 53 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
55 | HttpServletRequest req) { | ||
56 | Result<IPage<InspectionPlan>> result = new Result<>(); | 54 | Result<IPage<InspectionPlan>> result = new Result<>(); |
57 | try { | 55 | try { |
58 | inspectionPlan.setDelFlag(0); | ||
59 | QueryWrapper<InspectionPlan> queryWrapper = QueryGenerator.initQueryWrapper(inspectionPlan, req.getParameterMap()); | ||
60 | Page<InspectionPlan> page = new Page<>(pageNo, pageSize); | 56 | Page<InspectionPlan> page = new Page<>(pageNo, pageSize); |
61 | IPage<InspectionPlan> pageList = inspectionPlanService.page(page, queryWrapper); | 57 | IPage<InspectionPlan> pageList = inspectionPlanService.getPage(page, inspectionPlan); |
62 | result.setSuccess(true); | 58 | result.setSuccess(true); |
63 | result.setResult(pageList); | 59 | result.setResult(pageList); |
64 | } catch (Exception e) { | 60 | } catch (Exception e) { |
... | ... |
... | @@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest; | ... | @@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest; |
22 | import java.text.ParseException; | 22 | import java.text.ParseException; |
23 | import java.text.SimpleDateFormat; | 23 | import java.text.SimpleDateFormat; |
24 | import java.util.*; | 24 | import java.util.*; |
25 | import java.util.stream.Collectors; | ||
25 | 26 | ||
26 | /** | 27 | /** |
27 | * <pre> | 28 | * <pre> |
... | @@ -64,7 +65,30 @@ public class InspectionTaskController { | ... | @@ -64,7 +65,30 @@ public class InspectionTaskController { |
64 | inspectionTaskVO.setEndTime(inspectionTaskVO.getEndTime() + " 23:59:59"); | 65 | inspectionTaskVO.setEndTime(inspectionTaskVO.getEndTime() + " 23:59:59"); |
65 | } | 66 | } |
66 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); | 67 | Page<InspectionTask> page = new Page<>(pageNo, pageSize); |
68 | QueryWrapper isExceptionQueryWrapper = new QueryWrapper(); | ||
69 | isExceptionQueryWrapper.eq("itdtfc.choice_state","0"); | ||
70 | isExceptionQueryWrapper.groupBy("itfc.inspection_task_id"); | ||
71 | List<String> isExceptionInspectionTaskIdList = inspectionTaskService.getIsExceptionInspectionTask(isExceptionQueryWrapper); | ||
67 | IPage<InspectionTask> pageList = inspectionTaskService.getPage(page, inspectionTaskVO); | 72 | IPage<InspectionTask> pageList = inspectionTaskService.getPage(page, inspectionTaskVO); |
73 | List<InspectionTask> inspectionTaskList = pageList.getRecords(); | ||
74 | List<String> inspectionTaskIdList = inspectionTaskList.stream().map(InspectionTask::getId).collect(Collectors.toList()); | ||
75 | if (inspectionTaskIdList.size() == 0){ | ||
76 | result.setSuccess(true); | ||
77 | result.setResult(pageList); | ||
78 | return result; | ||
79 | } | ||
80 | if (StringUtils.isBlank(inspectionTaskVO.getIsException())) { | ||
81 | isExceptionQueryWrapper.in("itfc.inspection_task_id", inspectionTaskIdList); | ||
82 | isExceptionInspectionTaskIdList = inspectionTaskService.getIsExceptionInspectionTask(isExceptionQueryWrapper); | ||
83 | } | ||
84 | for (InspectionTask inspectionTask : inspectionTaskList) { | ||
85 | if (isExceptionInspectionTaskIdList.contains(inspectionTask.getId())){ | ||
86 | inspectionTask.setIsException("true"); | ||
87 | }else{ | ||
88 | inspectionTask.setIsException("false"); | ||
89 | } | ||
90 | } | ||
91 | pageList.setRecords(inspectionTaskList); | ||
68 | result.setSuccess(true); | 92 | result.setSuccess(true); |
69 | result.setResult(pageList); | 93 | result.setResult(pageList); |
70 | return result; | 94 | return result; |
... | @@ -72,6 +96,32 @@ public class InspectionTaskController { | ... | @@ -72,6 +96,32 @@ public class InspectionTaskController { |
72 | 96 | ||
73 | /** | 97 | /** |
74 | * <pre> | 98 | * <pre> |
99 | * 实体字段翻译为数据库表字段 | ||
100 | * </pre> | ||
101 | * @param entityField | ||
102 | * @return | ||
103 | * @author Li Yuanyuan, 2024年3月27日 下午5:57:18 | ||
104 | * @Description: TODO(这里描述这个方法的需求变更情况) | ||
105 | */ | ||
106 | private String getDatabaseFieldToEntity(String entityField) { | ||
107 | String dataBaseField = ""; | ||
108 | if("inspectionCycleStartDate".equals(entityField)) { | ||
109 | dataBaseField = "inspection_cycle_start_date"; | ||
110 | } | ||
111 | if("taskStartTime".equals(entityField)) { | ||
112 | dataBaseField = "task_start_time"; | ||
113 | } | ||
114 | if("taskEndTime".equals(entityField)) { | ||
115 | dataBaseField = "task_end_time"; | ||
116 | } | ||
117 | if("taskState".equals(entityField)) { | ||
118 | dataBaseField = "task_state"; | ||
119 | } | ||
120 | return dataBaseField; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <pre> | ||
75 | * 通过巡检任务id删除对象 | 125 | * 通过巡检任务id删除对象 |
76 | * </pre> | 126 | * </pre> |
77 | * | 127 | * |
... | ... |
1 | package com.skua.modules.inspection.entity; | 1 | package com.skua.modules.inspection.entity; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.annotation.IdType; | 3 | import com.baomidou.mybatisplus.annotation.IdType; |
4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
4 | import com.baomidou.mybatisplus.annotation.TableId; | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
5 | import com.baomidou.mybatisplus.annotation.TableName; | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
6 | import com.skua.core.aspect.annotation.Dict; | 7 | import com.skua.core.aspect.annotation.Dict; |
... | @@ -112,4 +113,8 @@ public class InspectionPlan { | ... | @@ -112,4 +113,8 @@ public class InspectionPlan { |
112 | @ApiModelProperty(value = "计划任务类型") | 113 | @ApiModelProperty(value = "计划任务类型") |
113 | @Dict(dicCode = "inspection_plan_type") | 114 | @Dict(dicCode = "inspection_plan_type") |
114 | private String inspectionPlanType; | 115 | private String inspectionPlanType; |
116 | |||
117 | /**关联设备数量*/ | ||
118 | @TableField(exist = false) | ||
119 | private String equipCount; | ||
115 | } | 120 | } |
... | ... |
... | @@ -151,8 +151,12 @@ public class InspectionTask { | ... | @@ -151,8 +151,12 @@ public class InspectionTask { |
151 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") | 151 | @ApiModelProperty(value = "删除标识(0:删除,1:有效)") |
152 | private String delFlag; | 152 | private String delFlag; |
153 | 153 | ||
154 | /**巡检类型:设备、工艺、其他*/ | ||
154 | @TableField(exist=false) | 155 | @TableField(exist=false) |
155 | @Dict(dicCode = "inspection_plan_type") | 156 | @Dict(dicCode = "inspection_plan_type") |
156 | private String inspectionPlanType; | 157 | private String inspectionPlanType; |
157 | 158 | ||
159 | /**是否异常*/ | ||
160 | @TableField(exist = false) | ||
161 | private String isException; | ||
158 | } | 162 | } |
... | ... |
... | @@ -22,7 +22,7 @@ import java.util.Date; | ... | @@ -22,7 +22,7 @@ import java.util.Date; |
22 | //@Accessors(chain = true) | 22 | //@Accessors(chain = true) |
23 | @ApiModel(value="inspection_task_point对象", description="巡检任务-巡检点") | 23 | @ApiModel(value="inspection_task_point对象", description="巡检任务-巡检点") |
24 | public class InspectionTaskPoint { | 24 | public class InspectionTaskPoint { |
25 | 25 | ||
26 | /**主键*/ | 26 | /**主键*/ |
27 | @TableId(type = IdType.ID_WORKER_STR) | 27 | @TableId(type = IdType.ID_WORKER_STR) |
28 | @ApiModelProperty(value = "主键") | 28 | @ApiModelProperty(value = "主键") |
... | @@ -103,4 +103,13 @@ public class InspectionTaskPoint { | ... | @@ -103,4 +103,13 @@ public class InspectionTaskPoint { |
103 | @Excel(name = "排序", width = 15) | 103 | @Excel(name = "排序", width = 15) |
104 | @ApiModelProperty(value = "排序") | 104 | @ApiModelProperty(value = "排序") |
105 | private String sort; | 105 | private String sort; |
106 | |||
107 | /**巡检点状态(0:未运行,1启用,2维修中)*/ | ||
108 | private String pointStatus; | ||
109 | /**打卡时间*/ | ||
110 | @Excel(name = "打卡时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
111 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
112 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
113 | @ApiModelProperty(value = "打卡时间") | ||
114 | private Date clockStatusTime; | ||
106 | } | 115 | } |
... | ... |
... | @@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ... | @@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
11 | */ | 11 | */ |
12 | public interface InspectionPlanMapper extends BaseMapper<InspectionPlan> { | 12 | public interface InspectionPlanMapper extends BaseMapper<InspectionPlan> { |
13 | 13 | ||
14 | List<InspectionPlan> getPage(@Param("departId") String departId, @Param("planName") String planName, @Param("inspectionPlanType") String inspectionPlanType); | ||
14 | } | 15 | } |
... | ... |
... | @@ -34,4 +34,14 @@ public interface InspectionTaskMapper extends BaseMapper<InspectionTask> { | ... | @@ -34,4 +34,14 @@ public interface InspectionTaskMapper extends BaseMapper<InspectionTask> { |
34 | Map<String, Object> getEquipmentInfo(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); | 34 | Map<String, Object> getEquipmentInfo(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); |
35 | 35 | ||
36 | List<InspectionTask> getList(@Param("inspectionTaskVO") InspectionTaskVO inspectionTaskVO); | 36 | List<InspectionTask> getList(@Param("inspectionTaskVO") InspectionTaskVO inspectionTaskVO); |
37 | |||
38 | @Select("SELECT" + | ||
39 | " itfc.inspection_task_id as inspectionTaskId " + | ||
40 | " FROM " + | ||
41 | " inspection_task_fill_content itfc " + | ||
42 | " LEFT JOIN inspection_task_fill_choice itdtfc ON itdtfc.id = itfc.fill_content " + | ||
43 | " AND itdtfc.inspection_fill_id = itfc.inspection_fill_id " + | ||
44 | " AND itdtfc.inspection_task_id = itfc.inspection_task_id " + | ||
45 | " ${ew.customSqlSegment}") | ||
46 | List<Map<String, Object>> getIsExceptionInspectionTask(@Param(Constants.WRAPPER)QueryWrapper queryWrapper); | ||
37 | } | 47 | } |
... | ... |
... | @@ -2,4 +2,19 @@ | ... | @@ -2,4 +2,19 @@ |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.inspection.mapper.InspectionPlanMapper"> | 3 | <mapper namespace="com.skua.modules.inspection.mapper.InspectionPlanMapper"> |
4 | 4 | ||
5 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
5 | <select id="getPage" resultType="com.skua.modules.inspection.entity.InspectionPlan"> | ||
6 | select * from inspection_plan p | ||
7 | where p.del_flag = '0' | ||
8 | <if test="departId!=null and departId!=''"> | ||
9 | AND p.depart_id = #{departId} | ||
10 | </if> | ||
11 | <if test="planName!=null and planName!=''"> | ||
12 | AND p.plan_name like CONCAT('%',#{planName},'%') | ||
13 | </if> | ||
14 | <if test="inspectionPlanType!=null and inspectionPlanType!=''"> | ||
15 | AND p.inspection_plan_type = #{inspectionPlanType} | ||
16 | </if> | ||
17 | order by p.create_time desc | ||
18 | </select> | ||
19 | |||
20 | </mapper> | ||
... | ... |
1 | package com.skua.modules.inspection.service; | 1 | package com.skua.modules.inspection.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.inspection.entity.InspectionPlan; | 5 | import com.skua.modules.inspection.entity.InspectionPlan; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 6 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.inspection.vo.InspectionPlanVO; | 7 | import com.skua.modules.inspection.vo.InspectionPlanVO; |
... | @@ -18,4 +20,6 @@ public interface IInspectionPlanService extends IService<InspectionPlan> { | ... | @@ -18,4 +20,6 @@ public interface IInspectionPlanService extends IService<InspectionPlan> { |
18 | Map<String,Object> getInspectionPlanById(String planId); | 20 | Map<String,Object> getInspectionPlanById(String planId); |
19 | 21 | ||
20 | Map<String,Object> checkEditInspectionPlan(String planId,String planStartDate,String planTaskStartTime); | 22 | Map<String,Object> checkEditInspectionPlan(String planId,String planStartDate,String planTaskStartTime); |
23 | |||
24 | IPage<InspectionPlan> getPage(Page<InspectionPlan> page, InspectionPlan inspectionPlan); | ||
21 | } | 25 | } |
... | ... |
... | @@ -17,7 +17,7 @@ public interface IInspectionTaskFillContentService extends IService<InspectionTa | ... | @@ -17,7 +17,7 @@ public interface IInspectionTaskFillContentService extends IService<InspectionTa |
17 | 17 | ||
18 | List<Map<String, Object>> getInspectionPointHistoryByTaskId(String taskId); | 18 | List<Map<String, Object>> getInspectionPointHistoryByTaskId(String taskId); |
19 | 19 | ||
20 | List<Map<String, Object>> getInspectionHistoryFillGroupByInspectionPointId(String taskId, String inspectionPointId); | 20 | Map<String,List<Map<String, Object>>> getInspectionHistoryFillGroupByInspectionPointId(String taskId, String inspectionPointId); |
21 | 21 | ||
22 | List<Map<String, Object>> getInspectionHistoryByTaskId(String taskId); | 22 | List<Map<String, Object>> getInspectionHistoryByTaskId(String taskId); |
23 | 23 | ||
... | ... |
... | @@ -39,4 +39,6 @@ public interface IInspectionTaskService extends IService<InspectionTask> { | ... | @@ -39,4 +39,6 @@ public interface IInspectionTaskService extends IService<InspectionTask> { |
39 | boolean checkInspectionTriggerEquipQr(String equipmentInfoId, String code); | 39 | boolean checkInspectionTriggerEquipQr(String equipmentInfoId, String code); |
40 | 40 | ||
41 | IPage<InspectionTask> getPage(Page<InspectionTask> page, InspectionTaskVO inspectionTaskVO); | 41 | IPage<InspectionTask> getPage(Page<InspectionTask> page, InspectionTaskVO inspectionTaskVO); |
42 | |||
43 | List<String> getIsExceptionInspectionTask(QueryWrapper isExceptionQueryWrapper); | ||
42 | } | 44 | } |
... | ... |
... | @@ -2,6 +2,7 @@ package com.skua.modules.inspection.service.impl; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.inspection.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | import com.skua.core.util.ConvertUtils; | 8 | import com.skua.core.util.ConvertUtils; |
... | @@ -155,4 +156,12 @@ public class InspectionPlanServiceImpl extends ServiceImpl<InspectionPlanMapper, | ... | @@ -155,4 +156,12 @@ public class InspectionPlanServiceImpl extends ServiceImpl<InspectionPlanMapper, |
155 | } | 156 | } |
156 | return resultMap; | 157 | return resultMap; |
157 | } | 158 | } |
159 | |||
160 | @Override | ||
161 | public IPage<InspectionPlan> getPage(Page<InspectionPlan> page, InspectionPlan inspectionPlan) { | ||
162 | List<InspectionPlan> list = baseMapper.getPage(inspectionPlan.getDepartId(),inspectionPlan.getPlanName(),inspectionPlan.getInspectionPlanType()); | ||
163 | page.setRecords(list); | ||
164 | page.setTotal(list.size()); | ||
165 | return page; | ||
166 | } | ||
158 | } | 167 | } |
... | ... |
此文件的差异被折叠,
点击展开。
... | @@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional; | ... | @@ -33,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional; |
33 | import java.text.ParseException; | 33 | import java.text.ParseException; |
34 | import java.text.SimpleDateFormat; | 34 | import java.text.SimpleDateFormat; |
35 | import java.util.*; | 35 | import java.util.*; |
36 | import java.util.stream.Collectors; | ||
36 | 37 | ||
37 | import static org.apache.commons.beanutils.BeanUtils.populate; | 38 | import static org.apache.commons.beanutils.BeanUtils.populate; |
38 | 39 | ||
... | @@ -797,6 +798,13 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, | ... | @@ -797,6 +798,13 @@ public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, |
797 | return page; | 798 | return page; |
798 | } | 799 | } |
799 | 800 | ||
801 | @Override | ||
802 | public List<String> getIsExceptionInspectionTask(QueryWrapper queryWrapper) { | ||
803 | List<Map<String,Object>> isExceptionInspectionTaskMap = this.baseMapper.getIsExceptionInspectionTask(queryWrapper); | ||
804 | List<String> inspectionTaskIdList = isExceptionInspectionTaskMap.stream().map(map -> com.skua.core.util.ConvertUtils.getString(map.get("inspectionTaskId"))).collect(Collectors.toList()); | ||
805 | return inspectionTaskIdList; | ||
806 | } | ||
807 | |||
800 | public List<Map<String, Object>> correctionInspectionTrack(List<Map<String, Object>> pointList) throws Exception { | 808 | public List<Map<String, Object>> correctionInspectionTrack(List<Map<String, Object>> pointList) throws Exception { |
801 | List<Map<String, Object>> resultList; | 809 | List<Map<String, Object>> resultList; |
802 | String url = "http://api.map.baidu.com/rectify/v1/track"; | 810 | String url = "http://api.map.baidu.com/rectify/v1/track"; |
... | ... |
... | @@ -75,7 +75,7 @@ public class MybatisInterceptor implements Interceptor { | ... | @@ -75,7 +75,7 @@ public class MybatisInterceptor implements Interceptor { |
75 | add("ajh_supplier_manage"); | 75 | add("ajh_supplier_manage"); |
76 | add("ajh_meeting_attend"); | 76 | add("ajh_meeting_attend"); |
77 | add("equipment_sparepart_supplies_allot"); | 77 | add("equipment_sparepart_supplies_allot"); |
78 | // add("ajh_rectification_info"); | 78 | add("alarm_custom_rule_repository"); |
79 | add("alarm_rule_config_public_templete");//放行报警配置公共模板表 | 79 | add("alarm_rule_config_public_templete");//放行报警配置公共模板表 |
80 | //算法库相关表过滤权限 | 80 | //算法库相关表过滤权限 |
81 | add("sys_algorithm_database_info"); | 81 | add("sys_algorithm_database_info"); |
... | ... |
-
请 注册 或 登录 后发表评论