Преглед изворни кода

新增根据crmNo查询在途的sop信息

wangliang пре 1 година
родитељ
комит
0ffc12c848

+ 9 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -81,4 +81,13 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
     IPage<Map> list(IPage<Map> iPage, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue
 //            , @Param("userIdList") List<Long> userIdList
     );
+
+    /**
+     * 根据crmNo查询在途的sop信息
+     *
+     * @param crmNo
+     * @param userId
+     * @return
+     */
+    List<String> findFlowPassageByCrmNo(@Param("crmNo") String crmNo, @Param("userId") Long userId);
 }

+ 9 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -11,6 +11,7 @@ import com.qmth.sop.business.entity.TBSopInfo;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.common.enums.FlowApprovePassEnum;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -97,4 +98,12 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      * @throws InterruptedException
      */
     public Boolean sopApplyOrPublish(String sopNo, String crmNo, String flowDeploymentId, FlowApprovePassEnum approve, String formProperties) throws InterruptedException;
+
+    /**
+     * 根据crmNo查询在途的sop信息
+     *
+     * @param crmNo
+     * @return
+     */
+    List<String> findFlowPassageByCrmNo(String crmNo);
 }

+ 14 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -379,7 +379,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     public Boolean sopApplyOrPublish(String sopNo, String crmNo, String flowDeploymentId, FlowApprovePassEnum approve, String formProperties) throws InterruptedException {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(sopNo, crmNo);
-        Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("crm数据为空"));
+        Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
         Optional.ofNullable(crmProjectResult.getRegionManagerId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("crm大区经理数据为空"));
 
         TFCustomFlow tfCustomFlow = null;
@@ -418,4 +418,17 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
         return tbSopInfoService.save(tbSopInfo);
     }
+
+    /**
+     * 根据crmNo查询在途的sop信息
+     *
+     * @param crmNo
+     * @return
+     */
+    @Override
+    public List<String> findFlowPassageByCrmNo(String crmNo) {
+        Optional.ofNullable(crmNo).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        return this.baseMapper.findFlowPassageByCrmNo(crmNo, sysUser.getId());
+    }
 }

+ 8 - 1
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -1103,4 +1103,11 @@ SET name='作废', url='Cancel', `type`='LINK', parent_id=41, `sequence`=7, prop
 WHERE id=3038;
 UPDATE sys_privilege
 SET name='作废', url='Cancel', `type`='LINK', parent_id=42, `sequence`=7, property='AUTH', related='3045', enable=1, default_auth=0, front_display=1
-WHERE id=3040;
+WHERE id=3040;
+
+UPDATE sys_privilege
+SET name='结束流程接口', url='/api/admin/flow/delete', `type`='URL', parent_id=64, `sequence`=16, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=0
+WHERE id=3003;
+UPDATE sys_privilege
+SET name='批量结束流程接口', url='/api/admin/flow/batch/delete', `type`='URL', parent_id=64, `sequence`=28, property='AUTH', related=NULL, enable=1, default_auth=1, front_display=0
+WHERE id=3029;

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

@@ -132,4 +132,23 @@
             and ari.TYPE_ = 'candidate') t where t.flowId = art.PROC_INST_ID_)-->
          </where>
     </select>
+
+    <select id="findFlowPassageByCrmNo" resultType="java.lang.String">
+        select
+            tbsi.sop_no
+        from
+            t_b_sop_info tbsi
+                join t_b_sop_info_detail tbsid on tbsid.sop_info_id = tbsi.id
+                join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+                join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+        <where> 1 = 1
+            <if test="userId != null and userId != ''">
+                and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId})
+            </if>
+            <if test="crmNo != null and crmNo != ''">
+                and tbsi.crm_no = #{crmNo}
+            </if>
+                and tffa.status not in('FINISH', 'END')
+        </where>
+    </select>
 </mapper>