Browse Source

Merge remote-tracking branch 'origin/prod-20240506' into prod-20240506

zhongwei
haungxing 6 months ago
parent
commit
bb7f9a7fab
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/RealStationVo.java
  2. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  3. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckTemplateDTO.java
  4. 35
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java
  5. 26
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateEntity.java
  6. 25
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckTemplateDetailVO.java
  7. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java
  8. 17
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  9. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java
  10. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java
  11. 12
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml
  12. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java
  13. 8
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java
  14. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/wrapper/HandleWrapper.java
  15. 4
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
  16. 6
      hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java
  17. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  18. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  19. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java
  20. 58
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  21. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  22. 5
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java
  23. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  24. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java
  25. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IOperStationMonthReportService.java
  26. 356
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  27. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  28. 1
      hzims-service/operational/src/main/resources/db/2.0.6.sql
  29. 69
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java
  30. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/HygieneController.java
  31. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  32. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  33. 15
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateDetailMapper.java
  34. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateDetailMapper.xml
  35. 20
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.java
  36. 18
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateMapper.xml
  37. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneTemplateMapper.xml
  38. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.xml
  39. 61
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckTemplateService.java
  40. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IHygienePlanService.java
  41. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IRehearsalPlanService.java
  42. 8
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ITrainPlanService.java
  43. 59
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckRecordServiceImpl.java
  44. 37
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckTemplateDetailServiceImpl.java
  45. 161
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckTemplateServiceImpl.java
  46. 33
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygienePlanServiceImpl.java
  47. 28
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ICarCheckTemplateDetailService.java
  48. 31
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java
  49. 34
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java
  50. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/utils/BaseUtil.java
  51. 30
      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;

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -99,6 +99,11 @@ public class StationEntity extends TenantEntity implements Serializable {
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private Double waterLevelMax; private Double waterLevelMax;
@ApiModelProperty("前池下限水位")
@JsonSerialize(nullsUsing = NullSerializer.class)
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Double downWaterLevel;
@ApiModelProperty("经度(东经)") @ApiModelProperty("经度(东经)")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Float lgtd; private Float lgtd;

25
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/CarCheckTemplateDTO.java

@ -0,0 +1,25 @@
package com.hnac.hzims.safeproduct.dto;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @date 2024-05-30
*/
@Data
@ApiModel(value = "车检记录模板DTO类")
public class CarCheckTemplateDTO {
@ApiModelProperty("模板id")
private Long id;
@ApiModelProperty("模板名称")
private String templateName;
@ApiModelProperty("模板详情列表")
private List<CarCheckTemplateDetailEntity> detailList;
}

35
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateDetailEntity.java

@ -0,0 +1,35 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* 车检模板详情服务类
*
* @date 2024-05-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_check_template_detail")
@ApiModel(value = "车检模板详情实体类")
public class CarCheckTemplateDetailEntity extends BaseEntity {
@ApiModelProperty("车检记录id")
private Long templateId;
@NotNull
@Size(max = 500, message = "检查项目长度不能超过50")
@ApiModelProperty("检查项目")
private String checkItem;
@NotNull
@ApiModelProperty("检查内容")
private String checkContent;
}

26
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/CarCheckTemplateEntity.java

@ -0,0 +1,26 @@
package com.hnac.hzims.safeproduct.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
* @date 2024-05-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("hzims_car_check_template")
@ApiModel(value = "车检模板实体类")
public class CarCheckTemplateEntity extends BaseEntity {
@ApiModelProperty("模板名称")
private String templateName;
@TableField(exist = false)
@ApiModelProperty("创建机构名称")
private String createDeptName;
}

25
hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/CarCheckTemplateDetailVO.java

@ -0,0 +1,25 @@
package com.hnac.hzims.safeproduct.vo;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateDetailEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @date 2024-05-30
*/
@Data
@ApiModel(value = "车检模板详情VO类")
public class CarCheckTemplateDetailVO {
@ApiModelProperty("模板id")
private Long id;
@ApiModelProperty("模板名称")
private String templateName;
@ApiModelProperty("模板详情列表")
private List<CarCheckTemplateDetailEntity> templateDetailList;
}

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmAssociationController.java

@ -76,6 +76,4 @@ public class EmAssociationController extends BladeController {
return R.status(emAssociationService.deleteLogic(Func.toLongList(ids))); return R.status(emAssociationService.deleteLogic(Func.toLongList(ids)));
} }
} }

17
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java

@ -18,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.server.domain.Sys;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -59,9 +61,9 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
return false; return false;
} }
// 步骤2.查询当天处理的告警 // 步骤2.查询当天处理的告警
List<String> handlers = handleService.sameDayContent(); List<String> handlers = handleService.sameDayContent(stations.getData().stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 步骤3.查询延后未完成的告警 // 步骤3.查询延后未完成的告警
List<String> delays = handleService.incompleteContent(); List<String> delays = handleService.incompleteContent(stations.getData().stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 步骤4.近5分钟内告警 // 步骤4.近5分钟内告警
Set<String> keys = stringRedisTemplate.keys("hzims:queue:filter:alarm" + "*"); Set<String> keys = stringRedisTemplate.keys("hzims:queue:filter:alarm" + "*");
// 步骤5.遍历保存告警数据 // 步骤5.遍历保存告警数据
@ -79,6 +81,12 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){ if(CollectionUtil.isNotEmpty(delays) && delays.contains(alarm.getAlarmContext())){
return; return;
} }
// 告警站点名称截取
if(StringUtil.isNotBlank(alarm.getAlarmContext()) && !AlarmConstants.CONDITION_ALARM.equals(alarm.getAlarmSource()) && !AlarmConstants.INTERRUPT.equals(alarm.getAlarmType())
&& !AlarmConstants.ABNORMAL.equals(alarm.getAlarmType())){
String[] countext = alarm.getAlarmContext().split("\\.");
alarm.setAlarmContext(countext[countext.length - 1]);
}
// 近5分钟内告警重复 // 近5分钟内告警重复
if(CollectionUtil.isNotEmpty(keys)){ if(CollectionUtil.isNotEmpty(keys)){
for (String key : keys) { for (String key : keys) {
@ -88,10 +96,6 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
} }
} }
} }
// fpd告警拼接
if(AlarmConstants.EARLY_WARNING.equals(alarm.getAlarmSource())){
alarm.setAlarmContext(optional.get().getName() + "." + alarm.getAlarmContext());
}
// 步骤3.站点参数设置 // 步骤3.站点参数设置
alarm.setCreateDept(optional.get().getCreateDept()); alarm.setCreateDept(optional.get().getCreateDept());
alarm.setStationName(optional.get().getName()); alarm.setStationName(optional.get().getName());
@ -126,5 +130,4 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
}); });
return true; return true;
} }
} }

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java

@ -29,7 +29,7 @@ public class HZ300MqttConsumer implements SubscribeCallBack {
private AlarmSaveService alarmSaveService; private AlarmSaveService alarmSaveService;
@Override @Override
public void onMessage(Map<String, Object> data) { public void onMessage(Map<String, Object> data) {
log.info("HZ3000队列监听到消息 : {}",data); log.error("HZ3000队列监听到消息 : {}",data);
//消费代码 //消费代码
List<AlarmEntity> alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data)); List<AlarmEntity> alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data));
if(CollectionUtil.isEmpty(alarmEntities)){ if(CollectionUtil.isEmpty(alarmEntities)){

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.java

@ -22,7 +22,7 @@ public interface AlarmHandleMapper extends UserDataScopeBaseMapper<AlarmHandleEn
List<String> handles(@Param("start") String start,@Param("end") String end); List<String> handles(@Param("start") String start,@Param("end") String end);
List<String> sameDayContent(@Param("start") String start,@Param("end") String end); List<String> sameDayContent(@Param("start") String start,@Param("end") String end,@Param("stations") List<String> stations);
List<String> incompleteContent(@Param("end") String end); List<String> incompleteContent(@Param("end") String end,@Param("stations") List<String> stations);
} }

12
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml

@ -50,6 +50,12 @@
<if test="start != null and end != null"> <if test="start != null and end != null">
AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end} AND HANDLER.CREATE_TIME BETWEEN #{start} AND #{end}
</if> </if>
<if test="stations != null">
and HANDLER.STATION_CODE in
<foreach collection="stations" item="station" index="index" open="(" close=")" separator=",">
#{station}
</foreach>
</if>
</where> </where>
</select> </select>
<select id="incompleteContent" resultType="java.lang.String"> <select id="incompleteContent" resultType="java.lang.String">
@ -59,6 +65,12 @@
HANDLER.IS_DELETED = 0 HANDLER.IS_DELETED = 0
AND HANDLER.HANDLE_WAY = 1 AND HANDLER.HANDLE_WAY = 1
AND (HANDLER.DELAY_TIME &gt; #{end}) AND (HANDLER.DELAY_TIME &gt; #{end})
<if test="stations != null">
and HANDLER.STATION_CODE in
<foreach collection="stations" item="station" index="index" open="(" close=")" separator=",">
#{station}
</foreach>
</if>
</where> </where>
</select> </select>
</mapper> </mapper>

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleService.java

@ -26,7 +26,7 @@ public interface AlarmHandleService extends BaseService<AlarmHandleEntity> {
List<String> handles(); List<String> handles();
List<String> sameDayContent(); List<String> sameDayContent(List<String> stations);
List<String> incompleteContent(); List<String> incompleteContent(List<String> stations);
} }

8
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java

@ -173,12 +173,12 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
* @return * @return
*/ */
@Override @Override
public List<String> sameDayContent() { public List<String> sameDayContent(List<String> stations) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.HOUR_OF_DAY,-1); calendar.add(Calendar.HOUR_OF_DAY,-1);
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.sameDayContent(start,end); return this.baseMapper.sameDayContent(start,end,stations);
} }
/** /**
@ -186,8 +186,8 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
* @return * @return
*/ */
@Override @Override
public List<String> incompleteContent() { public List<String> incompleteContent(List<String> stations) {
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME); String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
return this.baseMapper.incompleteContent(end); return this.baseMapper.incompleteContent(end,stations);
} }
} }

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/wrapper/HandleWrapper.java

@ -18,7 +18,7 @@ public class HandleWrapper extends BaseEntityWrapper<AlarmHandleVo,AlarmHandleVo
@Override @Override
public AlarmHandleVo entityVO(AlarmHandleVo entity) { public AlarmHandleVo entityVO(AlarmHandleVo entity) {
if (1==entity.getHandleWay()|| StringUtils.isNotEmpty(entity.getUserName())) { if (1==entity.getHandleWay()|| StringUtils.isEmpty(entity.getUserName())) {
User createUser = UserCache.getUser(entity.getCreateUser()); User createUser = UserCache.getUser(entity.getCreateUser());
if (ObjectUtil.isEmpty(createUser)) { if (ObjectUtil.isEmpty(createUser)) {
return entity; return entity;

4
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java

@ -86,7 +86,7 @@ public class MessageServiceImpl implements MessageService {
message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription());
message.setTaskId(entity.getId()); message.setTaskId(entity.getId());
message.setTenantId(stationByCode.getData().getTenantId()); message.setTenantId(stationByCode.getData().getTenantId());
message.setContent(entity.getAlarmContext()); message.setContent(entity.getStationName() + "." +entity.getAlarmContext());
message.setDeptId(dept); message.setDeptId(dept);
R<String> deptName = sysClient.getDeptName(dept); R<String> deptName = sysClient.getDeptName(dept);
if (deptName.isSuccess()) { if (deptName.isSuccess()) {
@ -207,7 +207,7 @@ public class MessageServiceImpl implements MessageService {
// map.put("thing5",Optional.ofNullable(entity.getDeviceCode()).orElse("未知设备")); // map.put("thing5",Optional.ofNullable(entity.getDeviceCode()).orElse("未知设备"));
map.put("thing11",getTruncateString(entity.getAlarmContext(), 20)); map.put("thing11",getTruncateString(entity.getAlarmContext(), 20));
map.put("time2",entity.getAlarmTime()); map.put("time2",entity.getAlarmTime());
map.put("thing14", DictCache.getValue("alarm_source", entity.getAlarmSource())); map.put("thing14", DictCache.getValue("alarm_type", entity.getAlarmType()));
message.setMap(map); message.setMap(map);
// 消息内容 // 消息内容
message.setContent(entity.getAlarmContext()); message.setContent(entity.getAlarmContext());

6
hzims-service/hzims-basic/src/main/java/com/hnac/hzims/basic/mapper/PersonManagemetMapper.java

@ -6,6 +6,7 @@ import com.hnac.hzims.basic.vo.PersonManagemetExportVo;
import com.hnac.hzims.basic.vo.PersonManagemetVo; import com.hnac.hzims.basic.vo.PersonManagemetVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.Date; import java.util.Date;
@ -18,16 +19,17 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonManagemetEntity> { public interface PersonManagemetMapper extends UserDataScopeBaseMapper<PersonManagemetEntity> {
@UserDataAuth
List<PersonManagemetVo> getPersonManagemetEntity( List<PersonManagemetVo> getPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime, @Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job, @Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ; @Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
Integer getCountByPersonManagemetEntity( Integer getCountByPersonManagemetEntity(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime, @Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job, @Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,
@Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ; @Param(value = "academicTitle")String academicTitle, @Param(value = "status")Integer status, @Param(value = "current")Integer current, @Param(value = "size")Integer size) ;
@UserDataAuth
List<PersonManagemetExportVo> exportPersonManagemet( List<PersonManagemetExportVo> exportPersonManagemet(
@Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime, @Param(value = "type")String type, @Param(value = "deadStartTime") Date deadStartTime, @Param(value = "deadTime")Date deadTime,
@Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job, @Param(value = "name")String name, @Param(value = "unitName")String unitName, @Param(value = "sex")String sex, @Param(value = "job")String job,

13
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java

@ -157,19 +157,6 @@ public class RealTargetScheduledTask {
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
/**
* 获取站点近3年发电量数据
*/
@XxlJob(LOAD_POWER_DATA_NEW)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadPowerDataNew(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
service.loadPowerDataNew(param, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC),2,3);
return new ReturnT<>("SUCCESS");
}
@XxlJob(WIND_POWER_GENERATION_RECENT_YEAR) @XxlJob(WIND_POWER_GENERATION_RECENT_YEAR)
//@Scheduled(cron = "0/40 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -247,6 +247,8 @@ public class AlarmServiceImpl implements AlarmService {
if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){ if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){
entity.setStatus(1); entity.setStatus(1);
} }
return entity; return entity;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if(CollectionUtil.isEmpty(entities)){ if(CollectionUtil.isEmpty(entities)){
@ -274,7 +276,7 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setType(Integer.parseInt(entity.getType())); alarm.setType(Integer.parseInt(entity.getType()));
alarm.setStation(entity.getStationId()); alarm.setStation(entity.getStationId());
alarm.setRealId(entity.getRealId()); alarm.setRealId(entity.getRealId());
alarm.setContext(entity.getStationName() + "." + entity.getSoeExplain()); alarm.setContext(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));

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/RealTargetService.java

@ -28,7 +28,5 @@ public interface RealTargetService {
void loadPowerData(String param, List<Integer> types, Integer serveType, int year); void loadPowerData(String param, List<Integer> types, Integer serveType, int year);
void loadPowerDataNew(String param, List<Integer> types, Integer serveType, int year);
void loadPowerDataByWindEnergy(String param, List<Integer> types, Integer serveType, int year,String key); void loadPowerDataByWindEnergy(String param, List<Integer> types, Integer serveType, int year,String key);
} }

58
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -1252,6 +1252,7 @@ public class RealTargetServiceImpl implements RealTargetService {
List<List<StationEntity>> limits = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stations.stream().skip((long) a * 3).limit(3).parallel().collect(Collectors.toList())).collect(Collectors.toList()); List<List<StationEntity>> limits = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stations.stream().skip((long) a * 3).limit(3).parallel().collect(Collectors.toList())).collect(Collectors.toList());
CountDownLatch countDownLatch = new CountDownLatch(limits.size()); CountDownLatch countDownLatch = new CountDownLatch(limits.size());
for(List<StationEntity> item : limits){ for(List<StationEntity> item : limits){
try{
pool.submit(()->{ pool.submit(()->{
item.forEach(station->{ item.forEach(station->{
// 站点设备集合 // 站点设备集合
@ -1265,9 +1266,11 @@ public class RealTargetServiceImpl implements RealTargetService {
countDownLatch.countDown(); countDownLatch.countDown();
log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList())); log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}); });
}catch (Exception e){
log.error("pool_item_execute_complete_error : {}" ,e.getMessage());
} }
//所有模板数据获取完成后释放锁 }
// 等待所有线程执行完成
try { try {
countDownLatch.await(); countDownLatch.await();
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -1277,57 +1280,6 @@ public class RealTargetServiceImpl implements RealTargetService {
redisTemplate.opsForValue().set(recent_year_power_data, powerMap); redisTemplate.opsForValue().set(recent_year_power_data, powerMap);
} }
@Override
public void loadPowerDataNew(String param, List<Integer> types, Integer serveType, int year) {
// 站点查询
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
if (CollectionUtil.isNotEmpty(types)) {
in(StationEntity::getType, types);
}
}});
// 设备信息
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {
});
// 开始时间
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - year);
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 存储数据map :<站点id,<月份,发电量>>
Map<Long, Map<String, Float>> powerMap = new CopyOnWriteMap<>();
// 将站点切割
int limit = countStep(stations.size());
List<List<StationEntity>> limits = Stream.iterate(0, n -> n + 1).limit(limit).parallel().map(a -> stations.stream().skip((long) a * 3).limit(3).parallel().collect(Collectors.toList())).collect(Collectors.toList());
CountDownLatch countDownLatch = new CountDownLatch(limits.size());
for(List<StationEntity> item : limits){
pool.submit(()->{
item.forEach(station->{
// 站点设备集合
List<EminfoAndEmParamVo> stationDevices = devices.stream().filter(device -> device.getCreateDept().equals(station.getRefDept())).collect(Collectors.toList());
Map<String, Float> generateMap = this.lastReduceFirst(station,stationDevices,start,end);
if(MapUtils.isEmpty(generateMap)){
return;
}
powerMap.put(station.getId(),generateMap);
});
countDownLatch.countDown();
log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
});
}
//所有模板数据获取完成后释放锁
try {
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
redisTemplate.opsForValue().set(recent_year_power_data_test, JSONObject.toJSONString(powerMap));
}
private Map<String, Float> lastReduceFirst(StationEntity station, List<EminfoAndEmParamVo> devices, String start, String end) { private Map<String, Float> lastReduceFirst(StationEntity station, List<EminfoAndEmParamVo> devices, String start, String end) {
List<PowerMonthVo> datas = new ArrayList<>(); List<PowerMonthVo> datas = new ArrayList<>();

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());

5
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java

@ -855,6 +855,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateData(BaseService service, List<? extends SyncBO> data) { public void updateData(BaseService service, List<? extends SyncBO> data) {
try{
if (CollectionUtil.isEmpty(data)) { if (CollectionUtil.isEmpty(data)) {
return; return;
} }
@ -871,6 +872,10 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
if (CollectionUtil.isNotEmpty(dataList.get(3))) { if (CollectionUtil.isNotEmpty(dataList.get(3))) {
service.deleteLogic(dataList.get(3).stream().map(SyncBO::getPrimaryKey).collect(Collectors.toList())); service.deleteLogic(dataList.get(3).stream().map(SyncBO::getPrimaryKey).collect(Collectors.toList()));
} }
}catch (Exception exception){
log.error("offline_update_data : {}",exception.getMessage());
}
} }
/** /**

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -403,6 +403,9 @@ public class HydropowerServiceImpl implements HydropowerService {
if(CollectionUtil.isEmpty(targetList)){ if(CollectionUtil.isEmpty(targetList)){
return; return;
} }
// 月发电量
float powerMon = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum();
response.setPowerYear(powerMon);
// 年发电量 // 年发电量
float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum();
response.setPowerYear(powerYear); response.setPowerYear(powerYear);
@ -428,7 +431,10 @@ public class HydropowerServiceImpl implements HydropowerService {
return; return;
} }
String month = DateUtil.format(new Date(),"yyyy-MM") + "-01"; String month = DateUtil.format(new Date(),"yyyy-MM") + "-01";
response.setPowerMon(map.get(id).getOrDefault(month, 0f)); float powerMon = map.get(id).getOrDefault(month, 0f);
if(powerMon > 0){
response.setPowerMon(powerMon);
}
} }
@ -650,14 +656,17 @@ public class HydropowerServiceImpl implements HydropowerService {
if (MapUtils.isEmpty(map)) { if (MapUtils.isEmpty(map)) {
return kpi; return kpi;
} }
String month = DateUtil.format(new Date(),"yyyy-MM") + "-01";
// 当月发电量 // 当月发电量
kpi.setGenerateMon(map.entrySet().stream().filter(o->stations.stream().map(StationEntity::getId).collect(Collectors.toList()).contains(o.getKey())).mapToDouble(entry->{ String month = DateUtil.format(new Date(),"yyyy-MM") + "-01";
double generateMon = map.entrySet().stream().filter(o->stations.stream().map(StationEntity::getId).collect(Collectors.toList()).contains(o.getKey())).mapToDouble(entry->{
if(entry.getValue().containsKey(month)){ if(entry.getValue().containsKey(month)){
return Double.valueOf(entry.getValue().get(month)); return Double.valueOf(entry.getValue().get(month));
} }
return 0.0; return 0.0;
}).sum()); }).sum();
if(generateMon > 0){
kpi.setGenerateMon(generateMon);
}
// 今年发电趋势 // 今年发电趋势
kpi.setPowerMonthVoList(this.handlePowerFinish(stations,map)); kpi.setPowerMonthVoList(this.handlePowerFinish(stations,map));
// 近3年发电量 // 近3年发电量

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/MonthReportController.java

@ -129,7 +129,8 @@ public class MonthReportController {
// LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth); // LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth);
// return R.data(taskMonthService.getStationMonthReport(startDate,endDate,deptId.toString())); // return R.data(taskMonthService.getStationMonthReport(startDate,endDate,deptId.toString()));
R<Dept> deptR = sysClient.getDept(deptId); R<Dept> deptR = sysClient.getDept(deptId);
return R.data(operStationMonthReportService.getStationMonthReport(yearAndMonth, BeanUtil.copy(deptR.getData(),DeptVO.class))); // return R.data(operStationMonthReportService.getStationMonthReport(yearAndMonth, BeanUtil.copy(deptR.getData(),DeptVO.class)));
return R.success("月报测试");
} }
@GetMapping("/test") @GetMapping("/test")

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/IOperStationMonthReportService.java

@ -14,7 +14,7 @@ public interface IOperStationMonthReportService {
* @param yearAndMonth * @param yearAndMonth
* @return * @return
*/ */
StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO); // StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO);
/** /**
* 获取电站月报 * 获取电站月报
* @param yearAndMonth * @param yearAndMonth

356
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java

@ -128,181 +128,181 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
**/ **/
private static final String STATION_REPORT_OUTSIDE = "1"; private static final String STATION_REPORT_OUTSIDE = "1";
@Override // @Override
public StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO) { // public StationReportAllVO getStationMonthReport(String yearAndMonth, DeptVO deptVO) {
StationReportAllVO stationReportAllVo = new StationReportAllVO(); // StationReportAllVO stationReportAllVo = new StationReportAllVO();
stationReportAllVo.setStationName(deptVO.getDeptName()); // stationReportAllVo.setStationName(deptVO.getDeptName());
stationReportAllVo.setYearMonth(YearMonth.parse(yearAndMonth).format(DateTimeFormatter.ofPattern("yyyy年MM月"))); // stationReportAllVo.setYearMonth(YearMonth.parse(yearAndMonth).format(DateTimeFormatter.ofPattern("yyyy年MM月")));
//处理请求参数 // //处理请求参数
Map<String, Object> params = new HashMap<>(); // Map<String, Object> params = new HashMap<>();
//使用预定义实例来转换 // //使用预定义实例来转换
DateTimeFormatter fmt = DateTimeFormatter.ISO_LOCAL_DATE; // DateTimeFormatter fmt = DateTimeFormatter.ISO_LOCAL_DATE;
LocalDate startDate = DateUtil.getFirstDayByYearMonth(yearAndMonth); // LocalDate startDate = DateUtil.getFirstDayByYearMonth(yearAndMonth);
LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth); // LocalDate endDate = DateUtil.getLastDayByYearMonth(yearAndMonth);
params.put("startDate", fmt.format(startDate)); // params.put("startDate", fmt.format(startDate));
params.put("endDate", fmt.format(endDate)); // params.put("endDate", fmt.format(endDate));
//
List<Long> deptIdList = new ArrayList<>(); // List<Long> deptIdList = new ArrayList<>();
deptIdList.add(deptVO.getId()); // deptIdList.add(deptVO.getId());
//获取下属机构 // //获取下属机构
R<List<Dept>> childDeptListR = sysClient.getDeptChild(deptVO.getId()); // R<List<Dept>> childDeptListR = sysClient.getDeptChild(deptVO.getId());
if (childDeptListR.isSuccess() && CollectionUtil.isNotEmpty(childDeptListR.getData())) { // if (childDeptListR.isSuccess() && CollectionUtil.isNotEmpty(childDeptListR.getData())) {
deptIdList.addAll(childDeptListR.getData().stream().map(Dept::getId).collect(Collectors.toList())); // deptIdList.addAll(childDeptListR.getData().stream().map(Dept::getId).collect(Collectors.toList()));
} // }
params.put("deptId", deptIdList); // params.put("deptId", deptIdList);
//
//获取机构及子机构下的站点 // //获取机构及子机构下的站点
List<StationEntity> stationEntityList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ // List<StationEntity> stationEntityList = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
in(StationEntity::getRefDept, deptIdList); // in(StationEntity::getRefDept, deptIdList);
}}); // }});
//
//监控线程执行完后返回结果 // //监控线程执行完后返回结果
CountDownLatch countDownLatch = new CountDownLatch(POOL_QUANTITY); // CountDownLatch countDownLatch = new CountDownLatch(POOL_QUANTITY);
long startMillis = System.currentTimeMillis(); // long startMillis = System.currentTimeMillis();
//电站发电情况 // //电站发电情况
pool.execute(() -> { // pool.execute(() -> {
try { // try {
List<StationReportVO> powerList = new ArrayList<>(); // List<StationReportVO> powerList = new ArrayList<>();
stationEntityList.forEach(stationEntity -> { // stationEntityList.forEach(stationEntity -> {
List<StationReportVO> stationReportVOList = mainSystemMonitoringService.getElectricSituation(yearAndMonth, stationEntity.getCode()); // List<StationReportVO> stationReportVOList = mainSystemMonitoringService.getElectricSituation(yearAndMonth, stationEntity.getCode());
powerList.addAll(stationReportVOList); // powerList.addAll(stationReportVOList);
}); // });
stationReportAllVo.setStationReportVOList(powerList); // stationReportAllVo.setStationReportVOList(powerList);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("电站发电耗时:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//值班情况 // //值班情况
pool.execute(() -> { // pool.execute(() -> {
try { // try {
// List<DutyReportVO> dutyReportVOList = iImsDutyMainService.getDutyMainStatisticsByClassId(params); //// List<DutyReportVO> dutyReportVOList = iImsDutyMainService.getDutyMainStatisticsByClassId(params);
// stationReportAllVo.setDutyReportVOList(dutyReportVOList); //// stationReportAllVo.setDutyReportVOList(dutyReportVOList);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("值班情况耗时:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//日常维护 // //日常维护
pool.execute(() -> { // pool.execute(() -> {
try { // try {
List<MaintenanceReportVO> maintenanceList = operMaintenanceTaskService.getMaintenanceStatisticsByDisposer(params); // List<MaintenanceReportVO> maintenanceList = operMaintenanceTaskService.getMaintenanceStatisticsByDisposer(params);
stationReportAllVo.setMaintenanceReportVOList(maintenanceList); // stationReportAllVo.setMaintenanceReportVOList(maintenanceList);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("日常维护:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//检修 // //检修
pool.execute(() -> { // pool.execute(() -> {
try { // try {
// List<AccessRunReportVO> accessList = operAccessTaskService.getAccessTaskByName(params); //// List<AccessRunReportVO> accessList = operAccessTaskService.getAccessTaskByName(params);
// stationReportAllVo.setAccessReportVOList(accessList); //// stationReportAllVo.setAccessReportVOList(accessList);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("检修:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("检修:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("检修:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//缺陷 // //缺陷
pool.execute(() -> { // pool.execute(() -> {
try { // try {
List<DefectReportsVO> defectList = operDefectService.getFaultByFaultCode(params); // List<DefectReportsVO> defectList = operDefectService.getFaultByFaultCode(params);
stationReportAllVo.setDefectReportsVOList(defectList); // stationReportAllVo.setDefectReportsVOList(defectList);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("缺陷:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//两票统计 // //两票统计
pool.execute(() -> { // pool.execute(() -> {
try { // try {
String deptIds = deptIdList.stream().map(deptId -> deptId.toString()).collect(Collectors.joining(",")); // String deptIds = deptIdList.stream().map(deptId -> deptId.toString()).collect(Collectors.joining(","));
TicketStatisticDTO ticketStatisticDTO = new TicketStatisticDTO(); // TicketStatisticDTO ticketStatisticDTO = new TicketStatisticDTO();
ticketStatisticDTO.setStartDate(fmt.format(startDate)); // ticketStatisticDTO.setStartDate(fmt.format(startDate));
ticketStatisticDTO.setEndDate(fmt.format(endDate)); // ticketStatisticDTO.setEndDate(fmt.format(endDate));
ticketStatisticDTO.setDeptIds(deptIds); // ticketStatisticDTO.setDeptIds(deptIds);
List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketReportStatistic(ticketStatisticDTO); // List<TicketInfoStatisticVO> ticketVOS = ticketInfoAllClient.getTicketReportStatistic(ticketStatisticDTO);
stationReportAllVo.setTicketInfoStatisticVOList(ticketVOS); // stationReportAllVo.setTicketInfoStatisticVOList(ticketVOS);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("两票统计:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//巡检 // //巡检
pool.execute(() -> { // pool.execute(() -> {
try { // try {
List<TaskReportVO> taskReportVOS = taskReportClient.getInspectTaskReport(params); // List<TaskReportVO> taskReportVOS = taskReportClient.getInspectTaskReport(params);
this.fillInspectProblem(startDate, endDate, deptIdList, taskReportVOS); // this.fillInspectProblem(startDate, endDate, deptIdList, taskReportVOS);
stationReportAllVo.setInspectReportVOList(taskReportVOS); // stationReportAllVo.setInspectReportVOList(taskReportVOS);
} finally { // } finally {
countDownLatch.countDown(); // countDownLatch.countDown();
log.info("巡检:"+(System.currentTimeMillis()-startMillis)+"ms"); // log.info("巡检:"+(System.currentTimeMillis()-startMillis)+"ms");
System.out.print("巡检:"+(System.currentTimeMillis()-startMillis)+"ms"); // System.out.print("巡检:"+(System.currentTimeMillis()-startMillis)+"ms");
} // }
}); // });
//智能诊断 // //智能诊断
pool.execute(() -> { // pool.execute(() -> {
if (CollectionUtil.isNotEmpty(stationEntityList)) { // if (CollectionUtil.isNotEmpty(stationEntityList)) {
StatisticStatusDTO statisticStatusDTO = new StatisticStatusDTO(); // StatisticStatusDTO statisticStatusDTO = new StatisticStatusDTO();
List<String> stationIds = stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList()); // List<String> stationIds = stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList());
String[] stationIdArray = new String[stationIds.size()]; // String[] stationIdArray = new String[stationIds.size()];
stationIds.toArray(stationIdArray); // stationIds.toArray(stationIdArray);
statisticStatusDTO.setStationIds(stationIdArray); // statisticStatusDTO.setStationIds(stationIdArray);
statisticStatusDTO.setThreshold(0.3f); // statisticStatusDTO.setThreshold(0.3f);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
statisticStatusDTO.setStart(formatter.format(LocalDateTime.of(startDate, LocalTime.MIN))); // statisticStatusDTO.setStart(formatter.format(LocalDateTime.of(startDate, LocalTime.MIN)));
statisticStatusDTO.setEnd(formatter.format(LocalDateTime.of(endDate, LocalTime.MAX))); // statisticStatusDTO.setEnd(formatter.format(LocalDateTime.of(endDate, LocalTime.MAX)));
R<Map<String, List<StatisticStatusVO>>> diagnoseResult = diagnoseClient.getStatisticStatus(statisticStatusDTO); // R<Map<String, List<StatisticStatusVO>>> diagnoseResult = diagnoseClient.getStatisticStatus(statisticStatusDTO);
List<String> diagnoseConclusionList = new ArrayList<>(); // List<String> diagnoseConclusionList = new ArrayList<>();
if (diagnoseResult.isSuccess()) { // if (diagnoseResult.isSuccess()) {
Map<String, List<StatisticStatusVO>> statisticStatusVOList = diagnoseResult.getData(); // Map<String, List<StatisticStatusVO>> statisticStatusVOList = diagnoseResult.getData();
statisticStatusVOList.forEach((k, v) -> { // statisticStatusVOList.forEach((k, v) -> {
if (v.size() > 5) { // if (v.size() > 5) {
v = v.subList(0, 5); // v = v.subList(0, 5);
} // }
String diagnoseConclusion = v.stream().map(s -> { // String diagnoseConclusion = v.stream().map(s -> {
String riskLevel = ""; // String riskLevel = "";
if (s.getSeverity() >= 3) { // if (s.getSeverity() >= 3) {
riskLevel = "高风险"; // riskLevel = "高风险";
} else if (s.getSeverity() == 2) { // } else if (s.getSeverity() == 2) {
riskLevel = "一般"; // riskLevel = "一般";
} else if (s.getSeverity() == 1) { // } else if (s.getSeverity() == 1) {
riskLevel = "低风险"; // riskLevel = "低风险";
} // }
String c = "发生在" + s.getOrd() + "的" + s.getName() + ",风险等级:" + riskLevel + ",最后一次出现的时间:" + s.getLastBeginTime() + ";";//,持续时长:"+s.getLongTime()+" // String c = "发生在" + s.getOrd() + "的" + s.getName() + ",风险等级:" + riskLevel + ",最后一次出现的时间:" + s.getLastBeginTime() + ";";//,持续时长:"+s.getLongTime()+"
return c; // return c;
}).collect(Collectors.joining("\n")); // }).collect(Collectors.joining("\n"));
if (StringUtil.isNotBlank(diagnoseConclusion)) { // if (StringUtil.isNotBlank(diagnoseConclusion)) {
StationEntity stationEntity = stationService.getById(k); // StationEntity stationEntity = stationService.getById(k);
if (ObjectUtil.isNotEmpty(stationEntity)) { // if (ObjectUtil.isNotEmpty(stationEntity)) {
diagnoseConclusion = stationEntity.getName() + "本月智能诊断服务预警前五位的可能存在风险的故障信息:\n" + diagnoseConclusion; // diagnoseConclusion = stationEntity.getName() + "本月智能诊断服务预警前五位的可能存在风险的故障信息:\n" + diagnoseConclusion;
diagnoseConclusionList.add(diagnoseConclusion); // diagnoseConclusionList.add(diagnoseConclusion);
} // }
} // }
}); // });
stationReportAllVo.setDiagnoseConclusion(diagnoseConclusionList.stream().collect(Collectors.joining("\n"))); // stationReportAllVo.setDiagnoseConclusion(diagnoseConclusionList.stream().collect(Collectors.joining("\n")));
stationReportAllVo.setStatisticStatusVOList(statisticStatusVOList); // stationReportAllVo.setStatisticStatusVOList(statisticStatusVOList);
} // }
} // }
countDownLatch.countDown(); // countDownLatch.countDown();
}); // });
//所有模板数据获取完成后释放锁 // //所有模板数据获取完成后释放锁
try { // try {
countDownLatch.await(); // countDownLatch.await();
} catch (InterruptedException e) { // } catch (InterruptedException e) {
e.printStackTrace(); // e.printStackTrace();
Thread.currentThread().interrupt(); // Thread.currentThread().interrupt();
} // }
//小结 // //小结
this.getStationReportConclusion(stationReportAllVo, params); // this.getStationReportConclusion(stationReportAllVo, params);
return stationReportAllVo; // return stationReportAllVo;
} // }
@Override @Override
public StationRunReportAllVO getStationMonthReportV2(String yearAndMonth, DeptVO deptVO) { public StationRunReportAllVO getStationMonthReportV2(String yearAndMonth, DeptVO deptVO) {
StationRunReportAllVO stationReportAllVo = new StationRunReportAllVO(); StationRunReportAllVO stationReportAllVo = new StationRunReportAllVO();
@ -1217,8 +1217,10 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
//日常维护任务统计 //日常维护任务统计
if (CollectionUtil.isNotEmpty(stationReportAllVo.getMaintenanceReportVOList())) { if (CollectionUtil.isNotEmpty(stationReportAllVo.getMaintenanceReportVOList())) {
List<RunReportVO> maintenanceReportVOList = stationReportAllVo.getMaintenanceReportVOList(); List<RunReportVO> maintenanceReportVOList = stationReportAllVo.getMaintenanceReportVOList();
int completeTaskNum = maintenanceReportVOList.stream().filter(vo -> Func.isNotEmpty(vo.getCompleteNum())).mapToInt(RunReportVO::getCompleteNum).sum(); int completeTaskNum = maintenanceReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName()))
int incompleteTaskNum = maintenanceReportVOList.stream().filter(vo -> Func.isNotEmpty(vo.getIncompleteNum())).mapToInt(RunReportVO::getIncompleteNum).sum(); .filter(vo -> Func.isNotEmpty(vo.getCompleteNum())).mapToInt(RunReportVO::getCompleteNum).sum();
int incompleteTaskNum = maintenanceReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName()))
.filter(vo -> Func.isNotEmpty(vo.getIncompleteNum())).mapToInt(RunReportVO::getIncompleteNum).sum();
if (completeTaskNum == 0 && incompleteTaskNum == 0) { if (completeTaskNum == 0 && incompleteTaskNum == 0) {
conclusion.append("2、无日常维护任务;\r\n"); conclusion.append("2、无日常维护任务;\r\n");
} else { } else {

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -336,12 +336,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() > 0 && station.getWaterLevel() > station.getWaterLevelMax()){
station.setWaterColor(2); station.setWaterColor(2);
}else if((station.getWaterLevel() / station.getWaterLevelMax()) > 0.9){ }else if(station.getDownWaterLevel() > 0 && station.getWaterLevel() < station.getDownWaterLevel()){
station.setWaterColor(1); station.setWaterColor(1);
} }
} }

1
hzims-service/operational/src/main/resources/db/2.0.6.sql

@ -0,0 +1 @@
ALTER TABLE `hzims_station` ADD COLUMN `DOWN_WATER_LEVEL` decimal(6, 2) NULL DEFAULT NULL COMMENT '下限水位' AFTER `LIMIT_WATER_LEVEL`;

69
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/CarController.java

@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.safeproduct.Constants; import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO; import com.hnac.hzims.safeproduct.dto.CarCheckRecordDTO;
import com.hnac.hzims.safeproduct.dto.CarCheckTemplateDTO;
import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarMaintenanceConfirmationDTO;
import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO; import com.hnac.hzims.safeproduct.dto.CarUsedRecordConfirmationDTO;
import com.hnac.hzims.safeproduct.entity.*; import com.hnac.hzims.safeproduct.entity.*;
@ -54,6 +55,8 @@ public class CarController extends BladeController {
private final ICarInsuranceService carInsuranceService; private final ICarInsuranceService carInsuranceService;
private final ICarCheckTemplateService carCheckTemplateService;
@PostMapping("/saveCar") @PostMapping("/saveCar")
@ApiOperation(value = "新增车辆") @ApiOperation(value = "新增车辆")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ -269,31 +272,47 @@ public class CarController extends BladeController {
return R.data(page); return R.data(page);
} }
// @ApiOperation(value = "新增车检记录模板") @PostMapping("/saveCarCheckTemplate")
// @ApiOperationSupport(order = 39) @ApiOperation(value = "新增车检模板")
// public R saveCarCheckRecordTemplate() { @ApiOperationSupport(order = 39)
// @Operate(label = "新增车检模板", type = BusinessType.INSERT, ignore = false)
// } public R saveCarCheckTemplate(@RequestBody CarCheckTemplateDTO dto) {
// return R.status(carCheckTemplateService.saveCarCheckTemplate(dto));
// @ApiOperationSupport(order = 40) }
// public R updateCarCheckRecordTemplate() {
// @PostMapping("/updateCarCheckTemplate")
// } @ApiOperation(value = "修改车检模板")
// @ApiOperationSupport(order = 40)
// @ApiOperationSupport(order = 41) @Operate(label = "修改车检模板", type = BusinessType.UPDATE, ignore = false)
// public R removeCarCheckRecordTemplate() { public R updateCarCheckTemplate(@RequestBody CarCheckTemplateDTO dto) {
// return R.status(carCheckTemplateService.updateCarCheckTemplate(dto));
// } }
//
// @ApiOperationSupport(order = 42) @GetMapping("/removeCarCheckTemplate")
// public R carCheckRecordTemplateDetail() { @ApiOperation(value = "删除车检模板")
// @ApiOperationSupport(order = 41)
// } @Operate(label = "删除车检模板", type = BusinessType.DELETE, ignore = false)
// public R removeCarCheckTemplate(@RequestParam Long id) {
// @ApiOperationSupport(order = 43) return R.status(carCheckTemplateService.removeCarCheckTemplate(id));
// public R carCheckRecordTemplatePage() { }
//
// } @GetMapping("/carCheckTemplateDetail")
@ApiOperation(value = "车检模板详情")
@ApiOperationSupport(order = 42)
@Operate(label = "车检模板详情", type = BusinessType.QUERY, ignore = false)
public R<CarCheckTemplateDetailVO> carCheckTemplateDetail(@RequestParam Long id) {
CarCheckTemplateDetailVO vo = carCheckTemplateService.getCarCheckTemplateDetail(id);
return R.data(vo);
}
@GetMapping("/carCheckTemplatePage")
@ApiOperation(value = "车检模板分页")
@ApiOperationSupport(order = 43)
@Operate(label = "车检模板分页", type = BusinessType.QUERY, ignore = false)
public R<IPage<CarCheckTemplateEntity>> carCheckTemplatePage(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {
IPage<CarCheckTemplateEntity> page = carCheckTemplateService.getCarCheckTemplatePage(query, param);
return R.data(page);
}
@GetMapping("/exportCarMaintenanceData") @GetMapping("/exportCarMaintenanceData")
@ApiOperation(value = "导出车辆维保记录单") @ApiOperation(value = "导出车辆维保记录单")

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);
}
} }

15
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateDetailMapper.java

@ -0,0 +1,15 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateDetailEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 车检模板详情Mapper类
*
* @date 2024-05-30
*/
@Mapper
public interface CarCheckTemplateDetailMapper extends BaseMapper<CarCheckTemplateDetailEntity> {
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/CarCheckTemplateDetailMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarCheckTemplateDetailMapper">
</mapper>

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

@ -0,0 +1,20 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
@Mapper
public interface CarCheckTemplateMapper extends BaseMapper<CarCheckTemplateEntity> {
/**
* 车检分页
* @param page 分页类
* @param param 参数
* @return 分页
*/
IPage<CarCheckTemplateEntity> getCarCheckTemplatePage(IPage<CarCheckTemplateEntity> page, Map<String, Object> param);
}

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

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hnac.hzims.safeproduct.mapper.CarCheckTemplateMapper">
<select id="getCarCheckTemplatePage" resultType="com.hnac.hzims.safeproduct.entity.CarCheckTemplateEntity">
SELECT
*
FROM
hzims_car_check_template
WHERE
is_deleted = 0
<if test="param.templateName != null and param.templateName != ''">
AND template_name like concat('%', #{param.templateName}, '%')
</if>
ORDER BY
create_time DESC
</select>
</mapper>

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

61
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/ICarCheckTemplateService.java

@ -0,0 +1,61 @@
package com.hnac.hzims.safeproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.dto.CarCheckTemplateDTO;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateEntity;
import com.hnac.hzims.safeproduct.vo.CarCheckTemplateDetailVO;
import org.springblade.core.mp.support.Query;
import java.util.Map;
/**
* 车检模板服务类
*
* @date 2024-05-28
*/
public interface ICarCheckTemplateService extends IService<CarCheckTemplateEntity> {
/**
* 新增车检模板
* @param dto 车检模板dto类
* @return true-成功false-失败
*/
boolean saveCarCheckTemplate(CarCheckTemplateDTO dto);
/**
* 根据名称获取车检模板
* @param name 模板名称
* @return 车检模板实体类
*/
CarCheckTemplateEntity getCarCheckTemplateByName(String name);
/**
* 修改车检模板
* @param dto 车检模板dto类
* @return true-成功false-失败
*/
boolean updateCarCheckTemplate(CarCheckTemplateDTO dto);
/**
* 删除车检模板
* @param id 模板id
* @return true-成功false-失败
*/
boolean removeCarCheckTemplate(Long id);
/**
* 车检模板详情
* @param id 模板id
* @return 模板详情VO类
*/
CarCheckTemplateDetailVO getCarCheckTemplateDetail(Long id);
/**
* 车检分页
* @param query 分页类
* @param param 参数
* @return 分页
*/
IPage<CarCheckTemplateEntity> getCarCheckTemplatePage(Query query, Map<String, Object> param);
}

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);
} }

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

@ -18,6 +18,7 @@ import com.hnac.hzims.safeproduct.service.ICarCheckRecordService;
import com.hnac.hzims.safeproduct.utils.BaseUtil; import com.hnac.hzims.safeproduct.utils.BaseUtil;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO; import com.hnac.hzims.safeproduct.vo.CarCheckRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO; import com.hnac.hzims.safeproduct.vo.CarCheckRecordPageVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -68,16 +69,17 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
String lastCode = getLastCode(currentNormMonth); String lastCode = getLastCode(currentNormMonth);
String code = BaseUtil.getUniqueCode("CLJC", lastCode, currentSimpleMonth); String code = BaseUtil.getUniqueCode("CLJC", lastCode, currentSimpleMonth);
carCheckRecordEntity.setCode(code); carCheckRecordEntity.setCode(code);
// 新增车检记录成功,新增相关检查项数据 // 新增车检记录
boolean saveRecord = this.save(carCheckRecordEntity); boolean saveRecord = this.save(carCheckRecordEntity);
if (saveRecord) { if (!saveRecord) {
throw new ServiceException("车检记录新增失败");
}
// 新增车检项
CarCheckRecordEntity recordEntity = getCarCheckRecordByCode(code); CarCheckRecordEntity recordEntity = getCarCheckRecordByCode(code);
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList(); List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
itemList.forEach(x -> x.setCarCheckRecordId(recordEntity.getId())); itemList.forEach(x -> x.setCarCheckRecordId(recordEntity.getId()));
return carCheckItemService.saveBatch(itemList); return carCheckItemService.saveBatch(itemList);
} }
return false;
}
/** /**
* 车检记录详情 * 车检记录详情
@ -157,22 +159,24 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean updateCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO) { public boolean updateCarCheckRecord(CarCheckRecordDTO carCheckRecordDTO) {
boolean deleteFlag = carCheckItemService.removeRelativeCarCheckItem(carCheckRecordDTO.getId()); // 修改车检记录
if (!deleteFlag){
return false;
}
// 更新检查项
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
itemList.forEach(x -> {x.setCarCheckRecordId(carCheckRecordDTO.getId());
x.setId(null);});
boolean b = carCheckItemService.saveBatch(itemList);
if (b) {
// 若更新检查项成功,则更新车检记录
CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity(); CarCheckRecordEntity carCheckRecordEntity = new CarCheckRecordEntity();
BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity); BeanUtil.copyProperties(carCheckRecordDTO, carCheckRecordEntity);
return this.updateById(carCheckRecordEntity); boolean updateRecord = this.updateById(carCheckRecordEntity);
if (!updateRecord) {
throw new ServiceException("车检记录更新失败");
} }
return false; // 删除旧的检查项
boolean deleteItem = carCheckItemService.removeRelativeCarCheckItem(carCheckRecordDTO.getId());
if (!deleteItem) {
throw new ServiceException("旧的车检记录检查项删除失败");
}
// 新增新的检查项
List<CarCheckItemEntity> itemList = carCheckRecordDTO.getItemList();
itemList.forEach(x -> {
x.setCarCheckRecordId(carCheckRecordDTO.getId());
});
return carCheckItemService.saveBatch(itemList);
} }
/** /**
@ -182,10 +186,10 @@ public class CarCheckRecordServiceImpl extends ServiceImpl<CarCheckRecordMapper,
@Override @Override
public boolean removeCarCheckRecord(Long id) { public boolean removeCarCheckRecord(Long id) {
boolean remove = this.removeById(id); boolean remove = this.removeById(id);
if (remove) { if (!remove) {
return carCheckItemService.removeRelativeCarCheckItem(id); throw new ServiceException("车检记录删除失败");
} }
return false; return carCheckItemService.removeRelativeCarCheckItem(id);
} }
/** /**
@ -195,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));

37
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckTemplateDetailServiceImpl.java

@ -0,0 +1,37 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateDetailEntity;
import com.hnac.hzims.safeproduct.mapper.CarCheckTemplateDetailMapper;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 车检模板详情服务实现类
*
* @date 2024-05-30
*/
@Service
public class CarCheckTemplateDetailServiceImpl extends ServiceImpl<CarCheckTemplateDetailMapper, CarCheckTemplateDetailEntity>
implements ICarCheckTemplateDetailService {
/**
* 删除关联的模板详情数据
*/
@Override
public boolean removeReferenceDetail(Long templateId) {
List<CarCheckTemplateDetailEntity> list = this.getReferenceDetail(templateId);
List<Long> ids = list.stream().map(CarCheckTemplateDetailEntity::getId).collect(Collectors.toList());
return this.removeByIds(ids);
}
@Override
public List<CarCheckTemplateDetailEntity> getReferenceDetail(Long templateId) {
QueryWrapper<CarCheckTemplateDetailEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckTemplateDetailEntity::getTemplateId, templateId);
return this.list(queryWrapper);
}
}

161
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarCheckTemplateServiceImpl.java

@ -0,0 +1,161 @@
package com.hnac.hzims.safeproduct.service.impl;
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.safeproduct.dto.CarCheckTemplateDTO;
import com.hnac.hzims.safeproduct.entity.*;
import com.hnac.hzims.safeproduct.mapper.CarCheckTemplateMapper;
import com.hnac.hzims.safeproduct.service.ICarCheckTemplateService;
import com.hnac.hzims.safeproduct.vo.CarCheckTemplateDetailVO;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.system.feign.ISysClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 车检模板服务实现类
*
* @date 2024-05-28
*/
@Service
public class CarCheckTemplateServiceImpl extends ServiceImpl<CarCheckTemplateMapper, CarCheckTemplateEntity> implements ICarCheckTemplateService {
@Autowired
ICarCheckTemplateDetailService carCheckTemplateDetailService;
@Resource
CarCheckTemplateMapper carCheckTemplateMapper;
@Autowired
ISysClient sysClient;
/**
* 新增车检模板
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveCarCheckTemplate(CarCheckTemplateDTO dto) {
String templateName = dto.getTemplateName();
// 重名校验
CarCheckTemplateEntity template = getCarCheckTemplateByName(templateName);
if (template != null) {
throw new ServiceException("模板名不可重复");
}
// 新增车检模板
CarCheckTemplateEntity templateEntity = new CarCheckTemplateEntity();
templateEntity.setTemplateName(templateName);
boolean saveTemplate = this.save(templateEntity);
if (!saveTemplate) {
throw new ServiceException("车检模板新增失败");
}
// 新增模板详情
template = getCarCheckTemplateByName(templateName);
List<CarCheckTemplateDetailEntity> details = dto.getDetailList();
for (CarCheckTemplateDetailEntity detail : details) {
detail.setTemplateId(template.getId());
}
return carCheckTemplateDetailService.saveBatch(details);
}
/**
* 根据名称获取车检模板
*/
public CarCheckTemplateEntity getCarCheckTemplateByName(String name) {
QueryWrapper<CarCheckTemplateEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckTemplateEntity::getTemplateName, name);
return this.getOne(queryWrapper);
}
/**
* 修改车检模板
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateCarCheckTemplate(CarCheckTemplateDTO dto) {
String templateName = dto.getTemplateName();
Long templateId = dto.getId();
// 重名校验
QueryWrapper<CarCheckTemplateEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(CarCheckTemplateEntity::getTemplateName, templateName);
queryWrapper.lambda().ne(CarCheckTemplateEntity::getId, templateId);
CarCheckTemplateEntity template = this.getOne(queryWrapper);
if (template != null) {
throw new ServiceException("模板名不可重复");
}
// 更新模板
CarCheckTemplateEntity templateEntity = new CarCheckTemplateEntity();
templateEntity.setId(templateId);
templateEntity.setTemplateName(templateName);
boolean updateTemplate = this.updateById(templateEntity);
if (!updateTemplate) {
throw new ServiceException("车检模板更新失败");
}
// 更新模板详情
// 删除旧的模板详情数据
boolean removeDetail = carCheckTemplateDetailService.removeReferenceDetail(templateId);
if (!removeDetail) {
throw new ServiceException("车检模板详情数据删除失败");
}
// 新增新的模板详情数据
List<CarCheckTemplateDetailEntity> detailList = dto.getDetailList();
for (CarCheckTemplateDetailEntity detail : detailList) {
detail.setTemplateId(templateId);
}
return carCheckTemplateDetailService.saveBatch(detailList);
}
/**
* 删除车检模板
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean removeCarCheckTemplate(Long id) {
boolean removeTemplate = this.removeById(id);
if (!removeTemplate) {
throw new ServiceException("车检模板删除失败");
}
return carCheckTemplateDetailService.removeReferenceDetail(id);
}
/**
* 车检模板详情
*/
@Override
public CarCheckTemplateDetailVO getCarCheckTemplateDetail(Long id) {
CarCheckTemplateEntity templateEntity = this.getById(id);
CarCheckTemplateDetailVO vo = new CarCheckTemplateDetailVO();
vo.setId(templateEntity.getId());
vo.setTemplateName(templateEntity.getTemplateName());
List<CarCheckTemplateDetailEntity> list = carCheckTemplateDetailService.getReferenceDetail(id);
vo.setTemplateDetailList(list);
return vo;
}
/**
* 车检分页
*/
@Override
public IPage<CarCheckTemplateEntity> getCarCheckTemplatePage(Query query, Map<String, Object> param) {
IPage<CarCheckTemplateEntity> page = new Page<>(query.getCurrent(), query.getSize());
IPage<CarCheckTemplateEntity> templatePage = carCheckTemplateMapper.getCarCheckTemplatePage(page, param);
List<CarCheckTemplateEntity> templateList = templatePage.getRecords();
// 获取机构名
templateList.forEach(template -> {
R<String> deptName = sysClient.getDeptName(template.getCreateDept());
if (deptName.isSuccess()) {
template.setCreateDeptName(deptName.getData());
}
});
templatePage.setRecords(templateList);
return templatePage;
}
}

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 名称

28
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ICarCheckTemplateDetailService.java

@ -0,0 +1,28 @@
package com.hnac.hzims.safeproduct.service.impl;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.safeproduct.entity.CarCheckTemplateDetailEntity;
import java.util.List;
/**
* 车检模板详情服务类
*
* @date 2024-05-30
*/
public interface ICarCheckTemplateDetailService extends IService<CarCheckTemplateDetailEntity> {
/**
* 删除关联的模板详情数据
* @param templateId 模板id
* @return true-成功false-失败
*/
boolean removeReferenceDetail(Long templateId);
/**
* 查询关联的模板详情列表
* @param templateId 模板id
* @return 模板详情列表
*/
List<CarCheckTemplateDetailEntity> getReferenceDetail(Long templateId);
}

31
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,9 +285,39 @@ 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("")) {
// 未完成计划包括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().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();
} }

30
hzims-service/safeproduct/src/main/resources/db/2.0.1.sql

@ -47,3 +47,33 @@ CREATE TABLE IF NOT EXISTS `hzims_hygiene_template_detail` (
-- 添加考试及格分字段 -- 添加考试及格分字段
ALTER TABLE hzims_test 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_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 '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`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='车检模板表';
-- 新增车检模板详情表
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 '检查项目',
`check_content` mediumtext NOT NULL COMMENT '检查内容',
`create_user` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建人',
`create_dept` bigint(20) NOT NULL DEFAULT '-1' COMMENT '创建部门',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_user` bigint(20) DEFAULT '-1' COMMENT '更新人',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间',
`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='车检模板详情表';
Loading…
Cancel
Save