Commit 85c08429 authored by 周健威's avatar 周健威

Merge branch 'master-modify-cutAmount' into dev

parents 3fa8b690 62f0a822
...@@ -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,19 +435,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -435,19 +435,12 @@ 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())) {
for(OrderAccountDeduction deduction : oad.getDeductions()) { handleViolateDetail(DeductionTypeEnum.VIOLATE_ADVANCE, oad, vio);
if(DeductionTypeEnum.VIOLATE_ADVANCE.getCode().equals(deduction.getType())) { }else if(OrderViolateEnum.AFTER.getCode().equals(vio.getType())) {
deduction.setName(vio.getDeductions()); handleViolateDetail(DeductionTypeEnum.VIOLATE_DELAY, oad, vio);
BigDecimal diff = vio.getCost().subtract(deduction.getAmount());
//修改归还押金金额
oad.setDepositAmount(oad.getDepositAmount().subtract(diff));
deduction.setAmount(vio.getCost());
}
}
}
} }
} }
}catch (Exception e) { }catch (Exception e) {
...@@ -455,6 +448,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -455,6 +448,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
} }
private void handleViolateDetail(DeductionTypeEnum dte, OrderAccountDetail oad, DedDetailDTO vio) {
for(OrderAccountDeduction deduction : oad.getDeductions()) {
if(dte.getCode().equals(deduction.getType())) {
deduction.setName(vio.getDeductions());
BigDecimal diff = vio.getCost().subtract(deduction.getAmount());
//修改归还押金金额
oad.setDepositAmount(oad.getDepositAmount().subtract(diff));
deduction.setAmount(vio.getCost());
}
}
}
/** /**
* 获取每日订单账目,用于统计 * 获取每日订单账目,用于统计
......
...@@ -261,18 +261,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp ...@@ -261,18 +261,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
} }
//延期扣除费用 //延期扣除费用
if (StringUtils.isNotBlank(orderVehicleCrosstownDto.getViolateDetail())) { if (StringUtils.isNotBlank(orderVehicleCrosstownDto.getViolateDetail())) {
JSONArray jsonArray = JSONArray.parseArray(orderVehicleCrosstownDto.getViolateDetail()); JSONObject jsonObject = JSONObject.parseObject(orderVehicleCrosstownDto.getViolateDetail());
if(jsonArray != null && jsonArray.size() > 0) { if (jsonObject != null) {
for (int i = 0; i < jsonArray.size(); i++) { if (jsonObject.getString("cost") != null) {
JSONObject jsonObject = JSONObject.parseObject(jsonArray.get(i).toString()); cost += Double.parseDouble(jsonObject.getString("cost"));
if (jsonObject != null) { }
if (jsonObject.getString("cost") != null) { if (jsonObject.getString("excessCost") != null) {
cost += Double.parseDouble(jsonObject.getString("cost")); cost += Double.parseDouble(jsonObject.getString("excessCost"));
}
if (jsonObject.getString("excessCost") != null) {
cost += Double.parseDouble(jsonObject.getString("excessCost"));
}
}
} }
} }
} }
......
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