Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
zhongwei
ty 8 months ago
parent
commit
8beb838884
  1. 4
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java
  2. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java
  3. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  4. 6
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java
  5. 7
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java
  6. 5
      hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java
  7. 3
      hzims-service/equipment/src/main/resources/db/2.0.0.sql.1
  8. 24
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java
  9. 2
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigServiceImpl.java
  10. 10
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/monitor/service/impl/AlarmSaveServiceImpl.java
  11. 11
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java
  12. 7
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/HZ300MqttConsumer.java
  13. 3
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleMapper.xml
  14. 3
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/wrapper/HandleWrapper.java
  15. 11
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java
  16. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java
  17. 59
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java
  18. 139
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java
  19. 3
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/AlarmQueryMapper.java
  20. 31
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java
  21. 5
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java
  22. 13
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmService.java
  23. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/InterruptionAlarmService.java
  24. 136
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java
  25. 244
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  26. 107
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/InterruptionAlarmServiceImpl.java
  27. 8
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java
  28. 50
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
  29. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  30. 7
      hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/AlarmQueryMapper.xml
  31. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/wrapper/OfflineRecordWrapper.java
  32. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/entity/InspectionTaskSMS.java
  33. 18
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml
  34. 14
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
  35. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java
  36. 2
      hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
  37. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgPushRecordWrapper.java
  38. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgSmsRecordWrapper.java
  39. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgWsRecordHistoryWrapper.java
  40. 4
      hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgWsRecordWrapper.java
  41. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java
  42. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/excel/BaseExport.java
  43. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java
  44. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  45. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  46. 31
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java
  47. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java
  48. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java
  49. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/wrapper/AreaMapWrapper.java
  50. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java
  51. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  52. 76
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  53. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectWrapper.java
  54. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperFaultWrapper.java
  55. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperPhenomenonWrapper.java
  56. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyGroupClient.java
  57. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyClassMapper.java
  58. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyChangeServiceImpl.java
  59. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyEmergencyServiceImpl.java
  60. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
  61. 28
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  62. 22
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  63. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java
  64. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/OverConfigService.java
  65. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/OverDetailsService.java
  66. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/OverConfigServiceImpl.java
  67. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/OverDetailsServiceImpl.java
  68. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java
  69. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OtherWrapper.java
  70. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverConfigWrapper.java
  71. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverDetailsWrapper.java
  72. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverWrapper.java
  73. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/PowerWrapper.java
  74. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/RainfallWrapper.java
  75. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/SolveWrapper.java
  76. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/StorageWrapper.java
  77. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java
  78. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/WindWrapper.java
  79. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/dto/BusinessFileDto.java
  80. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/dto/ScanDto.java
  81. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  82. 160
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/ScanServiceImpl.java
  83. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WindHomeServiceImpl.java
  84. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java
  85. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java
  86. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java
  87. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java
  88. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java
  89. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java
  90. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/schedule/OperPersonalCreateMonthReport.java
  91. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java
  92. 18
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  93. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  94. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  95. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java
  96. BIN
      hzims-service/operational/src/main/resources/template/excel/access_import_template.xlsx
  97. 1
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ReviewController.java
  98. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/scheduled/SafeToolTypePushUserTask.java
  99. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/EmergencyPlanServiceImpl.java
  100. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/ImsMonAlarmInfoWrapper.java
  101. Some files were not shown because too many files have changed in this diff Show More

4
hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java

@ -64,4 +64,8 @@ public interface AlarmConstants {
List<String> HZ3000_TYPES = Arrays.asList("0","1","2","3","4","5","6","7","8","9","10","11","12");
String SMS_MESSAGE_TEMPLATE_CODE = "aliyun-alert-push";
String FDP_INVALID_STATUS = "1.0";
String FDP_INVALID_ZOME_STATUS = "1";
}

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/dto/OperDefectRepeatRatioDTO.java

@ -27,9 +27,13 @@ public class OperDefectRepeatRatioDTO {
// @ApiModelProperty(value = "缺陷等级名称")
// private String defectLevelName;
@ApiModelProperty(value = "发生数量")
@ApiModelProperty(value = "重复缺陷发生数量")
private Long happenNum = 0L;
@ApiModelProperty(value = "缺陷发生总数")
private Long happenSumNum = 0L;
@ApiModelProperty(value = "占总缺陷的比率")
private Double happenRatio = 0.0;

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -70,6 +70,9 @@ public interface MainConstants {
// 集中监控数据处理
String CENTRALIZED_MONITORING = "centralizedMonitoring";
// 清理历史告警数据
String CLEAR_HISTORY_ALARM = "clearHistoryAlarm";
// 开停机告警
String START_STOP_ALARM = "startStopAlarm";

6
hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/SpWarehouseOutController.java

@ -11,7 +11,6 @@ import com.hnac.hzims.spare.entity.SpWarehouseOutEntity;
import com.hnac.hzims.spare.service.ISpWarehouseOutService;
import com.hnac.hzims.spare.vo.SpWarehouseExportVO;
import com.hnac.hzims.spare.vo.SpWarehouseOutVO;
import com.hnac.hzims.vo.VoteChartVo;
import com.hnac.hzinfo.log.annotation.Business;
import com.hnac.hzinfo.log.annotation.Operate;
import io.swagger.annotations.Api;
@ -39,7 +38,6 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 控制器
*
@ -81,6 +79,7 @@ public class SpWarehouseOutController extends BladeController {
IPage<SpWarehouseOutVO> pages = sp_warehouse_outService.selectPageList(Condition.getPage(query),warehouseOutVO);
return R.data(pages);
}
/**
* 分页 代码自定义代号
*/
@ -120,6 +119,7 @@ public class SpWarehouseOutController extends BladeController {
e.printStackTrace();
}
}
/**
* 工单预警
*/
@ -165,7 +165,6 @@ public class SpWarehouseOutController extends BladeController {
return R.status(sp_warehouse_outService.saveOrUpdate(sp_warehouse_out));
}
/**
* 删除 代码自定义代号
*/
@ -176,6 +175,7 @@ public class SpWarehouseOutController extends BladeController {
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(sp_warehouse_outService.deleteLogic(Func.toLongList(ids)));
}
/**
* 完成流程 修改状态
*/

7
hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.java

@ -1,10 +1,8 @@
package com.hnac.hzims.spare.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.spare.entity.SpWarehouseOutEntity;
import com.hnac.hzims.spare.vo.SpWarehouseOutVO;
import feign.Param;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
@ -19,6 +17,7 @@ import java.util.Map;
public interface SpWarehouseOutMapper extends UserDataScopeBaseMapper<SpWarehouseOutEntity> {
String selectMaxCode(Map<String,Object> params);
/**
* 分页列表
* @param page
@ -27,8 +26,10 @@ public interface SpWarehouseOutMapper extends UserDataScopeBaseMapper<SpWarehous
*/
@UserDataAuth
List<SpWarehouseOutVO> selectPageList(IPage<SpWarehouseOutVO> page, Map<String,Object> params);
// @UserDataAuth
@UserDataAuth
List<SpWarehouseOutVO> selectListByCondition( Map<String,Object> params);
/**
* 根据工单ID查询出库单编码
* @param ticketId

5
hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpWarehouseOutServiceImpl.java

@ -17,15 +17,12 @@ import com.hnac.hzims.spare.vo.WtSpBasicVO;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.launch.constant.FlowConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDictBizClient;
import org.springblade.system.feign.ISysClient;
@ -34,13 +31,11 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 服务实现类

3
hzims-service/equipment/src/main/resources/db/2.0.0.sql.1

@ -33,3 +33,6 @@ update equipment.hzims_em_definition set type = '2' where type = '0';
update bladex.blade_dict set dict_key = '2' where id = 1675699613977288706;
update equipment.hzims_em_definition set type = '2' where type = '0';
-- 修改故障诊断任务表的字符集
ALTER TABLE hzims_fdp_task CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

24
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigDetailServiceImpl.java

@ -92,26 +92,20 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDet
AlarmHandleMarkVo mark = new AlarmHandleMarkVo();
mark.setIsRightTabulation(0);
mark.setIsSmallBell(0);
switch (type){
case 2:
mark.setIsShowAlert(0);
mark.setIsMask(1);
mark.setIsBroadcast(0);
mark.setIsPlatformMessage(0);
mark.setIsShortMessage(0);
mark.setIsWxMessage(0);
break;
case 3:
case 5:
mark.setIsShowAlert(1);
mark.setIsMask(1);
mark.setIsBroadcast(1);
mark.setIsPlatformMessage(1);
mark.setIsShortMessage(1);
mark.setIsWxMessage(1);
break;
case 13:
case 14:
if(2 == type){
mark.setIsShowAlert(0);
mark.setIsMask(1);
mark.setIsBroadcast(0);
mark.setIsPlatformMessage(0);
mark.setIsShortMessage(0);
mark.setIsWxMessage(0);
}else if(13 == type || 14 == type){
mark.setIsShowAlert(0);
mark.setIsMask(0);
mark.setIsBroadcast(1);
@ -119,11 +113,11 @@ public class AlarmConfigDetailServiceImpl extends BaseServiceImpl<AlarmConfigDet
mark.setIsShortMessage(0);
mark.setIsWxMessage(0);
mark.setIsSmallBell(1);
break;
}
return mark;
}
/**
* 等级告警默认处理标识
* @param type

2
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/service/impl/AlarmConfigServiceImpl.java

@ -111,7 +111,7 @@ public class AlarmConfigServiceImpl extends BaseServiceImpl<AlarmConfigMapper, A
.eq(AlarmConfigDetailEntity::getAlarmType,source)
.eq(AlarmConfigDetailEntity::getAlarmChiledType,type)
);
if(ObjectUtil.isEmpty(config)){
if(ObjectUtil.isEmpty(detail)){
return detailService.defaultMark(source,type);
}
AlarmHandleMarkVo mark = new AlarmHandleMarkVo();

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

@ -46,12 +46,11 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
// 步骤1.查询告警数据对应站点
R<List<StationEntity>> result = stationClient.querySatationByCodes(alarms.stream().map(AlarmEntity::getStationId).collect(Collectors.toList()));
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
log.error("alarm query station is null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList()));
log.error("alarm_query_station_is_null : {}",alarms.stream().map(AlarmEntity::getAlarmId).collect(Collectors.toList()));
return false;
}
// 步骤2.遍历保存告警数据
alarms.forEach(alarm->{
List<StationEntity> stations = result.getData().stream().filter(o->o.getCode().equals(alarm.getStationId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(stations)){
return;
@ -64,10 +63,9 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
// 步骤4.根据站点查询配置标识
AlarmHandleMarkVo mark = alarmConfigService.mark(alarm.getStationId(),alarm.getAlarmSource(),alarm.getAlarmType());
if(ObjectUtil.isEmpty(mark)){
log.error("alarm obtain mark is null : {}",alarm.getAlarmId());
log.error("alarm_obtain_mark_is_null : {}",alarm.getAlarmId());
return;
}
// 步骤5.告警处理标识赋值
alarm.setIsRightTabulation(mark.getIsRightTabulation());
alarm.setIsBroadcast(mark.getIsBroadcast());
@ -77,11 +75,10 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
alarm.setIsSmallBell(mark.getIsSmallBell());
alarm.setIsShortMessage(mark.getIsShortMessage());
alarm.setIsWxMessage(mark.getIsWxMessage());
// 步骤6.保存当日告警数据
boolean isSave = alarmService.save(alarm);
if(!isSave){
log.error("alarm save fail : {}",alarm.getAlarmId());
log.error("alarm_save_fail : {}",alarm.getAlarmId());
return;
}
@ -90,4 +87,5 @@ public class AlarmSaveServiceImpl implements AlarmSaveService {
});
return true;
}
}

11
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/FdpMqttConsumer.java

@ -2,10 +2,12 @@ package com.hnac.hzims.alarm.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.source.service.FdpAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzims.alarm.source.service.FdpAlarmService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,6 +20,7 @@ import java.util.Map;
*/
@Service
@Slf4j
public class FdpMqttConsumer implements SubscribeCallBack {
@Autowired
private FdpAlarmService fdpAlarmService;
@ -25,11 +28,15 @@ public class FdpMqttConsumer implements SubscribeCallBack {
private AlarmSaveService alarmSaveService;
@Override
public void onMessage(Map<String, Object> data) {
System.out.println("监听到消息"+data.toString());
String s = JSONObject.toJSONString(data);
log.error("监听Fdp消息 : {}" ,s);
//消费代码
List<AlarmEntity> alarmEntities = fdpAlarmService.receiveMessage(s);
if(CollectionUtil.isEmpty(alarmEntities)){
return;
}
log.error("监听Fdp有效消息 : {}" ,alarmEntities.get(0).getAlarmId());
//统一数据处理
try {
alarmSaveService.save(alarmEntities);

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

@ -6,6 +6,7 @@ import com.hnac.hzims.alarm.source.service.SystemAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import com.hnac.hzinfo.subscribe.SubscribeCallBack;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -31,11 +32,15 @@ public class HZ300MqttConsumer implements SubscribeCallBack {
log.error("HZ3000队列监听到消息 : {}",data);
//消费代码
List<AlarmEntity> alarmEntities = systemAlarmService.receiveMessage(JSONObject.toJSONString(data));
if(CollectionUtil.isEmpty(alarmEntities)){
log.error("HZ3000消息转换数据异常");
return;
}
//统一数据处理
try {
alarmSaveService.save(alarmEntities);
}catch (Exception e){
log.error("HZ3000告警数据处理报错(HZ300Alarm):"+e);
log.error("HZ3000告警数据处理报错(HZ300Alarm):{}" , e.getMessage());
}
}
}

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

@ -4,9 +4,10 @@
<select id="selectHandlePage" resultType="com.hnac.hzims.alarm.config.vo.AlarmHandleVo">
SELECT H.*,S.NAME AS STATION_NAME
SELECT H.*,S.NAME AS STATION_NAME,F.PROCESS_INSTANCE_ID
FROM HZIMS_ALARM_HANDLE H
LEFT JOIN HZIMS_OPERATION.HZIMS_STATION S ON H.STATION_CODE = S.CODE
LEFT JOIN HZIMS_ALARM_HANDLE_FLOW F ON H.ALARM_ID = F.ALARM_ID
<where>
H.IS_DELETED = 0
<if test="param.stationCode != null">

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

@ -21,8 +21,7 @@ public class HandleWrapper extends BaseEntityWrapper<AlarmHandleVo,AlarmHandleVo
if(ObjectUtil.isEmpty(createUser)){
return entity;
}
assert entity != null;
entity.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
entity.setUserName(createUser.getRealName());
return entity;
}
}

11
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java

@ -26,8 +26,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import static com.hnac.hzims.alarm.config.constants.AlarmConstants.EARLY;
import static com.hnac.hzims.alarm.config.constants.AlarmConstants.EARLY_WARNING;
import static com.hnac.hzims.alarm.config.constants.AlarmConstants.*;
/**
* 等级告警实现类
@ -73,8 +72,10 @@ public class FdpAlarmServiceImpl implements FdpAlarmService {
if (ObjectUtils.isEmpty(alarms)) {
return new ArrayList<>();
}
AlarmEntity entity = getAlarmEntity(alarms);
return Collections.singletonList(entity);
if(FDP_INVALID_STATUS.equals(alarms.getStatus()) || FDP_INVALID_ZOME_STATUS.equals(alarms.getStatus())){
return Collections.singletonList(getAlarmEntity(alarms));
}
return new ArrayList<>();
}
private AlarmEntity getAlarmEntity(FdpAlarmVo item) {
@ -87,7 +88,7 @@ public class FdpAlarmServiceImpl implements FdpAlarmService {
entity.setAlarmType(EARLY);
entity.setDeviceCode(item.getDeviceId());
entity.setDeviceName(item.getDeviceName());
entity.setAlarmStatus(0);
entity.setAlarmStatus(1);
entity.setAlarmValue(item.getInfo());
entity.setStationId(item.getStation());
entity.setDiagReason(item.getDiagReason());

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/SystemAlarmServiceImpl.java

@ -74,7 +74,6 @@ public class SystemAlarmServiceImpl implements SystemAlarmService {
public List<AlarmEntity> receiveMessage(String message) {
// 对象转换
SystemAlarmVo systemAlarm = JSONObject.parseObject(message, SystemAlarmVo.class);
log.error("HZ3000告警对象转换后:{}",systemAlarm);
if (ObjectUtils.isEmpty(systemAlarm)) {
return new ArrayList<>();
}

59
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java

@ -1,59 +0,0 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.source.service.LevelAlarmService;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.net.URI;
/**
* @author ysj
*/
@Slf4j
@Component
@EnableScheduling
public class LevelAlarmRegular {
@Autowired
private LevelAlarmService levelService;
private LevelAlarmWebSocket socket;
@Value("${hzims.level.wss-url}")
private String level_wss_url;
// 两分钟进行一次检查链接是否存活,不存活了重新建立链接
@Scheduled(cron = "0 0/2 * * * ?")
private void regular(){
// 检查链接存活状态
if(ObjectUtil.isEmpty(socket) || !socket.isOpen()){
log.error("level websocket survival check : {}","死亡");
this.createSocket();
if(ObjectUtil.isNotEmpty(socket) && socket.isOpen()){
String message = levelService.message();
if(!StringUtil.isEmpty(message)){
socket.send(message);
}
}
log.error("level websocket survival check : {}","重新建立链接");
}else{
log.error("level websocket survival check : {}","存活");
}
}
// 创建websocket链接
private void createSocket() {
try{
socket = new LevelAlarmWebSocket(new URI(level_wss_url));
socket.connectBlocking();
}catch (Exception e){
log.error("level create error : {}",e.getMessage());
}
}
}

139
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java

@ -1,139 +0,0 @@
package com.hnac.hzims.alarm.ws.level;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.source.service.LevelAlarmService;
import com.hnac.hzims.alarm.monitor.service.AlarmSaveService;
import lombok.extern.slf4j.Slf4j;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.handshake.ServerHandshake;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.core.tool.utils.StringUtil;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.net.Socket;
import java.net.URI;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Optional;
/**
* @author ysj
*/
@Slf4j
public class LevelAlarmWebSocket extends WebSocketClient {
private final LevelAlarmService levelService;
private AlarmSaveService alarmSaveService;
/**
* 构造等级告警websocket
* @param uri
*/
public LevelAlarmWebSocket(URI uri) {
super(uri);
levelService = SpringUtil.getBean(LevelAlarmService.class);
connection(this);
}
// 链接到服务器回调接口
@Override
public void onOpen(ServerHandshake handshakedata) {
log.error("systemAlarm websocket open");
}
// 接收到服务器消息回调接口
@Override
public void onMessage(String message) {
if(StringUtil.isEmpty(message)){
log.error("level alarm on message is null");
}else{
// 告警数据转化
List<AlarmEntity> alarmEntities = levelService.receiveMessage(message);
// 等级告警数据处理
try {
//websocket 消息推送保存
alarmSaveService.save(alarmEntities);
}catch (Exception e){
throw new ServiceException("集中监控告警数据处理报错(levelAlarm):"+e);
}
}
}
// 与服务器链接中断回调接口
@Override
public void onClose(int code, String reason, boolean remote) {
log.error("level alarm websocket close");
}
// 与服务器通讯异常触发
@Override
public void onError(Exception e) {
log.error("level alarm websocket error : {}",e.getMessage());
}
/**
* 建立链接
* @param webSocket
*/
private void connection(LevelAlarmWebSocket webSocket) {
SSLContext context = init();
if(Optional.ofNullable(context).isPresent()){
Socket socket = create(context);
if(Optional.ofNullable(socket).isPresent()){
webSocket.setSocket(socket);
}
}
}
/**
* 创建Socket
* @param context
* @return
*/
private Socket create(SSLContext context) {
Socket socket = null;
try{
socket = context.getSocketFactory().createSocket();
}catch (Exception e){
log.error("level alarm socket create error : {}",e.getMessage());
}
return socket;
}
/**
* 协议初始化
* @return SSLContext
*/
private SSLContext init() {
SSLContext SSL = null;
try{
SSL = SSLContext.getInstance("TLS");
SSL.init(null, new TrustManager[]{new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain,
String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}}, new SecureRandom());
}catch (Exception e){
log.error("level alarm SSL init error : {}",e.getMessage());
}
return SSL;
}
}

3
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/AlarmQueryMapper.java

@ -2,11 +2,12 @@ package com.hnac.hzims.scheduled.mapper.alarm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import org.apache.ibatis.annotations.Param;
/**
* @author ysj
*/
public interface AlarmQueryMapper extends BaseMapper<AlarmEntity> {
void clear(@Param("alarmTime") String param);
}

31
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/AlarmScheduledTask.java

@ -1,6 +1,7 @@
package com.hnac.hzims.scheduled.scheduled;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.AlarmService;
import com.hnac.hzims.scheduled.service.alarm.InterruptionAlarmService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
@ -13,8 +14,7 @@ import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.INTERRUPT_ALARM;
import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_ALARM;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**
@ -26,10 +26,22 @@ import static com.hnac.hzims.operational.main.constant.MainConstants.START_STOP_
public class AlarmScheduledTask {
@Autowired
private AlarmQueryService alarmQueryService;
private AlarmService alarmService;
@Autowired
private InterruptionAlarmService interruptionService;
/**
* 实时告警数据清除
* @return ReturnT<String>
*/
@XxlJob(CLEAR_HISTORY_ALARM)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> clearHistoryAlarm(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00");
}
alarmService.clearHistoryAlarm(param);
return new ReturnT<>("SUCCESS");
}
/**
* 开停机告警
@ -41,17 +53,22 @@ public class AlarmScheduledTask {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
alarmQueryService.startStopAlarm(param);
alarmService.startStopAlarm(param);
return new ReturnT<>("SUCCESS");
}
/**
* 数据通讯中断
* @param param
* @return
*/
@XxlJob(INTERRUPT_ALARM)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> interruption(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
interruptionService.interruption(param);
alarmService.interruption(param);
return new ReturnT<>("SUCCESS");
}
}

5
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmQueryService.java

@ -10,10 +10,7 @@ import java.util.List;
*/
public interface AlarmQueryService extends BaseService<AlarmEntity> {
void startStopAlarm(String param);
void clear(String param);
List<String> bells(List<String> codes);
List<String> aborts(List<String> codes);
}

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

@ -0,0 +1,13 @@
package com.hnac.hzims.scheduled.service.alarm;
/**
* @author ysj
*/
public interface AlarmService {
void startStopAlarm(String param);
void clearHistoryAlarm(String param);
void interruption(String param);
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/InterruptionAlarmService.java

@ -3,10 +3,14 @@ package com.hnac.hzims.scheduled.service.alarm;
import com.hnac.hzims.business.interruption.entity.InterruptionEntity;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* @author ysj
*/
public interface InterruptionAlarmService extends BaseService<InterruptionEntity> {
void interruption(String param);
List<String> aborts(List<String> codes);
}

136
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmQueryServiceImpl.java

@ -34,115 +34,9 @@ import java.util.stream.Collectors;
public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, AlarmEntity> implements AlarmQueryService {
private final StationService stationService;
private final RedisTemplate redisTemplate;
private final static String start_stop_cache_final = "hzims:operation:start:stop:key";
private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key";
/**
* 开停机告警
* @param param
*/
@Override
public void startStopAlarm(String param) {
// 获取站点开关机状态
Map<String,Integer> startStopMap = (HashMap<String, Integer>) redisTemplate.opsForValue().get(start_stop_cache_final);
// 查询接入水电站点
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>()
.eq(StationEntity::getDataOrigin,0)
.eq(StationEntity::getType, HomePageConstant.HYDROPOWER)
);
if(CollectionUtil.isEmpty(stations)){
return;
}
// 获取站点设备实时数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key);
if(CollectionUtil.isEmpty(reals)){
return;
}
Map<String,Integer> refresh = new HashMap<>();
// 实时设备遍历
reals.forEach(real->{
// 过滤站点
List<StationEntity> list = stations.stream().filter(item -> item.getRefDept().equals(real.getDeptId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(list)){
return;
}
// 确定站点
StationEntity station = list.get(0);
// 数据初始化记录
if(CollectionUtil.isEmpty(startStopMap)){
if(Math.abs(real.getActivePower()) > 0){
refresh.put(real.getDeviceCode(),1);
}else{
refresh.put(real.getDeviceCode(),0);
}
return;
}
// 比对开机状态
if(Math.abs(real.getActivePower()) > 0){
if(startStopMap.get(real.getDeviceCode()) == 0){
refresh.put(real.getDeviceCode(),1);
// 记录开机告警
this.saveStartStopAlarm(station,real,1);
}else{
refresh.put(real.getDeviceCode(),0);
}
}else{
if(startStopMap.get(real.getDeviceCode()) == 1){
refresh.put(real.getDeviceCode(),0);
// 记录关机告警
this.saveStartStopAlarm(station,real,0);
}else{
refresh.put(real.getDeviceCode(),1);
}
}
});
redisTemplate.opsForValue().set(start_stop_cache_final,refresh);
}
/**
* 保存站点设备开关机告警
* @param station
* @param real
* @param state
*/
private void saveStartStopAlarm(StationEntity station, HydropowerUnitRealVo real, int state) {
AlarmEntity alarm = new AlarmEntity();
alarm.setStationId(station.getCode());
alarm.setStationName(station.getName());
alarm.setDeviceCode(real.getDeviceCode());
alarm.setDeviceName(real.getDeviceName());
alarm.setAlarmId(station.getCode() + "_" + Func.randomUUID());
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_关机");
alarm.setAlarmSource(AlarmConstants.START_STOP_WARNING);
alarm.setAlarmType(AlarmConstants.STOP);
if(state == 1){
alarm.setAlarmType(AlarmConstants.START);
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_开机");
}
alarm.setStatus(0);
alarm.setAlarmTime(new Date());
alarm.setIsRightTabulation(0);
alarm.setIsShowAlert(1);
alarm.setIsSmallBell(1);
alarm.setIsMask(1);
alarm.setIsBroadcast(0);
alarm.setIsPlatformMessage(1);
alarm.setIsShortMessage(1);
alarm.setIsWxMessage(1);
alarm.setTenantId(station.getTenantId());
alarm.setCreateDept(station.getRefDept());
alarm.setCreateUser(station.getCreateUser());
alarm.setUpdateUser(station.getUpdateUser());
alarm.setUpdateTime(station.getUpdateTime());
this.save(alarm);
public void clear(String param) {
this.baseMapper.clear(param);
}
/**
@ -162,30 +56,4 @@ public class AlarmQueryServiceImpl extends BaseServiceImpl<AlarmQueryMapper, Ala
}
return alarms.stream().map(AlarmEntity::getStationId).distinct().collect(Collectors.toList());
}
/**
* 查询站点数据中断
* @param codes
* @return
*/
@Override
public List<String> aborts(List<String> codes) {
List<AlarmEntity> alarms = this.list(Wrappers.<AlarmEntity>lambdaQuery()
.in(AlarmEntity::getStationId,codes)
.eq(AlarmEntity::getAlarmSource, AlarmConstants.HZ3000_ALARM)
.in(AlarmEntity::getAlarmType, Arrays.asList(AlarmConstants.INTERRUPT,AlarmConstants.ABNORMAL))
);
if(CollectionUtil.isEmpty(alarms)){
return new ArrayList<>();
}
return alarms.stream().collect(Collectors.groupingBy(AlarmEntity::getStationId)).values().stream().map(alarmEntities -> {
// 站点最近的一条数据中断、数据异常告警
AlarmEntity alarm = alarmEntities.stream().sorted(Comparator.comparing(AlarmEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
// 状态为中断
if (alarm.getAlarmStatus().equals(0)) {
return alarm.getStationId();
}
return "";
}).filter(StringUtil::isNotBlank).distinct().collect(Collectors.toList());
}
}

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

@ -0,0 +1,244 @@
package com.hnac.hzims.scheduled.service.alarm.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.business.interruption.constants.InterruptionConstants;
import com.hnac.hzims.business.interruption.entity.InterruptionEntity;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.AlarmService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import com.hnac.hzinfo.datasearch.soe.ISoeClient;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author ysj
*/
@AllArgsConstructor
@Service
@Slf4j
public class AlarmServiceImpl implements AlarmService {
private final StationService stationService;
private final AlarmQueryService alarmQueryService;
private final InterruptionAlarmServiceImpl interruptionAlarmService;
private final ISoeClient soeClient;
private final RedisTemplate redisTemplate;
private final static String start_stop_cache_final = "hzims:operation:start:stop:key";
private final static String load_hydropower_unit_real_key = "hzims:operation:loadhydropowerunit:real:key";
/**
* 开停机告警
* @param param
*/
@Override
public void startStopAlarm(String param) {
// 获取站点开关机状态
Map<String,Integer> startStopMap = (HashMap<String, Integer>) redisTemplate.opsForValue().get(start_stop_cache_final);
// 查询接入水电站点
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>()
.eq(StationEntity::getDataOrigin,0)
.eq(StationEntity::getType, HomePageConstant.HYDROPOWER)
);
if(CollectionUtil.isEmpty(stations)){
return;
}
// 获取站点设备实时数据
List<HydropowerUnitRealVo> reals = (List<HydropowerUnitRealVo>) redisTemplate.opsForValue().get(load_hydropower_unit_real_key);
if(CollectionUtil.isEmpty(reals)){
return;
}
Map<String,Integer> refresh = new HashMap<>();
// 实时设备遍历
reals.forEach(real->{
// 过滤站点
List<StationEntity> list = stations.stream().filter(item -> item.getRefDept().equals(real.getDeptId())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(list)){
return;
}
// 确定站点
StationEntity station = list.get(0);
// 数据初始化记录
if(CollectionUtil.isEmpty(startStopMap)){
if(Math.abs(real.getActivePower()) > 0){
refresh.put(real.getDeviceCode(),1);
}else{
refresh.put(real.getDeviceCode(),0);
}
return;
}
// 比对开机状态
if(Math.abs(real.getActivePower()) > 0){
if(startStopMap.get(real.getDeviceCode()) == 0){
refresh.put(real.getDeviceCode(),1);
// 记录开机告警
this.saveStartStopAlarm(station,real,1);
}else{
refresh.put(real.getDeviceCode(),0);
}
}else{
if(startStopMap.get(real.getDeviceCode()) == 1){
refresh.put(real.getDeviceCode(),0);
// 记录关机告警
this.saveStartStopAlarm(station,real,0);
}else{
refresh.put(real.getDeviceCode(),1);
}
}
});
redisTemplate.opsForValue().set(start_stop_cache_final,refresh);
}
/**
* 清理历史告警数据
* @param param
*/
@Override
public void clearHistoryAlarm(String param) {
this.alarmQueryService.clear(param);
}
/**
* 保存站点设备开关机告警
* @param station
* @param real
* @param state
*/
private void saveStartStopAlarm(StationEntity station, HydropowerUnitRealVo real, int state) {
AlarmEntity alarm = new AlarmEntity();
alarm.setStationId(station.getCode());
alarm.setStationName(station.getName());
alarm.setDeviceCode(real.getDeviceCode());
alarm.setDeviceName(real.getDeviceName());
alarm.setAlarmId(station.getCode() + "_" + Func.randomUUID());
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_关机");
alarm.setAlarmSource(AlarmConstants.START_STOP_WARNING);
alarm.setAlarmType(AlarmConstants.STOP);
if(state == 1){
alarm.setAlarmType(AlarmConstants.START);
alarm.setAlarmContext(station.getName() + "_" + real.getDeviceName() + "_开机");
}
alarm.setStatus(0);
alarm.setAlarmTime(new Date());
alarm.setIsRightTabulation(0);
alarm.setIsShowAlert(1);
alarm.setIsSmallBell(1);
alarm.setIsMask(1);
alarm.setIsBroadcast(0);
alarm.setIsPlatformMessage(1);
alarm.setIsShortMessage(1);
alarm.setIsWxMessage(1);
alarm.setTenantId(station.getTenantId());
alarm.setCreateDept(station.getRefDept());
alarm.setCreateUser(station.getCreateUser());
alarm.setUpdateUser(station.getUpdateUser());
alarm.setUpdateTime(station.getUpdateTime());
this.alarmQueryService.save(alarm);
}
/**
* 数据中断告警
* @param param
*/
@Override
public void interruption(String param) {
// 查询接入站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getDataOrigin,"0")
);
if(CollectionUtil.isEmpty(stations)){
return;
}
// 查询告警数据: 间隔10分钟
SoeQueryConditionByStation query = new SoeQueryConditionByStation();
query.setTypes(InterruptionConstants.INTERRUPTION_TYPE);
query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
Calendar calendar = Calendar.getInstance();
query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
calendar.add(Calendar.MINUTE,-360);
query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
query.setNeedPage(false);
query.setPage(1);
query.setLimit(1000);
Result<HzPage<SoeData>> result = soeClient.getByStationsAndTime(query);
// 未查询到告警信息
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())) {
return;
}
// 中断告警数据
List<SoeData> soes = result.getData().getRecords();
// 查询当天数据中断告警记录
List<InterruptionEntity> saves = this.saveInterruptions(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 批量保存中断告警数据
this.interruptionAlarmService.saveBatch(soes.stream().filter(o-> CollectionUtil.isEmpty(saves) || !saves.stream().map(InterruptionEntity::getAlarmId).collect(Collectors.toList()).contains(o.getId())).map(soe->{
InterruptionEntity entity = new InterruptionEntity();
List<StationEntity> soeStations = stations.stream().filter(o->o.getCode().equals(soe.getStation())).collect(Collectors.toList());
if(!CollectionUtil.isEmpty(soeStations)){
entity.setStationId(soeStations.get(0).getCode());
entity.setStationName(soeStations.get(0).getName());
entity.setCreateDept(soeStations.get(0).getRefDept());
entity.setTenantId(soeStations.get(0).getTenantId());
}
entity.setAlarmId(soe.getId());
entity.setRealId(soe.getRealId());
entity.setSoeExplain(soe.getSoeExplain());
entity.setType(soe.getSoeType());
entity.setAlarmTime(soe.getTs());
entity.setStatus(0);
// 通讯中断恢复
if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){
entity.setStatus(1);
}
return entity;
}).collect(Collectors.toList()));
}
/**
* 查询当天数据中断告警记录
* @param stations
* @return
*/
private List<InterruptionEntity> saveInterruptions(List<String> stations) {
Calendar calendar = Calendar.getInstance();
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.HOUR_OF_DAY, -calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND));
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
return this.interruptionAlarmService.list(Wrappers.<InterruptionEntity>lambdaQuery()
.in(InterruptionEntity::getStationId,stations)
.ge(InterruptionEntity::getCreateTime,start)
.le(InterruptionEntity::getCreateTime,end)
);
}
}

107
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/InterruptionAlarmServiceImpl.java

@ -2,28 +2,19 @@ package com.hnac.hzims.scheduled.service.alarm.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.business.interruption.constants.InterruptionConstants;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.business.interruption.entity.InterruptionEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.mapper.alarm.InterruptionAlrmMapper;
import com.hnac.hzims.scheduled.service.alarm.InterruptionAlarmService;
import com.hnac.hzims.scheduled.service.operation.station.StationService;
import com.hnac.hzinfo.datasearch.soe.ISoeClient;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@ -36,85 +27,27 @@ import java.util.stream.Collectors;
@DS("alarm")
public class InterruptionAlarmServiceImpl extends BaseServiceImpl<InterruptionAlrmMapper, InterruptionEntity> implements InterruptionAlarmService {
private final StationService stationService;
private final ISoeClient soeClient;
/**
* 数据中断告警
* @param param
* 查询站点数据中断
* @param codes
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void interruption(String param) {
// 查询接入站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getDataOrigin,"0")
public List<String> aborts(List<String> codes) {
List<InterruptionEntity> alarms = this.list(Wrappers.<InterruptionEntity>lambdaQuery()
.in(InterruptionEntity::getStationId,codes)
);
if(CollectionUtil.isEmpty(stations)){
return;
}
// 查询告警数据: 间隔10分钟
SoeQueryConditionByStation query = new SoeQueryConditionByStation();
query.setTypes(InterruptionConstants.INTERRUPTION_TYPE);
query.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
Calendar calendar = Calendar.getInstance();
query.setEndTime(LocalDateTime.parse(DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
calendar.add(Calendar.MINUTE,-10);
query.setBeginTime(LocalDateTime.parse(DateUtil.format(calendar.getTime() , DateUtil.PATTERN_DATETIME),DateUtil.DATETIME_FORMATTER));
query.setNeedPage(false);
query.setPage(1);
query.setLimit(1000);
Result<HzPage<SoeData>> result = soeClient.getByStationsAndTime(query);
// 未查询到告警信息
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())) {
return;
}
// 中断告警数据
List<SoeData> soes = result.getData().getRecords();
// 查询当天数据中断告警记录
List<InterruptionEntity> saves = this.saveInterruptions(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 批量保存中断告警数据
this.saveBatch(soes.stream().filter(o-> CollectionUtil.isEmpty(saves) || !saves.stream().map(InterruptionEntity::getAlarmId).collect(Collectors.toList()).contains(o.getId())).map(soe->{
InterruptionEntity entity = new InterruptionEntity();
List<StationEntity> soeStations = stations.stream().filter(o->o.getCode().equals(soe.getStation())).collect(Collectors.toList());
if(!CollectionUtil.isEmpty(soeStations)){
entity.setStationId(soeStations.get(0).getCode());
entity.setStationName(soeStations.get(0).getName());
entity.setCreateDept(soeStations.get(0).getRefDept());
entity.setTenantId(soeStations.get(0).getTenantId());
}
entity.setAlarmId(soe.getId());
entity.setRealId(soe.getRealId());
entity.setSoeExplain(soe.getSoeExplain());
entity.setType(soe.getSoeType());
entity.setAlarmTime(soe.getTs());
entity.setStatus(0);
// 通讯中断恢复
if(InterruptionConstants.ABNORMAL_STATUS.equals(soe.getSoeAlarmType())){
entity.setStatus(1);
if(CollectionUtil.isEmpty(alarms)){
return new ArrayList<>();
}
return entity;
}).collect(Collectors.toList()));
return alarms.stream().collect(Collectors.groupingBy(InterruptionEntity::getStationId)).values().stream().map(alarmEntities -> {
// 站点最近的一条数据中断、数据异常告警
InterruptionEntity alarm = alarmEntities.stream().sorted(Comparator.comparing(InterruptionEntity::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
// 状态为中断
if (alarm.getStatus().equals(0)) {
return alarm.getStationId();
}
/**
* 查询当天数据中断告警记录
* @param stations
* @return
*/
private List<InterruptionEntity> saveInterruptions(List<String> stations) {
Calendar calendar = Calendar.getInstance();
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.HOUR_OF_DAY, -calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE, -calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND, -calendar.get(Calendar.SECOND));
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
return this.list(Wrappers.<InterruptionEntity>lambdaQuery()
.in(InterruptionEntity::getStationId,stations)
.ge(InterruptionEntity::getCreateTime,start)
.le(InterruptionEntity::getCreateTime,end)
);
return "";
}).filter(StringUtil::isNotBlank).distinct().collect(Collectors.toList());
}
}

8
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/DutyServiceImpl.java

@ -63,7 +63,7 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
// 负责人
User user = UserCache.getUser(Long.valueOf(item.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
item.setManagerName(user.getName());
item.setManagerName(user.getRealName());
item.setManagerPhone(user.getPhone());
}
// FIXME 上网
@ -117,7 +117,7 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getName());
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
// 发电量
@ -143,7 +143,7 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getName());
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
dutyInfoVo.setGeneratingCapacity(0);
@ -183,7 +183,7 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyMainInfoVo.setManagerName(user.getName());
dutyMainInfoVo.setManagerName(user.getRealName());
dutyMainInfoVo.setManagerPhone(user.getPhone());
}
return dutyMainInfoVo;

50
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java

@ -24,7 +24,10 @@ import com.hnac.hzims.operational.report.vo.DutyDefectVO;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.service.equipment.PlanService;
import com.hnac.hzims.scheduled.service.inspect.TaskService;
import com.hnac.hzims.scheduled.service.operation.business.*;
import com.hnac.hzims.scheduled.service.operation.business.AccessService;
import com.hnac.hzims.scheduled.service.operation.business.DutyService;
import com.hnac.hzims.scheduled.service.operation.business.MaintenanceService;
import com.hnac.hzims.scheduled.service.operation.business.PhenomenonService;
import com.hnac.hzims.scheduled.service.operation.fill.*;
import com.hnac.hzims.scheduled.service.operation.home.ShowService;
import com.hnac.hzims.scheduled.service.operation.plate.DataService;
@ -77,6 +80,7 @@ public class ShowServiceImpl implements ShowService {
private final OverService overService;
private final PlanService planService;
private final PowerService powerService;
private final WindService windService;
private final SolveService solveService;
private final OtherService otherService;
private final AccessService accessService;
@ -319,27 +323,35 @@ public class ShowServiceImpl implements ShowService {
if(CollectionUtil.isEmpty(stations)){
return target;
}
QueryWrapper<PowerEntity> queryWrapper = new QueryWrapper<PowerEntity>() {{
in("create_dept", stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()));
eq("type", HomePageConstant.WIND_POWER_TYPE);
likeRight("mon", DateUtil.format(new Date(),"yyyy"));
}};
List<PowerEntity> list = powerService.list(queryWrapper);
if(CollectionUtil.isEmpty(list)){
// 计划发电量
List<PlanGenerationEntity> plans = planService.planGeneration(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()),null, DateUtil.format(new Date(),"yyyy"));
// 填报信息
List<WindEntity> winds = windService.list(Wrappers.<WindEntity>lambdaQuery()
.in(WindEntity::getStationCode, stations.stream().map(StationEntity::getCode).collect(Collectors.toList()))
.likeRight(WindEntity::getFillDate, DateUtil.format(new Date(),"yyyy")));
if(CollectionUtil.isEmpty(winds)){
return target;
}
double plan = list.stream().mapToDouble(PowerEntity::getPlannedPowerMon).sum();
double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum();
double plan = plans.stream().mapToDouble(PlanGenerationEntity::getPlanGeneration).sum();
double power = winds.stream().mapToDouble(WindEntity::getPower).sum();
List<EminfoAndEmParamVo> devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(), new TypeReference<List<EminfoAndEmParamVo>>() {});
// 装机容量
target.setTaget_one(list.stream().map(PowerEntity::getInstalledCapacity).collect(Collectors.toSet()).stream().mapToDouble(Double::valueOf).sum());
target.setTaget_one(devices.stream().filter(o->stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(o.getCreateDept())).mapToDouble(EminfoAndEmParamVo::getInstalledCapacity).sum());
// 发电量
target.setTaget_two(list.stream().mapToDouble(PowerEntity::getPowerMon).sum());
target.setTaget_two(power);
if(Math.abs(plan) > 0){
// 发电完成率
target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
target.setTaget_three(BigDecimal.valueOf(power / plan * 100).setScale(2, RoundingMode.HALF_UP).doubleValue());
}
// 双票合格率
target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, RoundingMode.HALF_UP).doubleValue());
LocalDate firstDay = LocalDate.now().withDayOfYear(1);
LocalDateTime firstDateTime = LocalDateTime.of(firstDay, LocalTime.MIN);
R<List<Dept>> result = sysClient.getDeptList();
List<Long> areas = result.getData().stream().filter(dept -> stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(dept.getId())).map(Dept::getParentId).collect(Collectors.toList());
DoublePassRateVO pass = ticketService.doublePassRate(areas, firstDateTime, LocalDateTime.now());
if (ObjectUtil.isNotEmpty(pass)) {
target.setTaget_four(Double.valueOf(pass.getDoublePassRate()));
}
return target;
}
@ -433,6 +445,12 @@ public class ShowServiceImpl implements ShowService {
TargetVo target = new TargetVo();
target.setType(HomePageConstant.DISTRIBUTION_NETWORK);
target.setTypeName(DictCache.getValue("stationType", HomePageConstant.DISTRIBUTION_NETWORK));
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.DISTRIBUTION_NETWORK));
if(CollectionUtil.isEmpty(stations)){
return target;
}
// 线程池
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("network-taget-pool-%d").build();
ScheduledExecutorService exe = new ScheduledThreadPoolExecutor(3, namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
@ -446,6 +464,7 @@ public class ShowServiceImpl implements ShowService {
List<OverEntity> overs = overService.list(new QueryWrapper<OverEntity>() {{
ge("create_time", firstDateTime);
le("create_time", LocalDateTime.now());
in("create_dept",stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()));
}});
if(CollectionUtil.isEmpty(overs)){
countDownLatch.countDown();
@ -468,6 +487,7 @@ public class ShowServiceImpl implements ShowService {
List<SolveEntity> solves = solveService.list(new QueryWrapper<SolveEntity>() {{
ge("create_time", firstDateTime);
le("create_time", LocalDateTime.now());
in("create_dept",stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()));
}});
if(CollectionUtil.isEmpty(solves)){
countDownLatch.countDown();
@ -481,6 +501,7 @@ public class ShowServiceImpl implements ShowService {
List<OtherEntity> others = otherService.list(new QueryWrapper<OtherEntity>() {{
ge("create_time", firstDateTime);
le("create_time", LocalDateTime.now());
in("create_dept",stations.stream().map(StationEntity::getRefDept).collect(Collectors.toList()));
}});
if(CollectionUtil.isEmpty(others)){
countDownLatch.countDown();
@ -648,6 +669,7 @@ public class ShowServiceImpl implements ShowService {
return null;
}
list = R.getData();
}
// 根据参数查询有效站点
List<StationEntity> stationList = this.stationByParams(list,deptId,typeList,serveType);

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -19,6 +19,7 @@ import com.hnac.hzims.operational.main.vo.RealStationVo;
import com.hnac.hzims.operational.station.entity.StationAttributeEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService;
import com.hnac.hzims.scheduled.service.alarm.InterruptionAlarmService;
import com.hnac.hzims.scheduled.service.equipment.WorkshopInfoService;
import com.hnac.hzims.scheduled.service.operation.alarm.RecordService;
import com.hnac.hzims.scheduled.service.operation.monitor.MonitorService;
@ -56,14 +57,25 @@ import java.util.stream.Stream;
public class MonitorServiceImpl implements MonitorService {
private final RecordService alertService;
private final StationService stationService;
private final AlarmQueryService alarmQueryService;
private final StationAttributeService attbtService;
private final WorkshopInfoService workshopInfoService;
private final StationAttrConfigService attrConfigService;
private final InterruptionAlarmService interruptionAlarmService;
private final RedisTemplate redisTemplate;
private final ISysClient sysClient;
private final RedisClient redisClient;
private final IAnalyseDataSearchClient analyseDataSearchClient;
@Value("${hzims.equipment.emInfo.emInfoList}")
@ -294,7 +306,7 @@ public class MonitorServiceImpl implements MonitorService {
// 铃铛
List<String> bells = alarmQueryService.bells(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 数据中断
List<String> aborts = alarmQueryService.aborts(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList()));
List<String> aborts = interruptionAlarmService.aborts(stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList()));
// 隐藏设备列表
List<String> hideList = attrConfigService.getHideList();
// 分割,每个map限制10个长度

7
hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/AlarmQueryMapper.xml

@ -1,5 +1,10 @@
<?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.alarm.show.mapper.AlarmMapper">
<mapper namespace="com.hnac.hzims.scheduled.mapper.alarm.AlarmQueryMapper">
<delete id="clear">
delete from hzims_alarm
where alarm_time &lt; #{alarmTime}
</delete>
</mapper>

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/wrapper/OfflineRecordWrapper.java

@ -24,8 +24,8 @@ public class OfflineRecordWrapper extends BaseEntityWrapper<OfflineRecordEntity,
OfflineRecordVO vo = BeanUtil.copy(entity, OfflineRecordVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser.getName());
vo.setUpdateUserName(updateUser.getName());
vo.setCreateUserName(createUser.getRealName());
vo.setUpdateUserName(updateUser.getRealName());
return vo;
}

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/entity/InspectionTaskSMS.java

@ -31,7 +31,7 @@ public class InspectionTaskSMS extends TaskEntity {
*/
public void setSmsDetail(){
User user = UserCache.getUser(this.getUserId());
this.setCnName(user.getName());
this.setCnName(user.getRealName());
this.setPhone(user.getPhone());
this.setLoginName(user.getAccount());
}

18
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/mapper/TaskMapper.xml

@ -180,9 +180,10 @@
order by t.UPDATE_TIME desc
</select>
<select id="getAllPageList" parameterType="com.hnac.hzinfo.inspect.task.vo.TaskListQuery" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT t.*,u.USER_ID as userIds,u.USER_NAME from HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID
and u.IS_DELETED=0
SELECT t.*,u.USER_ID as userIds,u.USER_NAME as userNames
from
HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER u on t.ID=u.TASK_ID and u.IS_DELETED=0
where t.IS_DELETED=0
<if test="task.userId != null ">
and u.USER_ID=#{task.userId}
@ -191,12 +192,15 @@
order by t.UPDATE_TIME desc
</select>
<select id="getAllExportList" resultType="com.hnac.hzinfo.inspect.task.vo.TaskVo">
SELECT t.*,b.USER_ID as userIds,(SELECT group_concat(u .user_name) FROM HZ_ST_EX_TASK_USER u WHERE t.ID=u.TASK_ID
SELECT
t.*, b.USER_ID as userIds,
(SELECT group_concat(u.user_name) FROM HZ_ST_EX_TASK_USER u WHERE t.ID=u.TASK_ID
<if test="task.userId != null ">
and u.USER_ID=#{task.userId}
</if>) AS userNames from HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER b on t.ID=b.TASK_ID
and b.IS_DELETED=0
</if>) AS userNames
from
HZ_ST_EX_TASK t
LEFT JOIN HZ_ST_EX_TASK_USER b on t.ID=b.TASK_ID and b.IS_DELETED=0
where t.IS_DELETED=0
<if test="task.userId != null ">
and u.USER_ID=#{task.userId}

14
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzinfo.inspect.task.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -10,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.utils.Condition;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.safeproduct.Constants;
import com.hnac.hzims.safeproduct.entity.ImsMonCameraInfoEntity;
import com.hnac.hzims.safeproduct.feign.IImsMonCameraInfoClient;
@ -51,6 +53,7 @@ import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -60,6 +63,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@ -364,7 +368,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
taskReportVO.setCompleteSituation(finishSituation);
taskReportVO.setIncompleteNum(list.stream().filter(taskCountVO -> Func.isNotEmpty(taskCountVO.getUndoneTask())).collect(Collectors.summingInt(TaskCountVO::getUndoneTask)));
taskReportVO.setIncompleteSituation(undoSituation);
taskReportVO.setUserName(user.getName());
taskReportVO.setUserName(user.getRealName());
result.add(taskReportVO);
}
});
@ -531,14 +535,18 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp
query.setCurrent(taskDTO.getCurrent());
IPage<TaskVo> pages = Condition.getPage(query);
List<TaskVo> list = this.baseMapper.getAllPageList(pages,taskDTO);
list = list.stream().map(taskVo -> {
list = list.stream().peek(taskVo -> {
// 获取机器人信息
if (taskVo.getAutoVideo().equals(PlanContants.InspectTypeEnum.ROBOT.getVal()) ) {
if (Func.isNotEmpty( ObjectUtil.isNotEmpty(taskVo.getUserId()))) {
taskVo.setRobot(robotService.getDetailByUserId(taskVo.getUserId()));
}
}
return taskVo;
// 巡检时长计算
if (ObjectUtil.isNotEmpty(taskVo.getStartTime()) && ObjectUtil.isNotEmpty(taskVo.getEndTime())) {
long inspectTime = DateUtil.between(taskVo.getStartTime(), taskVo.getEndTime()).toMinutes();
taskVo.setInspectTime(Optional.of(inspectTime).orElse(0L));
}
}).collect(Collectors.toList());
pages.setRecords(list);
BladePage<TaskVo> bladePage = BladePage.of(pages);

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/vo/TaskVo.java

@ -29,4 +29,7 @@ public class TaskVo extends TaskEntity {
@ApiModelProperty("执行名称,按逗号分隔")
private String userNames;
@ApiModelProperty("巡检时长/分钟")
private Long inspectTime;
}

2
hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java

@ -187,7 +187,7 @@ public class MessageClient extends BladeController implements IMessageClient{
if (ObjectUtil.isEmpty(user)||ObjectUtil.isEmpty(user.getPhone())){
continue;
}
record.setPusherName(user.getName());
record.setPusherName(user.getRealName());
record.setPusher(pushId.toString());
record.setPushType(MessageConstants.IMMEDIATELY);
record.setDeptName(Func.isNotEmpty(record.getDeptName()) ? record.getDeptName() : this.getDeptNameById(record.getDeptId()));

4
hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgPushRecordWrapper.java

@ -24,8 +24,8 @@ public class MsgPushRecordWrapper extends BaseEntityWrapper<MsgPushRecordEntity,
MsgPushRecordVO vo = BeanUtil.copy(entity, MsgPushRecordVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser.getName());
vo.setUpdateUserName(updateUser.getName());
vo.setCreateUserName(createUser.getRealName());
vo.setUpdateUserName(updateUser.getRealName());
return vo;
}

4
hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgSmsRecordWrapper.java

@ -25,8 +25,8 @@ public class MsgSmsRecordWrapper extends BaseEntityWrapper<MsgSmsRecordEntity, M
MsgSmsRecordVO vo = BeanUtil.copy(entity, MsgSmsRecordVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser.getName());
vo.setUpdateUserName(updateUser.getName());
vo.setCreateUserName(createUser.getRealName());
vo.setUpdateUserName(updateUser.getRealName());
return vo;
}

4
hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgWsRecordHistoryWrapper.java

@ -24,8 +24,8 @@ public class MsgWsRecordHistoryWrapper extends BaseEntityWrapper<MsgWsRecordHist
MsgWsRecordHistoryVO vo = BeanUtil.copy(entity, MsgWsRecordHistoryVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser.getName());
vo.setUpdateUserName(updateUser.getName());
vo.setCreateUserName(createUser.getRealName());
vo.setUpdateUserName(updateUser.getRealName());
return vo;
}

4
hzims-service/message/src/main/java/com/hnac/hzims/message/wrapper/MsgWsRecordWrapper.java

@ -25,9 +25,9 @@ public class MsgWsRecordWrapper extends BaseEntityWrapper<MsgWsRecordEntity, Msg
User createUser = UserCache.getUser(entity.getCreateUser());
if(null != entity.getUpdateUser()) {
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setUpdateUserName(updateUser.getName());
vo.setUpdateUserName(updateUser.getRealName());
}
vo.setCreateUserName(createUser.getName());
vo.setCreateUserName(createUser.getRealName());
return vo;
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/controller/OperAccessLibraryController.java

@ -114,7 +114,7 @@ public class OperAccessLibraryController extends BladeController {
@ApiOperationSupport(order = 7)
@PostMapping(value = "/import")
@Operate(label = "检修库导入",type = com.hnac.hzinfo.log.contants.BusinessType.IMPORT,risk = Risk.LOW,ignore = false)
public void libraryImport(@RequestParam MultipartFile file) {
service.libraryImport(file);
public R libraryImport(@RequestParam MultipartFile file) {
return R.data(service.libraryImport(file));
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/excel/BaseExport.java

@ -12,6 +12,6 @@ public abstract class BaseExport {
protected String getUserName(Long uid) {
User user = UserCache.getUser(uid);
return user != null ? user.getName() : uid != null ? uid.toString() : StringUtils.EMPTY;
return user != null ? user.getRealName() : uid != null ? uid.toString() : StringUtils.EMPTY;
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/IOperAccessLibraryService.java

@ -30,5 +30,5 @@ public interface IOperAccessLibraryService extends BaseService<OperAccessLibrary
void downLoad();
void libraryImport(MultipartFile file);
String libraryImport(MultipartFile file);
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -126,20 +126,20 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
entity.setActStartTime(new Date());
if (ObjectUtil.isNotEmpty(entity.getTechLead())){
User user = UserCache.getUser(entity.getTechLead());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setTechLeadName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
entity.setTechLeadName(user.getRealName());
}
}
if (ObjectUtil.isNotEmpty(entity.getManager())){
User user = UserCache.getUser(entity.getManager());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setManagerName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
entity.setManagerName(user.getRealName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
entity.setCreateUserName(user.getUserName());
entity.setUpdateUserName(user.getUserName());
entity.setCreateUserName(user.getNickName());
entity.setUpdateUserName(user.getNickName());
}
planService.save(entity);
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java

@ -128,10 +128,10 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
List<OperAccessMaterialEntity> materialEntityList = JSONObject.parseArray(JSON.toJSONString(entity.getAccessMaterials()), OperAccessMaterialEntity.class);
if (ObjectUtil.isNotEmpty(entity.getHandler())){
User user = UserCache.getUser(entity.getHandler());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
entity.setHandlerName(user.getName());
entity.setCreateUserName(user.getName());
entity.setUpdateUserName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
entity.setHandlerName(user.getRealName());
entity.setCreateUserName(user.getRealName());
entity.setUpdateUserName(user.getRealName());
}
}
taskService.save(entity);

31
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessLibraryServiceImpl.java

@ -22,6 +22,7 @@ import com.hnac.hzims.operational.util.PdfUtils;
import com.hnac.hzims.safeproduct.feign.IDangerSourceClient;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
@ -32,6 +33,7 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
@ -149,7 +151,7 @@ public class OperAccessLibraryServiceImpl extends BaseServiceImpl<OperAccessLibr
* @param file
*/
@Override
public void libraryImport(MultipartFile file){
public String libraryImport(MultipartFile file){
// 文件名检查
String fileName = file.getOriginalFilename();
if(!fileName.endsWith(PdfUtils.XLS_SUFFIX) && !fileName.endsWith(PdfUtils.XLSX_SUFFIX)){
@ -169,6 +171,7 @@ public class OperAccessLibraryServiceImpl extends BaseServiceImpl<OperAccessLibr
throw new ServiceException("请填写导入检修库数据!");
}
List<OperAccessLibraryDetailEntity> details = new ArrayList<>();
StringBuilder failBuilder = new StringBuilder();
Long libraryId = null;
for (int i = 2; i <= rows + 1; i++) {
// 读取左上端单元格
@ -178,27 +181,43 @@ public class OperAccessLibraryServiceImpl extends BaseServiceImpl<OperAccessLibr
continue;
}
if( (i - 1) % 4 == 1){
if(StringUtils.isEmpty(row.getCell(1).getStringCellValue())){
if(StringUtils.isEmpty(row.getCell(1).getStringCellValue())
|| StringUtils.isEmpty(row.getCell(2).getStringCellValue())
|| ObjectUtil.isEmpty(row.getCell(3).getDateCellValue())){
failBuilder.append((int)row.getCell(0).getNumericCellValue()).append(",");
continue;
}
OperAccessLibraryEntity library = new OperAccessLibraryEntity();
row.getCell(1).setCellType(CellType.STRING);
library.setEmName(row.getCell(1).getStringCellValue());
library.setGradeCode(DictCache.getValue("gradeCode",row.getCell(2).getStringCellValue()));
library.setLastServiceTime(row.getCell(3).getDateCellValue());
if(!ObjectUtil.isEmpty(row.getCell(4).getNumericCellValue())){
library.setPeriod((int)row.getCell(4).getNumericCellValue());
library.setStopHours((int)row.getCell(5).getNumericCellValue());
}
if(!ObjectUtil.isEmpty(row.getCell(5).getNumericCellValue())){
library.setPeriod((int)row.getCell(5).getNumericCellValue());
}
this.save(library);
libraryId = library.getId();
}
if(StringUtils.isNotEmpty(row.getCell(6).getStringCellValue())){
//设置单元格类型
row.getCell(6).setCellType(CellType.STRING);
row.getCell(7).setCellType(CellType.STRING);
if(StringUtils.isNotEmpty(row.getCell(6).getStringCellValue())
&& StringUtils.isNotEmpty(row.getCell(7).getStringCellValue())){
OperAccessLibraryDetailEntity detail = new OperAccessLibraryDetailEntity();
detail.setName(row.getCell(6).getStringCellValue());
detail.setContent(row.getCell(7).getStringCellValue());
detail.setName(row.getCell(6).getRichStringCellValue().getString());
detail.setContent(row.getCell(7).getRichStringCellValue().getString());
detail.setPid(libraryId);
details.add(detail);
}
}
this.libraryDetailService.saveBatch(details);
if(failBuilder.length() > 0){
return "导入完成,序号:" + failBuilder.substring(0,failBuilder.toString().length()-1) + "数据未填写或者必传项未填写,未导入成功!";
}
return "导入完成";
}
/**

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java

@ -46,14 +46,14 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl<OperAccessS
public R doSave(OperAccessStatisticsDTO req) {
if (ObjectUtil.isNotEmpty(req.getManager())){
User user = UserCache.getUser(req.getManager());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setManagerName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
req.setManagerName(user.getRealName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getNickName())){
req.setCreateUserName(user.getNickName());
req.setUpdateUserName(user.getNickName());
}
boolean save = super.save(req);
return R.status(save);

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessTaskServiceImpl.java

@ -111,14 +111,14 @@ public class OperAccessTaskServiceImpl extends BaseServiceImpl<OperAccessTaskMap
req.setCode("TASK" + DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATETIME_MINI) + new DecimalFormat("###").format(RandomUtils.nextInt(0, 999)));
if (ObjectUtil.isNotEmpty(req.getHandler())){
User user = UserCache.getUser(req.getHandler());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setHandlerName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
req.setHandlerName(user.getRealName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getNickName())){
req.setCreateUserName(user.getNickName());
req.setUpdateUserName(user.getNickName());
}
List<OperAccessMaterialEntity> materialEntityList = JSONObject.parseArray(JSON.toJSONString(req.getAccessMaterials()), OperAccessMaterialEntity.class);
if (super.save(req)) {

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/wrapper/AreaMapWrapper.java

@ -26,7 +26,7 @@ public class AreaMapWrapper extends BaseEntityWrapper<AreaMapEntity, AreaMapVo>
return vo;
}
assert vo != null;
vo.setUserName(createUser.getName());
vo.setUserName(createUser.getRealName());
return vo;
}
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/constants/RedisKeyConstants.java

@ -11,8 +11,8 @@ import org.springframework.stereotype.Component;
@Data
public class RedisKeyConstants {
public static String MAINTENANCE_TASK_DELAY_LIST = "hzims:operation:maintenance:end:delay:tasks";
public static String REMIND_TASK_END_LIST = "hzims:operation:maintenance:end:delay:tasks";
public static String MAINTENANCE_TASK_DELAY_LIST = "hzims:operation:maintenance:delay:tasks";
public static String REMIND_TASK_END_LIST = "hzims:operation:maintenance:end:tasks";
/**根据realId获取实时数据**/
@Value("${hzims.operation.realIdKey}")

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -101,12 +101,12 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
}
if (ObjectUtil.isNotEmpty(entity.getFinder())&&StringUtils.isBlank(entity.getFinderName())){
User user = UserCache.getUser(entity.getFinder());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())) {
entity.setFinderName(user.getName());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getRealName())) {
entity.setFinderName(user.getRealName());
}
}
if (StringUtils.isNotBlank(AuthUtil.getUserName())){
entity.setCreateUserName(AuthUtil.getUserName());
if (StringUtils.isNotBlank(AuthUtil.getNickName())){
entity.setCreateUserName(AuthUtil.getNickName());
}
//加锁
Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + entity.getCreateDept(), entity.getCreateDept(), 30, TimeUnit.SECONDS);

76
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java

@ -730,26 +730,29 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
sheet.addMergedRegion(repeat_religon);
currentRow++;
//表头2
CellRangeAddress repeat_head2_cell_religon = new CellRangeAddress(currentRow, currentRow, (short) 0, (short) 2);
sheet.addMergedRegion(repeat_head2_cell_religon);
HSSFRow repeat_head2 = sheet.createRow(currentRow);
this.setFullHeadCell(wb, repeat_head2, (short) 9, 0);
HSSFCell repeat_head2_cell1 = repeat_head2.getCell(3);
CellRangeAddress repeat_head2_cell1_religon = new CellRangeAddress(currentRow, currentRow, (short) 3, (short) 4);
HSSFCell repeat_head2_cell1 = repeat_head2.getCell(1);
CellRangeAddress repeat_head2_cell1_religon = new CellRangeAddress(currentRow, currentRow, (short) 1, (short) 2);
sheet.addMergedRegion(repeat_head2_cell1_religon);
repeat_head2_cell1.setCellValue("发生数量");
repeat_head2_cell1.setCellValue("重复发生数量");
HSSFCell repeat_head2_cell2 = repeat_head2.getCell(5);
CellRangeAddress repeat_head2_cell2_religon = new CellRangeAddress(currentRow, currentRow, (short) 5, (short) 6);
HSSFCell repeat_head2_cell2 = repeat_head2.getCell(3);
CellRangeAddress repeat_head2_cell2_religon = new CellRangeAddress(currentRow, currentRow, (short) 3, (short) 4);
sheet.addMergedRegion(repeat_head2_cell2_religon);
repeat_head2_cell2.setCellValue("占重复缺陷总数的比率(%)");
HSSFCell repeat_head2_cell3 = repeat_head2.getCell(7);
CellRangeAddress repeat_head2_cell3_religon = new CellRangeAddress(currentRow, currentRow, (short) 7, (short) 8);
HSSFCell repeat_head2_cell3 = repeat_head2.getCell(5);
CellRangeAddress repeat_head2_cell3_religon = new CellRangeAddress(currentRow, currentRow, (short) 5, (short) 6);
sheet.addMergedRegion(repeat_head2_cell3_religon);
repeat_head2_cell3.setCellValue("占总缺陷的比率(%)");
repeat_head2_cell3.setCellValue("总发生数量");
HSSFCell repeat_head2_cell4 = repeat_head2.getCell(7);
CellRangeAddress repeat_head2_cell4_religon = new CellRangeAddress(currentRow, currentRow, (short) 7, (short) 8);
sheet.addMergedRegion(repeat_head2_cell4_religon);
repeat_head2_cell4.setCellValue("占总缺陷的比率(%)");
currentRow++;
@ -759,8 +762,6 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
this.setFullHeadCell(wb, repeat_row, (short) 9, 1);
//第一列
HSSFCell repeat_cell1 = repeat_row.getCell(0);
CellRangeAddress repeat_content_religon = new CellRangeAddress(currentRow, currentRow, (short) 0, (short) 2);
sheet.addMergedRegion(repeat_content_religon);
if ("1".equals(repeat.get(i).getDefectLevel())) {
repeat_cell1.setCellValue("一类缺陷");
} else if ("2".equals(repeat.get(i).getDefectLevel())) {
@ -771,22 +772,28 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
repeat_cell1.setCellValue(repeat.get(i).getDefectLevel());
}
//第二列
HSSFCell repeat_cell2 = repeat_row.getCell(3);
CellRangeAddress repeat_content_religon1 = new CellRangeAddress(currentRow, currentRow, (short) 3, (short) 4);
HSSFCell repeat_cell2 = repeat_row.getCell(1);
CellRangeAddress repeat_content_religon1 = new CellRangeAddress(currentRow, currentRow, (short) 1, (short) 2);
sheet.addMergedRegion(repeat_content_religon1);
repeat_cell2.setCellValue(repeat.get(i).getHappenNum());
//第三列
HSSFCell repeat_cell3 = repeat_row.getCell(5);
CellRangeAddress repeat_content_religon2 = new CellRangeAddress(currentRow, currentRow, (short) 5, (short) 6);
HSSFCell repeat_cell3 = repeat_row.getCell(3);
CellRangeAddress repeat_content_religon2 = new CellRangeAddress(currentRow, currentRow, (short) 3, (short) 4);
sheet.addMergedRegion(repeat_content_religon2);
repeat_cell3.setCellValue(this.dealDouble(repeat.get(i).getRepeatRatio()));
//第四列
HSSFCell repeat_cell4 = repeat_row.getCell(7);
CellRangeAddress repeat_content_religon3 = new CellRangeAddress(currentRow, currentRow, (short) 7, (short) 8);
HSSFCell repeat_cell4 = repeat_row.getCell(5);
CellRangeAddress repeat_content_religon3 = new CellRangeAddress(currentRow, currentRow, (short) 5, (short) 6);
sheet.addMergedRegion(repeat_content_religon3);
repeat_cell4.setCellValue(this.dealDouble(repeat.get(i).getHappenRatio()));
repeat_cell4.setCellValue(repeat.get(i).getHappenSumNum());
//第五列
HSSFCell repeat_cell5 = repeat_row.getCell(7);
CellRangeAddress repeat_content_religon4 = new CellRangeAddress(currentRow, currentRow, (short) 7, (short) 8);
sheet.addMergedRegion(repeat_content_religon4);
repeat_cell5.setCellValue(this.dealDouble(repeat.get(i).getHappenRatio()));
currentRow++;
}
return currentRow;
@ -944,7 +951,7 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
List<String> deptList ;
R<List<Dept>> res = sysClient.getDeptByCurrentUser();
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
deptList = res.getData().stream().map(Dept::getId).map(s -> s.toString()).collect(Collectors.toList());
deptList = res.getData().stream().map(Dept::getId).map(Object::toString).collect(Collectors.toList());
} else {
throw new WebServiceException("该用户没有此权限");
}
@ -961,35 +968,46 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
//总缺陷数
int total = repetStatistics.stream().mapToInt(OperDefectStatisticsCodeDTO::getDefectNum).sum();
//总重复缺陷数
int totalRepeat = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.summingInt(OperDefectStatisticsCodeDTO::getDefectNum));
int totalRepeat = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).mapToInt(OperDefectStatisticsCodeDTO::getDefectNum).sum();
//等级重复统计
Map<String, IntSummaryStatistics> repeatList = repetStatistics.stream().filter(s -> s.getDefectNum() > 1 && s.getDefectLevel() != null).collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
//缺陷等级分类总数统计
Map<String, IntSummaryStatistics> sums = repetStatistics.stream().collect(Collectors.groupingBy(OperDefectStatisticsCodeDTO::getDefectLevel, Collectors.summarizingInt(OperDefectStatisticsCodeDTO::getDefectNum)));
OperDefectRepeatRatioDTO one = new OperDefectRepeatRatioDTO();
one.setDefectLevel(DefectConstant.DefectLevelEnum.ONE.getStatus());
if (repeatList.get(one.getDefectLevel()) != null) {
one.setHappenNum(repeatList.get(one.getDefectLevel()).getSum());
one.setHappenRatio(one.getHappenNum() / Double.valueOf(total));
one.setRepeatRatio(one.getHappenNum() / Double.valueOf(totalRepeat));
one.setRepeatRatio(one.getHappenNum() / (double) totalRepeat);
}
if(sums.containsKey(one.getDefectLevel())){
one.setHappenSumNum(sums.get(one.getDefectLevel()).getSum());
one.setHappenRatio(one.getHappenSumNum() / (double) total);
}
OperDefectRepeatRatioDTO two = new OperDefectRepeatRatioDTO();
two.setDefectLevel(DefectConstant.DefectLevelEnum.TWO.getStatus());
if (repeatList.get(two.getDefectLevel()) != null) {
two.setHappenNum(repeatList.get(two.getDefectLevel()).getSum());
two.setHappenRatio(two.getHappenNum() / Double.valueOf(total));
two.setRepeatRatio(two.getHappenNum() / Double.valueOf(totalRepeat));
two.setRepeatRatio(two.getHappenNum() / (double) totalRepeat);
}
if(sums.containsKey(two.getDefectLevel())){
two.setHappenSumNum(sums.get(two.getDefectLevel()).getSum());
two.setHappenRatio(two.getHappenSumNum() / (double) total);
}
OperDefectRepeatRatioDTO three = new OperDefectRepeatRatioDTO();
three.setDefectLevel(DefectConstant.DefectLevelEnum.THREE.getStatus());
if (repeatList.get(three.getDefectLevel()) != null) {
three.setHappenNum(repeatList.get(three.getDefectLevel()).getSum());
three.setHappenRatio(three.getHappenNum() / Double.valueOf(total));
three.setRepeatRatio(three.getHappenNum() / Double.valueOf(totalRepeat));
three.setRepeatRatio(three.getHappenNum() / (double) totalRepeat);
}
if(sums.containsKey(three.getDefectLevel())){
three.setHappenSumNum(sums.get(three.getDefectLevel()).getSum());
three.setHappenRatio(three.getHappenSumNum() / (double) total);
}
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder().defectLevel("合计").happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum()).happenRatio(one.getHappenRatio() + two.getHappenRatio() + three.getHappenRatio()).repeatRatio(1.00).build();
OperDefectRepeatRatioDTO addUp = OperDefectRepeatRatioDTO.builder().defectLevel("合计").happenNum(one.getHappenNum() + two.getHappenNum() + three.getHappenNum()).happenSumNum(one.getHappenSumNum() + two.getHappenSumNum() + three.getHappenSumNum()).happenRatio(1.0).repeatRatio(1.00).build();
if (addUp.getHappenNum().equals(0L)) {
addUp.setRepeatRatio(0.0);
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperDefectWrapper.java

@ -35,8 +35,8 @@ public class OperDefectWrapper extends BaseEntityWrapper<OperDefectEntity, OperD
OperDefectVO vo = BeanUtil.copy(entity, OperDefectVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser == null ? "" : createUser.getName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName());
vo.setCreateUserName(createUser == null ? "" : createUser.getRealName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getRealName());
OperPhenomenonEntity phenomenonEntity = phenomenonService.getOne(Wrappers.<OperPhenomenonEntity>lambdaUpdate()
.eq(OperPhenomenonEntity::getDefectCode,entity.getDefectCode()).last("limit 1"));
if(Func.isNotEmpty(phenomenonEntity)){

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperFaultWrapper.java

@ -40,8 +40,8 @@ public class OperFaultWrapper extends BaseEntityWrapper<OperFaultEntity, OperFau
OperFaultVO vo = BeanUtil.copy(entity, OperFaultVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser == null ? "" : createUser.getName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName());
vo.setCreateUserName(createUser == null ? "" : createUser.getRealName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getRealName());
if(Func.isNotEmpty(entity.getSafeInfos())){
vo.setDangerSources(sourceClient.details(entity.getSafeInfos().split(",")));
}

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/wrapper/OperPhenomenonWrapper.java

@ -56,20 +56,20 @@ public class OperPhenomenonWrapper extends BaseEntityWrapper<OperPhenomenonEntit
OperPhenomenonVO vo = BeanUtil.copy(entity, OperPhenomenonVO.class);
User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(createUser == null ? "" : createUser.getName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getName());
vo.setCreateUserName(createUser == null ? "" : createUser.getRealName());
vo.setUpdateUserName(updateUser == null ? "" : updateUser.getRealName());
User userC = UserCache.getUser(entity.getConclusionPeople());
vo.setConclusionPeopleName(userC == null ? "" : userC.getName());
vo.setConclusionPeopleName(userC == null ? "" : userC.getRealName());
User userF = UserCache.getUser(entity.getFinder());
vo.setFinderName(userF == null ? "" : userF.getName());
vo.setFinderName(userF == null ? "" : userF.getRealName());
User userD = UserCache.getUser(entity.getDiscriminator());
vo.setDiscriminatorName(userD == null ? "" : userD.getName());
vo.setDiscriminatorName(userD == null ? "" : userD.getRealName());
User userHn = UserCache.getUser(entity.getHandler());
vo.setHandlerName(userHn == null ? "" : userHn.getName());
vo.setHandlerName(userHn == null ? "" : userHn.getRealName());
if(Func.isNotEmpty(entity.getSafeInfos())){
vo.setDangerSources(sourceClient.details(entity.getSafeInfos().split(",")));
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/feign/DutyGroupClient.java

@ -47,7 +47,7 @@ public class DutyGroupClient implements IDutyGroupClient {
if(CollectionUtil.isEmpty(persons)){
return group;
}
List<String> personNames = persons.stream().filter(o-> !charge.equals(o.getPersonId())).map(o-> UserCache.getUser(o.getPersonId()).getName()).collect(Collectors.toList());
List<String> personNames = persons.stream().filter(o-> !charge.equals(o.getPersonId())).map(o-> UserCache.getUser(o.getPersonId()).getRealName()).collect(Collectors.toList());
if(CollectionUtil.isEmpty(personNames)){
group.setRepairPersonnelSum(0);
return group;

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/mapper/ImsDutyClassMapper.java

@ -34,6 +34,7 @@ public interface ImsDutyClassMapper extends UserDataScopeBaseMapper<ImsDutyClass
String getClassTypeIds(@Param("createDept") Long createDept,@Param("classTypeId") Long classTypeId);
@UserDataAuth
List<DutyClassTypeTree> getDutyClassTree(@Param("deptId")Long deptId);
List<DutyClassTypeTree> getDutyClassByType(@Param("class_type_id") Long classTypeId);

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyChangeServiceImpl.java

@ -120,10 +120,10 @@ public class ImsDutyChangeServiceImpl extends BaseServiceImpl<ImsDutyChangeMappe
ImsDutyChangeVO vo = ImsDutyChangeWrapper.build().entityVO(detail);
try {
log.info(detail.getCreateUser() + "..............");
vo.setCreateUserName(UserCache.getUser(detail.getCreateUser()).getName());
vo.setUpdateUserName(UserCache.getUser(detail.getUpdateUser()).getName());
vo.setAcceptPersonName(UserCache.getUser(detail.getAcceptPersonId()).getName());
vo.setApplyPersonName(UserCache.getUser(detail.getApplyPersonId()).getName());
vo.setCreateUserName(UserCache.getUser(detail.getCreateUser()).getRealName());
vo.setUpdateUserName(UserCache.getUser(detail.getUpdateUser()).getRealName());
vo.setAcceptPersonName(UserCache.getUser(detail.getAcceptPersonId()).getRealName());
vo.setApplyPersonName(UserCache.getUser(detail.getApplyPersonId()).getRealName());
ImsSchedulingVo imsSchedulingVo1 = dutyMainService.getByIdOneV2(detail.getAcceptDutyId());
vo.setAcceptDutyMainVo(imsSchedulingVo1);
ImsSchedulingVo imsSchedulingVo = dutyMainService.getByIdOneV2(detail.getApplyDutyId());

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyEmergencyServiceImpl.java

@ -81,11 +81,11 @@ public class ImsDutyEmergencyServiceImpl extends BaseServiceImpl<ImsDutyEmergenc
collect= records.stream().map(sig -> {
R<User> user = userClient.userInfoById(sig.getRegistrant());
if (user.isSuccess()&&ObjectUtils.isNotEmpty(user.getData())){
sig.setRegistrantName(user.getData().getName());
sig.setRegistrantName(user.getData().getRealName());
}
R<User> userR = userClient.userInfoById(sig.getChargePerson());
if (userR.isSuccess()&&ObjectUtils.isNotEmpty(userR.getData())){
sig.setChargePersonName(userR.getData().getName());
sig.setChargePersonName(userR.getData().getRealName());
}
ImsDutyClassEntity classEntity = imsDutyClassService.getById(sig.getDutyClass());
sig.setDutyClassName(classEntity.getClassName());

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

@ -166,8 +166,8 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
imsDutyGroupVO.setId(entity.getId());
imsDutyGroupVO.setManagerId(entity.getManagerId());
User user = UserCache.getUser(entity.getManagerId());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())){
imsDutyGroupVO.setManagerName(user.getName());
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getRealName())){
imsDutyGroupVO.setManagerName(user.getRealName());
}
List<ImsDutyGroupPVO> imsDutyGroupPVOS = imsDutyGroupPService.listByGroupId(entity.getId());
if (CollectionUtil.isNotEmpty(imsDutyGroupPVOS)){
@ -247,8 +247,8 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
for (ImsDutyGroupPVO imsDutyGroupPVo : imsDutyGroupPEntities) {
imsDutyGroupPVo.setSignage(false);
User user = UserCache.getUser(imsDutyGroupPVo.getPersonId());
if (ObjectUtil.isNotEmpty(user) && Func.isNotBlank(user.getName())) {
imsDutyGroupPVo.setGroupName(user.getName());
if (ObjectUtil.isNotEmpty(user) && Func.isNotBlank(user.getRealName())) {
imsDutyGroupPVo.setGroupName(user.getRealName());
} else {
groupIds.add(imsDutyGroupPVo.getId().toString());
this.baseMapper.updateManagerIdById(imsDutyGroupPVo.getGroupId());

28
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -809,9 +809,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
User user = UserCache.getUser(Long.valueOf(split[j]));
if (ObjectUtil.isNotEmpty(user)) {
if (j == split.length - 1) {
s.setName(s.getName() + user.getName());
s.setName(s.getName() + user.getRealName());
} else {
s.setName(s.getName() + user.getName() + "、");
s.setName(s.getName() + user.getRealName() + "、");
}
}
}
@ -868,7 +868,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (ObjectUtil.isNotEmpty(user)) {
vo.setUserId(s);
if (ObjectUtil.isNotEmpty(user)) {
vo.setUserName(user.getName());
vo.setUserName(user.getRealName());
}
vo.setId(id);
list.add(vo);
@ -894,8 +894,8 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
R<User> user = userClient.userInfoById(Long.valueOf(s));
if (user.isSuccess() && ObjectUtil.isNotEmpty(user.getData())) {
vo.setUserId(s);
if (ObjectUtil.isNotEmpty(user.getData().getName())) {
vo.setUserName(user.getData().getName());
if (ObjectUtil.isNotEmpty(user.getData().getRealName())) {
vo.setUserName(user.getData().getRealName());
}
vo.setId(id);
list.add(vo);
@ -1083,7 +1083,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
dutyReportVO.setGroupName(imsDutyGroupEntity.getGroupName());
User user = UserCache.getUser(imsDutyGroupEntity.getManagerId());
if (ObjectUtil.isNotEmpty(user)){
dutyReportVO.setManagerName(user.getName());
dutyReportVO.setManagerName(user.getRealName());
}
dutyReportVO.setDutyNum(v.size());
//获取值班ID
@ -1264,7 +1264,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
}
User managerUser = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(managerUser)) {
dutyMainInfoVo.setManagerName(managerUser.getName());
dutyMainInfoVo.setManagerName(managerUser.getRealName());
dutyMainInfoVo.setManagerPhone(managerUser.getPhone());
}
@ -1294,7 +1294,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
vo.setCorryInfo(corryVo);
User carryManagerUser = UserCache.getUser(Long.valueOf(corryVo.getManagerId()));
if (ObjectUtil.isNotEmpty(carryManagerUser)) {
corryVo.setManagerName(carryManagerUser.getName());
corryVo.setManagerName(carryManagerUser.getRealName());
corryVo.setManagerPhone(carryManagerUser.getPhone());
}
}
@ -1359,7 +1359,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
// 负责人
User user = UserCache.getUser(Long.valueOf(item.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
item.setManagerName(user.getName());
item.setManagerName(user.getRealName());
item.setManagerPhone(user.getPhone());
}
// FIXME 上网
@ -1657,9 +1657,9 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
User user = restUserList.get(j);
if (ObjectUtil.isNotEmpty(user)) {
if (j == restUserList.size() - 1) {
personNames += user.getName();
personNames += user.getRealName();
} else {
personNames += user.getName() + "、";
personNames += user.getRealName() + "、";
}
}
}
@ -1732,7 +1732,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getName());
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
// 发电量
@ -1758,7 +1758,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
// 负责人
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId()));
if (ObjectUtil.isNotEmpty(user)) {
dutyInfoVo.setManagerName(user.getName());
dutyInfoVo.setManagerName(user.getRealName());
dutyInfoVo.setManagerPhone(user.getPhone());
}
dutyInfoVo.setGeneratingCapacity(0);
@ -1771,7 +1771,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
if (ObjectUtil.isNotEmpty(user)) {
AuditVo auditVo = new AuditVo();
auditVo.setPersonId(personId);
auditVo.setPersonName(user.getName());
auditVo.setPersonName(user.getRealName());
auditVo.setPhone(user.getPhone());
return auditVo;
}

22
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -342,8 +342,8 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
String userName = "";
PushExtrasReq req = new PushExtrasReq();
log.info("--------------------------req:" + req, groupEntityManagerId, userName, date);
if (ObjectUtil.isNotEmpty(userR.getData()) && StringUtil.isNotBlank(userR.getData().getName())) {
userName = userR.getData().getName();
if (ObjectUtil.isNotEmpty(userR.getData()) && StringUtil.isNotBlank(userR.getData().getRealName())) {
userName = userR.getData().getRealName();
log.info("--------------------------req2:" + req, groupEntityManagerId, userName, date);
}
String format = DateUtil.format(date, PATTERN_DATETIME);
@ -552,11 +552,11 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
}
ImsSchedulingVo imsSchedulingVo = imsDutyMainServiceImpl.getByIdOneV2(entity.getId(), null);//交班人
if (ObjectUtil.isNotEmpty(imsSchedulingVo)&&null != imsSchedulingVo.getManagerId()) {
imsSchedulingVo.setUserName(userClient.userInfoById(imsSchedulingVo.getManagerId()).getData().getName());
imsSchedulingVo.setUserName(userClient.userInfoById(imsSchedulingVo.getManagerId()).getData().getRealName());
}
ImsSchedulingVo imsSchedulingVo1 = imsDutyMainServiceImpl.getByIdOneV2(null, entity.getId());
if (ObjectUtil.isNotEmpty(imsSchedulingVo1)&&null != imsSchedulingVo1.getManagerId()) {
imsSchedulingVo1.setUserName(userClient.userInfoById(imsSchedulingVo1.getManagerId()).getData().getName());
imsSchedulingVo1.setUserName(userClient.userInfoById(imsSchedulingVo1.getManagerId()).getData().getRealName());
}else {
throw new ServiceException("没有找到接班对象值班信息,请联系管理人员,尽快进行排班!!!!");
}
@ -773,7 +773,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
if (ObjectUtil.isNotEmpty(groupEntityManagerId) && ObjectUtil.isNotEmpty(classEntity)) {
String userName = "";
if (null != groupEntityManagerId) {
userName = userClient.userInfoById(groupEntityManagerId).getData().getName();
userName = userClient.userInfoById(groupEntityManagerId).getData().getRealName();
}
PushExtrasReq req = new PushExtrasReq();
if (null != entity.getPreDutyId()) {
@ -834,7 +834,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
}
}
}
remondingCarryV2(carryMainentity.getDutyDate(),2, carryManagerId, user.getData().getName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
remondingCarryV2(carryMainentity.getDutyDate(),2, carryManagerId, user.getData().getRealName(), classEntity, null, carryTenantId, carryCreateDept, carryMainentity.getId(), carryMainentity.getCreateUser());//提醒接班人
}
}
}
@ -1157,7 +1157,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
messagePushRecordDto.setTaskId(taskId);
messagePushRecordDto.setTenantId(tenantId);
messagePushRecordDto.setPusher(admin.getId().toString());
messagePushRecordDto.setPusherName(admin.getName());
messagePushRecordDto.setPusherName(admin.getRealName());
messagePushRecordDto.setAccount(admin.getId().toString());
messagePushRecordDto.setContent(" 负责人"+userName + datyTime+ "("+classEntity.getStartTime()
+ "-" + classEntity.getEndTime()+")"+" 的值班,目前已交班延迟,请尽快联系该负责人进行交班工作!");
@ -1620,7 +1620,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
ImsDutyGroupEntity groupEntity = imsDutyGroupService.getById(dutyGroupId);
User manager = UserCache.getUser(groupEntity.getManagerId());
if (cn.hutool.core.util.ObjectUtil.isNotEmpty(manager)){
managerName=manager.getName();
managerName=manager.getRealName();
}
}else {
ImsDutyMainPersonEntity dutyMainPerson = imsDutyMainPersonService.getOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
@ -1629,7 +1629,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
}});
User manager = UserCache.getUser(dutyMainPerson.getDutyChargePerson());
if (cn.hutool.core.util.ObjectUtil.isNotEmpty(manager)){
managerName=manager.getName();
managerName=manager.getRealName();
}
}
return managerName;
@ -1643,9 +1643,9 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
User user = UserCache.getUser(Long.valueOf(split[j]));
if (org.springblade.core.tool.utils.ObjectUtil.isNotEmpty(user)) {
if (j == split.length - 1) {
handNumber= handNumber + user.getName();
handNumber= handNumber + user.getRealName();
} else {
handNumber= handNumber + user.getName()+ "、";
handNumber= handNumber + user.getRealName()+ "、";
}
}
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/controller/OverConfigController.java

@ -7,6 +7,7 @@ import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.fill.entity.OverConfigEntity;
import com.hnac.hzims.operational.fill.service.OverConfigService;
import com.hnac.hzims.operational.fill.service.OverDetailsService;
import com.hnac.hzims.operational.fill.vo.OverConfigVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -30,6 +31,8 @@ public class OverConfigController extends BladeController {
private final OverConfigService service;
private final OverDetailsService detailsService;
/**
* 新增
*/
@ -47,7 +50,7 @@ public class OverConfigController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "逻辑删除", notes = "传入id字符串以逗号分隔")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids)));
return R.status(detailsService.clear(Func.toLongList(ids)));
}
/**

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/OverConfigService.java

@ -8,6 +8,8 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import java.util.List;
/**
* 检修配置接口
*/
@ -18,4 +20,5 @@ public interface OverConfigService extends BaseService<OverConfigEntity> {
int getSort();
boolean checkOverName(String overName);
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/OverDetailsService.java

@ -16,4 +16,6 @@ import java.util.List;
public interface OverDetailsService extends BaseService<OverDetailsEntity> {
R<IPage<OverDetailsVo>> pageCondition(OverDetailsVo vo, Query query);
boolean clear(List<Long> longList);
}

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/OverConfigServiceImpl.java

@ -6,7 +6,6 @@ import com.hnac.hzims.operational.fill.entity.OverConfigEntity;
import com.hnac.hzims.operational.fill.mapper.OverConfigMapper;
import com.hnac.hzims.operational.fill.service.OverConfigService;
import com.hnac.hzims.operational.fill.vo.OverConfigVo;
import com.hnac.hzims.operational.fill.wrapper.OtherWrapper;
import com.hnac.hzims.operational.fill.wrapper.OverConfigWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/OverDetailsServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.fill.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.fill.entity.OverConfigEntity;
import com.hnac.hzims.operational.fill.entity.OverDetailsEntity;
import com.hnac.hzims.operational.fill.mapper.OverDetailsMapper;
@ -11,10 +12,12 @@ import com.hnac.hzims.operational.fill.vo.OverDetailsVo;
import com.hnac.hzims.operational.fill.wrapper.OverDetailsWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.stereotype.Service;
@ -56,4 +59,16 @@ public class OverDetailsServiceImpl extends BaseServiceImpl<OverDetailsMapper, O
return R.data(pages.setRecords(list));
}
@Override
public boolean clear(List<Long> ids) {
List<OverDetailsEntity> details = this.list(Wrappers.<OverDetailsEntity>lambdaQuery()
.in(OverDetailsEntity::getOverConfigId,ids)
.eq(OverDetailsEntity::getIsDeleted,0)
);
if(CollectionUtil.isNotEmpty(details)){
throw new ServiceException("该检修卡分类已在检修填报数据中引用,无法删除!");
}
return this.configService.deleteLogic(ids);
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/GenerateWrapper.java

@ -29,7 +29,7 @@ public class GenerateWrapper extends BaseEntityWrapper<GenerateEntity, GenerateV
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OtherWrapper.java

@ -25,7 +25,7 @@ public class OtherWrapper extends BaseEntityWrapper<OtherEntity, OtherVo> {
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverConfigWrapper.java

@ -25,7 +25,7 @@ public class OverConfigWrapper extends BaseEntityWrapper<OverConfigEntity, OverC
return vo;
}
assert vo != null;
vo.setUserName(createUser.getName());
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverDetailsWrapper.java

@ -25,7 +25,7 @@ public class OverDetailsWrapper extends BaseEntityWrapper<OverDetailsEntity, Ove
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/OverWrapper.java

@ -25,7 +25,7 @@ public class OverWrapper extends BaseEntityWrapper<OverEntity, OverVo> {
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/PowerWrapper.java

@ -25,7 +25,7 @@ public class PowerWrapper extends BaseEntityWrapper<PowerEntity, PowerVo> {
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/RainfallWrapper.java

@ -29,7 +29,7 @@ public class RainfallWrapper extends BaseEntityWrapper<RainfallEntity, RainfallV
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/SolveWrapper.java

@ -25,7 +25,7 @@ public class SolveWrapper extends BaseEntityWrapper<SolveEntity, SolveVo> {
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
vo.setAscriptionUser(entity.getCreateUser());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/StorageWrapper.java

@ -29,7 +29,7 @@ public class StorageWrapper extends BaseEntityWrapper<StorageEntity, StorageVo>
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/UseWrapper.java

@ -29,7 +29,7 @@ public class UseWrapper extends BaseEntityWrapper<UseEntity, UseVo> {
return vo;
}
assert vo != null;
vo.setUserName(Optional.ofNullable(createUser.getName()).orElse(null));
vo.setUserName(createUser.getRealName());
return vo;
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/wrapper/WindWrapper.java

@ -25,7 +25,7 @@ public class WindWrapper extends BaseEntityWrapper<WindEntity, WindVo> {
return vo;
}
assert vo != null;
vo.setUserName(createUser.getName());
vo.setUserName(createUser.getRealName());
return vo;
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/dto/BusinessFileDto.java

@ -2,7 +2,6 @@ package com.hnac.hzims.operational.main.dto;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.duty.vo.MainOperPhenomenonVo;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -25,7 +24,7 @@ public class BusinessFileDto {
private int operAccessTaskEntityCount;
@ApiModelProperty(value = "消缺单")
private List<MainOperPhenomenonVo> operPhenomenonEntityList;
private List<OperPhenomenonEntity> operPhenomenonEntityList;
@ApiModelProperty(value = "日常维护")
private List<OperMaintenanceTaskEntity> operMaintenanceTaskEntityList;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/dto/ScanDto.java

@ -3,6 +3,7 @@ package com.hnac.hzims.operational.main.dto;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import io.swagger.annotations.ApiModelProperty;
@ -30,7 +31,7 @@ public class ScanDto {
private int emInfoEntityCount;
@ApiModelProperty(value = "消缺单")
private List<OperDefectEntity> operDefectEntityList;
private List<OperPhenomenonEntity> operDefectEntityList;
@ApiModelProperty(value = "日常维护")
private List<OperMaintenanceTaskEntity> operMaintenanceTaskEntityList;

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

@ -1860,7 +1860,7 @@ public class HydropowerServiceImpl implements HydropowerService {
if (ObjectUtil.isEmpty(user)) {
return "";
}
return user.getName();
return user.getRealName();
}
/**
@ -1883,7 +1883,7 @@ public class HydropowerServiceImpl implements HydropowerService {
if (ObjectUtil.isEmpty(user)) {
continue;
}
builder.append(user.getName()).append(",");
builder.append(user.getRealName()).append(",");
}
if(builder.length() <= 0){
return "";

160
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/ScanServiceImpl.java

@ -4,37 +4,27 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.monitor.feign.IMonitorClient;
import com.hnac.hzims.operational.access.constants.AccessConstants;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.duty.vo.MainOperPhenomenonVo;
import com.hnac.hzims.operational.main.dto.BusinessFileDto;
import com.hnac.hzims.operational.main.dto.ScanDto;
import com.hnac.hzims.operational.main.service.IScanService;
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.feign.IFlowClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
@ -59,16 +49,12 @@ public class ScanServiceImpl implements IScanService {
@Override
public ScanDto getData(String emCode) {
ScanDto scanDto = new ScanDto();
//日常维护任务
List<OperMaintenanceTaskEntity> maintenanceTaskEntityList = maintenanceTaskService.list(new LambdaQueryWrapper<OperMaintenanceTaskEntity>() {{
and(o -> o.eq(OperMaintenanceTaskEntity::getStatus, MaintenanceConstant.TASK_STATUS_1).
or().eq(OperMaintenanceTaskEntity::getStatus, MaintenanceConstant.TASK_STATUS_2).
or().eq(OperMaintenanceTaskEntity::getStatus, MaintenanceConstant.TASK_STATUS_3).
or().eq(OperMaintenanceTaskEntity::getStatus, MaintenanceConstant.TASK_STATUS_4));
orderByDesc(OperMaintenanceTaskEntity::getCreateTime);
eq(OperMaintenanceTaskEntity::getEmCode, emCode);
ne(OperMaintenanceTaskEntity::getFlowTaskName,"结束");
orderByDesc(OperMaintenanceTaskEntity::getCreateTime);
}});
if(CollectionUtil.isNotEmpty(maintenanceTaskEntityList)){
scanDto.setOperMaintenanceTaskEntityCount(maintenanceTaskEntityList.size());
@ -76,130 +62,25 @@ public class ScanServiceImpl implements IScanService {
}
//检修任务
List<OperAccessTaskEntity> accessTaskEntityList = accessTaskService.list(new LambdaQueryWrapper<OperAccessTaskEntity>() {{
and(o -> o.eq(OperAccessTaskEntity::getStatus, AccessConstants.ACCESS_TASK_STATUS_1).
or().eq(OperAccessTaskEntity::getStatus, AccessConstants.ACCESS_TASK_STATUS_2).
or().eq(OperAccessTaskEntity::getStatus, AccessConstants.ACCESS_TASK_STATUS_3));
orderByDesc(OperAccessTaskEntity::getCreateTime);
eq(OperAccessTaskEntity::getEmCode, emCode);
ne(OperAccessTaskEntity::getStatus, 4);
orderByDesc(OperAccessTaskEntity::getCreateTime);
}});
if(CollectionUtil.isNotEmpty(maintenanceTaskEntityList)){
scanDto.setOperAccessTaskEntityCount(accessTaskEntityList.size());
scanDto.setOperAccessTaskEntityList(accessTaskEntityList);
}
//消缺单
List<OperDefectEntity> defectList = defectService.getDefectByEmCodeList(emCode);
if (CollectionUtil.isNotEmpty(defectList)) {
scanDto.setOperDefectEntityCount(defectList.size());
scanDto.setOperDefectEntityList(defectList);
}
/*List<String> defectList = new ArrayList<>();
List<String> maintenanceList = new ArrayList<>();
List<String> accesss = new ArrayList<>();
Date date = new Date();
log.info("--------------------开始时间--------:"+ DateUtil.format(date,DateUtil.PATTERN_DATETIME));
R<BladePage> defectAll = flowClient.todoList(CATEGORY_ID, null, 1, 9999);
if (defectAll.isSuccess()) {
BladePage data = defectAll.getData();
if (ObjectUtil.isNotEmpty(data) && CollectionUtil.isNotEmpty(data.getRecords())) {
List<Map> records = defectAll.getData().getRecords();
for (Map defect : records) {
if (defect.get("processDefinitionName").equals("巡检问题处理流程")) {
defectList.add(defect.get("businessId").toString());
} else if (defect.get("processDefinitionName").equals("日常维护流程")) {
maintenanceList.add(defect.get("businessId").toString());
} else if (defect.get("processDefinitionName").equals("检修任务执行流程")) {
accesss.add(defect.get("businessId").toString());
}
}
}
}
//消缺单
if (CollectionUtil.isNotEmpty(defectList)) {
List<OperDefectEntity> defectList1 = defectService.getDefectList(emCode, defectList);
if (CollectionUtil.isNotEmpty(defectList1)) {
scanDto.setOperDefectEntityCount(defectList1.size());
scanDto.setOperDefectEntityList(defectList1);
}
}
//日常维护任务
if (CollectionUtil.isNotEmpty(maintenanceList)) {
List<OperMaintenanceTaskEntity> operMaintenanceTaskEntities = maintenanceTaskService.getByEmCode(emCode, maintenanceList);
if (CollectionUtil.isNotEmpty(operMaintenanceTaskEntities)) {
scanDto.setOperMaintenanceTaskEntityCount(operMaintenanceTaskEntities.size());
scanDto.setOperMaintenanceTaskEntityList(operMaintenanceTaskEntities);
}
}
//检修任务
if (CollectionUtil.isNotEmpty(accesss)) {
List<OperAccessTaskEntity> operAccessTaskEntities = accessTaskService.getByEmCode(emCode, accesss);
if (CollectionUtil.isNotEmpty(operAccessTaskEntities)) {
scanDto.setOperAccessTaskEntityCount(operAccessTaskEntities.size());
scanDto.setOperAccessTaskEntityList(operAccessTaskEntities);
}
}*/
/*//消缺单
R<BladePage> defectBladePageR = flowClient.todoList(CATEGORY_ID, "巡检问题处理流程", 1, 999);
log.info("defectBladePageR--------------------:" + defectBladePageR);
if (defectBladePageR.isSuccess()) {
List<Map> defects = defectBladePageR.getData().getRecords();
if (CollectionUtil.isNotEmpty(defects)) {
for (Map defect : defects) {
defectList.add(defect.get("businessId").toString());
}
if (CollectionUtil.isNotEmpty(defectList)) {
List<OperDefectEntity> defectList1 = defectService.getDefectList(emCode, defectList);
if (CollectionUtil.isNotEmpty(defectList1)) {
scanDto.setOperDefectEntityCount(defectList1.size());
scanDto.setOperDefectEntityList(defectList1);
}
}
}
}
//日常维护任务
R<BladePage> maintenanceBladePageR = flowClient.todoList(CATEGORY_ID, "日常维护流程", 1, 999);
List<Map> maintenances = maintenanceBladePageR.getData().getRecords();
if (CollectionUtil.isNotEmpty(maintenances)) {
for (Map maintenance : maintenances) {
log.info("------------------待办--------------------" + maintenance.get("businessId").toString());
maintenanceList.add(maintenance.get("businessId").toString());
}
if (CollectionUtil.isNotEmpty(maintenanceList)) {
List<OperMaintenanceTaskEntity> operMaintenanceTaskEntities = maintenanceTaskService.getByEmCode(emCode, maintenanceList);
if (CollectionUtil.isNotEmpty(operMaintenanceTaskEntities)) {
scanDto.setOperMaintenanceTaskEntityCount(operMaintenanceTaskEntities.size());
scanDto.setOperMaintenanceTaskEntityList(operMaintenanceTaskEntities);
}
}
}
//检修任务
R<BladePage> accessBladePageR = flowClient.todoList(CATEGORY_ID, "检修任务执行流程", 1, 999);
List<Map> records = accessBladePageR.getData().getRecords();
if (CollectionUtil.isNotEmpty(records)) {
for (Map record : records) {
log.info("------------------待办--------------------" + record.get("businessId").toString());
accesss.add(record.get("businessId").toString());
}
if (CollectionUtil.isNotEmpty(accesss)) {
List<OperAccessTaskEntity> operAccessTaskEntities = accessTaskService.getByEmCode(emCode, accesss);
if (CollectionUtil.isNotEmpty(operAccessTaskEntities)) {
scanDto.setOperAccessTaskEntityCount(operAccessTaskEntities.size());
scanDto.setOperAccessTaskEntityList(operAccessTaskEntities);
}
List<OperPhenomenonEntity> phenomenons = phenomenonService.list(new LambdaQueryWrapper<OperPhenomenonEntity>(){{
eq(OperPhenomenonEntity::getEmCode,emCode);
isNull(OperPhenomenonEntity::getHandleTaskId);
orderByDesc(OperPhenomenonEntity::getCreateTime);
}});
if (CollectionUtil.isNotEmpty(phenomenons)) {
scanDto.setOperDefectEntityCount(phenomenons.size());
scanDto.setOperDefectEntityList(phenomenons);
}
}*/
return scanDto;
}
@Override
public ScanDto getRealDataTimeAndDeviceFile(String emCode){
@ -233,7 +114,7 @@ public class ScanServiceImpl implements IScanService {
//日常维护任务
List<OperMaintenanceTaskEntity> list = maintenanceTaskService.list(new LambdaQueryWrapper<OperMaintenanceTaskEntity>() {{
eq(OperMaintenanceTaskEntity::getEmCode, emCode);
eq(OperMaintenanceTaskEntity::getStatus, 5);
eq(OperMaintenanceTaskEntity::getFlowTaskName, "结束");
}});
if (CollectionUtil.isNotEmpty(list)) {
dto.setOperMaintenanceTaskEntityCount(list.size());
@ -249,15 +130,14 @@ public class ScanServiceImpl implements IScanService {
dto.setOperAccessTaskEntityList(list1);
}
//消缺单
/*List<OperPhenomenonEntity> list2 = phenomenonService.list(new LambdaQueryWrapper<OperPhenomenonEntity>() {{
List<OperPhenomenonEntity> phenomenons = phenomenonService.list(new LambdaQueryWrapper<OperPhenomenonEntity>(){{
eq(OperPhenomenonEntity::getEmCode,emCode);
eq(OperPhenomenonEntity::getConclusionStatus, 1);
}});*/
List<MainOperPhenomenonVo> listByStatus = phenomenonService.getListByStatus(emCode, DefectConstant.HandlerStatusEnum.FINISH_STATUS.getStatus());
if (CollectionUtil.isNotEmpty(listByStatus)) {
dto.setOperPhenomenonEntityCount(listByStatus.size());
dto.setOperPhenomenonEntityList(listByStatus);
isNotNull(OperPhenomenonEntity::getHandleTaskId);
orderByDesc(OperPhenomenonEntity::getCreateTime);
}});
if (CollectionUtil.isNotEmpty(phenomenons)) {
dto.setOperPhenomenonEntityList(phenomenons);
dto.setOperPhenomenonEntityCount(phenomenons.size());
}
return dto;

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

@ -236,6 +236,11 @@ public class WindHomeServiceImpl implements WindHomeService {
Map<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(stations);
return areas.entrySet().stream().map(entry -> {
WindSubordinateVo subordinate = new WindSubordinateVo();
subordinate.setGeneration(0.0);
subordinate.setGenerationRate(0.0);
subordinate.setGenerationComplete(0.0);
subordinate.setFanUse(0.0);
subordinate.setFactoryUse(0.0);
// 获取第一个站点经纬度、行政编码信息
StationEntity station = entry.getValue().get(0);
subordinate.setLttd(station.getLttd());
@ -252,11 +257,6 @@ public class WindHomeServiceImpl implements WindHomeService {
if(CollectionUtil.isNotEmpty(winds)){
List<WindEntity> piece = winds.stream().filter(o->entry.getValue().stream().map(StationEntity::getCode).collect(Collectors.toList()).contains(o.getStationCode())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(piece)){
subordinate.setGeneration(0.0);
subordinate.setGenerationRate(0.0);
subordinate.setGenerationComplete(0.0);
subordinate.setFanUse(0.0);
subordinate.setFactoryUse(0.0);
return subordinate;
}
// 发电量
@ -294,8 +294,7 @@ public class WindHomeServiceImpl implements WindHomeService {
}
}
return subordinate;
}).filter(o-> Math.abs(o.getGeneration()) > 0 || Math.abs(o.getGenerationRate()) > 0 || Math.abs(o.getGenerationComplete()) > 0
|| Math.abs(o.getFactoryUse()) > 0 || Math.abs(o.getFanUse()) > 0 ).sorted(Comparator.comparing(WindSubordinateVo::getGeneration).reversed()).collect(Collectors.toList());
}).sorted(Comparator.comparing(WindSubordinateVo::getGeneration).reversed()).collect(Collectors.toList());
}
/**
@ -721,7 +720,7 @@ public class WindHomeServiceImpl implements WindHomeService {
if (ObjectUtil.isEmpty(user)) {
return "";
}
return user.getName();
return user.getRealName();
}
/**
@ -744,7 +743,7 @@ public class WindHomeServiceImpl implements WindHomeService {
if (ObjectUtil.isEmpty(user)) {
continue;
}
builder.append(user.getName()).append(",");
builder.append(user.getRealName()).append(",");
}
if(builder.length() <= 0){
return "";

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenancePlanController.java

@ -67,14 +67,14 @@ public class OperMaintenancePlanController extends BladeController {
req.setTaskType("1");
if (ObjectUtil.isNotEmpty(req.getDisposer())){
User user = UserCache.getUser(req.getDisposer());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getName())){
req.setDisposerName(user.getName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getRealName())){
req.setDisposerName(user.getRealName());
}
}
BladeUser user = AuthUtil.getUser();
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getUserName())){
req.setCreateUserName(user.getUserName());
req.setUpdateUserName(user.getUserName());
if (ObjectUtil.isNotEmpty(user)&& StringUtils.isNotEmpty(user.getNickName())){
req.setCreateUserName(user.getNickName());
req.setUpdateUserName(user.getNickName());
}
planService.save(req);
return R.data(req);

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/OperMaintenanceTaskController.java

@ -124,6 +124,7 @@ public class OperMaintenanceTaskController extends BladeController {
public R<IPage<OperMaintenanceTaskVO>> list(@RequestBody OperMaintenanceTaskDTO req) {
return taskService.list(req);
}
@ApiLog
@PostMapping("/exportMaintenance")
@ApiOperationSupport(order = 2)

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskRemindHandler.java

@ -1,6 +1,5 @@
package com.hnac.hzims.operational.maintenance.scheduled;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Lists;
import com.hnac.hzims.common.constant.CommonConstant;
import com.hnac.hzims.message.MessageConstants;
@ -17,7 +16,6 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.data.redis.core.RedisTemplate;
@ -31,6 +29,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import static com.hnac.hzims.operational.maintenance.constants.ScheduledConstant.REMIND_MAINTENANCE_BECOME_TASK;
@Component
@Slf4j
@AllArgsConstructor
@ -56,7 +55,7 @@ public class MaintenanceTaskRemindHandler {
else if(Lists.newArrayList("待领用","待执行").contains(taskEntity.getFlowTaskName())) {
XxlJobLogger.log("开始执行id为{}的任务", Optional.ofNullable(operMaintenanceTaskEntity.getId()).orElse(0L));
//日常维护任务到期消息提醒,提醒对象:执行人、项目经理角色 取出
//this.sendMessage(taskEntity);
this.sendMessage(taskEntity);
redisTemplate.opsForZSet().remove(RedisKeyConstants.MAINTENANCE_TASK_DELAY_LIST,operMaintenanceTaskEntity);
}
});
@ -84,7 +83,7 @@ public class MaintenanceTaskRemindHandler {
request.setCreateUser(taskEntity.getCreateUser());
request.setTenantId(CommonConstant.TENANT_ID);
R<Boolean> sendFlag = messageClient.sendAppAndWsMsgByUsers(request);
if(!(sendFlag.isSuccess() && sendFlag.getData())) {
if(!sendFlag.isSuccess() || sendFlag.getData() == null) {
XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
}
// 任务执行人发送短信
@ -93,7 +92,7 @@ public class MaintenanceTaskRemindHandler {
request.setUserIds(listR.getData().stream().map(User::getId).map(String::valueOf).collect(Collectors.joining(",")));
request.setContent("有一条待执行的日常维护任务【"+taskEntity.getTitle()+"】即将于"+ DateUtil.format(taskEntity.getPlanEndTime(),DateUtil.PATTERN_DATETIME) +"过期,请确认。");
R<Boolean> result = messageClient.sendAppAndWsMsgByUsers(request);
if(!(result.isSuccess() && result.getData())) {
if(!result.isSuccess() || result.getData() == null) {
XxlJobLogger.log(taskEntity.getId() +"执行人消息推送失败!");
}
}

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java

@ -61,10 +61,12 @@ public class MaintenanceTaskSchedule {
@XxlJob(GENERATE_MAINTENANCE_TASK_SCHEDULE)
public ReturnT<String> execute(String param) throws Exception {
Date startDate = StringUtil.isNotBlank(param) ? DateUtil.parse(param, DateUtil.PATTERN_DATE) : DateUtil.parse(DateUtil.formatDate(DateUtil.now()), DateUtil.PATTERN_DATE);
Date endDate = DateUtil.parse(DateUtil.formatDate(DateUtil.plusDays(startDate, 1)), DateUtil.PATTERN_DATE);
LambdaQueryWrapper<OperMaintenancePlanEntity> planQW = Wrappers.<OperMaintenancePlanEntity>lambdaQuery().isNull(OperMaintenancePlanEntity::getCreateTaskTime)
.ge(OperMaintenancePlanEntity::getDisposeTime, startDate).lt(OperMaintenancePlanEntity::getDisposeTime, endDate);
String startDate = DateUtil.format(DateUtil.now(), DateUtil.PATTERN_DATE) + " 00:00:00";
String endDate = DateUtil.format(DateUtil.plusDays(DateUtil.now(), 1), DateUtil.PATTERN_DATE) + " 00:00:00";
LambdaQueryWrapper<OperMaintenancePlanEntity> planQW = Wrappers.<OperMaintenancePlanEntity>lambdaQuery()
.isNull(OperMaintenancePlanEntity::getCreateTaskTime)
.ge(OperMaintenancePlanEntity::getDisposeTime, startDate)
.lt(OperMaintenancePlanEntity::getDisposeTime, endDate);
List<OperMaintenancePlanEntity> planList = planService.list(planQW);
XxlJobLogger.log("日常维护任务生成开始!计划ID为:"+planList.stream().map(OperMaintenancePlanEntity::getId).map(String::valueOf).collect(Collectors.joining(",")));
//分页插入日常维护计划

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java

@ -348,8 +348,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
String disposerName="";
for (int i = 0; i < split.length; i++) {
User user = UserCache.getUser(Long.valueOf(split[i]));
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getName())){
disposerName=disposerName+user.getName();
if (ObjectUtil.isNotEmpty(user)&&StringUtils.isNotBlank(user.getRealName())){
disposerName=disposerName+user.getRealName();
}
}
taskEntity.setDisposer(userId.replaceAll("\\^", ","));

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceTaskServiceImpl.java

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
@ -54,6 +53,7 @@ import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

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

@ -75,7 +75,7 @@ public class OperPersonalCreateMonthReport {
}
}
else{
log.info("{}已生成月报",user.getName());
log.info("{}已生成月报",user.getRealName());
}
}
});

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

@ -554,7 +554,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
List<User> userListByRoleAlias = userClient.relationUserListByRoleAlias("200000", deptId, PROJECT_MANAGER).getData();
if (CollectionUtil.isNotEmpty(userListByRoleAlias)){
User user = userListByRoleAlias.get(0);
map.put("manager", user.getName());
map.put("manager", user.getRealName());
}else {
map.put("manager","");
}
@ -624,7 +624,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
map.put("inspectReportSum", sumList);
continue;
}
fillMapByClass(inspectReportVOList,list);
fillMapByClass(inspectReport, list);
}
map.put("inspectReportVOList", list);
}
@ -1222,7 +1222,8 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor
int sum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum();
int qualifiedNum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum();
// double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(sum,2, RoundingMode.HALF_DOWN).doubleValue();
double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(new BigDecimal(sum*100),2, RoundingMode.HALF_DOWN).doubleValue();
double ticketInfoProportion = sum == 0 ? 0 : new BigDecimal(qualifiedNum).divide(new BigDecimal(sum*100),2,
RoundingMode.HALF_DOWN).doubleValue();
String phenomenonConclusion = "5、本月开票%s张,合格率%s;";
conclusion.append(String.format(phenomenonConclusion, sum, ticketInfoProportion)).append(";\r\n");
}else {

18
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java

@ -104,21 +104,11 @@ public class StationController extends BladeController {
return R.status(stationService.instanceProject(req));
}
@PostMapping("/updateBatch")
@PostMapping("/updateBatchSort")
@ApiOperationSupport(order = 30)
@ApiOperation(value = "批量修改", notes = "传入站点列表")
public R updateBatch(@RequestBody List<StationEntity> req) {
for (StationEntity stationEntity : req) {
if (StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) {
List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getCode, stationEntity.getCode()).or().eq(StationEntity::getName, stationEntity.getName());
}});
Assert.isTrue(CollectionUtil.isEmpty(list), () -> {
throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理");
});
}
}
return R.status(stationService.updateBatchById(req));
@ApiOperation(value = "批量修改排序", notes = "传入站点列表")
public R updateBatchSort(@RequestBody List<StationEntity> req) {
return R.status(stationService.updateBatchSort(req));
}
/**

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

@ -144,4 +144,10 @@ public interface IStationService extends BaseService<StationEntity> {
Boolean updateStation(StationEntity station);
/**
* 批量更新站点排序
* @param req 站点列表
* @return 更新是否成功
*/
boolean updateBatchSort(List<StationEntity> req);
}

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -896,4 +896,19 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
}
return false;
}
/**
* 批量更新站点排序
*/
@Override
public boolean updateBatchSort(List<StationEntity> req) {
List<StationEntity> stations = new ArrayList<>();
for (StationEntity stationEntity : req) {
// 获取当前的站点信息
StationEntity station = this.getById(stationEntity.getId());
station.setSort(stationEntity.getSort());
stations.add(station);
}
return this.updateBatchById(stations);
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/workOrder/service/impl/DistributeWorkOrderServiceImpl.java

@ -82,7 +82,7 @@ public class DistributeWorkOrderServiceImpl implements IDistributeWorkOrderServi
publisher.setContactAddress("123123");
publisher.setContactName("123123");
publisher.setContactPhone(user.getPhone());
publisher.setPublisher(user.getName());
publisher.setPublisher(user.getRealName());
publisher.setPublisherScale("123123");
orderPackageDto.setPublisher(publisher);
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

BIN
hzims-service/operational/src/main/resources/template/excel/access_import_template.xlsx

Binary file not shown.

1
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ReviewController.java

@ -78,6 +78,7 @@ public class ReviewController extends BladeController {
throw new ServiceException("该站点已录入数据,无法重复录入");
});
ReviewEntity entity = BeanUtil.copy(req,ReviewEntity.class);
entity.setSubmitter(AuthUtil.getUserId());
reviewService.save(entity);
req.getReviewStandardEntityList().stream().forEach(reviewStandardEntity -> {
reviewStandardEntity.setReviewId(entity.getId());

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

@ -129,7 +129,7 @@ public class SafeToolTypePushUserTask {
else {
typeNames = typeEntityList.stream().map(SafetyToolTypeEntity::getTypeName).collect(Collectors.joining("、"));
}
XxlJobLogger.log("开始推送,推送人:{}",JSONObject.toJSONString(noticeUser.getName()));
XxlJobLogger.log("开始推送,推送人:{}",JSONObject.toJSONString(noticeUser.getRealName()));
if(sendType == APP_PUSH && Func.isNotEmpty(noticeUser.getPhone())){
//短信推送
String code = "safeTool";

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/EmergencyPlanServiceImpl.java

@ -51,7 +51,7 @@ public class EmergencyPlanServiceImpl extends BaseServiceImpl<EmergencyPlanMappe
like("file_name", req.getFileName());
}
}};
queryWrapper.orderByDesc("create_time");
IPage pages = super.page(Condition.getPage(query), queryWrapper);
List list = EmergencyPlanWrapper.build().listVO(pages.getRecords());
return R.data(pages.setRecords(list));

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/wrapper/ImsMonAlarmInfoWrapper.java

@ -28,7 +28,7 @@ public class ImsMonAlarmInfoWrapper extends BaseEntityWrapper<ImsMonAlarmInfoEnt
if(entity != null){
ImsMonAlarmInfoVO vo = BeanUtil.copy(entity, ImsMonAlarmInfoVO.class);
vo.setCameraName(cameraInfoService.getById(vo.getCameraId()).getName());
vo.setAcceptUserName(UserCache.getUser(entity.getCreateUser()).getName());
vo.setAcceptUserName(UserCache.getUser(entity.getCreateUser()).getRealName());
return vo;
} else {
return null;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save