diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java index e6a42b3..7b7fbdb 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java @@ -53,6 +53,7 @@ public class MessageConstants { DUTY("duty","值班消息"), SAFE("safe","安全消息"), ACCESS("access","检修消息"), + TICKETMESSAGE("ticket-message","工作票消息"), ; @Getter private String key; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java index 46a48bc..7bef5ea 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java +++ b/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 final static String STARTEVENT = "workTicketFlow"; + /** + * 第一种工作票的key + */ + public static final String FIRST_TICKET_KEY = "networking"; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java new file mode 100644 index 0000000..f6b6fdf --- /dev/null +++ b/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); + } + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java new file mode 100644 index 0000000..185fef7 --- /dev/null +++ b/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; +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java new file mode 100644 index 0000000..2bb86f5 --- /dev/null +++ b/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 { + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java new file mode 100644 index 0000000..7113a06 --- /dev/null +++ b/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 { + + + /** + * 根据字典key查询字典value + */ + String selectDictValueByKey(String dictKey); + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java new file mode 100644 index 0000000..84fbfd9 --- /dev/null +++ b/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 implements ProcessDictService { + /** + * 根据字典key查询字典value + * + * @param dictKey + */ + @Override + public String selectDictValueByKey(String dictKey) { + LambdaQueryChainWrapper processDictLambdaQueryChainWrapper = new LambdaQueryChainWrapper<>(baseMapper); + processDictLambdaQueryChainWrapper.eq(ProcessDict::getDictKey,dictKey); + return processDictLambdaQueryChainWrapper.one().getDictValue(); + } +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java index 82f64ce..1255079 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java +++ b/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; 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.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; @@ -9,6 +10,8 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; 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 ProcessDictService processDictService; + + + + + + + /** * 设置执行那种实现类 * @@ -36,7 +48,8 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService { @Override public Boolean isWorkflowProcess(WorkflowQueue 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("已执行第一种开工作票流程环节操作~~~~"); return true; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java index 145b692..b785073 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/entity/WorkTicketFinish.java +++ b/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.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; 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; 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 73bd986..15202c8 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 @@ -5,10 +5,15 @@ import cn.afterturn.easypoi.word.WordExportUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; 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.IdWorker; 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.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.feign.IOperAccessTaskClient; 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.ticket.constants.TicketConstants; 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.response.ProcessWorkFlowResponse; 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.flow.core.entity.BladeFlow; 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.entity.User; import org.springblade.system.user.feign.IUserClient; @@ -68,6 +75,8 @@ import java.time.LocalDateTime; import java.util.*; 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 String newFirstWorkTicketFlowKey = "workTicketFlow"; - private final IStationClient stationClient; @@ -141,6 +148,16 @@ public class TicketProcessServiceImpl implements TicketProcessService { 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()); //5. 保存工作任务 this.saveWorkTicketContentDto(workTicketVo.getWorkTicketContentDtoList(), workTicketVo.getWorkTicket()); - //6. 开启动作流 - this.dealProcess(newFirstWorkTicketFlowKey, workTicketVo); - //7. 处理任务 + //6. 查询第一种工作票值 + String dictValue = processDictService.selectDictValueByKey(FIRST_TICKET_KEY); + //7. 开启动作流 + this.dealProcess(dictValue, workTicketVo); + //8. 处理任务 this.returnTicket(workTicketVo); } @@ -244,16 +263,21 @@ public class TicketProcessServiceImpl implements TicketProcessService { e.printStackTrace(); } //更新安全措施 - List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); - if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { - log.info("获取安全措施的数据:{}", safetyMeasuresList); - safetyMeasuresList.forEach(item -> { - if (ObjectUtils.isNotEmpty(item.getTicketId())) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(WorkTicketSafetyMeasureEntity::getTicketId, item.getTicketId()); - workTicketSafetyMeasureService.update(item, queryWrapper); + try { + List safetyMeasuresList = workTicketVo.getSafetyMeasuresList(); + if (CollectionUtils.isNotEmpty(safetyMeasuresList)) { + log.info("获取安全措施的数据:{}", safetyMeasuresList); + for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) { + if (ObjectUtils.isNotEmpty(item.getId())) { + workTicketSafetyMeasureService.updateById(item); + }else { + item.setTicketId(workTicketInfo.getId()); + workTicketSafetyMeasureService.save(item); + } } - }); + } + } catch (Exception e) { + e.printStackTrace(); } //工作票工作任务组 // List workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList(); @@ -293,13 +317,16 @@ public class TicketProcessServiceImpl implements TicketProcessService { //工作结束 WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish(); try { - if (ObjectUtils.isNotEmpty(workTicketFinish) && 99 == workTicket.getFlowStatus().intValue()) { + log.info("工作结束==============>"+ (workTicket.getFlowStatus().intValue())); + if (ObjectUtils.isNotEmpty(workTicketFinish)) { WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId()); log.info("获取工作结束:{}", workTicketFinish); if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) { + log.info("获取工作结束保存成功"); workTicketFinish.setTicketId(workTicketInfo.getId()); workTicketFinishService.save(workTicketFinish); } else { + log.info("获取工作结束更新成功"); workTicketDelay.setInitialTime(LocalDateTime.now()); workTicketFinishService.updateByTicketId(workTicketFinish); } @@ -369,6 +396,47 @@ public class TicketProcessServiceImpl implements TicketProcessService { } catch (Exception e) { 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 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(); if (StringUtils.isEmpty(taskId)) { workTicket.setFlowDescription("结束"); - workTicket.setFlowTaskId(" "); + // workTicket.setFlowTaskId(" "); workTicket.setFlowTaskName("结束"); workTicket.setNextStepOperator(" "); workTicket.setStepOperator(" "); + workTicket.setFlowStatus(999); } else { workTicket.setFlowTaskId(taskId); workTicket.setFlowTaskName(response.getTaskName()); @@ -850,7 +919,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay(); log.info("工作票延期: {}", workTicketDelay); if (ObjectUtils.isNotEmpty(workTicketDelay)) { - result.putAll(PdfUtils.objectToMapResult(workTicket, result)); + result.putAll(PdfUtils.objectToMapResult(workTicketDelay, result)); } else { result.putAll(PdfUtils.objectToMapResult(new WorkTicketDelayEntity(), result)); } @@ -967,12 +1036,11 @@ public class TicketProcessServiceImpl implements TicketProcessService { //负责人 String licensorName = WordHelper.toMapAsString(result, "principalName", 10); result.put("principalName2", licensorName); - }else { + } else { WordHelper.putMap(result, "principalName2", 10); } //许可人确认工作票终结 - if (WordHelper.isNoneBlank(result, "workEndTime")) { log.info("许可人确认工作票终结"); //负责人 @@ -981,7 +1049,7 @@ public class TicketProcessServiceImpl implements TicketProcessService { //许可人 String licensorName = WordHelper.toMapAsString(result, "licensorName", 10); result.put("licensorName2", licensorName); - }else { + } else { WordHelper.putMap(result, "principalName3", 10); WordHelper.putMap(result, "licensorName2", 10); } @@ -1059,12 +1127,32 @@ public class TicketProcessServiceImpl implements TicketProcessService { * @param maps 新的Map * @param i 索引 */ - private static void listWichMap(List> matterLibraryListFive, List> matterLibraryListFlow, List> maps, int i) { - Map stringObjectMap = matterLibraryListFive.get(i); - Map stringObjectMap1 = matterLibraryListFlow.get(i); + private static void listWichMap(List> matterLibraryListFive, + List> matterLibraryListFlow, List> maps, int i) { HashMap objectObjectHashMap = new HashMap<>(); - objectObjectHashMap.put("safetyMeasure", stringObjectMap.get("safetyMeasure")); - objectObjectHashMap.put("safetyMeasure1", stringObjectMap1.get("safetyMeasure")); + if (matterLibraryListFive.size() > 0) { + if (matterLibraryListFive.size() <= i) { + objectObjectHashMap.put("safetyMeasure", ""); + } else { + Map stringObjectMap = matterLibraryListFive.get(i); + objectObjectHashMap.put("safetyMeasure", stringObjectMap.get("safetyMeasure")); + } + } else { + objectObjectHashMap.put("safetyMeasure", ""); + } + + + if (matterLibraryListFlow.size() > 0) { + if (matterLibraryListFlow.size() <= i) { + objectObjectHashMap.put("safetyMeasure1", ""); + } else { + Map stringObjectMap = matterLibraryListFive.get(i); + objectObjectHashMap.put("safetyMeasure1", stringObjectMap.get("safetyMeasure")); + } + }else { + objectObjectHashMap.put("safetyMeasure1", ""); + } + maps.add(objectObjectHashMap); } @@ -1130,8 +1218,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□"); } } - - } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java index f6e0b8e..83519ba 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketFinishServiceImpl.java +++ b/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.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.ticket.twoTicket.entity.WorkTicketFinish; import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketFinishMapper; @@ -34,8 +35,8 @@ public class WorkTicketFinishServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(WorkTicketFinish::getTicketId, ticketId); queryWrapper.orderByDesc(WorkTicketFinish::getCreateTime); - queryWrapper.last("limit 1"); - return this.getOne(queryWrapper); + List list = this.list(queryWrapper); + return CollectionUtils.isNotEmpty(list) ? list.get(0) : null; } /** diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java index 8147ea9..e8505ad 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/utils/WordHelper.java @@ -71,8 +71,7 @@ public class WordHelper extends StringUtils { * 判断map不为为空 */ public static boolean isNoneBlank(Map result, String key) { - String value = WordHelper.toString(result.get(key)).trim(); - System.out.println(value.length()); + String value = WordHelper.toString(result.get(key)); if (StringUtils.isNoneBlank(value)) { return true; } @@ -116,6 +115,7 @@ public class WordHelper extends StringUtils { */ private static void isContainsKey(Map params, Map result) { + if (params.containsKey("principalName1")) { result.put("principalName1", params.get("principalName1")); params.remove("principalName1"); @@ -219,7 +219,7 @@ public class WordHelper extends StringUtils { Object newValue = StringUtils.isNoneBlank(toString(value).trim()) ? value : "\u00A0" + printSpace(count); result.put(key, newValue); } 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); } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 1da1885..0105a3d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -256,7 +256,7 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl { User user = UserCache.getUser(item.getCreateUser()); if (user != null) { - item.setCreateUserName(UserCache.getUser(item.getCreateUser()).getName()); + item.setCreateUserName(user.getName()); } }); diff --git a/hzims-service/ticket/src/main/resources/application.yml b/hzims-service/ticket/src/main/resources/application.yml index 9341ce3..1de0a34 100644 --- a/hzims-service/ticket/src/main/resources/application.yml +++ b/hzims-service/ticket/src/main/resources/application.yml @@ -16,6 +16,7 @@ swagger: + #ticket: # workTickets: # - status: 1 diff --git a/hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml b/hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml new file mode 100644 index 0000000..1882427 --- /dev/null +++ b/hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/xml/ProcessTypeMapper.xml b/hzims-service/ticket/src/main/resources/mapper/processflow/ProcessTypeMapper.xml similarity index 100% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/xml/ProcessTypeMapper.xml rename to hzims-service/ticket/src/main/resources/mapper/processflow/ProcessTypeMapper.xml diff --git a/hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx b/hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx index 591306f..5e86dca 100644 Binary files a/hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx and b/hzims-service/ticket/src/main/resources/template/secondary/工作票危险点分析及控制措施票.docx differ diff --git a/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx index f2760d0..4684a35 100644 Binary files a/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx and b/hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx differ