Commit c294a45b authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/master-modify-cutAmount' into master-modify-cutAmount

parents 2d095128 18048456
...@@ -352,8 +352,14 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -352,8 +352,14 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
//剩余押金 = 押金 - 违章保证金 - 定损金额 //剩余押金 = 押金 - 违章保证金 - 定损金额
oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(crosstown.getDeductionCost())); oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(crosstown.getDeductionCost()));
handleCrosstownDetail(crosstown, oad); handleCrosstownDetail(crosstown, oad);
BigDecimal refundAmont = crosstown.getRestDeposit().subtract(illegalReserve);
BigDecimal originalRefundAmount = crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve); //退款
BigDecimal refundAmont = oad.getDepositAmount().add(oad.getOrderAmount());
//crosstown.getRestDeposit().subtract(illegalReserve);
//原退款的钱
BigDecimal originalRefundAmount = oad.getOriginDepositAmount().add(oad.getOriginOrderAmount());
//crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
String refundDesc = "退还押金:"+ refundAmont.toString()+ "(已扣除 违章预备金:"+ illegalReserve.toString(); String refundDesc = "退还押金:"+ refundAmont.toString()+ "(已扣除 违章预备金:"+ illegalReserve.toString();
refundDesc = handleDed(crosstown, refundDesc); refundDesc = handleDed(crosstown, refundDesc);
refundDesc += ")"; refundDesc += ")";
......
...@@ -173,11 +173,11 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -173,11 +173,11 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
if (!flag) { if (!flag) {
return ObjectRestResponse.createFailedResult(3502, "今日不是交车日期"); return ObjectRestResponse.createFailedResult(3502, "今日不是交车日期");
} }
if (userDTO.getCompanyId() != orderRentVehicleDetail.getStartCompanyId()) { if (null == userDTO.getCompanyId() || !userDTO.getCompanyId().equals(orderRentVehicleDetail.getStartCompanyId())) {
return ObjectRestResponse.createFailedResult(3501, "无交车权限"); return ObjectRestResponse.createFailedResult(3501, "无交车权限");
} }
} else { } else {
if (userDTO.getCompanyId() != orderRentVehicleDetail.getEndCompanyId()) { if (null == userDTO.getCompanyId() || !userDTO.getCompanyId().equals(orderRentVehicleDetail.getEndCompanyId())) {
return ObjectRestResponse.createFailedResult(3503, "无收车权限"); return ObjectRestResponse.createFailedResult(3503, "无收车权限");
} }
} }
......
...@@ -176,7 +176,7 @@ public class OrderCalculateBiz { ...@@ -176,7 +176,7 @@ public class OrderCalculateBiz {
InProgressVO inProgressVO = inProgressCalculate(baseOrder, orderItem, orvd.getFreeDays(), useDays, oad); InProgressVO inProgressVO = inProgressCalculate(baseOrder, orderItem, orvd.getFreeDays(), useDays, oad);
//定金 - (额外消费金额 + 违约金) //定金 - (额外消费金额 + 违约金)
oad.setDepositAmount(orvd.getDeposit().subtract(inProgressVO.getConsumeAmount().add(inProgressVO.getViolateAmount()))); oad.setDepositAmount(orvd.getDeposit().subtract(inProgressVO.getExtraAmount().add(inProgressVO.getViolateAmount())));
oad.setOrderAmount(inProgressVO.getRefundOrderAmount()); oad.setOrderAmount(inProgressVO.getRefundOrderAmount());
oad.setOriginDepositAmount(orvd.getDeposit()); oad.setOriginDepositAmount(orvd.getDeposit());
oad.setOriginOrderAmount(baseOrder.getGoodsAmount()); oad.setOriginOrderAmount(baseOrder.getGoodsAmount());
......
...@@ -10,6 +10,7 @@ import com.xxfc.platform.order.entity.BaseOrder; ...@@ -10,6 +10,7 @@ import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderRentVehicleDetail; import com.xxfc.platform.order.entity.OrderRentVehicleDetail;
import com.xxfc.platform.order.entity.OrderVehicleCrosstown; import com.xxfc.platform.order.entity.OrderVehicleCrosstown;
import com.xxfc.platform.order.entity.OrderViolation; import com.xxfc.platform.order.entity.OrderViolation;
import com.xxfc.platform.order.pojo.account.OrderAccountDeduction;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail; import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import com.xxfc.platform.universal.constant.DictionaryKey; import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary; import com.xxfc.platform.universal.entity.Dictionary;
...@@ -113,9 +114,16 @@ public class RentDepositJobHandler extends IJobHandler { ...@@ -113,9 +114,16 @@ public class RentDepositJobHandler extends IJobHandler {
setIsDel(SYS_FALSE); setIsDel(SYS_FALSE);
}}); }});
OrderAccountDetail oad = new OrderAccountDetail();
String refundDesc = "退还押金:"; String refundDesc = "退还押金:";
BigDecimal refundAmont; BigDecimal refundAmont;
if(null != orderViolation) { if(null != orderViolation) {
//设置扣款项
oad.getDeductions().add(
orderAccountBiz.initDeduction(orderViolation.getPrice(), DeductionTypeEnum.VIOLATE_TRAFFIC_DEDUCT.getDesc(), DeductionTypeEnum.VIOLATE_TRAFFIC_DEDUCT, OrderAccountDeduction.ORIGIN_DEPOSIT)
);
//还车扣除款 剩余的 钱,再减去违章预备金 //还车扣除款 剩余的 钱,再减去违章预备金
refundAmont = orvd.getReturnPayResidue().subtract(orderViolation.getPrice()); refundAmont = orvd.getReturnPayResidue().subtract(orderViolation.getPrice());
refundDesc += refundAmont.toString()+ "(已扣除 违章扣款:"+ refundAmont.toString(); refundDesc += refundAmont.toString()+ "(已扣除 违章扣款:"+ refundAmont.toString();
...@@ -124,7 +132,8 @@ public class RentDepositJobHandler extends IJobHandler { ...@@ -124,7 +132,8 @@ public class RentDepositJobHandler extends IJobHandler {
refundAmont = orvd.getReturnPayResidue(); refundAmont = orvd.getReturnPayResidue();
refundDesc += refundAmont.toString(); refundDesc += refundAmont.toString();
} }
OrderAccountDetail oad = new OrderAccountDetail(); oad.setOriginDepositAmount(orvd.getReturnPayResidue());
oad.setDepositAmount(refundAmont);
orderAccountBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode(), AccountTypeEnum.OUT_RESIDUE_DEPOSIT, oad); orderAccountBiz.refundTrigger(baseOrder, orvd, BigDecimal.ZERO, orvd.getReturnPayResidue(), refundAmont, refundDesc, RefundStatusEnum.REFUND_DEPOSIT.getCode(), AccountTypeEnum.OUT_RESIDUE_DEPOSIT, oad);
orderDepositRefundRecordBiz.completeRecordStatus(crosstown.getId(), DepositRefundStatus.VIOLATIONARRIVAL); orderDepositRefundRecordBiz.completeRecordStatus(crosstown.getId(), DepositRefundStatus.VIOLATIONARRIVAL);
orderMsgBiz.handelMsgDeposit(orvd, baseOrder, userFeign.userDetailById(baseOrder.getUserId()).getData()); orderMsgBiz.handelMsgDeposit(orvd, baseOrder, userFeign.userDetailById(baseOrder.getUserId()).getData());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment