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("工作接收人时间")
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>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<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);
}
/**
* 获取下一班组数据
* @param item
*
* @param 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 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<StationEntity> stations = stationService.list(Wrappers.<StationEntity>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<StationEntity> stations = stationService.list(Wrappers.<StationEntity>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<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));
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<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();
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;
}
/**

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 ->{
Map<String,String> 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());
}

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;
}
//更新工作票
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<WorkTicketSafetyMeasureEntity> 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<TicketInfoDanger> ticketInfoDangers = workTicketVo.getTicketInfoDangers();
if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
ticketInfoDangerService.saveBatch(ticketInfoDangers);
try {
if (workTicketInfo.getIsHazard()) {
List<TicketInfoDanger> 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<List<User>> roleAlias = userClient.relationUserListByRoleAlias(workTicket.getTenantId(), workTicket.getCreateDept(), response.getNextStepOperator());
@ -399,6 +417,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
e.printStackTrace();
log.error("R<List<User>> 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<String, Object> 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<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.orderByDesc(BaseEntity::getCreateTime);
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
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.hnac.hzims.**.entity
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#swagger扫描路径配置
swagger:

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

Binary file not shown.
Loading…
Cancel
Save