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

Merge remote-tracking branch 'origin/dev' into dev

lengfaqiang 2 лет назад
Родитель
Сommit
b7fba65567
33 измененных файлов с 844 добавлено и 176 удалено
  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. 14 14
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  10. 7 9
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java
  11. 14 24
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  12. 11 16
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java
  13. 14 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java
  14. 14 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java
  15. 54 6
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  16. 4 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java
  17. 80 13
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  18. 94 6
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml
  19. 97 1
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml
  20. 10 0
      sckw-modules/sckw-report/pom.xml
  21. 33 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwWorkController.java
  22. 11 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/KwfCapacityVo.java
  23. 2 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwFleetService.java
  24. 175 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwWorkService.java
  25. 29 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/vo/QueryBusinessStatisticsResVo.java
  26. 4 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java
  27. 2 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  28. 3 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  29. 4 7
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java
  30. 0 31
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/QueryMappingResVo.java
  31. 3 2
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  32. 37 37
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java
  33. 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>

+ 14 - 14
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java

@@ -86,7 +86,7 @@ public class KwfDriverController {
      * @date 2023/7/6
      **/
     @PostMapping("/statistics")
-    public HttpResult statistics(@RequestBody HashMap params) throws SystemException {
+    public HttpResult statistics(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         Map countMaps = driverService.statistics(params);
         return HttpResult.ok(countMaps);
@@ -99,7 +99,7 @@ public class KwfDriverController {
      * @date 2023/7/6
      **/
     @PostMapping("/select")
-    public HttpResult findPage(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findPage(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         // 设置分页参数
         PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
@@ -115,19 +115,19 @@ public class KwfDriverController {
      * @date 2023/7/6
      **/
     @PostMapping("/findList")
-    public HttpResult findList(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findList(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         return HttpResult.ok(driverService.findList(params));
     }
 
     /**
      * @param params 查询参数
-     * @description 导出
+     * @desc 导出
      * @author zk
      * @date 2023/07/11
      **/
     @PostMapping("/export")
-    public HttpResult export(@RequestBody HashMap params) {
+    public HttpResult export(@RequestBody Map<String, Object> params) {
         params.put("entId", LoginUserHolder.getEntId());
         /**分页数据**/
         List<KwfDriverVo> drivers = driverService.findPage(params);
@@ -142,7 +142,7 @@ public class KwfDriverController {
 
     /**
      * @param file 导入文件
-     * @description 导入
+     * @desc 导入
      * @author zk
      * @date 2023/07/11
      **/
@@ -165,7 +165,7 @@ public class KwfDriverController {
 
     /**
      * @param params {}
-     * @description 更新
+     * @desc 更新
      * @author zk
      * @date 2023/5/30
      **/
@@ -176,7 +176,7 @@ public class KwfDriverController {
 
     /**
      * @param {ids:主键ID(多个以逗号隔开)}
-     * @description 删除
+     * @desc 删除
      * @author zk
      * @date 2023/7/7
      **/
@@ -187,7 +187,7 @@ public class KwfDriverController {
 
     /**
      * @param params {}
-     * @description 司机身份证信息编辑
+     * @desc 司机身份证信息编辑
      * @author zk
      * @date 2023/7/7
      **/
@@ -198,7 +198,7 @@ public class KwfDriverController {
 
     /**
      * @param params {}
-     * @description 司机驾驶证信息编辑
+     * @desc 司机驾驶证信息编辑
      * @author zk
      * @date 2023/7/7
      **/
@@ -209,7 +209,7 @@ public class KwfDriverController {
 
     /**
      * @param params {}
-     * @description 司机从业资格证信息编辑
+     * @desc 司机从业资格证信息编辑
      * @author zk
      * @date 2023/7/7
      **/
@@ -220,7 +220,7 @@ public class KwfDriverController {
 
     /**
      * @param {password 旧密码、newPassword 新密码、account 账号}
-     * @description 修改密码
+     * @desc 修改密码
      * @author zk
      * @date 2023/07/11
      **/
@@ -231,7 +231,7 @@ public class KwfDriverController {
 
     /**
      * @param {driverId 司机主键id/登陆后缓存中取、phone 手机号、captcha 短信验证码}
-     * @description 更换手机号
+     * @desc 更换手机号
      * @author zk
      * @date 2023/07/11
      **/
@@ -242,7 +242,7 @@ public class KwfDriverController {
 
     /**
      * @param {account 账号、password 密码、captcha 验证码}
-     * @description 忘记密码
+     * @desc 忘记密码
      * @author zk
      * @date 2023/08/15
      **/

+ 7 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfFleetController.java

@@ -9,7 +9,6 @@ import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
-import com.sckw.fleet.model.KwfFleet;
 import com.sckw.fleet.model.dto.KwfFleetDto;
 import com.sckw.fleet.model.vo.KwfFleetVo;
 import com.sckw.fleet.service.KwfFleetService;
@@ -18,7 +17,6 @@ import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -52,7 +50,7 @@ public class KwfFleetController {
      * @date 2023/7/6
      **/
     @PostMapping("/select")
-    public HttpResult findPage(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findPage(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         // 设置分页参数
         PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
@@ -68,19 +66,19 @@ public class KwfFleetController {
      * @date 2023/7/6
      **/
     @PostMapping("/findList")
-    public HttpResult findList(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findList(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         return HttpResult.ok(fleetService.findList(params));
     }
 
     /**
      * @param params 查询参数
-     * @description 导出
+     * @desc 导出
      * @author zk
      * @date 2023/07/11
      **/
     @PostMapping("/export")
-    public HttpResult export(@RequestBody HashMap params) {
+    public HttpResult export(@RequestBody Map<String, Object> params) {
         params.put("entId", LoginUserHolder.getEntId());
         /**查询分页数据**/
         List<KwfFleetVo> fleets = fleetService.findPage(params);
@@ -107,7 +105,7 @@ public class KwfFleetController {
 
     /**
      * @param params {}
-     * @description 更新
+     * @desc 更新
      * @author zk
      * @date 2023/7/6
      **/
@@ -117,8 +115,8 @@ public class KwfFleetController {
     }
 
     /**
-     * @param {ids:主键ID(多个以逗号隔开)}
-     * @description 删除
+     * @param ids {ids:主键ID(多个以逗号隔开)}
+     * @desc 删除
      * @author zk
      * @date 2023/7/6
      **/

+ 14 - 24
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -5,23 +5,16 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
-import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
-import com.sckw.core.utils.DateUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
-import com.sckw.fleet.model.KwfFleet;
-import com.sckw.fleet.model.KwfTransportLicense;
-import com.sckw.fleet.model.KwfTruck;
-import com.sckw.fleet.model.KwfTruckLicense;
 import com.sckw.fleet.model.dto.GpsByTruckNoDto;
 import com.sckw.fleet.model.dto.KwfTransportLicenseDto;
 import com.sckw.fleet.model.dto.KwfTruckDto;
@@ -29,15 +22,12 @@ import com.sckw.fleet.model.dto.KwfTruckLicenseDto;
 import com.sckw.fleet.model.vo.*;
 import com.sckw.fleet.service.KwfTruckService;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.model.dto.res.SysDictResDto;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
-import jakarta.validation.constraints.NotBlank;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -107,7 +97,7 @@ public class KwfTruckController {
      * @date 2023/7/6
      **/
     @PostMapping("/statistics")
-    public HttpResult statistics(@RequestBody HashMap params) throws SystemException {
+    public HttpResult statistics(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         Map countMaps = truckService.statistics(params);
         return HttpResult.ok(countMaps);
@@ -120,11 +110,11 @@ public class KwfTruckController {
      * @date 2023/7/6
      **/
     @PostMapping("/select")
-    public HttpResult findPage(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findPage(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         // 设置分页参数
         PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
-        List<KwfDriverVo> list = truckService.findPage(params);
+        List<KwfTruckVo> list = truckService.findPage(params);
         PageResult pageResult = PageHelperUtil.getPageResult(new PageInfo<>(list));
         return HttpResult.ok(pageResult);
     }
@@ -136,19 +126,19 @@ public class KwfTruckController {
      * @date 2023/7/6
      **/
     @PostMapping("/findList")
-    public HttpResult findList(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findList(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         return HttpResult.ok(truckService.findList(params));
     }
 
     /**
      * @param params 查询参数
-     * @description 导出
+     * @desc 导出
      * @author zk
      * @date 2023/07/11
      **/
     @PostMapping("/export")
-    public HttpResult export(@RequestBody HashMap params) {
+    public HttpResult export(@RequestBody Map<String, Object> params) {
         params.put("entId", LoginUserHolder.getEntId());
         /**查询数据**/
         List<KwfTruckVo> trucks = truckService.findPage(params);
@@ -163,7 +153,7 @@ public class KwfTruckController {
 
     /**
      * @param file 导入文件
-     * @description 导入
+     * @desc 导入
      * @author zk
      * @date 2023/07/11
      **/
@@ -186,7 +176,7 @@ public class KwfTruckController {
 
     /**
      * @param params {}
-     * @description 更新
+     * @desc 更新
      * @author zk
      * @date 2023/5/30
      **/
@@ -197,7 +187,7 @@ public class KwfTruckController {
 
     /**
      * @param {ids:主键ID(多个以逗号隔开)}
-     * @description 删除
+     * @desc 删除
      * @author zk
      * @date 2023/7/7
      **/
@@ -208,7 +198,7 @@ public class KwfTruckController {
 
     /**
      * @param params {}
-     * @description 车辆行驶证信息编辑
+     * @desc 车辆行驶证信息编辑
      * @author zk
      * @date 2023/7/7
      **/
@@ -219,7 +209,7 @@ public class KwfTruckController {
 
     /**
      * @param params {}
-     * @description 车辆道路运输许可证编辑
+     * @desc 车辆道路运输许可证编辑
      * @author zk
      * @date 2023/7/7
      **/
@@ -241,7 +231,7 @@ public class KwfTruckController {
 
     /**
      * @param truckNos 車牌號集
-     * @description 车辆查询GPS(业务关联 + 归属车辆)
+     * @desc 车辆查询GPS(业务关联 + 归属车辆)
      * @author zk
      * @date 2023/7/26
      **/
@@ -256,7 +246,7 @@ public class KwfTruckController {
 
     /**
      * @param params {truckNos 車牌號集, startTime 開始實際, endTime 結束時間}
-     * @description 车辆查询GPS(通过车牌号查询)
+     * @desc 车辆查询GPS(通过车牌号查询)
      * @author zk
      * @date 2023/7/26
      **/
@@ -297,7 +287,7 @@ public class KwfTruckController {
     }
 
     /**
-     * @description 获取JSON文件数据(暂时使用)
+     * @desc 获取JSON文件数据(暂时使用)
      * @author zk
      * @date 2023/8/2
      **/

+ 11 - 16
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckReportController.java

@@ -11,7 +11,6 @@ import com.sckw.excel.easyexcel.RequestHolder;
 import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.fleet.model.KwfTruckReport;
 import com.sckw.fleet.model.dto.KwfChangeFleetDto;
-import com.sckw.fleet.model.dto.KwfTruckDto;
 import com.sckw.fleet.model.dto.KwfTruckReportDto;
 import com.sckw.fleet.model.vo.KwfTruckReportVo;
 import com.sckw.fleet.service.KwfTruckReportService;
@@ -21,8 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -45,7 +42,7 @@ public class KwfTruckReportController {
      * @date 2023/7/18
      **/
     @PostMapping("/statistics")
-    public HttpResult statistics(@RequestBody HashMap params) throws SystemException {
+    public HttpResult statistics(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         Map countMaps = reportService.statistics(params);
         return HttpResult.ok(countMaps);
@@ -58,7 +55,7 @@ public class KwfTruckReportController {
      * @date 2023/7/18
      **/
     @PostMapping("/select")
-    public HttpResult findPage(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findPage(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         // 设置分页参数
         PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
@@ -69,12 +66,12 @@ public class KwfTruckReportController {
 
     /**
      * @param params 查询参数
-     * @description 导出
+     * @desc 导出
      * @author zk
      * @date 2023/07/18
      **/
     @PostMapping("/export")
-    public HttpResult export(@RequestBody HashMap params) {
+    public HttpResult export(@RequestBody Map<String, Object> params) {
         params.put("entId", LoginUserHolder.getEntId());
         /**查询数据**/
         List<KwfTruckReportVo> trucks = reportService.findPage(params);
@@ -94,7 +91,7 @@ public class KwfTruckReportController {
      * @date 2023/7/6
      **/
     @PostMapping("/findList")
-    public HttpResult findList(@RequestBody HashMap params) throws SystemException {
+    public HttpResult findList(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         return HttpResult.ok(reportService.findList(params));
     }
@@ -106,14 +103,14 @@ public class KwfTruckReportController {
      * @date 2023/7/6
      **/
     @PostMapping("/busStatusStatistics")
-    public HttpResult busStatusStatistics(@RequestBody HashMap params) throws SystemException {
+    public HttpResult busStatusStatistics(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         return HttpResult.ok(reportService.busStatusStatistics(params));
     }
 
     /**
      * @param file 导入文件
-     * @description 导入
+     * @desc 导入
      * @author zk
      * @date 2023/07/18
      **/
@@ -136,7 +133,7 @@ public class KwfTruckReportController {
 
     /**
      * @param params {}
-     * @description 更新
+     * @desc 更新
      * @author zk
      * @date 2023/7/18
      **/
@@ -147,7 +144,7 @@ public class KwfTruckReportController {
 
     /**
      * @param {ids:主键ID(多个以逗号隔开)}
-     * @description 删除
+     * @desc 删除
      * @author zk
      * @date 2023/7/18
      **/
@@ -158,7 +155,7 @@ public class KwfTruckReportController {
 
     /**
      * @param params {}
-     * @description 车队变更
+     * @desc 车队变更
      * @author zk
      * @date 2023/7/18
      **/
@@ -169,7 +166,7 @@ public class KwfTruckReportController {
 
     /**
      * @param params {}
-     * @description 校验识别
+     * @desc 校验识别
      * @author zk
      * @date 2023/7/18
      **/
@@ -177,6 +174,4 @@ public class KwfTruckReportController {
     public HttpResult checkReports(@Valid @RequestBody List<String> params) throws SystemException {
         return reportService.checkReports(params);
     }
-
-
 }

+ 14 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfDriverMapper.java

@@ -20,6 +20,13 @@ import java.util.Map;
 @Mapper
 public interface KwfDriverMapper extends BaseMapper<KwfDriver> {
 
+    /**
+     * 统计
+     * @param params
+     * @return
+     */
+    List<KwfTableTopCount> statisticsAll(Map<String, Object> params);
+
     /**
      * 统计
      * @param params
@@ -27,6 +34,13 @@ public interface KwfDriverMapper extends BaseMapper<KwfDriver> {
      */
     List<KwfTableTopCount> statistics(Map<String, Object> params);
 
+    /**
+     * 分页查询
+     * @param params
+     * @return
+     */
+    List<KwfDriverVo> findPageAll(Map<String, Object> params);
+
     /**
      * 分页查询
      * @param params

+ 14 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dao/KwfTruckMapper.java

@@ -20,6 +20,13 @@ import java.util.Map;
 @Mapper
 public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
 
+    /**
+     * 统计
+     * @param params
+     * @return
+     */
+    List<KwfTableTopCount> statisticsAll(Map<String, Object> params);
+
     /**
      * 统计
      * @param params
@@ -27,6 +34,13 @@ public interface KwfTruckMapper extends BaseMapper<KwfTruck> {
      */
     List<KwfTableTopCount> statistics(Map<String, Object> params);
 
+    /**
+     * 分页查询
+     * @param params
+     * @return
+     */
+    List<KwfTruckVo> findPageAll(Map<String, Object> params);
+
     /**
      * 分页查询
      * @param params

+ 54 - 6
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -149,7 +149,7 @@ public class KwfDriverService {
      **/
     public Map statistics(Map<String, Object> params) {
         /**统计数据**/
-        List<KwfTableTopCount> counts = driverDao.statistics(params);
+        List<KwfTableTopCount> counts = this.statisticsHandle(params);
         long tatol = 0;
         for (KwfTableTopCount topCount:counts) {
             tatol += topCount.getTotal();
@@ -166,7 +166,6 @@ public class KwfDriverService {
         /**数据处理**/
         Map<String, Integer> authStatusMap = new HashMap(){{put("正常", 1); put("临时", 2); put("异常", 3);}};
         for(Map.Entry<String, Integer> entry:authStatusMap.entrySet()){
-            System.out.println(entry.getKey()+"--->"+entry.getValue());
             KwfTableTopCount count = new KwfTableTopCount();
             for (KwfTableTopCount topCount:counts) {
                 if (Integer.parseInt(topCount.getValue()) == entry.getValue()) {
@@ -185,6 +184,24 @@ public class KwfDriverService {
         return tableCount;
     }
 
+    /**
+     * @param params 参数
+     * @desc 统计
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public List<KwfTableTopCount> statisticsHandle(Map<String, Object> params) {
+        int systemType = LoginUserHolder.getSystemType();
+        /**统计数据**/
+        if (systemType == SystemTypeEnum.MANAGE.getCode()) {
+            List<KwfTableTopCount> counts = driverDao.statisticsAll(params);
+            return counts;
+        } else {
+            List<KwfTableTopCount> counts = driverDao.statistics(params);
+            return counts;
+        }
+    }
+
     /**
      * @param params 分页参数
      * @desc 分页查询
@@ -193,7 +210,7 @@ public class KwfDriverService {
      **/
     public List<KwfDriverVo> findPage(Map<String, Object> params) {
         /**查询分页数据**/
-        List<KwfDriverVo> drivers = driverDao.findPage(params);
+        List<KwfDriverVo> drivers = this.findPageHandle(params);
         if (CollectionUtils.isEmpty(drivers)) {
             return drivers;
         }
@@ -205,7 +222,7 @@ public class KwfDriverService {
         for (KwfDriverVo driver:drivers) {
             createBys.add(Long.parseLong(driver.getCreateBy()));
             entIds.add(Long.parseLong(driver.getEntId()));
-            dictKey.add(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + driver.getLicenseType());
+            dictKey.add(StringUtils.isNotBlank(driver.getLicenseType()) ? DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + driver.getLicenseType() : null);
         }
         //用户数据集
         createBys = createBys.stream().distinct().collect(Collectors.toList());
@@ -214,8 +231,7 @@ public class KwfDriverService {
         entIds = entIds.stream().distinct().collect(Collectors.toList());
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
         //数据字典
-        dictKey = dictKey.stream().distinct().collect(Collectors.toList());
-        Map<String, SysDictResDto> dicts = !CollectionUtils.isEmpty(dictKey) ? remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey)) : null;
+        Map<String, SysDictResDto> dicts = this.dict(dictKey);
 
         /**数据组装**/
         for (KwfDriverVo driver:drivers) {
@@ -229,6 +245,24 @@ public class KwfDriverService {
         return drivers;
     }
 
+    /**
+     * @param params 分页参数
+     * @desc 分页查询
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public List<KwfDriverVo> findPageHandle(Map<String, Object> params) {
+        int systemType = LoginUserHolder.getSystemType();
+        /**统计数据**/
+        if (systemType == SystemTypeEnum.MANAGE.getCode()) {
+            List<KwfDriverVo> drivers = driverDao.findPageAll(params);
+            return drivers;
+        } else {
+            List<KwfDriverVo> drivers = driverDao.findPage(params);
+            return drivers;
+        }
+    }
+
     /**
      * @param params 查询参数
      * @desc 查询
@@ -824,6 +858,20 @@ public class KwfDriverService {
         return dict != null ? dict.getLabel() : null;
     }
 
+    /**
+     * @param dictKey 字典值
+     * @desc 获取数据字典
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public Map<String, SysDictResDto> dict(List<String> dictKey) {
+        if (CollectionUtils.isEmpty(dictKey)) {
+            return Collections.emptyMap();
+        }
+        dictKey = dictKey.stream().distinct().collect(Collectors.toList());
+        return remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
+    }
+
     /**
      * @param params 参数
      * @desc 校验司机是否有证书

+ 4 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -175,7 +175,7 @@ public class KwfTruckReportService {
      * @author zk
      * @date 2023/7/6
      **/
-    public HttpResult findList(HashMap params) throws SystemException {
+    public HttpResult findList(Map<String, Object> params) throws SystemException {
         return HttpResult.ok(truckReportDao.findList(params));
     }
 
@@ -185,7 +185,7 @@ public class KwfTruckReportService {
      * @author zk
      * @date 2023/7/6
      **/
-    public HttpResult busStatusStatistics(@RequestBody HashMap params) throws SystemException {
+    public HttpResult busStatusStatistics(@RequestBody Map<String, Object> params) throws SystemException {
         params.put("entId", LoginUserHolder.getEntId());
         List<Map<String, Object>> trucks = truckReportDao.findList(params);
         /**全部数据-处理**/
@@ -207,7 +207,7 @@ public class KwfTruckReportService {
 
     /**
      * @param {}
-     * @description 导出
+     * @desc 导出
      * @author zk
      * @date 2023/07/11
      **/
@@ -522,7 +522,7 @@ public class KwfTruckReportService {
         List<KwfTruckReportDto> effective = new ArrayList();
         //已有运力/识别失败
         int haveCount = Global.NUMERICAL_ZERO, errorCount = Global.NUMERICAL_ZERO,
-            rowIndex = Global.NUMERICAL_ZERO, repeatCount = Global.NUMERICAL_ZERO;
+                rowIndex = Global.NUMERICAL_ZERO, repeatCount = Global.NUMERICAL_ZERO;
         List<String> errorMsg = new ArrayList<>();
         List<String> haveMsg = new ArrayList<>();
         List<String> repeatMsg = new ArrayList<>();

+ 80 - 13
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -106,9 +106,8 @@ public class KwfTruckService {
             truckDetailVo.setTransportLicense(transportLicenseVo);
 
             //字典
-            Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
-            SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
-            truckDetailVo.setColorName(color != null ? color.getLabel() : null);
+            String value = getDictValue(DictTypeEnum.COLOR_TYPE.getType(), StringUtils.objectStr(truck.getColor()));
+            truckDetailVo.setColorName(value);
 
             //车队班组
             KwfFleet fleet = this.findByFleetTruck(truckId, LoginUserHolder.getEntId());
@@ -162,6 +161,24 @@ public class KwfTruckService {
         return tableCount;
     }
 
+    /**
+     * @param params 参数
+     * @desc 统计
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public List<KwfTableTopCount> statisticsHandle(Map<String, Object> params) {
+        int systemType = LoginUserHolder.getSystemType();
+        /**统计数据**/
+        if (systemType == SystemTypeEnum.MANAGE.getCode()) {
+            List<KwfTableTopCount> counts = truckDao.statisticsAll(params);
+            return counts;
+        } else {
+            List<KwfTableTopCount> counts = truckDao.statistics(params);
+            return counts;
+        }
+    }
+
     /**
      * @param params 分页参数
      * @desc 分页查询
@@ -184,10 +201,10 @@ public class KwfTruckService {
         for (KwfTruckVo truck:trucks) {
             createBys.add(Long.parseLong(truck.getCreateBy()));
             entIds.add(Long.parseLong(truck.getEntId()));
-            dictKey.add(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            dictKey.add(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
-            dictKey.add(DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
-            dictKey.add(DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
+            dictKey.add(truck.getColor() != null ? DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor() : null);
+            dictKey.add(truck.getColor() != null ? DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType() : null);
+            dictKey.add(truck.getColor() != null ? DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType() : null);
+            dictKey.add(truck.getColor() != null ? DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType() : null);
         }
         //用户数据集
         createBys = createBys.stream().distinct().collect(Collectors.toList());
@@ -196,17 +213,16 @@ public class KwfTruckService {
         entIds = entIds.stream().distinct().collect(Collectors.toList());
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
         //数据字典
-        dictKey = dictKey.stream().distinct().collect(Collectors.toList());
-        Map<String, SysDictResDto> dicts = CollectionUtils.isEmpty(dictKey) ? remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey)) : null;
+        Map<String, SysDictResDto> dicts = this.dict(dictKey);
 
         /**数据组装**/
         for (KwfTruckVo truck:trucks) {
             UserCacheResDto user = users == null ? null : users.get(Long.parseLong(truck.getCreateBy()));
             EntCacheResDto ent = ents == null ? null : ents.get(Long.parseLong(truck.getEntId()));
-            SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            SysDictResDto type = dicts == null ? null : dicts.get(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
-            SysDictResDto useType = dicts == null ? null : dicts.get(DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
-            SysDictResDto energyType = dicts == null ? null : dicts.get(DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
+            SysDictResDto color = dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
+            SysDictResDto type = dicts.get(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
+            SysDictResDto useType = dicts.get(DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
+            SysDictResDto energyType = dicts.get(DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
             truck.setCreateByName(user != null ? user.getName() : null);
             truck.setFirmName(ent != null ? ent.getFirmName() : null);
             truck.setColorName(color != null ? color.getLabel() : null);
@@ -217,6 +233,24 @@ public class KwfTruckService {
         return trucks;
     }
 
+    /**
+     * @param params 分页参数
+     * @desc 分页查询
+     * @author zk
+     * @date 2023/7/6
+     **/
+    public List<KwfTruckVo> findPageHandle(Map<String, Object> params) {
+        int systemType = LoginUserHolder.getSystemType();
+        /**统计数据**/
+        if (systemType == SystemTypeEnum.MANAGE.getCode()) {
+            List<KwfTruckVo> counts = truckDao.findPageAll(params);
+            return counts;
+        } else {
+            List<KwfTruckVo> counts = truckDao.findPage(params);
+            return counts;
+        }
+    }
+
     /**
      * @param params 查询参数
      * @desc 查询
@@ -724,6 +758,39 @@ public class KwfTruckService {
         return detail;
     }
 
+    /**
+     * @param type 字典类型
+     * @param value 字典值
+     * @desc 获取数据字典值
+     * @author zk
+     * @date 2023/8/30
+     **/
+    public String getDictValue(String type, String value) {
+        if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
+            return null;
+        }
+        List<String> dictKey = new ArrayList<>(){{
+            add(type + Global.POUND + value);
+        }};
+        Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
+        SysDictResDto dict = dicts == null ? null : dicts.get(DictTypeEnum.APPROVED_DRIVING.getType() + Global.POUND + value);
+        return dict != null ? dict.getLabel() : null;
+    }
+
+    /**
+     * @param dictKey 字典值
+     * @desc 获取数据字典
+     * @author zk
+     * @date 2023/9/11
+     **/
+    public Map<String, SysDictResDto> dict(List<String> dictKey) {
+        if (CollectionUtils.isEmpty(dictKey)) {
+            return Collections.emptyMap();
+        }
+        dictKey = dictKey.stream().distinct().collect(Collectors.toList());
+        return remoteSystemService.queryDictMapByTypeValues(String.join(Global.COMMA, dictKey));
+    }
+
     /**
      * @param params 参数
      * @desc 校验车辆是否有证书

+ 94 - 6
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -2,6 +2,44 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.fleet.dao.KwfDriverMapper">
 
+    <select id="statisticsAll" resultType="com.sckw.fleet.model.vo.KwfTableTopCount" parameterType="java.util.Map" >
+        SELECT
+            dr.`auth_status` value, count(0) total
+        from kwf_driver dr
+        left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0
+        left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
+        left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
+        where dr.del_flag = 0
+        <if test="entId != null and entId != ''">
+            and dr.ent_id = #{entId, jdbcType=VARCHAR}
+        </if>
+        <if test="name != null and name != ''">
+            and dr.name = #{name, jdbcType=VARCHAR}
+        </if>
+        <if test="idcard != null and idcard != ''">
+            and dr.idcard = #{idcard, jdbcType=VARCHAR}
+        </if>
+        <if test="phone != null and phone != ''">
+            and dr.phone = #{phone, jdbcType=VARCHAR}
+        </if>
+        <if test="licenseType != null and licenseType != ''">
+            and drl.type = #{licenseType, jdbcType=VARCHAR}
+        </if>
+        <if test="startTime != null and startTime != '' " >
+            and DATE( dr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endTime != null and endTime != '' " >
+            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="keywords != null and keywords != ''">
+            and (
+            dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
+            )
+        </if>
+        GROUP BY dr.`auth_status`
+    </select>
+
     <select id="statistics" resultType="com.sckw.fleet.model.vo.KwfTableTopCount" parameterType="java.util.Map" >
         SELECT
         dr.`auth_status` value, count(0) total
@@ -10,8 +48,6 @@
         left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0
         left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
         left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
-        left join kwf_truck_report trr on trr.ent_id = dre.ent_id and trr.driver_id = dr.id
-        left join kwf_truck tr on tr.id = trr.truck_id
         left join kwf_fleet_driver flr on flr.driver_id = dr.id and flr.del_flag = 0
         left join kwf_fleet fl on fl.id = flr.fleet_id and fl.del_flag = 0
         where dr.del_flag = 0 and dre.del_flag = 0
@@ -51,20 +87,72 @@
         GROUP BY dr.`auth_status`
     </select>
 
+    <select id="findPageAll" resultType="com.sckw.fleet.model.vo.KwfDriverVo" parameterType="java.util.Map" >
+        SELECT
+        dr.id, dr.name, dr.phone, dr.idcard, dr.status, dr.auth_status authStatus, drc.expire_time idcardExpireTime,
+        drc.address, drl.driver_no driverNo, drl.type licenseType, drl.expire_time licenseExpireTime,
+        drl.grant_unit licenseGrantUnit,drq.quali_no qualiNo, dr.ent_id entId, dr.create_by createBy,
+        dr.create_time createTime,dr.update_time updateTime, dr.remark
+        from kwf_driver dr
+        left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0
+        left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
+        left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
+        where dr.del_flag = 0
+        <if test="entId != null and entId != ''">
+            and dr.ent_id = #{entId, jdbcType=VARCHAR}
+        </if>
+        <if test="name != null and name != ''">
+            and dr.name = #{name, jdbcType=VARCHAR}
+        </if>
+        <if test="idcard != null and idcard != ''">
+            and dr.idcard = #{idcard, jdbcType=VARCHAR}
+        </if>
+        <if test="phone != null and phone != ''">
+            and dr.phone = #{phone, jdbcType=VARCHAR}
+        </if>
+        <if test="licenseType != null and licenseType != ''">
+            and drl.type = #{licenseType, jdbcType=VARCHAR}
+        </if>
+        <if test="status != null and status != ''">
+            and dr.status = #{status, jdbcType=VARCHAR}
+        </if>
+        <if test="authStatus != null and status != ''">
+            and dr.auth_status = #{authStatus, jdbcType=VARCHAR}
+        </if>
+        <if test="startTime != null and startTime != '' " >
+            and DATE( dr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endTime != null and endTime != '' " >
+            and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        </if>
+        <choose>
+            <when test="ids != null and ids != '' ">
+                and dr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
+        <if test="keywords != null and keywords != ''">
+            and (
+            dr.name like concat('%',#{keywords},'%')
+            or dr.phone like concat('%',#{keywords},'%')
+            )
+        </if>
+        ORDER BY dr.create_time desc
+    </select>
+
     <select id="findPage" resultType="com.sckw.fleet.model.vo.KwfDriverVo" parameterType="java.util.Map" >
         SELECT
         dr.id, dr.name, dr.phone, dr.idcard, dr.status, dr.auth_status authStatus, drc.expire_time idcardExpireTime,
         drc.address, drl.driver_no driverNo, drl.type licenseType, drl.expire_time licenseExpireTime,
         drl.grant_unit licenseGrantUnit,drq.quali_no qualiNo, dr.ent_id entId, dr.create_by createBy,
-        dr.create_time createTime,dr.update_time updateTime, dr.remark, tr.truck_no truckNo, fl.id fleetId,
-        fl.name fleetName
+        dr.create_time createTime,dr.update_time updateTime, dr.remark, fl.id fleetId, fl.name fleetName
         from kwf_driver dr
         left join kwf_driver_ent dre on dre.driver_id = dr.id
         left join kwf_driver_card drc on drc.driver_id = dr.id and drc.del_flag = 0
         left join kwf_driver_license drl on drl.driver_id = dr.id and drl.del_flag = 0
         left join kwf_driver_qualification drq on drq.driver_id = dr.id and drq.del_flag = 0
-        left join kwf_truck_report trr on trr.ent_id = dre.ent_id and trr.driver_id = dr.id
-        left join kwf_truck tr on tr.id = trr.truck_id
         left join kwf_fleet_driver flr on flr.driver_id = dr.id and flr.del_flag = 0
         left join kwf_fleet fl on fl.id = flr.fleet_id and fl.del_flag = 0
         where dr.del_flag = 0 and dre.del_flag = 0

+ 97 - 1
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -2,10 +2,49 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.fleet.dao.KwfTruckMapper">
 
-    <select id="statistics" resultType="com.sckw.fleet.model.vo.KwfTableTopCount" parameterType="java.util.Map" >
+    <select id="statisticsAll" resultType="com.sckw.fleet.model.vo.KwfTableTopCount" parameterType="java.util.Map" >
         SELECT
             tr.`auth_status` value, count(0) total
         from kwf_truck tr
+        left join kwf_truck_license trl on trl.truck_id = tr.id and trl.del_flag = 0
+        left join kwf_transport_license tranl on tranl.truck_id = tr.id and tranl.del_flag = 0
+        where tr.del_flag = 0
+        <if test="entId != null and entId != ''">
+            and tr.ent_id = #{entId, jdbcType=VARCHAR}
+        </if>
+        <if test="truckNo != null and truckNo != ''">
+            and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
+        </if>
+        <if test="type != null and type != ''">
+            and tr.type = #{type, jdbcType=VARCHAR}
+        </if>
+        <if test="energyType != null and energyType != ''">
+            and tr.energy_type = #{energyType, jdbcType=VARCHAR}
+        </if>
+        <if test="useType != null and useType != ''">
+            and tr.use_type = #{useType, jdbcType=VARCHAR}
+        </if>
+        <if test="status != null and status != ''">
+            and tr.status = #{status, jdbcType=VARCHAR}
+        </if>
+        <if test="startTime != null and startTime != '' " >
+            and DATE( tr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endTime != null and endTime != '' " >
+            and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="keywords != null and keywords != ''">
+            and (
+            tr.truck_no like concat('%',#{keywords},'%')
+            )
+        </if>
+        GROUP BY tr.`auth_status`
+    </select>
+
+    <select id="statistics" resultType="com.sckw.fleet.model.vo.KwfTableTopCount" parameterType="java.util.Map" >
+        SELECT
+        tr.`auth_status` value, count(0) total
+        from kwf_truck tr
         left join kwf_truck_ent tre on tre.truck_id = tr.id
         left join kwf_truck_license trl on trl.truck_id = tr.id and trl.del_flag = 0
         left join kwf_transport_license tranl on tranl.truck_id = tr.id and tranl.del_flag = 0
@@ -50,6 +89,63 @@
         GROUP BY tr.`auth_status`
     </select>
 
+    <select id="findPageAll" resultType="com.sckw.fleet.model.vo.KwfTruckVo" parameterType="java.util.Map" >
+        SELECT
+            tr.id, tr.ent_id entId, tr.truck_no truckNo, tr.type, tr.energy_type energyType, tr.use_type useType,
+            tr.spec, tr.actual_weight actualWeight, tr.gross_weight grossWeight, tr.tare_weight tareWeight,
+            tr.color, tr.eev, tr.trailer_no trailerNo, tr.total_complete totalComplete, tr.total_take totalTake,
+            tr.total_weight totalWeight, tr.business_status businessStatus, tr.remark, tr.status, tr.auth_status authStatus,
+            tr.create_by createBy, tr.create_time createTime, tr.update_by updateBy, tr.update_time updateTime,
+            trl.owner, trl.vin, trl.reg_time regTime, trl.grant_time grantTime, trl.grant_unit grantUnit,
+            trl.driving_no drivingNo, tranl.road_tran_no roadTranNo, tranl.firm_name tranFirmName,
+            tranl.business_license_no businessLicenseNo
+        from kwf_truck tr
+        left join kwf_truck_license trl on trl.truck_id = tr.id and trl.del_flag = 0
+        left join kwf_transport_license tranl on tranl.truck_id = tr.id and tranl.del_flag = 0
+        where tr.del_flag = 0
+        <if test="entId != null and entId != ''">
+            and tr.ent_id = #{entId, jdbcType=VARCHAR}
+        </if>
+        <if test="truckNo != null and truckNo != ''">
+            and tr.truck_no = #{truckNo, jdbcType=VARCHAR}
+        </if>
+        <if test="truckType != null and truckType != ''">
+            and tr.type = #{type, jdbcType=VARCHAR}
+        </if>
+        <if test="energyType != null and energyType != ''">
+            and tr.energy_type = #{energyType, jdbcType=VARCHAR}
+        </if>
+        <if test="useType != null and useType != ''">
+            and tr.use_type = #{useType, jdbcType=VARCHAR}
+        </if>
+        <if test="status != null and status != ''">
+            and tr.status = #{status, jdbcType=VARCHAR}
+        </if>
+        <if test="authStatus != null and status != ''">
+            and tr.auth_status = #{authStatus, jdbcType=VARCHAR}
+        </if>
+        <if test="startTime != null and startTime != '' " >
+            and DATE( tr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}
+        </if>
+        <if test="endTime != null and endTime != '' " >
+            and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
+        </if>
+        <choose>
+            <when test="ids != null">
+                and tr.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
+        <if test="keywords != null and keywords != ''">
+            and (
+            tr.truck_no like concat('%',#{keywords},'%')
+            )
+        </if>
+        ORDER BY tr.create_time desc
+    </select>
+
     <select id="findPage" resultType="com.sckw.fleet.model.vo.KwfTruckVo" parameterType="java.util.Map" >
         SELECT
         tr.id, tr.ent_id entId, tr.truck_no truckNo, tr.type, tr.energy_type energyType, tr.use_type useType,

+ 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());
+    }
+
+}

+ 11 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/model/vo/KwfCapacityVo.java

@@ -58,4 +58,15 @@ public class KwfCapacityVo implements Serializable {
      * 企业详细地址
      */
     private String detailAddress;
+
+    /**
+     * 企业头像
+     */
+    private String head;
+
+    /**
+     * 资料审批状态(0未审批、1通过、2未通过、3审批中)
+     */
+    private Integer approval;
+
 }

+ 2 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwFleetService.java

@@ -66,6 +66,8 @@ public class KwFleetService {
             capacity.setCityCode(ent.getCityCode());
             capacity.setCityName(ent.getCityName());
             capacity.setDetailAddress(ent.getDetailAddress());
+            capacity.setApproval(ent.getApproval());
+            capacity.setHead(ent.getHead());
             list.add(capacity);
             entIds.add(ent.getId());
         }

+ 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);
     }
 
     /**

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

@@ -63,6 +63,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         for (String typeValue : typeValueArr) {
             if (StringUtils.isNotBlank(typeValue)) {
                 String[] split = typeValue.split(Global.POUND);
+                if (split == null || split.length < Global.NUMERICAL_TWO) {
+                    continue;
+                }
                 SysDictResDto sysDictResDto = queryDictByTypeAndValue(split[0], split[1]);
                 map.put(typeValue, sysDictResDto);
             }

+ 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