Bladeren bron

整车线完成

jz.kai 2 jaren geleden
bovenliggende
commit
b68b29b59e

+ 42 - 0
web/src/main/java/com/jpsoft/prices/modules/base/controller/InvoiceQuotesController.java

@@ -287,6 +287,48 @@ public class InvoiceQuotesController {
                         totalFee = transportFee.add(deliveryFee).add(storageFee).add(insureFee).add(taxFee).add(receiptFee);
                     }
                 }
+                if(totalWeight.compareTo(new BigDecimal(5 * 1000)) <= 0 && totalVolume <= 25 * 1000000) {
+                    Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(4.2米)");
+                    if(standard != null) {
+                        BigDecimal tempFee = rentalPlan(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) && !(totalWeight.compareTo(new BigDecimal(15 * 1000)) > 0 || totalVolume > 50 * 1000000)) {
+                    Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(6.8米)");
+                    if(standard != null) {
+                        BigDecimal tempFee = rentalPlan(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(15 * 1000)) > 0 || totalVolume > 50 * 1000000) {
+                    Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(9.6米)");
+                    if(standard != null) {
+                        BigDecimal tempFee = rentalPlan(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);
+                    }
+                }
 
                 dto.setCompanyName(company.getName());
                 dto.setNumbers(infoList.size());

+ 11 - 0
web/src/main/java/com/jpsoft/prices/modules/common/controller/PlansController.java

@@ -58,4 +58,15 @@ public class PlansController {
 
         return val;
     }
+
+    /**
+     * 整车方案
+     */
+    public static BigDecimal rentalPlan(Standard standard, BigDecimal weight, Integer volume){
+        BigDecimal val = new BigDecimal(0);
+
+        val = standard.getUnitPrice();
+
+        return val;
+    }
 }

+ 1 - 1
web/src/main/resources/application-production.yml

@@ -1,6 +1,6 @@
 spring:
   datasource:
-    url: jdbc:log4jdbc:mysql://47.92.161.104:3336/feilihua_prices?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    url: jdbc:log4jdbc:mysql://114.55.55.123:3306/feilihua_prices?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
     username: root
     password: jpsoft8121234