|
|
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|
|
|
|
import com.fasterxml.jackson.databind.ser.std.NullSerializer; |
|
|
|
|
import com.hnac.hzims.common.logs.utils.StringUtils; |
|
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity; |
|
|
|
|
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient; |
|
|
|
@ -26,16 +28,20 @@ import com.hnac.hzims.ticket.twoTicket.service.IWorkTicketFinishService;
|
|
|
|
|
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; |
|
|
|
|
import com.hnac.hzims.ticket.twoTicket.vo.process.FristWorkTicketVo; |
|
|
|
|
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; |
|
|
|
|
import com.hnac.hzims.ticket.utils.MergeDocUtils; |
|
|
|
|
import com.hnac.hzims.ticket.utils.PdfUtils; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.entity.*; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.service.*; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl; |
|
|
|
|
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl; |
|
|
|
|
import io.swagger.annotations.ApiModelProperty; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.BooleanUtils; |
|
|
|
|
import org.apache.commons.lang3.math.NumberUtils; |
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFDocument; |
|
|
|
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
@ -51,6 +57,10 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.FileInputStream; |
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
@ -100,7 +110,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
|
|
|
|
|
private final IAccessTaskClient accessTaskClient; |
|
|
|
|
|
|
|
|
|
private String newFirstWorkTicketFlowKey = "workTicket"; |
|
|
|
|
private String newFirstWorkTicketFlowKey = "workTicketFlow"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IStationClient stationClient; |
|
|
|
@ -193,6 +203,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
log.info("获取taskId: {}", response.getTaskId()); |
|
|
|
|
log.info("获取下一个审批人是: {}", response.getNextStepOperator()); |
|
|
|
|
log.info("获取当前任务名称是: {}", response.getTaskName()); |
|
|
|
|
log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType()); |
|
|
|
|
//json转换表单
|
|
|
|
|
String formData = JSON.toJSONString(response.getVariables()); |
|
|
|
|
log.info("获取表单的数据:{}", formData); |
|
|
|
@ -342,16 +353,20 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
String description = getWorkTicketDescription(flowStatus); |
|
|
|
|
String flowDescription = ""; |
|
|
|
|
//当前审批人
|
|
|
|
|
User user = UserCache.getUser(workTicket.getStepOperator()); |
|
|
|
|
String stepOperator = workTicket.getStepOperator(); |
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(nextStepOperator)) { |
|
|
|
|
if ("0".equals(response.getHandleType())) { |
|
|
|
|
Long taskUser = NumberUtils.createLong(nextStepOperator.startsWith("taskUser_") ? nextStepOperator.substring(9) : null); |
|
|
|
|
//下一个审批人
|
|
|
|
|
User stepUser = UserCache.getUser(taskUser); |
|
|
|
|
flowDescription = "审批中,当前环节是".concat(description).concat(",当前审批人是").concat(user.getName()).concat(",下一个审批人是").concat(stepUser.getName()).concat("待审批"); |
|
|
|
|
workTicket.setNextStepOperator(taskUser); |
|
|
|
|
} else { |
|
|
|
|
flowDescription = "审批中,当前环节是".concat(description).concat(",审批人是").concat(user.getName()); |
|
|
|
|
flowDescription = |
|
|
|
|
"审批中,当前环节是".concat(description).concat(",待").concat(stepUser.getName()).concat("审批"); |
|
|
|
|
workTicket.setNextStepOperator(stepUser.getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ("1".equals(response.getHandleType())) { |
|
|
|
|
System.out.println("获取角色信息" + response.getNextStepOperator()); |
|
|
|
|
flowDescription = "审批中,当前环节是".concat(description).concat(",当前操作人是").concat(stepOperator); |
|
|
|
|
} |
|
|
|
|
//如果taskId为空 或 flowStatus = 99
|
|
|
|
|
if (StringUtils.isEmpty(taskId) || 99 == flowStatus) { |
|
|
|
@ -359,8 +374,8 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
workTicket.setFlowDescription(flowDescription); |
|
|
|
|
workTicket.setFlowTaskId(""); |
|
|
|
|
workTicket.setFlowTaskName("结束"); |
|
|
|
|
workTicket.setNextStepOperator(-1L); |
|
|
|
|
workTicket.setStepOperator(-1L); |
|
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
|
workTicket.setStepOperator(null); |
|
|
|
|
} else { |
|
|
|
|
workTicket.setFlowDescription(flowDescription); |
|
|
|
|
workTicket.setFlowTaskId(taskId); |
|
|
|
@ -368,7 +383,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
} |
|
|
|
|
//如果下一个审批人【nextStepOperator】是null设为-1
|
|
|
|
|
if (StringUtils.isEmpty(nextStepOperator)) { |
|
|
|
|
workTicket.setNextStepOperator(-1L); |
|
|
|
|
workTicket.setNextStepOperator(null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -424,7 +439,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
* |
|
|
|
|
* @param workTicketVo |
|
|
|
|
*/ |
|
|
|
|
private void returnTicket(WorkTicketVo workTicketVo) { |
|
|
|
|
public void returnTicket(WorkTicketVo workTicketVo) { |
|
|
|
|
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); |
|
|
|
|
if (TicketConstants.TaskTypeEnum.JXRW.getType().equals(workTicket.getTaskType())) { |
|
|
|
|
OperAccessTaskEntity taskEntity = new OperAccessTaskEntity(); |
|
|
|
@ -451,7 +466,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
* @param newFirstWorkTicketFlowKey |
|
|
|
|
* @param workTicketVo |
|
|
|
|
*/ |
|
|
|
|
private void dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) { |
|
|
|
|
public void dealProcess(String newFirstWorkTicketFlowKey, WorkTicketVo workTicketVo) { |
|
|
|
|
//若为线下工作票 则无需开启工作流
|
|
|
|
|
Integer status = WorkTicketConstants.FirstWorkTicketStatusEnum.SIGN.getStatus(); |
|
|
|
|
if (status.intValue() != workTicketVo.getWorkTicket().getFlowStatus().intValue()) { |
|
|
|
@ -465,7 +480,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
if (!listR.isSuccess() || CollectionUtil.isEmpty(listR.getData())) { |
|
|
|
|
throw new ServiceException("工作票签发人角色下未查询到相关人员"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info("获取签发人角色下的人员: {}", listR.getData()); |
|
|
|
|
Map<String, Object> params = new HashMap<>(4); |
|
|
|
|
params.put("workTicketVo", workTicketVo); |
|
|
|
@ -473,7 +487,10 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
workTicketVo.setIsState(true); |
|
|
|
|
log.info("获取表单的数据: {}", workTicketVo); |
|
|
|
|
R<BladeFlow> processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey, String.valueOf(workTicketVo.getWorkTicket().getId()), workTicketVo.getWorkTicket().getWorkContent(), params); |
|
|
|
|
if (!processInstanceContainNameByKey.isSuccess() && processInstanceContainNameByKey.getData() == null) { |
|
|
|
|
log.info("processInstanceContainNameByKey.isSuccess() : {}", processInstanceContainNameByKey.isSuccess()); |
|
|
|
|
log.info("processInstanceContainNameByKey.getData() : {}", processInstanceContainNameByKey.getData()); |
|
|
|
|
log.info("BladeFlow processInstanceContainNameByKey:{}", processInstanceContainNameByKey); |
|
|
|
|
if (!processInstanceContainNameByKey.isSuccess() && processInstanceContainNameByKey.getCode() == 500) { |
|
|
|
|
throw new ServiceException("启动流程失败..."); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -485,7 +502,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
* @param workTicketContentDtoList |
|
|
|
|
* @param workTicketInfoEntity |
|
|
|
|
*/ |
|
|
|
|
private void saveWorkTicketContentDto(List<WorkTicketContentEntity> workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) { |
|
|
|
|
public void saveWorkTicketContentDto(List<WorkTicketContentEntity> workTicketContentDtoList, WorkTicketInfoEntity workTicketInfoEntity) { |
|
|
|
|
if (CollectionUtils.isEmpty(workTicketContentDtoList)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -508,7 +525,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
* @param safetyMeasuresList |
|
|
|
|
* @param workTicketInfoEntity |
|
|
|
|
*/ |
|
|
|
|
private void saveSafetyMeasures(List<WorkTicketSafetyMeasureEntity> safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) { |
|
|
|
|
public void saveSafetyMeasures(List<WorkTicketSafetyMeasureEntity> safetyMeasuresList, WorkTicketInfoEntity workTicketInfoEntity) { |
|
|
|
|
if (CollectionUtil.isEmpty(safetyMeasuresList)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -533,7 +550,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
* @param workTicket |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private WorkTicketInfoEntity saveWorkTicketInfo(WorkTicketInfoEntity workTicket) { |
|
|
|
|
public WorkTicketInfoEntity saveWorkTicketInfo(WorkTicketInfoEntity workTicket) { |
|
|
|
|
workTicket.setStatus(Func.isEmpty(workTicket.getPrincipal()) || Func.isEmpty(workTicket.getClassGroupMembers()) ? WorkTicketConstants.FirstWorkTicketStatusEnum.OFFLINE_OPERATE.getStatus() : WorkTicketConstants.FirstWorkTicketStatusEnum.SIGN.getStatus()); |
|
|
|
|
//班组成员名称
|
|
|
|
|
String byclassGroupMembers = getByClassGroupMembers(workTicket); |
|
|
|
@ -542,7 +559,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
String principalName = getByPrincipal(workTicket); |
|
|
|
|
workTicket.setPrincipalName(principalName); |
|
|
|
|
workTicket.setFlowStatus(1); |
|
|
|
|
workTicket.setStepOperator(AuthUtil.getUserId()); |
|
|
|
|
workTicket.setStepOperator(UserCache.getUser(AuthUtil.getUserId()).getName()); |
|
|
|
|
//唯一
|
|
|
|
|
workTicket.setCreateUser(AuthUtil.getUserId()); |
|
|
|
|
boolean isSave = firstWorkTicketService.save(workTicket); |
|
|
|
@ -631,15 +648,120 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新预览 |
|
|
|
|
* |
|
|
|
|
* @param ticketId |
|
|
|
|
* @param response |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
@Override |
|
|
|
|
public void newPreview(Long ticketId, HttpServletResponse response) { |
|
|
|
|
String fileName = IdWorker.get32UUID() + ".docx"; |
|
|
|
|
// response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + fileName); |
|
|
|
|
response.setContentType("application/vnd.ms-excel;charset=utf-8"); |
|
|
|
|
// response.addHeader("Pargam", "no-cache");
|
|
|
|
|
// response.addHeader("Cache-Control", "no-cache");
|
|
|
|
|
WorkTicketVo workTicketVo = ticketInfoService.selectDetailsById(ticketId); |
|
|
|
|
log.info("新工作票 {}", workTicketVo); |
|
|
|
|
//将查询的数据转换为map
|
|
|
|
|
Map<String, Object> workTicketInfoMap = this.convertMap(workTicketVo); |
|
|
|
|
//创建新的map
|
|
|
|
|
Map<String, Object> objectObjectHashMap = new HashMap<>(); |
|
|
|
|
for (Map.Entry<String, Object> stringObjectEntry : workTicketInfoMap.entrySet()) { |
|
|
|
|
System.out.println("获取map : " + stringObjectEntry.getKey() + "=====>" + stringObjectEntry.getValue()); |
|
|
|
|
} |
|
|
|
|
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); |
|
|
|
|
|
|
|
|
|
if ((workTicket.getIsSafety() == null && workTicket.getIsHazard() == null && workTicket.getIsLimited() == null && workTicket.getIsRailway() == null) |
|
|
|
|
|| (workTicket.getIsSafety() == null || workTicket.getIsHazard() == null || workTicket.getIsLimited() == null || workTicket.getIsRailway() == null)) { |
|
|
|
|
extractedWithWord(response, workTicketInfoMap); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果4个多为false 或为空 附件不展示附件
|
|
|
|
|
if (!workTicket.getIsSafety() && !workTicket.getIsHazard() && !workTicket.getIsLimited() && !workTicket.getIsRailway()) { |
|
|
|
|
extractedWithWord(response, workTicketInfoMap); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
List<File> docFileList = new ArrayList<>(); |
|
|
|
|
docFileList.add(new File("template/电气第一种工作票模版.docx")); |
|
|
|
|
//安全隔离措施附页 (true,展示附件,false,不展示附件)
|
|
|
|
|
if (workTicket.getIsSafety()) { |
|
|
|
|
setWorkTicketPrincipalChange(docFileList); |
|
|
|
|
} |
|
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
|
if (workTicket.getIsSafety()) { |
|
|
|
|
setWorkTicketHazardPointChange(docFileList); |
|
|
|
|
} |
|
|
|
|
//动火工作票 (true,展示附件,false,不展示附件)
|
|
|
|
|
if (workTicket.getIsRailway()) { |
|
|
|
|
setWorkTicketRailwayChange(docFileList); |
|
|
|
|
} |
|
|
|
|
//有限空间监测记录单(true,展示附件,false,不展示附件)
|
|
|
|
|
if (workTicket.getIsLimited()) { |
|
|
|
|
setWorkTicketLimitedChange(docFileList); |
|
|
|
|
} |
|
|
|
|
MergeDocUtils.mergeDoc(docFileList, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 预览 |
|
|
|
|
* |
|
|
|
|
* @param response |
|
|
|
|
* @param workTicketInfoMap |
|
|
|
|
* @throws Exception |
|
|
|
|
*/ |
|
|
|
|
private static void extractedWithWord(HttpServletResponse response, Map<String, Object> workTicketInfoMap) throws Exception { |
|
|
|
|
XWPFDocument doc = WordExportUtil.exportWord07("template/电气第一种工作票模版.docx", workTicketInfoMap); |
|
|
|
|
String os = System.getProperty("os.name"); |
|
|
|
|
//Windows操作系统
|
|
|
|
|
if (os != null && os.toLowerCase().startsWith("windows")) { |
|
|
|
|
log.info("当前系统版本是:{}", os); |
|
|
|
|
String name = "D:/导出excel/电气第一种工作票模版.docx"; |
|
|
|
|
FileOutputStream fos = new FileOutputStream(name); |
|
|
|
|
doc.write(fos); |
|
|
|
|
} else { |
|
|
|
|
//其它操作系统
|
|
|
|
|
log.info("当前系统版本是:{}", os); |
|
|
|
|
ServletOutputStream outputStream = response.getOutputStream(); |
|
|
|
|
doc.write(outputStream); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//封装map 转换 excel导出
|
|
|
|
|
private Map<String, Object> convertMap(WorkTicketVo workTicketVo) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
WorkTicketInfoEntity workTicket = workTicketVo.getWorkTicket(); |
|
|
|
|
|
|
|
|
|
Map<String,Object> map1 = JSONObject.parseObject(JSONObject.toJSONString(workTicket), Map.class); |
|
|
|
|
for (Map.Entry<String, Object> stringObjectEntry : map1.entrySet()) { |
|
|
|
|
System.out.println("stringObjectEntry : " + stringObjectEntry.getKey() + "=====>" + stringObjectEntry.getValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//1. 工作对象
|
|
|
|
|
// log.info("工作对象: {}", workTicket);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> workTicketInfoMap = PdfUtils.objectToMap(workTicket, true); |
|
|
|
|
//安全隔离措施附页 (true,展示附件,false,不展示附件
|
|
|
|
|
getDataConversion(workTicketInfoMap, "isSafety", workTicketInfoMap.get("isSafety")); |
|
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
|
getDataConversion(workTicketInfoMap, "isHazard", workTicketInfoMap.get("isHazard")); |
|
|
|
|
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
|
|
|
|
|
getDataConversion(workTicketInfoMap, "isRailway", workTicketInfoMap.get("isRailway")); |
|
|
|
|
//有限空间监测记录单(true,展示附件,false,不展示附件)
|
|
|
|
|
getDataConversion(workTicketInfoMap, "isLimited", workTicketInfoMap.get("isLimited")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.putAll(workTicketInfoMap); |
|
|
|
|
//2. 安全措施
|
|
|
|
|
List<WorkTicketSafetyMeasureEntity> safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); |
|
|
|
|
log.info("安全措施: {}", safetyMeasuresList); |
|
|
|
|
if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { |
|
|
|
|
Map<String, List<WorkTicketSafetyMeasureEntity>> measureMap = safetyMeasuresList.stream().collect(Collectors.groupingBy(WorkTicketSafetyMeasureEntity::getType)); |
|
|
|
|
Arrays.stream(WorkTicketConstants.WorkTicketMeasureTypeEnum.class.getEnumConstants()).forEach(measureEnum -> { |
|
|
|
@ -654,10 +776,11 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
index = 1; |
|
|
|
|
tempIndex++; |
|
|
|
|
} |
|
|
|
|
log.info("获取安全措施的信息: {}", measureVO); |
|
|
|
|
Map<String, Object> map = PdfUtils.objectToMap(measureVO, true); |
|
|
|
|
map.put("index", index); |
|
|
|
|
map.put("safetyMeasure", ObjectUtil.isNotEmpty(map.get("measure")) ? map.get("measure") : null); |
|
|
|
|
String status = TicketConstants.SafetyMeasureStatusEnum.FINISH.getStatus().equals(measureVO.getStatus()) ? "√" : "×"; |
|
|
|
|
String status = TicketConstants.SafetyMeasureStatusEnum.FINISH.getStatus().equals(measureVO.getStatus()) ? "√" : ""; |
|
|
|
|
map.put("status", status); |
|
|
|
|
mapList.add(map); |
|
|
|
|
index++; |
|
|
|
@ -668,8 +791,14 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
workTicketInfoMap.put(measureEnum.getConvertAttributes(), new ArrayList<Map<String, String>>(1)); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
result.putAll(workTicketInfoMap); |
|
|
|
|
} else { |
|
|
|
|
result.put("matterLibraryListOne", new ArrayList<>()); |
|
|
|
|
result.put("matterLibraryListTwo", new ArrayList<>()); |
|
|
|
|
result.put("matterLibraryListThree", new ArrayList<>()); |
|
|
|
|
result.put("matterLibraryListFour", new ArrayList<>()); |
|
|
|
|
} |
|
|
|
|
result.putAll(workTicketInfoMap); |
|
|
|
|
|
|
|
|
|
//3. 工作票工作任务组
|
|
|
|
|
List<WorkTicketContentEntity> workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); |
|
|
|
|
if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) { |
|
|
|
@ -678,6 +807,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
|
|
|
|
|
//4. 工作票延期
|
|
|
|
|
WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); |
|
|
|
|
log.info("工作票延期: {}", workTicketDelay); |
|
|
|
|
if (ObjectUtils.isNotEmpty(workTicketDelay)) { |
|
|
|
|
result.putAll(PdfUtils.objectToMap(workTicketDelay, true)); |
|
|
|
|
} else { |
|
|
|
@ -686,6 +816,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
|
|
|
|
|
//5. 工作结束
|
|
|
|
|
WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); |
|
|
|
|
log.info("工作结束: {}", workTicketFinish); |
|
|
|
|
if (ObjectUtils.isNotEmpty(workTicketFinish)) { |
|
|
|
|
result.putAll(PdfUtils.objectToMap(workTicketFinish, true)); |
|
|
|
|
} else { |
|
|
|
@ -710,6 +841,61 @@ public class TicketProcessServiceImpl implements TicketProcessService {
|
|
|
|
|
return JSONObject.parseObject(JSONObject.toJSONString(target), Map.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 安全隔离措施附页 |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
public void setWorkTicketPrincipalChange(List<File> docFileList) { |
|
|
|
|
docFileList.add(new File("template/secondary/工作票安全措施附页.docx")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 危险点分析与预控措施票 |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
public void setWorkTicketHazardPointChange(List<File> docFileList) { |
|
|
|
|
docFileList.add(new File("template/secondary/工作票危险点分析及控制措施票.docx")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 动火工作票 |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
public void setWorkTicketRailwayChange(List<File> docFileList) { |
|
|
|
|
File file = new File("template/secondary/动火工作票.docx"); |
|
|
|
|
docFileList.add(file); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 有限空间监测记录单(true,展示附件,false,不展示附件) |
|
|
|
|
*/ |
|
|
|
|
@SneakyThrows |
|
|
|
|
public void setWorkTicketLimitedChange(List<File> docFileList) { |
|
|
|
|
File file = new File("template/secondary/有限空间监测记录单.docx"); |
|
|
|
|
docFileList.add(file); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* value true转 ☑ 或 false转 □ |
|
|
|
|
* |
|
|
|
|
* @param dataConversion |
|
|
|
|
* @param key |
|
|
|
|
* @param value |
|
|
|
|
*/ |
|
|
|
|
public void getDataConversion(Map<String, Object> dataConversion, String key, Object value) { |
|
|
|
|
String newValue = value == null ? (String) value : value.toString(); |
|
|
|
|
if (StringUtils.isNoneBlank(newValue)) { |
|
|
|
|
dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|