浏览代码

管局上报

haungfuli 2 年之前
父节点
当前提交
f61cc97130
共有 25 个文件被更改,包括 648 次插入186 次删除
  1. 1 1
      winsea-haixin-platform-backend/src/main/resources/application.yml
  2. 9 8
      winsea-haixin-plugin-wangluohuoyun/pom.xml
  3. 4 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java
  4. 11 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverCarInfoController.java
  5. 6 6
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/DriverInfoController.java
  6. 14 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/HyFreightSettlementInfoController.java
  7. 14 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/OrderInfoController.java
  8. 17 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverCarInfo.java
  9. 17 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyDriverInfo.java
  10. 17 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyFreightSettlementInfo.java
  11. 48 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java
  12. 7 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverCarInfoService.java
  13. 2 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IDriverInfoService.java
  14. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IHyFreightSettlementInfoService.java
  15. 8 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IOrderInfoService.java
  16. 60 10
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java
  17. 72 53
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java
  18. 78 11
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java
  19. 82 46
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  20. 4 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java
  21. 40 34
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/MonitoringSystemReporting.java
  22. 25 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverCarInfoMapper.xml
  23. 25 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverInfoMapper.xml
  24. 25 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyFreightSettlementInfoMapper.xml
  25. 54 7
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

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

@@ -14,7 +14,7 @@ spring:
     serialization:
     serialization:
       write_dates_as_timestamps: false
       write_dates_as_timestamps: false
   profiles:
   profiles:
-    active: test
+    active: local
   resources:
   resources:
     static-locations: file:///winsea/static/
     static-locations: file:///winsea/static/
   thymeleaf:
   thymeleaf:

+ 9 - 8
winsea-haixin-plugin-wangluohuoyun/pom.xml

@@ -153,15 +153,16 @@
         <dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk15on</artifactId>
             <artifactId>bcprov-jdk15on</artifactId>
-            <version>1.54</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opensaml</groupId>
-            <artifactId>opensaml-saml-api</artifactId>
-            <version>3.3.0</version>
-            <scope>compile</scope>
+            <version>1.47</version>
+<!--            <scope>compile</scope>-->
         </dependency>
         </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>org.opensaml</groupId>-->
+<!--            <artifactId>opensaml-saml-api</artifactId>-->
+<!--            <version>3.3.0</version>-->
+<!--            <scope>compile</scope>-->
+<!--        </dependency>-->
         <dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-aop</artifactId>
             <artifactId>spring-boot-starter-aop</artifactId>

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

@@ -140,6 +140,10 @@ public enum StatusEnum {
     ADOPTED("7", "已通过", "adopted"),
     ADOPTED("7", "已通过", "adopted"),
     PENDING("9", "暂缓中", "pending"),
     PENDING("9", "暂缓中", "pending"),
 
 
+    //交管局上报状态
+    REPORTED_FAIL("3", "未通过", "reported_fail"),
+    REPORTED_SUCESS("5", "已通过", "reported_sucess"),
+
     ;
     ;
     @Getter
     @Getter
     private String flag;
     private String flag;

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

@@ -116,14 +116,23 @@ public class DriverCarInfoController {
     }
     }
 
 
     /**
     /**
-     * 批量上报
+     * 车辆信息园区批量上报
      */
      */
-    @Log(title = "车辆信息批量上报")
+    @Log(title = "车辆信息园区批量上报")
     @PostMapping("/api/batchSubmission")
     @PostMapping("/api/batchSubmission")
     public String batchSubmission(@RequestBody HyDriverCarInfo hyDriverCarInfo) throws IOException , ParseException {
     public String batchSubmission(@RequestBody HyDriverCarInfo hyDriverCarInfo) throws IOException , ParseException {
         return driverCarInfoService.batchSubmission(hyDriverCarInfo);
         return driverCarInfoService.batchSubmission(hyDriverCarInfo);
     }
     }
 
 
+    /**
+     * 车辆信息交管监测系统批量上报
+     */
+    @Log(title = "车辆信息交管监测系统批量上报")
+    @PostMapping("/api/trafficManagementReport")
+    public String trafficManagementReport(@RequestBody HyDriverCarInfo hyDriverCarInfo) throws Exception {
+        return driverCarInfoService.trafficManagementReport(hyDriverCarInfo);
+    }
+
     /**
     /**
      * 后台管理车辆信息上报列表
      * 后台管理车辆信息上报列表
      * @param hyDriverCarInfo
      * @param hyDriverCarInfo

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

@@ -144,20 +144,20 @@ public class DriverInfoController {
     }
     }
 
 
     /**
     /**
-     * 批量上报
+     * 司机信息园区批量上报
      */
      */
-    @Log(title = "批量上报")
+    @Log(title = "司机信息园区批量上报")
     @PostMapping("/api/batchSubmission")
     @PostMapping("/api/batchSubmission")
-    public String batchSubmission(@RequestBody HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+    public String batchSubmission(@RequestBody HyDriverInfo hyDriverInfo) throws IOException , ParseException,Exception {
         return driverInfoService.batchSubmission(hyDriverInfo);
         return driverInfoService.batchSubmission(hyDriverInfo);
     }
     }
 
 
     /**
     /**
-     * 管局上报
+     * 司机信息交管局批量上报
      */
      */
-    @Log(title = "管局上报")
+    @Log(title = "司机信息交管局批量上报")
     @PostMapping("/api/administrationReport")
     @PostMapping("/api/administrationReport")
-    public String administrationReport(@RequestBody HyDriverInfo hyDriverInfo){
+    public String administrationReport(@RequestBody HyDriverInfo hyDriverInfo) throws Exception {
         return driverInfoService.administrationReport(hyDriverInfo);
         return driverInfoService.administrationReport(hyDriverInfo);
     }
     }
 
 

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

@@ -86,17 +86,29 @@ public class HyFreightSettlementInfoController {
     }
     }
 
 
     /**
     /**
-     * 流水单批量上报
+     * 流水单园区批量上报
      *
      *
      * @param
      * @param
      * @return
      * @return
      */
      */
-    @Log(title = "流水单批量上报")
+    @Log(title = "流水单园区批量上报")
     @PostMapping("/api/batchSubmission")
     @PostMapping("/api/batchSubmission")
     public String batchSubmission(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
     public String batchSubmission(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException {
         return hyFreightSettlementInfoService.batchSubmission(hyFreightSettlementInfo);
         return hyFreightSettlementInfoService.batchSubmission(hyFreightSettlementInfo);
     }
     }
 
 
+    /**
+     * 流水单交管监测系统批量上报
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "流水单交管监测系统批量上报")
+    @PostMapping("/api/trafficManagementReport")
+    public String trafficManagementReport(@RequestBody HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
+        return hyFreightSettlementInfoService.trafficManagementReport(hyFreightSettlementInfo);
+    }
+
     /**
     /**
      * 流水单查看
      * 流水单查看
      *
      *

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

@@ -194,17 +194,29 @@ public class OrderInfoController {
     }
     }
 
 
     /**
     /**
-     * 运单批量上报
+     * 运单园区批量上报
      *
      *
      * @param
      * @param
      * @return
      * @return
      */
      */
-    @Log(title = "运单批量上报")
+    @Log(title = "运单园区批量上报")
     @PostMapping("/api/batchSubmission")
     @PostMapping("/api/batchSubmission")
     public String batchSubmission(@RequestBody OrderInfo orderInfo) throws IOException {
     public String batchSubmission(@RequestBody OrderInfo orderInfo) throws IOException {
         return orderInfoService.batchSubmission(orderInfo);
         return orderInfoService.batchSubmission(orderInfo);
     }
     }
 
 
+    /**
+     * 运单交管局批量上报
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "运单交管局批量上报")
+    @PostMapping("/api/waybillAdministrationReport")
+    public String waybillAdministrationReport(@RequestBody OrderInfo orderInfo) throws Exception {
+        return orderInfoService.waybillAdministrationReport(orderInfo);
+    }
+
     /**
     /**
      * 审核
      * 审核
      *
      *

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

@@ -287,6 +287,18 @@ public class HyDriverCarInfo extends BaseModel<HyDriverCarInfo> {
      * 上报失败原因
      * 上报失败原因
      */
      */
     private String escalationFailureReason;
     private String escalationFailureReason;
+    /**
+     * 交管局上报状态key(1未上报3未通过5已通过)
+     */
+    private String reportedStatusKey;
+    /**
+     * 交管局上报状态
+     */
+    private String reportedStatus;
+    /**
+     * 交管局上报失败原因
+     */
+    private String reportedFailureReason;
     /**
     /**
      * 上报list
      * 上报list
      */
      */
@@ -373,6 +385,11 @@ public class HyDriverCarInfo extends BaseModel<HyDriverCarInfo> {
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private String vehicleTypeKey;
     private String vehicleTypeKey;
+    /**
+     * 管局上报列表状态(1未上报2上报失败3上报成功)
+     */
+    @TableField(exist = false)
+    private String administrationType;
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

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

@@ -239,6 +239,18 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      * 上报失败原因
      * 上报失败原因
      */
      */
     private String escalationFailureReason;
     private String escalationFailureReason;
+    /**
+     * 交管局上报状态key(1未上报3未通过5已通过)
+     */
+    private String reportedStatusKey;
+    /**
+     * 交管局上报状态
+     */
+    private String reportedStatus;
+    /**
+     * 交管局上报失败原因
+     */
+    private String reportedFailureReason;
     /**
     /**
      * 审核通过一次(1是)
      * 审核通过一次(1是)
      */
      */
@@ -278,6 +290,11 @@ public class HyDriverInfo extends BaseModel<HyDriverInfo> {
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private String searchKeyWord;
     private String searchKeyWord;
+    /**
+     * 管局上报列表状态(1未上报2上报失败3上报成功)
+     */
+    @TableField(exist = false)
+    private String administrationType;
     /**
     /**
      * 筛选开始日期
      * 筛选开始日期
      */
      */

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

@@ -105,6 +105,18 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      * 上报失败原因
      * 上报失败原因
      */
      */
     private String escalationFailureReason;
     private String escalationFailureReason;
+    /**
+     * 交管局上报状态key(1未上报3未通过5已通过)
+     */
+    private String reportedStatusKey;
+    /**
+     * 交管局上报状态
+     */
+    private String reportedStatus;
+    /**
+     * 交管局上报失败原因
+     */
+    private String reportedFailureReason;
     /**
     /**
      * 流水号
      * 流水号
      */
      */
@@ -196,6 +208,11 @@ public class HyFreightSettlementInfo extends BaseModel<HyFreightSettlementInfo>
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
     private String token;
     private String token;
+    /**
+     * 管局上报列表状态(1未上报2上报失败3上报成功)
+     */
+    @TableField(exist = false)
+    private String administrationType;
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

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

@@ -292,6 +292,18 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      * 上报失败原因
      * 上报失败原因
      */
      */
     private String escalationFailureReason;
     private String escalationFailureReason;
+    /**
+     * 交管局上报状态key(1未上报3未通过5已通过)
+     */
+    private String reportedStatusKey;
+    /**
+     * 交管局上报状态
+     */
+    private String reportedStatus;
+    /**
+     * 交管局上报失败原因
+     */
+    private String reportedFailureReason;
 
 
 
 
 
 
@@ -636,6 +648,42 @@ public class OrderInfo extends BaseModel<OrderInfo> {
     @TableField(exist = false)
     @TableField(exist = false)
     private String businessTypeCode;
     private String businessTypeCode;
 
 
+    /**
+     * 发货地经度
+     */
+    @TableField(exist = false)
+    private String sendLongitude;
+    /**
+     * 发货地纬度
+     */
+    @TableField(exist = false)
+    private String sendLatitude;
+    /**
+     * 发货地行政区划代码
+     */
+    @TableField(exist = false)
+    private String sendAdCode;
+    /**
+     * 收货地行政区划代码
+     */
+    @TableField(exist = false)
+    private String unsendAdCode;
+    /**
+     * 收货地经度
+     */
+    @TableField(exist = false)
+    private String unsendLongitude;
+    /**
+     * 收货地纬度
+     */
+    @TableField(exist = false)
+    private String unsendLatitude;
+    /**
+     * 管局上报列表状态(1未上报2上报失败3上报成功)
+     */
+    @TableField(exist = false)
+    private String administrationType;
+
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {
         return this.id;
         return this.id;

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

@@ -72,6 +72,13 @@ public interface IDriverCarInfoService extends IService<HyDriverCarInfo> {
      */
      */
     String batchSubmission(HyDriverCarInfo hyDriverCarInfo) throws IOException , ParseException;
     String batchSubmission(HyDriverCarInfo hyDriverCarInfo) throws IOException , ParseException;
 
 
+    /**
+     * 交管监测系统上报
+     * @param hyDriverCarInfo
+     * @return
+     */
+    String trafficManagementReport(HyDriverCarInfo hyDriverCarInfo) throws Exception ;
+
     /**
     /**
      * 后台管理车辆信息上报列表
      * 后台管理车辆信息上报列表
      * @param  hyDriverCarInfo
      * @param  hyDriverCarInfo

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

@@ -73,14 +73,14 @@ public interface IDriverInfoService extends IService<HyDriverInfo> {
      * @param hyDriverInfo
      * @param hyDriverInfo
      * @return
      * @return
      */
      */
-    String batchSubmission(HyDriverInfo hyDriverInfo) throws IOException , ParseException;
+    String batchSubmission(HyDriverInfo hyDriverInfo) throws IOException , ParseException,Exception;
 
 
     /**
     /**
      * 管局上报
      * 管局上报
      * @param hyDriverInfo
      * @param hyDriverInfo
      * @return
      * @return
      */
      */
-    String administrationReport(HyDriverInfo hyDriverInfo);
+    String administrationReport(HyDriverInfo hyDriverInfo) throws Exception ;
 
 
 
 
     /**
     /**

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

@@ -64,6 +64,14 @@ public interface IHyFreightSettlementInfoService extends IService<HyFreightSettl
      */
      */
     String batchSubmission(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException ;
     String batchSubmission(HyFreightSettlementInfo hyFreightSettlementInfo) throws IOException, ParseException ;
 
 
+    /**
+     * 流水单交管监测系统批量上报
+     *
+     * @param hyFreightSettlementInfo
+     * @return
+     */
+    String trafficManagementReport(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception ;
+
     /**
     /**
      * 流水单查看
      * 流水单查看
      *
      *

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

@@ -134,6 +134,14 @@ public interface IOrderInfoService extends IService<OrderInfo> {
      */
      */
     String batchSubmission (OrderInfo orderInfo) throws IOException;
     String batchSubmission (OrderInfo orderInfo) throws IOException;
 
 
+    /**
+     * 运单管局上报
+     *
+     * @param orderInfo
+     * @return
+     */
+    String waybillAdministrationReport (OrderInfo orderInfo) throws Exception ;
+
     /**
     /**
      * 审核
      * 审核
      *
      *

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

@@ -21,6 +21,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
+import net.sf.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
@@ -50,6 +51,9 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
     private IDriverInfoService driverInfoService;
     private IDriverInfoService driverInfoService;
     @Autowired
     @Autowired
     private INewsInfoService newsInfoService;
     private INewsInfoService newsInfoService;
+    @Autowired
+    private IDriverCarInfoService driverCarInfoService;
+
 
 
     /**
     /**
      * 后台管理车辆列表
      * 后台管理车辆列表
@@ -120,7 +124,8 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         }
         }
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
-
+        hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PLATFORM_UNDER_REVIEW.getFlag());
+        hyDriverCarInfo.setEscalationStatus(StatusEnum.PLATFORM_UNDER_REVIEW.getName());
 //        //查询车辆类型key值
 //        //查询车辆类型key值
 //        HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
 //        HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
 //                .eq("const_id", "CAR1").eq("const_value", hyDriverCarInfo.getVehicleType()));
 //                .eq("const_id", "CAR1").eq("const_value", hyDriverCarInfo.getVehicleType()));
@@ -160,6 +165,8 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         //信息编辑
         //信息编辑
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         hyDriverCarInfo.setStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
+        hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PLATFORM_UNDER_REVIEW.getFlag());
+        hyDriverCarInfo.setEscalationStatus(StatusEnum.PLATFORM_UNDER_REVIEW.getName());
 
 
 //        //查询车辆类型key值
 //        //查询车辆类型key值
 //        HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
 //        HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
@@ -237,9 +244,12 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
                 if (!"通过".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))) {
                 if (!"通过".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))) {
                     return EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo);
                     return EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo);
                 }
                 }
-
                 hyDriverCarInfo1.setStatusKey(StatusEnum.TASK_REJECT.getFlag());
                 hyDriverCarInfo1.setStatusKey(StatusEnum.TASK_REJECT.getFlag());
                 hyDriverCarInfo1.setStatus(StatusEnum.TASK_REJECT.getName());
                 hyDriverCarInfo1.setStatus(StatusEnum.TASK_REJECT.getName());
+                hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.NOT_REPORTED.getFlag());
+                hyDriverCarInfo1.setEscalationStatus(StatusEnum.NOT_REPORTED.getName());
+                hyDriverCarInfo1.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                hyDriverCarInfo1.setReportedStatus(StatusEnum.NO_REPORTED.getName());
                 hyDriverCarInfo1.setDrivingOverdueFlag("0");
                 hyDriverCarInfo1.setDrivingOverdueFlag("0");
                 hyDriverCarInfo1.setTrailerOverdueFlag("0");
                 hyDriverCarInfo1.setTrailerOverdueFlag("0");
                 hyDriverCarInfo1.setOperationOverdueFlag("0");
                 hyDriverCarInfo1.setOperationOverdueFlag("0");
@@ -268,7 +278,7 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
     }
     }
 
 
     /**
     /**
-     * 批量上报
+     * 园区批量上报
      * @param hyDriverCarInfo
      * @param hyDriverCarInfo
      * @return
      * @return
      * @throws IOException
      * @throws IOException
@@ -297,27 +307,66 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
-                //监测系统上报
+                //更改上报状态
+                hyDriverCarInfo1.setEscalationDate(new Date());
+                hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
+                hyDriverCarInfo1.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
+                this.updateById(hyDriverCarInfo1);
+            }
+        }
+        return "ok";
+    }
+
+    /**
+     * 交管监测系统上报
+     * @param hyDriverCarInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String trafficManagementReport (HyDriverCarInfo hyDriverCarInfo) throws Exception {
+        if (!CollectionUtils.isEmpty(hyDriverCarInfo.getHyDriverCarInfoList())) {
+            for (HyDriverCarInfo hyDriverCarInfo1 : hyDriverCarInfo.getHyDriverCarInfoList()) {
+                //查询车辆类型key值
+                HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                        .eq("const_id", "CAR1").eq("const_value", hyDriverCarInfo1.getVehicleType()));
+                hyDriverCarInfo1.setVehicleTypeKey(hyCommonSysParameter.getConstKey());
+                //交管监测系统上报
                 new Thread(new Runnable() {
                 new Thread(new Runnable() {
                     @Override
                     @Override
                     public void run() {
                     public void run() {
                         try{
                         try{
-                            MonitoringSystemReporting.testVehicleRoot(hyDriverCarInfo1);
+                            String result = MonitoringSystemReporting.testVehicleRoot(hyDriverCarInfo1);
+                            JSONObject jsonObject = JSONObject.fromObject(result);
+                            //发送成功
+                            if ("1001".equals(jsonObject.getString("code"))){
+                                hyDriverCarInfo1.setReportedStatusKey(StatusEnum.REPORTED_SUCESS.getFlag());
+                                hyDriverCarInfo1.setReportedStatus(StatusEnum.REPORTED_SUCESS.getName());
+                            }
+                            //发送失败
+                            else if ("3003".equals(jsonObject.getString("code"))){
+                                hyDriverCarInfo1.setReportedStatusKey(StatusEnum.REPORTED_FAIL.getFlag());
+                                hyDriverCarInfo1.setReportedStatus(StatusEnum.REPORTED_FAIL.getName());
+                                String str = jsonObject.getString("data");
+                                String reg = "[^(0-9\\u4e00-\\u9fa5)]";
+                                String str1 = str.replaceAll(reg, " ").trim();
+                                str = str1.replaceAll(" +",",");
+                                hyDriverCarInfo1.setReportedFailureReason(str);
+                            }
+                            driverCarInfoService.updateById(hyDriverCarInfo1);
                         }catch (Exception e){
                         }catch (Exception e){
                             e.printStackTrace();
                             e.printStackTrace();
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
-                //更改上报状态
-                hyDriverCarInfo1.setEscalationDate(new Date());
-                hyDriverCarInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
-                hyDriverCarInfo1.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
-                this.updateById(hyDriverCarInfo1);
             }
             }
         }
         }
         return "ok";
         return "ok";
     }
     }
 
 
+
     /**
     /**
      * 后台管理车辆信息上报列表
      * 后台管理车辆信息上报列表
      *
      *
@@ -330,6 +379,7 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
         pageView.put("startRecord", (hyDriverCarInfo.getCurrentPage() - 1)
         pageView.put("startRecord", (hyDriverCarInfo.getCurrentPage() - 1)
                 * hyDriverCarInfo.getPageSize());
                 * hyDriverCarInfo.getPageSize());
         //公司id
         //公司id
+        pageView.put("administrationType", hyDriverCarInfo.getAdministrationType());
         pageView.put("searchType", hyDriverCarInfo.getSearchType());
         pageView.put("searchType", hyDriverCarInfo.getSearchType());
         pageView.put("searchKeyWord", hyDriverCarInfo.getSearchKeyWord());
         pageView.put("searchKeyWord", hyDriverCarInfo.getSearchKeyWord());
         pageView.put("startDate", hyDriverCarInfo.getStartDate());
         pageView.put("startDate", hyDriverCarInfo.getStartDate());

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

@@ -19,6 +19,8 @@ import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.TestJson;
 import com.yh.saas.plugin.yiliangyiyun.util.TestJson;
 import lombok.SneakyThrows;
 import lombok.SneakyThrows;
+import net.sf.json.JSONObject;
+import org.json.JSONString;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
@@ -55,6 +57,8 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     private ICommonUserService commonUserService;
     private ICommonUserService commonUserService;
     @Autowired
     @Autowired
     private IOrderInfoService orderInfoService;
     private IOrderInfoService orderInfoService;
+    @Autowired
+    private IDriverInfoService driverInfoService;
 
 
     /**
     /**
      * 查询上报结果(每分钟执行一次)
      * 查询上报结果(每分钟执行一次)
@@ -65,20 +69,20 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
 
 
         //查询司机上报结果
         //查询司机上报结果
         List<HyDriverInfo> hyDriverInfoList = this.selectList(new EntityWrapper<HyDriverInfo>()
         List<HyDriverInfo> hyDriverInfoList = this.selectList(new EntityWrapper<HyDriverInfo>()
-        .eq("escalation_status_key","5").eq("delete_flag","0"));
-        if (!CollectionUtils.isEmpty(hyDriverInfoList)){
+                .eq("escalation_status_key", "5").eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(hyDriverInfoList)) {
             //获取token
             //获取token
             String token = EntityAnalyse.GetJTToken();
             String token = EntityAnalyse.GetJTToken();
-            for (HyDriverInfo hyDriverInfo : hyDriverInfoList){
+            for (HyDriverInfo hyDriverInfo : hyDriverInfoList) {
                 //上报司机信息校验结果查询
                 //上报司机信息校验结果查询
                 hyDriverInfo.setToken(token);
                 hyDriverInfo.setToken(token);
-                if ("通过".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))){
+                if ("通过".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))) {
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
                     hyDriverInfo.setEscalationStatus(StatusEnum.PASSED.getName());
                     hyDriverInfo.setEscalationStatus(StatusEnum.PASSED.getName());
-                }else if ("待校验".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))){
+                } else if ("待校验".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))) {
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
                     hyDriverInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
                     hyDriverInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
-                }else {
+                } else {
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
                     hyDriverInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
                     hyDriverInfo.setEscalationStatus(StatusEnum.FAIL.getName());
                     hyDriverInfo.setEscalationStatus(StatusEnum.FAIL.getName());
                     hyDriverInfo.setEscalationFailureReason(EntityAnalyse.driverInfoCheck(hyDriverInfo));
                     hyDriverInfo.setEscalationFailureReason(EntityAnalyse.driverInfoCheck(hyDriverInfo));
@@ -88,20 +92,20 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         }
         }
         //查询车辆上报结果
         //查询车辆上报结果
         List<HyDriverCarInfo> hyDriverCarInfoList = driverCarInfoService.selectList(new EntityWrapper<HyDriverCarInfo>()
         List<HyDriverCarInfo> hyDriverCarInfoList = driverCarInfoService.selectList(new EntityWrapper<HyDriverCarInfo>()
-                .eq("escalation_status_key","5").eq("delete_flag","0"));
-        if (!CollectionUtils.isEmpty(hyDriverCarInfoList)){
+                .eq("escalation_status_key", "5").eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(hyDriverCarInfoList)) {
             //获取token
             //获取token
             String token = EntityAnalyse.GetJTToken();
             String token = EntityAnalyse.GetJTToken();
-            for (HyDriverCarInfo hyDriverCarInfo : hyDriverCarInfoList){
+            for (HyDriverCarInfo hyDriverCarInfo : hyDriverCarInfoList) {
                 //上报车辆信息校验结果查询
                 //上报车辆信息校验结果查询
                 hyDriverCarInfo.setToken(token);
                 hyDriverCarInfo.setToken(token);
-                if ("通过".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))){
+                if ("通过".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))) {
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PASSED.getFlag());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.PASSED.getName());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.PASSED.getName());
-                }else if ("待校验".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))){
+                } else if ("待校验".equals(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo))) {
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.PARK_UNDER_REVIEW.getName());
-                }else {
+                } else {
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
                     hyDriverCarInfo.setEscalationStatusKey(StatusEnum.FAIL.getFlag());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.FAIL.getName());
                     hyDriverCarInfo.setEscalationStatus(StatusEnum.FAIL.getName());
                     hyDriverCarInfo.setEscalationFailureReason(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo));
                     hyDriverCarInfo.setEscalationFailureReason(EntityAnalyse.driverCarInfoCheck(hyDriverCarInfo));
@@ -111,20 +115,20 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         }
         }
         //查询运单上报结果
         //查询运单上报结果
         List<OrderInfo> orderInfoList = orderInfoService.selectList(new EntityWrapper<OrderInfo>()
         List<OrderInfo> orderInfoList = orderInfoService.selectList(new EntityWrapper<OrderInfo>()
-                .eq("escalation_status_key","5").eq("delete_flag","0"));
-        if (!CollectionUtils.isEmpty(orderInfoList)){
+                .eq("escalation_status_key", "5").eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(orderInfoList)) {
             //获取token
             //获取token
             String token = EntityAnalyse.GetJTToken();
             String token = EntityAnalyse.GetJTToken();
-            for (OrderInfo orderInfo : orderInfoList){
+            for (OrderInfo orderInfo : orderInfoList) {
                 //上报车辆信息校验结果查询
                 //上报车辆信息校验结果查询
                 orderInfo.setToken(token);
                 orderInfo.setToken(token);
-                if ("通过".equals(EntityAnalyse.waybillCheck(orderInfo))){
+                if ("通过".equals(EntityAnalyse.waybillCheck(orderInfo))) {
                     orderInfo.setEscalationStatusKey(StatusEnum.ADOPTED.getFlag());
                     orderInfo.setEscalationStatusKey(StatusEnum.ADOPTED.getFlag());
                     orderInfo.setEscalationStatus(StatusEnum.ADOPTED.getName());
                     orderInfo.setEscalationStatus(StatusEnum.ADOPTED.getName());
-                }else if ("待校验".equals(EntityAnalyse.waybillCheck(orderInfo))){
+                } else if ("待校验".equals(EntityAnalyse.waybillCheck(orderInfo))) {
                     orderInfo.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
                     orderInfo.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
                     orderInfo.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
                     orderInfo.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
-                }else {
+                } else {
                     orderInfo.setEscalationStatusKey(StatusEnum.NOT_ADOPT.getFlag());
                     orderInfo.setEscalationStatusKey(StatusEnum.NOT_ADOPT.getFlag());
                     orderInfo.setEscalationStatus(StatusEnum.NOT_ADOPT.getName());
                     orderInfo.setEscalationStatus(StatusEnum.NOT_ADOPT.getName());
                     orderInfo.setEscalationFailureReason(EntityAnalyse.waybillCheck(orderInfo));
                     orderInfo.setEscalationFailureReason(EntityAnalyse.waybillCheck(orderInfo));
@@ -142,7 +146,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public Page<HyDriverInfo> selectDriverInfoPage(HyDriverInfo driverViewInfo){
+    public Page<HyDriverInfo> selectDriverInfoPage(HyDriverInfo driverViewInfo) {
         Map<String, Object> pageView = new HashMap<>(11);
         Map<String, Object> pageView = new HashMap<>(11);
         pageView.put("startRecord", (driverViewInfo.getCurrentPage() - 1)
         pageView.put("startRecord", (driverViewInfo.getCurrentPage() - 1)
                 * driverViewInfo.getPageSize());
                 * driverViewInfo.getPageSize());
@@ -170,8 +174,6 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         page.setTotal(dataCount == null ? 0 : dataCount);
         page.setTotal(dataCount == null ? 0 : dataCount);
         page.setCurrent(driverViewInfo.getCurrentPage());
         page.setCurrent(driverViewInfo.getCurrentPage());
         page.setSize(driverViewInfo.getPageSize());
         page.setSize(driverViewInfo.getPageSize());
-        TestJson j = new TestJson();
-        j.sendTest();
         return page;
         return page;
     }
     }
 
 
@@ -202,7 +204,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public String addInfo(HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+    public String addInfo(HyDriverInfo hyDriverInfo) throws IOException, ParseException {
         //新增主键id
         //新增主键id
         hyDriverInfo.setId(IdGenerator.generateUUID());
         hyDriverInfo.setId(IdGenerator.generateUUID());
         hyDriverInfo.setFirstFlag("1");
         hyDriverInfo.setFirstFlag("1");
@@ -211,6 +213,8 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
         hyDriverInfo.setBackStageStatus(StatusEnum.TO_BE_REVIEWED.getName());
         hyDriverInfo.setBackStageStatus(StatusEnum.TO_BE_REVIEWED.getName());
+        hyDriverInfo.setEscalationStatusKey(StatusEnum.PLATFORM_UNDER_REVIEW.getFlag());
+        hyDriverInfo.setEscalationStatus(StatusEnum.PLATFORM_UNDER_REVIEW.getName());
         //判断司机电话是否唯一
         //判断司机电话是否唯一
         List<HyDriverInfo> hyDriverInfos =
         List<HyDriverInfo> hyDriverInfos =
                 this.selectList(new EntityWrapper<HyDriverInfo>()
                 this.selectList(new EntityWrapper<HyDriverInfo>()
@@ -287,7 +291,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public String editInfo(HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+    public String editInfo(HyDriverInfo hyDriverInfo) throws IOException, ParseException {
         //获取当前年月日
         //获取当前年月日
         SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
         SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
         String date = f.format(new Date(System.currentTimeMillis()));
         String date = f.format(new Date(System.currentTimeMillis()));
@@ -296,24 +300,26 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         //判断身份证有效期
         //判断身份证有效期
         if (!"长期".equals(hyDriverInfo.getCardValidityDate())) {
         if (!"长期".equals(hyDriverInfo.getCardValidityDate())) {
             int result1 = hyDriverInfo.getCardValidityDate().compareTo(date);
             int result1 = hyDriverInfo.getCardValidityDate().compareTo(date);
-            if (result1 == 0){
+            if (result1 == 0) {
                 throw new YException(YExceptionEnum.TERM_OF_VALIDITY);
                 throw new YException(YExceptionEnum.TERM_OF_VALIDITY);
             }
             }
         }
         }
         //驾驶证
         //驾驶证
         int result2 = hyDriverInfo.getDriverLicenseValidityDate().compareTo(date);
         int result2 = hyDriverInfo.getDriverLicenseValidityDate().compareTo(date);
-        if (result2 == 0){
+        if (result2 == 0) {
             throw new YException(YExceptionEnum.DRIVER_TERM_OF_VALIDITY);
             throw new YException(YExceptionEnum.DRIVER_TERM_OF_VALIDITY);
         }
         }
         //从业资格证
         //从业资格证
         int result3 = hyDriverInfo.getQualificationCertificateValidityDate().compareTo(date1);
         int result3 = hyDriverInfo.getQualificationCertificateValidityDate().compareTo(date1);
-        if (result3 < 0){
+        if (result3 < 0) {
             throw new YException(YExceptionEnum.CONG_TERM_OF_VALIDITY);
             throw new YException(YExceptionEnum.CONG_TERM_OF_VALIDITY);
         }
         }
         hyDriverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         hyDriverInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_REVIEWED.getFlag());
         hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverInfo.setAuthenticationStatus(StatusEnum.IDENTITY_REVIEWED.getName());
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
         hyDriverInfo.setBackStageStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
         hyDriverInfo.setBackStageStatus(StatusEnum.TO_BE_REVIEWED.getName());
         hyDriverInfo.setBackStageStatus(StatusEnum.TO_BE_REVIEWED.getName());
+        hyDriverInfo.setEscalationStatusKey(StatusEnum.PLATFORM_UNDER_REVIEW.getFlag());
+        hyDriverInfo.setEscalationStatus(StatusEnum.PLATFORM_UNDER_REVIEW.getName());
 
 
 //        //上报
 //        //上报
 //        List<HyDriverInfo> hyDriverInfos1 = new ArrayList<>();
 //        List<HyDriverInfo> hyDriverInfos1 = new ArrayList<>();
@@ -377,22 +383,26 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public String examine(HyDriverInfo hyDriverInfo) throws IOException {
     public String examine(HyDriverInfo hyDriverInfo) throws IOException {
-        //查询司机列表
+        //查询司机
         HyDriverInfo hyDriverInfo1 = this.selectById(hyDriverInfo.getId());
         HyDriverInfo hyDriverInfo1 = this.selectById(hyDriverInfo.getId());
         if (hyDriverInfo1 != null) {
         if (hyDriverInfo1 != null) {
-            //
+            //通过
             if ("1".equals(hyDriverInfo.getFlag())) {
             if ("1".equals(hyDriverInfo.getFlag())) {
                 //上报司机信息校验结果查询
                 //上报司机信息校验结果查询
                 String token = EntityAnalyse.GetJTToken();
                 String token = EntityAnalyse.GetJTToken();
                 hyDriverInfo.setToken(token);
                 hyDriverInfo.setToken(token);
-                if (!"通过".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))){
+                if (!"通过".equals(EntityAnalyse.driverInfoCheck(hyDriverInfo))) {
                     throw new YException(YExceptionEnum.SHANG_BAO_ERROR);
                     throw new YException(YExceptionEnum.SHANG_BAO_ERROR);
                 }
                 }
-
+                //更改状态
                 hyDriverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
                 hyDriverInfo1.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
                 hyDriverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
                 hyDriverInfo1.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
                 hyDriverInfo1.setBackStageStatusKey(StatusEnum.TASK_REJECT.getFlag());
                 hyDriverInfo1.setBackStageStatusKey(StatusEnum.TASK_REJECT.getFlag());
                 hyDriverInfo1.setBackStageStatus(StatusEnum.TASK_REJECT.getName());
                 hyDriverInfo1.setBackStageStatus(StatusEnum.TASK_REJECT.getName());
+                hyDriverInfo.setEscalationStatusKey(StatusEnum.NOT_REPORTED.getFlag());
+                hyDriverInfo.setEscalationStatus(StatusEnum.NOT_REPORTED.getName());
+                hyDriverInfo.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                hyDriverInfo.setReportedStatus(StatusEnum.NO_REPORTED.getName());
                 hyDriverInfo1.setOverdueFlag("0");
                 hyDriverInfo1.setOverdueFlag("0");
                 hyDriverInfo1.setDriverOverdueFlag("0");
                 hyDriverInfo1.setDriverOverdueFlag("0");
                 hyDriverInfo1.setQualificationOverdueFlag("0");
                 hyDriverInfo1.setQualificationOverdueFlag("0");
@@ -483,6 +493,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
 
 
     /**
     /**
      * 批量上报
      * 批量上报
+     *
      * @param hyDriverInfo
      * @param hyDriverInfo
      * @return
      * @return
      * @throws IOException
      * @throws IOException
@@ -490,7 +501,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public String batchSubmission (HyDriverInfo hyDriverInfo) throws IOException , ParseException {
+    public String batchSubmission(HyDriverInfo hyDriverInfo) throws IOException, ParseException, Exception {
         //园区上报
         //园区上报
         //获取token
         //获取token
         String token = EntityAnalyse.GetJTToken();
         String token = EntityAnalyse.GetJTToken();
@@ -498,26 +509,15 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
         new Thread(new Runnable() {
         new Thread(new Runnable() {
             @Override
             @Override
             public void run() {
             public void run() {
-                try{
+                try {
                     EntityAnalyse.uploadDriverInfo(hyDriverInfo);
                     EntityAnalyse.uploadDriverInfo(hyDriverInfo);
-                }catch (Exception e){
+                } catch (Exception e) {
                     e.printStackTrace();
                     e.printStackTrace();
                 }
                 }
             }
             }
         }).start();
         }).start();
-        if (!CollectionUtils.isEmpty(hyDriverInfo.getHyDriverInfoList())){
-            for (HyDriverInfo hyDriverInfo1 : hyDriverInfo.getHyDriverInfoList()){
-                //监测系统上报
-                new Thread(new Runnable() {
-                    @Override
-                    public void run() {
-                        try{
-//                            MonitoringSystemReporting.testDriverRoot(hyDriverInfo1);
-                        }catch (Exception e){
-                            e.printStackTrace();
-                        }
-                    }
-                }).start();
+        if (!CollectionUtils.isEmpty(hyDriverInfo.getHyDriverInfoList())) {
+            for (HyDriverInfo hyDriverInfo1 : hyDriverInfo.getHyDriverInfoList()) {
                 //更改上报状态
                 //更改上报状态
                 hyDriverInfo1.setEscalationDate(new Date());
                 hyDriverInfo1.setEscalationDate(new Date());
                 hyDriverInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
                 hyDriverInfo1.setEscalationStatusKey(StatusEnum.PARK_UNDER_REVIEW.getFlag());
@@ -530,21 +530,39 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
 
 
     /**
     /**
      * 管局上报
      * 管局上报
+     *
      * @param hyDriverInfo
      * @param hyDriverInfo
      * @return
      * @return
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public String administrationReport (HyDriverInfo hyDriverInfo){
-        if (!CollectionUtils.isEmpty(hyDriverInfo.getHyDriverInfoList())){
-            for (HyDriverInfo hyDriverInfo1 : hyDriverInfo.getHyDriverInfoList()){
+    public String administrationReport(HyDriverInfo hyDriverInfo) throws Exception {
+        if (!CollectionUtils.isEmpty(hyDriverInfo.getHyDriverInfoList())) {
+            for (HyDriverInfo hyDriverInfo1 : hyDriverInfo.getHyDriverInfoList()) {
                 //监测系统上报
                 //监测系统上报
                 new Thread(new Runnable() {
                 new Thread(new Runnable() {
                     @Override
                     @Override
                     public void run() {
                     public void run() {
-                        try{
-//                            MonitoringSystemReporting.testDriverRoot(hyDriverInfo1);
-                        }catch (Exception e){
+                        try {
+                            String result = MonitoringSystemReporting.testDriverRoot(hyDriverInfo1);
+                            JSONObject jsonObject = JSONObject.fromObject(result);
+                            //发送成功
+                            if ("1001".equals(jsonObject.getString("code"))) {
+                                hyDriverInfo1.setReportedStatusKey(StatusEnum.REPORTED_SUCESS.getFlag());
+                                hyDriverInfo1.setReportedStatus(StatusEnum.REPORTED_SUCESS.getName());
+                            }
+                            //发送失败
+                            else if ("3003".equals(jsonObject.getString("code"))) {
+                                hyDriverInfo1.setReportedStatusKey(StatusEnum.REPORTED_FAIL.getFlag());
+                                hyDriverInfo1.setReportedStatus(StatusEnum.REPORTED_FAIL.getName());
+                                String str = jsonObject.getString("data");
+                                String reg = "[^(0-9\\u4e00-\\u9fa5)]";
+                                String str1 = str.replaceAll(reg, " ").trim();
+                                str = str1.replaceAll(" +",",");
+                                hyDriverInfo1.setReportedFailureReason(str);
+                            }
+                            driverInfoService.updateById(hyDriverInfo1);
+                        } catch (Exception e) {
                             e.printStackTrace();
                             e.printStackTrace();
                         }
                         }
                     }
                     }
@@ -562,11 +580,12 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public Page<HyDriverInfo> selectDriverInfoSubmission(HyDriverInfo hyDriverInfo){
+    public Page<HyDriverInfo> selectDriverInfoSubmission(HyDriverInfo hyDriverInfo) {
         Map<String, Object> pageView = new HashMap<>(9);
         Map<String, Object> pageView = new HashMap<>(9);
         pageView.put("startRecord", (hyDriverInfo.getCurrentPage() - 1)
         pageView.put("startRecord", (hyDriverInfo.getCurrentPage() - 1)
                 * hyDriverInfo.getPageSize());
                 * hyDriverInfo.getPageSize());
         //公司id
         //公司id
+        pageView.put("administrationType", hyDriverInfo.getAdministrationType());
         pageView.put("searchType", hyDriverInfo.getSearchType());
         pageView.put("searchType", hyDriverInfo.getSearchType());
         pageView.put("searchKeyWord", hyDriverInfo.getSearchKeyWord());
         pageView.put("searchKeyWord", hyDriverInfo.getSearchKeyWord());
         pageView.put("startDate", hyDriverInfo.getStartDate());
         pageView.put("startDate", hyDriverInfo.getStartDate());

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

@@ -13,6 +13,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
+import net.sf.json.JSONObject;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -56,6 +57,9 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
     private IHyFreezingMoneyInfoService hyFreezingMoneyInfoService;
     private IHyFreezingMoneyInfoService hyFreezingMoneyInfoService;
     @Autowired
     @Autowired
     private IHyDriverCapitalInfoService hyDriverCapitalInfoService;
     private IHyDriverCapitalInfoService hyDriverCapitalInfoService;
+    @Autowired
+    private IHyFreightSettlementInfoService hyFreightSettlementInfoService;
+
 
 
     /**
     /**
      * 后台管理司机运费结算列表
      * 后台管理司机运费结算列表
@@ -124,8 +128,10 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                 HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfoList.get(i).getId());
                 HyFreightSettlementInfo hyFreightSettlementInfo1 = this.selectById(hyFreightSettlementInfoList.get(i).getId());
                 hyFreightSettlementInfo1.setStatusKey(StatusEnum.RECEIVED.getFlag());
                 hyFreightSettlementInfo1.setStatusKey(StatusEnum.RECEIVED.getFlag());
                 hyFreightSettlementInfo1.setStatus(StatusEnum.RECEIVED.getName());
                 hyFreightSettlementInfo1.setStatus(StatusEnum.RECEIVED.getName());
-                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
-                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.NO_REPORTED.getName());
+                hyFreightSettlementInfo1.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                hyFreightSettlementInfo1.setReportedStatus(StatusEnum.NO_REPORTED.getName());
                 hyFreightSettlementInfo1.setPaymentDate(new Date());
                 hyFreightSettlementInfo1.setPaymentDate(new Date());
                 hyFreightSettlementInfo1.setSerialNumber(hyFreightSettlementInfoList.get(i).getSerialNumber());
                 hyFreightSettlementInfo1.setSerialNumber(hyFreightSettlementInfoList.get(i).getSerialNumber());
                 hyFreightSettlementInfo1.setPaymentVoucher(hyFreightSettlementInfoList.get(i).getPaymentVoucher());
                 hyFreightSettlementInfo1.setPaymentVoucher(hyFreightSettlementInfoList.get(i).getPaymentVoucher());
@@ -194,8 +200,10 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                             orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_FINISH.getName());
                             orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_FINISH.getName());
                             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_FINISH.getFlag());
                             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_FINISH.getFlag());
                             orderInfo1.setOrderEndDate(new Date());
                             orderInfo1.setOrderEndDate(new Date());
-//                            orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getFlag());
-//                            orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                            orderInfo1.setEscalationStatus(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setReportedStatus(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
 //                            //信息上报
 //                            //信息上报
 //                            String token = EntityAnalyse.GetJTToken();
 //                            String token = EntityAnalyse.GetJTToken();
 //                            orderInfo1.setToken(token);
 //                            orderInfo1.setToken(token);
@@ -325,8 +333,11 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                             orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_FINISH.getName());
                             orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_FINISH.getName());
                             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_FINISH.getFlag());
                             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_FINISH.getFlag());
                             orderInfo1.setOrderEndDate(new Date());
                             orderInfo1.setOrderEndDate(new Date());
-//                            orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getFlag());
-//                            orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                            orderInfo1.setEscalationStatus(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setReportedStatus(StatusEnum.NO_REPORTED.getFlag());
+                            orderInfo1.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
+
 //                            //信息上报
 //                            //信息上报
 //                            String token = EntityAnalyse.GetJTToken();
 //                            String token = EntityAnalyse.GetJTToken();
 //                            orderInfo1.setToken(token);
 //                            orderInfo1.setToken(token);
@@ -420,6 +431,7 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
         pageView.put("startRecord", (hyFreightSettlementInfo.getCurrentPage() - 1)
         pageView.put("startRecord", (hyFreightSettlementInfo.getCurrentPage() - 1)
                 * hyFreightSettlementInfo.getPageSize());
                 * hyFreightSettlementInfo.getPageSize());
         //模糊查询
         //模糊查询
+        pageView.put("administrationType", hyFreightSettlementInfo.getAdministrationType());
         pageView.put("startDate", hyFreightSettlementInfo.getStartDate());
         pageView.put("startDate", hyFreightSettlementInfo.getStartDate());
         pageView.put("endDate", hyFreightSettlementInfo.getEndDate());
         pageView.put("endDate", hyFreightSettlementInfo.getEndDate());
         pageView.put("searchKeyWord", hyFreightSettlementInfo.getSearchKeyWord());
         pageView.put("searchKeyWord", hyFreightSettlementInfo.getSearchKeyWord());
@@ -509,26 +521,81 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
+                //更改上报状态
+                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                this.updateById(hyFreightSettlementInfo1);
+            }
+        }
+        return "ok";
+    }
+
+    /**
+     * 流水单交管监测系统批量上报
+     * @param hyFreightSettlementInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String trafficManagementReport(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
+        if (CollectionUtils.isNotEmpty(hyFreightSettlementInfo.getHyFreightSettlementInfos())) {
+            for (HyFreightSettlementInfo hyFreightSettlementInfo1 : hyFreightSettlementInfo.getHyFreightSettlementInfos()) {
+                //查询上报所需信息
+                //查询订单
+                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());
+                //车辆信息
+                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()));
+                if (hyCommonSysParameter == null){
+                    hyFreightSettlementInfo1.setBankKey("9999");
+                }else {
+                    hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                }
                 //监测系统上报
                 //监测系统上报
                 new Thread(new Runnable() {
                 new Thread(new Runnable() {
                     @Override
                     @Override
                     public void run() {
                     public void run() {
                         try{
                         try{
-                            MonitoringSystemReporting.getFinancialRoot(hyFreightSettlementInfo1);
+                            String result = MonitoringSystemReporting.getFinancialRoot(hyFreightSettlementInfo1);
+                            JSONObject jsonObject = JSONObject.fromObject(result);
+                            //发送成功
+                            if ("1001".equals(jsonObject.getString("code"))){
+                                hyFreightSettlementInfo1.setReportedStatusKey(StatusEnum.REPORTED_SUCESS.getFlag());
+                                hyFreightSettlementInfo1.setReportedStatus(StatusEnum.REPORTED_SUCESS.getName());
+                            }
+                            //发送失败
+                            else if ("3003".equals(jsonObject.getString("code"))){
+                                hyFreightSettlementInfo1.setReportedStatusKey(StatusEnum.REPORTED_FAIL.getFlag());
+                                hyFreightSettlementInfo1.setReportedStatus(StatusEnum.REPORTED_FAIL.getName());
+                                String str = jsonObject.getString("data");
+                                String reg = "[^(0-9\\u4e00-\\u9fa5)]";
+                                String str1 = str.replaceAll(reg, " ").trim();
+                                str = str1.replaceAll(" +",",");
+                                hyFreightSettlementInfo1.setReportedFailureReason(str);
+                            }
+                            hyFreightSettlementInfoService.updateById(hyFreightSettlementInfo1);
                         }catch (Exception e){
                         }catch (Exception e){
                             e.printStackTrace();
                             e.printStackTrace();
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
-                //更改上报状态
-                hyFreightSettlementInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
-                hyFreightSettlementInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
-                this.updateById(hyFreightSettlementInfo1);
             }
             }
         }
         }
         return "ok";
         return "ok";
     }
     }
 
 
+
     /**
     /**
      * 流水单查看
      * 流水单查看
      * @param hyFreightSettlementInfo
      * @param hyFreightSettlementInfo

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

@@ -22,6 +22,7 @@ import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSONObject;
 import org.activiti.engine.impl.util.CollectionUtil;
 import org.activiti.engine.impl.util.CollectionUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.CollectionUtils;
 
 
@@ -102,6 +103,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
     private IHyFreightSettlementInfoService hyFreightSettlementInfoService;
     private IHyFreightSettlementInfoService hyFreightSettlementInfoService;
     @Autowired
     @Autowired
     private ICommonSysParameterService commonSysParameterService;
     private ICommonSysParameterService commonSysParameterService;
+    @Autowired
+    private IOrderInfoService orderInfoService;
     @Value("${file-root-path}")
     @Value("${file-root-path}")
     private String localPath;
     private String localPath;
     @Getter
     @Getter
@@ -683,8 +686,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
             orderInfo1.setCargoOwnerStatusKey(StatusEnum.OWNER_ORDER_FINISH.getFlag());
             orderInfo1.setCargoOwnerStatusKey(StatusEnum.OWNER_ORDER_FINISH.getFlag());
             orderInfo1.setCargoOwnerStatus(StatusEnum.OWNER_ORDER_FINISH.getName());
             orderInfo1.setCargoOwnerStatus(StatusEnum.OWNER_ORDER_FINISH.getName());
             orderInfo1.setOrderEndDate(new Date());
             orderInfo1.setOrderEndDate(new Date());
-//            orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getFlag());
-//            orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+            orderInfo1.setEscalationStatus(StatusEnum.NO_REPORTED.getFlag());
+            orderInfo1.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+            orderInfo1.setReportedStatus(StatusEnum.NO_REPORTED.getFlag());
+            orderInfo1.setReportedStatusKey(StatusEnum.NO_REPORTED.getFlag());
 //            //信息上报
 //            //信息上报
 //            String token = EntityAnalyse.GetJTToken();
 //            String token = EntityAnalyse.GetJTToken();
 //            orderInfo1.setToken(token);
 //            orderInfo1.setToken(token);
@@ -708,17 +713,17 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
             HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
             HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                     .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
                     .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
             //货主是公司
             //货主是公司
-            if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+            if (orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()) {
                 //计算公司累计支付运费
                 //计算公司累计支付运费
                 HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
                 HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
-                if(hyCompanyInfo != null){
+                if (hyCompanyInfo != null) {
                     Double d = hyCompanyInfo.getAccumulatedFreight();
                     Double d = hyCompanyInfo.getAccumulatedFreight();
                     hyCompanyInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
                     hyCompanyInfo.setAccumulatedFreight(d + freightInfo.getActualFreight() + freightInfo.getOwnerServiceCharge());
                     companyInfoService.updateById(hyCompanyInfo);
                     companyInfoService.updateById(hyCompanyInfo);
                 }
                 }
             }
             }
             //货主是个人
             //货主是个人
-            else{
+            else {
                 //计算货主累计支付运费
                 //计算货主累计支付运费
                 if (hyCargoOwnerInfo != null) {
                 if (hyCargoOwnerInfo != null) {
                     Double d = hyCargoOwnerInfo.getAccumulatedFreight();
                     Double d = hyCargoOwnerInfo.getAccumulatedFreight();
@@ -832,6 +837,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         pageView.put("startRecord", (orderInfo.getCurrentPage() - 1)
         pageView.put("startRecord", (orderInfo.getCurrentPage() - 1)
                 * orderInfo.getPageSize());
                 * orderInfo.getPageSize());
         //模糊查询
         //模糊查询
+        pageView.put("administrationType", orderInfo.getAdministrationType());
         pageView.put("startDate", orderInfo.getStartDate());
         pageView.put("startDate", orderInfo.getStartDate());
         pageView.put("endDate", orderInfo.getEndDate());
         pageView.put("endDate", orderInfo.getEndDate());
         pageView.put("searchKeyWord", orderInfo.getSearchKeyWord());
         pageView.put("searchKeyWord", orderInfo.getSearchKeyWord());
@@ -886,50 +892,73 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         String token = EntityAnalyse.GetJTToken();
         String token = EntityAnalyse.GetJTToken();
         if (CollectionUtils.isNotEmpty(orderInfo.getOrderInfoList())) {
         if (CollectionUtils.isNotEmpty(orderInfo.getOrderInfoList())) {
             for (OrderInfo orderInfo1 : orderInfo.getOrderInfoList()) {
             for (OrderInfo orderInfo1 : orderInfo.getOrderInfoList()) {
+
                 //园区上报
                 //园区上报
                 orderInfo1.setToken(token);
                 orderInfo1.setToken(token);
                 new Thread(new Runnable() {
                 new Thread(new Runnable() {
                     @Override
                     @Override
                     public void run() {
                     public void run() {
-                        try{
+                        try {
                             EntityAnalyse.uploadWaybill(orderInfo1);
                             EntityAnalyse.uploadWaybill(orderInfo1);
-                        }catch (Exception e){
+                        } catch (Exception e) {
                             e.printStackTrace();
                             e.printStackTrace();
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
+                //更改上报状态
+                orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
+                orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
+                this.updateById(orderInfo1);
+            }
+        }
+        return "ok";
+    }
+
+    /**
+     * 运单管局上报
+     *
+     * @param orderInfo
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String waybillAdministrationReport(OrderInfo orderInfo)  throws Exception  {
+        if (CollectionUtils.isNotEmpty(orderInfo.getOrderInfoList())) {
+            for (OrderInfo orderInfo1 : orderInfo.getOrderInfoList()) {
                 //1.查询任务,获取业务类型代码
                 //1.查询任务,获取业务类型代码
                 PublishTaskInfo publishTaskInfo = publishTaskInfoService.selectById(orderInfo1.getTaskId());
                 PublishTaskInfo publishTaskInfo = publishTaskInfoService.selectById(orderInfo1.getTaskId());
-                if (publishTaskInfo != null){
+                if (publishTaskInfo != null) {
                     orderInfo1.setBusinessTypeCode(publishTaskInfo.getBusinessTypeKey());
                     orderInfo1.setBusinessTypeCode(publishTaskInfo.getBusinessTypeKey());
                     orderInfo1.setShipToName(publishTaskInfo.getReceiver());
                     orderInfo1.setShipToName(publishTaskInfo.getReceiver());
-                    if (publishTaskInfo.getReceiverIdcard() == null && publishTaskInfo.getReceiverIdcard().isEmpty()){
+                    if (publishTaskInfo.getReceiverIdcard() == null && publishTaskInfo.getReceiverIdcard().isEmpty()) {
                         orderInfo1.setShipToID(publishTaskInfo.getReceiverCreditCode());
                         orderInfo1.setShipToID(publishTaskInfo.getReceiverCreditCode());
-                    }else {
+                    } else {
                         orderInfo1.setShipToID(publishTaskInfo.getReceiverIdcard());
                         orderInfo1.setShipToID(publishTaskInfo.getReceiverIdcard());
                     }
                     }
-                    if (!"个人货主".equals(publishTaskInfo.getCargoOwner()) && publishTaskInfo.getCompId() != null){
+                    if (!"个人货主".equals(publishTaskInfo.getCargoOwner()) && publishTaskInfo.getCompId() != null) {
                         //查询公司社会信用代码
                         //查询公司社会信用代码
                         HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(publishTaskInfo.getCompId());
                         HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(publishTaskInfo.getCompId());
-                        if (hyCompanyInfo != null){
+                        if (hyCompanyInfo != null) {
                             orderInfo1.setConsignorID(hyCompanyInfo.getUnifiedSocialCreditCode());
                             orderInfo1.setConsignorID(hyCompanyInfo.getUnifiedSocialCreditCode());
                         }
                         }
                     }
                     }
                 }
                 }
                 //2.查询承运表,装卸货时间
                 //2.查询承运表,装卸货时间
-                HyCarrierInfo hyCarrierInfo = carrierInfoService.selectOne(new EntityWrapper<HyCarrierInfo>().eq("order_id",orderInfo1.getId())
-                .eq("delete_flag","0"));
-                if (hyCarrierInfo != null){
+                HyCarrierInfo hyCarrierInfo = carrierInfoService.selectOne(new EntityWrapper<HyCarrierInfo>().eq("order_id", orderInfo1.getId())
+                        .eq("delete_flag", "0"));
+                if (hyCarrierInfo != null) {
                     orderInfo1.setDeliveryTime(hyCarrierInfo.getLoadingDate());
                     orderInfo1.setDeliveryTime(hyCarrierInfo.getLoadingDate());
                     orderInfo1.setReceivingTime(hyCarrierInfo.getUnloadingDate());
                     orderInfo1.setReceivingTime(hyCarrierInfo.getUnloadingDate());
                     orderInfo1.setGrossWeight(hyCarrierInfo.getLoadingGrossWeight());
                     orderInfo1.setGrossWeight(hyCarrierInfo.getLoadingGrossWeight());
                 }
                 }
                 //3.查询托运人信息
                 //3.查询托运人信息
                 HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                 HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
-                        .eq("common_id",orderInfo1.getCargoCommonId()).eq("delete_flag","0"));
-                if (hyCargoOwnerInfo != null){
+                        .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+                if (hyCargoOwnerInfo != null) {
                     orderInfo1.setConsignorName(hyCargoOwnerInfo.getName());
                     orderInfo1.setConsignorName(hyCargoOwnerInfo.getName());
-                    if ("个人货主".equals(publishTaskInfo.getCargoOwner())){
+                    if ("个人货主".equals(publishTaskInfo.getCargoOwner())) {
                         //查询托运人身份证号
                         //查询托运人身份证号
                         orderInfo1.setConsignorID(hyCargoOwnerInfo.getCardNumber());
                         orderInfo1.setConsignorID(hyCargoOwnerInfo.getCardNumber());
                     }
                     }
@@ -944,38 +973,45 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 orderInfo1.setShipToNationalCode(hyCommonSysParameter1.getConstKey());
                 orderInfo1.setShipToNationalCode(hyCommonSysParameter1.getConstKey());
                 //查询司机信息
                 //查询司机信息
                 HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
                 HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
-                        .eq("common_id",orderInfo1.getCommonId()).eq("delete_flag","0"));
-                if (hyDriverInfo != null){
-                    orderInfo1.setDriverIdCard(hyDriverInfo.getNumberCard());
+                        .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
+                if (hyDriverInfo != null) {
                     orderInfo1.setRoadTransportBusinessLicenseNo(hyDriverInfo.getActualCarrierBusinessLicense());
                     orderInfo1.setRoadTransportBusinessLicenseNo(hyDriverInfo.getActualCarrierBusinessLicense());
                 }
                 }
-                //车辆信息
-                HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
-                        .eq("car_number",orderInfo1.getCarNumber()).eq("common_id",orderInfo1.getCommonId()).eq("delete_flag","0"));
-                if (hyDriverCarInfo != null){
-                    orderInfo1.setCarNumberColour(hyDriverCarInfo.getCarNumberColour());
-                }
 
 
                 //监测系统上报
                 //监测系统上报
                 new Thread(new Runnable() {
                 new Thread(new Runnable() {
                     @Override
                     @Override
                     public void run() {
                     public void run() {
-                        try{
-                            MonitoringSystemReporting.testDispatch(orderInfo1);
-                        }catch (Exception e){
+                        try {
+                            String result = MonitoringSystemReporting.testDispatch(orderInfo1);
+                            JSONObject jsonObject = JSONObject.fromObject(result);
+                            //发送成功
+                            if ("1001".equals(jsonObject.getString("code"))){
+                                orderInfo1.setReportedStatusKey(StatusEnum.REPORTED_SUCESS.getFlag());
+                                orderInfo1.setReportedStatus(StatusEnum.REPORTED_SUCESS.getName());
+                            }
+                            //发送失败
+                            else if ("3003".equals(jsonObject.getString("code"))){
+                                orderInfo1.setReportedStatusKey(StatusEnum.REPORTED_FAIL.getFlag());
+                                orderInfo1.setReportedStatus(StatusEnum.REPORTED_FAIL.getName());
+                                String str = jsonObject.getString("data");
+                                String reg = "[^(0-9\\u4e00-\\u9fa5)]";
+                                String str1 = str.replaceAll(reg, " ").trim();
+                                str = str1.replaceAll(" +",",");
+                                orderInfo1.setReportedFailureReason(str);
+                            }
+                            orderInfoService.updateById(orderInfo1);
+                        } catch (Exception e) {
                             e.printStackTrace();
                             e.printStackTrace();
                         }
                         }
                     }
                     }
                 }).start();
                 }).start();
-                //更改上报状态
-                orderInfo1.setEscalationStatusKey(StatusEnum.UNDER_REVIEW.getFlag());
-                orderInfo1.setEscalationStatus(StatusEnum.UNDER_REVIEW.getName());
-                this.updateById(orderInfo1);
             }
             }
         }
         }
         return "ok";
         return "ok";
     }
     }
 
 
+
     /**
     /**
      * 审核(平台确认装卸车)
      * 审核(平台确认装卸车)
      *
      *
@@ -1062,17 +1098,17 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         }
                         }
                         hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
                         hyFreezingMoneyInfoService.insert(hyFreezingMoneyInfo);
                         //货主是公司
                         //货主是公司
-                        if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+                        if (orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()) {
                             //计算公司累计支付运费
                             //计算公司累计支付运费
                             HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
                             HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
-                            if(hyCompanyInfo != null){
+                            if (hyCompanyInfo != null) {
                                 Double d3 = hyCompanyInfo.getAccumulatedFreight();
                                 Double d3 = hyCompanyInfo.getAccumulatedFreight();
                                 hyCompanyInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
                                 hyCompanyInfo.setAccumulatedFreight(d3 + orderInfo1.getAdvanceCharge());
                                 companyInfoService.updateById(hyCompanyInfo);
                                 companyInfoService.updateById(hyCompanyInfo);
                             }
                             }
                         }
                         }
                         //货主是个人
                         //货主是个人
-                        else{
+                        else {
                             //查询货主
                             //查询货主
                             HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                             HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                                     .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
                                     .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
@@ -1102,8 +1138,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         hyFreightSettlementInfo.setAmountMoney(freightInfo.getPayableFreight());
                         hyFreightSettlementInfo.setAmountMoney(freightInfo.getPayableFreight());
                         hyFreightSettlementInfo.setStatusKey(StatusEnum.NO_PAYMENT.getFlag());
                         hyFreightSettlementInfo.setStatusKey(StatusEnum.NO_PAYMENT.getFlag());
                         hyFreightSettlementInfo.setStatus(StatusEnum.NO_PAYMENT.getName());
                         hyFreightSettlementInfo.setStatus(StatusEnum.NO_PAYMENT.getName());
-                        hyFreightSettlementInfo.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
-                        hyFreightSettlementInfo.setEscalationStatus(StatusEnum.NO_REPORTED.getName());
+//                        hyFreightSettlementInfo.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+//                        hyFreightSettlementInfo.setEscalationStatus(StatusEnum.NO_REPORTED.getName());
                         hyFreightSettlementInfoService.insert(hyFreightSettlementInfo);
                         hyFreightSettlementInfoService.insert(hyFreightSettlementInfo);
                     }
                     }
                 } else {
                 } else {
@@ -1224,17 +1260,17 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                         HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
                                 .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
                                 .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
                         //货主是公司
                         //货主是公司
-                        if(orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()){
+                        if (orderInfo1.getCompId() != null && !orderInfo1.getCompId().isEmpty()) {
                             //计算公司累计支付运费
                             //计算公司累计支付运费
                             HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
                             HyCompanyInfo hyCompanyInfo = companyInfoService.selectById(orderInfo1.getCompId());
-                            if(hyCompanyInfo != null){
+                            if (hyCompanyInfo != null) {
                                 Double d3 = hyCompanyInfo.getAccumulatedFreight();
                                 Double d3 = hyCompanyInfo.getAccumulatedFreight();
                                 hyCompanyInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
                                 hyCompanyInfo.setAccumulatedFreight(d3 + freightInfo.getOwnerFreightBalance() + freightInfo.getOwnerServiceCharge());
                                 companyInfoService.updateById(hyCompanyInfo);
                                 companyInfoService.updateById(hyCompanyInfo);
                             }
                             }
                         }
                         }
                         //货主是个人
                         //货主是个人
-                        else{
+                        else {
                             //计算货主累计支付运费
                             //计算货主累计支付运费
                             if (hyCargoOwnerInfo != null) {
                             if (hyCargoOwnerInfo != null) {
                                 Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
                                 Double d3 = hyCargoOwnerInfo.getAccumulatedFreight();
@@ -1268,14 +1304,14 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                     hyFreightSettlementInfo.setBankDeposit(orderInfo1.getBankDeposit());
                     hyFreightSettlementInfo.setBankDeposit(orderInfo1.getBankDeposit());
                     hyFreightSettlementInfo.setBankDepositBranch(orderInfo1.getBankDepositBranch());
                     hyFreightSettlementInfo.setBankDepositBranch(orderInfo1.getBankDepositBranch());
                     hyFreightSettlementInfo.setPaymentType("尾款");
                     hyFreightSettlementInfo.setPaymentType("尾款");
-                    if (freightInfo.getPrepaidFreight() == null){
+                    if (freightInfo.getPrepaidFreight() == null) {
                         throw new YException(YExceptionEnum.PAY_ADVANCE_PAYMENT);
                         throw new YException(YExceptionEnum.PAY_ADVANCE_PAYMENT);
                     }
                     }
                     hyFreightSettlementInfo.setAmountMoney(freightInfo.getActualFreight() - freightInfo.getPrepaidFreight() - freightInfo.getDriverServiceCharge());
                     hyFreightSettlementInfo.setAmountMoney(freightInfo.getActualFreight() - freightInfo.getPrepaidFreight() - freightInfo.getDriverServiceCharge());
                     hyFreightSettlementInfo.setStatusKey(StatusEnum.NO_PAYMENT.getFlag());
                     hyFreightSettlementInfo.setStatusKey(StatusEnum.NO_PAYMENT.getFlag());
                     hyFreightSettlementInfo.setStatus(StatusEnum.NO_PAYMENT.getName());
                     hyFreightSettlementInfo.setStatus(StatusEnum.NO_PAYMENT.getName());
-                    hyFreightSettlementInfo.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
-                    hyFreightSettlementInfo.setEscalationStatus(StatusEnum.NO_REPORTED.getName());
+//                    hyFreightSettlementInfo.setEscalationStatusKey(StatusEnum.NO_REPORTED.getFlag());
+//                    hyFreightSettlementInfo.setEscalationStatus(StatusEnum.NO_REPORTED.getName());
                     hyFreightSettlementInfoService.insert(hyFreightSettlementInfo);
                     hyFreightSettlementInfoService.insert(hyFreightSettlementInfo);
                 } else {
                 } else {
                     //驳回卸车更改订单状态
                     //驳回卸车更改订单状态
@@ -1358,7 +1394,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         }
         }
         //司机签合同
         //司机签合同
         else {
         else {
-            if (orderInfo.getCarNumber() != null && !orderInfo.getCarNumber().isEmpty()){
+            if (orderInfo.getCarNumber() != null && !orderInfo.getCarNumber().isEmpty()) {
                 //查询车辆信息
                 //查询车辆信息
                 HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>().eq("car_number", orderInfo.getCarNumber())
                 HyDriverCarInfo hyDriverCarInfo = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>().eq("car_number", orderInfo.getCarNumber())
                         .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
                         .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));

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

@@ -272,6 +272,7 @@ public class EntityAnalyse {
         params.put("vehicleLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getDrivingLicenseHomePage())), hyDriverCarInfo.getToken()));
         params.put("vehicleLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getDrivingLicenseHomePage())), hyDriverCarInfo.getToken()));
         params.put("vehicleLicenseSecondSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getDrivingLicenseBackPage())), hyDriverCarInfo.getToken()));
         params.put("vehicleLicenseSecondSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getDrivingLicenseBackPage())), hyDriverCarInfo.getToken()));
         params.put("transportLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getOperationCertificate())), hyDriverCarInfo.getToken()));
         params.put("transportLicenseFirstSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getOperationCertificate())), hyDriverCarInfo.getToken()));
+        params.put("transportLicenseSecondSheetImg", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyDriverCarInfo.getOperationCertificate())), hyDriverCarInfo.getToken()));
 
 
         httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
         httpPost.setEntity(new StringEntity("[" + params.toString() + "]", StandardCharsets.UTF_8));
         // 设置header信息
         // 设置header信息
@@ -414,8 +415,9 @@ public class EntityAnalyse {
         financial.put("bankCode", hyFreightSettlementInfo.getBankKey());
         financial.put("bankCode", hyFreightSettlementInfo.getBankKey());
         financial.put("networkName", hyFreightSettlementInfo.getBankDepositBranch());
         financial.put("networkName", hyFreightSettlementInfo.getBankDepositBranch());
         financial.put("sequenceCode", hyFreightSettlementInfo.getSerialNumber());
         financial.put("sequenceCode", hyFreightSettlementInfo.getSerialNumber());
-        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(hyFreightSettlementInfo.getAmountMoney())) * 1000;
-        int intValue1 = doubleValue1.intValue();
+        DecimalFormat df1 = new DecimalFormat("0.000");
+//        String str = String.valueOf(Double.valueOf(df1.format(hyFreightSettlementInfo.getAmountMoney())) * 1000);
+        int intValue1 = (int)(Double.valueOf(df1.format(hyFreightSettlementInfo.getAmountMoney())) * 1000);
         financial.put("monetaryAmount", intValue1);
         financial.put("monetaryAmount", intValue1);
         financial.put("dateTime", f.format(hyFreightSettlementInfo.getPaymentDate()));
         financial.put("dateTime", f.format(hyFreightSettlementInfo.getPaymentDate()));
         financial.put("payFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPaymentVoucher())), hyFreightSettlementInfo.getToken()));
         financial.put("payFile", EntityAnalyse.uploadImage(EntityAnalyse.urlToFile(new URL(hyFreightSettlementInfo.getPaymentVoucher())), hyFreightSettlementInfo.getToken()));

+ 40 - 34
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/MonitoringSystemReporting.java

@@ -2,11 +2,14 @@ package com.yh.saas.plugin.yiliangyiyun.util;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.google.gson.internal.$Gson$Preconditions;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverCarInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverCarInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyDriverInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.*;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.*;
+import com.yh.saas.plugin.yiliangyiyun.service.IDriverCarInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.Waybill;
 import com.yh.saas.plugin.yiliangyiyun.service.Waybill;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPost;
@@ -14,6 +17,7 @@ import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
@@ -23,6 +27,11 @@ import java.util.*;
 
 
 public class MonitoringSystemReporting {
 public class MonitoringSystemReporting {
 
 
+    @Autowired
+    private IDriverCarInfoService driverCarInfoService;
+    @Autowired
+    private IDriverInfoService driverInfoService;
+
     /**
     /**
      * 用户列表
      * 用户列表
      */
      */
@@ -101,7 +110,7 @@ public class MonitoringSystemReporting {
      * @return
      * @return
      * @throws IOException
      * @throws IOException
      */
      */
-    public Map<String, String> login(String userName, String password, String debug) {
+    public static Map<String, String> login(String userName, String password, String debug) {
         Map<String, String> map = new HashMap<>();
         Map<String, String> map = new HashMap<>();
 
 
         try {
         try {
@@ -140,7 +149,7 @@ public class MonitoringSystemReporting {
         return map;
         return map;
     }
     }
 
 
-    public Root loginRoot(String userName, String password, String uscc, String debug) {
+    public static Root loginRoot(String userName, String password, String uscc, String debug) {
         Map<String, String> token = login(userName, password, debug);
         Map<String, String> token = login(userName, password, debug);
         Root edmRoot = new Root();
         Root edmRoot = new Root();
         edmRoot.setToken(token.get("token"));
         edmRoot.setToken(token.get("token"));
@@ -210,7 +219,7 @@ public class MonitoringSystemReporting {
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
-    public Root testDriverRoot(HyDriverInfo hyDriverInfo) throws Exception {
+    public static String testDriverRoot(HyDriverInfo hyDriverInfo) throws Exception {
         String name = "驾驶员信息单";
         String name = "驾驶员信息单";
         DriverInfo driver = testDriver(hyDriverInfo);
         DriverInfo driver = testDriver(hyDriverInfo);
         //roots.get(0)
         //roots.get(0)
@@ -219,7 +228,7 @@ public class MonitoringSystemReporting {
         System.out.println("发送报文的内容:" + messageJson);
         System.out.println("发送报文的内容:" + messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         System.out.println("服务器返回消息:" + result);
         System.out.println("服务器返回消息:" + result);
-        return root;
+        return result;
     }
     }
 //    public static Root testDriverRoot(Root root1) throws Exception{
 //    public static Root testDriverRoot(Root root1) throws Exception{
 //        return testDriverRoot(root1,null);
 //        return testDriverRoot(root1,null);
@@ -238,7 +247,7 @@ public class MonitoringSystemReporting {
         driver.setValidPeriodFrom(f.format(hyDriverInfo.getDriverLicenseValidityStartDate()));
         driver.setValidPeriodFrom(f.format(hyDriverInfo.getDriverLicenseValidityStartDate()));
         String str = hyDriverInfo.getDriverLicenseValidityDate().replace("-", "");
         String str = hyDriverInfo.getDriverLicenseValidityDate().replace("-", "");
         driver.setValidPeriodTo(str);
         driver.setValidPeriodTo(str);
-        driver.setQualificationCertificate(hyDriverInfo.getQualificationCertificate());
+        driver.setQualificationCertificate(hyDriverInfo.getQualificationCertificateNumber());
         driver.setTelephone(hyDriverInfo.getDriverPhone());
         driver.setTelephone(hyDriverInfo.getDriverPhone());
         driver.setRemark("备注");
         driver.setRemark("备注");
         return driver;
         return driver;
@@ -256,7 +265,7 @@ public class MonitoringSystemReporting {
      * @return
      * @return
      * @throws Exception 车辆信息单
      * @throws Exception 车辆信息单
      */
      */
-    public static Root testVehicleRoot(HyDriverCarInfo hyDriverCarInfo) throws Exception {
+    public static String testVehicleRoot(HyDriverCarInfo hyDriverCarInfo) throws Exception {
         String name = "车辆信息单";
         String name = "车辆信息单";
         Vehicle vehicle = new Vehicle();
         Vehicle vehicle = new Vehicle();
         SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");//设置日期格式
         SimpleDateFormat f = new SimpleDateFormat("yyyyMMdd");//设置日期格式
@@ -306,12 +315,12 @@ public class MonitoringSystemReporting {
         }
         }
         vehicle.setRoadTransportCertificateNumber(hyDriverCarInfo.getOperationCertificateNumber());
         vehicle.setRoadTransportCertificateNumber(hyDriverCarInfo.getOperationCertificateNumber());
         vehicle.setRemark("备注");
         vehicle.setRemark("备注");
-        Root root = getRoot(vehicle, name, roots.get(0));
+        Root root = getRoot(vehicle, name, loginRoot("23106960", "qweasd!@#123", "91210804MA10FPAM2G", "debugSystem"));
         String messageJson = JSON.toJSONString(root);
         String messageJson = JSON.toJSONString(root);
         System.out.println("发送报文的内容:" + messageJson);
         System.out.println("发送报文的内容:" + messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         System.out.println("服务器返回消息:" + result);
         System.out.println("服务器返回消息:" + result);
-        return root;
+        return result;
     }
     }
 
 
     /**
     /**
@@ -320,10 +329,11 @@ public class MonitoringSystemReporting {
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
-    public static Root getFinancialRoot(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
+    public static String getFinancialRoot(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
         String name = "资金流水单";
         String name = "资金流水单";
         FinancialRoot financialRoot = new FinancialRoot();
         FinancialRoot financialRoot = new FinancialRoot();
         SimpleDateFormat f1 = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
         SimpleDateFormat f1 = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
+        DecimalFormat df = new DecimalFormat("0.000");
 
 
         financialRoot.setDocumentNumber(hyFreightSettlementInfo.getDocumentNo());
         financialRoot.setDocumentNumber(hyFreightSettlementInfo.getDocumentNo());
         financialRoot.setSendToProDateTime(f1.format(new Date()));
         financialRoot.setSendToProDateTime(f1.format(new Date()));
@@ -340,7 +350,7 @@ public class MonitoringSystemReporting {
         ShippingNote shippingNote1 = new ShippingNote();
         ShippingNote shippingNote1 = new ShippingNote();
         shippingNote1.setShippingNoteNumber(hyFreightSettlementInfo.getOrderNo());
         shippingNote1.setShippingNoteNumber(hyFreightSettlementInfo.getOrderNo());
         shippingNote1.setSerialNumber("0000");
         shippingNote1.setSerialNumber("0000");
-        shippingNote1.setTotalMonetaryAmount(String.valueOf(hyFreightSettlementInfo.getAmountMoney()));
+        shippingNote1.setTotalMonetaryAmount(df.format(hyFreightSettlementInfo.getAmountMoney()));
         shippingNoteList.add(shippingNote1);
         shippingNoteList.add(shippingNote1);
         financialRoot.setShippingNoteList(shippingNoteList);
         financialRoot.setShippingNoteList(shippingNoteList);
         //财务列表
         //财务列表
@@ -351,17 +361,16 @@ public class MonitoringSystemReporting {
         financial1.setReceiptAccount(hyFreightSettlementInfo.getBankCard());
         financial1.setReceiptAccount(hyFreightSettlementInfo.getBankCard());
         financial1.setBankCode(hyFreightSettlementInfo.getBankKey());
         financial1.setBankCode(hyFreightSettlementInfo.getBankKey());
         financial1.setSequenceCode(hyFreightSettlementInfo.getSerialNumber());
         financial1.setSequenceCode(hyFreightSettlementInfo.getSerialNumber());
-        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(hyFreightSettlementInfo.getAmountMoney()));
-        financial1.setMonetaryAmount(String.valueOf(doubleValue1));
+        financial1.setMonetaryAmount(df.format(hyFreightSettlementInfo.getAmountMoney()));
         financial1.setDateTime(f1.format(hyFreightSettlementInfo.getPaymentDate()));
         financial1.setDateTime(f1.format(hyFreightSettlementInfo.getPaymentDate()));
         financiallist.add(financial1);
         financiallist.add(financial1);
         financialRoot.setFinanciallist(financiallist);
         financialRoot.setFinanciallist(financiallist);
-        Root root = getRoot(financialRoot, name);
+        Root root = getRoot(financialRoot, name, loginRoot("23106960", "qweasd!@#123", "91210804MA10FPAM2G", "debugSystem"));
         String messageJson = JSON.toJSONString(root);
         String messageJson = JSON.toJSONString(root);
         System.out.println("发送报文的内容:" + messageJson);
         System.out.println("发送报文的内容:" + messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         String result = PostUtils.post(sendUrl, messageJson);
         System.out.println("服务器返回消息:" + result);
         System.out.println("服务器返回消息:" + result);
-        return root;
+        return result;
     }
     }
 
 
     /**
     /**
@@ -369,22 +378,16 @@ public class MonitoringSystemReporting {
      *
      *
      * @return
      * @return
      */
      */
-    public static Root testDispatch(OrderInfo orderInfo) {
-        Root root = null;
-        try {
-            Root edmRoot = roots.get(r.nextInt(roots.size()));
-            String name = "电子运单";
-            Dispatch dispatch = getDispatch(orderInfo);
-//            dispatch.setUnifiedSocialCreditIdentifier(edmRoot.getUscc());
-            root = getRoot(dispatch, name, edmRoot);
-            String messageJson = JSON.toJSONString(root);
-            System.out.println("发送报文的内容:" + messageJson);
-            String result = PostUtils.post(sendUrl, messageJson);
-            System.out.println("服务器返回消息:" + result);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return root;
+    public static String testDispatch(OrderInfo orderInfo) throws Exception  {
+        String name = "电子运单";
+        Dispatch dispatch = getDispatch(orderInfo);
+        Root edmRoot = loginRoot("23106960", "qweasd!@#123", "91210804MA10FPAM2G", "debugSystem");
+        Root root = getRoot(dispatch, name, edmRoot);
+        String messageJson = JSON.toJSONString(root);
+        System.out.println("发送报文的内容:" + messageJson);
+        String result = PostUtils.post(sendUrl, messageJson);
+        System.out.println("服务器返回消息:" + result);
+        return result;
     }
     }
 
 
     /**
     /**
@@ -410,8 +413,9 @@ public class MonitoringSystemReporting {
         dispatch.setDespatchActualDateTime(f.format(orderInfo.getDeliveryTime()));
         dispatch.setDespatchActualDateTime(f.format(orderInfo.getDeliveryTime()));
         dispatch.setGoodsReceiptDateTime(f.format(orderInfo.getReceivingTime()));
         dispatch.setGoodsReceiptDateTime(f.format(orderInfo.getReceivingTime()));
         dispatch.setRemark("备注");
         dispatch.setRemark("备注");
-        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(orderInfo.getActualFreight()));
-        dispatch.setTotalMonetaryAmount(String.valueOf(doubleValue1));
+        DecimalFormat df = new DecimalFormat("0.000");
+        dispatch.setTotalMonetaryAmount(df.format(orderInfo.getActualFreight()));
+//        dispatch.setTotalMonetaryAmount("10000.000");
         setConsignorInfo(dispatch, orderInfo);
         setConsignorInfo(dispatch, orderInfo);
         setConsigneeInfo(dispatch, orderInfo);
         setConsigneeInfo(dispatch, orderInfo);
         setInsuranceInformation(dispatch, orderInfo);
         setInsuranceInformation(dispatch, orderInfo);
@@ -464,6 +468,8 @@ public class MonitoringSystemReporting {
 
 
     public static void setVehicleInfo(Dispatch dispatch, OrderInfo orderInfo) {
     public static void setVehicleInfo(Dispatch dispatch, OrderInfo orderInfo) {
         SimpleDateFormat f = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
         SimpleDateFormat f = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
+        DecimalFormat df = new DecimalFormat("0.000");
+
         List<VehicleInfo> vehicleInfos = new ArrayList<>();
         List<VehicleInfo> vehicleInfos = new ArrayList<>();
         //车辆信息
         //车辆信息
         VehicleInfo vehicleInfo = new VehicleInfo();
         VehicleInfo vehicleInfo = new VehicleInfo();
@@ -495,8 +501,8 @@ public class MonitoringSystemReporting {
         GoodsInfo goodsInfo1 = new GoodsInfo();
         GoodsInfo goodsInfo1 = new GoodsInfo();
         goodsInfo1.setDescriptionOfGoods(orderInfo.getGoodsName());
         goodsInfo1.setDescriptionOfGoods(orderInfo.getGoodsName());
         goodsInfo1.setCargoTypeClassificationCode(orderInfo.getGoodsTypeKey());
         goodsInfo1.setCargoTypeClassificationCode(orderInfo.getGoodsTypeKey());
-        Double doubleValue1 = Double.parseDouble(new DecimalFormat("0.000").format(orderInfo.getGrossWeight() * 1000));
-        goodsInfo1.setGoodsItemGrossWeight(String.valueOf(doubleValue1));
+        goodsInfo1.setGoodsItemGrossWeight(df.format(orderInfo.getGrossWeight() * 1000));
+//        goodsInfo1.setGoodsItemGrossWeight(df.format(100000));
         goodsInfos.add(goodsInfo1);
         goodsInfos.add(goodsInfo1);
         vehicleInfo.setGoodsInfo(goodsInfos);
         vehicleInfo.setGoodsInfo(goodsInfos);
         vehicleInfos.add(vehicleInfo);
         vehicleInfos.add(vehicleInfo);

+ 25 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/DriverCarInfoMapper.xml

@@ -155,6 +155,17 @@
                 AND c.escalation_status_key = '13'
                 AND c.escalation_status_key = '13'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND c.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND c.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND c.reported_status_key = '5'
+            </if>
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(d.account_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
             OR lower(d.account_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
@@ -226,6 +237,9 @@
         c.escalation_status_key as escalationStatusKey,
         c.escalation_status_key as escalationStatusKey,
         c.escalation_date as escalationDate,
         c.escalation_date as escalationDate,
         c.escalation_failure_reason as escalationFailureReason,
         c.escalation_failure_reason as escalationFailureReason,
+        c.reported_status_key as reportedStatusKey,
+        c.reported_status as reportedStatus,
+        c.reported_failure_reason as reportedFailureReason,
         c.create_date as createDate,
         c.create_date as createDate,
         c.update_date as updateDate
         c.update_date as updateDate
         FROM hy_driver_car_info c
         FROM hy_driver_car_info c
@@ -245,6 +259,17 @@
                 AND c.escalation_status_key = '13'
                 AND c.escalation_status_key = '13'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND c.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND c.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND c.reported_status_key = '5'
+            </if>
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(d.account_number) like lower(CONCAT('%',#{searchKeyWord},'%')))
             OR lower(d.account_number) like lower(CONCAT('%',#{searchKeyWord},'%')))

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

@@ -153,6 +153,17 @@
                 AND d.escalation_status_key = '13'
                 AND d.escalation_status_key = '13'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND d.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND d.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND d.reported_status_key = '5'
+            </if>
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
             OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
@@ -206,6 +217,9 @@
         d.escalation_failure_reason as escalationFailureReason,
         d.escalation_failure_reason as escalationFailureReason,
         d.escalation_status_key as escalationStatusKey,
         d.escalation_status_key as escalationStatusKey,
         case when d.escalation_status is null then '未认证' else d.escalation_status end as escalationStatus,
         case when d.escalation_status is null then '未认证' else d.escalation_status end as escalationStatus,
+        d.reported_status_key as reportedStatusKey,
+        d.reported_status as reportedStatus,
+        d.reported_failure_reason as reportedFailureReason,
         d.create_date as createDate,
         d.create_date as createDate,
         d.update_date as updateDate
         d.update_date as updateDate
         FROM common_user c
         FROM common_user c
@@ -226,6 +240,17 @@
                 AND d.escalation_status_key = '13'
                 AND d.escalation_status_key = '13'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND d.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND d.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND d.reported_status_key = '5'
+            </if>
+        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             AND (lower(d.driver_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
             OR lower(c.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))

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

@@ -123,6 +123,17 @@
                 AND f.escalation_status_key = '9'
                 AND f.escalation_status_key = '9'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND f.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND f.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND f.reported_status_key = '5'
+            </if>
+        </if>
         <if test="startDate != null and startDate != ''">
         <if test="startDate != null and startDate != ''">
             AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
             AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
             DATE_FORMAT(#{startDate},"%Y%m%d"))
@@ -156,6 +167,9 @@
         f.escalation_status_key as escalationStatusKey,
         f.escalation_status_key as escalationStatusKey,
         f.escalation_status as escalationStatus,
         f.escalation_status as escalationStatus,
         f.escalation_failure_reason as escalationFailureReason,
         f.escalation_failure_reason as escalationFailureReason,
+        f.reported_status_key as reportedStatusKey,
+        f.reported_status as reportedStatus,
+        f.reported_failure_reason as reportedFailureReason,
         f.serial_number as serialNumber,
         f.serial_number as serialNumber,
         f.arrival_date as arrivalDate,
         f.arrival_date as arrivalDate,
         f.payment_voucher as paymentVoucher,
         f.payment_voucher as paymentVoucher,
@@ -184,6 +198,17 @@
                 AND f.escalation_status_key = '9'
                 AND f.escalation_status_key = '9'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND f.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND f.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND f.reported_status_key = '5'
+            </if>
+        </if>
         <if test="startDate != null and startDate != ''">
         <if test="startDate != null and startDate != ''">
             AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
             AND (DATE_FORMAT(f.payment_date,"%Y%m%d") >=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
             DATE_FORMAT(#{startDate},"%Y%m%d"))

+ 54 - 7
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

@@ -81,13 +81,20 @@
         c.car_no as carNumber,
         c.car_no as carNumber,
         cu.avatar_url as cargoOwnerPortrait,
         cu.avatar_url as cargoOwnerPortrait,
         d.advance_payment as driverAdvancePayment,
         d.advance_payment as driverAdvancePayment,
-        co.advance_payment as ownerAdvancePayment
+        co.advance_payment as ownerAdvancePayment,
+        p.send_longitude as sendLongitude,
+        p.send_latitude as sendLatitude,
+        p.send_ad_code as sendAdCode,
+        p.unsend_ad_code as unsendAdCode,
+        p.unsend_longitude as unsendLongitude,
+        p.unsend_latitude as unsendLatitude
         FROM hy_order_info o
         FROM hy_order_info o
         LEFT JOIN common_user cu on o.cargo_common_id = cu.id and cu.delete_flag = 0
         LEFT JOIN common_user cu on o.cargo_common_id = cu.id and cu.delete_flag = 0
         LEFT JOIN hy_carrier_info c on c.order_id = o.id and c.delete_flag = 0
         LEFT JOIN hy_carrier_info c on c.order_id = o.id and c.delete_flag = 0
         LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
         LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
         LEFT JOIN hy_driver_info d on d.common_id = o.common_id and d.delete_flag = 0
         LEFT JOIN hy_driver_info d on d.common_id = o.common_id and d.delete_flag = 0
         LEFT JOIN hy_cargo_owner_info co on co.common_id = o.cargo_common_id and co.delete_flag = 0
         LEFT JOIN hy_cargo_owner_info co on co.common_id = o.cargo_common_id and co.delete_flag = 0
+        LEFT JOIN hy_publish_task_info p on p.id = o.task_id and p.delete_flag = 0
         WHERE o.delete_flag = '0'
         WHERE o.delete_flag = '0'
         AND o.common_id = #{commonId}
         AND o.common_id = #{commonId}
         <if test="searchKeyWord != null and searchKeyWord != ''">
         <if test="searchKeyWord != null and searchKeyWord != ''">
@@ -427,12 +434,21 @@
 
 
     <select id="getData" parameterType="Map"
     <select id="getData" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo">
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo">
-    select * from hy_order_info where delete_flag = '0'
-    AND common_id = #{commonId}
-    AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH) &lt;= date(create_date)
-    AND order_status_key &lt; 15
-    AND order_status_key > 1
-    ORDER BY update_date DESC
+    select o.*,
+    p.send_longitude as sendLongitude,
+    p.send_latitude as sendLatitude,
+    p.send_ad_code as sendAdCode,
+    p.unsend_ad_code as unsendAdCode,
+    p.unsend_longitude as unsendLongitude,
+    p.unsend_latitude as unsendLatitude
+    from hy_order_info o
+    LEFT JOIN hy_publish_task_info p on p.id = o.task_id and p.delete_flag = 0
+    where o.delete_flag = '0'
+    AND o.common_id = #{commonId}
+    AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH) &lt;= date(o.create_date)
+    AND o.order_status_key &lt; 15
+    AND o.order_status_key > 1
+    ORDER BY o.update_date DESC
     </select>
     </select>
 
 
 
 
@@ -476,13 +492,28 @@
                 AND o.escalation_status_key = '9'
                 AND o.escalation_status_key = '9'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND o.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND o.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND o.reported_status_key = '5'
+            </if>
+        </if>
     </select>
     </select>
+
     <!-- 获得后台管理运单上报列表 -->
     <!-- 获得后台管理运单上报列表 -->
     <select id="getWaybillListhByCondition" parameterType="Map"
     <select id="getWaybillListhByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo">
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo">
         SELECT
         SELECT
         o.id,
         o.id,
         o.order_no as orderNo,
         o.order_no as orderNo,
+        o.task_id as taskId,
+        o.cargo_common_id as cargoCommonId,
+        o.common_id as commonId,
         case when o.freight_advance = 1 then '垫付' else '非垫付' end as freightAdvance,
         case when o.freight_advance = 1 then '垫付' else '非垫付' end as freightAdvance,
         o.cargo_owner as cargoOwner,
         o.cargo_owner as cargoOwner,
         o.driver_name as driverName,
         o.driver_name as driverName,
@@ -512,11 +543,16 @@
         o.escalation_status_key as escalationStatusKey,
         o.escalation_status_key as escalationStatusKey,
         o.escalation_status as escalationStatus,
         o.escalation_status as escalationStatus,
         o.escalation_failure_reason as escalationFailureReason,
         o.escalation_failure_reason as escalationFailureReason,
+        o.reported_status_key as reportedStatusKey,
+        o.reported_status as reportedStatus,
+        o.reported_failure_reason as reportedFailureReason,
         c.car_number_colour as carNumberColour,
         c.car_number_colour as carNumberColour,
         d.number_card as driverIdCard,
         d.number_card as driverIdCard,
         o.car_number as carNumber,
         o.car_number as carNumber,
         o.goods_type as goodsType,
         o.goods_type as goodsType,
         o.goods_type_key as goodsTypeKey,
         o.goods_type_key as goodsTypeKey,
+        o.goods_name as goodsName,
+        o.actual_freight as actualFreight,
         o.create_date as createDate,
         o.create_date as createDate,
         o.update_date as updateDate
         o.update_date as updateDate
         FROM hy_order_info o
         FROM hy_order_info o
@@ -555,6 +591,17 @@
                 AND o.escalation_status_key = '9'
                 AND o.escalation_status_key = '9'
             </if>
             </if>
         </if>
         </if>
+        <if test="administrationType != null and administrationType != ''">
+            <if test="administrationType == 1">
+                AND o.reported_status_key = '1'
+            </if>
+            <if test="administrationType == 2">
+                AND o.reported_status_key = '3'
+            </if>
+            <if test="administrationType == 3">
+                AND o.reported_status_key = '5'
+            </if>
+        </if>
         ORDER BY o.order_end_date DESC
         ORDER BY o.order_end_date DESC
         <if test="currentPage != null and currentPage != ''">
         <if test="currentPage != null and currentPage != ''">
             LIMIT ${startRecord}, ${pageSize}
             LIMIT ${startRecord}, ${pageSize}