|
@@ -3,14 +3,8 @@ package com.jpsoft.prices.modules.base.controller;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.prices.modules.base.dto.InvoiceInfoDTO;
|
|
|
import com.jpsoft.prices.modules.base.dto.InvoiceQuotesDTO;
|
|
|
-import com.jpsoft.prices.modules.base.entity.Company;
|
|
|
-import com.jpsoft.prices.modules.base.entity.Invoice;
|
|
|
-import com.jpsoft.prices.modules.base.entity.InvoiceInfo;
|
|
|
-import com.jpsoft.prices.modules.base.entity.Standard;
|
|
|
-import com.jpsoft.prices.modules.base.service.CompanyService;
|
|
|
-import com.jpsoft.prices.modules.base.service.InvoiceInfoService;
|
|
|
-import com.jpsoft.prices.modules.base.service.InvoiceService;
|
|
|
-import com.jpsoft.prices.modules.base.service.StandardService;
|
|
|
+import com.jpsoft.prices.modules.base.entity.*;
|
|
|
+import com.jpsoft.prices.modules.base.service.*;
|
|
|
import com.jpsoft.prices.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.prices.modules.common.dto.Sort;
|
|
|
import com.jpsoft.prices.modules.common.utils.PojoUtils;
|
|
@@ -42,6 +36,8 @@ public class InvoiceQuotesController {
|
|
|
private InvoiceInfoService invoiceInfoService;
|
|
|
@Autowired
|
|
|
private StandardService standardService;
|
|
|
+ @Autowired
|
|
|
+ private DestinationService destinationService;
|
|
|
|
|
|
@ApiOperation(value="基于物流公司的报价单比对")
|
|
|
@RequestMapping(value = "quotesList",method = RequestMethod.POST)
|
|
@@ -91,7 +87,7 @@ public class InvoiceQuotesController {
|
|
|
// continue;
|
|
|
// }
|
|
|
if(info.getGrossWeight().compareTo(new BigDecimal(1000)) >= 0) {
|
|
|
- standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量");
|
|
|
+ standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "e915f3a3-a431-4879-a729-a4b4d0a0e97a", "重量");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanA(standard, info);
|
|
|
|
|
@@ -111,7 +107,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
if(info.getBoxLength() >= 1000 || info.getBoxWidth() >= 1000 ||info.getBoxHight() >= 1000) {
|
|
|
- standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "木箱(1米及以上)");
|
|
|
+ standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "e915f3a3-a431-4879-a729-a4b4d0a0e97a", "木箱(1米及以上)");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = piecePlan(standard, info);
|
|
|
|
|
@@ -131,7 +127,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
if(info.getBoxLength() < 1000 && info.getBoxWidth() < 1000 && info.getBoxHight() < 1000) {
|
|
|
- standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "木箱(1米以下)");
|
|
|
+ standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "e915f3a3-a431-4879-a729-a4b4d0a0e97a", "木箱(1米以下)");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = piecePlan(standard, info);
|
|
|
|
|
@@ -176,7 +172,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖0,1】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -190,7 +186,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖1,50】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -204,7 +200,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖50,100】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -218,7 +214,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖100,200】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -232,7 +228,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖200,300】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -246,7 +242,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖300,500】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -260,7 +256,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖500,1000】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -274,7 +270,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖1000,2000】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -288,7 +284,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
if(totalWeight.compareTo(new BigDecimal(2000)) > 0) {
|
|
|
- Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "重量〖2000,∞】");
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "d4e79194-6367-4fdc-bc39-a68accdb499f", "重量〖2000,∞】");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = weightPlanB(standard, totalWeight);
|
|
|
|
|
@@ -301,22 +297,68 @@ public class InvoiceQuotesController {
|
|
|
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(0)) > 0 && (new BigDecimal(1000)).compareTo(totalWeight) >= 0) {
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "f01af697-c6a3-4e83-a500-360926df9597", "重量〖0,1】");
|
|
|
+ if(standard != null) {
|
|
|
+ Destination destination = destinationService.get(invoice.getDestinationId());
|
|
|
+ BigDecimal tempFee = weightPlanC(standard, totalWeight, new BigDecimal(destination.getMileage()));
|
|
|
+
|
|
|
+ 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(1000)) > 0 && (new BigDecimal(3000)).compareTo(totalWeight) >= 0) {
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "f01af697-c6a3-4e83-a500-360926df9597", "重量〖1,3】");
|
|
|
+ if(standard != null) {
|
|
|
+ Destination destination = destinationService.get(invoice.getDestinationId());
|
|
|
+ BigDecimal tempFee = weightPlanC(standard, totalWeight, new BigDecimal(destination.getMileage()));
|
|
|
+
|
|
|
+ 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(3000)) > 0 && (new BigDecimal(5000)).compareTo(totalWeight) >= 0) {
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "f01af697-c6a3-4e83-a500-360926df9597", "重量〖3,5】");
|
|
|
+ if(standard != null) {
|
|
|
+ Destination destination = destinationService.get(invoice.getDestinationId());
|
|
|
+ BigDecimal tempFee = weightPlanC(standard, totalWeight, new BigDecimal(destination.getMileage()));
|
|
|
+
|
|
|
+ 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(5000)) > 0) {
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "f01af697-c6a3-4e83-a500-360926df9597", "重量〖5,∞】");
|
|
|
+ if(standard != null) {
|
|
|
+ Destination destination = destinationService.get(invoice.getDestinationId());
|
|
|
+ BigDecimal tempFee = weightPlanC(standard, totalWeight, new BigDecimal(destination.getMileage()));
|
|
|
+
|
|
|
+ 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) {
|
|
|
- Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(4.2米)");
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "27ecefdd-ed26-45ba-8995-d8e7a35bb78e", "整车(4.2米)");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = rentalPlan(standard);
|
|
|
|
|
@@ -330,7 +372,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
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(), "27ecefdd-ed26-45ba-8995-d8e7a35bb78e", "整车(9.6米)");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = rentalPlan(standard);
|
|
|
|
|
@@ -344,7 +386,7 @@ public class InvoiceQuotesController {
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "整车(6.8米)");
|
|
|
+ Standard standard = standardService.getStandard(company.getId(), invoice.getDestinationId(), "27ecefdd-ed26-45ba-8995-d8e7a35bb78e", "整车(6.8米)");
|
|
|
if(standard != null) {
|
|
|
BigDecimal tempFee = rentalPlan(standard);
|
|
|
|