Эх сурвалжийг харах

卸货的地址运量信息为空的查询bug

czh 1 жил өмнө
parent
commit
7efc475f08

+ 6 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dubbo/TransportServiceImpl.java

@@ -325,11 +325,12 @@ public class TransportServiceImpl implements TransportRemoteService {
                 Map<Long, LineFreightAddressRes> lineFreightAddress = manageService.findLineFreightAddress(lineFreightRateIds);
                 if (lineFreightAddress != null) {
                     for (LineFreightAddressRes address : lineFreightAddress.values()) {
-                        BigDecimal decimal = amountMap.get(address.getId());
-                        if (decimal != null) {
-                            BigDecimal sum = address.getTransportPrice().multiply(decimal).setScale(2, RoundingMode.HALF_UP);
-                            actualAmount = actualAmount.add(sum);
-                        }
+//                        BigDecimal decimal = amountMap.get(address.getId());
+//                        if (decimal != null) {
+//                            BigDecimal sum = address.getTransportPrice().multiply(decimal).setScale(2, RoundingMode.HALF_UP);
+//                            actualAmount = actualAmount.add(sum);
+//                        }
+                        actualAmount = actualAmount.add(address.getTransportAmount());
                     }
                 }
             }

+ 6 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtLogisticsOrderConsignmentService.java

@@ -1777,6 +1777,7 @@ public class KwtLogisticsOrderConsignmentService {
             parentLoadOrderMap = orderLoadAddress.stream().collect(Collectors.toMap(KwtLogisticsOrderAddress::getId, Function.identity()));
         }
         if (!CollectionUtils.isEmpty(loadAddress)) {
+            int sort = 1;
             for (AddressInfoDto address : loadAddress) {
                 if (address.getAmount().compareTo(new BigDecimal("0.00")) == 0) {
                     continue;
@@ -1792,7 +1793,7 @@ public class KwtLogisticsOrderConsignmentService {
                     loadOrderAddress.setDetailAddress(loadAddressData.getDetailAddress());
                     loadOrderAddress.setContacts(loadAddressData.getContacts());
                     loadOrderAddress.setLOrderId(orderId);
-                    loadOrderAddress.setSort(address.getSort());
+                    loadOrderAddress.setSort(sort);
                     loadOrderAddress.setLat(loadAddressData.getLat());
                     loadOrderAddress.setFence(loadAddressData.getFence());
                     loadOrderAddress.setCityName(loadAddressData.getCityName());
@@ -1828,6 +1829,7 @@ public class KwtLogisticsOrderConsignmentService {
                     orderAmount.setUpdateTime(new Date());
                     orderAmount.setDelFlag(0);
                     logisticsOrderAmountMapper.insert(orderAmount);
+                    sort += 1;
                 }
             }
 
@@ -1846,6 +1848,7 @@ public class KwtLogisticsOrderConsignmentService {
         }
 
         if (!ObjectUtils.isEmpty(unloadAddress)) {
+            int sort = 1;
             for (AddressInfoDto address : unloadAddress) {
                 if (address.getAmount().compareTo(new BigDecimal("0.00")) == 0) {
                     continue;
@@ -1877,7 +1880,7 @@ public class KwtLogisticsOrderConsignmentService {
                     unloadOrderAddress.setLng(loadAddressData.getLng());
                     unloadOrderAddress.setRemark(loadAddressData.getRemark());
                     unloadOrderAddress.setStatus(loadAddressData.getStatus());
-                    unloadOrderAddress.setSort(address.getSort());
+                    unloadOrderAddress.setSort(sort);
                     logisticsOrderAddressMapper.insert(unloadOrderAddress);
 
                     KwtLogisticsOrderAmount orderAmount = new KwtLogisticsOrderAmount();
@@ -1898,6 +1901,7 @@ public class KwtLogisticsOrderConsignmentService {
                     orderAmount.setUpdateTime(new Date());
                     orderAmount.setDelFlag(0);
                     logisticsOrderAmountMapper.insert(orderAmount);
+                    sort += 1;
                 }
             }
         }

+ 4 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtTransportCommonService.java

@@ -832,12 +832,12 @@ public class KwtTransportCommonService {
                         Map<Long, LineFreightAddressRes> lineFreightAddress = manageService.findLineFreightAddress(lineFreightRateIds);
                         if (lineFreightAddress != null) {
                             for (LineFreightAddressRes address : lineFreightAddress.values()) {
-                                BigDecimal decimal = amountMap.get(address.getId());
-                                if (decimal != null) {
+//                                BigDecimal decimal = amountMap.get(address.getId());
+//                                if (decimal != null) {
 //                                    BigDecimal sum = address.getTransportPrice().multiply(decimal).setScale(2, RoundingMode.HALF_UP);
 //                                    actualAmount = actualAmount.add(address.getTransportAmount());
-                                    actualAmount = actualAmount.add(address.getTransportAmount());
-                                }
+//                                }
+                                actualAmount = actualAmount.add(address.getTransportAmount());
                             }
                         }
                     }

+ 1 - 2
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderAddressMapper.xml

@@ -66,9 +66,8 @@
         a.detail_address AS unloadAddressDetail,
         b.load_amount    AS unloadAmount
         FROM kwt_logistics_order_address a
-        LEFT JOIN kwt_logistics_order_amount b ON a.id = b.l_address_id
+        LEFT JOIN kwt_logistics_order_amount b ON a.id = b.l_address_id AND b.del_flag = 0
         WHERE a.del_flag = 0
-        AND b.del_flag = 0
         AND a.address_type = #{addressType,jdbcType=INTEGER}
         AND a.l_order_id = #{lOrderId}
     </select>