Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 6 months ago
parent
commit
0f87d17a7d
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  2. 4
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java
  3. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  4. 5
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  5. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  6. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  7. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  8. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  9. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  10. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml
  11. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml
  12. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml
  13. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  14. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java
  15. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java
  16. 30
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  17. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  18. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java
  19. 34
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java
  20. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  21. 8
      hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

3
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("最大前池水位") @ApiModelProperty("最大前池水位")
private Double waterLevelMax; private Double waterLevelMax;
@ApiModelProperty("下限前池水位")
private Double downWaterLevel;
@ApiModelProperty("前池水位") @ApiModelProperty("前池水位")
private Double waterLevel; private Double waterLevel;

4
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 @NotNull
@ApiModelProperty("检查内容") @ApiModelProperty("检查内容")
private String checkContent; private String checkContent;
@NotNull
@ApiModelProperty("检查结果")
private String checkResult;
} }

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -58,7 +58,7 @@ public class MonitorScheduledTask {
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(CENTRALIZED_MONITORING) @XxlJob(CENTRALIZED_MONITORING)
//@Scheduled(cron = "0/40 * * * * ? ") // @Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadMonitoring(String param) { public ReturnT<String> loadMonitoring(String param) {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");

5
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.DateUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.mqtt.producer.IMqttSender;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -55,7 +54,7 @@ public class AlarmServiceImpl implements AlarmService {
private final RedisTemplate redisTemplate; 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 start_stop_cache_final = "hzims:operation:start:stop:key";
private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real: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.setContext(entity.getStationName() + "." + entity.getSoeExplain());
alarm.setState(entity.getStatus()); alarm.setState(entity.getStatus());
log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm)); 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));
}); });
} }

1
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.setStationCode(optional.get().getCode());
realStation.setStationName(optional.get().getName()); 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.setWaterLevelMax(Optional.ofNullable(optional.get().getLimitWaterLevel()).orElse(0.0));
realStation.setServerType(optional.get().getServeType()); realStation.setServerType(optional.get().getServeType());
realStation.setStationDeptId(optional.get().getRefDept()); realStation.setStationDeptId(optional.get().getRefDept());

11
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())){ if(ObjectUtil.isEmpty(o.getSort())){
o.setSort(999); 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 * @param station
*/ */
private void waterLevel(List<WaterLevelVo> list, RealStationVo station) { private void waterLevel(List<WaterLevelVo> list, RealStationVo station) {
station.setWaterLevel(0.0); Random random = new Random();
station.setWaterLevel(random.nextDouble() * 10);
station.setWaterColor(0); station.setWaterColor(0);
if(CollectionUtil.isEmpty(list)){ if(CollectionUtil.isEmpty(list)){
return; return;
@ -336,12 +337,12 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
return; return;
} }
station.setWaterLevel(levelList.get(0)); 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; return;
} }
if(station.getWaterLevelMax() < station.getWaterLevel()){ if(station.getWaterLevelMax() < station.getWaterLevel() || station.getDownWaterLevel() > station.getWaterLevel()){
station.setWaterColor(2); 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); station.setWaterColor(1);
} }
} }

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java

@ -230,4 +230,19 @@ public class HygieneController extends BladeController {
IPage<HygieneTemplateEntity> page = hygieneTemplateService.getHygieneTemplatePage(param, query); IPage<HygieneTemplateEntity> page = hygieneTemplateService.getHygieneTemplatePage(param, query);
return R.data(page); 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<IPage<HygienePlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<HygienePlanEntity> page = hygienePlanService.getDetailListByMonth(param, query);
return R.data(page);
}
} }

18
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java

@ -82,8 +82,7 @@ public class RehearsalController extends BladeController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "rehearsalStatus", value = "演练状态", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "演练计划分页") @ApiOperation(value = "演练计划分页")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ -178,4 +177,19 @@ public class RehearsalController extends BladeController {
public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) { public void exportRehearsalRecordData(@RequestParam Long id, HttpServletResponse response) {
rehearsalRecordService.exportRehearsalRecordData(id, 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<IPage<RehearsalPlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<RehearsalPlanEntity> page = rehearsalPlanService.getDetailListByMonth(query, param);
return R.data(page);
}
} }

18
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java

@ -91,8 +91,7 @@ public class TrainController extends BladeController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledStartTime", value = "计划开始时间", dataType = "query", paramType = "string"),
@ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "scheduledEndTime", value = "计划结束时间", dataType = "query", paramType = "string")
@ApiImplicitParam(name = "trainStatus", value = "培训计划状态", dataType = "query", paramType = "string")
}) })
@ApiOperation(value = "培训计划分页") @ApiOperation(value = "培训计划分页")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ -276,4 +275,19 @@ public class TrainController extends BladeController {
public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) { public void exportTrainRecordData(@RequestParam Long id, HttpServletResponse response) {
trainRecordService.exportTrainRecordData(id, 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<IPage<TrainPlanEntity>> detailListByMonth(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<TrainPlanEntity> page = trainPlanService.getDetailListByMonth(param, query);
return R.data(page);
}
} }

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml

@ -6,11 +6,11 @@
SELECT SELECT
* *
FROM FROM
car_check_template_detail hzims_car_check_template
WHERE WHERE
is_deleted = 0 is_deleted = 0
<if test="param.templateName != null and param.templateName != ''"> <if test="param.templateName != null and param.templateName != ''">
AND template_name like concate('%', #{param.templateName}, '%') AND template_name like concat('%', #{param.templateName}, '%')
</if> </if>
ORDER BY ORDER BY
create_time DESC create_time DESC

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml

@ -9,7 +9,7 @@
WHERE WHERE
is_deleted = 0 is_deleted = 0
<if test="param.templateName != null and param.templateName != ''"> <if test="param.templateName != null and param.templateName != ''">
AND template_name like concate('%', #{param.templateName}, '%') AND template_name like concat('%', #{param.templateName}, '%')
</if> </if>
ORDER BY ORDER BY
create_time DESC create_time DESC

11
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml

@ -81,14 +81,11 @@
<if test="param.unit != null and param.unit != ''"> <if test="param.unit != null and param.unit != ''">
AND unit like concat('%', #{param.unit}, '%') AND unit like concat('%', #{param.unit}, '%')
</if> </if>
<if test="param.startTime != null and param.startTime != ''"> <if test="param.scheduledStartTime != null and param.scheduledStartTime != ''">
AND scheduled_start_time >= #{param.startTime} AND scheduled_start_time >= #{param.scheduledStartTime}
</if> </if>
<if test="param.endTime != null and param.endTime != ''"> <if test="param.scheduledEndTime != null and param.scheduledEndTime != ''">
AND scheduled_end_time &lt;= #{param.endTime} AND scheduled_end_time &lt;= #{param.scheduledEndTime}
</if>
<if test="param.trainStatus != null and param.trainStatus != ''">
AND train_status = #{param.trainStatus}
</if> </if>
ORDER BY ORDER BY
create_time DESC create_time DESC

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java

@ -92,4 +92,12 @@ public interface IHygienePlanService extends IService<HygienePlanEntity> {
* @param response 响应类 * @param response 响应类
*/ */
void exportHygienePlanData(Map<String, Object> param, HttpServletResponse response); void exportHygienePlanData(Map<String, Object> param, HttpServletResponse response);
/**
* 查询卫生月度详情列表
* @param param 参数
* @param query 分页类
* @return 月度详情列表
*/
IPage<HygienePlanEntity> getDetailListByMonth(Map<String, Object> param, Query query);
} }

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java

@ -66,4 +66,12 @@ public interface IRehearsalPlanService extends IService<RehearsalPlanEntity> {
* @return 演练计划数据 * @return 演练计划数据
*/ */
IPage<RehearsalPlanEntity> rehearsalPlanPage(Map<String, Object> param, Query query); IPage<RehearsalPlanEntity> rehearsalPlanPage(Map<String, Object> param, Query query);
/**
* 查询月度详情列表
* @param query 分页类
* @param param 参数
* @return 详情列表
*/
IPage<RehearsalPlanEntity> getDetailListByMonth(Query query, Map<String, Object> param);
} }

8
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java

@ -66,4 +66,12 @@ public interface ITrainPlanService extends IService<TrainPlanEntity> {
* @return 培训计划数据 * @return 培训计划数据
*/ */
IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query); IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query);
/**
* 查询培训月度详情列表
* @param param 参数
* @param query 分页类
* @return 月度详情列表
*/
IPage<TrainPlanEntity> getDetailListByMonth(Map<String, Object> param, Query query);
} }

30
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java

@ -106,19 +106,7 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
} }
// 拼装检查列表 // 拼装检查列表
List<CarCheckItemEntity> itemList = carCheckItemService.getListByCarCheckRecordId(id); List<CarCheckItemEntity> itemList = carCheckItemService.getListByCarCheckRecordId(id);
List<CarCheckItemEntity> checkItemList = new ArrayList<>(); carCheckRecordDetailVO.setCheckItemList(itemList);
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);
return carCheckRecordDetailVO; return carCheckRecordDetailVO;
} }
return null; return null;
@ -187,7 +175,6 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList(); List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
itemList.forEach(x -> { itemList.forEach(x -> {
x.setCarCheckRecordId(carCheckRecordDTO.getId()); x.setCarCheckRecordId(carCheckRecordDTO.getId());
// x.setId(null);
}); });
return carCheckItemService.saveBatch(itemList); return carCheckItemService.saveBatch(itemList);
} }
@ -212,6 +199,21 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
public void exportCarCheckRecordData(Long id, HttpServletResponse response) { public void exportCarCheckRecordData(Long id, HttpServletResponse response) {
CarCheckRecordDetailVO carCheckRecordDetailVO = this.getCarCheckRecord(id); CarCheckRecordDetailVO carCheckRecordDetailVO = this.getCarCheckRecord(id);
// 数据处理 // 数据处理
// 检查项
List<CarCheckItemEntity> checkList = carCheckRecordDetailVO.getCheckItemList();
List<CarCheckItemEntity> 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(); String code = carCheckRecordDetailVO.getCode();
carCheckRecordDetailVO.setYear(code.substring(4, 8)); carCheckRecordDetailVO.setYear(code.substring(4, 8));

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java

@ -371,6 +371,39 @@ public class HygienePlanServiceImpl extends ServiceImpl<HygienePlanMapper, Hygie
} }
/** /**
* 查询卫生月度详情列表
*/
@Override
public IPage<HygienePlanEntity> getDetailListByMonth(Map<String, Object> param, Query query) {
QueryWrapper<HygienePlanEntity> 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 unit 单位
* @param name 名称 * @param name 名称

33
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java

@ -276,7 +276,6 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
String unit = String.valueOf(param.get("unit")); String unit = String.valueOf(param.get("unit"));
String startTime = String.valueOf(param.get("scheduledStartTime")); String startTime = String.valueOf(param.get("scheduledStartTime"));
String endTime = String.valueOf(param.get("scheduledEndTime")); String endTime = String.valueOf(param.get("scheduledEndTime"));
String rehearsalStatus = String.valueOf(param.get("rehearsalStatus"));
if (!unit.equals("null") && !unit.equals("")) { if (!unit.equals("null") && !unit.equals("")) {
queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit);
} }
@ -286,8 +285,38 @@ public class RehearsalPlanServiceImpl extends ServiceImpl<RehearsalPlanMapper, R
if (!endTime.equals("null") && !endTime.equals("")) { if (!endTime.equals("null") && !endTime.equals("")) {
queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime);
} }
queryWrapper.lambda().orderByDesc(RehearsalPlanEntity::getCreateTime);
return this.page(Condition.getPage(query), queryWrapper);
}
/**
* 查询月度详情列表
*/
@Override
public IPage<RehearsalPlanEntity> getDetailListByMonth(Query query, Map<String, Object> param) {
QueryWrapper<RehearsalPlanEntity> 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("")) { 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); queryWrapper.lambda().orderByDesc(RehearsalPlanEntity::getCreateTime);
return this.page(Condition.getPage(query), queryWrapper); return this.page(Condition.getPage(query), queryWrapper);

34
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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.constants.SafeProductConstant;
import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO;
import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity;
@ -268,6 +269,39 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
} }
/** /**
* 查询培训月度详情列表
*/
@Override
public IPage<TrainPlanEntity> getDetailListByMonth(Map<String, Object> param, Query query) {
QueryWrapper<TrainPlanEntity> 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 unit 单位
* @param startTime 计划开始时间 * @param startTime 计划开始时间

3
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")) { if (templatePath.equals("template/卫生自查表.docx")) {
formatHygieneRecordTable(xwpfDocument); formatHygieneRecordTable(xwpfDocument);
} }
if (templatePath.equals("template/车辆检查表.docx")) {
formatCarCheckRecordTable(xwpfDocument);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

8
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 '考试及格分'; 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', `id` bigint(20) NOT NULL COMMENT '主键ID',
`template_name` varchar(50) NOT NULL COMMENT '模板名称', `template_name` varchar(50) NOT NULL COMMENT '模板名称',
`create_user` bigint(20) NOT NULL DEFAULT '-1' 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 '状态', `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE 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', `id` bigint(20) NOT NULL COMMENT '主键ID',
`template_id` bigint(20) NOT NULL COMMENT '模板id', `template_id` bigint(20) NOT NULL COMMENT '模板id',
`check_item` varchar(500) NOT NULL COMMENT '检查项目', `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 '状态', `status` int(2) NOT NULL DEFAULT '1' COMMENT '状态',
`is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除', `is_deleted` int(2) NOT NULL DEFAULT '0' COMMENT '逻辑删除状态:0-未删除,1-删除',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='车检模板详情表';
Loading…
Cancel
Save