ソースを参照

Merge remote-tracking branch 'origin/dev_1.1.0' into dev_1.1.0

caozixuan 1 年間 前
コミット
4bd3395ce2

+ 12 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1185,14 +1185,23 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         FlowResult flowResultParam = JSONObject.parseObject(sopSaveParam.getFormProperties(), FlowResult.class);
+
         LinkedHashMap<String, FlowTaskResult> setupParamMap = flowResultParam.getSetupMap();
+        FlowTaskResult flowTaskResultNew = null;
         for (Map.Entry<String, FlowTaskResult> entry : setupParamMap.entrySet()) {
-            if (entry.getValue().getSetup() != 0) {//更新动态表单字段和处理时限
+            if (entry.getValue().getSetup().intValue() != 0) {//更新动态表单字段和处理时限
                 tbSopInfoService.saveDynamicSop(tfCustomFlow, tfCustomFlowEntity.getCode(),
                         tfCustomFlowEntity.getFlowId(), entry.getValue());
+                if (entry.getValue().getSetup().intValue() == 1) {
+                    flowTaskResultNew = entry.getValue();
+                }
             }
         }
+        ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResultNew);
+
         FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
+        FlowTaskResult flowTaskResultOld = this.getFormProperties(tfCustomFlowEntity, 1);
+        ServiceScopeEnum scopeOldEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResultOld);
         LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
         for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
             if (Objects.nonNull(setupParamMap.get(entry.getKey()))) {
@@ -1269,8 +1278,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 tbSopLogService.save(tbSopLog);
             }
 
-            ServiceScopeEnum scopeEnum = tbSopInfoService.findServiceScope(tfCustomFlow.getType(), flowTaskResult);
-            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW) {//教务处sop流程待审核人
+            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
+                    && scopeEnum != scopeOldEnum) {//教务处sop流程待审核人
                 List<AllocationParam> allocationParams = new ArrayList<>();
                 Task task = taskService.createTaskQuery().processInstanceId(tfCustomFlowEntity.getFlowId().toString())
                         .singleResult();

+ 2 - 2
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -204,7 +204,7 @@
         </where>) t
         join t_f_custom_flow_entity tfcfe on tfcfe.code = t.sop_no
         join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
-        where t.status = 'START' and (tffa.status in ('START', 'DRAFT', 'AUDITING', 'REJECT', 'CANCEL') or (tffa.status = 'FINISH' and (t.datediff <![CDATA[ >= ]]> -1 and t.datediff <![CDATA[ <= ]]> 0)))
+        where t.status = 'DRAFT' and (tffa.status in ('START', 'DRAFT', 'AUDITING', 'REJECT', 'CANCEL') or (tffa.status = 'FINISH' and (t.datediff <![CDATA[ >= ]]> -1 and t.datediff <![CDATA[ <= ]]> 0)))
     </select>
 
     <select id="findFlowByServiceId" resultType="com.qmth.sop.business.bean.result.SopInfoResult">
@@ -229,7 +229,7 @@
             <if test="serviceId != null and serviceId != ''">
                 and tbsi.service_id = #{serviceId}
             </if>
-                and tbsi.status = 'START'
+                and tbsi.status = 'DRAFT'
                 and tffa.status not in('END')
         </where>
     </select>

+ 1 - 1
sop-business/src/main/resources/mapper/TBSopPlanDateLogMapper.xml

@@ -9,7 +9,7 @@
                left join t_b_service tbs on tbs.id = tbsi.service_id
                left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
         <where> 1 = 1
-                and tbsi.status = 'START'
+                and tbsi.status = 'DRAFT'
             <if test="serviceId != null and serviceId != ''">
                 and tbs.id = #{serviceId}
             </if>