Commit 0ce4c2a1 authored by jiaorz's avatar jiaorz

添加更换还车公司计费接口

parent 546fd218
......@@ -35,7 +35,6 @@ import com.xxfc.platform.vehicle.pojo.VehicleDepartureVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -264,8 +263,10 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
//延期扣除费用
if (StringUtils.isNotBlank(orderVehicleCrosstownDto.getViolateDetail())) {
JSONObject jsonObject = JSONObject.parseObject(orderVehicleCrosstownDto.getViolateDetail());
if (jsonObject != null) {
JSONArray jsonArray = JSONArray.parseArray(orderVehicleCrosstownDto.getViolateDetail());
if(jsonArray != null && jsonArray.size() > 0) {
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = JSONObject.parseObject(jsonArray.get(i).toString());
if (jsonObject.getString("cost") != null) {
cost += Double.parseDouble(jsonObject.getString("cost"));
}
......@@ -274,6 +275,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
}
}
}
orderVehicleCrosstownDto.setUserLicenseImg(orderVehicleCrosstownDto.getLicenseImg());
//扣除费用,每次都是重新计算
BigDecimal amount = new BigDecimal(cost.toString()).divide(new BigDecimal("1"), 2, BigDecimal.ROUND_UP);
......
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