Selaa lähdekoodia

新增sop系统自动审批

wangliang 1 vuosi sitten
vanhempi
commit
3f6473a80f

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -73,12 +73,13 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @param iPage
      * @param type
      * @param serviceId
+     * @param tableName
      * @param fieldName
      * @param fieldValue
      * @return
      */
     @SuppressWarnings("MybatisXMapperMethodInspection")
-    IPage<Map> list(IPage<Map> iPage, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue
+    IPage<Map> list(IPage<Map> iPage, @Param("type") String type, @Param("serviceId") Long serviceId, @Param("tableName") String tableName, @Param("fieldName") String fieldName, @Param("fieldValue") String fieldValue
 //            , @Param("userIdList") List<Long> userIdList
     );
 

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

@@ -303,6 +303,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         if (sopInfoListParam.getType() != TFCustomTypeEnum.OFFICE_SOP_FLOW && sopInfoListParam.getType() != TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {
             throw ExceptionResultEnum.ERROR.exception("流程类型只能为教务处或研究生");
         }
+        String tableName = sopInfoListParam.getType().getTableName() + "_" + sopInfoListParam.getVersion();
         String fieldName = null, fieldValue = null;
         if (!CollectionUtils.isEmpty(sopInfoListParam.getFormWidgetMetadataList())) {
             StringJoiner stringJoiner = new StringJoiner(",");
@@ -320,7 +321,7 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
             fieldName = stringJoiner.toString();
             fieldValue = !Objects.equals(stringJoinerValue.toString().trim(), "") ? stringJoinerValue.toString().trim() : null;
         }
-        return this.baseMapper.list(new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()), Objects.nonNull(sopInfoListParam.getType()) ? sopInfoListParam.getType().name() : null, sopInfoListParam.getServiceId(), fieldName, fieldValue);
+        return this.baseMapper.list(new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()), Objects.nonNull(sopInfoListParam.getType()) ? sopInfoListParam.getType().name() : null, sopInfoListParam.getServiceId(), tableName, fieldName, fieldValue);
     }
 
     /**

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

@@ -81,7 +81,7 @@
                 <if test="fieldName != null and fieldName != ''">
                     ,${fieldName}
                 </if>
-        from t_b_sop_info tbsi
+                from t_b_sop_info tbsi
                  left join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
                  left join t_b_service tbs on tbs.id = tbsi.service_id
                  left join sys_custom sc on sc.id = tbsi.custom_id
@@ -92,7 +92,9 @@
                  left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
                  left join ACT_RU_TASK art on art.PROC_INST_ID_ = tffa.flow_id
                  left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
-                 left join t_b_sop_dynamic_office_1 tbsdo1 on tbsdo1.flow_deployment_id = tfcf.flow_deployment_id
+                 <if test="tableName != null and tableName != ''">
+                     left join ${tableName} t on t.flow_deployment_id = tfcf.flow_deployment_id
+                 </if>
         <where> 1 = 1
             <if test="type != null and type != ''">
                 and tfcf.type = #{type}