wangliang 1 жил өмнө
parent
commit
92b3ce4282

+ 0 - 154
sop-api/src/main/resources/qualityProblemFlow/qualityProblemFlow.bpmn

@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test" id="m1626068475250" name="">
-  <process id="QUALITY_PROBLEM_FLOW" isExecutable="true" isClosed="false" processType="None">
-    <userTask id="f_usertask_quality_problem_approve_2" name="质量问题初审" activiti:candidateUsers="${assigneeList2}" activiti:formKey="quality_problem_approve.form"></userTask>
-    <startEvent id="startevent1" name="Start" activiti:formKey="quality_problem_start.form"></startEvent>
-    <userTask id="f_usertask_quality_problem_apply_1" name="质量问题上报" activiti:candidateUsers="${assigneeList1}" activiti:formKey="quality_problem_apply.form"></userTask>
-    <sequenceFlow id="flow6" sourceRef="startevent1" targetRef="f_usertask_quality_problem_apply_1"></sequenceFlow>
-    <exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
-    <sequenceFlow id="flow15" name="驳回" sourceRef="exclusivegateway2" targetRef="f_usertask_quality_problem_apply_1">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_apply_1'}]]></conditionExpression>
-    </sequenceFlow>
-    <userTask id="f_usertask_quality_problem_check_3" name="甲方复核" activiti:assignee="${assignee3}" activiti:formKey="quality_problem_check.form">
-      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${assigneeList3}" activiti:elementVariable="assignee3">
-        <completionCondition>${nrOfCompletedInstances/nrOfInstances==1 || reject3==1}</completionCondition>
-      </multiInstanceLoopCharacteristics>
-    </userTask>
-    <sequenceFlow id="flow17" name="通过" sourceRef="exclusivegateway2" targetRef="f_usertask_quality_problem_check_3">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_check_3'}]]></conditionExpression>
-    </sequenceFlow>
-    <exclusiveGateway id="exclusivegateway3" name="Exclusive Gateway"></exclusiveGateway>
-    <sequenceFlow id="flow18" sourceRef="f_usertask_quality_problem_check_3" targetRef="exclusivegateway3"></sequenceFlow>
-    <sequenceFlow id="flow19" name="驳回" sourceRef="exclusivegateway3" targetRef="f_usertask_quality_problem_approve_2">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_approve_2'}]]></conditionExpression>
-    </sequenceFlow>
-    <userTask id="f_usertask_quality_problem_third_check_4" name="乙方复核" activiti:assignee="${assignee4}" activiti:formKey="quality_problem_third_check.form">
-      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${assigneeList4}" activiti:elementVariable="assignee4">
-        <completionCondition>${nrOfCompletedInstances/nrOfInstances==1 || reject4==1}</completionCondition>
-      </multiInstanceLoopCharacteristics>
-    </userTask>
-    <sequenceFlow id="flow20" name="通过" sourceRef="exclusivegateway3" targetRef="f_usertask_quality_problem_third_check_4">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_third_check_4'}]]></conditionExpression>
-    </sequenceFlow>
-    <exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
-    <sequenceFlow id="flow21" sourceRef="f_usertask_quality_problem_third_check_4" targetRef="exclusivegateway4"></sequenceFlow>
-    <sequenceFlow id="flow22" name="驳回" sourceRef="exclusivegateway4" targetRef="f_usertask_quality_problem_approve_2">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_approve_2'}]]></conditionExpression>
-    </sequenceFlow>
-    <endEvent id="f_usertask_quality_problem_end_0" name="结束"></endEvent>
-    <sequenceFlow id="flow23" name="通过" sourceRef="exclusivegateway4" targetRef="f_usertask_quality_problem_end_0">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_end_0'}]]></conditionExpression>
-    </sequenceFlow>
-    <sequenceFlow id="flow24" sourceRef="f_usertask_quality_problem_apply_1" targetRef="f_usertask_quality_problem_approve_2"></sequenceFlow>
-    <sequenceFlow id="flow25" sourceRef="f_usertask_quality_problem_approve_2" targetRef="exclusivegateway2"></sequenceFlow>
-    <sequenceFlow id="flow26" name="没有乙方且通过" sourceRef="exclusivegateway3" targetRef="f_usertask_quality_problem_end_0">
-      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${approve == 'f_usertask_quality_problem_end_0'}]]></conditionExpression>
-    </sequenceFlow>
-  </process>
-  <bpmndi:BPMNDiagram id="BPMNDiagram_QUALITY_PROBLEM_FLOW">
-    <bpmndi:BPMNPlane bpmnElement="QUALITY_PROBLEM_FLOW" id="BPMNPlane_QUALITY_PROBLEM_FLOW">
-      <bpmndi:BPMNShape bpmnElement="f_usertask_quality_problem_approve_2" id="BPMNShape_f_usertask_quality_problem_approve_2">
-        <omgdc:Bounds height="55.0" width="85.0" x="450.0" y="130.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
-        <omgdc:Bounds height="35.0" width="35.0" x="240.0" y="40.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="f_usertask_quality_problem_apply_1" id="BPMNShape_f_usertask_quality_problem_apply_1">
-        <omgdc:Bounds height="55.0" width="85.0" x="215.0" y="130.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
-        <omgdc:Bounds height="40.0" width="40.0" x="472.0" y="240.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="f_usertask_quality_problem_check_3" id="BPMNShape_f_usertask_quality_problem_check_3">
-        <omgdc:Bounds height="55.0" width="105.0" x="440.0" y="330.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="exclusivegateway3" id="BPMNShape_exclusivegateway3">
-        <omgdc:Bounds height="40.0" width="40.0" x="680.0" y="337.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="f_usertask_quality_problem_third_check_4" id="BPMNShape_f_usertask_quality_problem_third_check_4">
-        <omgdc:Bounds height="55.0" width="105.0" x="648.0" y="480.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
-        <omgdc:Bounds height="40.0" width="40.0" x="472.0" y="487.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="f_usertask_quality_problem_end_0" id="BPMNShape_f_usertask_quality_problem_end_0">
-        <omgdc:Bounds height="35.0" width="35.0" x="475.0" y="590.0"></omgdc:Bounds>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
-        <omgdi:waypoint x="257.0" y="75.0"></omgdi:waypoint>
-        <omgdi:waypoint x="257.0" y="130.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
-        <omgdi:waypoint x="472.0" y="260.0"></omgdi:waypoint>
-        <omgdi:waypoint x="257.0" y="260.0"></omgdi:waypoint>
-        <omgdi:waypoint x="257.0" y="185.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="472.0" y="260.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
-        <omgdi:waypoint x="492.0" y="280.0"></omgdi:waypoint>
-        <omgdi:waypoint x="492.0" y="330.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="492.0" y="280.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
-        <omgdi:waypoint x="545.0" y="357.0"></omgdi:waypoint>
-        <omgdi:waypoint x="680.0" y="357.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
-        <omgdi:waypoint x="700.0" y="337.0"></omgdi:waypoint>
-        <omgdi:waypoint x="699.0" y="157.0"></omgdi:waypoint>
-        <omgdi:waypoint x="535.0" y="157.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="700.0" y="337.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow20" id="BPMNEdge_flow20">
-        <omgdi:waypoint x="700.0" y="377.0"></omgdi:waypoint>
-        <omgdi:waypoint x="700.0" y="480.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="700.0" y="377.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow21" id="BPMNEdge_flow21">
-        <omgdi:waypoint x="648.0" y="507.0"></omgdi:waypoint>
-        <omgdi:waypoint x="512.0" y="507.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow22" id="BPMNEdge_flow22">
-        <omgdi:waypoint x="472.0" y="507.0"></omgdi:waypoint>
-        <omgdi:waypoint x="202.0" y="506.0"></omgdi:waypoint>
-        <omgdi:waypoint x="202.0" y="239.0"></omgdi:waypoint>
-        <omgdi:waypoint x="492.0" y="185.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="472.0" y="507.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow23" id="BPMNEdge_flow23">
-        <omgdi:waypoint x="492.0" y="527.0"></omgdi:waypoint>
-        <omgdi:waypoint x="492.0" y="590.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="22.0" x="492.0" y="527.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow24" id="BPMNEdge_flow24">
-        <omgdi:waypoint x="300.0" y="157.0"></omgdi:waypoint>
-        <omgdi:waypoint x="450.0" y="157.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow25" id="BPMNEdge_flow25">
-        <omgdi:waypoint x="492.0" y="185.0"></omgdi:waypoint>
-        <omgdi:waypoint x="492.0" y="240.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge bpmnElement="flow26" id="BPMNEdge_flow26">
-        <omgdi:waypoint x="700.0" y="377.0"></omgdi:waypoint>
-        <omgdi:waypoint x="490.0" y="402.0"></omgdi:waypoint>
-        <omgdi:waypoint x="444.0" y="505.0"></omgdi:waypoint>
-        <omgdi:waypoint x="492.0" y="590.0"></omgdi:waypoint>
-        <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="100.0" x="700.0" y="377.0"></omgdc:Bounds>
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-    </bpmndi:BPMNPlane>
-  </bpmndi:BPMNDiagram>
-</definitions>

+ 0 - 1
sop-api/src/main/resources/qualityProblemFlow/quality_problem_apply.form

@@ -1 +0,0 @@
-[{"id":"1","code":"TEXT","type":"FORM","formId":"problem_point","formName":"problem_point","title":"问题简要","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"length":30,"name":"文本","span":12},{"id":"2","code":"TEXTAREA","type":"FORM","formId":"problem_remark","formName":"problem_remark","title":"问题情况说明","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"length":300,"name":"文本域","span":12},{"id":"3","code":"FILE","type":"FORM","formId":"attachments_info","formName":"attachments_info","title":"附件说明","inputType":"FILE","required":false,"readable":false,"writable":true,"visable":true,"length":5,"name":"文件","span":12}]

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
sop-api/src/main/resources/qualityProblemFlow/quality_problem_approve.form


+ 0 - 1
sop-api/src/main/resources/qualityProblemFlow/quality_problem_check.form

@@ -1 +0,0 @@
-[{"id":"12","code":"RADIO","type":"FORM","formId":"approve_radio","formName":"approve_radio","title":"审批意见","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"name":"单选框","span":12,"options":"[{\"value\":\"1\",\"label\":\"同意\"},{\"value\":\"0\",\"label\":\"不同意\"}]"},{"id":"13","code":"SIGN","type":"FORM","formId":"sign","formName":"sign","title":"添加签名","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"name":"签名","span":6},{"id":"14","code":"TEXTAREA","type":"FORM","formId":"approve_remark","formName":"approve_remark","title":"备注","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"name":"文本域","span":12}]

+ 0 - 1
sop-api/src/main/resources/qualityProblemFlow/quality_problem_start.form

@@ -1 +0,0 @@
-{"approveRejectMap":{"f_usertask_quality_problem_approve_2":[{"afterFlowTaskKey":"f_usertask_quality_problem_apply_1","setup":1}],"f_usertask_quality_problem_check_3":[{"afterFlowTaskKey":"f_usertask_quality_problem_approve_2","setup":2}],"f_usertask_quality_problem_third_check_4":[{"afterFlowTaskKey":"f_usertask_quality_problem_approve_2","setup":2}]}}

+ 0 - 1
sop-api/src/main/resources/qualityProblemFlow/quality_problem_third_check.form

@@ -1 +0,0 @@
-[{"id":"15","code":"RADIO","type":"FORM","formId":"approve_radio","formName":"approve_radio","title":"审批意见","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"name":"单选框","span":12,"options":"[{\"value\":\"1\",\"label\":\"同意\"},{\"value\":\"0\",\"label\":\"不同意\"}]"},{"id":"16","code":"SIGN","type":"FORM","formId":"sign","formName":"sign","title":"添加签名","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"name":"签名","span":6},{"id":"17","code":"TEXTAREA","type":"FORM","formId":"approve_remark","formName":"approve_remark","title":"备注","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"name":"文本域","span":12}]

+ 163 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TBSopLog.java

@@ -0,0 +1,163 @@
+package com.qmth.sop.business.entity;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.FlowStatusEnum;
+import com.qmth.sop.common.enums.SopLogTypeEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * <p>
+ * sop日志
+ * </p>
+ *
+ * @author wangliang
+ * @since 2024-01-23
+ */
+@ApiModel(value = "TBSopLog对象", description = "sop日志")
+public class TBSopLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty(value = "sop主键")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long sopId;
+
+    @ApiModelProperty(value = "类型,EDIT:sop编辑,CHANGE_EFFECT_ENGINEER:更改实施工程师,CHANGE_ASSISTANT_ENGINEER:更改助理工程师,ADD_EFFECT_ENGINEER:新增实施工程师,ADD_ASSISTANT_ENGINEER:新增助理工程师,REMOVE_EFFECT_ENGINEER:删除实施工程师,REMOVE_ASSISTANT_ENGINEER:删除助理工程师")
+    private SopLogTypeEnum type;
+
+    @ApiModelProperty(value = "状态,START:已开始,AUDITING:审核中,REJECT:已驳回,END:已终止,FINISH:已结束")
+    private FlowStatusEnum status;
+
+    @ApiModelProperty(value = "计划步骤")
+    private Integer setup;
+
+    @ApiModelProperty(value = "更改前内容")
+    private String updateBeforeObj;
+
+    @ApiModelProperty(value = "更改后内容")
+    private String updateAfterObj;
+
+    @ApiModelProperty(value = "创建人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long createId;
+
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    public TBSopLog() {
+
+    }
+
+    public TBSopLog(Long sopId, SopLogTypeEnum type, FlowStatusEnum status, Integer setup, String updateBeforeObj,
+            String updateAfterObj, Long createId) {
+        this.id = SystemConstant.getDbUuid();
+        this.sopId = sopId;
+        this.type = type;
+        this.status = status;
+        this.setup = setup;
+        this.updateBeforeObj = updateBeforeObj;
+        this.updateAfterObj = updateAfterObj;
+        this.createId = createId;
+        this.createTime = System.currentTimeMillis();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        TBSopLog tbSopLog = (TBSopLog) o;
+        return sopId.equals(tbSopLog.sopId) && updateBeforeObj.equals(tbSopLog.updateBeforeObj)
+                && updateAfterObj.equals(tbSopLog.updateAfterObj);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(sopId, updateBeforeObj, updateAfterObj);
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getSopId() {
+        return sopId;
+    }
+
+    public void setSopId(Long sopId) {
+        this.sopId = sopId;
+    }
+
+    public SopLogTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(SopLogTypeEnum type) {
+        this.type = type;
+    }
+
+    public FlowStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(FlowStatusEnum status) {
+        this.status = status;
+    }
+
+    public Integer getSetup() {
+        return setup;
+    }
+
+    public void setSetup(Integer setup) {
+        this.setup = setup;
+    }
+
+    public String getUpdateBeforeObj() {
+        return updateBeforeObj;
+    }
+
+    public void setUpdateBeforeObj(String updateBeforeObj) {
+        this.updateBeforeObj = updateBeforeObj;
+    }
+
+    public String getUpdateAfterObj() {
+        return updateAfterObj;
+    }
+
+    public void setUpdateAfterObj(String updateAfterObj) {
+        this.updateAfterObj = updateAfterObj;
+    }
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+}

+ 16 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopLogMapper.java

@@ -0,0 +1,16 @@
+package com.qmth.sop.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.sop.business.entity.TBSopLog;
+
+/**
+ * <p>
+ * sop日志 Mapper 接口
+ * </p>
+ *
+ * @author wangliang
+ * @since 2024-01-23
+ */
+public interface TBSopLogMapper extends BaseMapper<TBSopLog> {
+
+}

+ 16 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TBSopLogService.java

@@ -0,0 +1,16 @@
+package com.qmth.sop.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.sop.business.entity.TBSopLog;
+
+/**
+ * <p>
+ * sop日志 服务类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2024-01-23
+ */
+public interface TBSopLogService extends IService<TBSopLog> {
+
+}

+ 27 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -107,6 +107,9 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Resource
     TBUserArchivesService tbUserArchivesService;
 
+    @Resource
+    TBSopLogService tbSopLogService;
+
     /**
      * 查询动态sop表名是否存在
      *
@@ -366,12 +369,27 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 tfCustomFlowEntity.getCrmNo());
         Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
 
+        String oldFlowProcessVar = tfCustomFlowEntity.getFlowProcessVar();
         Map<String, Object> map = activitiService.taskApprove(flowApproveParam);
         if (flowApproveParam.getApprove() != FlowApprovePassEnum.DRAFT) {
             map.put(SystemConstant.CRM_INFO, crmProjectResult);
             map.put(SystemConstant.SOP_ID, tbSopInfo.getId());
             map.put(SystemConstant.SOURCE, "sopApprove");
             tbSopInfoService.saveJobRemind(map);
+
+            //新增sop日志
+            if (tbSopInfo.getStatus() == SopStatusEnum.START) {
+                TFFlowApprove tfFlowApprove = (TFFlowApprove) map.get(SystemConstant.FLOW_APPROVE);
+                Optional.ofNullable(tfFlowApprove)
+                        .orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
+
+                TBSopLog tbSopLog = new TBSopLog(tbSopInfo.getId(), SopLogTypeEnum.APPROVE, tfFlowApprove.getStatus(),
+                        tfFlowApprove.getSetup(), oldFlowProcessVar, tfCustomFlowEntity.getFlowProcessVar(),
+                        sysUser.getId());
+                if (tbSopLog.equals(tbSopLog)) {
+                    tbSopLogService.save(tbSopLog);
+                }
+            }
         }
         TFFlowApprove tfFlowApprove = (TFFlowApprove) map.get(SystemConstant.FLOW_APPROVE);
         tbSopInfo.setStatus(
@@ -1249,6 +1267,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getCode, tbSopInfo.getSopNo()));
         Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
 
+        String oldFlowProcessVar = tfCustomFlowEntity.getFlowProcessVar();
         TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda()
                 .eq(TFFlowApprove::getFlowId, tfCustomFlowEntity.getFlowId()));
         Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
@@ -1311,6 +1330,14 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, 1);
             tbSopInfoService.saveSopPlanDate(flowTaskResult, tbSopInfo.getId(), tfCustomFlowEntity.getFlowId(),
                     sysUser.getId());
+
+            //新增sop日志
+            TBSopLog tbSopLog = new TBSopLog(tbSopInfo.getId(), SopLogTypeEnum.EDIT, tfFlowApprove.getStatus(),
+                    tfFlowApprove.getSetup(), oldFlowProcessVar, tfCustomFlowEntity.getFlowProcessVar(),
+                    sysUser.getId());
+            if (tbSopLog.equals(tbSopLog)) {
+                tbSopLogService.save(tbSopLog);
+            }
         }
         return tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
     }

+ 20 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.qmth.sop.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.sop.business.entity.TBSopLog;
+import com.qmth.sop.business.mapper.TBSopLogMapper;
+import com.qmth.sop.business.service.TBSopLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * sop日志 服务实现类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2024-01-23
+ */
+@Service
+public class TBSopLogServiceImpl extends ServiceImpl<TBSopLogMapper, TBSopLog> implements TBSopLogService {
+
+}

+ 5 - 0
sop-business/src/main/resources/mapper/TBSopLogMapper.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.qmth.sop.business.mapper.TBSopLogMapper">
+
+</mapper>

+ 37 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/SopLogTypeEnum.java

@@ -0,0 +1,37 @@
+package com.qmth.sop.common.enums;
+
+/**
+ * @Description: sop日志类型 enum
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/8/2
+ */
+public enum SopLogTypeEnum {
+
+    APPROVE("sop审核"),
+
+    EDIT("sop编辑"),
+
+    CHANGE_EFFECT_ENGINEER("更改实施工程师"),
+
+    CHANGE_ASSISTANT_ENGINEER("更改助理工程师"),
+
+    ADD_EFFECT_ENGINEER("新增实施工程师"),
+
+    ADD_ASSISTANT_ENGINEER("新增助理工程师"),
+
+    REMOVE_EFFECT_ENGINEER("删除实施工程师"),
+
+    REMOVE_ASSISTANT_ENGINEER("删除助理工程师");
+
+    private String title;
+
+    private SopLogTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно