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

修改代码

parent 5fabe447
...@@ -7,7 +7,6 @@ import java.util.Map; ...@@ -7,7 +7,6 @@ import java.util.Map;
public enum OrderViolateEnum { public enum OrderViolateEnum {
BEFORE(1, "提前"), BEFORE(1, "提前"),
AFTER(2, "延期"), AFTER(2, "延期"),
EXCESS(3, "消费超额金")
; ;
/** /**
* 编码 * 编码
......
...@@ -435,11 +435,22 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -435,11 +435,22 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
private void handleCrosstownDetail(OrderVehicleCrosstown crosstown, OrderAccountDetail oad) { private void handleCrosstownDetail(OrderVehicleCrosstown crosstown, OrderAccountDetail oad) {
try{ try{
if(null != crosstown.getViolateDetail()) { if(null != crosstown.getViolateDetail()) {
List<DedDetailDTO> dddList = JSONUtil.toList(JSONUtil.parseArray(crosstown.getViolateDetail()), DedDetailDTO.class); DedDetailDTO vio = JSONUtil.toBean(crosstown.getViolateDetail(), DedDetailDTO.class);
for(DedDetailDTO vio : dddList) {
if(OrderViolateEnum.BEFORE.getCode().equals(vio.getType())) { if(OrderViolateEnum.BEFORE.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.VIOLATE_ADVANCE, oad, vio);
}else if(OrderViolateEnum.AFTER.getCode().equals(vio.getType())) {
handleViolateDetail(DeductionTypeEnum.VIOLATE_DELAY, oad, vio);
}
}
}catch (Exception e) {
log.error("crosstown.getViolateDetail() crosstown id :"+crosstown.getId() +" 转换失败");
}
}
private void handleViolateDetail(DeductionTypeEnum dte, OrderAccountDetail oad, DedDetailDTO vio) {
for(OrderAccountDeduction deduction : oad.getDeductions()) { for(OrderAccountDeduction deduction : oad.getDeductions()) {
if(DeductionTypeEnum.VIOLATE_ADVANCE.getCode().equals(deduction.getType())) { if(dte.getCode().equals(deduction.getType())) {
deduction.setName(vio.getDeductions()); deduction.setName(vio.getDeductions());
BigDecimal diff = vio.getCost().subtract(deduction.getAmount()); BigDecimal diff = vio.getCost().subtract(deduction.getAmount());
//修改归还押金金额 //修改归还押金金额
...@@ -448,12 +459,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -448,12 +459,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
} }
} }
}
}
}catch (Exception e) {
log.error("crosstown.getViolateDetail() crosstown id :"+crosstown.getId() +" 转换失败");
}
}
/** /**
......
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