Browse Source

新增工作票process_dict字典表

zhongwei
段飞宇 2 years ago
parent
commit
1cc419302f
  1. 5
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java
  2. 44
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessDictController.java
  3. 113
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/entity/ProcessDict.java
  4. 14
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/mapper/ProcessDictMapper.java
  5. 22
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/ProcessDictService.java
  6. 33
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/service/impl/ProcessDictServiceImpl.java
  7. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java
  8. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  9. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java
  10. 1
      hzims-service/ticket/src/main/resources/application.yml
  11. 5
      hzims-service/ticket/src/main/resources/mapper/processflow/ProcessDictMapper.xml
  12. 0
      hzims-service/ticket/src/main/resources/mapper/processflow/ProcessTypeMapper.xml

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 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);
}
}

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

@ -0,0 +1,113 @@
package com.hnac.hzims.ticket.processflow.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
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)
public class ProcessDict {
/**
* 票据编码
*/
@TableId(value = "dictCode",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;
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;
}

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

@ -18,6 +18,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;
@ -68,6 +69,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 +115,6 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final IAccessTaskClient accessTaskClient;
private String newFirstWorkTicketFlowKey = "workTicketFlow";
private final IStationClient stationClient;
@ -141,6 +142,9 @@ public class TicketProcessServiceImpl implements TicketProcessService {
private final TicketInfoDangerService ticketInfoDangerService;
private final ProcessDictService processDictService;
/**
* 启动开票流程
*
@ -188,9 +192,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);
}

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 -> {
User user = UserCache.getUser(item.getCreateUser());
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:
# workTickets:
# - 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

Loading…
Cancel
Save