Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun

ccj 2 năm trước cách đây
mục cha
commit
5732454390
18 tập tin đã thay đổi với 419 bổ sung78 xóa
  1. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java
  2. 18 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverInfoController.java
  3. 13 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/OrderInfoController.java
  4. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FeedbackReport.java
  5. 4 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCargoOwnerInfo.java
  6. 43 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverInfo.java
  7. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java
  8. 16 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/DriverInfoMapper.java
  9. 13 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverInfoService.java
  10. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IOrderInfoService.java
  11. 1 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerInfoServiceImpl.java
  12. 8 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java
  13. 80 20
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java
  14. 20 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  15. 6 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java
  16. 55 48
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java
  17. 114 4
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml
  18. 2 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FeedbackReportMapper.xml

+ 9 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -123,6 +123,15 @@ public enum StatusEnum {
     PARTIAL_REPAYMENT("3", "部分还款", "partial_repayment"),
     REPAID("5", "已还款", "repaid"),
 
+    //司机信息上报状态
+    PLATFORM_UNDER_REVIEW("1", "平台审核中", "platform_under_review"),
+    NOT_REPORTED("3", "未上报", "not_reported"),
+    PARK_UNDER_REVIEW("5", "园区审核中", "park_under_review"),
+    TRAFFIC_UNDER_REVIEW("7", "交管审核中", "traffic_under_review"),
+    FAIL("9", "未通过", "fail"),
+    PASSED("11", "已通过", "Passed"),
+    EXPIRED("13", "已过期", "repaid"),
+
     ;
     @Getter
     private String flag;

+ 18 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverInfoController.java

@@ -129,5 +129,23 @@ public class DriverInfoController {
     public DistinguishView qualificationLicenseShibie (String image){
         return EntityAnalyse.qualificationLicenseShibie(image);
     }
+
+    /**
+     * 批量上报
+     */
+    @PostMapping("/api/batchSubmission")
+    public String batchSubmission(@RequestBody HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+        return driverInfoService.batchSubmission(hyDriverInfo);
+    }
+
+    /**
+     * 后台管理司机信息上报列表
+     * @param driverViewInfo
+     * @return
+     */
+    @GetMapping("/selectDriverInfoSubmission")
+    public Page<HyDriverInfo> selectDriverInfoSubmission(HyDriverInfo driverViewInfo){
+        return driverInfoService.selectDriverInfoSubmission(driverViewInfo);
+    }
 }
 

+ 13 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/OrderInfoController.java

@@ -53,7 +53,7 @@ public class OrderInfoController {
     }
 
     /**
-     * 获取一个月内司机的订单
+     * 查询订单集合
      *
      * @param
      * @return
@@ -65,7 +65,7 @@ public class OrderInfoController {
 
 
     /**
-     * 查询订单集合
+     * 获取一个月内司机的订单
      *
      * @param
      * @return
@@ -75,6 +75,17 @@ public class OrderInfoController {
         return orderInfoService.getData(commonId);
     }
 
+    /**
+     * 获取司机和货主两人关联的订单
+     *
+     * @param
+     * @return
+     */
+    @GetMapping("/getAssociatedOrder")
+    List<OrderInfo> getAssociatedOrder(OrderInfo orderInfo) {
+        return orderInfoService.getAssociatedOrder(orderInfo);
+    }
+
     /**
      * 订单详情
      */

+ 8 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FeedbackReport.java

@@ -37,6 +37,14 @@ public class FeedbackReport extends BaseModel<FeedbackReport> {
      * 工单编号
      */
     private String number;
+    /**
+     * 订单id
+     */
+    private String orderId;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
     /**
      * 发起方用户id
      */

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCargoOwnerInfo.java

@@ -41,6 +41,10 @@ public class HyCargoOwnerInfo extends BaseModel<HyCargoOwnerInfo> {
      * 用户id
      */
     private String commonId;
+    /**
+     * 账号
+     */
+    private String accountNumber;
     /**
      * 姓名
      */

+ 43 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverInfo.java

@@ -45,6 +45,10 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      * 用户id
      */
     private String commonId;
+    /**
+     * 账号
+     */
+    private String accountNumber;
     /**
      * 司机姓名
      */
@@ -211,6 +215,29 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      * 累计支付运费(元)
      */
     private Double accumulatedFreight;
+    /**
+     * 上报时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date escalationDate;
+    /**
+     * 上报状态key(1平台审核中3未上报5园区审核中7交管审核中9未通过11已通过13已过期)
+     */
+    private String escalationStatusKey;
+    /**
+     * 上报状态
+     */
+    private String escalationStatus;
+    /**
+     * 上报失败原因
+     */
+    private String escalationFailureReason;
+    /**
+     * 上报list
+     */
+    @TableField(exist = false)
+    private List<HyDriverInfo> hyDriverInfoList;
     /**
      * 审核标识
      */
@@ -224,6 +251,7 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
     private List<HyDriverPayeeInfo> hyDriverPayeeInfoList;
     /**
      * 查询类型(1待审核2已通过3已驳回4已过期5已注销6已禁用7未认证8重点关注)
+     * 上报列表(1待上报2审核中3已通过4已过期)
      */
     @TableField(exist = false)
     private String searchType;
@@ -232,6 +260,21 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      */
     @TableField(exist = false)
     private String searchKeyWord;
+    /**
+     * 筛选开始日期
+     */
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private String startDate;
+    /**
+     * 筛选结束日期
+     */
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private String endDate;
+
     /**
      * 头像
      */

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java

@@ -42,6 +42,7 @@ public enum YExceptionEnum {
 	BANKCARD_ADDED("ERROR20", "您已经添加过该银行卡,请勿重复添加!"),
 	OWNER_NO_RELEASE("ERROR21", "当前货主身份不可发布!"),
 	COMP_OWNER_ALREADY("ERROR22", "您已经具备该公司货主身份"),
+	CORRECT_DRIVING_LICENSE("ERROR23", "请上传正确的行驶证"),
 	;
 	@Getter
 	private String value;

+ 16 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/DriverInfoMapper.java

@@ -16,8 +16,6 @@ import java.util.Map;
  */
 public interface DriverInfoMapper extends BaseMapper<HyDriverInfo> {
 
-
-
     /**
      * 根据条件查询司机总数
      *
@@ -33,4 +31,20 @@ public interface DriverInfoMapper extends BaseMapper<HyDriverInfo> {
      * @return
      */
     List<HyDriverInfo> getListByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询司机信息上报总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getSubmissionCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询司机信息上报列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<HyDriverInfo> getSubmissionListByCondition(Map<String, Object> pageView);
 }

+ 13 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverInfoService.java

@@ -66,4 +66,17 @@ public interface IDriverInfoService extends IService<HyDriverInfo> {
      */
     HyDriverInfo getDriver(HyDriverInfo hyDriverInfo);
 
+    /**
+     * 批量上报
+     * @param hyDriverInfo
+     * @return
+     */
+    String batchSubmission(HyDriverInfo hyDriverInfo) throws IOException , ParseException;
+
+    /**
+     * 后台管理司机信息上报列表
+     * @param  driverViewInfo
+     * @return
+     */
+    Page<HyDriverInfo> selectDriverInfoSubmission(HyDriverInfo driverViewInfo);
 }

+ 8 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IOrderInfoService.java

@@ -55,6 +55,14 @@ public interface IOrderInfoService extends IService<OrderInfo> {
      */
     List<OrderInfo> getData(String commonId);
 
+    /**
+     * 获取司机和货主两人关联的订单
+     *
+     * @param
+     * @return
+     */
+    List<OrderInfo> getAssociatedOrder(OrderInfo orderInfo);
+
     /**
      * 订单详情
      *

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerInfoServiceImpl.java

@@ -47,7 +47,7 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
     @Override
     public HyCargoOwnerInfo firstAuthentication(String phone) {
         HyCargoOwnerInfo hyCargoOwnerInfo = this.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
-                .eq("phone",phone)
+                .eq("account_number",phone)
                 .eq("delete_flag",0));
         if (hyCargoOwnerInfo == null){
             HyCargoOwnerInfo hyCargoOwnerInfo1 = new HyCargoOwnerInfo();

+ 8 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java

@@ -107,15 +107,20 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         }
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
-        this.insert(hyDriverCarInfo);
 
+        if(hyDriverCarInfo.getVehicleType() == null){
+            throw new YException(YExceptionEnum.CORRECT_DRIVING_LICENSE);
+        }
         //查询车辆类型key值
         HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                 .eq("const_id", "CAR1").eq("const_value", hyDriverCarInfo.getVehicleType()));
         hyDriverCarInfo.setVehicleTypeKey(hyCommonSysParameter.getConstKey());
+        //车辆信息上报
         String token = EntityAnalyse.GetJTToken();
         hyDriverCarInfo.setToken(token);
         EntityAnalyse.uploadDriverCarInfo(hyDriverCarInfo);
+
+        this.insert(hyDriverCarInfo);
         return "ok";
     }
 
@@ -133,9 +138,11 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                 .eq("const_id", "CAR1").eq("const_value", hyDriverCarInfo.getVehicleType()));
         hyDriverCarInfo.setVehicleTypeKey(hyCommonSysParameter.getConstKey());
+        //信息上报
         String token = EntityAnalyse.GetJTToken();
         hyDriverCarInfo.setToken(token);
         EntityAnalyse.uploadDriverCarInfo(hyDriverCarInfo);
+
         this.updateById(hyDriverCarInfo);
         return "OK";
     }

+ 80 - 20
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java

@@ -1,6 +1,5 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
@@ -15,27 +14,13 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.DriverInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
-import com.yh.saas.plugin.yiliangyiyun.util.HttpUtils;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
+
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.client.RestTemplate;
 
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.util.*;
 
@@ -107,7 +92,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     @Override
     public HyDriverInfo firstAuthentication(String driverPhone) {
         HyDriverInfo hyDriverInfo = this.selectOne(new EntityWrapper<HyDriverInfo>()
-                .eq("driver_phone", driverPhone)
+                .eq("account_number", driverPhone)
                 .eq("delete_flag", 0));
         if (hyDriverInfo == null) {
             HyDriverInfo hyDriverInfo1 = new HyDriverInfo();
@@ -166,12 +151,24 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 hyDriverPayeeInfo.setCommonId(hyDriverInfo.getCommonId());
             }
         }
-        boolean one = this.insert(hyDriverInfo);
-        boolean three = driverPayeeInfoService.insertBatch(hyDriverPayeeInfoList);
 
+        //上报
+        List<HyDriverInfo> hyDriverInfos1 = new ArrayList<>();
+        //将对象放入list
+        hyDriverInfos1.add(hyDriverInfo);
+        hyDriverInfo.setHyDriverInfoList(hyDriverInfos1);
+        //获取token
         String token = EntityAnalyse.GetJTToken();
         hyDriverInfo.setToken(token);
         EntityAnalyse.uploadDriverInfo(hyDriverInfo);
+        //更改上报状态
+        hyDriverInfo.setEscalationDate(new Date());
+        hyDriverInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+        hyDriverInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+
+        boolean one = this.insert(hyDriverInfo);
+        boolean three = driverPayeeInfoService.insertBatch(hyDriverPayeeInfoList);
+
         // 假如 都成功返回ok
         if (one && three) {
             return "OK";
@@ -192,10 +189,19 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
         hyDriverInfo.setBackStageStatus(StatusEnum.TO_BE_REVIEWED.getName());
 
+        //上报
+        List<HyDriverInfo> hyDriverInfos = new ArrayList<>();
+        //将对象放入list
+        hyDriverInfos.add(hyDriverInfo);
+        hyDriverInfo.setHyDriverInfoList(hyDriverInfos);
+        //获取token
         String token = EntityAnalyse.GetJTToken();
         hyDriverInfo.setToken(token);
         EntityAnalyse.uploadDriverInfo(hyDriverInfo);
-
+        //更改上报状态
+        hyDriverInfo.setEscalationDate(new Date());
+        hyDriverInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+        hyDriverInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
         //主表信息编辑
         this.updateById(hyDriverInfo);
         //收款人账户信息编辑
@@ -326,4 +332,58 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         return hyDriverInfo1;
     }
 
+    /**
+     * 批量上报
+     * @param hyDriverInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    public String batchSubmission (HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+        //上报
+        //获取token
+        String token = EntityAnalyse.GetJTToken();
+        hyDriverInfo.setToken(token);
+        EntityAnalyse.uploadDriverInfo(hyDriverInfo);
+        if (!CollectionUtils.isEmpty(hyDriverInfo.getHyDriverInfoList())){
+            for (HyDriverInfo hyDriverInfo1 : hyDriverInfo.getHyDriverInfoList()){
+                //更改上报状态
+                hyDriverInfo1.setEscalationDate(new Date());
+                hyDriverInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+                hyDriverInfo1.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+                this.updateById(hyDriverInfo1);
+            }
+        }
+        return "ok";
+    }
+
+    /**
+     * 后台管理司机信息上报列表
+     *
+     * @param hyDriverInfo
+     * @return
+     */
+    @Override
+    public Page<HyDriverInfo> selectDriverInfoSubmission(HyDriverInfo hyDriverInfo){
+        Map<String, Object> pageView = new HashMap<>(11);
+        pageView.put("startRecord", (hyDriverInfo.getCurrentPage() - 1)
+                * hyDriverInfo.getPageSize());
+        //公司id
+        pageView.put("searchType", hyDriverInfo.getSearchType());
+        pageView.put("searchKeyWord", hyDriverInfo.getSearchKeyWord());
+        pageView.put("startDate", hyDriverInfo.getStartDate());
+        pageView.put("endDate", hyDriverInfo.getEndDate());
+        pageView.put("pageSize", hyDriverInfo.getPageSize());
+        pageView.put("currentPage", hyDriverInfo.getCurrentPage());
+        // 查询司机总数
+        Integer dataCount = baseMapper.getSubmissionCountByCondition(pageView);
+        List<HyDriverInfo> dataList = baseMapper.getSubmissionListByCondition(pageView);
+        Page<HyDriverInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(hyDriverInfo.getCurrentPage());
+        page.setSize(hyDriverInfo.getPageSize());
+        return page;
+    }
 }

+ 20 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java

@@ -234,6 +234,26 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
     }
 
 
+    /**
+     * 获取司机和货主两人关联的订单
+     *
+     * @param
+     * @return
+     */
+    @Override
+    public List<OrderInfo> getAssociatedOrder(OrderInfo orderInfo) {
+        //根据司机用户id和货主用户id查询
+        List<OrderInfo> orderInfoList = this.selectList(new EntityWrapper<OrderInfo>().eq("common_id",orderInfo.getCommonId())
+                .eq("cargo_common_id",orderInfo.getCargoCommonId()).eq("delete_flag","0")
+                .orderBy("update_date",false));
+        if (CollectionUtils.isNotEmpty(orderInfoList)){
+            return orderInfoList;
+        }
+        List<OrderInfo> orderInfoList1 = new ArrayList<>();
+        return orderInfoList1;
+    }
+
+
     /**
      * 订单货主/司机详情,好评率
      *

+ 6 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java

@@ -225,6 +225,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         driverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
                         driverInfo.setBackStageStatus(StatusEnum.IDENTITY_OVERDUE.getName());
                         driverInfo.setBackStageStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
+                        driverInfo.setEscalationStatus(StatusEnum.EXPIRED.getFlag());
+                        driverInfo.setEscalationStatusKey(StatusEnum.EXPIRED.getFlag());
                         driverInfoService.updateById(driverInfo);
                     }
                     //身份证到期前10天
@@ -260,6 +262,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     driverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
                     driverInfo.setBackStageStatus(StatusEnum.IDENTITY_OVERDUE.getName());
                     driverInfo.setBackStageStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
+                    driverInfo.setEscalationStatus(StatusEnum.EXPIRED.getFlag());
+                    driverInfo.setEscalationStatusKey(StatusEnum.EXPIRED.getFlag());
                     driverInfoService.updateById(driverInfo);
                 }//驾驶证到期前10天
                 int result210 = driverInfo.getDriverLicenseValidityDate().compareTo(date10);
@@ -293,6 +297,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     driverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
                     driverInfo.setBackStageStatus(StatusEnum.IDENTITY_OVERDUE.getName());
                     driverInfo.setBackStageStatusKey(StatusEnum.IDENTITY_OVERDUE.getFlag());
+                    driverInfo.setEscalationStatus(StatusEnum.EXPIRED.getFlag());
+                    driverInfo.setEscalationStatusKey(StatusEnum.EXPIRED.getFlag());
                     driverInfoService.updateById(driverInfo);
                 }
                 //从业资格证到期前10天

+ 55 - 48
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java

@@ -10,6 +10,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.DistinguishView;
 import com.yh.saas.plugin.yiliangyiyun.service.ICommonSysParameterService;
 import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
@@ -143,54 +144,60 @@ public class EntityAnalyse {
         // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
         HttpPost httpPost = new HttpPost(url);
         JSONObject params = new JSONObject();
-        params.put("driverName", hyDriverInfo.getDriverName());
-        params.put("drivingLicense", hyDriverInfo.getNumberCard());
-        params.put("vehicleClass", hyDriverInfo.getQuasiDrivingVehicle());
-        params.put("issuingOrganizations", hyDriverInfo.getLssuingAuthority());
-        params.put("validPeriodFrom", f.format(hyDriverInfo.getDriverLicenseValidityStartDate()));
-        params.put("validPeriodTo", f.format(hyDriverInfo.getDriverLicenseValidityDate()));
-        params.put("qualificationCertificate", hyDriverInfo.getQualificationCertificateNumber());
-        params.put("telephone", hyDriverInfo.getDriverPhone());
-        params.put("remark", hyDriverInfo.getDriverName() + hyDriverInfo.getDriverPhone());
-        params.put("idCardFrontImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo.getCardAddressUrl())), hyDriverInfo.getToken()));
-        params.put("idCardBackImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo.getCardBackAddressUrl())), hyDriverInfo.getToken()));
-        params.put("driverLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo.getDriverLicenseHomePage())), hyDriverInfo.getToken()));
-        params.put("driverLicenseSecondSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo.getDriverLicenseBackPage())), hyDriverInfo.getToken()));
-        params.put("transportCertificationImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo.getQualificationCertificate())), hyDriverInfo.getToken()));
-        if ("长期".equals(hyDriverInfo.getCardValidityDate())) {
-            params.put("idCardValidPeriodTo", "2099-12-31");
-        } else {
-            params.put("idCardValidPeriodTo", hyDriverInfo.getCardValidityDate());
-        }
-        params.put("transportCertificationValidPeriodTo", f.format(hyDriverInfo.getQualificationCertificateValidityDate()));
-        if ("男".equals(hyDriverInfo.getDriverSex())) {
-            params.put("driverSex", 1);
-        } else {
-            params.put("driverSex", 2);
-        }
-        String s = hyDriverInfo.getDriverBirthday().substring(0, hyDriverInfo.getDriverBirthday().length() - 1);
-        String s1 = s.replace("年", "-");
-        String s2 = s1.replace("月", "-");
-        Date date = f.parse(s2);
-        params.put("driverBirthday", f.format(date));
-        httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
-        // 设置header信息
-        httpPost.setHeader("Content-type", "application/json");
-        httpPost.setHeader("token", hyDriverInfo.getToken());
-        CloseableHttpResponse response = httpClient.execute(httpPost);
-        try {
-            // 执行请求操作,并拿到结果(同步阻塞)
-            String body = EntityUtils.toString(response.getEntity());
-            JSONObject jsonObject = JSONObject.parseObject(body);
-            String result = jsonObject.getString("result");
-            System.out.println("result = " + result);
-            return result;
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            // 释放链接
-            response.close();
-            httpClient.close();
+        List<HyDriverInfo> hyDriverInfos = hyDriverInfo.getHyDriverInfoList();
+        //批量上报
+        if (CollectionUtils.isNotEmpty(hyDriverInfos)){
+            for (HyDriverInfo hyDriverInfo1 : hyDriverInfos){
+                params.put("driverName", hyDriverInfo1.getDriverName());
+                params.put("drivingLicense", hyDriverInfo1.getNumberCard());
+                params.put("vehicleClass", hyDriverInfo1.getQuasiDrivingVehicle());
+                params.put("issuingOrganizations", hyDriverInfo1.getLssuingAuthority());
+                params.put("validPeriodFrom", f.format(hyDriverInfo1.getDriverLicenseValidityStartDate()));
+                params.put("validPeriodTo", f.format(hyDriverInfo1.getDriverLicenseValidityDate()));
+                params.put("qualificationCertificate", hyDriverInfo1.getQualificationCertificateNumber());
+                params.put("telephone", hyDriverInfo1.getDriverPhone());
+                params.put("remark", hyDriverInfo1.getDriverName() + hyDriverInfo1.getDriverPhone());
+                params.put("idCardFrontImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo1.getCardAddressUrl())), hyDriverInfo.getToken()));
+                params.put("idCardBackImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo1.getCardBackAddressUrl())), hyDriverInfo.getToken()));
+                params.put("driverLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo1.getDriverLicenseHomePage())), hyDriverInfo.getToken()));
+                params.put("driverLicenseSecondSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo1.getDriverLicenseBackPage())), hyDriverInfo.getToken()));
+                params.put("transportCertificationImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverInfo1.getQualificationCertificate())), hyDriverInfo.getToken()));
+                if ("长期".equals(hyDriverInfo1.getCardValidityDate())) {
+                    params.put("idCardValidPeriodTo", "2099-12-31");
+                } else {
+                    params.put("idCardValidPeriodTo", hyDriverInfo1.getCardValidityDate());
+                }
+                params.put("transportCertificationValidPeriodTo", f.format(hyDriverInfo1.getQualificationCertificateValidityDate()));
+                if ("男".equals(hyDriverInfo1.getDriverSex())) {
+                    params.put("driverSex", 1);
+                } else {
+                    params.put("driverSex", 2);
+                }
+                String s = hyDriverInfo1.getDriverBirthday().substring(0, hyDriverInfo1.getDriverBirthday().length() - 1);
+                String s1 = s.replace("年", "-");
+                String s2 = s1.replace("月", "-");
+                Date date = f.parse(s2);
+                params.put("driverBirthday", f.format(date));
+                httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
+                // 设置header信息
+                httpPost.setHeader("Content-type", "application/json");
+                httpPost.setHeader("token", hyDriverInfo.getToken());
+                CloseableHttpResponse response = httpClient.execute(httpPost);
+                try {
+                    // 执行请求操作,并拿到结果(同步阻塞)
+                    String body = EntityUtils.toString(response.getEntity());
+                    JSONObject jsonObject = JSONObject.parseObject(body);
+                    String result = jsonObject.getString("result");
+                    System.out.println("result = " + result);
+                    return result;
+                } catch (Exception e) {
+                    e.printStackTrace();
+                } finally {
+                    // 释放链接
+                    response.close();
+                    httpClient.close();
+                }
+            }
         }
         return "";
     }

+ 114 - 4
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml

@@ -2,7 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yh.saas.plugin.yiliangyiyun.mapper.DriverInfoMapper">
 
-
     <!-- 获得司机总数 -->
     <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
         select
@@ -48,8 +47,6 @@
         </if>
     </select>
 
-
-
     <!-- 司机列表查询 -->
     <select id="getListByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo">
@@ -57,7 +54,7 @@
         d.id,
         case when d.common_id is null then c.id else d.common_id end as commonId,
         case when d.driver_name is null then c.user_name else d.driver_name end as driverName,
-        case when d.driver_phone is null then c.phone else d.driver_phone end as driverPhone,
+        c.phone as driverPhone,
         d.number_card as numberCard,
         d.shipments_number as shipmentsNumber,
         d.favorable_rate as favorableRate,
@@ -130,4 +127,117 @@
             LIMIT ${startRecord}, ${pageSize}
         </if>
     </select>
+
+
+
+    <!-- 获得司机信息上报总数 -->
+    <select id="getSubmissionCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        select
+        count(c.id)
+        FROM common_user c
+        LEFT JOIN hy_driver_info d on c.id = d.common_id and d.delete_flag = 0
+        WHERE c.delete_flag = '0'
+        AND c.identification = '1'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND (d.escalation_status_key = '3' OR d.escalation_status_key = '9')
+            </if>
+            <if test="searchType == 2">
+                AND (d.escalation_status_key = '5' OR d.escalation_status_key = '7')
+            </if>
+            <if test="searchType == 3">
+                AND d.escalation_status_key = '11'
+            </if>
+            <if test="searchType == 4">
+                AND d.escalation_status_key = '13'
+            </if>
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="startDate != null and startDate != ''">
+            AND (DATE_FORMAT(d.create_date,"%Y%m%d") >=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null and endDate != ''">
+            AND (DATE_FORMAT(d.create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+    </select>
+
+    <!-- 司机信息上报列表查询 -->
+    <select id="getSubmissionListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo">
+        SELECT
+        d.id,
+        case when d.common_id is null then c.id else d.common_id end as commonId,
+        d.driver_name as driverName,
+        c.phone as driverPhone,
+        d.number_card as numberCard,
+        d.shipments_number as shipmentsNumber,
+        d.favorable_rate as favorableRate,
+        d.complaints_number as complaintsNumber,
+        d.reported_number as reportedNumber,
+        d.accumulated_freight as accumulatedFreight,
+        d.advance_payment as advancePayment,
+        d.card_address_url as cardAddressUrl,
+        d.card_back_address_url as cardBackAddressUrl,
+        d.card_validity_date as cardValidityDate,
+        d.driver_license_home_page as driverLicenseHomePage,
+        d.driver_license_back_page as driverLicenseBackPage,
+        d.driver_license_validity_start_date as driverLicenseValidityStartDate,
+        d.driver_license_validity_date as driverLicenseValidityDate,
+        d.quasi_driving_vehicle as quasiDrivingVehicle,
+        d.lssuing_authority as lssuingAuthority,
+        d.qualification_certificate as qualificationCertificate,
+        d.qualification_certificate_validity_date as qualificationCertificateValidityDate,
+        d.qualification_certificate_number as qualificationCertificateNumber,
+        d.overdue_flag as overdueFlag,
+        d.driver_overdue_flag as driverOverdueFlag,
+        d.qualification_overdue_flag as qualificationOverdueFlag,
+        d.authentication_status_key as authenticationStatusKey,
+        case when d.authentication_status is null then '未认证' else d.authentication_status end as authenticationStatus,
+        d.back_stage_status_key as backStageStatusKey,
+        case when d.back_stage_status is null then '未认证' else d.back_stage_status end as backStageStatus,
+        d.escalation_date as escalationDate,
+        d.escalation_status_key as escalationStatusKey,
+        case when d.escalation_status is null then '未认证' else d.escalation_status end as escalationStatus,
+        d.create_date as createDate,
+        d.update_date as updateDate
+        FROM common_user c
+        LEFT JOIN hy_driver_info d on c.id = d.common_id and d.delete_flag = 0
+        WHERE c.delete_flag = '0'
+        AND c.identification = '1'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 1">
+                AND (d.escalation_status_key = '3' OR d.escalation_status_key = '9')
+            </if>
+            <if test="searchType == 2">
+                AND (d.escalation_status_key = '5' OR d.escalation_status_key = '7')
+            </if>
+            <if test="searchType == 3">
+                AND d.escalation_status_key = '11'
+            </if>
+            <if test="searchType == 4">
+                AND d.escalation_status_key = '13'
+            </if>
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
+            OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
+        </if>
+        <if test="startDate != null and startDate != ''">
+            AND (DATE_FORMAT(d.create_date,"%Y%m%d") >=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
+        </if>
+        <if test="endDate != null and endDate != ''">
+            AND (DATE_FORMAT(d.create_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        ORDER BY d.escalation_status_key ASC,d.escalation_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>

+ 2 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FeedbackReportMapper.xml

@@ -46,6 +46,8 @@
         SELECT
         id,
         number,
+        order_id as orderId,
+        order_no as orderNo,
         common_id as commonId,
         initiator,
         initiator_number as initiatorNumber,