Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
2258d97484
  1. 1
      hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
  2. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
  3. 44
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java
  4. 115
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java
  5. 14
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java
  6. 22
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java
  7. 33
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java
  8. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java
  9. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java
  10. 132
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  11. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java
  12. 6
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java
  13. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java
  14. 1
      hzims-service/ticket/src/main/resources/application.yml
  15. 5
      hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml
  16. 0
      hzims-service/ticket/src/main/resources/mapper/processflow/ProcessTypeMapper.xml
  17. BIN
      hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx
  18. BIN
      hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx

1
hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java

@ -53,6 +53,7 @@ public class MessageConstants {
DUTY("duty","值班消息"), DUTY("duty","值班消息"),
SAFE("safe","安全消息"), SAFE("safe","安全消息"),
ACCESS("access","检修消息"), ACCESS("access","检修消息"),
TICKETMESSAGE("ticket-message","工作票消息"),
; ;
@Getter @Getter
private String key; private String key;

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java

@ -10,5 +10,8 @@ package com.hnac.hzims.ticket.processflow.constant;
*/ */
public class TicketProcessConstant { public class TicketProcessConstant {
public final static String STARTEVENT = "workTicketFlow"; /**
* 第一种工作票的key
*/
public static final String FIRST_TICKET_KEY = "networking";
} }

44
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java

@ -0,0 +1,44 @@
package com.hnac.hzims.ticket.processflow.controller;
import com.hnac.hzims.ticket.processflow.entity.ProcessDict;
import com.hnac.hzims.ticket.processflow.service.ProcessDictService;
import groovy.util.logging.Slf4j;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/6/5 9:35
*/
@Slf4j
@RequestMapping("/process-dict")
@RestController
@RequiredArgsConstructor
public class ProcessDictController {
private final ProcessDictService processDictService;
@GetMapping("/test")
public void test(){
ProcessDict processDict = new ProcessDict();
processDict.setDictKey("networking");
processDict.setDictSort(0);
processDict.setDictValue("workTicketFlow");
processDict.setDictLabel("第一种工作票");
processDict.setIsDefault("Y");
processDict.setRemark("第一种工作票");
processDict.setDictType("工作票");
processDictService.save(processDict);
}
}

115
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java

@ -0,0 +1,115 @@
package com.hnac.hzims.ticket.processflow.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 票据字典表
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/6/5 8:33
*/
@Data
@ApiModel(value = "ProcessDict",description = "票据字典表")
@Accessors(chain = true)
@TableName("process_dict")
public class ProcessDict {
/**
* 票据编码
*/
@TableId(type = IdType.AUTO)
@ApiModelProperty("票据编码")
private Long dictCode;
/**
*票据排序
*/
@ApiModelProperty("票据排序")
private Integer dictSort;
/**
*票据字典码
*/
@ApiModelProperty("票据字典码")
private String dictKey;
/**
*票据流程标识
*/
@ApiModelProperty("票据流程标识")
private String dictValue;
/**
*票据标签
*/
@ApiModelProperty("票据标签")
private String dictLabel;
/**
*票据类型
*/
@ApiModelProperty("票据类型")
private String dictType;
/**
*是否默认Y是 N否
*/
@ApiModelProperty("是否默认(Y是 N否)")
private String isDefault;
/**
*状态0正常 1停用
*/
@ApiModelProperty("状态(0正常 1停用)")
private Integer status;
/**
* 所属机构
*/
@ApiModelProperty("所属机构")
private Long createDept;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新时间
*/
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
/**
* 票据备注
*/
@ApiModelProperty("票据备注")
private String remark;
}

14
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java

@ -0,0 +1,14 @@
package com.hnac.hzims.ticket.processflow.mapper;
import com.hnac.hzims.ticket.processflow.entity.ProcessDict;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/6/5 8:49
*/
public interface ProcessDictMapper extends UserDataScopeBaseMapper<ProcessDict> {
}

22
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java

@ -0,0 +1,22 @@
package com.hnac.hzims.ticket.processflow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.ticket.processflow.entity.ProcessDict;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/6/5 8:52
*/
public interface ProcessDictService extends IService<ProcessDict> {
/**
* 根据字典key查询字典value
*/
String selectDictValueByKey(String dictKey);
}

33
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java

@ -0,0 +1,33 @@
package com.hnac.hzims.ticket.processflow.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.ticket.processflow.entity.ProcessDict;
import com.hnac.hzims.ticket.processflow.mapper.ProcessDictMapper;
import com.hnac.hzims.ticket.processflow.service.ProcessDictService;
import groovy.util.logging.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* @Author WL
* @Version v1.0
* @Serial 1.0
* @Date 2023/6/5 8:59
*/
@Slf4j
@Service
public class ProcessDictServiceImpl extends ServiceImpl<ProcessDictMapper, ProcessDict> implements ProcessDictService {
/**
* 根据字典key查询字典value
*
* @param dictKey
*/
@Override
public String selectDictValueByKey(String dictKey) {
LambdaQueryChainWrapper<ProcessDict> processDictLambdaQueryChainWrapper = new LambdaQueryChainWrapper<>(baseMapper);
processDictLambdaQueryChainWrapper.eq(ProcessDict::getDictKey,dictKey);
return processDictLambdaQueryChainWrapper.one().getDictValue();
}
}

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; package com.hnac.hzims.ticket.processflow.strategy.serviceimpl;
import com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant; import com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant;
import com.hnac.hzims.ticket.processflow.service.ProcessDictService;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue;
@ -9,6 +10,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY;
/** /**
* 开工作票流程实现类 * 开工作票流程实现类
* *
@ -27,6 +30,15 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService {
private final TicketProcessService ticketProcessService; private final TicketProcessService ticketProcessService;
private final ProcessDictService processDictService;
/** /**
* 设置执行那种实现类 * 设置执行那种实现类
* *
@ -36,7 +48,8 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService {
@Override @Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
log.info("是否执行开第一种工作票流程环节操作~~~~,流程ticket: {}", flowQueue); log.info("是否执行开第一种工作票流程环节操作~~~~,流程ticket: {}", flowQueue);
if (TicketProcessConstant.STARTEVENT.equals(flowQueue.getProcessDefinitionKey())) { String dictValue = processDictService.selectDictValueByKey(FIRST_TICKET_KEY);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行第一种开工作票流程环节操作~~~~"); log.info("已执行第一种开工作票流程环节操作~~~~");
return true; return true;
} }

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java

@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -124,6 +126,8 @@ public class WorkTicketFinish implements Serializable {
/** /**
* 结束时间 * 结束时间
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime workEndTime; private LocalDateTime workEndTime;

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

@ -5,10 +5,15 @@ import cn.afterturn.easypoi.word.WordExportUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient;
import com.hnac.hzims.operational.feign.IAccessTaskClient; import com.hnac.hzims.operational.feign.IAccessTaskClient;
@ -18,6 +23,7 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.ticket.constants.TicketConstants; import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.constants.WorkTicketConstants; import com.hnac.hzims.ticket.constants.WorkTicketConstants;
import com.hnac.hzims.ticket.processflow.service.ProcessDictService;
import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker;
import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant; import com.hnac.hzims.ticket.twoTicket.constant.TicketConstant;
@ -51,6 +57,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.entity.BladeFlow;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
@ -68,6 +75,8 @@ import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant.FIRST_TICKET_KEY;
/** /**
* 开票处理流程实现类 * 开票处理流程实现类
@ -112,8 +121,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final IAccessTaskClient accessTaskClient; private final IAccessTaskClient accessTaskClient;
private String newFirstWorkTicketFlowKey = "workTicketFlow";
private final IStationClient stationClient; private final IStationClient stationClient;
@ -141,6 +148,16 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final TicketInfoDangerService ticketInfoDangerService; private final TicketInfoDangerService ticketInfoDangerService;
private final ProcessDictService processDictService;
private final IMessageClient messageClient;
private final ISysClient sysClient;
/** /**
* 启动开票流程 * 启动开票流程
* *
@ -188,9 +205,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket()); this.saveSafetyMeasures(workTicketVo.getSafetyMeasuresList(), workTicketVo.getWorkTicket());
//5. 保存工作任务 //5. 保存工作任务
this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket());
//6. 开启动作流 //6. 查询第一种工作票值
this.dealProcess(newFirstWorkTicketFlowKey, workTicketVo); String dictValue = processDictService.selectDictValueByKey(FIRST_TICKET_KEY);
//7. 处理任务 //7. 开启动作流
this.dealProcess(dictValue, workTicketVo);
//8. 处理任务
this.returnTicket(workTicketVo); this.returnTicket(workTicketVo);
} }
@ -244,16 +263,21 @@ public class TicketProcessServiceImpl implements TicketProcessService {
e.printStackTrace(); e.printStackTrace();
} }
//更新安全措施 //更新安全措施
try {
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
log.info("获取安全措施的数据:{}", safetyMeasuresList); log.info("获取安全措施的数据:{}", safetyMeasuresList);
safetyMeasuresList.forEach(item -> { for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) {
if (ObjectUtils.isNotEmpty(item.getTicketId())) { if (ObjectUtils.isNotEmpty(item.getId())) {
LambdaQueryWrapper<WorkTicketSafetyMeasureEntity> queryWrapper = new LambdaQueryWrapper<>(); workTicketSafetyMeasureService.updateById(item);
queryWrapper.eq(WorkTicketSafetyMeasureEntity::getTicketId, item.getTicketId()); }else {
workTicketSafetyMeasureService.update(item, queryWrapper); item.setTicketId(workTicketInfo.getId());
workTicketSafetyMeasureService.save(item);
} }
}); }
}
} catch (Exception e) {
e.printStackTrace();
} }
//工作票工作任务组 //工作票工作任务组
// List<WorkTicketContentEntity> workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); // List<WorkTicketContentEntity> workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList();
@ -293,13 +317,16 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//工作结束 //工作结束
WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish();
try { try {
if (ObjectUtils.isNotEmpty(workTicketFinish) && 99 == workTicket.getFlowStatus().intValue()) { log.info("工作结束==============>"+ (workTicket.getFlowStatus().intValue()));
if (ObjectUtils.isNotEmpty(workTicketFinish)) {
WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId()); WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId());
log.info("获取工作结束:{}", workTicketFinish); log.info("获取工作结束:{}", workTicketFinish);
if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) { if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) {
log.info("获取工作结束保存成功");
workTicketFinish.setTicketId(workTicketInfo.getId()); workTicketFinish.setTicketId(workTicketInfo.getId());
workTicketFinishService.save(workTicketFinish); workTicketFinishService.save(workTicketFinish);
} else { } else {
log.info("获取工作结束更新成功");
workTicketDelay.setInitialTime(LocalDateTime.now()); workTicketDelay.setInitialTime(LocalDateTime.now());
workTicketFinishService.updateByTicketId(workTicketFinish); workTicketFinishService.updateByTicketId(workTicketFinish);
} }
@ -369,6 +396,47 @@ public class TicketProcessServiceImpl implements TicketProcessService {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
//推送消息
MessagePushRecordDto message = new MessagePushRecordDto();
message.setBusinessClassify("business");
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
message.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
message.setTaskId(workTicketInfo.getId());
message.setTenantId("200000");
message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
message.setPushType(MessageConstants.IMMEDIATELY);
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
"您有一张工作票待审批,工作内容:".concat(workTicketInfo.getWorkContent())
.concat(",审批环节:")
.concat(response.getTaskName());
message.setContent(countent);
message.setDeptId(workTicketInfo.getCreateDept());
R<String> deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
if (deptName.isSuccess()) {
message.setDeptName(deptName.getData());
}
String userIds = response.getUserId();
if (StringUtils.isBlank(userIds)){
log.error("推送的消息不能为空哦,{}",userIds);
return;
}
String[] split = userIds.split(",");
for (String userId : split) {
message.setPusher(userId);
User user = UserCache.getUser(NumberUtils.toLong(userId));
if (ObjectUtils.isNotEmpty(user)) {
message.setPusherName(user.getName());
}
message.setAccount(userId);
message.setCreateUser(NumberUtils.toLong(userId));
messageClient.sendMessage(message);
}
} }
@ -417,10 +485,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
String taskId = response.getTaskId(); String taskId = response.getTaskId();
if (StringUtils.isEmpty(taskId)) { if (StringUtils.isEmpty(taskId)) {
workTicket.setFlowDescription("结束"); workTicket.setFlowDescription("结束");
workTicket.setFlowTaskId(" "); // workTicket.setFlowTaskId(" ");
workTicket.setFlowTaskName("结束"); workTicket.setFlowTaskName("结束");
workTicket.setNextStepOperator(" "); workTicket.setNextStepOperator(" ");
workTicket.setStepOperator(" "); workTicket.setStepOperator(" ");
workTicket.setFlowStatus(999);
} else { } else {
workTicket.setFlowTaskId(taskId); workTicket.setFlowTaskId(taskId);
workTicket.setFlowTaskName(response.getTaskName()); workTicket.setFlowTaskName(response.getTaskName());
@ -850,7 +919,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay();
log.info("工作票延期: {}", workTicketDelay); log.info("工作票延期: {}", workTicketDelay);
if (ObjectUtils.isNotEmpty(workTicketDelay)) { if (ObjectUtils.isNotEmpty(workTicketDelay)) {
result.putAll(PdfUtils.objectToMapResult(workTicket, result)); result.putAll(PdfUtils.objectToMapResult(workTicketDelay, result));
} else { } else {
result.putAll(PdfUtils.objectToMapResult(new WorkTicketDelayEntity(), result)); result.putAll(PdfUtils.objectToMapResult(new WorkTicketDelayEntity(), result));
} }
@ -967,12 +1036,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//负责人 //负责人
String licensorName = WordHelper.toMapAsString(result, "principalName", 10); String licensorName = WordHelper.toMapAsString(result, "principalName", 10);
result.put("principalName2", licensorName); result.put("principalName2", licensorName);
}else { } else {
WordHelper.putMap(result, "principalName2", 10); WordHelper.putMap(result, "principalName2", 10);
} }
//许可人确认工作票终结 //许可人确认工作票终结
if (WordHelper.isNoneBlank(result, "workEndTime")) { if (WordHelper.isNoneBlank(result, "workEndTime")) {
log.info("许可人确认工作票终结"); log.info("许可人确认工作票终结");
//负责人 //负责人
@ -981,7 +1049,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//许可人 //许可人
String licensorName = WordHelper.toMapAsString(result, "licensorName", 10); String licensorName = WordHelper.toMapAsString(result, "licensorName", 10);
result.put("licensorName2", licensorName); result.put("licensorName2", licensorName);
}else { } else {
WordHelper.putMap(result, "principalName3", 10); WordHelper.putMap(result, "principalName3", 10);
WordHelper.putMap(result, "licensorName2", 10); WordHelper.putMap(result, "licensorName2", 10);
} }
@ -1059,12 +1127,32 @@ public class TicketProcessServiceImpl implements TicketProcessService {
* @param maps 新的Map * @param maps 新的Map
* @param i 索引 * @param i 索引
*/ */
private static void listWichMap(List<Map<String, Object>> matterLibraryListFive, List<Map<String, Object>> matterLibraryListFlow, List<Map<String, Object>> maps, int i) { private static void listWichMap(List<Map<String, Object>> matterLibraryListFive,
Map<String, Object> stringObjectMap = matterLibraryListFive.get(i); List<Map<String, Object>> matterLibraryListFlow, List<Map<String, Object>> maps, int i) {
Map<String, Object> stringObjectMap1 = matterLibraryListFlow.get(i);
HashMap<String, Object> objectObjectHashMap = new HashMap<>(); HashMap<String, Object> objectObjectHashMap = new HashMap<>();
if (matterLibraryListFive.size() > 0) {
if (matterLibraryListFive.size() <= i) {
objectObjectHashMap.put("safetyMeasure", "");
} else {
Map<String, Object> stringObjectMap = matterLibraryListFive.get(i);
objectObjectHashMap.put("safetyMeasure", stringObjectMap.get("safetyMeasure")); objectObjectHashMap.put("safetyMeasure", stringObjectMap.get("safetyMeasure"));
objectObjectHashMap.put("safetyMeasure1", stringObjectMap1.get("safetyMeasure")); }
} else {
objectObjectHashMap.put("safetyMeasure", "");
}
if (matterLibraryListFlow.size() > 0) {
if (matterLibraryListFlow.size() <= i) {
objectObjectHashMap.put("safetyMeasure1", "");
} else {
Map<String, Object> stringObjectMap = matterLibraryListFive.get(i);
objectObjectHashMap.put("safetyMeasure1", stringObjectMap.get("safetyMeasure"));
}
}else {
objectObjectHashMap.put("safetyMeasure1", "");
}
maps.add(objectObjectHashMap); maps.add(objectObjectHashMap);
} }
@ -1130,8 +1218,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□"); dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□");
} }
} }
} }

5
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java

@ -2,6 +2,7 @@ package com.hnac.hzims.ticket.twoTicket.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish;
import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketFinishMapper; import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketFinishMapper;
@ -34,8 +35,8 @@ public class WorkTicketFinishServiceImpl extends ServiceImpl<WorkTicketFinishMap
LambdaQueryWrapper<WorkTicketFinish> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<WorkTicketFinish> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WorkTicketFinish::getTicketId, ticketId); queryWrapper.eq(WorkTicketFinish::getTicketId, ticketId);
queryWrapper.orderByDesc(WorkTicketFinish::getCreateTime); queryWrapper.orderByDesc(WorkTicketFinish::getCreateTime);
queryWrapper.last("limit 1"); List<WorkTicketFinish> list = this.list(queryWrapper);
return this.getOne(queryWrapper); return CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
} }
/** /**

6
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java

@ -71,8 +71,7 @@ public class WordHelper extends StringUtils {
* 判断map不为为空 * 判断map不为为空
*/ */
public static boolean isNoneBlank(Map<String, Object> result, String key) { public static boolean isNoneBlank(Map<String, Object> result, String key) {
String value = WordHelper.toString(result.get(key)).trim(); String value = WordHelper.toString(result.get(key));
System.out.println(value.length());
if (StringUtils.isNoneBlank(value)) { if (StringUtils.isNoneBlank(value)) {
return true; return true;
} }
@ -116,6 +115,7 @@ public class WordHelper extends StringUtils {
*/ */
private static void isContainsKey(Map<String, Object> params, Map<String, Object> result) { private static void isContainsKey(Map<String, Object> params, Map<String, Object> result) {
if (params.containsKey("principalName1")) { if (params.containsKey("principalName1")) {
result.put("principalName1", params.get("principalName1")); result.put("principalName1", params.get("principalName1"));
params.remove("principalName1"); params.remove("principalName1");
@ -219,7 +219,7 @@ public class WordHelper extends StringUtils {
Object newValue = StringUtils.isNoneBlank(toString(value).trim()) ? value : "\u00A0" + printSpace(count); Object newValue = StringUtils.isNoneBlank(toString(value).trim()) ? value : "\u00A0" + printSpace(count);
result.put(key, newValue); result.put(key, newValue);
} else { } else {
Object newValue = StringUtils.isNoneBlank(toString(value).trim()) ? value : "\u00A0"; Object newValue = StringUtils.isNoneBlank(toString(value).trim()) ? value : "\u00A0" + printSpace(4);
result.put(key, newValue); result.put(key, newValue);
} }
} }

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

@ -256,7 +256,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
workTicketInfoVOIPage.getRecords().forEach(item -> { workTicketInfoVOIPage.getRecords().forEach(item -> {
User user = UserCache.getUser(item.getCreateUser()); User user = UserCache.getUser(item.getCreateUser());
if (user != null) { if (user != null) {
item.setCreateUserName(UserCache.getUser(item.getCreateUser()).getName()); item.setCreateUserName(user.getName());
} }
}); });

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

@ -16,6 +16,7 @@ swagger:
#ticket: #ticket:
# workTickets: # workTickets:
# - status: 1 # - status: 1

5
hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml

@ -0,0 +1,5 @@
<?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.ticket.processflow.mapper.ProcessDictMapper">
</mapper>

0
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/xml/ProcessTypeMapper.xml → hzims-service/ticket/src/main/resources/mapper/processflow/ProcessTypeMapper.xml

BIN
hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx

Binary file not shown.

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

Binary file not shown.
Loading…
Cancel
Save