Преглед изворни кода

工作台+菜单关联+dubbo

czh пре 2 година
родитељ
комит
4a3204dd85
19 измењених фајлова са 425 додато и 83 уклоњено
  1. 1 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java
  2. 1 0
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java
  3. 1 1
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java
  4. 41 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/QueryEntInfoByCityCodeAndEntTypesWithPageReqDto.java
  5. 12 0
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractTradeMapper.java
  6. 27 1
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java
  7. 17 0
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/res/QueryContractValidCountResDto.java
  8. 25 0
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml
  9. 10 0
      sckw-modules/sckw-report/pom.xml
  10. 33 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwWorkController.java
  11. 175 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwWorkService.java
  12. 29 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/QueryBusinessStatisticsResVo.java
  13. 4 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java
  14. 2 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  15. 4 7
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java
  16. 0 31
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/QueryMappingResVo.java
  17. 3 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  18. 37 37
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java
  19. 3 0
      sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

+ 1 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/EntTypeEnum.java

@@ -18,7 +18,7 @@ public enum EntTypeEnum {
     SUPPLIER(1, "供应商"),
     //采购商
     PURCHASER(2, "采购商"),
-    //4PL物流  托运
+    //4PL物流  托运 承运
     LOGISTICS3(3, "4PL物流"),
     //3PL物流  承运
     LOGISTICS4(4, "3PL物流");

+ 1 - 0
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java

@@ -39,4 +39,5 @@ public interface RemoteContractService {
      */
     Map<Integer, Integer> queryContractValidCount(Long entId);
 
+
 }

+ 1 - 1
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -192,7 +192,7 @@ public interface RemoteUserService {
      * @author: czh
      * @date: 2023/9/1
      */
-    PageResult queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList, Integer page, Integer pageSize);
+    PageResult queryEntInfoByCityCodeAndEntTypesWithPage(QueryEntInfoByCityCodeAndEntTypesWithPageReqDto reqDto);
 
     /**
      * @param id 用户id

+ 41 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/QueryEntInfoByCityCodeAndEntTypesWithPageReqDto.java

@@ -0,0 +1,41 @@
+package com.sckw.system.api.model.dto.req;
+
+import com.sckw.core.model.page.PageRequest;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author czh
+ * @desc 查企业
+ * @date 2023/9/11
+ */
+@Data
+public class QueryEntInfoByCityCodeAndEntTypesWithPageReqDto extends PageRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -7651223952035026025L;
+
+    /**
+     * 区域code
+     */
+    private Integer cityCode;
+
+    /**
+     * 企业类型
+     */
+    private List<Integer> entTypeList;
+
+    /**
+     * 企业id
+     */
+    private List<Long> entIdList;
+
+    /**
+     * 企业名
+     */
+    private String entName;
+
+}

+ 12 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractTradeMapper.java

@@ -2,12 +2,15 @@ package com.sckw.contract.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.contract.model.dto.req.QueryListReqDto;
+import com.sckw.contract.model.dto.res.QueryContractValidCountResDto;
 import com.sckw.contract.model.dto.res.QueryListResDto;
 import com.sckw.contract.model.entity.KwcContractTrade;
 import com.sckw.contract.model.vo.req.QueryListReqVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
 * @author PC
@@ -27,6 +30,15 @@ public interface KwcContractTradeMapper extends BaseMapper<KwcContractTrade> {
      * @return QueryListResVo
      */
     List<QueryListResDto> queryList(QueryListReqDto reqVo);
+
+    /**
+     * @param entIdList  企业id
+     * @return QueryContractValidCountResDto
+     * @desc: 查各个类型的有效合同  贸易和物流写一起算了
+     * @author: czh
+     * @date: 2023/9/11
+     */
+    List<QueryContractValidCountResDto> queryContractValidCount(@Param(value = "list") List<Long> entIdList);
 }
 
 

+ 27 - 1
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java

@@ -5,6 +5,7 @@ import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
 import com.sckw.contract.api.model.dto.res.EntInfo;
 import com.sckw.contract.dao.KwcContractLogisticsMapper;
 import com.sckw.contract.dao.KwcContractTradeMapper;
+import com.sckw.contract.model.dto.res.QueryContractValidCountResDto;
 import com.sckw.contract.model.entity.KwcContractLogistics;
 import com.sckw.contract.model.entity.KwcContractLogisticsUnit;
 import com.sckw.contract.model.entity.KwcContractTrade;
@@ -13,11 +14,15 @@ import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.ContractStatusEnum;
 import com.sckw.core.model.enums.SigningWayEnum;
 import com.sckw.core.utils.CollectionUtils;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author czh
@@ -36,6 +41,9 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     @Autowired
     private KwcContractTradeMapper kwcContractTradeMapper;
 
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
     @Override
     public Map<Long, ContractCommonInfoResDto> queryContractBaseInfo(List<Long> contractIds) {
         HashMap<Long, ContractCommonInfoResDto> map = new HashMap<>(4);
@@ -103,7 +111,25 @@ public class RemoteContractServiceImpl implements RemoteContractService {
      */
     @Override
     public Map<Integer, Integer> queryContractValidCount(Long entId) {
-        return null;
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(entId);
+        if (Objects.isNull(entCacheResDto)) {
+            return Collections.emptyMap();
+        }
+
+        List<Long> entIdList = new ArrayList<>();
+        entIdList.add(entId);
+
+        List<EntCacheResDto> child = entCacheResDto.getChild();
+        if (CollectionUtils.isNotEmpty(child)) {
+            entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
+        }
+
+        List<QueryContractValidCountResDto> queryContractValidCountResDtos = kwcContractTradeMapper.queryContractValidCount(entIdList);
+        if (CollectionUtils.isEmpty(queryContractValidCountResDtos)) {
+            return Collections.emptyMap();
+        }
+
+        return queryContractValidCountResDtos.stream().collect(Collectors.toMap(QueryContractValidCountResDto::getUnitType, QueryContractValidCountResDto::getCnt, (o, n) -> n));
     }
 
     private ContractCommonInfoResDto fillContractLogistics(KwcContractLogistics kwcContractLogistics) {

+ 17 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/res/QueryContractValidCountResDto.java

@@ -0,0 +1,17 @@
+package com.sckw.contract.model.dto.res;
+
+import lombok.Data;
+
+/**
+ * @author czh
+ * @desc 查各个类型的有效合同
+ * @date 2023/9/11
+ */
+@Data
+public class QueryContractValidCountResDto {
+
+    private Integer unitType;
+
+    private Integer cnt;
+
+}

+ 25 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml

@@ -121,4 +121,29 @@
         </if>
         order by a.create_time desc
     </select>
+
+    <select id="queryContractValidCount" resultType="com.sckw.contract.model.dto.res.QueryContractValidCountResDto">
+        SELECT b.unit_type,
+               count(1) cnt
+          FROM kwc_contract_trade a
+          left join kwc_contract_trade_unit b on a.id = b.contract_id
+         where a.`status` != 3
+           and b.ent_id in
+            <foreach collection="list" separator="," open="(" close=")" item="item">
+                #{item}
+            </foreach>
+         GROUP BY b.unit_type
+         union all
+        SELECT b.unit_type,
+               count(1)
+          FROM kwc_contract_logistics a
+          left join kwc_contract_logistics_unit b on a.id = b.contract_id
+         where a.`status` != 3
+           and b.ent_id in
+            <foreach collection="list" separator="," open="(" close=")" item="item">
+                #{item}
+            </foreach>
+         GROUP BY b.unit_type
+    </select>
+
 </mapper>

+ 10 - 0
sckw-modules/sckw-report/pom.xml

@@ -115,6 +115,16 @@
             <artifactId>sckw-common-log</artifactId>
             <version>1.0.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-payment-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-contract-api</artifactId>
+            <version>1.0.0</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 33 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwWorkController.java

@@ -0,0 +1,33 @@
+package com.sckw.report.controller;
+
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.report.service.KwWorkService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author czh
+ * @desc 工作台
+ * @date 2023/9/11
+ */
+@RestController
+@RequestMapping("kwWork")
+public class KwWorkController {
+
+    @Autowired
+    private KwWorkService kwWorkService;
+
+    /**
+     * @return HttpResult
+     * @desc: 业务数据数量统计
+     * @author: czh
+     * @date: 2023/9/11
+     */
+    @PostMapping("queryBusinessStatistics")
+    public HttpResult queryBusinessStatistics() {
+        return HttpResult.ok(kwWorkService.queryBusinessStatistics());
+    }
+
+}

+ 175 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwWorkService.java

@@ -0,0 +1,175 @@
+package com.sckw.report.service;
+
+import com.sckw.contract.api.RemoteContractService;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.CooperateTypeEnum;
+import com.sckw.core.model.enums.EntTypeEnum;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.order.api.dubbo.TradeOrderStatisticsService;
+import com.sckw.order.api.model.TradeOrderCountStatisticsDTO;
+import com.sckw.payment.api.dubbo.PaymentDubboService;
+import com.sckw.payment.api.model.dto.LedgerCount;
+import com.sckw.report.service.vo.QueryBusinessStatisticsResVo;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.transport.api.dubbo.TransportStatisticsService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author czh
+ * @desc 工作台
+ * @date 2023/9/11
+ */
+@Slf4j
+@Service
+public class KwWorkService {
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private TransportStatisticsService transportStatisticsService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private PaymentDubboService paymentDubboService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteContractService remoteContractService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private TradeOrderStatisticsService tradeOrderStatisticsService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+
+    /**
+     * @return QueryBusinessStatisticsResVo
+     * @desc: 业务数据数量统计
+     * @author: czh
+     * @date: 2023/9/11
+     */
+    public List<QueryBusinessStatisticsResVo> queryBusinessStatistics() {
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(LoginUserHolder.getEntId());
+        if(Objects.isNull(entCacheResDto)) {
+            return Collections.emptyList();
+        }
+
+        String entTypes = entCacheResDto.getEntTypes();
+        //承运
+        Boolean hasCarrier = entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS4.getCode())) || entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()));
+        //托运
+        Boolean hasCheck = entTypes.contains(String.valueOf(EntTypeEnum.LOGISTICS3.getCode()));
+        //采购
+        Boolean hasPurchase = entTypes.contains(String.valueOf(EntTypeEnum.PURCHASER.getCode()));
+        //供应
+        Boolean hasSupplier = entTypes.contains(String.valueOf(EntTypeEnum.SUPPLIER.getCode()));
+
+        List<QueryBusinessStatisticsResVo> list = new ArrayList<>();
+        //合同部分
+        Map<Integer, Integer> contractMap = remoteContractService.queryContractValidCount(entCacheResDto.getId());
+        if (!contractMap.isEmpty()) {
+            if (hasPurchase) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("采购合同");
+                queryBusinessStatisticsResVo.setNum(contractMap.getOrDefault(CooperateTypeEnum.PURCHASER.getCode(), Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasSupplier) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("销售合同");
+                queryBusinessStatisticsResVo.setNum(contractMap.getOrDefault(CooperateTypeEnum.SUPPLIER.getCode(), Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasCarrier) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("承运合同");
+                queryBusinessStatisticsResVo.setNum(contractMap.getOrDefault(CooperateTypeEnum.CARRIAGE.getCode(), Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasCheck) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("托运合同");
+                queryBusinessStatisticsResVo.setNum(contractMap.getOrDefault(CooperateTypeEnum.CONSIGN.getCode(), Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+        }
+
+        //订单部分
+        List<TradeOrderCountStatisticsDTO> orderNumByTopEntId = tradeOrderStatisticsService.getOrderNumByTopEntId(entCacheResDto.getId());
+        if (CollectionUtils.isNotEmpty(orderNumByTopEntId)) {
+            Map<Integer, Integer> collect = orderNumByTopEntId.stream().collect(Collectors.toMap(TradeOrderCountStatisticsDTO::getOrderType, TradeOrderCountStatisticsDTO::getNum, (o, n) -> n));
+            if (hasSupplier) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("销售订单");
+                queryBusinessStatisticsResVo.setNum(collect.getOrDefault(Global.NUMERICAL_TWO, Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasPurchase) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("采购订单");
+                queryBusinessStatisticsResVo.setNum(collect.getOrDefault(Global.NUMERICAL_ONE, Global.NUMERICAL_ZERO));
+                list.add(queryBusinessStatisticsResVo);
+            }
+        }
+
+        //承运订单
+        Integer integer = transportStatisticsService.statisticsLogistics(entCacheResDto.getId());
+        if (hasCarrier) {
+            QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+            queryBusinessStatisticsResVo.setType("承运订单");
+            queryBusinessStatisticsResVo.setNum(Objects.isNull(integer) ? Global.NUMERICAL_ZERO : integer);
+            list.add(queryBusinessStatisticsResVo);
+        }
+
+        //托运订单
+        Integer integer1 = transportStatisticsService.statisticsPendingVerificationWaybill(entCacheResDto.getId());
+        if (hasCheck) {
+            QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+            queryBusinessStatisticsResVo.setType("托运订单");
+            queryBusinessStatisticsResVo.setNum(Objects.isNull(integer1) ? Global.NUMERICAL_ZERO : integer1);
+            list.add(queryBusinessStatisticsResVo);
+        }
+
+        LedgerCount ledgerCount = paymentDubboService.countLedger(entCacheResDto.getId());
+        if (Objects.nonNull(ledgerCount)) {
+
+            if (hasSupplier) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("销售对账");
+                queryBusinessStatisticsResVo.setNum(Objects.isNull(ledgerCount.sell()) ? Global.NUMERICAL_ZERO : ledgerCount.sell());
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasPurchase) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("采购对账");
+                queryBusinessStatisticsResVo.setNum(Objects.isNull(ledgerCount.purchase()) ? Global.NUMERICAL_ZERO : ledgerCount.purchase());
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasCarrier) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("承运对账");
+                queryBusinessStatisticsResVo.setNum(Objects.isNull(ledgerCount.carrier()) ? Global.NUMERICAL_ZERO : ledgerCount.carrier());
+                list.add(queryBusinessStatisticsResVo);
+            }
+
+            if (hasCheck) {
+                QueryBusinessStatisticsResVo queryBusinessStatisticsResVo = new QueryBusinessStatisticsResVo();
+                queryBusinessStatisticsResVo.setType("托运对账");
+                queryBusinessStatisticsResVo.setNum(Objects.isNull(ledgerCount.shipper()) ? Global.NUMERICAL_ZERO : ledgerCount.shipper());
+                list.add(queryBusinessStatisticsResVo);
+            }
+        }
+        return list;
+    }
+
+}

+ 29 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/QueryBusinessStatisticsResVo.java

@@ -0,0 +1,29 @@
+package com.sckw.report.service.vo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 业务统计返参
+ * @date 2023/9/11
+ */
+@Data
+public class QueryBusinessStatisticsResVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -2006480000281228490L;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    /**
+     * 数量
+     */
+    private Integer num;
+
+}

+ 4 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java

@@ -149,6 +149,9 @@ public interface KwsEnterpriseDao {
      * @author: czh
      * @date: 2023/9/1
      */
-    List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(@Param(value = "cityCode") Integer cityCode, @Param(value = "entTypeList") List<Integer> entTypeList, @Param(value = "entIdList") List<Long> entIdList);
+    List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(@Param(value = "cityCode") Integer cityCode,
+                                                                  @Param(value = "entTypeList") List<Integer> entTypeList,
+                                                                  @Param(value = "entIdList") List<Long> entIdList,
+                                                                  @Param(value = "entName") String entName);
 
 }

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

@@ -196,8 +196,8 @@ public class RemoteBaseService {
      * @author: czh
      * @date: 2023/9/1
      */
-    public List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList) {
-        return kwsEnterpriseService.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList);
+    public List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList, String entName) {
+        return kwsEnterpriseService.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList, entName);
     }
 
     /**

+ 4 - 7
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -11,10 +11,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.system.api.RemoteUserService;
-import com.sckw.system.api.model.dto.req.ForgetPasswordReqDto;
-import com.sckw.system.api.model.dto.req.RegisterReqDto;
-import com.sckw.system.api.model.dto.req.UpdatePasswordReqDto;
-import com.sckw.system.api.model.dto.req.UserLoginReqDto;
+import com.sckw.system.api.model.dto.req.*;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.system.dao.KwsEnterpriseDao;
 import com.sckw.system.dao.KwsUserLoginDao;
@@ -184,9 +181,9 @@ public class RemoteUserServiceImpl implements RemoteUserService {
      * @date: 2023/9/1
      */
     @Override
-    public PageResult queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList, Integer page, Integer pageSize) {
-        PageHelper.startPage(page, pageSize);
-        List<KwsEnterprise> list = remoteBaseService.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList);
+    public PageResult queryEntInfoByCityCodeAndEntTypesWithPage(QueryEntInfoByCityCodeAndEntTypesWithPageReqDto reqDto) {
+        PageHelper.startPage(reqDto.getPage(), reqDto.getPageSize());
+        List<KwsEnterprise> list = remoteBaseService.queryEntInfoByCityCodeAndEntTypesWithPage(reqDto.getCityCode(), reqDto.getEntTypeList(), reqDto.getEntIdList(), reqDto.getEntName());
         return PageHelperUtil.getPageResult(new PageInfo<>(list));
     }
 

+ 0 - 31
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/QueryMappingResVo.java

@@ -16,45 +16,14 @@ public class QueryMappingResVo implements Serializable {
     @Serial
     private static final long serialVersionUID = -5437311334622661332L;
 
-    /**
-     * 主键id
-     */
-    private Long id;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
     /**
      * 菜单名
      */
     private String name;
 
-    /**
-     * 功能编码
-     */
-    private String perms;
-
-    /**
-     * 菜单类型  类型:1菜单/2按钮
-     */
-    private Integer type;
-
-    /**
-     * 排序码
-     */
-    private Integer sort;
-
-    /**
-     * 菜单id
-     */
-    private Long menuId;
-
     /**
      * 关联的菜单id
      */
     private Long mappingMenuId;
 
-
 }

+ 3 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -996,6 +996,7 @@ public class KwsEnterpriseService {
             return null;
         }
         EntCacheResDto entCacheResDto = new EntCacheResDto();
+        BeanUtils.copyProperties(enterprise, entCacheResDto);
         entCacheResDto.setId(enterprise.getId());
         entCacheResDto.setFirmName(enterprise.getFirmName());
         entCacheResDto.setApproval(enterprise.getApproval());
@@ -1051,7 +1052,7 @@ public class KwsEnterpriseService {
      * @author: czh
      * @date: 2023/9/1
      */
-    public List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList) {
-        return kwsEnterpriseDao.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList);
+    public List<KwsEnterprise> queryEntInfoByCityCodeAndEntTypesWithPage(Integer cityCode, List<Integer> entTypeList, List<Long> entIdList, String entName) {
+        return kwsEnterpriseDao.queryEntInfoByCityCodeAndEntTypesWithPage(cityCode, entTypeList, entIdList, entName);
     }
 }

+ 37 - 37
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

@@ -3,11 +3,13 @@ package com.sckw.system.service;
 import java.util.Date;
 
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.MenuTypeEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.utils.BeanUtils;
@@ -26,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 菜单service接口
+ *
  * @author zk
  * @date 2023-05-31
  */
@@ -262,27 +265,29 @@ public class KwsMenuService {
 
         List<KwsMenuResVo> menuList = kwsMenuDao.findList(findMenuTreePojo);
         List<KwsMenuResVo> finalList = new ArrayList<>();
-        finalList = menuList;
         //app菜单特殊处理
-//        if (SystemTypeEnum.COMPANY.getCode().equals(LoginUserHolder.getSystemType()) && ClientTypeEnum.app.getValue().equals(LoginUserHolder.getClientType())) {
-//            for (KwsMenuResVo kwsMenuResVo : menuList) {
-//                List<KwsMenuMapping> kwsMenuMappings = kwsMenuMappingDao.selectByMenuId(kwsMenuResVo.getId());
-//                if (CollectionUtils.isEmpty(kwsMenuMappings)) {
-//                    continue;
-//                }
-//
-//                List<Long> mapIds = kwsMenuMappings.stream().map(KwsMenuMapping::getMappingId).toList();
-//                List<KwsMenu> kwsMenus = kwsMenuDao.selectByKeys(mapIds);
-//                if (CollectionUtils.isEmpty(kwsMenus)) {
-//                    continue;
-//                }
-//
-//                List<KwsMenuResVo> kwsMenuResVos = BeanUtils.copyToList(kwsMenus, KwsMenuResVo.class);
-//                finalList.addAll(kwsMenuResVos);
-//            }
-//        } else {
-//            finalList = menuList;
-//        }
+        if (SystemTypeEnum.COMPANY.getCode().equals(LoginUserHolder.getSystemType()) &&
+                ClientTypeEnum.app.getValue().equals(LoginUserHolder.getClientType()) &&
+                Objects.equals(LoginUserHolder.getIsMain(), Global.NO) &&
+                Objects.equals(LoginUserHolder.getEntId(), 156382319450525696L)) {
+            for (KwsMenuResVo kwsMenuResVo : menuList) {
+                List<KwsMenuMapping> kwsMenuMappings = kwsMenuMappingDao.selectByMenuId(kwsMenuResVo.getId());
+                if (CollectionUtils.isEmpty(kwsMenuMappings)) {
+                    continue;
+                }
+
+                List<Long> mapIds = kwsMenuMappings.stream().map(KwsMenuMapping::getMappingId).toList();
+                List<KwsMenu> kwsMenus = kwsMenuDao.selectByKeys(mapIds);
+                if (CollectionUtils.isEmpty(kwsMenus)) {
+                    continue;
+                }
+
+                List<KwsMenuResVo> kwsMenuResVos = BeanUtils.copyToList(kwsMenus, KwsMenuResVo.class);
+                finalList.addAll(kwsMenuResVos);
+            }
+        } else {
+            finalList = menuList;
+        }
 
         List<KwsMenuResVo> rootList = new ArrayList<>();
 
@@ -489,7 +494,7 @@ public class KwsMenuService {
 
 
     /**
-     * @param  id 菜单id
+     * @param id 菜单id
      * @return HttpResult
      * @desc: 根据菜单查映射关系
      * @author: czh
@@ -501,27 +506,22 @@ public class KwsMenuService {
             return Collections.emptyList();
         }
 
-
         List<KwsMenu> kwsMenus = kwsMenuDao.selectByKeys(kwsMenuMappings.stream().map(KwsMenuMapping::getMappingId).toList());
-        Map<Long, List<KwsMenu>> collect = kwsMenus.stream().collect(Collectors.groupingBy(KwsMenu::getParentId));
+        if (CollectionUtils.isEmpty(kwsMenus)) {
+            return Collections.emptyList();
+        }
+
+        Map<Long, KwsMenu> collect = kwsMenus.stream().collect(Collectors.toMap(KwsMenu::getId, Function.identity(), (oldValue, newValue) -> newValue));
 
         List<QueryMappingResVo> list = new ArrayList<>();
         for (KwsMenuMapping kwsMenuMapping : kwsMenuMappings) {
-            KwsMenu kwsMenu = kwsMenuDao.selectByKey(kwsMenuMapping.getMappingId());
-            if (Objects.nonNull(kwsMenu)) {
-                QueryMappingResVo queryMappingResVo = new QueryMappingResVo();
-                queryMappingResVo.setId(kwsMenuMapping.getId());
-                queryMappingResVo.setRemark(kwsMenu.getRemark());
-                queryMappingResVo.setName(kwsMenu.getName());
-                queryMappingResVo.setPerms(kwsMenu.getPerms());
-                queryMappingResVo.setType(kwsMenu.getType());
-                queryMappingResVo.setSort(kwsMenu.getSort());
-                queryMappingResVo.setMenuId(kwsMenuMapping.getMenuId());
-                queryMappingResVo.setMappingMenuId(kwsMenuMapping.getMappingId());
-                list.add(queryMappingResVo);
-            }
+            KwsMenu kwsMenus1 = collect.get(kwsMenuMapping.getMappingId());
+            QueryMappingResVo queryMappingResVo = new QueryMappingResVo();
+            queryMappingResVo.setName(kwsMenus1.getName());
+            queryMappingResVo.setMappingMenuId(kwsMenuMapping.getMappingId());
+            list.add(queryMappingResVo);
         }
-
         return list;
     }
+
 }

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

@@ -304,6 +304,9 @@
             #{item}
           </foreach>
         </if>
+        <if test="entName != null and entName != ''">
+          and a.firm_name like concat('%', #{entName}, '%')
+        </if>
         and exists (select 1
                       from kws_ent_type k
                      where a.id = k.ent_id