haungfuli преди 2 години
родител
ревизия
c4a2b745a1

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

@@ -993,6 +993,34 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         if ("3".equals(ENV)) {
             if (CollectionUtils.isNotEmpty(orderInfo.getOrderInfoList())) {
                 for (OrderInfo orderInfo1 : orderInfo.getOrderInfoList()) {
+
+                    //驾驶员监测系统上报
+                    HyDriverInfo hyDriverInfo1 = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                            .eq("common_id",orderInfo1.getCommonId()).eq("delete_flag","0"));
+                    new Thread(new Runnable() {
+                        @Override
+                        public void run() {
+                            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());
+                                    hyDriverInfo1.setReportedFailureReason(jsonObject.getString("data"));
+                                }
+                                driverInfoService.updateById(hyDriverInfo1);
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    }).start();
+
                     //车辆监测系统上报
                     HyDriverCarInfo hyDriverCarInfo1 = driverCarInfoService.selectOne(new EntityWrapper<HyDriverCarInfo>()
                     .eq("car_number",orderInfo1.getCarNumber()).eq("delete_flag","0"));
@@ -1062,9 +1090,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         }
                     }
                     //查询发货地区行政区划代码
-                    hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
+                    HyCommonSysParameter hyCommonSysParameter2 = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                             .eq("const_id", "REGION1").eq("const_value", orderInfo1.getSendArea()));
-                    orderInfo1.setNationalCode(hyCommonSysParameter.getConstKey());
+                    orderInfo1.setNationalCode(hyCommonSysParameter2.getConstKey());
                     //查询收货地区行政区划代码
                     HyCommonSysParameter hyCommonSysParameter1 = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                             .eq("const_id", "REGION1").eq("const_value", orderInfo1.getUnloadArea()));