diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java index 326fb58..7943bcb 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java @@ -34,6 +34,9 @@ public class RealStationVo implements Serializable { @ApiModelProperty("最大前池水位") private Double waterLevelMax; + @ApiModelProperty("下限前池水位") + private Double downWaterLevel; + @ApiModelProperty("前池水位") private Double waterLevel; diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java index 97c666c..387b8a5 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java @@ -32,8 +32,4 @@ public class CarCheckTemplateDetailEntity extends BaseEntity { @NotNull @ApiModelProperty("检查内容") private String checkContent; - - @NotNull - @ApiModelProperty("检查结果") - private String checkResult; } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java index 15e3cf7..bdaa7dd 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java @@ -58,7 +58,7 @@ public class MonitorScheduledTask { * @return ReturnT */ @XxlJob(CENTRALIZED_MONITORING) - //@Scheduled(cron = "0/40 * * * * ? ") + // @Scheduled(cron = "0/40 * * * * ? ") public ReturnT loadMonitoring(String param) { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java index 69c643c..6c811ef 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java @@ -27,7 +27,6 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.mqtt.producer.IMqttSender; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -55,7 +54,7 @@ public class AlarmServiceImpl implements AlarmService { private final RedisTemplate redisTemplate; - private final IMqttSender mqttSender; + //private final IMqttSender mqttSender; private final static String start_stop_cache_final = "hzims:operation:start:stop:key"; private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key"; @@ -277,7 +276,7 @@ public class AlarmServiceImpl implements AlarmService { alarm.setContext(entity.getStationName() + "." + entity.getSoeExplain()); alarm.setState(entity.getStatus()); log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm)); - mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm)); + //mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm)); }); } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java index 13b41ce..0547edb 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java @@ -500,6 +500,7 @@ public class MonitorServiceImpl implements MonitorService { } realStation.setStationCode(optional.get().getCode()); realStation.setStationName(optional.get().getName()); + realStation.setDownWaterLevel(Optional.ofNullable(optional.get().getDownWaterLevel()).orElse(0.0)); realStation.setWaterLevelMax(Optional.ofNullable(optional.get().getLimitWaterLevel()).orElse(0.0)); realStation.setServerType(optional.get().getServeType()); realStation.setStationDeptId(optional.get().getRefDept()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java index 7e38882..bda8eed 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java @@ -258,7 +258,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService { if(ObjectUtil.isEmpty(o.getSort())){ o.setSort(999); } - }).sorted(Comparator.comparing((RealStationVo::getSort))).collect(Collectors.toList()))); + }).sorted(Comparator.comparing((RealStationVo::getSort)).thenComparing(RealStationVo::getStationName)).collect(Collectors.toList()))); } /** @@ -326,7 +326,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService { * @param station */ private void waterLevel(List list, RealStationVo station) { - station.setWaterLevel(0.0); + Random random = new Random(); + station.setWaterLevel(random.nextDouble() * 10); station.setWaterColor(0); if(CollectionUtil.isEmpty(list)){ return; @@ -336,12 +337,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService { return; } station.setWaterLevel(levelList.get(0)); - if(ObjectUtil.isEmpty(station.getWaterLevelMax()) || ObjectUtil.isEmpty(station.getWaterLevel()) || station.getWaterLevelMax() <= 0 || station.getWaterLevel() <= 0){ + if(station.getWaterLevel() <= 0){ return; } - if(station.getWaterLevelMax() < station.getWaterLevel()){ + if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){ station.setWaterColor(2); - }else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.8){ + }else if((station.getWaterLevelMax() > 0 && (station.getWaterLevel() / station.getWaterLevelMax()) > 0.8) || (station.getDownWaterLevel() > 0 && (station.getWaterLevel() / station.getDownWaterLevel()) < 1.2)){ station.setWaterColor(1); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java index 8290da9..1c4de51 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java @@ -230,4 +230,19 @@ public class HygieneController extends BladeController { IPage page = hygieneTemplateService.getHygieneTemplatePage(param, query); return R.data(page); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "hygienePlanStatus", value = "卫生计划状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "卫生月度详情列表") + @ApiOperationSupport(order = 20) + @Operate(label = "卫生月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = hygienePlanService.getDetailListByMonth(param, query); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 14cdc89..08d28ce 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -82,8 +82,7 @@ public class RehearsalController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "rehearsalStatus", value = "演练状态", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "演练计划分页") @ApiOperationSupport(order = 5) @@ -178,4 +177,19 @@ public class RehearsalController extends BladeController { public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) { rehearsalRecordService.exportRehearsalRecordData(id, response); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "rehearsalStatus", value = "演练状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "演练月度详情列表") + @ApiOperationSupport(order = 15) + @Operate(label = "演练月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = rehearsalPlanService.getDetailListByMonth(query, param); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index 7eda44c..ef252f9 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -91,8 +91,7 @@ public class TrainController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "trainStatus", value = "培训计划状态", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "培训计划分页") @ApiOperationSupport(order = 5) @@ -276,4 +275,19 @@ public class TrainController extends BladeController { public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) { trainRecordService.exportTrainRecordData(id, response); } + + @GetMapping("/detailListByMonth") + @ApiImplicitParams({ + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "trainStatus", value = "培训计划状态", dataType = "query", paramType = "string") + }) + @ApiOperation(value = "培训月度详情列表") + @ApiOperationSupport(order = 24) + @Operate(label = "培训月度详情列表", type = BusinessType.QUERY, ignore = false) + public R> detailListByMonth(@ApiIgnore @RequestParam Map param, Query query) { + IPage page = trainPlanService.getDetailListByMonth(param, query); + return R.data(page); + } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml index 83f2b3b..cf3e0ba 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml @@ -6,11 +6,11 @@ SELECT * FROM - car_check_template_detail + hzims_car_check_template WHERE is_deleted = 0 - AND template_name like concate('%', #{param.templateName}, '%') + AND template_name like concat('%', #{param.templateName}, '%') ORDER BY create_time DESC diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml index cdb1378..c4edda8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml @@ -9,7 +9,7 @@ WHERE is_deleted = 0 - AND template_name like concate('%', #{param.templateName}, '%') + AND template_name like concat('%', #{param.templateName}, '%') ORDER BY create_time DESC diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml index 19ef188..45cc431 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml @@ -81,14 +81,11 @@ AND unit like concat('%', #{param.unit}, '%') - - AND scheduled_start_time >= #{param.startTime} + + AND scheduled_start_time >= #{param.scheduledStartTime} - - AND scheduled_end_time <= #{param.endTime} - - - AND train_status = #{param.trainStatus} + + AND scheduled_end_time <= #{param.scheduledEndTime} ORDER BY create_time DESC diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java index a564531..484cfcf 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java @@ -92,4 +92,12 @@ public interface IHygienePlanService extends IService { * @param response 响应类 */ void exportHygienePlanData(Map param, HttpServletResponse response); + + /** + * 查询卫生月度详情列表 + * @param param 参数 + * @param query 分页类 + * @return 月度详情列表 + */ + IPage getDetailListByMonth(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java index d679fc0..7745227 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java @@ -66,4 +66,12 @@ public interface IRehearsalPlanService extends IService { * @return 演练计划数据 */ IPage rehearsalPlanPage(Map param, Query query); + + /** + * 查询月度详情列表 + * @param query 分页类 + * @param param 参数 + * @return 详情列表 + */ + IPage getDetailListByMonth(Query query, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java index 75e86ed..1aa7ad7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java @@ -66,4 +66,12 @@ public interface ITrainPlanService extends IService { * @return 培训计划数据 */ IPage trainPlanPage(Map param, Query query); + + /** + * 查询培训月度详情列表 + * @param param 参数 + * @param query 分页类 + * @return 月度详情列表 + */ + IPage getDetailListByMonth(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java index 69ae394..2ddad1b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java @@ -106,19 +106,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckItemService.getListByCarCheckRecordId(id); - List checkItemList = new ArrayList<>(); - itemList.forEach(item -> { - String[] contents = item.getCheckContent().split(",|,"); - String[] results = item.getCheckResult().split(",|,"); - for (int i = 0; i < contents.length; i++) { - CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); - carCheckItemEntity.setCheckItem(item.getCheckItem()); - carCheckItemEntity.setCheckContent(contents[i]); - carCheckItemEntity.setCheckResult(results[i]); - checkItemList.add(carCheckItemEntity); - } - }); - carCheckRecordDetailVO.setCheckItemList(checkItemList); + carCheckRecordDetailVO.setCheckItemList(itemList); return carCheckRecordDetailVO; } return null; @@ -187,7 +175,6 @@ public class CarCheckRecordServiceImpl extends ServiceImpl itemList = carCheckRecordDTO.getItemList(); itemList.forEach(x -> { x.setCarCheckRecordId(carCheckRecordDTO.getId()); -// x.setId(null); }); return carCheckItemService.saveBatch(itemList); } @@ -212,6 +199,21 @@ public class CarCheckRecordServiceImpl extends ServiceImpl checkList = carCheckRecordDetailVO.getCheckItemList(); + List res = new ArrayList<>(); + checkList.forEach(item -> { + String[] checkContent = item.getCheckContent().split(","); + String[] checkResult = item.getCheckResult().split(","); + for (int i = 0; i < checkContent.length; i++) { + CarCheckItemEntity carCheckItemEntity = new CarCheckItemEntity(); + carCheckItemEntity.setCheckItem(item.getCheckItem()); + carCheckItemEntity.setCheckContent(checkContent[i]); + carCheckItemEntity.setCheckResult(checkResult[i]); + res.add(carCheckItemEntity); + } + }); + carCheckRecordDetailVO.setCheckItemList(res); // 表头年月 String code = carCheckRecordDetailVO.getCode(); carCheckRecordDetailVO.setYear(code.substring(4, 8)); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java index d0d3b88..ea4d1a0 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java @@ -371,6 +371,39 @@ public class HygienePlanServiceImpl extends ServiceImpl getDetailListByMonth(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String hygieneStatus = String.valueOf(param.get("hygienePlanStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(HygienePlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(HygienePlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(HygienePlanEntity::getScheduledEndTime, endTime); + } + if (!hygieneStatus.equals("null") && !hygieneStatus.equals("")) { + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (hygieneStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.UNFINISHED.getValue()) + .or() + .eq(HygienePlanEntity::getHygienePlanStatus, HygieneStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(HygienePlanEntity::getHygienePlanStatus, hygieneStatus); + } + } + queryWrapper.lambda().orderByDesc(HygienePlanEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 根据单位、名称、时间查询卫生自查计划 * @param unit 单位 * @param name 名称 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index 9cd63ef..08c858e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -276,7 +276,6 @@ public class RehearsalPlanServiceImpl extends ServiceImpl getDetailListByMonth(Query query, Map param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String rehearsalStatus = String.valueOf(param.get("rehearsalStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); + } if (!rehearsalStatus.equals("null") && !rehearsalStatus.equals("")) { - queryWrapper.lambda().eq(RehearsalPlanEntity::getRehearsalStatus, rehearsalStatus); + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (rehearsalStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.UNFINISHED.getValue()) + .or() + .eq(RehearsalPlanEntity::getRehearsalStatus, RehearsalStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(RehearsalPlanEntity::getRehearsalStatus, rehearsalStatus); + } } queryWrapper.lambda().orderByDesc(RehearsalPlanEntity::getCreateTime); return this.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 3f3af95..40fb225 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -268,6 +269,39 @@ public class TrainPlanServiceImpl extends ServiceImpl getDetailListByMonth(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String unit = String.valueOf(param.get("unit")); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf(param.get("scheduledEndTime")); + String trainStatus = String.valueOf(param.get("trainStatus")); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(TrainPlanEntity::getUnit, unit); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(TrainPlanEntity::getScheduledEndTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(TrainPlanEntity::getScheduledEndTime, endTime); + } + if (!trainStatus.equals("null") && !trainStatus.equals("")) { + // 未完成计划包括UNFINISHED和WAITING两种状态 + if (trainStatus.equals("UNFINISHED+WAITING")) { + queryWrapper.lambda().and(wrapper -> wrapper.eq(TrainPlanEntity::getTrainStatus, TrainStatusEnum.UNFINISHED.getValue()) + .or() + .eq(TrainPlanEntity::getTrainStatus, TrainStatusEnum.WAITING.getValue())); + } else { + queryWrapper.lambda().eq(TrainPlanEntity::getTrainStatus, trainStatus); + } + } + queryWrapper.lambda().orderByDesc(TrainPlanEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 根据单位和计划时间查询培训计划数据 * @param unit 单位 * @param startTime 计划开始时间 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java index 76aada7..c80b1ba 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java @@ -147,6 +147,9 @@ public class BaseUtil { if (templatePath.equals("template/卫生自查表.docx")) { formatHygieneRecordTable(xwpfDocument); } + if (templatePath.equals("template/车辆检查表.docx")) { + formatCarCheckRecordTable(xwpfDocument); + } } catch (Exception e) { e.printStackTrace(); } diff --git a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql index 733ffca..4c2497b 100644 --- a/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql +++ b/hzims-service/safeproduct/src/main/resources/db/2.0.1.sql @@ -49,7 +49,7 @@ ALTER TABLE hzims_test ADD COLUMN passing_score int(10) NOT NULL DEFAULT 60 COMMENT '考试及格分'; -- 新增车检模板表 -CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` ( +CREATE TABLE IF NOT EXISTS `hzims_car_check_template` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_name` varchar(50) NOT NULL COMMENT '模板名称', `create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人', @@ -60,10 +60,10 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template` ( `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', PRIMARY KEY (`id`) USING BTREE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板表'; -- 新增车检模板详情表 -CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` ( +CREATE TABLE IF NOT EXISTS `hzims_car_check_template_detail` ( `id` bigint(20) NOT NULL COMMENT '主键ID', `template_id` bigint(20) NOT NULL COMMENT '模板id', `check_item` varchar(500) NOT NULL COMMENT '检查项目', @@ -76,4 +76,4 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` ( `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', PRIMARY KEY (`id`) USING BTREE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表'; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表'; \ No newline at end of file