haungfuli 2 years ago
parent
commit
b70583d119

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

@@ -132,7 +132,7 @@ public enum StatusEnum {
     PASSED("11", "已通过", "Passed"),
     PASSED("11", "已通过", "Passed"),
     EXPIRED("13", "已过期", "repaid"),
     EXPIRED("13", "已过期", "repaid"),
 
 
-    //运单上报状态
+    //运单(资金流水单)上报状态
     NO_REPORTED("1", "未上报", "no_reported"),
     NO_REPORTED("1", "未上报", "no_reported"),
     NOT_ADOPT("3", "未通过", "not_adopt"),
     NOT_ADOPT("3", "未通过", "not_adopt"),
     UNDER_REVIEW("5", "审核中", "under_review"),
     UNDER_REVIEW("5", "审核中", "under_review"),

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

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.io.IOException;
 import java.io.IOException;
+import java.text.ParseException;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -58,8 +59,44 @@ public class HyFreightSettlementInfoController {
      */
      */
     @Log(title = "后台管理司机运费结算批量付款")
     @Log(title = "后台管理司机运费结算批量付款")
     @PostMapping("/api/paymentList")
     @PostMapping("/api/paymentList")
-    public String paymentList(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException {
+    public String paymentList(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
         return hyFreightSettlementInfoService.paymentList(hyFreightSettlementInfo);
         return hyFreightSettlementInfoService.paymentList(hyFreightSettlementInfo);
     }
     }
+
+    /**
+     * 后台管理流水单上报列表
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    @Log(title = "流水单上报列表")
+    @GetMapping("/selectFlowSheet")
+    public Page<HyFreightSettlementInfo> selectFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo) {
+        return hyFreightSettlementInfoService.selectFlowSheet(hyFreightSettlementInfo);
+    }
+
+    /**
+     * 后台管理流水单上报暂缓上报
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "流水单暂缓上报")
+    @PostMapping("/api/postponeReporting")
+    public String postponeReporting(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo){
+        return hyFreightSettlementInfoService.postponeReporting(hyFreightSettlementInfo);
+    }
+
+    /**
+     * 流水单批量上报
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "流水单批量上报")
+    @PostMapping("/api/batchSubmission")
+    public String batchSubmission(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
+        return hyFreightSettlementInfoService.batchSubmission(hyFreightSettlementInfo);
+    }
 }
 }
 
 

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

@@ -47,6 +47,10 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      * 订单编号
      * 订单编号
      */
      */
     private String orderNo;
     private String orderNo;
+    /**
+     * 单证号
+     */
+    private String documentNo;
     /**
     /**
      * 是否垫付(0否1是)
      * 是否垫付(0否1是)
      */
      */
@@ -89,6 +93,18 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      * 状态
      * 状态
      */
      */
     private String status;
     private String status;
+    /**
+     * 上报状态key(1未上报3未通过5审核中7已通过9暂缓中)
+     */
+    private String escalationStatusKey;
+    /**
+     * 上报状态
+     */
+    private String escalationStatus;
+    /**
+     * 上报失败原因
+     */
+    private String escalationFailureReason;
     /**
     /**
      * 流水号
      * 流水号
      */
      */
@@ -133,6 +149,7 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private List<HyFreightSettlementInfo> hyFreightSettlementInfos;
     private List<HyFreightSettlementInfo> hyFreightSettlementInfos;
+
     /**
     /**
      * 司机身份证号
      * 司机身份证号
      */
      */
@@ -164,7 +181,7 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
     @TableField(exist = false)
     @TableField(exist = false)
     private String driverPhone;
     private String driverPhone;
     /**
     /**
-     *司机地址
+     *司机身份证地址
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private String driverAddress;
     private String driverAddress;
@@ -173,11 +190,6 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private String bankKey;
     private String bankKey;
-    /**
-     *实际运费金额
-     */
-    @TableField(exist = false)
-    private String totalFreight;
     /**
     /**
      *token
      *token
      */
      */

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

@@ -571,6 +571,11 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private HyCompanyInfo hyCompanyInfo;
     private HyCompanyInfo hyCompanyInfo;
+    /**
+     * 货主身份证号
+     */
+    @TableField(exist = false)
+    private String cargoOwnerIdCard;
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

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

@@ -33,4 +33,20 @@ public interface HyFreightSettlementInfoMapper extends BaseMapper<HyFreightSettl
      * @return
      * @return
      */
      */
     List<HyFreightSettlementInfo> getListByCondition(Map<String, Object> pageView);
     List<HyFreightSettlementInfo> getListByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询货主提现总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getEscalationCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询货主提现列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<HyFreightSettlementInfo> getEscalationListByCondition(Map<String, Object> pageView);
 }
 }

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

@@ -5,6 +5,7 @@ import com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo;
 import com.baomidou.mybatisplus.service.IService;
 import com.baomidou.mybatisplus.service.IService;
 
 
 import java.io.IOException;
 import java.io.IOException;
+import java.text.ParseException;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -37,5 +38,29 @@ public interface IHyFreightSettlementInfoService extends IService<HyFreightSettl
      * @param hyFreightSettlementInfo
      * @param hyFreightSettlementInfo
      * @return
      * @return
      */
      */
-    String paymentList(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException;
+    String paymentList(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException;
+
+    /**
+     * 后台管理流水单上报列表
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    Page<HyFreightSettlementInfo> selectFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo);
+
+    /**
+     * 后台管理流水单上报暂缓上报
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    String postponeReporting(HyFreightSettlementInfo hyFreightSettlementInfo);
+
+    /**
+     * 流水单批量上报
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    String batchSubmission(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException ;
 }
 }

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

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.io.IOException;
 import java.io.IOException;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
@@ -43,6 +44,12 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
     private ICompanyInfoService companyInfoService;
     private ICompanyInfoService companyInfoService;
     @Autowired
     @Autowired
     private ICargoOwnerInfoService cargoOwnerInfoService;
     private ICargoOwnerInfoService cargoOwnerInfoService;
+    @Autowired
+    private IDriverInfoService driverInfoService;
+    @Autowired
+    private IDriverCarInfoService driverCarInfoService;
+    @Autowired
+    private ICommonSysParameterService commonSysParameterService;
 
 
     /**
     /**
      * 后台管理司机运费结算列表
      * 后台管理司机运费结算列表
@@ -102,13 +109,15 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public String paymentList(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException {
+    public String paymentList(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
         List<HyFreightSettlementInfo> hyFreightSettlementInfoList = hyFreightSettlementInfo.getHyFreightSettlementInfos();
         List<HyFreightSettlementInfo> hyFreightSettlementInfoList = hyFreightSettlementInfo.getHyFreightSettlementInfos();
         if (CollectionUtils.isNotEmpty(hyFreightSettlementInfoList)) {
         if (CollectionUtils.isNotEmpty(hyFreightSettlementInfoList)) {
             for (int i = 0; i < hyFreightSettlementInfoList.size(); i++) {
             for (int i = 0; i < hyFreightSettlementInfoList.size(); i++) {
                 HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfoList.get(i).getId());
                 HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfoList.get(i).getId());
                 hyFreightSettlementInfo1.setStatusKey(StatusEnum.PAYMENT_ED.getFlag());
                 hyFreightSettlementInfo1.setStatusKey(StatusEnum.PAYMENT_ED.getFlag());
                 hyFreightSettlementInfo1.setStatus(StatusEnum.PAYMENT_ED.getName());
                 hyFreightSettlementInfo1.setStatus(StatusEnum.PAYMENT_ED.getName());
+                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
                 hyFreightSettlementInfo1.setPaymentDate(new Date());
                 hyFreightSettlementInfo1.setPaymentDate(new Date());
                 //查询费用信息
                 //查询费用信息
                 FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
                 FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
@@ -253,10 +262,108 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                         }
                         }
                     }
                     }
                 }
                 }
+                //查询上报所需信息
+                //司机信息
+                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());
+                //车辆信息
+                HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
+                        .eq("car_number",orderInfo1.getCarNumber()).eq("delete_flag","0"));
+                hyFreightSettlementInfo1.setCarNumber(hyDriverCarInfo.getCarNumber());
+                hyFreightSettlementInfo1.setCarNumberColour(hyDriverCarInfo.getCarNumberColour());
+                //查询银行key值
+                HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                        .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
+                hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                //上报
+                String token = EntityAnalyse.GetJTToken();
+                hyFreightSettlementInfo1.setToken(token);
+                EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
+                //编辑信息
                 this.updateById(hyFreightSettlementInfo1);
                 this.updateById(hyFreightSettlementInfo1);
             }
             }
             return "ok";
             return "ok";
         }
         }
         return "ng";
         return "ng";
     }
     }
+
+    /**
+     * 后台管理流水单上报列表
+     *
+     * @param
+     * @return
+     */
+    @Override
+    public Page<HyFreightSettlementInfo> selectFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo) {
+        Map<String, Object> pageView = new HashMap<>(9);
+        pageView.put("startRecord", (hyFreightSettlementInfo.getCurrentPage() - 1)
+                * hyFreightSettlementInfo.getPageSize());
+        //模糊查询
+        pageView.put("startDate", hyFreightSettlementInfo.getStartDate());
+        pageView.put("endDate", hyFreightSettlementInfo.getEndDate());
+        pageView.put("searchKeyWord", hyFreightSettlementInfo.getSearchKeyWord());
+        pageView.put("searchType", hyFreightSettlementInfo.getSearchType());
+        pageView.put("pageSize", hyFreightSettlementInfo.getPageSize());
+        pageView.put("currentPage", hyFreightSettlementInfo.getCurrentPage());
+        // 查询订单总数
+        Integer dataCount = baseMapper.getEscalationCountByCondition(pageView);
+        List<HyFreightSettlementInfo> dataList = baseMapper.getEscalationListByCondition(pageView);
+        Page<HyFreightSettlementInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(hyFreightSettlementInfo.getCurrentPage());
+        page.setSize(hyFreightSettlementInfo.getPageSize());
+        return page;
+    }
+
+    /**
+     * 后台管理流水单上报暂缓上报
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    @Override
+    public String postponeReporting(HyFreightSettlementInfo hyFreightSettlementInfo) {
+        List<HyFreightSettlementInfo> hyFreightSettlementInfoList = hyFreightSettlementInfo.getHyFreightSettlementInfos();
+        if (CollectionUtils.isNotEmpty(hyFreightSettlementInfoList)) {
+            for (int i = 0; i < hyFreightSettlementInfoList.size(); i++) {
+                HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfoList.get(i).getId());
+                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.PENDING.getFlag());
+                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.PENDING.getName());
+                this.updateById(hyFreightSettlementInfo1);
+            }
+            return "ok";
+        }
+        return "ng";
+    }
+
+    /**
+     * 流水单批量上报
+     * @param hyFreightSettlementInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    public String batchSubmission(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
+        //获取token
+        String token = EntityAnalyse.GetJTToken();
+        if (CollectionUtils.isNotEmpty(hyFreightSettlementInfo.getHyFreightSettlementInfos())){
+            for (HyFreightSettlementInfo hyFreightSettlementInfo1 : hyFreightSettlementInfo.getHyFreightSettlementInfos()){
+                //上报
+                hyFreightSettlementInfo1.setToken(token);
+                EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
+                //更改上报状态
+                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                this.updateById(hyFreightSettlementInfo1);
+            }
+        }
+        return "ok";
+    }
 }
 }

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

@@ -395,6 +395,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 .eq("delete_flag", "0"));
                 .eq("delete_flag", "0"));
         if (hyCargoOwnerInfo != null) {
         if (hyCargoOwnerInfo != null) {
             orderInfo.setOwnerAdvancePayment(hyCargoOwnerInfo.getAdvancePayment());
             orderInfo.setOwnerAdvancePayment(hyCargoOwnerInfo.getAdvancePayment());
+            orderInfo.setCargoOwnerIdCard(hyCargoOwnerInfo.getCardNumber());
         }
         }
         //查询任务信息
         //查询任务信息
         PublishTaskInfo publishTaskInfo = publishTaskInfoService.selectById(orderInfo.getTaskId());
         PublishTaskInfo publishTaskInfo = publishTaskInfoService.selectById(orderInfo.getTaskId());

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

@@ -367,85 +367,85 @@ public class EntityAnalyse {
      * @throws IOException
      * @throws IOException
      */
      */
     public static String uploadFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
     public static String uploadFlowSheet(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
-//        String url = "http://116.182.4.67:50065/platform/api/v1/money";
-//        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
-//        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
-//        CloseableHttpClient httpClient = HttpClients.createDefault();
-//        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
-//        HttpPost httpPost = new HttpPost(url);
-//        JSONObject params = new JSONObject();
-//        params.put("documentNumber", );
-//        params.put("sendToProDateTime", f.format(new Date()));
-//        params.put("carrier", hyFreightSettlementInfo.getDriverName());
-//        params.put("actualCarrierId", hyFreightSettlementInfo.getDriverIdCard());
-//        params.put("vehicleNumber", hyFreightSettlementInfo.getCarNumber());
-//        if ("黄色".equals(hyFreightSettlementInfo.getCarNumberColour())) {
-//            params.put("vehiclePlateColorCode", 2);
-//        } else if ("蓝色".equals(hyFreightSettlementInfo.getCarNumberColour())) {
-//            params.put("vehiclePlateColorCode", 1);
-//        }
-//        //运单列表
-//        JSONArray shippingNoteList = new JSONArray();
-//        JSONObject shippingNote = new JSONObject();
-//        shippingNote.put("shippingNoteNumber", hyFreightSettlementInfo.getOrderNo());
-//        shippingNote.put("serialNumber","0000");
-//        shippingNote.put("totalMonetaryAmount", );
-//        shippingNote.put("fuelAmount", );
-//        shippingNoteList.add(shippingNote);
-//        params.put("shippingNoteList",shippingNoteList);
-//        //财务列表
-//        JSONArray financialList = new JSONArray();
-//        JSONObject financial = new JSONObject();
-//        financial.put("shippingNoteNumber", );
-//        financial.put("serialNumber","0000");
-//        financial.put("driverName", hyFreightSettlementInfo.getDriverName());
-//        financial.put("driverLicense", hyFreightSettlementInfo.getDriverIdCard());
-//        financial.put("paymentMeansCode", "32");
-//        if ("男".equals(hyFreightSettlementInfo.getDriverSex())) {
-//            financial.put("sex",1);
-//        } else {
-//            financial.put("sex",2);
-//        }
-//        financial.put("sex",1);
-//        String s = hyFreightSettlementInfo.getDriverBirthday().substring(0, hyFreightSettlementInfo.getDriverBirthday().length() - 1);
-//        String s1 = s.replace("年", "-");
-//        String s2 = s1.replace("月", "-");
-//        Date date = df.parse(s2);
-//        financial.put("birthday", df.format(date));
-//        financial.put("idcardNumber", hyFreightSettlementInfo.getDriverIdCard());
-//        financial.put("phone", hyFreightSettlementInfo.getDriverPhone());
-//        financial.put("address",hyFreightSettlementInfo.getDriverAddress());
-//        financial.put("receiptAccount", hyFreightSettlementInfo.getDriverName());
-//        financial.put("bankCode", hyFreightSettlementInfo.getBankKey());
-//        financial.put("networkName", hyFreightSettlementInfo.getBankDepositBranch());
-//        financial.put("sequenceCode", hyFreightSettlementInfo.getSerialNumber());
-//        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(hyFreightSettlementInfo.getAmountMoney())) * 1000;
-//        int intValue1 = doubleValue1.intValue();
-//        financial.put("monetaryAmount", intValue1);
-//        financial.put("dateTime", f.format(hyFreightSettlementInfo.getArrivalDate()));
-//        financial.put("payFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPaymentVoucher())), hyFreightSettlementInfo.getToken()));
-//        financialList.add(financial);
-//        params.put("financialList",financialList);
-//
-//        httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
-//        // 设置header信息
-//        httpPost.setHeader("Content-type", "application/json");
-//        httpPost.setHeader("token", hyFreightSettlementInfo.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();
-//        }
+        String url = "http://116.182.4.67:50065/platform/api/v1/money";
+        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(url);
+        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("vehicleNumber", hyFreightSettlementInfo.getCarNumber());
+        if ("黄色".equals(hyFreightSettlementInfo.getCarNumberColour())) {
+            params.put("vehiclePlateColorCode", 2);
+        } else if ("蓝色".equals(hyFreightSettlementInfo.getCarNumberColour())) {
+            params.put("vehiclePlateColorCode", 1);
+        }
+        //运单列表
+        JSONArray shippingNoteList = new JSONArray();
+        JSONObject shippingNote = new JSONObject();
+        shippingNote.put("shippingNoteNumber", hyFreightSettlementInfo.getOrderNo());
+        shippingNote.put("serialNumber","0000");
+        shippingNote.put("totalMonetaryAmount", hyFreightSettlementInfo.getAmountMoney() * 1000);
+        shippingNote.put("fuelAmount", 0);
+        shippingNoteList.add(shippingNote);
+        params.put("shippingNoteList",shippingNoteList);
+        //财务列表
+        JSONArray financialList = new JSONArray();
+        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("paymentMeansCode", "32");
+        if ("男".equals(hyFreightSettlementInfo.getDriverSex())) {
+            financial.put("sex",1);
+        } else {
+            financial.put("sex",2);
+        }
+        financial.put("sex",1);
+        String s = hyFreightSettlementInfo.getDriverBirthday().substring(0, hyFreightSettlementInfo.getDriverBirthday().length() - 1);
+        String s1 = s.replace("年", "-");
+        String s2 = s1.replace("月", "-");
+        Date date = df.parse(s2);
+        financial.put("birthday", df.format(date));
+        financial.put("idcardNumber", hyFreightSettlementInfo.getDriverIdCard());
+        financial.put("phone", hyFreightSettlementInfo.getDriverPhone());
+        financial.put("address",hyFreightSettlementInfo.getDriverAddress());
+        financial.put("receiptAccount", hyFreightSettlementInfo.getDriverName());
+        financial.put("bankCode", hyFreightSettlementInfo.getBankKey());
+        financial.put("networkName", hyFreightSettlementInfo.getBankDepositBranch());
+        financial.put("sequenceCode", hyFreightSettlementInfo.getSerialNumber());
+        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(hyFreightSettlementInfo.getAmountMoney())) * 1000;
+        int intValue1 = doubleValue1.intValue();
+        financial.put("monetaryAmount", intValue1);
+        financial.put("dateTime", f.format(hyFreightSettlementInfo.getArrivalDate()));
+        financial.put("payFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPaymentVoucher())), hyFreightSettlementInfo.getToken()));
+        financialList.add(financial);
+        params.put("financialList",financialList);
+
+        httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
+        // 设置header信息
+        httpPost.setHeader("Content-type", "application/json");
+        httpPost.setHeader("token", hyFreightSettlementInfo.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 "";
         return "";
     }
     }
 
 

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

@@ -183,6 +183,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,
@@ -266,6 +267,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,
@@ -361,6 +363,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,
@@ -455,6 +458,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,
@@ -538,6 +542,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,
@@ -629,6 +634,7 @@
         SELECT
         SELECT
         p.id,
         p.id,
         p.common_id AS commonId,
         p.common_id AS commonId,
+        p.comp_id AS compId,
         p.cargo_owner AS cargoOwner,
         p.cargo_owner AS cargoOwner,
         p.send_private AS sendPrivate,
         p.send_private AS sendPrivate,
         p.send_city AS sendCity,
         p.send_city AS sendCity,