haungfuli 2 yıl önce
ebeveyn
işleme
dd215acc69

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

@@ -210,6 +210,16 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      */
     @TableField(exist = false)
     private String driverAddress;
+    /**
+     *收款人身份证正面
+     */
+    @TableField(exist = false)
+    private String payeeIDCardFront;
+    /**
+     *收款人身份证反面
+     */
+    @TableField(exist = false)
+    private String payeeIDCardBack;
     /**
      *司机账号
      */

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

@@ -706,6 +706,30 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      */
     @TableField(exist = false)
     private String unsendLatitude;
+    /**
+     * 装车时间
+     */
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date loadingDate;
+    /**
+     * 卸车时间
+     */
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date unloadingDate;
+    /**
+     * 装车经纬度
+     */
+    @TableField(exist = false)
+    private String loadingLonLat;
+    /**
+     * 卸车经纬度
+     */
+    @TableField(exist = false)
+    private String unloadingLonLat;
     /**
      * 体积(立方米)
      */
@@ -716,6 +740,11 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      */
     @TableField(exist = false)
     private Integer packageNumber;
+    /**
+     * 回单照片
+     */
+    @TableField(exist = false)
+    private String receiptImg;
     /**
      * 管局上报列表状态(1未上报2上报失败3上报成功)
      */

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

@@ -56,6 +56,7 @@ public enum YExceptionEnum {
 	SHANG_BAO_ERROR("ERROR33", "园区上报信息错误,详情见司机信息上报页面!"),
 	ID_CARD_NOT_EQUALS("ERROR34", "身份证号与司机认证信息不一致!"),
 	WAS_NOT_FOUND_USER("ERROR34", "未找到该用户!"),
+	FAILED_TO_REPORT("ERROR35", "上报失败!"),
 	;
 	@Getter
 	private String value;

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

@@ -305,17 +305,25 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
                         @Override
                         public void run() {
                             try {
-                                EntityAnalyse.uploadDriverCarInfo(hyDriverCarInfo1);
+                                String result = EntityAnalyse.uploadDriverCarInfo(hyDriverCarInfo1);
+                                if ("数据上报成功,数据完整,等待系统校验".equals(result)){
+                                    //更改上报状态
+                                    hyDriverCarInfo1.setEscalationDate(new Date());
+                                    hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+                                    hyDriverCarInfo1.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+                                    driverCarInfoService.updateById(hyDriverCarInfo1);
+                                }else {
+                                    hyDriverCarInfo1.setEscalationDate(new Date());
+                                    hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
+                                    hyDriverCarInfo1.setEscalationStatus(StatusEnum.FAIL.getName());
+                                    hyDriverCarInfo1.setEscalationFailureReason(result);
+                                    driverCarInfoService.updateById(hyDriverCarInfo1);
+                                }
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }
                         }
                     }).start();
-                    //更改上报状态
-                    hyDriverCarInfo1.setEscalationDate(new Date());
-                    hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
-                    hyDriverCarInfo1.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
-                    this.updateById(hyDriverCarInfo1);
                 }
             }
             return "ok";

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

@@ -124,7 +124,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
             //获取token
             String token = EntityAnalyse.GetJTToken();
             for (OrderInfo orderInfo : orderInfoList) {
-                //上报车辆信息校验结果查询
+                //上报运单信息校验结果查询
                 orderInfo.setToken(token);
                 if ("通过".equals(EntityAnalyse.waybillCheck(orderInfo))) {
                     orderInfo.setEscalationStatusKey(StatusEnum.ADOPTED.getFlag());

+ 35 - 13
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java

@@ -518,14 +518,28 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                     //查询上报所需信息
                     //查询订单
                     OrderInfo orderInfo1 = orderInfoService.selectById(hyFreightSettlementInfo1.getOrderId());
-                    //司机信息
-                    HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
-                            .eq("common_id", hyFreightSettlementInfo1.getCommonId()).eq("delete_flag", "0"));
-                    hyFreightSettlementInfo1.setDriverIdCard(hyDriverInfo.getNumberCard());
-                    hyFreightSettlementInfo1.setDriverSex(hyDriverInfo.getDriverSex());
-                    hyFreightSettlementInfo1.setDriverBirthday(hyDriverInfo.getDriverBirthday());
-                    hyFreightSettlementInfo1.setDriverPhone(hyDriverInfo.getDriverPhone());
-                    hyFreightSettlementInfo1.setDriverAddress(hyDriverInfo.getCardAddress());
+                    if (orderInfo1.getCarCaptainCommonId() == null){
+                        //该司机没有车队长
+                        //司机信息
+                        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                                .eq("common_id", hyFreightSettlementInfo1.getCommonId()).eq("delete_flag", "0"));
+                        hyFreightSettlementInfo1.setDriverSex(hyDriverInfo.getDriverSex());
+                        hyFreightSettlementInfo1.setDriverBirthday(hyDriverInfo.getDriverBirthday());
+                        hyFreightSettlementInfo1.setDriverPhone(hyDriverInfo.getDriverPhone());
+                        hyFreightSettlementInfo1.setDriverAddress(hyDriverInfo.getCardAddress());
+                        hyFreightSettlementInfo1.setPayeeIDCardFront(hyDriverInfo.getCardAddressUrl());
+                        hyFreightSettlementInfo1.setPayeeIDCardBack(hyDriverInfo.getCardBackAddressUrl());
+                    }else {
+                        //该司机有车队长,收款人账户信息为车队长
+                        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                                .eq("common_id", hyFreightSettlementInfo1.getCarCaptainCommonId()).eq("delete_flag", "0"));
+                        hyFreightSettlementInfo1.setDriverSex(hyDriverInfo.getDriverSex());
+                        hyFreightSettlementInfo1.setDriverBirthday(hyDriverInfo.getDriverBirthday());
+                        hyFreightSettlementInfo1.setDriverPhone(hyDriverInfo.getDriverPhone());
+                        hyFreightSettlementInfo1.setDriverAddress(hyDriverInfo.getCardAddress());
+                        hyFreightSettlementInfo1.setPayeeIDCardFront(hyDriverInfo.getCardAddressUrl());
+                        hyFreightSettlementInfo1.setPayeeIDCardBack(hyDriverInfo.getCardBackAddressUrl());
+                    }
                     //车辆信息
                     HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
                             .eq("car_number", orderInfo1.getCarNumber()).eq("delete_flag", "0"));
@@ -545,16 +559,24 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                         @Override
                         public void run() {
                             try {
-                                EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
+                                String result = EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
+                                if ("数据上报成功,数据完整,等待系统校验".equals(result)){
+                                    //更改上报状态
+                                    hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                                    hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                                    hyFreightSettlementInfoService.updateById(hyFreightSettlementInfo1);
+                                }else {
+                                    //更改上报状态
+                                    hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.NOT_ADOPT.getFlag());
+                                    hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.NOT_ADOPT.getName());
+                                    hyFreightSettlementInfo1.setEscalationFailureReason(result);
+                                    hyFreightSettlementInfoService.updateById(hyFreightSettlementInfo1);
+                                }
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }
                         }
                     }).start();
-                    //更改上报状态
-                    hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
-                    hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
-                    this.updateById(hyFreightSettlementInfo1);
                 }
             }
             return "ok";

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

@@ -21,6 +21,7 @@ import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
 import lombok.Getter;
+import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import net.sf.json.JSONObject;
 import org.activiti.engine.impl.util.CollectionUtil;
@@ -34,6 +35,7 @@ import org.apache.commons.httpclient.util.DateUtil;
 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.BasicCookieStore;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
@@ -55,6 +57,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.net.URISyntaxException;
 import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -945,7 +948,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
     }
 
     /**
-     * 运单批量上报
+     * 运单园区批量上报
      *
      * @param orderInfo
      * @return
@@ -963,20 +966,98 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
 
                     //园区上报
                     orderInfo1.setToken(token);
+
+                    //1.查询任务,获取业务类型代码
+                    PublishTaskInfo publishTaskInfo = publishTaskInfoService.selectById(orderInfo1.getTaskId());
+                    if (publishTaskInfo != null) {
+                        orderInfo1.setBusinessTypeCode(publishTaskInfo.getBusinessTypeKey());
+                        orderInfo1.setShipToName(publishTaskInfo.getReceiver());
+                        if (publishTaskInfo.getReceiverIdcard() == null && publishTaskInfo.getReceiverIdcard().isEmpty()) {
+                            orderInfo1.setShipToID(publishTaskInfo.getReceiverCreditCode());
+                        } else {
+                            orderInfo1.setShipToID(publishTaskInfo.getReceiverIdcard());
+                        }
+                        if (!"个人货主".equals(publishTaskInfo.getCargoOwner()) && publishTaskInfo.getCompId() != null) {
+                            //查询公司社会信用代码
+                            HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(publishTaskInfo.getCompId());
+                            if (hyCompanyInfo != null) {
+                                orderInfo1.setConsignorID(hyCompanyInfo.getUnifiedSocialCreditCode());
+                            }
+                        }
+                    }
+                    //2.查询承运表,装卸货时间
+                    HyCarrierInfo hyCarrierInfo = carrierInfoService.selectOne(new EntityWrapper<HyCarrierInfo>().eq("order_id", orderInfo1.getId())
+                            .eq("delete_flag", "0"));
+                    if (hyCarrierInfo != null) {
+                        orderInfo1.setDeliveryTime(hyCarrierInfo.getLoadingDate());
+                        orderInfo1.setReceivingTime(hyCarrierInfo.getUnloadingDate());
+                        orderInfo1.setGrossWeight(hyCarrierInfo.getLoadingGrossWeight());
+                        orderInfo1.setVolume(hyCarrierInfo.getVolume());
+                        orderInfo1.setPackageNumber(hyCarrierInfo.getPackageNumber());
+                        orderInfo1.setLoadingDate(hyCarrierInfo.getLoadingDate());
+                        orderInfo1.setUnloadingDate(hyCarrierInfo.getUnloadingDate());
+                        orderInfo1.setLoadingLonLat(hyCarrierInfo.getLoadingLongitude() + "," + hyCarrierInfo.getLoadingLatitude());
+                        orderInfo1.setUnloadingLonLat(hyCarrierInfo.getUnloadingLongitude() + "," + hyCarrierInfo.getUnloadingLatitude());
+                        orderInfo1.setReceiptImg(hyCarrierInfo.getReceiptImg());
+                    }
+                    //3.查询托运人信息
+                    HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
+                            .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+                    if (hyCargoOwnerInfo != null) {
+                        orderInfo1.setConsignorName(hyCargoOwnerInfo.getName());
+                        if ("个人货主".equals(publishTaskInfo.getCargoOwner())) {
+                            //查询托运人身份证号
+                            orderInfo1.setConsignorID(hyCargoOwnerInfo.getCardNumber());
+                        }
+                    }
+                    //查询发货地区行政区划代码
+                    HyCommonSysParameter hyCommonSysParameter2 = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                            .eq("const_id", "REGION1").eq("const_value", orderInfo1.getSendArea()));
+                    orderInfo1.setNationalCode(hyCommonSysParameter2.getConstKey());
+                    //查询收货地区行政区划代码
+                    HyCommonSysParameter hyCommonSysParameter1 = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                            .eq("const_id", "REGION1").eq("const_value", orderInfo1.getUnloadArea()));
+                    orderInfo1.setShipToNationalCode(hyCommonSysParameter1.getConstKey());
+                    //判断该司机是否有车队长
+                    if (orderInfo1.getCarCaptainCommonId() != null && !orderInfo1.getCarCaptainCommonId().isEmpty()) {
+                        //有车队长
+                        //查询车队长信息
+                        HyCarCaptainInfo hyCarCaptainInfo = hyCarCaptainInfoService.selectOne(new EntityWrapper<HyCarCaptainInfo>()
+                                .eq("common_id", orderInfo1.getCarCaptainCommonId()).eq("delete_flag", "0"));
+                        if (hyCarCaptainInfo != null) {
+                            orderInfo1.setRoadTransportBusinessLicenseNo(hyCarCaptainInfo.getRoadTransportOperationLicenseNo());
+                        }
+                    } else {
+                        //查询司机信息
+                        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                                .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
+                        if (hyDriverInfo != null) {
+                            orderInfo1.setRoadTransportBusinessLicenseNo(hyDriverInfo.getActualCarrierBusinessLicense());
+                        }
+                    }
                     new Thread(new Runnable() {
+                        @SneakyThrows
                         @Override
                         public void run() {
                             try {
-                                EntityAnalyse.uploadWaybill(orderInfo1);
+                                String result = EntityAnalyse.uploadWaybill(orderInfo1);
+                                if ("数据上报成功,数据完整,等待系统校验".equals(result)){
+                                    //更改上报状态
+                                    orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                                    orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                                    orderInfoService.updateById(orderInfo1);
+                                }else {
+                                    //更改上报状态
+                                    orderInfo1.setEscalationStatusKey(StatusEnum.NOT_ADOPT.getFlag());
+                                    orderInfo1.setEscalationStatus(StatusEnum.NOT_ADOPT.getName());
+                                    orderInfo1.setEscalationFailureReason(result);
+                                    orderInfoService.updateById(orderInfo1);
+                                }
                             } catch (Exception e) {
                                 e.printStackTrace();
                             }
                         }
                     }).start();
-                    //更改上报状态
-                    orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
-                    orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
-                    this.updateById(orderInfo1);
                 }
             }
             return "ok";

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

@@ -305,14 +305,46 @@ public class EntityAnalyse {
      * @throws IOException
      */
     public static String uploadWaybill(OrderInfo orderInfo) throws IOException {
+        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
+        DecimalFormat df = new DecimalFormat("0.000");
+        DecimalFormat df1 = new DecimalFormat("0.0000");
+
         String url = "http://116.182.4.67:50065/platform/api/v1/transport";
         CloseableHttpClient httpClient = HttpClients.createDefault();
         // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
         HttpPost httpPost = new HttpPost(url);
         JSONObject params = new JSONObject();
+        params.put("originalDocumentNumber", orderInfo.getOrderNo());
         params.put("shippingNoteNumber", orderInfo.getOrderNo());
         params.put("serialNumber", "0000");
+        params.put("vehicleAmount", "1");
+        params.put("transportTypeCode", "1");
+        params.put("sendToProDateTime", f.format(new Date()));
+        params.put("carrier", "黑龙江畅运通物流供应链有限公司");
         params.put("unifiedSocialCreditIdentifier", "91230229MABPEWQX94");
+        params.put("permitNumber", "230229200940");
+        params.put("consignmentDateTime", f.format(orderInfo.getCreateDate()));
+        params.put("businessTypeCode", orderInfo.getBusinessTypeCode());
+        params.put("despatchActualDateTime", f.format(orderInfo.getDeliveryTime()));
+        params.put("goodsReceiptDateTime", f.format(orderInfo.getReceivingTime()));
+
+        //托运人信息
+        JSONObject consignorInfoQuery = new JSONObject();
+        consignorInfoQuery.put("consignor", orderInfo.getConsignorName());
+        consignorInfoQuery.put("consignorId", orderInfo.getConsignorID());
+        consignorInfoQuery.put("placeOfLoading", orderInfo.getSendPrivate() + orderInfo.getSendCity() + orderInfo.getSendArea() + orderInfo.getSendDetailedAddress());
+        consignorInfoQuery.put("countrySubdivisionCode", orderInfo.getNationalCode());
+        params.put("consignorInfoQuery", consignorInfoQuery);
+
+        //收货方信息
+        JSONObject consigneeInfoQuery = new JSONObject();
+        consigneeInfoQuery.put("consignee", orderInfo.getShipToName());
+        consigneeInfoQuery.put("consigneeId", orderInfo.getShipToID());
+        consigneeInfoQuery.put("goodsReceiptPlace", orderInfo.getUnloadPrivate() + orderInfo.getUnloadCity() + orderInfo.getUnloadArea() + orderInfo.getUnloadDetailedAddress());
+        consigneeInfoQuery.put("countrySubdivisionCode", orderInfo.getShipToNationalCode());
+        consigneeInfoQuery.put("totalMonetaryAmount", df.format(orderInfo.getActualFreight() * 1000));
+        params.put("consigneeInfoQuery", consigneeInfoQuery);
+
         //车辆信息
         JSONObject vehicleInfoQuery = new JSONObject();
         if ("黄色".equals(orderInfo.getCarNumberColour())) {
@@ -321,26 +353,65 @@ public class EntityAnalyse {
             vehicleInfoQuery.put("vehiclePlateColorCode", 1);
         }
         vehicleInfoQuery.put("vehicleNumber", orderInfo.getCarNumber());
+        vehicleInfoQuery.put("despatchActualDateTime", f.format(orderInfo.getDeliveryTime()));
+        vehicleInfoQuery.put("goodsReceiptDateTime", f.format(orderInfo.getReceivingTime()));
+        vehicleInfoQuery.put("placeOfLoading", orderInfo.getSendPrivate() + orderInfo.getSendCity() + orderInfo.getSendArea() + orderInfo.getSendDetailedAddress());
+        vehicleInfoQuery.put("loadingCountrySubdivisionCode", orderInfo.getNationalCode());
+        vehicleInfoQuery.put("goodsReceiptPlace", orderInfo.getUnloadPrivate() + orderInfo.getUnloadCity() + orderInfo.getUnloadArea() + orderInfo.getUnloadDetailedAddress());
+        vehicleInfoQuery.put("receiptCountrySubdivisionCode", orderInfo.getShipToNationalCode());
+        vehicleInfoQuery.put("driverLoadDateTime", orderInfo.getLoadingDate());
+        vehicleInfoQuery.put("driverLoadLonlat", orderInfo.getLoadingLonLat());
+        vehicleInfoQuery.put("driverUnloadDateTime", orderInfo.getUnloadingDate());
+        vehicleInfoQuery.put("driverUnloadLonlat", orderInfo.getUnloadingLonLat());
         params.put("vehicleInfoQuery", vehicleInfoQuery);
+
         //司机信息
         JSONObject drivers = new JSONObject();
         drivers.put("driverName", orderInfo.getDriverName());
         drivers.put("drivingLicense", orderInfo.getDriverIdCard());
         params.put("drivers", drivers);
+
         //货物信息
         JSONObject goodsInfos = new JSONObject();
         goodsInfos.put("descriptionOfGoods", orderInfo.getGoodsType());
         goodsInfos.put("cargoTypeClassificationCode", orderInfo.getGoodsTypeKey());
+        goodsInfos.put("goodsItemGrossWeight", df.format(orderInfo.getGrossWeight() * 1000000));
+        //todo 体积,件数
+        if (orderInfo.getVolume() != null){
+            goodsInfos.put("cube", df1.format(orderInfo.getVolume() * 10000));
+        }
+        if (orderInfo.getPackageNumber() != null) {
+            goodsInfos.put("totalNumberOfPackages", String.valueOf(orderInfo.getPackageNumber()));
+        }
         params.put("goodsInfos", goodsInfos);
 
+        //实际承运人信息
+        JSONObject actualCarrierInfo = new JSONObject();
+        actualCarrierInfo.put("actualCarrierName", orderInfo.getPayeeName());
+        actualCarrierInfo.put("actualCarrierBusinessLicense", orderInfo.getRoadTransportBusinessLicenseNo());
+        actualCarrierInfo.put("actualCarrierId", orderInfo.getPayeeIdCard());
+        params.put("actualCarrierInfo", actualCarrierInfo);
+
+        //保险信息
+        JSONObject insuranceInformation = new JSONObject();
+        insuranceInformation.put("policyNumber", orderInfo.getPolicyNo() != null ? orderInfo.getPolicyNo() : "none");
+        insuranceInformation.put("insuranceCompanyCode", orderInfo.getInsuranceCompanyCode() != null ? orderInfo.getInsuranceCompanyCode() : "none");
+        params.put("insuranceInformation", insuranceInformation);
+
+        params.put("remark", orderInfo.getRemark() != null ? orderInfo.getRemark() : "");
+        params.put("file", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(orderInfo.getDriverContractUrl())), orderInfo.getToken()));
+        params.put("ownersContractFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(orderInfo.getOwnerContractUrl())), orderInfo.getToken()));
+        params.put("backDocumentImages", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(orderInfo.getReceiptImg())), orderInfo.getToken()));
+
+
         httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
         // 设置header信息
         httpPost.setHeader("Content-type", "application/json");
         httpPost.setHeader("token", orderInfo.getToken());
-        CloseableHttpResponse response = httpClient.execute(httpPost);
+//        CloseableHttpResponse response = null;
         try {
             // 执行请求操作,并拿到结果(同步阻塞)
-            String body = EntityUtils.toString(response.getEntity());
+            String body = EntityUtils.toString(httpClient.execute(httpPost).getEntity());
             JSONObject jsonObject = JSONObject.parseObject(body);
             String result = jsonObject.getString("result");
             System.out.println("result = " + result);
@@ -349,7 +420,7 @@ public class EntityAnalyse {
             e.printStackTrace();
         } finally {
             // 释放链接
-            response.close();
+//            response.close();
             httpClient.close();
         }
         return "";
@@ -372,8 +443,8 @@ public class EntityAnalyse {
         JSONObject params = new JSONObject();
         params.put("documentNumber", hyFreightSettlementInfo.getDocumentNo());
         params.put("sendToProDateTime", f.format(new Date()));
-        params.put("carrier", hyFreightSettlementInfo.getDriverName());
-        params.put("actualCarrierId", hyFreightSettlementInfo.getDriverIdCard());
+        params.put("carrier", hyFreightSettlementInfo.getPayeeName());
+        params.put("actualCarrierId", hyFreightSettlementInfo.getPayeeIdCard());
         params.put("vehicleNumber", hyFreightSettlementInfo.getCarNumber());
         if ("黄色".equals(hyFreightSettlementInfo.getCarNumberColour())) {
             params.put("vehiclePlateColorCode", 2);
@@ -394,10 +465,10 @@ public class EntityAnalyse {
         JSONObject financial = new JSONObject();
         financial.put("shippingNoteNumber", hyFreightSettlementInfo.getOrderNo());
         financial.put("serialNumber", "0000");
-        financial.put("driverName", hyFreightSettlementInfo.getDriverName());
-        financial.put("driverLicense", hyFreightSettlementInfo.getDriverIdCard());
+        financial.put("driverName", hyFreightSettlementInfo.getPayeeName());
+        financial.put("driverLicense", hyFreightSettlementInfo.getPayeeIdCard());
         financial.put("paymentMeansCode", "32");
-        financial.put("recipient", hyFreightSettlementInfo.getDriverName());
+        financial.put("recipient", hyFreightSettlementInfo.getPayeeName());
         if ("男".equals(hyFreightSettlementInfo.getDriverSex())) {
             financial.put("sex", 1);
         } else {
@@ -409,7 +480,7 @@ public class EntityAnalyse {
         String s2 = s1.replace("月", "-");
         Date date = df.parse(s2);
         financial.put("birthday", df.format(date));
-        financial.put("idcardNumber", hyFreightSettlementInfo.getDriverIdCard());
+        financial.put("idcardNumber", hyFreightSettlementInfo.getPayeeIdCard());
         financial.put("phone", hyFreightSettlementInfo.getDriverPhone());
         financial.put("address", hyFreightSettlementInfo.getDriverAddress());
         financial.put("receiptAccount", hyFreightSettlementInfo.getBankCard());
@@ -422,6 +493,8 @@ public class EntityAnalyse {
         financial.put("monetaryAmount", intValue1);
         financial.put("dateTime", f.format(hyFreightSettlementInfo.getPaymentDate()));
         financial.put("payFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPaymentVoucher())), hyFreightSettlementInfo.getToken()));
+        financial.put("recipientIdCardBackImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPayeeIDCardBack())), hyFreightSettlementInfo.getToken()));
+        financial.put("recipientIdCardFrontImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPayeeIDCardFront())), hyFreightSettlementInfo.getToken()));
         financialList.add(financial);
         params.put("financialList", financialList);
 

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

@@ -151,6 +151,7 @@
         SELECT
         f.id,
         f.common_id as commonId,
+        f.car_captain_common_id as carCaptainCommonId,
         f.order_id as orderId,
         f.order_no as orderNo,
         f.document_no as documentNo,

+ 2 - 4
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

@@ -479,8 +479,7 @@
         </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND o.escalation_status_key = '1'
-                OR o.escalation_status_key = '3'
+                AND (o.escalation_status_key = '1' OR o.escalation_status_key = '3')
             </if>
             <if test="searchType == 2">
                 AND o.escalation_status_key = '5'
@@ -585,8 +584,7 @@
         </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND o.escalation_status_key = '1'
-                OR o.escalation_status_key = '3'
+                AND (o.escalation_status_key = '1' OR o.escalation_status_key = '3')
             </if>
             <if test="searchType == 2">
                 AND o.escalation_status_key = '5'