فهرست منبع

dubbo企业查询接口

czh 2 سال پیش
والد
کامیت
661831e7a9

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

@@ -84,6 +84,15 @@ public interface RemoteSystemService {
      */
     List<EntCacheResDto> queryEntCacheByName(String entName);
 
+    /**
+     * @param endIdList 企业id集合
+     * @return Map<Long, EntCacheResDto>
+     * @desc: 查企业树
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> endIdList);
+
     /**
      * @param userId 用户id
      * @return UserCacheResDto
@@ -128,4 +137,5 @@ public interface RemoteSystemService {
      * @date: 2023/7/11
      */
     UserCacheResDto queryManagerInfoByEntId(Long entId);
+
 }

+ 16 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/EntCacheResDto.java

@@ -55,6 +55,16 @@ public class EntCacheResDto implements Serializable {
      */
     private String phone;
 
+    /**
+     * 集团企业id
+     */
+    private Long parentId;
+
+    /**
+     * 主体单位们id
+     */
+    private String entDeptIds;
+
     /**
      * 机构信息
      */
@@ -64,4 +74,10 @@ public class EntCacheResDto implements Serializable {
      * 资质信息
      */
     private List<EntCertificateResDto> certificateInfo;
+
+    /**
+     * 下属单位
+     */
+    private List<EntCacheResDto> child;
+
 }

+ 20 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEntDeptDao.java

@@ -3,6 +3,8 @@ package com.sckw.system.dao;
 import com.sckw.system.model.KwsEntDept;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * 组织机构
  * @author zk
@@ -32,4 +34,22 @@ public interface KwsEntDeptDao {
      */
     KwsEntDept selectByKey(Long id);
 
+    /**
+     * @param entId 企业id
+     * @return KwsEntDept
+     * @desc: 根据企业id查关联
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    List<KwsEntDept> selectByEntId(Long entId);
+
+    /**
+     * @param entPid 企业pid
+     * @return KwsEntDept
+     * @desc: 根据企业pid查关联
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    List<KwsEntDept> selectByEntPid(Long entPid);
+
 }

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

@@ -5,6 +5,7 @@ import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.api.model.pojo.DeptInfoPojo;
+import com.sckw.system.dao.KwsEntDeptDao;
 import com.sckw.system.model.*;
 import com.sckw.system.model.vo.res.CertificateResVo;
 import com.sckw.system.model.vo.res.KwsDeptResVo;
@@ -39,6 +40,9 @@ public class RemoteBaseService {
     @Resource
     private KwsRoleService kwsRoleService;
 
+    @Resource
+    private KwsEntDeptDao kwsEntDeptDao;
+
 
     public KwsEnterpriseResDto queryEnterpriseById(Long id) {
         KwsEnterprise kwsEnterprise = kwsEnterpriseService.queryKwsEnterpriseById(id);
@@ -110,4 +114,24 @@ public class RemoteBaseService {
     public List<KwsEnterprise> queryEntByName(String entName) {
         return kwsEnterpriseService.queryEntByName(entName);
     }
+
+
+    /**
+     * @param entCacheResDto 返参
+     * @desc: 填充父子属id
+     * @author: czh
+     * @date: 2023/7/17
+     */
+    public void fillRelate(EntCacheResDto entCacheResDto) {
+        Long id = entCacheResDto.getId();
+//        List<KwsEntDept> kwsEntDepts = kwsEntDeptDao.selectByEntID(id);
+//        if (CollectionUtils.isNotEmpty(kwsEntDepts)) {
+//            entCacheResDto.setEntDeptIds(String.join(Global.COMMA, kwsEntDepts.stream().map(KwsEntDept::getEntPid).map(String::valueOf).toList()));
+//            return;
+//        }
+//
+//        kwsEntDepts = kwsEntDeptDao.selectByEntPid(id);
+
+
+    }
 }

+ 9 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -201,7 +201,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
             return Collections.emptyList();
         }
 
-        List<EntCacheResDto> list = new ArrayList();
+        List<EntCacheResDto> list = new ArrayList<>();
         for (KwsEnterprise kwsEnterprise : kwsEnterprises) {
             EntCacheResDto entCacheResDto = queryEntCacheById(kwsEnterprise.getId());
             if (!Objects.isNull(entCacheResDto)) {
@@ -211,6 +211,14 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return list;
     }
 
+    @Override
+    public Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> endIdList) {
+        for (Long entId : endIdList) {
+            queryEntCacheById(entId);
+        }
+        return null;
+    }
+
     @Override
     public List<EntCacheResDto> queryEntCacheByIds(List<Long> entIds) {
         if (CollectionUtils.isEmpty(entIds)) {

+ 1 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/EntRegisterReqVo.java

@@ -33,7 +33,7 @@ public class EntRegisterReqVo implements Serializable {
     /**
      * 企业编号
      */
-    @NotBlank(message = "企业编号不能为空")
+//    @NotBlank(message = "企业编号不能为空")
     private String code;
 
     /**

+ 8 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEntDeptDao.xml

@@ -26,6 +26,14 @@
     where id = #{id,jdbcType=BIGINT}
   </select>
 
+    <select id="selectByEntId" resultType="com.sckw.system.model.KwsEntDept">
+      select * from kws_ent_dep where del_flag = 0 and ent_id = #{entId}
+    </select>
+
+  <select id="selectByEntPid" resultType="com.sckw.system.model.KwsEntDept">
+    select * from kws_ent_dep where del_flag = 0 and ent_pid = #{entPid}
+  </select>
+
   <insert id="insert" parameterType="com.sckw.system.model.KwsEntDept">
     insert into kws_ent_dep
     <trim prefix="(" suffix=")" suffixOverrides=",">

+ 3 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -484,6 +484,9 @@
       <if test="cityCode != null">
         city_code = #{cityCode,jdbcType=INTEGER},
       </if>
+      <if test="cityName != null">
+        city_name = #{cityName,jdbcType=VARCHAR},
+      </if>
       <if test="detailAddress != null">
         detail_address = #{detailAddress,jdbcType=VARCHAR},
       </if>