|
@@ -211,9 +211,6 @@ public class PayOrderLogic {
|
|
|
workerOrderBuy.insert();
|
|
|
|
|
|
BigDecimal totalAmount = new BigDecimal("0");
|
|
|
- BigDecimal workerAmount = new BigDecimal("0");
|
|
|
-
|
|
|
- BigDecimal workerProceAmount = new BigDecimal("0");
|
|
|
BigDecimal manualAmount = new BigDecimal("0");
|
|
|
|
|
|
|
|
@@ -232,9 +229,7 @@ public class PayOrderLogic {
|
|
|
|
|
|
|
|
|
totalAmount = totalAmount.add(workerOrderItem.getTotalAmount());
|
|
|
- workerAmount = workerAmount.add(workerOrderItem.getWorkerAmount());
|
|
|
|
|
|
- workerProceAmount = workerProceAmount.add(workerOrderItem.getWorkerProceAmount());
|
|
|
manualAmount = manualAmount.add(Objects.isNull(workerOrderItem.getManualAmount()) ? BigDecimal.ZERO : workerOrderItem.getManualAmount());
|
|
|
num = num.add(workerOrderItem.getNum());
|
|
|
}
|
|
@@ -244,38 +239,13 @@ public class PayOrderLogic {
|
|
|
totalAmount = totalAmount.add(workerOrderBuy.getServicePrice());
|
|
|
|
|
|
|
|
|
- BigDecimal workerServiceProceAmount = workerOrderBuy.getServicePrice().multiply(Convert.toBigDecimal("0.006"));
|
|
|
-
|
|
|
-
|
|
|
- if (workerServiceProceAmount.doubleValue() > 0.01) {
|
|
|
- workerServiceProceAmount = workerServiceProceAmount.setScale(2, BigDecimal.ROUND_CEILING);
|
|
|
- workerProceAmount =workerProceAmount.add(workerServiceProceAmount);
|
|
|
|
|
|
- }else {
|
|
|
- workerServiceProceAmount = Convert.toBigDecimal("0.01");
|
|
|
- workerProceAmount =workerProceAmount.add(workerServiceProceAmount);
|
|
|
- }
|
|
|
-
|
|
|
- workerAmount = workerAmount.add(workerOrderBuy.getServicePrice()).subtract(workerServiceProceAmount);
|
|
|
}
|
|
|
|
|
|
|
|
|
if (workerOrderBuy.getOtherPrice() != null){
|
|
|
|
|
|
totalAmount = totalAmount.add(workerOrderBuy.getOtherPrice());
|
|
|
- workerAmount = workerAmount.add(workerOrderBuy.getServicePrice());
|
|
|
- BigDecimal workerOtherProceAmount = workerOrderBuy.getOtherPrice().multiply(Convert.toBigDecimal("0.006"));
|
|
|
-
|
|
|
-
|
|
|
- if (workerOtherProceAmount.doubleValue() > 0.01) {
|
|
|
- workerOtherProceAmount = workerOtherProceAmount.setScale(2, BigDecimal.ROUND_CEILING);
|
|
|
- workerProceAmount =workerProceAmount.add(workerOtherProceAmount.setScale(2, BigDecimal.ROUND_CEILING));
|
|
|
-
|
|
|
- }else {
|
|
|
- workerOtherProceAmount = Convert.toBigDecimal("0.01");
|
|
|
- workerProceAmount =workerProceAmount.add(Convert.toBigDecimal("0.01"));
|
|
|
- }
|
|
|
- workerAmount = workerAmount.add(workerOrderBuy.getServicePrice()).subtract(workerOtherProceAmount);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -293,16 +263,11 @@ public class PayOrderLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (workerProceAmount.doubleValue() > 0.01) {
|
|
|
- workerOrderBuy.setWorkerProceAmount(workerProceAmount.setScale(2, BigDecimal.ROUND_CEILING));
|
|
|
- }else {
|
|
|
- if (totalAmount.doubleValue() > 0)
|
|
|
- workerOrderBuy.setWorkerProceAmount(Convert.toBigDecimal("0.01"));
|
|
|
- }
|
|
|
- workerOrderBuy.setWorkerProceAmount(workerProceAmount);
|
|
|
- workerOrderBuy.setCommissionAmount(workerProceAmount);
|
|
|
+
|
|
|
+ workerOrderBuy.setWorkerProceAmount(totalAmount.multiply(Convert.toBigDecimal("0.006")).setScale(2,BigDecimal.ROUND_CEILING));
|
|
|
+ workerOrderBuy.setCommissionAmount(totalAmount.multiply(Convert.toBigDecimal("0.006")).setScale(2,BigDecimal.ROUND_CEILING));
|
|
|
workerOrderBuy.setTotalAmount(totalAmount);
|
|
|
- workerOrderBuy.setWorkerAmount(workerAmount);
|
|
|
+ workerOrderBuy.setWorkerAmount(totalAmount.subtract(totalAmount.multiply(Convert.toBigDecimal("0.006"))).setScale(2,BigDecimal.ROUND_CEILING));
|
|
|
workerOrderBuy.setManualAmount(manualAmount);
|
|
|
|
|
|
workerOrderBuy.setNum(num);
|
|
@@ -351,25 +316,6 @@ public class PayOrderLogic {
|
|
|
|
|
|
workerOrderItem.setChargeType("ACC");
|
|
|
workerOrderItem.setWorkerAmount(workerOrderItem.getNormAmount().multiply(Convert.toBigDecimal(workerOrderItem.getNum())));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- BigDecimal workerProceAmount = workerOrderItem.getWorkerAmount().multiply(Convert.toBigDecimal("0.006"));
|
|
|
-
|
|
|
-
|
|
|
- if (workerProceAmount.doubleValue() > 0.01) {
|
|
|
- workerOrderItem.setWorkerProceAmount(workerProceAmount.setScale(2, BigDecimal.ROUND_CEILING));
|
|
|
-
|
|
|
- }else {
|
|
|
- workerOrderItem.setWorkerProceAmount(Convert.toBigDecimal("0.01"));
|
|
|
- }
|
|
|
-
|
|
|
- workerOrderItem.setWorkerAmount(workerOrderItem.getWorkerAmount().subtract(workerOrderItem.getWorkerProceAmount()));
|
|
|
-
|
|
|
- if (workerOrderItem.getWorkerAmount().doubleValue() <= 0){
|
|
|
- workerOrderItem.setWorkerProceAmount(Convert.toBigDecimal("0"));
|
|
|
- workerOrderItem.setWorkerAmount(Convert.toBigDecimal("0"));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
private void addFuCai(Map<String, WorkerNormStockBean> workerStockMap, WorkerOrderItem workerOrderItem, WorkerOrderBuy workerOrderBuy) {
|
|
@@ -431,26 +377,12 @@ public class PayOrderLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
- workerOrderItem.setWorkerAmount(workerOrderItem.getTotalAmount());
|
|
|
-
|
|
|
-
|
|
|
- BigDecimal workerProceAmount = workerOrderItem.getWorkerAmount().multiply(Convert.toBigDecimal("0.006"));
|
|
|
-
|
|
|
|
|
|
- if (workerProceAmount.doubleValue() > 0.01) {
|
|
|
- workerOrderItem.setWorkerProceAmount(workerProceAmount.setScale(2, BigDecimal.ROUND_CEILING));
|
|
|
+ workerOrderItem.setWorkerAmount(workerOrderItem.getTotalAmount());
|
|
|
|
|
|
- }else {
|
|
|
- workerOrderItem.setWorkerProceAmount(Convert.toBigDecimal("0.01"));
|
|
|
- }
|
|
|
|
|
|
- workerOrderItem.setWorkerAmount(workerOrderItem.getWorkerAmount().subtract(workerOrderItem.getWorkerProceAmount()));
|
|
|
|
|
|
|
|
|
- if (workerOrderItem.getWorkerAmount().doubleValue() < 0){
|
|
|
- workerOrderItem.setWorkerProceAmount(Convert.toBigDecimal("0"));
|
|
|
- workerOrderItem.setWorkerAmount(Convert.toBigDecimal("0"));
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|