haungfuli 2 years ago
parent
commit
c24909ab4e

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

@@ -1269,17 +1269,13 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         //判断装车毛重是否大于等于车辆核定载质量
                         //判断装车毛重是否大于等于车辆核定载质量
                         if ("挂车".equals(hyDriverCarInfo1.getCarCategory())) {
                         if ("挂车".equals(hyDriverCarInfo1.getCarCategory())) {
                             if (orderInfo1.getGrossWeight() >= (hyDriverCarInfo1.getGuaCarApprovedWeight() / 1000)) {
                             if (orderInfo1.getGrossWeight() >= (hyDriverCarInfo1.getGuaCarApprovedWeight() / 1000)) {
-                                int min_val = 1;
-                                int max_val = 4;
-                                double randomNum = Math.random() * ( max_val - min_val );
-                                orderInfo1.setGrossWeight(hyDriverCarInfo1.getGuaCarApprovedWeight() - randomNum);
+                                int randomNum = (int) (Math.random() * (4 - 1 + 1)) + 1;
+                                orderInfo1.setGrossWeight((hyDriverCarInfo1.getGuaCarApprovedWeight() / 1000) - randomNum);
                             }
                             }
                         } else {
                         } else {
                             if (orderInfo1.getGrossWeight() >= (hyDriverCarInfo1.getCarApprovedWeight() / 1000)) {
                             if (orderInfo1.getGrossWeight() >= (hyDriverCarInfo1.getCarApprovedWeight() / 1000)) {
-                                int min_val = 1;
-                                int max_val = 4;
-                                double randomNum = Math.random() * ( max_val - min_val );
-                                orderInfo1.setGrossWeight(hyDriverCarInfo1.getCarApprovedWeight() - randomNum);
+                                int randomNum = (int) (Math.random() * (4 - 1 + 1)) + 1;
+                                orderInfo1.setGrossWeight((hyDriverCarInfo1.getCarApprovedWeight() / 1000) - randomNum);
                             }
                             }
                         }
                         }
                         if (hyCarrierInfo.getVolume() != null) {
                         if (hyCarrierInfo.getVolume() != null) {
@@ -1325,7 +1321,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         }
                         }
                     }
                     }
 
 
-
                     new Thread(new Runnable() {
                     new Thread(new Runnable() {
                         @Override
                         @Override
                         public void run() {
                         public void run() {