zk 2 лет назад
Родитель
Сommit
0f331f9259
18 измененных файлов с 804 добавлено и 129 удалено
  1. 4 4
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java
  2. 0 2
      sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java
  3. 19 48
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverController.java
  4. 6 48
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java
  5. 33 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/ForgetPasswordDto.java
  6. 52 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverCardVo.java
  7. 106 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverDetailVo.java
  8. 57 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverLicenseVo.java
  9. 57 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverQualificationVo.java
  10. 68 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTransportLicenseVo.java
  11. 129 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckDetailVo.java
  12. 68 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckLicenseVo.java
  13. 20 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java
  14. 122 12
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  15. 55 4
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java
  16. 1 1
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTransportLicenseMapper.xml
  17. 1 1
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckLicenseMapper.xml
  18. 6 5
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

+ 4 - 4
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -115,14 +115,14 @@ public class AuthController {
         String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_LOGIN.getValue(), params.getAccount());
 
         RedissonUtils.putString(key, params.getCaptcha(), RedisConstant.SMS_VERIFY_CODE_VALID_TIME);
-        String captcha = RedissonUtils.getString(key);
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(captcha)) {
+        String smsCaptcha = RedissonUtils.getString(key);
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
             return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
         }
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(captcha)) {
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && StringUtils.isBlank(smsCaptcha)) {
             return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "验证码已过期,请重新获取!");
         }
-        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !captcha.equals(params.getCaptcha())) {
+        if (params.getLoginMethod() == LoginMethodEnum.SMS.getValue() && !smsCaptcha.equals(params.getCaptcha())) {
             return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不正确,请检查并重新输入!");
         }
 

+ 0 - 2
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -470,8 +470,6 @@ public class AuthServiceImpl implements IAuthService {
         return HttpResult.ok(loginRes);
     }
 
-
-
     static class AsyncProcess1 implements Runnable {
         private final LoginBase loginBase;
 

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

@@ -1,20 +1,18 @@
 package com.sckw.fleet.controller;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
 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.*;
 import com.sckw.fleet.model.dto.*;
-import com.sckw.fleet.model.vo.KwfDriverVo;
+import com.sckw.fleet.model.vo.*;
 import com.sckw.fleet.service.KwfDriverService;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
@@ -47,28 +45,8 @@ public class KwfDriverController {
     @GetMapping("/detail")
     public HttpResult selectByKey(Long id) throws SystemException {
         //司机信息
-        KwfDriver driver = driverService.selectByKey(id);
-        JSONObject driverJson = JSONObject.parseObject(JSON.toJSONString(driver));
-
-        //数据查询
-        if (driver != null) {
-            //身份证信息
-            KwfDriverCard cardJson = driverService.findCarByKey(driver.getId());
-            driverJson.put("driverCard", cardJson);
-
-            //司机驾驶证信息
-            KwfDriverLicense licenseJson = driverService.findLicenseByKey(driver.getId());
-            driverJson.put("driverLicense", licenseJson);
-
-            //司机从业资格证
-            KwfDriverQualification qualificationJson = driverService.findQualificationByKey(driver.getId());
-            driverJson.put("driverQualification", qualificationJson);
-        }
-        //车队班组
-        KwfFleet fleet = driverService.findByFleetDriver(id, LoginUserHolder.getEntId());
-        driverJson.put("fleetName", fleet != null ? fleet.getName() : null);
-        driverJson.put("fleetId", fleet != null ? fleet.getId() : null);
-        return HttpResult.ok(driverJson);
+        KwfDriverDetailVo driverDetailVo = driverService.detail(id);
+        return HttpResult.ok(driverDetailVo);
     }
 
     /**
@@ -97,28 +75,8 @@ public class KwfDriverController {
         }
 
         //司机信息
-        KwfDriver driver = driverService.selectByKey(id);
-        JSONObject driverJson = JSONObject.parseObject(JSON.toJSONString(driver));
-
-        //数据查询
-        if (driver != null) {
-            //身份证信息
-            KwfDriverCard cardJson = driverService.findCarByKey(driver.getId());
-            driverJson.put("driverCard", cardJson);
-
-            //司机驾驶证信息
-            KwfDriverLicense licenseJson = driverService.findLicenseByKey(driver.getId());
-            driverJson.put("driverLicense", licenseJson);
-
-            //司机从业资格证
-            KwfDriverQualification qualificationJson = driverService.findQualificationByKey(driver.getId());
-            driverJson.put("driverQualification", qualificationJson);
-        }
-        //车队班组
-        KwfFleet fleet = driverService.findByFleetDriver(id, LoginUserHolder.getEntId());
-        driverJson.put("fleetName", fleet != null ? fleet.getName() : null);
-        driverJson.put("fleetId", fleet != null ? fleet.getId() : null);
-        return HttpResult.ok(driverJson);
+        KwfDriverDetailVo driverDetailVo = driverService.detail(id);
+        return HttpResult.ok(driverDetailVo);
     }
 
     /**
@@ -279,4 +237,17 @@ public class KwfDriverController {
         return driverService.replacePhone(params);
     }
 
+    /**
+     * @param {account 账号、password 密码、captcha 验证码}
+     * @description 忘记密码
+     * @author zk
+     * @date 2023/08/15
+     **/
+    @PostMapping("/forgetPassword")
+    public HttpResult forgetPassword(@RequestHeader(name = "System-Type") int systemType,
+                                     @RequestHeader(name = "Client-Type") String clientType,
+                                     @RequestBody @Valid ForgetPasswordDto params) {
+        return driverService.forgetPassword(params);
+    }
+
 }

+ 6 - 48
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -10,6 +10,7 @@ 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;
@@ -25,8 +26,7 @@ import com.sckw.fleet.model.dto.GpsByTruckNoDto;
 import com.sckw.fleet.model.dto.KwfTransportLicenseDto;
 import com.sckw.fleet.model.dto.KwfTruckDto;
 import com.sckw.fleet.model.dto.KwfTruckLicenseDto;
-import com.sckw.fleet.model.vo.KwfDriverVo;
-import com.sckw.fleet.model.vo.KwfTruckVo;
+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;
@@ -66,29 +66,8 @@ public class KwfTruckController {
     @GetMapping("/detail")
     public HttpResult selectByKey(Long id) throws SystemException {
         //车辆信息
-        KwfTruck truck = truckService.selectByKey(id);
-        JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
-
-        //数据组装
-        if (truck != null) {
-            //车辆行驶证信息
-            KwfTruckLicense truckLicense = truckService.findTruckLicenseByKey(id);
-            truckJson.put("truckLicense", truckLicense);
-
-            //车辆道路运输许可证
-            KwfTransportLicense transportLicense = truckService.findTransportLicenseByKey(id);
-            truckJson.put("transportLicense", transportLicense);
-
-            //字典
-            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());
-            truckJson.put("colorName", color != null ? color.getLabel() : null);
-        }
-        //车队班组
-        KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
-        truckJson.put("fleetId", fleet != null ? fleet.getId() : null);
-        truckJson.put("fleetName", fleet != null ? fleet.getName() : null);
-        return HttpResult.ok(truckJson);
+        KwfTruckDetailVo truckDetailVo = truckService.detail(id);
+        return HttpResult.ok(truckDetailVo);
     }
 
     /**
@@ -112,29 +91,8 @@ public class KwfTruckController {
         }
 
         //车辆信息
-        KwfTruck truck = truckService.selectByKey(id);
-        JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
-
-        //数据组装
-        if (truck != null) {
-            //车辆行驶证信息
-            KwfTruckLicense truckLicense = truckService.findTruckLicenseByKey(id);
-            truckJson.put("truckLicense", truckLicense);
-
-            //车辆道路运输许可证
-            KwfTransportLicense transportLicense = truckService.findTransportLicenseByKey(id);
-            truckJson.put("transportLicense", transportLicense);
-
-            //字典
-            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());
-            truckJson.put("colorName", color != null ? color.getLabel() : null);
-        }
-        //车队班组
-        KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
-        truckJson.put("fleetId", fleet != null ? fleet.getId() : null);
-        truckJson.put("fleetName", fleet != null ? fleet.getName() : null);
-        return HttpResult.ok(truckJson);
+        KwfTruckDetailVo truckDetailVo = truckService.detail(id);
+        return HttpResult.ok(truckDetailVo);
     }
 
     /**

+ 33 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/dto/ForgetPasswordDto.java

@@ -0,0 +1,33 @@
+package com.sckw.fleet.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+import lombok.Data;
+
+/**
+ * @author zk
+ * @desc 忘记密码
+ * @date 2023/08/15
+ */
+@Data
+public class ForgetPasswordDto {
+
+    /**
+     * 账号
+     */
+    @NotBlank(message = "账号不能为空!")
+    @Pattern(regexp = "^1[3456789]\\d{9}$", message = "账号是您的手机号码,请确认再输入!")
+    private String account;
+
+    /**
+     * 旧密码
+     */
+    @NotBlank(message = "密码不能为空!")
+    private String password;
+
+    /**
+     * 旧密码
+     */
+    @NotBlank(message = "验证码不能为空!")
+    private String captcha;
+}

+ 52 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverCardVo.java

@@ -0,0 +1,52 @@
+package com.sckw.fleet.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 司机身份证信息
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfDriverCardVo implements Serializable{
+
+        /**
+     * 司机id
+     */
+    private Long driverId;
+
+    /**
+     * 身份证号
+     */
+    private String idcard;
+
+    /**
+     * 有效日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date expireTime;
+
+    /**
+     * 联系地址
+     */
+    private String address;
+
+    /**
+     * 证书正面URL地址
+     */
+    private String certificateMain;
+
+    /**
+     * 证书反面URL地址
+     */
+    private String certificateRevolt;
+
+    /**
+     * 车辆状态(0未认证、1已认证)
+     */
+    private Integer status;
+
+}

+ 106 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverDetailVo.java

@@ -0,0 +1,106 @@
+package com.sckw.fleet.model.vo;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @desc 司机
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfDriverDetailVo implements Serializable {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 司机姓名
+     */
+    private String name;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 盐
+     */
+    private String salt;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 身份证号
+     */
+    private String idcard;
+
+    /**
+     * 车辆状态(0正常、1锁定)
+     */
+    private Integer status;
+
+    /**
+     * 车辆业务状态(0空闲、1任务)
+     */
+    private Integer businessStatus;
+
+    /**
+     * 认证状态(1认证、2临时、3异常)
+     */
+    private Integer authStatus;
+
+    /**
+     * 车队名称
+     */
+    private String remark;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 车队ID
+     */
+    private Long fleetId;
+
+    /**
+     * 车队名称
+     */
+    private String fleetName;
+
+    /**
+     * 身份证信息
+     */
+    KwfDriverCardVo driverCard;
+
+    /**
+     * 司机驾驶证信息
+     */
+    KwfDriverLicenseVo driverLicense;
+
+    /**
+     * 司机从业资格证
+     */
+    KwfDriverQualificationVo driverQualification;
+
+    /**
+     * 车辆信息
+     */
+    List<Map<String, Object>> trucks;
+
+}

+ 57 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverLicenseVo.java

@@ -0,0 +1,57 @@
+package com.sckw.fleet.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 司机驾驶证信息
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfDriverLicenseVo implements Serializable{
+
+        /**
+     * 司机id
+     */
+    private Long driverId;
+
+    /**
+     * 驾驶证号
+     */
+    private String driverNo;
+
+    /**
+     * 准驾车型
+     */
+    private String type;
+
+    /**
+     * 有效日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date expireTime;
+
+    /**
+     * 发证机关单位
+     */
+    private String grantUnit;
+
+    /**
+     * 证书正面URL地址
+     */
+    private String certificateMain;
+
+    /**
+     * 证书反面URL地址
+     */
+    private String certificateRevolt;
+
+    /**
+     * 车辆状态(0未认证、1已认证)
+     */
+    private Integer status;
+
+}

+ 57 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfDriverQualificationVo.java

@@ -0,0 +1,57 @@
+package com.sckw.fleet.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 司机从业资格证
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfDriverQualificationVo implements Serializable {
+
+    /**
+     * 司机id
+     */
+    private Long driverId;
+
+    /**
+     * 从业资格证号
+     */
+    private String qualiNo;
+
+    /**
+     * 准驾车型
+     */
+    private String type;
+
+    /**
+     * 有效日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date expireTime;
+
+    /**
+     * 发证机关单位
+     */
+    private String grantUnit;
+
+    /**
+     * 证书正面URL地址
+     */
+    private String certificateMain;
+
+    /**
+     * 证书反面URL地址
+     */
+    private String certificateRevolt;
+
+    /**
+     * 车辆状态(0未认证、1已认证)
+     */
+    private Integer status;
+
+}

+ 68 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTransportLicenseVo.java

@@ -0,0 +1,68 @@
+package com.sckw.fleet.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 车辆道路运输许可证
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfTransportLicenseVo implements Serializable {
+
+    /**
+     * 车辆主键ID
+     */
+    private Long truckId;
+
+    /**
+     * 道路运输证号
+     */
+    private String roadTranNo;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 经营许可证号
+     */
+    private String businessLicenseNo;
+
+    /**
+     * 发证机关单位
+     */
+    private String grantUnit;
+
+    /**
+     * 发证日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date grantTime;
+
+    /**
+     * 有效期至
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date expireTime;
+
+    /**
+     * 证书正面URL地址
+     */
+    private String certificateMain;
+
+    /**
+     * 证书反面URL地址
+     */
+    private String certificateRevolt;
+
+    /**
+     * 车辆状态(0未认证、1已认证)
+     */
+    private Integer status;
+
+}

+ 129 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckDetailVo.java

@@ -0,0 +1,129 @@
+package com.sckw.fleet.model.vo;
+
+import lombok.Data;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author zk
+ * @desc 车辆信息
+ * @date 2023/7/11 0011
+ */
+@Data
+public class KwfTruckDetailVo implements Serializable {
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 车牌号
+     */
+    private String truckNo;
+
+    /**
+     * 车辆类型(牵引车、自卸、高栏、平板、厢式、集装箱车、罐车、封闭式、专项作业车、其他)
+     */
+    private Integer type;
+
+    /**
+     * 能源类型(柴油、汽油、电动、氢能、天然气、液化石油气、甲醇、油电混动、油气混动、其他)
+     */
+    private Integer energyType;
+
+    /**
+     * 使用性质(营运车、租赁车辆、货运车、危化品运输车、非营运车、其他)
+     */
+    private Integer useType;
+
+    /**
+     * 外廓尺寸
+     */
+    private String spec;
+
+    /**
+     * 标准荷载(净重)
+     */
+    private BigDecimal actualWeight;
+
+    /**
+     * 车辆总质量(毛重)
+     */
+    private BigDecimal grossWeight;
+
+    /**
+     * 皮重
+     */
+    private BigDecimal tareWeight;
+
+    /**
+     * 车辆颜色
+     */
+    private Integer color;
+
+    /**
+     * 环保等级(国标)
+     */
+    private Integer eev;
+
+    /**
+     * 挂车号
+     */
+    private String trailerNo;
+
+    /**
+     * 车辆状态(0正常、1锁定)
+     */
+    private Integer status;
+
+    /**
+     * 车辆业务状态(0空闲、1任务)
+     */
+    private Integer businessStatus;
+
+    /**
+     * 认证状态(1认证、2临时、3异常)
+     */
+    private Integer authStatus;
+
+    /**
+     * 车队名称
+     */
+    private String remark;
+
+    /**
+     * 车辆颜色
+     */
+    private String colorName;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 车队ID
+     */
+    private Long fleetId;
+
+    /**
+     * 车队名称
+     */
+    private String fleetName;
+
+    /**
+     * 车辆行驶证信息
+     */
+    KwfTruckLicenseVo truckLicense;
+
+    /**
+     * 车辆道路运输许可证
+     */
+    KwfTransportLicenseVo transportLicense;
+}

+ 68 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckLicenseVo.java

@@ -0,0 +1,68 @@
+package com.sckw.fleet.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 车辆行驶证信息
+ * @author zk
+ * @date 2023/7/6
+ */
+@Data
+public class KwfTruckLicenseVo implements Serializable {
+
+    /**
+     * 车辆主键ID
+     */
+    private Long truckId;
+
+    /**
+     * 车辆识别码
+     */
+    private String vin;
+
+    /**
+     * 车辆行驶证号
+     */
+    private String drivingNo;
+
+    /**
+     * 车辆所有人
+     */
+    private String owner;
+
+    /**
+     * 注册日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date regTime;
+
+    /**
+     * 发证机关单位
+     */
+    private String grantUnit;
+
+    /**
+     * 发证日期
+     */
+    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
+    private Date grantTime;
+
+    /**
+     * 证书正面URL地址
+     */
+    private String certificateMain;
+
+    /**
+     * 证书反面URL地址
+     */
+    private String certificateRevolt;
+
+    /**
+     * 车辆状态(0未认证、1已认证)
+     */
+    private Integer status;
+
+}

+ 20 - 4
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/KwfTruckReportVo.java

@@ -43,13 +43,13 @@ public class KwfTruckReportVo {
      * 认证状态(1认证、2临时、3异常)
      */
     @ExcelIgnore
-    private Integer authStatus;
+    private Integer truckAuthStatus;
 
     /**
      * 认证状态
      */
     @ExcelProperty(value = "状态")
-    private String authStatusName;
+    private String truckAuthStatusName;
 
     /**
      * 司机主键id
@@ -87,6 +87,18 @@ public class KwfTruckReportVo {
     @ExcelProperty(value = "司机归档企业")
     private String driverFirmName;
 
+    /**
+     * 认证状态(1认证、2临时、3异常)
+     */
+    @ExcelIgnore
+    private Integer driverAuthStatus;
+
+    /**
+     * 认证状态
+     */
+    @ExcelIgnore
+    private String driverAuthStatusName;
+
     /**
      * 车辆归档企业主键id
      */
@@ -177,8 +189,12 @@ public class KwfTruckReportVo {
     @ExcelProperty(value = "备注")
     private String remark;
 
-    public String getAuthStatusName() {
-        return authStatus == 1 ? "正常" : authStatus == 2 ? "临时" : "异常";
+
+    public String getTruckAuthStatusName() {
+        return truckAuthStatus == 1 ? "正常" : truckAuthStatus == 2 ? "临时" : "异常";
     }
 
+    public String getDriverAuthStatusName() {
+        return driverAuthStatus == 1 ? "正常" : driverAuthStatus == 2 ? "临时" : "异常";
+    }
 }

+ 122 - 12
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -1,7 +1,9 @@
 package com.sckw.fleet.service;
 
+import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.PasswordUtils;
@@ -12,8 +14,7 @@ import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.dao.*;
 import com.sckw.fleet.model.*;
 import com.sckw.fleet.model.dto.*;
-import com.sckw.fleet.model.vo.KwfDriverVo;
-import com.sckw.fleet.model.vo.KwfTableTopCount;
+import com.sckw.fleet.model.vo.*;
 import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
@@ -50,6 +51,8 @@ public class KwfDriverService {
     @Autowired
     KwfDriverQualificationMapper KwfDriverQualificationDao;
     @Autowired
+    KwfTruckReportMapper truckReportDao;
+    @Autowired
     KwfFleetDriverMapper fleetDriverDao;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
@@ -64,6 +67,63 @@ public class KwfDriverService {
         return driverDao.selectById(key);
     }
 
+    /**
+     * @param driverId 司机ID
+     * @desc 司机信息查询
+     * @author zk
+     * @date 2023/7/11
+     **/
+    public KwfDriverDetailVo detail(Long driverId) {
+        //司机信息
+        KwfDriver driver = this.selectByKey(driverId);
+        KwfDriverDetailVo driverDetailVo = new KwfDriverDetailVo();
+        BeanUtils.copyPropertiesValue(driver, driverDetailVo);
+
+        //数据查询
+        if (driver != null) {
+            //身份证信息
+            KwfDriverCard cardJson = this.findCarByKey(driverId);
+            KwfDriverCardVo driverCardVo = new KwfDriverCardVo();
+            BeanUtils.copyPropertiesValue(cardJson, driverCardVo);
+            driverDetailVo.setDriverCard(driverCardVo);
+
+            //司机驾驶证信息
+            KwfDriverLicense licenseJson = this.findLicenseByKey(driverId);
+            KwfDriverLicenseVo driverLicenseVo = new KwfDriverLicenseVo();
+            BeanUtils.copyPropertiesValue(licenseJson, driverLicenseVo);
+            driverDetailVo.setDriverLicense(driverLicenseVo);
+
+            //司机从业资格证
+            KwfDriverQualification qualificationJson = this.findQualificationByKey(driverId);
+            KwfDriverQualificationVo qualificationVo = new KwfDriverQualificationVo();
+            BeanUtils.copyPropertiesValue(qualificationJson, qualificationVo);
+            driverDetailVo.setDriverQualification(qualificationVo);
+
+            //车队班组
+            KwfFleet fleet = this.findByFleetDriver(driverId, LoginUserHolder.getEntId());
+            driverDetailVo.setFleetId(fleet != null ? fleet.getId() : null);
+            driverDetailVo.setFleetName(fleet != null ? fleet.getName() : null);
+
+            //司机关联车辆(车辆上报)
+            if (LoginUserHolder.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+                List<Map<String, Object>> trucks = new ArrayList();
+                List<Map<String, Object>> reports = truckReportDao.findList(new HashMap() {{
+                    put("driverId", driverId);
+                }});
+                for (Map<String, Object> report : reports) {
+                    trucks.add(new HashMap() {{
+                        put("truckId", report.get("truckId"));
+                        put("truckNo", report.get("truckNo"));
+                        put("trailerNo", report.get("truckTrailerNo"));
+                    }});
+                }
+                driverDetailVo.setTrucks(trucks);
+            }
+            return driverDetailVo;
+        }
+        return null;
+    }
+
     /**
      * @param params 参数
      * @desc 统计
@@ -362,6 +422,10 @@ public class KwfDriverService {
         /**数据copy**/
         KwfDriverCard driverCard = new KwfDriverCard();
         BeanUtils.copyProperties(params, driverCard);
+        driverCard.setStatus(Global.YES);
+        if (StringUtils.isBlank(driverCard.getCertificateMain()) && StringUtils.isBlank(driverCard.getCertificateRevolt())) {
+            driverCard.setStatus(Global.NO);
+        }
 
         /**数据更新**/
         int count = 0;
@@ -407,6 +471,10 @@ public class KwfDriverService {
         /**数据copy**/
         KwfDriverLicense driverLicense = new KwfDriverLicense();
         BeanUtils.copyProperties(params, driverLicense);
+        driverLicense.setStatus(Global.YES);
+        if (StringUtils.isBlank(driverLicense.getCertificateMain()) && StringUtils.isBlank(driverLicense.getCertificateRevolt())) {
+            driverLicense.setStatus(Global.NO);
+        }
 
         /**数据更新**/
         int count = 0;
@@ -453,6 +521,10 @@ public class KwfDriverService {
         /**数据copy**/
         KwfDriverQualification driverQual = new KwfDriverQualification();
         BeanUtils.copyProperties(params, driverQual);
+        driverQual.setStatus(Global.YES);
+        if (StringUtils.isBlank(driverQual.getCertificateMain()) && StringUtils.isBlank(driverQual.getCertificateRevolt())) {
+            driverQual.setStatus(Global.NO);
+        }
 
         /**数据更新**/
         int count = 0;
@@ -534,7 +606,6 @@ public class KwfDriverService {
         return fleetDriverDao.findByFleetDriver(driverId, entId);
     }
 
-
     /**
      * @param params 参数
      * @desc: 修改密码
@@ -583,13 +654,13 @@ public class KwfDriverService {
         }
 
         /**从缓存中取出验证码/校验**/
-        String valueKey = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, params.getPhone());
-        String phoneCaptcha = RedissonUtils.getString(valueKey);
-        if (StringUtils.isBlank(phoneCaptcha)) {
-            return HttpResult.error("手机验证码不正确请确认!");
+        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, params.getPhone());
+        String smsCaptcha = RedissonUtils.getString(key);
+        if (StringUtils.isBlank(smsCaptcha)) {
+            return HttpResult.error("验证码已过期,请重新获取!!");
         }
-        if (!phoneCaptcha.equals(params.getCaptcha())) {
-            return HttpResult.error("手机验证码不正确请确认!");
+        if (!smsCaptcha.equals(params.getCaptcha())) {
+            return HttpResult.error("验证码不正确请确认再输入!");
         }
 
         /**唯一性交易**/
@@ -604,6 +675,42 @@ public class KwfDriverService {
         return count > 0 ? HttpResult.ok("手机号更换成功!") : HttpResult.error("手机号更换失败!");
     }
 
+    /**
+     * @param {account 账号、password 密码、captcha 验证码}
+     * @description 忘记密码
+     * @author zk
+     * @date 2023/08/15
+     **/
+    public HttpResult forgetPassword(ForgetPasswordDto params) {
+        /**校验**/
+        String key = StringUtils.format(RedisConstant.MESSAGE_SMS_VERIFY_CODE_VALUE_KEY, DictEnum.SMS_UPDATE_PASSWORD.getValue(), params.getAccount());
+        RedissonUtils.putString(key, params.getCaptcha(), RedisConstant.SMS_VERIFY_CODE_VALID_TIME);
+        String smsCaptcha = RedissonUtils.getString(key);
+        if (StringUtils.isBlank(smsCaptcha)){
+            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不能为空!");
+        }
+        if (StringUtils.isBlank(smsCaptcha)){
+            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码已过期,请重新获取!");
+        }
+        if (!params.getCaptcha().equals(smsCaptcha)){
+            return HttpResult.error(HttpStatus.UN_LOGIN_CODE, "验证码不正确,请确认再输入!");
+        }
+
+        /**查询**/
+        List<KwfDriver> drivers = driverDao.findDriver(new HashMap(){{ put("phone", params.getAccount()); }});
+        if (CollectionUtils.isEmpty(drivers)) {
+            return HttpResult.error("账号不存在,请确认后再输入!");
+        }
+        KwfDriver driver = drivers.get(Global.NUMERICAL_ZERO);
+
+        /**更新数据**/
+        driver.setPassword(PasswordUtils.entryptPassword(params.getPassword()));
+        driver.setSalt(PasswordUtils.getSaltSubPwd(driver.getPassword()));
+        int count = driverDao.updateById(driver);
+        return count > 0 ? HttpResult.ok("密码修改成功!") : HttpResult.error("密码修改失败!");
+    }
+
+
     /**
      * @param params 参数
      * @desc 校验司机是否有证书
@@ -612,15 +719,18 @@ public class KwfDriverService {
      **/
     public boolean checkLicense(KwfDriverDto params) {
         //身份证
-        if (params.getDriverCard() == null || StringUtils.isBlank(params.getDriverCard().getIdcard())) {
+        KwfDriverCardDto card = params.getDriverCard();
+        if (card == null || (StringUtils.isBlank(card.getCertificateMain()) && StringUtils.isBlank(card.getCertificateRevolt()))) {
             return false;
         }
         //司机驾驶证信息
-        if (params.getDriverLicense() == null || StringUtils.isBlank(params.getDriverLicense().getDriverNo())) {
+        KwfDriverLicenseDto license = params.getDriverLicense();
+        if (license == null || (StringUtils.isBlank(license.getCertificateMain()) && StringUtils.isBlank(license.getCertificateRevolt()))) {
             return false;
         }
         //司机从业资格证
-        if (params.getDriverQualification() == null || StringUtils.isBlank(params.getDriverQualification().getQualiNo())) {
+        KwfDriverQualificationDto quali = params.getDriverQualification();
+        if (quali == null || (StringUtils.isBlank(quali.getCertificateMain()) && StringUtils.isBlank(quali.getCertificateRevolt()))) {
             return false;
         }
         return true;

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

@@ -12,8 +12,7 @@ import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.dao.*;
 import com.sckw.fleet.model.*;
 import com.sckw.fleet.model.dto.*;
-import com.sckw.fleet.model.vo.KwfTableTopCount;
-import com.sckw.fleet.model.vo.KwfTruckVo;
+import com.sckw.fleet.model.vo.*;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
@@ -59,6 +58,46 @@ public class KwfTruckService {
         return truckDao.selectById(key);
     }
 
+    /**
+     * @param truckId 车辆档案ID
+     * @desc 车辆详情
+     * @author zk
+     * @date 2023/7/11
+     **/
+    public KwfTruckDetailVo detail(Long truckId){
+        //车辆信息
+        KwfTruck truck = this.selectByKey(truckId);
+        KwfTruckDetailVo truckDetailVo = new KwfTruckDetailVo();
+        BeanUtils.copyPropertiesValue(truck, truckDetailVo);
+
+        //数据组装
+        if (truck != null) {
+            //车辆行驶证信息
+            KwfTruckLicense truckLicense = this.findTruckLicenseByKey(truckId);
+            KwfTruckLicenseVo truckLicenseVo = new KwfTruckLicenseVo();
+            BeanUtils.copyPropertiesValue(truckLicense, truckLicenseVo);
+            truckDetailVo.setTruckLicense(truckLicenseVo);
+
+            //车辆道路运输许可证
+            KwfTransportLicense transportLicense = this.findTransportLicenseByKey(truckId);
+            KwfTransportLicenseVo transportLicenseVo = new KwfTransportLicenseVo();
+            BeanUtils.copyPropertiesValue(transportLicense, transportLicenseVo);
+            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);
+
+            //车队班组
+            KwfFleet fleet = this.findByFleetTruck(truckId, LoginUserHolder.getEntId());
+            truckDetailVo.setFleetId(fleet != null ? fleet.getId() : null);
+            truckDetailVo.setFleetName(fleet != null ? fleet.getName() : null);
+            return truckDetailVo;
+        }
+        return null;
+    }
+
     /**
      * @param params 参数
      * @desc 统计
@@ -347,6 +386,10 @@ public class KwfTruckService {
         /**数据copy**/
         KwfTruckLicense truckLicense = new KwfTruckLicense();
         BeanUtils.copyProperties(params, truckLicense);
+        truckLicense.setStatus(Global.YES);
+        if (StringUtils.isBlank(truckLicense.getCertificateMain()) && StringUtils.isBlank(truckLicense.getCertificateRevolt())) {
+            truckLicense.setStatus(Global.NO);
+        }
 
         /**数据更新**/
         int count = 0;
@@ -383,6 +426,10 @@ public class KwfTruckService {
         /**数据copy**/
         KwfTransportLicense transportLicense = new KwfTransportLicense();
         BeanUtils.copyProperties(params, transportLicense);
+        transportLicense.setStatus(Global.YES);
+        if (StringUtils.isBlank(transportLicense.getCertificateMain()) && StringUtils.isBlank(transportLicense.getCertificateRevolt())) {
+            transportLicense.setStatus(Global.NO);
+        }
 
         /**数据更新**/
         int count = 0;
@@ -473,11 +520,15 @@ public class KwfTruckService {
      **/
     public boolean checkLicense(KwfTruckDto params) {
         //车辆行驶证信息
-        if (params.getTruckLicense() == null || StringUtils.isBlank(params.getTruckLicense().getDrivingNo())) {
+        KwfTruckLicenseDto license = params.getTruckLicense();
+        if (license == null || (StringUtils.isBlank(license.getCertificateMain())
+                && StringUtils.isBlank(license.getCertificateRevolt()))) {
             return false;
         }
         //车辆道路运输许可证
-        if (params.getTransportLicense() == null || StringUtils.isBlank(params.getTransportLicense().getRoadTranNo())) {
+        KwfTransportLicenseDto transportLicense = params.getTransportLicense();
+        if (transportLicense == null || (StringUtils.isBlank(transportLicense.getCertificateMain())
+                && StringUtils.isBlank(transportLicense.getCertificateRevolt()))) {
             return false;
         }
         return true;

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

@@ -6,7 +6,7 @@
         SELECT
             id, truck_id truckId, road_tran_no roadTranNo, firm_name firmName, business_license_no businessLicenseNo,
             grant_unit grantUnit, grant_time grantTime, expire_time expireTime, certificate_main certificateMain,
-            certificate_revolt certificateRevolt, remark, create_by createBy, create_time createTime, update_by updateBy,
+            certificate_revolt certificateRevolt, status, remark, create_by createBy, create_time createTime, update_by updateBy,
             update_time updateTime
         from kwf_transport_license
         where del_flag = 0 and truck_id = #{truckId, jdbcType=BIGINT}

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

@@ -6,7 +6,7 @@
         SELECT
             id, truck_id truckId, vin, driving_no drivingNo, owner, reg_time regTime, grant_unit grantUnit,
             grant_time grantTime, certificate_main certificateMain, certificate_revolt certificateRevolt,
-            remark, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
+             status, remark, create_by createBy, create_time createTime, update_by updateBy, update_time updateTime
         from kwf_truck_license
         where del_flag = 0 and truck_id = #{truckId, jdbcType=BIGINT}
     </select>

+ 6 - 5
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -49,9 +49,10 @@
         SELECT
             trr.id, trr.ent_id entId, trr.truck_id truckId, driver_id driverId, trr.remark, tr.status,
             trr.create_by createBy, trr.create_time createTime, trr.update_time updateTime, trr.remark,
-            tr.truck_no truckNo, tr.actual_weight actualWeight, tr.business_status businessStatus, tr.auth_status authStatus,
-            dr.`name` driverName, dr.phone driverPhone, dr.idcard driverIdcard, dr.ent_id driverEntId,
-            tr.ent_id truckEntId, fl.name truckFleetName, tr.type truckType, tr.color, tr.trailer_no trailerNo
+            tr.truck_no truckNo, tr.actual_weight actualWeight, tr.business_status businessStatus,
+            tr.auth_status truckAuthStatus, dr.`name` driverName, dr.phone driverPhone, dr.idcard driverIdcard,
+            dr.ent_id driverEntId, dr.auth_status driverAuthStatus, tr.ent_id truckEntId, fl.name truckFleetName,
+            tr.type truckType, tr.color, tr.trailer_no trailerNo
         from kwf_truck_report trr
         left join kwf_truck tr on tr.id = trr.truck_id
         left join kwf_driver dr on dr.id = trr.driver_id
@@ -76,8 +77,8 @@
         <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 test="truckAuthStatus != null and truckAuthStatus != ''">
+            and tr.auth_status = #{truckAuthStatus, jdbcType=VARCHAR}
         </if>
         <if test="startTime != null and startTime != '' " >
             and DATE( trr.create_time) <![CDATA[ >= ]]> #{startTime,jdbcType=TIMESTAMP}