Commit 0bc4958d authored by 周健威's avatar 周健威

获取违约金 获取

parent d3137c3e
......@@ -8,6 +8,7 @@ public enum DeductionTypeEnum {
VIOLATE_CANCEL(101, "提前取消违约金"),
VIOLATE_ADVANCE(102, "提前还车违约金"),
VIOLATE_DELAY(103, "延迟还车违约金"),
VIOLATE_CHANGE_C(104, "更换还车公司费用"),
CONSUME(201, "消费金额"),
DAMAGES(301, "赔偿金(定损)"),
VIOLATE_TRAFFIC_DEDUCT(401, "违章扣款"),
......
......@@ -478,12 +478,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
private void handleCrosstownDetail(OrderVehicleCrosstown crosstown, OrderAccountDetail oad, CancelStartedVO csv) {
try{
if(null != crosstown.getViolateDetail()) {
DedDetailDTO vio = JSONUtil.toBean(crosstown.getViolateDetail(), DedDetailDTO.class);
//修改代码
List<DedDetailDTO> vios = JSONUtil.toList(JSONUtil.parseArray(crosstown.getViolateDetail()), DedDetailDTO.class);
//DedDetailDTO vio = JSONUtil.toBean(crosstown.getViolateDetail(), DedDetailDTO.class);
for(DedDetailDTO vio : vios) {
if(OrderViolateEnum.BEFORE.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.VIOLATE_ADVANCE, oad, vio, csv);
}else if(OrderViolateEnum.AFTER.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.VIOLATE_DELAY, oad, vio, csv);
}else if(OrderViolateEnum.CHANGE.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.VIOLATE_CHANGE_C, oad, vio, csv);
}
}
}
}catch (Exception e) {
......@@ -492,6 +498,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
private void handleViolateDetail(DeductionTypeEnum dte, OrderAccountDetail oad, DedDetailDTO vio, CancelStartedVO csv) {
Boolean flag = Boolean.FALSE;
for(OrderAccountDeduction deduction : oad.getDeductions()) {
if(dte.getCode().equals(deduction.getType())) {
deduction.setName(vio.getDeductions());
......@@ -501,10 +508,17 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
deduction.setAmount(vio.getCost());
//设置订单明细参数
csv.setViolateAmount(deduction.getAmount());
csv.setViolateDesc(deduction.getName());
csv.setViolateAmount(csv.getViolateAmount().add(diff));
csv.setViolateDesc(csv.getViolateDesc()+ deduction.getName());
flag = Boolean.TRUE;
break;
}
}
//如果没有修改,则添加
if(Boolean.FALSE.equals(flag)) {
oad.getDeductions().add(initDeduction(vio.getCost(), vio.getDeductions(), dte, OrderAccountDeduction.ORIGIN_DEPOSIT));
}
}
......
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