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

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

czh 2 лет назад
Родитель
Сommit
0b2e8a4b6e

+ 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,

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

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