Przeglądaj źródła

去除抛重系数,改为固定数值。

jz.kai 2 lat temu
rodzic
commit
f517f81f14

+ 40 - 12
web/src/main/java/com/jpsoft/prices/modules/base/controller/InvoiceQuotesController.java

@@ -160,11 +160,25 @@ public class InvoiceQuotesController {
                     totalWeight = totalWeight.add(info.getGrossWeight());
                     totalWeight = totalWeight.add(info.getGrossWeight());
                     totalVolume = totalVolume + info.getBoxLength() * info.getBoxWidth() * info.getBoxHight();
                     totalVolume = totalVolume + info.getBoxLength() * info.getBoxWidth() * info.getBoxHight();
                 }
                 }
+                if(company.getName().equals("跨越物流")) {
+                    BigDecimal tempWeight = new BigDecimal(0);
+                    tempWeight = new BigDecimal(totalVolume / 6000).setScale(1, BigDecimal.ROUND_HALF_UP);
+                    if (tempWeight.compareTo(totalWeight) > 0) {
+                        totalWeight = tempWeight;
+                    }
+                }
+                if(company.getName().equals("成程物流")) {
+                    BigDecimal tempWeight = new BigDecimal(0);
+                    tempWeight = new BigDecimal(totalVolume / 1000000 / 3.3).setScale(1, BigDecimal.ROUND_HALF_UP);
+                    if (tempWeight.compareTo(totalWeight) > 0) {
+                        totalWeight = tempWeight;
+                    }
+                }
 
 
                 if(totalWeight.compareTo(new BigDecimal(0)) > 0 && (new BigDecimal(1)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(0)) > 0 && (new BigDecimal(1)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖0,1】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖0,1】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -178,7 +192,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(1)) > 0 && (new BigDecimal(50)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(1)) > 0 && (new BigDecimal(50)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖1,50】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖1,50】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -192,7 +206,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(50)) > 0 && (new BigDecimal(100)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(50)) > 0 && (new BigDecimal(100)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖50,100】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖50,100】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -206,7 +220,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(100)) > 0 && (new BigDecimal(200)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(100)) > 0 && (new BigDecimal(200)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖100,200】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖100,200】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -220,7 +234,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(200)) > 0 && (new BigDecimal(300)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(200)) > 0 && (new BigDecimal(300)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖200,300】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖200,300】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -234,7 +248,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(300)) > 0 && (new BigDecimal(500)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(300)) > 0 && (new BigDecimal(500)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖300,500】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖300,500】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -248,7 +262,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(500)) > 0 && (new BigDecimal(1000)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(500)) > 0 && (new BigDecimal(1000)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖500,1000】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖500,1000】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -262,7 +276,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(1000)) > 0 && (new BigDecimal(2000)).compareTo(totalWeight) >= 0) {
                 if(totalWeight.compareTo(new BigDecimal(1000)) > 0 && (new BigDecimal(2000)).compareTo(totalWeight) >= 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖1000,2000】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖1000,2000】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -276,7 +290,7 @@ public class InvoiceQuotesController {
                 if(totalWeight.compareTo(new BigDecimal(2000)) > 0) {
                 if(totalWeight.compareTo(new BigDecimal(2000)) > 0) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖2000,∞】");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖2000,∞】");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = weightPlanB(standard, totalWeight);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -287,10 +301,24 @@ public class InvoiceQuotesController {
                         totalFee = transportFee.add(deliveryFee).add(storageFee).add(insureFee).add(taxFee).add(receiptFee);
                         totalFee = transportFee.add(deliveryFee).add(storageFee).add(insureFee).add(taxFee).add(receiptFee);
                     }
                     }
                 }
                 }
+//                if(totalWeight.compareTo(new BigDecimal(300)) > 0 && (new BigDecimal(500)).compareTo(totalWeight) >= 0) {
+//                    Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖300,500】");
+//                    if(standard != null) {
+//                        BigDecimal tempFee = weightPlanB(standard, totalWeight, totalVolume);
+//
+//                        transportFee = transportFee.add(tempFee);
+//                        deliveryFee = standard.getDeliveryFee();
+//                        storageFee = standard.getStorageFee();
+//                        insureFee = new BigDecimal(invoice.getGoodsValue()).multiply(standard.getInsureFee());
+//                        taxFee = transportFee.multiply(standard.getTaxFee());
+//                        receiptFee = standard.getReceiptFee();
+//                        totalFee = transportFee.add(deliveryFee).add(storageFee).add(insureFee).add(taxFee).add(receiptFee);
+//                    }
+//                }
                 if(totalWeight.compareTo(new BigDecimal(5 * 1000)) <= 0 && totalVolume <= 25 * 1000000) {
                 if(totalWeight.compareTo(new BigDecimal(5 * 1000)) <= 0 && totalVolume <= 25 * 1000000) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(4.2米)");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(4.2米)");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = rentalPlan(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = rentalPlan(standard);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -304,7 +332,7 @@ public class InvoiceQuotesController {
                 else if(totalWeight.compareTo(new BigDecimal(15 * 1000)) > 0 || totalVolume > 50 * 1000000) {
                 else if(totalWeight.compareTo(new BigDecimal(15 * 1000)) > 0 || totalVolume > 50 * 1000000) {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(9.6米)");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(9.6米)");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = rentalPlan(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = rentalPlan(standard);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();
@@ -318,7 +346,7 @@ public class InvoiceQuotesController {
                 else {
                 else {
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(6.8米)");
                     Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(6.8米)");
                     if(standard != null) {
                     if(standard != null) {
-                        BigDecimal tempFee = rentalPlan(standard, totalWeight, totalVolume);
+                        BigDecimal tempFee = rentalPlan(standard);
 
 
                         transportFee = transportFee.add(tempFee);
                         transportFee = transportFee.add(tempFee);
                         deliveryFee = standard.getDeliveryFee();
                         deliveryFee = standard.getDeliveryFee();

+ 2 - 8
web/src/main/java/com/jpsoft/prices/modules/common/controller/PlansController.java

@@ -36,15 +36,9 @@ public class PlansController {
     /**
     /**
      * 计重方案(首重、起步价、保底价)
      * 计重方案(首重、起步价、保底价)
      */
      */
-    public static BigDecimal weightPlanB(Standard standard, BigDecimal weight, Integer volume){
+    public static BigDecimal weightPlanB(Standard standard, BigDecimal weight){
         BigDecimal val = new BigDecimal(0);
         BigDecimal val = new BigDecimal(0);
 
 
-        BigDecimal tempWeight = new BigDecimal(0);
-        tempWeight = new BigDecimal(volume / standard.getVolumeMetric()).setScale(1, BigDecimal.ROUND_HALF_UP);
-        if (tempWeight.compareTo(weight) > 0) {
-            weight = tempWeight;
-        }
-
         if(weight.compareTo(new BigDecimal(0)) > 0 && (new BigDecimal(1)).compareTo(weight) >= 0){
         if(weight.compareTo(new BigDecimal(0)) > 0 && (new BigDecimal(1)).compareTo(weight) >= 0){
             val = standard.getStartingPrice();
             val = standard.getStartingPrice();
         }
         }
@@ -62,7 +56,7 @@ public class PlansController {
     /**
     /**
      * 整车方案
      * 整车方案
      */
      */
-    public static BigDecimal rentalPlan(Standard standard, BigDecimal weight, Integer volume){
+    public static BigDecimal rentalPlan(Standard standard){
         BigDecimal val = new BigDecimal(0);
         BigDecimal val = new BigDecimal(0);
 
 
         val = standard.getUnitPrice();
         val = standard.getUnitPrice();