czh hace 2 años
padre
commit
1edffb8b22

+ 5 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -337,6 +337,11 @@ public class KwsEnterpriseService {
             currentTypeList.addAll(listByEntId.stream().map(KwsEntType::getType).toList());
         }
         List<Integer> typeList = Arrays.stream(reqVo.getEntTypes().split(Global.COMMA)).map(Integer::parseInt).toList();
+
+        if (typeList.contains(EntTypeEnum.LOGISTICS3.getCode()) && typeList.contains(EntTypeEnum.LOGISTICS4.getCode())) {
+            throw new SystemException(HttpStatus.CODE_10301, HttpStatus.PL34);
+        }
+
         if (currentTypeList.contains(EntTypeEnum.LOGISTICS3.getCode()) && typeList.contains(EntTypeEnum.LOGISTICS4.getCode())) {
             throw new SystemException(HttpStatus.CODE_10301, HttpStatus.PL34);
         }

+ 7 - 5
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -182,11 +182,13 @@
 
   <select id="findList" resultType="com.sckw.system.model.vo.res.FindEntListResVo" parameterType="com.sckw.system.model.vo.req.FindListReqVo">
     select a.*,
-           b.id userId,
-           b.account,
-           b.name
+           d.id userId,
+           d.account,
+           d.name
       from kws_enterprise a
-    left join kws_user b on a.phone = b.account and b.del_flag = 0
+    left join kws_dept b on a.id = b.ent_id and b.del_flag = 0
+    left join kws_user_dept c on b.id = c.dept_id
+    left join kws_user d on c.user_id = d.id and d.del_flag = 0 and d.status = 0
     where a.del_flag = 0
     <if test="approval != null">
       and a.approval = #{approval}
@@ -195,7 +197,7 @@
         and a.firm_name like concat('%', #{entName}, '%')
       </if>
     <if test="entType != null">
-      and exists (select 1 from kws_ent_type b where a.id = b.ent_id and b.type = #{entType})
+      and exists (select 1 from kws_ent_type e where a.id = e.ent_id and e.type = #{entType})
     </if>
     order by a.create_time
   </select>