diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
index b0f4153..77e63a0 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/workTicket/entity/WorkTicketInfoEntity.java
+++ b/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("工作接收人时间")
- private String jobReceiverDateTime;
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime jobReceiverTime;
/**
diff --git a/hzims-service/operational/pom.xml b/hzims-service/operational/pom.xml
index 08f941d..e9dd242 100644
--- a/hzims-service/operational/pom.xml
+++ b/hzims-service/operational/pom.xml
@@ -100,8 +100,8 @@
org.apache.poi
- ooxml-schemas
- 1.4
+ poi-ooxml-schemas
+ 3.15
org.jfree
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
index fd93f5f..b7882fc 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AppHomeServiceImpl.java
+++ b/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);
}
+
+
/**
* 获取下一班组数据
* @param item
+ *
* @param id
*/
private void getNextDuty(AppAreaDutyVo item, Long id) {
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
index 2717ab6..8a6cb12 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
+++ b/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 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 DUTY_POOL_QUANTITY = 5;
@@ -131,7 +133,7 @@ public class HydropowerServiceImpl implements HydropowerService {
public void loadHydropowerReal(String param) {
// 水电站站点
List stations = stationService.list(Wrappers.lambdaQuery()
- .eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
+ //.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
);
if(CollectionUtil.isEmpty(stations)){
@@ -189,7 +191,7 @@ public class HydropowerServiceImpl implements HydropowerService {
public void loadHydropowerTarget(String param) {
// 水电站站点
List stations = stationService.list(Wrappers.lambdaQuery()
- .eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
+ //.eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE)
.eq(StationEntity::getType,HomePageConstant.HYDROPOWER)
);
if(CollectionUtil.isEmpty(stations)){
@@ -1146,11 +1148,11 @@ public class HydropowerServiceImpl implements HydropowerService {
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())).
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());
}
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());
}
@@ -1234,6 +1236,10 @@ public class HydropowerServiceImpl implements HydropowerService {
*/
@Override
public List group(Long deptId) {
+ List gourps = (List) redisTemplate.opsForValue().get(loadwater_group_key + deptId);
+ if(CollectionUtil.isNotEmpty(gourps)){
+ return gourps;
+ }
Map> areas = areaService.areaOrStaion(deptId,Collections.singletonList(HomePageConstant.HYDROPOWER));
if(MapUtils.isEmpty(areas)) {
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())));
// 计划发电量
List plans = planGenertionClient.getPlanGenerationByParam(codes,null,String.valueOf(Calendar.getInstance().get(Calendar.YEAR)));
- return areas.entrySet().stream().map(entry->{
+ List hydropowerAreas = areas.entrySet().stream().map(entry->{
HydropowerAreaVo area = new HydropowerAreaVo();
area.setDeptId(entry.getKey().getId());
area.setDeptName(entry.getKey().getDeptName());
@@ -1275,6 +1281,9 @@ public class HydropowerServiceImpl implements HydropowerService {
area.setStationTargets(this.stationTarget(entry.getValue(),reals,targets,plans));
return area;
}).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;
}
/**
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
index 0f13bc3..7d58740 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
+++ b/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 ->{
Map points = o.getPoint();
if(CollectionUtil.isEmpty(points)){
- return "";
+ return "0";
}
String realId = points.get(HomePageConstant.JOINT_RELAY);
- if(StringUtil.isBlank(realId)){
- return "";
+ if(StringUtil.isEmpty(realId)){
+ return "0";
+ }
+ if(MapUtils.isEmpty(realMap)){
+ return "0";
}
String value = realMap.get(realId);
- if(StringUtil.isBlank(value)){
- return "";
+ if(StringUtil.isEmpty(value)){
+ return "0";
}
if (value.contains("1") || "1.0".equals(value)) {
return o.getEmCode();
}
- return "";
+ return "0";
}).distinct().collect(Collectors.toList());
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
index 7ef6964..12eda49 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
+++ b/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;
}
- //更新工作票
- workTicket.setId(workTicketInfo.getId());
- //保存流程描述
- workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
- workTicket.setTenantId(workTicketInfo.getTenantId());
- saveWorkTicket(workTicket, response);
- //工作流ID
- workTicket.setProcessInstanceId(response.getProcessInstanceId());
- workTicketInfoService.updateById(workTicket);
+ try {
+ //更新工作票
+ workTicket.setId(workTicketInfo.getId());
+ //保存流程描述
+ workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
+ workTicket.setTenantId(workTicketInfo.getTenantId());
+ saveWorkTicket(workTicket, response);
+ //工作流ID
+ workTicket.setProcessInstanceId(response.getProcessInstanceId());
+ workTicketInfoService.updateById(workTicket);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
//更新安全措施
List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
@@ -287,9 +291,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
workTicketDelay.setCreateDept(workTicketInfo.getCreateDept());
workTicketDelay.setTicketId(workTicketInfo.getId());
workTicketDelay.setTenantId(workTicketInfo.getTenantId());
- if (ObjectUtils.isEmpty(workTicketDelay.getId()) || ObjectUtils.isEmpty(workTicketDelayEntity)) {
+ if (ObjectUtils.isEmpty(workTicketDelayEntity)) {
+ log.info("正在保存工作票延期");
workTicketDelayService.save(workTicketDelay);
} else {
+ log.info("正在更新工作票延期");
workTicketDelayService.updateByTicketId(workTicketDelay);
}
}
@@ -338,9 +344,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId());
- if (workTicketPrincipalChange.getId() == null || ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
+ if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
+ log.info("工作票负责人保存变更");
workTicketPrincipalChangeService.save(workTicketPrincipalChange);
} else {
+ log.info("工作票负责人更新变更");
workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange);
}
log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
@@ -355,11 +363,15 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//工作票危险点分析及控制措施票
- if (workTicketInfo.getIsHazard()) {
- List ticketInfoDangers = workTicketVo.getTicketInfoDangers();
- if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
- ticketInfoDangerService.saveBatch(ticketInfoDangers);
+ try {
+ if (workTicketInfo.getIsHazard()) {
+ List ticketInfoDangers = workTicketVo.getTicketInfoDangers();
+ 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())) {
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null);
- //下一个审批人
- User stepUser = UserCache.getUser(taskUser);
- flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(stepUser.getName()).concat("审批");
- workTicket.setNextStepOperator(stepUser.getName());
+ if (taskUser != null) {
+ //下一个审批人
+ User stepUser = UserCache.getUser(taskUser);
+ 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())) {
- System.out.println("获取角色信息" + response.getNextStepOperator());
+ log.info("获取角色信息" + response.getNextStepOperator());
//根据角色别名获取用户信息
try {
R> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator());
@@ -399,6 +417,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
e.printStackTrace();
log.error("R> roleAlias = userClient.userListByRoleAlias(workTicket.getTenantId(), response.getNextStepOperator())");
log.error("获取用户信息失败");
+ workTicket.setNextStepOperator(null);
}
}
@@ -418,6 +437,9 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if (StringUtils.isEmpty(nextStepOperator)) {
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.setCreateUser(AuthUtil.getUserId());
+ workTicket.setIsSafety(false);
+ workTicket.setIsHazard(false);
+ workTicket.setIsRailway(false);
+ workTicket.setIsLimited(false);
boolean isSave = firstWorkTicketService.save(workTicket);
if (!isSave) {
throw new IllegalArgumentException("保存工作对象错误");
@@ -738,13 +764,13 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//1. 工作对象
Map workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, result);
//安全隔离措施附页 (true,展示附件,false,不展示附件
- getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety"));
+ this.getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety"));
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
- getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard"));
+ this.getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard"));
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
- getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway"));
+ this.getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway"));
//有限空间监测记录单(true,展示附件,false,不展示附件)
- getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited"));
+ this.getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited"));
result.putAll(workTicketInfoMap);
//2. 安全措施
List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java
index 893b07d..8e6059e 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketPrincipalChangeServiceImpl.java
@@ -101,7 +101,7 @@ public class WorkTicketPrincipalChangeServiceImpl extends BaseServiceImpl