Bläddra i källkod

1、用户专场标识

zk 2 år sedan
förälder
incheckning
b9852b12dc

+ 11 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/context/LoginEntHolder.java

@@ -1,5 +1,6 @@
 package com.sckw.core.web.context;
 
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.model.LoginEntInfo;
 
 /**
@@ -82,4 +83,14 @@ public class LoginEntHolder {
         return LONGIN_ENT_HOLDER.get() == null ? null : LONGIN_ENT_HOLDER.get().getSpecial();
     }
 
+    /**
+     * 是否主平台(不属于专场)
+     * @author zk
+     * @Date 2023/12/17 0021
+     */
+    public static boolean mainPlatform(){
+        String pecial = getSpecial();
+        return StringUtils.isBlank(pecial);
+    }
+
 }

+ 9 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/model/LoginUserInfo.java

@@ -1,7 +1,6 @@
 package com.sckw.core.web.model;
 
 import lombok.Data;
-
 import java.util.List;
 
 /**
@@ -15,38 +14,47 @@ public class LoginUserInfo {
      * 用户id
      */
     private Long id;
+
     /**
      * 用户所属系统
      */
     private Integer systemType;
+
     /**
      * 用户账号
      */
     private String account;
+
     /**
      * 用户姓名
      */
     private String userName;
+
     /**
      * 用户电话
      */
     private String phone;
+
     /**
      * 是否主账号(0是/1否)
      */
     private int isMain;
+
     /**
      *用户账号状态(0正常/1锁定)
      */
     private Integer status;
+
     /**
      * 用户所属企业id
      */
     private Long entId;
+
     /**
      * 用户登录终端
      */
     private String clientType;
+
     /**
      * 用户所属机构id
      */

+ 8 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -251,6 +251,14 @@ public interface RemoteSystemService {
      **/
     List<SpecialResVo> findSpecial();
 
+    /**
+     * @param code 专场编号
+     * @desc 专场编号查询关联企业ID
+     * @author zk
+     * @date 2023/12/16
+     **/
+    List<Long> findEntIdsByCode(String code);
+
     /**
      * 企业主键id查询数据库企业信息
      * @param entIds 企业id查询数据库企业信息

+ 16 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -270,6 +270,22 @@ public class RemoteBaseService {
         return new ArrayList<>();
     }
 
+    /**
+     * @param code 专场编号
+     * @desc 专场编号查询关联企业ID
+     * @author zk
+     * @date 2023/12/16
+     **/
+    public List<Long> findEntIdsByCode(String code) {
+        return kwsSpecialService.findEntIdsByCode(code);
+    }
+
+    /**
+     * @param entIds 企业id查询数据库企业信息
+     * @desc 企业主键id查询数据库企业信息
+     * @author zk
+     * @date 2023/12/16
+     **/
     public Map<Long, KwsEnterpriseResDto> queryEnterpriseByEntIds(List<Long> entIds) {
         List<KwsEnterprise> enterpriseList = kwsEnterpriseDao.queryEnterpriseByEntIds(entIds);
         List<KwsEnterpriseResDto> dtoList = new ArrayList<>();

+ 12 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -809,10 +809,22 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
      * @author zk
      * @date 2023/12/14
      **/
+    @Override
     public List<SpecialResVo> findSpecial() {
         return remoteBaseService.findSpecial();
     }
 
+    /**
+     * @param code 专场编号
+     * @desc 专场编号查询关联企业ID
+     * @author zk
+     * @date 2023/12/16
+     **/
+    @Override
+    public List<Long> findEntIdsByCode(String code){
+        return remoteBaseService.findEntIdsByCode(code);
+    }
+
     /**
      * 企业主键id查询数据库企业信息
      * @param entIds 企业id查询数据库企业信息

+ 26 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsSpecialService.java

@@ -281,4 +281,30 @@ public class KwsSpecialService {
         }
         return null;
     }
+
+    /**
+     * @param code 专场编号
+     * @desc 专场编号查询关联企业ID
+     * @author zk
+     * @date 2023/12/16
+     **/
+    public List<Long> findEntIdsByCode(String code) {
+        //企业ID结果集
+        List<Long> entIds = new ArrayList<>();
+        //专场
+        List<KwsSpecial> specials = kwsSpecialDao.findList(new HashMap<>(){{put("code", code);}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            KwsSpecial special = specials.get(NumberConstant.ZERO);
+            entIds.add(special.getEntId());
+
+            //专场关联企业
+            List<KwsEntSpecial> entSpecials = kwsEntSpecialDao.findList(new HashMap<>(){{put("specialId", special.getId());}});
+            if (CollectionUtils.isNotEmpty(entSpecials)) {
+                entSpecials.forEach(e ->{
+                    entIds.add(e.getEntId());
+                });
+            }
+        }
+        return entIds;
+    }
 }