Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
tyty 2 years ago
parent
commit
82a9a00976
  1. 4
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
  2. 4
      hzims-service/operational/pom.xml
  3. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
  4. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
  5. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
  6. 74
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  7. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java
  8. 2
      hzims-service/ticket/src/main/resources/application.yml
  9. BIN
      hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx

4
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java

@ -446,7 +446,9 @@ public class WorkTicketInfoEntity extends TenantEntity implements Serializable {
* 工作接收人时间 * 工作接收人时间
*/ */
@ApiModelProperty("工作接收人时间") @ApiModelProperty("工作接收人时间")
private String jobReceiverDateTime; @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime jobReceiverTime;
/** /**

4
hzims-service/operational/pom.xml

@ -100,8 +100,8 @@
<!-- 月报统计图表导出--> <!-- 月报统计图表导出-->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId> <artifactId>poi-ooxml-schemas</artifactId>
<version>1.4</version> <version>3.15</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jfree</groupId> <groupId>org.jfree</groupId>

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java

@ -567,9 +567,12 @@ public class AppHomeServiceImpl implements IAppHomeService {
item.setClassMember(classMember); item.setClassMember(classMember);
} }
/** /**
* 获取下一班组数据 * 获取下一班组数据
* @param item * @param item
*
* @param id * @param id
*/ */
private void getNextDuty(AppAreaDutyVo item, Long id) { private void getNextDuty(AppAreaDutyVo item, Long id) {

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

@ -118,6 +118,8 @@ public class HydropowerServiceImpl implements HydropowerService {
private final static String load_hydropower_unit_target_key = "hzims:operation:loadhydropowerunit:target:key"; private final static String load_hydropower_unit_target_key = "hzims:operation:loadhydropowerunit:target:key";
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
private final static String loadwater_group_key = "hzims:operation:group:key";
private final static int POOL_QUANTITY = 4; private final static int POOL_QUANTITY = 4;
private final static int DUTY_POOL_QUANTITY = 5; private final static int DUTY_POOL_QUANTITY = 5;
@ -131,7 +133,7 @@ public class HydropowerServiceImpl implements HydropowerService {
public void loadHydropowerReal(String param) { public void loadHydropowerReal(String param) {
// 水电站站点 // 水电站站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) //.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER) .eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
); );
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){
@ -189,7 +191,7 @@ public class HydropowerServiceImpl implements HydropowerService {
public void loadHydropowerTarget(String param) { public void loadHydropowerTarget(String param) {
// 水电站站点 // 水电站站点
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE) //.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER) .eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
); );
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){
@ -1146,11 +1148,11 @@ public class HydropowerServiceImpl implements HydropowerService {
if(Math.abs(generate_sum) > 0){ if(Math.abs(generate_sum) > 0){
return scales.stream().peek(scale-> scale.setAreaMakeUp(BigDecimal.valueOf(scale.getPowerYear() / generate_sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue())). return scales.stream().peek(scale-> scale.setAreaMakeUp(BigDecimal.valueOf(scale.getPowerYear() / generate_sum * 100).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue())).
filter(scale-> Math.abs(scale.getCapacityUse()) > 0 || Math.abs(scale.getAreaMakeUp()) > 0 filter(scale-> Math.abs(scale.getCapacityUse()) > 0 || Math.abs(scale.getAreaMakeUp()) > 0
&& Math.abs(scale.getDeviceUse()) > 0 || Math.abs(scale.getGenerationRate()) > 0) || Math.abs(scale.getDeviceUse()) > 0 || Math.abs(scale.getGenerationRate()) > 0)
.sorted(Comparator.comparing(AreaScaleVo::getPowerYear).reversed()).collect(Collectors.toList()); .sorted(Comparator.comparing(AreaScaleVo::getPowerYear).reversed()).collect(Collectors.toList());
} }
return scales.stream().peek(scale-> scale.setAreaMakeUp(0.0)).filter(scale-> Math.abs(scale.getCapacityUse()) > 0 || Math.abs(scale.getAreaMakeUp()) > 0 return scales.stream().peek(scale-> scale.setAreaMakeUp(0.0)).filter(scale-> Math.abs(scale.getCapacityUse()) > 0 || Math.abs(scale.getAreaMakeUp()) > 0
&& Math.abs(scale.getDeviceUse()) > 0 || Math.abs(scale.getGenerationRate()) > 0) || Math.abs(scale.getDeviceUse()) > 0 || Math.abs(scale.getGenerationRate()) > 0)
.sorted(Comparator.comparing(AreaScaleVo::getPowerYear).reversed()).collect(Collectors.toList()); .sorted(Comparator.comparing(AreaScaleVo::getPowerYear).reversed()).collect(Collectors.toList());
} }
@ -1234,6 +1236,10 @@ public class HydropowerServiceImpl implements HydropowerService {
*/ */
@Override @Override
public List<HydropowerAreaVo> group(Long deptId) { public List<HydropowerAreaVo> group(Long deptId) {
List<HydropowerAreaVo> gourps = (List<HydropowerAreaVo>) redisTemplate.opsForValue().get(loadwater_group_key + deptId);
if(CollectionUtil.isNotEmpty(gourps)){
return gourps;
}
Map<Dept,List<StationEntity>> areas = areaService.areaOrStaion(deptId,Collections.singletonList(HomePageConstant.HYDROPOWER)); Map<Dept,List<StationEntity>> areas = areaService.areaOrStaion(deptId,Collections.singletonList(HomePageConstant.HYDROPOWER));
if(MapUtils.isEmpty(areas)) { if(MapUtils.isEmpty(areas)) {
return new ArrayList<>(); return new ArrayList<>();
@ -1252,7 +1258,7 @@ public class HydropowerServiceImpl implements HydropowerService {
areas.forEach((key,value)-> codes.addAll(value.stream().map(StationEntity::getCode).collect(Collectors.toList()))); areas.forEach((key,value)-> codes.addAll(value.stream().map(StationEntity::getCode).collect(Collectors.toList())));
// 计划发电量 // 计划发电量
List<PlanGenerationEntity> plans = planGenertionClient.getPlanGenerationByParam(codes,null,String.valueOf(Calendar.getInstance().get(Calendar.YEAR))); List<PlanGenerationEntity> plans = planGenertionClient.getPlanGenerationByParam(codes,null,String.valueOf(Calendar.getInstance().get(Calendar.YEAR)));
return areas.entrySet().stream().map(entry->{ List<HydropowerAreaVo> hydropowerAreas = areas.entrySet().stream().map(entry->{
HydropowerAreaVo area = new HydropowerAreaVo(); HydropowerAreaVo area = new HydropowerAreaVo();
area.setDeptId(entry.getKey().getId()); area.setDeptId(entry.getKey().getId());
area.setDeptName(entry.getKey().getDeptName()); area.setDeptName(entry.getKey().getDeptName());
@ -1275,6 +1281,9 @@ public class HydropowerServiceImpl implements HydropowerService {
area.setStationTargets(this.stationTarget(entry.getValue(),reals,targets,plans)); area.setStationTargets(this.stationTarget(entry.getValue(),reals,targets,plans));
return area; return area;
}).sorted(Comparator.comparing(HydropowerAreaVo::getReality)).collect(Collectors.toList()); }).sorted(Comparator.comparing(HydropowerAreaVo::getReality)).collect(Collectors.toList());
redisTemplate.opsForValue().set(loadwater_group_key,hydropowerAreas);
redisTemplate.expire(loadwater_group_key,5, TimeUnit.MINUTES);
return hydropowerAreas;
} }
/** /**

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

@ -344,20 +344,23 @@ public class SideHustleServiceImpl implements ISideHustleService {
return runDeviceList.stream().map(o ->{ return runDeviceList.stream().map(o ->{
Map<String,String> points = o.getPoint(); Map<String,String> points = o.getPoint();
if(CollectionUtil.isEmpty(points)){ if(CollectionUtil.isEmpty(points)){
return ""; return "0";
} }
String realId = points.get(HomePageConstant.JOINT_RELAY); String realId = points.get(HomePageConstant.JOINT_RELAY);
if(StringUtil.isBlank(realId)){ if(StringUtil.isEmpty(realId)){
return ""; return "0";
}
if(MapUtils.isEmpty(realMap)){
return "0";
} }
String value = realMap.get(realId); String value = realMap.get(realId);
if(StringUtil.isBlank(value)){ if(StringUtil.isEmpty(value)){
return ""; return "0";
} }
if (value.contains("1") || "1.0".equals(value)) { if (value.contains("1") || "1.0".equals(value)) {
return o.getEmCode(); return o.getEmCode();
} }
return ""; return "0";
}).distinct().collect(Collectors.toList()); }).distinct().collect(Collectors.toList());
} }

74
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -240,15 +240,19 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} }
return; return;
} }
//更新工作票 try {
workTicket.setId(workTicketInfo.getId()); //更新工作票
//保存流程描述 workTicket.setId(workTicketInfo.getId());
workTicketInfo.setCreateDept(workTicketInfo.getCreateDept()); //保存流程描述
workTicket.setTenantId(workTicketInfo.getTenantId()); workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
saveWorkTicket(workTicket, response); workTicket.setTenantId(workTicketInfo.getTenantId());
//工作流ID saveWorkTicket(workTicket, response);
workTicket.setProcessInstanceId(response.getProcessInstanceId()); //工作流ID
workTicketInfoService.updateById(workTicket); workTicket.setProcessInstanceId(response.getProcessInstanceId());
workTicketInfoService.updateById(workTicket);
} catch (Exception e) {
e.printStackTrace();
}
//更新安全措施 //更新安全措施
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
@ -287,9 +291,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicketDelay.setCreateDept(workTicketInfo.getCreateDept()); workTicketDelay.setCreateDept(workTicketInfo.getCreateDept());
workTicketDelay.setTicketId(workTicketInfo.getId()); workTicketDelay.setTicketId(workTicketInfo.getId());
workTicketDelay.setTenantId(workTicketInfo.getTenantId()); workTicketDelay.setTenantId(workTicketInfo.getTenantId());
if (ObjectUtils.isEmpty(workTicketDelay.getId()) || ObjectUtils.isEmpty(workTicketDelayEntity)) { if (ObjectUtils.isEmpty(workTicketDelayEntity)) {
log.info("正在保存工作票延期");
workTicketDelayService.save(workTicketDelay); workTicketDelayService.save(workTicketDelay);
} else { } else {
log.info("正在更新工作票延期");
workTicketDelayService.updateByTicketId(workTicketDelay); workTicketDelayService.updateByTicketId(workTicketDelay);
} }
} }
@ -338,9 +344,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId()); WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId());
if (workTicketPrincipalChange.getId() == null || ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) { if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
log.info("工作票负责人保存变更");
workTicketPrincipalChangeService.save(workTicketPrincipalChange); workTicketPrincipalChangeService.save(workTicketPrincipalChange);
} else { } else {
log.info("工作票负责人更新变更");
workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange); workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange);
} }
log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName()); log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
@ -355,11 +363,15 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//工作票危险点分析及控制措施票 //工作票危险点分析及控制措施票
if (workTicketInfo.getIsHazard()) { try {
List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers(); if (workTicketInfo.getIsHazard()) {
if (CollectionUtils.isNotEmpty(ticketInfoDangers)) { List<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers();
ticketInfoDangerService.saveBatch(ticketInfoDangers); if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
ticketInfoDangerService.saveBatch(ticketInfoDangers);
}
} }
} catch (Exception e) {
e.printStackTrace();
} }
} }
@ -380,15 +392,21 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if ("0".equals(response.getHandleType())) { if ("0".equals(response.getHandleType())) {
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null); Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null);
//下一个审批人 if (taskUser != null) {
User stepUser = UserCache.getUser(taskUser); //下一个审批人
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(stepUser.getName()).concat("审批"); User stepUser = UserCache.getUser(taskUser);
workTicket.setNextStepOperator(stepUser.getName()); if (stepUser != null) {
flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(stepUser.getName()).concat("审批");
workTicket.setNextStepOperator(stepUser.getName());
}
}else {
workTicket.setNextStepOperator(null);
}
} }
if ("1".equals(response.getHandleType())) { if ("1".equals(response.getHandleType())) {
System.out.println("获取角色信息" + response.getNextStepOperator()); log.info("获取角色信息" + response.getNextStepOperator());
//根据角色别名获取用户信息 //根据角色别名获取用户信息
try { try {
R<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator()); R<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator());
@ -399,6 +417,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
e.printStackTrace(); e.printStackTrace();
log.error("R<List<User>> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())"); log.error("R<List<User>> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())");
log.error("获取用户信息失败"); log.error("获取用户信息失败");
workTicket.setNextStepOperator(null);
} }
} }
@ -418,6 +437,9 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if (StringUtils.isEmpty(nextStepOperator)) { if (StringUtils.isEmpty(nextStepOperator)) {
workTicket.setNextStepOperator(null); workTicket.setNextStepOperator(null);
} }
System.out.println("workTicket = " + workTicket);
} }
@ -599,6 +621,10 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName()); workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName());
//唯一 //唯一
workTicket.setCreateUser(AuthUtil.getUserId()); workTicket.setCreateUser(AuthUtil.getUserId());
workTicket.setIsSafety(false);
workTicket.setIsHazard(false);
workTicket.setIsRailway(false);
workTicket.setIsLimited(false);
boolean isSave = firstWorkTicketService.save(workTicket); boolean isSave = firstWorkTicketService.save(workTicket);
if (!isSave) { if (!isSave) {
throw new IllegalArgumentException("保存工作对象错误"); throw new IllegalArgumentException("保存工作对象错误");
@ -738,13 +764,13 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//1. 工作对象 //1. 工作对象
Map<String, Object> workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, result); Map<String, Object> workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, result);
//安全隔离措施附页 (true,展示附件,false,不展示附件 //安全隔离措施附页 (true,展示附件,false,不展示附件
getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety")); this.getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety"));
//危险点分析与预控措施票 (true,展示附件,false,不展示附件) //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard")); this.getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard"));
//危险点分析与预控措施票 (true,展示附件,false,不展示附件) //危险点分析与预控措施票 (true,展示附件,false,不展示附件)
getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway")); this.getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway"));
//有限空间监测记录单(true,展示附件,false,不展示附件) //有限空间监测记录单(true,展示附件,false,不展示附件)
getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited")); this.getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited"));
result.putAll(workTicketInfoMap); result.putAll(workTicketInfoMap);
//2. 安全措施 //2. 安全措施
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java

@ -101,7 +101,7 @@ public class WorkTicketPrincipalChangeServiceImpl extends BaseServiceImpl<WorkTi
queryWrapper.eq(WorkTicketPrincipalChangeEntity::getTicketId,ticketId); queryWrapper.eq(WorkTicketPrincipalChangeEntity::getTicketId,ticketId);
queryWrapper.orderByDesc(BaseEntity::getCreateTime); queryWrapper.orderByDesc(BaseEntity::getCreateTime);
queryWrapper.last("limit 1"); queryWrapper.last("limit 1");
return this.getOne(queryWrapper); return this.list(queryWrapper).get(0);
} }
/** /**

2
hzims-service/ticket/src/main/resources/application.yml

@ -5,6 +5,8 @@ mybatis-plus:
- classpath:/mapper/**/*.xml - classpath:/mapper/**/*.xml
#实体扫描,多个package用逗号或者分号分隔 #实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity typeAliasesPackage: com.hnac.hzims.**.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置 #swagger扫描路径配置
swagger: swagger:

BIN
hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx

Binary file not shown.
Loading…
Cancel
Save