Browse Source

#检修工作票流程变化更改

zhongwei
yang_shj 2 weeks ago
parent
commit
ba0b4026cd
  1. 7
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketStartProcessReqDTO.java
  2. 3
      hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketMeasureVo.java
  3. 50
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

7
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/dto/request/AccessTicketStartProcessReqDTO.java

@ -1,5 +1,6 @@
package com.hnac.hzims.ticket.accessTicket.dto.request;
import com.hnac.hzims.ticket.accessTicket.vo.AccessTicketMeasureVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -24,6 +25,12 @@ public class AccessTicketStartProcessReqDTO implements Serializable {
@ApiModelProperty("故障描述")
private String faultDescribe;
@ApiModelProperty("检修安全措施")
private List<AccessTicketMeasureVo> measures;
@ApiModelProperty("检修安全措施确认人:当前登录用户")
private String measuresConfirmPersonnel;
@ApiModelProperty("图片")
private List<String> imgs;

3
hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/accessTicket/vo/AccessTicketMeasureVo.java

@ -9,6 +9,9 @@ import lombok.Data;
@Data
public class AccessTicketMeasureVo {
@ApiModelProperty("检修措施标题")
private String name;
@ApiModelProperty("检修措施字典编号")
private String code;

50
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java

@ -113,24 +113,14 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
String reversal = variables.get("processReversalStep").toString();
// 受理 reversal = 1
// 检修安全措施 reversal = 2
if("2".equals(reversal)){
if(variables.containsKey("measures")){
entity.setMeasures(variables.get("measures").toString());
}
if(variables.containsKey("measuresConfirmPersonnel")){
entity.setMeasuresConfirmPersonnel(variables.get("measuresConfirmPersonnel").toString());
}
}
// 危害因素及措施 reversal = 3
if("3".equals(reversal) && variables.containsKey("riskFactors")){
if("2".equals(reversal) && variables.containsKey("riskFactors")){
entity.setRiskFactors(variables.get("riskFactors").toString());
}
// 学习确认危险点 reversal = 4
if("4".equals(reversal)){
if("3".equals(reversal)){
if(variables.containsKey("studyHead")){
entity.setStudyHead(variables.get("studyHead").toString());
}
@ -140,13 +130,13 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
}
// 审批签发 reversal = 5
if("5".equals(reversal) && variables.containsKey("issuePersonnel")){
if("4".equals(reversal) && variables.containsKey("issuePersonnel")){
entity.setIssueTime(new Date());
entity.setIssuePersonnel(variables.get("issuePersonnel").toString());
}
// 实际检修 reversal = 6
if("6".equals(reversal)){
if("5".equals(reversal)){
if(ObjectUtil.isNotEmpty(variables.get("access"))){
// 检修延期
if((Boolean) variables.get("access")){
@ -165,12 +155,12 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
}
// 检修延期 reversal = 7
if("7".equals(reversal) && variables.containsKey("extensionPersonnel")){
if("6".equals(reversal) && variables.containsKey("extensionPersonnel")){
entity.setExtensionPersonnel(variables.get("extensionPersonnel").toString());
}
// 检修验收 reversal = 8
if("8".equals(reversal) && variables.containsKey("checkPersonnel")){
if("7".equals(reversal) && variables.containsKey("checkPersonnel")){
entity.setCheckTime(new Date());
entity.setCheckPersonnel(variables.get("checkPersonnel").toString());
entity.setTaskName("流程结束");
@ -235,6 +225,10 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
entity.setDeviceName(device.getData().getName());
entity.setDeviceAddress(device.getData().getInsLocation());
entity.setFaultDescribe(param.getFaultDescribe());
if(CollectionUtil.isNotEmpty(param.getMeasures())){
entity.setMeasures(JSONObject.toJSONString(param.getMeasures()));
}
entity.setMeasuresConfirmPersonnel(param.getMeasuresConfirmPersonnel());
// 图片
if(CollectionUtil.isNotEmpty(param.getImgs())){
entity.setImgs(JSONObject.toJSONString(param.getImgs()));
@ -279,17 +273,21 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
}
List<AccessTicketPageRspDTO> records = ipage.getRecords();
ipage.setRecords(records.stream().peek(record->{
List<User> users = new ArrayList<>();
Arrays.stream(record.getNextStepExecutor().split(",")).forEach(account->{
User user = UserCache.getUser(Long.valueOf(account));
if(ObjectUtil.isNotEmpty(user)){
users.add(user);
if(StringUtils.isNotEmpty(record.getNextStepExecutor())){
List<User> users = new ArrayList<>();
Arrays.stream(record.getNextStepExecutor().split(",")).forEach(account->{
User user = UserCache.getUser(Long.valueOf(account));
if(ObjectUtil.isNotEmpty(user)){
users.add(user);
}
});
if(CollectionUtil.isEmpty(users)){
record.setExecutors(new ArrayList<>());
}else{
record.setExecutors(users);
}
});
if(CollectionUtil.isEmpty(users)){
record.setExecutors(new ArrayList<>());
}else{
record.setExecutors(users);
record.setExecutors(new ArrayList<>());
}
}).collect(Collectors.toList()));
return ipage;
@ -398,8 +396,6 @@ public class AccessTicketServiceImpl extends ServiceImpl<AccessTicketMapper, Acc
params.setStudyMembers(meberNames.toString());
}
// 检修工作票创建时间
Calendar create = Calendar.getInstance();
create.setTime(access.getCreateTime());
params.setCreate(DateUtil.format(access.getCreateTime(),DateUtil.PATTERN_DATETIME));

Loading…
Cancel
Save