haungfuli 2 anos atrás
pai
commit
116d2c7045
17 arquivos alterados com 366 adições e 42 exclusões
  1. 2 0
      winsea-haixin-platform-backend/src/main/resources/application.yml
  2. 2 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverCarInfoController.java
  3. 3 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverInfoController.java
  4. 10 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverCarInfo.java
  5. 14 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverInfo.java
  6. 13 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java
  7. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/PublishTaskInfo.java
  8. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/DistinguishView.java
  9. 2 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverCarInfoService.java
  10. 3 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverInfoService.java
  11. 7 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java
  12. 44 24
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java
  13. 6 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  14. 2 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java
  15. 238 8
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java
  16. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml
  17. 2 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/PublishTaskInfoMapper.xml

+ 2 - 0
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -76,6 +76,8 @@ auth:
     - /searchRecordsInfo/**/*
     - /saleOrder/*
     - /saleOrder/**/*
+    - /commonSysParameter/*
+    - /commonSysParameter/**/*
     - /driverInfo/*
     - /driverInfo/**/*
     - /driverCarInfo/*

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

@@ -10,6 +10,7 @@ import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -49,7 +50,7 @@ public class DriverCarInfoController {
      * 添加信息
      */
     @PostMapping("/api/addInfo")
-    public String addInfo(@RequestBody HyDriverCarInfo hyDriverCarInfo){
+    public String addInfo(@RequestBody HyDriverCarInfo hyDriverCarInfo) throws IOException {
         return driverCarInfoService.addInfo(hyDriverCarInfo);
     }
 

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

@@ -9,6 +9,8 @@ import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.io.IOException;
+
 /**
  * <p>
  * 记录司机信息 前端控制器
@@ -49,7 +51,7 @@ public class DriverInfoController {
      * 添加信息
      */
     @PostMapping("/api/addInfo")
-    public String addInfo(@RequestBody HyDriverInfo hyDriverInfo){
+    public String addInfo(@RequestBody HyDriverInfo hyDriverInfo) throws IOException{
         return driverInfoService.addInfo(hyDriverInfo);
     }
 
@@ -69,7 +71,6 @@ public class DriverInfoController {
         return driverInfoService.editProportion(hyDriverInfo);
     }
 
-
     /**
      * 审核
      * @param

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

@@ -51,6 +51,14 @@ public class HyDriverCarInfo extends BaseModel<HyDriverCarInfo> {
      * 挂车号
      */
     private String guaCarNumber;
+    /**
+     * 车辆类型
+     */
+    private String vehicleType;
+    /**
+     * 车辆识别代号
+     */
+    private String carCode;
     /**
      * 车牌颜色
      */
@@ -304,6 +312,8 @@ public class HyDriverCarInfo extends BaseModel<HyDriverCarInfo> {
      */
     @TableField(exist = false)
     private String avatarUrl;
+    @TableField(exist = false)
+    private String token;
 
     @Override
     protected Serializable pkVal() {

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

@@ -53,6 +53,10 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      * 司机性别
      */
     private String driverSex;
+    /**
+     * 司机生日
+     */
+    private String driverBirthday;
     /**
      * 司机称呼
      */
@@ -94,7 +98,13 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      */
     private String driverLicenseBackPage;
     /**
-     * 驾驶证有效期
+     * 驾驶证有效期自(开始时间)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date driverLicenseValidityStartDate;
+    /**
+     * 驾驶证有效期至(结束时间)
      */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -228,6 +238,9 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
     @TableField(exist = false)
     private String avatarUrl;
 
+    @TableField(exist = false)
+    private String token;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 13 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java

@@ -53,9 +53,13 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      */
     private String cargoCommonId;
     /**
-     * 合同编号
+     * 承运合同编号
      */
     private String contractNo;
+    /**
+     * 委托合同编号
+     */
+    private String wtContractNo;
     /**
      * 订单编号
      */
@@ -116,6 +120,14 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      * 卸货地详细地址
      */
     private String unloadDetailedAddress;
+    /**
+     * 货物类别key
+     */
+    private String goodsTypeKey;
+    /**
+     * 货物类别
+     */
+    private String goodsType;
     /**
      * 货名key
      */

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

@@ -104,6 +104,14 @@ public class PublishTaskInfo extends BaseModel<PublishTaskInfo> {
      * 距离(公里)
      */
     private Double distance;
+    /**
+     * 货物类别key
+     */
+    private String goodsTypeKey;
+    /**
+     * 货物类别
+     */
+    private String goodsType;
     /**
      * 货名key
      */

+ 9 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/DistinguishView.java

@@ -15,6 +15,7 @@ public class DistinguishView {
     private String bankBranch;
     private String recPerson;
     private String recPersonNo;
+    private String recPersonBrithday;
     private String recPersonAddr;
     //身份证有效期
     private String idCardValidity;
@@ -66,6 +67,14 @@ public class DistinguishView {
     private String licenseIssueDate;
     //行驶证发证机关
     private String lssuingAuthority;
+    /**
+     * 车辆类型
+     */
+    private String vehicleType;
+    /**
+     * 车辆识别代号
+     */
+    private String carCode;
 
 
 

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverCarInfo;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -35,7 +36,7 @@ public interface IDriverCarInfoService extends IService<HyDriverCarInfo> {
      * @param hyDriverCarInfo
      * @return
      */
-    String addInfo(HyDriverCarInfo hyDriverCarInfo);
+    String addInfo(HyDriverCarInfo hyDriverCarInfo) throws IOException;
 
     /**
      * 编辑车辆信息

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

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.io.IOException;
+
 /**
  * <p>
  * 记录司机信息 服务类
@@ -26,7 +28,7 @@ public interface IDriverInfoService extends IService<HyDriverInfo> {
      * @param hyDriverInfo
      * @return
      */
-    String addInfo(HyDriverInfo hyDriverInfo);
+    String addInfo(HyDriverInfo hyDriverInfo) throws IOException;
 
     /**
      * 审核

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

@@ -12,9 +12,11 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.DriverCarInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IDriverCarInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -77,7 +79,7 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
      * @return
      */
     @Override
-    public String addInfo(HyDriverCarInfo hyDriverCarInfo){
+    public String addInfo(HyDriverCarInfo hyDriverCarInfo) throws IOException {
         //新增主键id
         hyDriverCarInfo.setId(IdGenerator.generateUUID());
         //判断车牌号是否重复
@@ -91,6 +93,10 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         this.insert(hyDriverCarInfo);
+
+        String token = EntityAnalyse.GetJTToken();
+        hyDriverCarInfo.setToken(token);
+        EntityAnalyse.uploadDriverCarInfo(hyDriverCarInfo);
         return "ok";
     }
 

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

@@ -1,5 +1,6 @@
 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;
@@ -13,15 +14,29 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 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.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
 
 /**
  * <p>
@@ -51,7 +66,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      * @return
      */
     @Override
-    public Page<HyDriverInfo> selectDriverInfoPage(HyDriverInfo driverViewInfo) {
+    public Page<HyDriverInfo> selectDriverInfoPage(HyDriverInfo driverViewInfo){
         Map<String, Object> pageView = new HashMap<>(11);
         pageView.put("startRecord", (driverViewInfo.getCurrentPage() - 1)
                 * driverViewInfo.getPageSize());
@@ -64,14 +79,14 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         // 查询司机总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<HyDriverInfo> dataList = baseMapper.getListByCondition(pageView);
-        if (!CollectionUtils.isEmpty(dataList)){
+        if (!CollectionUtils.isEmpty(dataList)) {
             dataList.forEach(driverViewInfo1 -> {
                 driverViewInfo1.setHyDriverCarInfoList(driverCarInfoService.selectList(new EntityWrapper<HyDriverCarInfo>()
-                        .eq(HyDriverCarInfo.QueryFiles.COMMON_ID,driverViewInfo1.getCommonId())
-                        .eq(HyDriverCarInfo.QueryFiles.DELETE_FLAG,NumberConstant.CONSTANT0)));
+                        .eq(HyDriverCarInfo.QueryFiles.COMMON_ID, driverViewInfo1.getCommonId())
+                        .eq(HyDriverCarInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0)));
                 driverViewInfo1.setHyDriverPayeeInfoList(driverPayeeInfoService.selectList(new EntityWrapper<HyDriverPayeeInfo>()
-                        .eq(HyDriverPayeeInfo.QueryFiles.COMMON_ID,driverViewInfo1.getCommonId())
-                        .eq(HyDriverPayeeInfo.QueryFiles.DELETE_FLAG,NumberConstant.CONSTANT0)));
+                        .eq(HyDriverPayeeInfo.QueryFiles.COMMON_ID, driverViewInfo1.getCommonId())
+                        .eq(HyDriverPayeeInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0)));
             });
         }
         Page<HyDriverInfo> page = new Page<>();
@@ -84,15 +99,16 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
 
     /**
      * 第一次认证
+     *
      * @param driverPhone
      * @return
      */
     @Override
     public HyDriverInfo firstAuthentication(String driverPhone) {
         HyDriverInfo hyDriverInfo = this.selectOne(new EntityWrapper<HyDriverInfo>()
-        .eq("driver_phone",driverPhone)
-        .eq("delete_flag",0));
-        if (hyDriverInfo == null){
+                .eq("driver_phone", driverPhone)
+                .eq("delete_flag", 0));
+        if (hyDriverInfo == null) {
             HyDriverInfo hyDriverInfo1 = new HyDriverInfo();
             hyDriverInfo1.setAuthenticationStatus("未认证");
             return hyDriverInfo1;
@@ -108,7 +124,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String addInfo(HyDriverInfo hyDriverInfo) {
+    public String addInfo(HyDriverInfo hyDriverInfo) throws IOException {
         //新增主键id
         hyDriverInfo.setId(IdGenerator.generateUUID());
         hyDriverInfo.setFirstFlag("1");
@@ -139,7 +155,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
             //将list转换为set
             HashSet<HyDriverPayeeInfo> set = new HashSet<>(hyDriverPayeeInfoList);
             boolean result = set.size() == hyDriverPayeeInfoList.size() ? true : false;
-            if (result == false){
+            if (result == false) {
                 //list中有重复元素
                 throw new YException(YExceptionEnum.BANKCARD_ADDED);
             }
@@ -151,6 +167,10 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         }
         boolean one = this.insert(hyDriverInfo);
         boolean three = driverPayeeInfoService.insertBatch(hyDriverPayeeInfoList);
+
+        String token = EntityAnalyse.GetJTToken();
+        hyDriverInfo.setToken(token);
+        EntityAnalyse.uploadDriverInfo(hyDriverInfo);
         // 假如 都成功返回ok
         if (one && three) {
             return "OK";
@@ -160,7 +180,6 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     }
 
 
-
     /**
      * 编辑信息
      */
@@ -234,7 +253,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 newsInfoService.addNewsInfo(newsInfo);
             }
             //驳回
-            else if("2".equals(hyDriverInfo.getFlag())){
+            else if ("2".equals(hyDriverInfo.getFlag())) {
                 hyDriverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
                 hyDriverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
                 hyDriverInfo1.setBackStageStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
@@ -270,24 +289,25 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
 
     /**
      * 司机详情
-     * @param  hyDriverInfo
+     *
+     * @param hyDriverInfo
      * @return
      */
     @Override
-    public HyDriverInfo getDriver(HyDriverInfo hyDriverInfo){
+    public HyDriverInfo getDriver(HyDriverInfo hyDriverInfo) {
         //查询司机信息
         HyDriverInfo hyDriverInfo1 = this.selectOne(new EntityWrapper<HyDriverInfo>().eq("common_id", hyDriverInfo.getCommonId())
-                .eq("delete_flag","0"));
+                .eq("delete_flag", "0"));
         //头像
         CommonUser commonUser = commonUserService.selectOne(new EntityWrapper<CommonUser>().eq("id", hyDriverInfo.getCommonId())
-                .eq("delete_flag","0"));
-        if (commonUser != null){
+                .eq("delete_flag", "0"));
+        if (commonUser != null) {
             hyDriverInfo1.setAvatarUrl(commonUser.getAvatarUrl());
         }
         //查询车辆信息
         List<HyDriverCarInfo> hyDriverCarInfos = driverCarInfoService.selectList(new EntityWrapper<HyDriverCarInfo>().eq("driver_id", hyDriverInfo1.getId())
-                .eq("delete_flag","0"));
-        if (!CollectionUtils.isEmpty(hyDriverCarInfos)){
+                .eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(hyDriverCarInfos)) {
             hyDriverInfo1.setHyDriverCarInfoList(hyDriverCarInfos);
         }
         return hyDriverInfo1;

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

@@ -413,7 +413,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
             else if ("2".equals(orderInfo.getTerminator())) {
                 //司机端和货主端装态改为已终止
                 orderInfo1.setTerminator("2");
-
+                orderInfo1.setTerminationReason(orderInfo.getTerminationReason());
+                orderInfo1.setTerminationReasonDescription(orderInfo.getTerminationReasonDescription());
                 // 向司机发送信息
                 NewsInfo newsInfo = new NewsInfo();
                 newsInfo.setCrtCommonId(orderInfo1.getCargoCommonId());
@@ -875,8 +876,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         //货主签合同
         if (orderInfo.getTypeFlag().equals("1")) {
             OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
-            orderInfo1.setCargoOwnerContract("1");
+            if ("2".equals(orderInfo.getSubmitFlag())) {
+                orderInfo1.setCargoOwnerContract("1");
+            }
             orderInfo1.setCargoOwnerAutograph(orderInfo.getCargoOwnerAutograph());
+            orderInfo1.setWtContractNo(orderInfo1.getOrderNo().replace("CY", "WTHT"));
             String pdfUrl = pdfUtil.transactionContract(orderInfo1);
             orderInfo1.setOwnerContractUrl(pdfUrl);
             this.updateById(orderInfo1);

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

@@ -1228,6 +1228,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         orderInfo.setUnloadArea(publishTaskInfo.getUnloadArea());
         orderInfo.setUnloadCity(publishTaskInfo.getUnloadCity());
         orderInfo.setUnloadPrivate(publishTaskInfo.getUnloadPrivate());
+        orderInfo.setGoodsTypeKey(publishTaskInfo.getGoodsTypeKey());
+        orderInfo.setGoodsType(publishTaskInfo.getGoodsType());
         orderInfo.setGoodsName(publishTaskInfo.getGoodsName());
         orderInfo.setDistance(publishTaskInfo.getDistance());
         orderInfo.setFreight(publishTaskInfo.getFreightPrice());

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

@@ -3,29 +3,33 @@ package com.yh.saas.plugin.yiliangyiyun.util;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyun.oss.ServiceException;
+import com.baomidou.mybatisplus.MybatisSqlSessionTemplate;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.mapper.Wrapper;
-import com.yh.saas.plugin.yiliangyiyun.entity.view.ConfigDO;
+import com.yh.saas.plugin.yiliangyiyun.entity.HyCommonSysParameter;
+import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverCarInfo;
+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.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
+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.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
+import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.net.URLEncoder;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
+import java.nio.charset.StandardCharsets;
+import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -33,7 +37,230 @@ import java.util.Map;
 
 public class EntityAnalyse {
 
+    @Autowired
+    public static ICommonSysParameterService commonSysParameterService;
+
+
+    /**
+     * 获取交投系统token
+     * @return
+     * @throws IOException
+     */
+    public static String GetJTToken() throws IOException {
+        String pwd = DigestUtils.sha1Hex("Ccj841968545");
+        String url = "http://116.182.4.67:50065/platform/login/login";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(url);
+        JSONObject params = new JSONObject();
+        params.put("loginAccount", "18241771147");
+        params.put("loginPwd", pwd);
+        httpPost.setEntity(new StringEntity(params.toString(), StandardCharsets.UTF_8));
+        // 设置header信息
+        httpPost.setHeader("Content-type", "application/json");
+        CloseableHttpResponse response = httpClient.execute(httpPost);
+        try {
+            // 执行请求操作,并拿到结果(同步阻塞)
+            String body = EntityUtils.toString(response.getEntity());
+            JSONObject jsonObject = JSONObject.parseObject(body);
+            if(jsonObject.getString("status").equals("1001")){
+                String token = jsonObject.getJSONObject("result").getString("token");
+                System.out.println("token = " + token);
+                return token;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            // 释放链接
+            response.close();
+            httpClient.close();
+        }
+        return "";
+    }
+
+    /**
+     * 上传文件
+     * @param image
+     * @return
+     * @throws IOException
+     */
+    public static String uploadImage(File image) throws IOException {
+        String url = "http://116.182.4.67:50065/platform/file/uploadImage";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(url);
+        JSONObject params = new JSONObject();
+        params.put("image", image);
+
+        httpPost.setEntity(new StringEntity(params.toString(), StandardCharsets.UTF_8));
+        // 设置header信息
+        httpPost.setHeader("Content-type", "application/json");
+        String token = EntityAnalyse.GetJTToken();
+        httpPost.setHeader("token", token);
+        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 "";
+    }
+
+    /**
+     * 上报驾驶员信息
+     * @param hyDriverInfo
+     * @return
+     * @throws IOException
+     */
+    public static String uploadDriverInfo(HyDriverInfo hyDriverInfo) throws IOException {
+        String url = "http://116.182.4.67:50065/platform/api/v1/driver";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 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", hyDriverInfo.getDriverLicenseValidityStartDate());
+        params.put("validPeriodTo", hyDriverInfo.getDriverLicenseValidityDate());
+        params.put("qualificationCertificate", hyDriverInfo.getQualificationCertificateNumber());
+        params.put("telephone", hyDriverInfo.getDriverPhone());
+        params.put("remark", hyDriverInfo.getDriverName() + hyDriverInfo.getDriverPhone());
+        params.put("idCardFrontImg", EntityAnalyse.uploadImage(new File(hyDriverInfo.getCardAddressUrl())));
+        params.put("idCardBackImg", EntityAnalyse.uploadImage(new File(hyDriverInfo.getCardBackAddressUrl())));
+        params.put("driverLicenseFirstSheetImg", EntityAnalyse.uploadImage(new File(hyDriverInfo.getDriverLicenseHomePage())));
+        params.put("driverLicenseSecondSheetImg", EntityAnalyse.uploadImage(new File(hyDriverInfo.getDriverLicenseBackPage())));
+        params.put("transportCertificationImg", EntityAnalyse.uploadImage(new File(hyDriverInfo.getQualificationCertificate())));
+        params.put("idCardValidPeriodTo", hyDriverInfo.getCardValidityDate());
+        params.put("transportCertificationValidPeriodTo", hyDriverInfo.getQualificationCertificateValidityDate());
+        if ("男".equals(hyDriverInfo.getDriverSex())){
+            params.put("driverSex", "1");
+        }else {
+            params.put("driverSex", "2");
+        }
+        params.put("driverBirthday", hyDriverInfo.getDriverBirthday());
+        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 "";
+    }
+
+    /**
+     * 上报车辆信息
+     * @param hyDriverCarInfo
+     * @return
+     * @throws IOException
+     */
+    public static String uploadDriverCarInfo(HyDriverCarInfo hyDriverCarInfo) throws IOException {
+        String url = "http://116.182.4.67:50065/platform/api/v1//vehicle";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(url);
+        JSONObject params = new JSONObject();
+        params.put("vehicleNumber", hyDriverCarInfo.getCarNumber());
+        if ("黄色".equals(hyDriverCarInfo.getCarNumberColour())){
+            params.put("vehiclePlateColorCode", "2");
+        }else if ("蓝色".equals(hyDriverCarInfo.getCarNumberColour())){
+            params.put("vehiclePlateColorCode", "1");
+        }
+        HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                .eq("const_id","CAR1").eq("const_value",hyDriverCarInfo.getVehicleType()));
+        params.put("vehicleType", hyCommonSysParameter.getConstKey());
+        params.put("owner", hyDriverCarInfo.getOwner());
+        params.put("useCharacter", hyDriverCarInfo.getUseNature());
+        params.put("vin", hyDriverCarInfo.getCarCode());
+        params.put("issuingOrganizations", hyDriverCarInfo.getLssuingAuthority());
+        params.put("vehicleLength", hyDriverCarInfo.getCarLong());
+        params.put("vehicleWidth", hyDriverCarInfo.getCarWidth());
+        params.put("vehicleHeight", hyDriverCarInfo.getCarHeight());
+        params.put("registerDate", hyDriverCarInfo.getDrivingLicenseRegistrationDate());
+        params.put("issueDate", hyDriverCarInfo.getDrivingLicenseIssueDate());
+        if ("汽油".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "A");
+        }else if ("柴油".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "B");
+        }else if ("油电混合".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "O");
+        }else if ("纯电动".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "C");
+        }else if ("插电式混合动力".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "O");
+        }else if ("增程式".equals(hyDriverCarInfo.getEnergyType())){
+            params.put("vehicleEnergyType", "Z");
+        }
+        params.put("vehicleTonnage", new DecimalFormat("#.00").format(hyDriverCarInfo.getCarApprovedWeight()*100000));
+        if ("非挂车".equals(hyDriverCarInfo.getCarCategory())){
+            params.put("grossMass", new DecimalFormat("#.00").format(hyDriverCarInfo.getCarTotalWeight()*100000));
+        }else {
+            params.put("grossMass", new DecimalFormat("#.00").format(hyDriverCarInfo.getServicingWeight()*100000));
+        }
+        params.put("roadTransportCertificateNumber", hyDriverCarInfo.getOperationCertificateNumber());
+        if (hyDriverCarInfo.getGuaCarNumber() != null){
+            params.put("trailerVehiclePlateNumber", hyDriverCarInfo.getGuaCarNumber());
+        }
+        params.put("licenseValidPeriodTo", hyDriverCarInfo.getDrivingLicenseValidityDate());
+        params.put("transportValidPeriodTo", hyDriverCarInfo.getOperationCertificateValidityDate());
+        params.put("vehicleLicenseFirstSheetImg", EntityAnalyse.uploadImage(new File(hyDriverCarInfo.getDrivingLicenseHomePage())));
+        params.put("vehicleLicenseSecondSheetImg", EntityAnalyse.uploadImage(new File(hyDriverCarInfo.getDrivingLicenseBackPage())));
+        params.put("transportLicenseFirstSheetImg", EntityAnalyse.uploadImage(new File(hyDriverCarInfo.getOperationCertificate())));
+        params.put("vehicleDriverImg", EntityAnalyse.uploadImage(new File(hyDriverCarInfo.getAddressUrl())));
+
+        httpPost.setEntity(new StringEntity(params.toString(), StandardCharsets.UTF_8));
+        // 设置header信息
+        httpPost.setHeader("Content-type", "application/json");
+        httpPost.setHeader("token", hyDriverCarInfo.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 "";
+    }
+
+    /**
+     * 银行卡识别
+     * @param bankImg
+     * @return
+     * @throws ServiceException
+     */
     public static DistinguishView bankShibie(String bankImg) throws ServiceException {
+
         String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
         String host = "https://api06.aliyun.venuscn.com";
         String path = "/ocr/bank-card";
@@ -169,6 +396,7 @@ public class EntityAnalyse {
                 distinguishView.setRecPerson(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("姓名"));
                 distinguishView.setRecPersonNo(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("身份证号"));
                 distinguishView.setRecPersonAddr(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("住址"));
+                distinguishView.setRecPersonBrithday(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("出生日期"));
             }
             else if("2".equals(flag))
             {
@@ -336,6 +564,8 @@ public class EntityAnalyse {
                 String t3 = t.substring(6,8);
                 distinguishView.setLicenseIssueDate(t1 + "-" + t2 + "-" + t3);
                 distinguishView.setLssuingAuthority(jsonObject.getString("issue_organization"));
+                distinguishView.setVehicleType(jsonObject.getString("vehicle_type"));
+                distinguishView.setCarCode(jsonObject.getString("vin"));
             }else {
                 String s = jsonObject.getString("inspection_record");
                 String s3 = s.substring(6,13);

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml

@@ -70,6 +70,7 @@
         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,

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

@@ -41,6 +41,8 @@
         p.id,
         p.task_no as taskNo,
         p.cargo_owner as cargoOwner,
+        p.goods_type_key as goodsTypeKey,
+        p.goods_type as goodsType,
         p.goods_name as goodsName,
         p.send_private as sendPrivate,
         p.send_city as sendCity,