Просмотр исходного кода

新增企业信息远程查询接口

tangyishan 13 часов назад
Родитель
Сommit
22d94ca4ef

+ 38 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/server/KwsEnterpriseServerController.java

@@ -0,0 +1,38 @@
+package com.sckw.system.controller.server;
+
+import com.sckw.system.model.vo.res.EntInfo;
+import com.sckw.system.service.KwsEnterpriseService;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+
+/**
+ * 企业信息
+ *
+ * @author tangyishan
+ * @since 2026-01-09  15:43
+ */
+@RestController
+@RequestMapping("/server/kwsEnt")
+@Tag(name = "服务端企业信息相关接口")
+@Data
+public class KwsEnterpriseServerController {
+    @Autowired
+    private KwsEnterpriseService kwsEntService;
+
+    /**
+     * @return HttpResult
+     * @desc: 根据企业id列表查询企业信息
+     */
+    @PostMapping("queryEntInfos")
+    public List<EntInfo> queryEntInfos(@RequestBody List<Long> entIds) {
+        return kwsEntService.queryEntInfoByKeys(entIds);
+    }
+}

+ 9 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java

@@ -67,6 +67,15 @@ public interface KwsEnterpriseDao extends BaseMapper<KwsEnterprise> {
      */
     List<KwsEnterprise> selectAllByKeys(@Param(value = "list") List<Long> list);
 
+    /**
+     * @param list 主键Ids
+     * @return KwsEnterprise
+     * @desc: 批量查
+     * @author: czh
+     * @date: 2023/6/19
+     */
+    List<EntInfo> queryEntInfoByKeys(@Param(value = "list") List<Long> list);
+
     /**
      * 查询
      *

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

@@ -242,6 +242,13 @@ public class KwsEnterpriseService {
         return checkKwsEnterpriseById(key);
     }
 
+    public List<EntInfo> queryEntInfoByKeys(List<Long> keys) {
+        if(CollectionUtils.isEmpty(keys)){
+            return Collections.emptyList();
+        }
+        return kwsEnterpriseDao.queryEntInfoByKeys(keys);
+    }
+
 
     /**
      * @param reqVo 分页入参

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

@@ -332,6 +332,18 @@
         </if>
     </select>
 
+    <select id="queryEntInfoByKeys" resultType="com.sckw.system.model.vo.res.EntInfo">
+        select id as entId, firm_name as entName
+        from kws_enterprise
+        where del_flag = 0
+        <if test="list != null and list.size() > 0">
+            and id in
+            <foreach collection="list" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
     <select id="queryEntInfoByCityCodeAndEntTypesWithPage" resultType="com.sckw.system.model.KwsEnterprise">
         SELECT a.*
         FROM kws_enterprise a