Commit 0ec680b4 authored by hezhen's avatar hezhen

Merge branch 'holiday-price' of...

Merge branch 'holiday-price' of http://113.105.137.151:22280/youjj/cloud-platform into holiday-price
parents 1676b3d4 b8677acd
......@@ -236,7 +236,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
orv.setFreeze2PayAmount(freeze2PayAmount);
orv.setFreeze2PayDesc("");
orv.setFreeze2PayDesc("冻结转支付订单号: "+ baseOrder.getNo());
ObjectRestResponse<String> result = thirdFeign.refund(orv);
refundTradeNo = result.getData();
......@@ -426,6 +426,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
//剩余押金 = 押金 - 违章保证金 - 定损金额
oad.setDepositAmount(oad.getDepositAmount().subtract(illegalReserve).subtract(csv.getDamagesAmount()));
//设置违约金
//设置原来算出的违约金及描述
csv.setViolateAmount(inProgressVO.getViolateAmount());
csv.setViolateDesc(inProgressVO.getViolateDesc());
//处理更改之后的违约金及描述
handleCrosstownDetail(crosstown, oad, csv);
//退款
......
......@@ -356,7 +356,7 @@ public class OrderCalculateBiz {
if(timeLag < 0 ) {
Integer useDays = getIncludeDays(orderPageVO.getOrderRentVehicleDetail().getStartTime(), DateTime.now().getMillis());
OrderAccountDetail oad = new OrderAccountDetail();
inProgressVO = inProgressCalculate(orderPageVO, vehicleItemDTO, useDays, new OrderAccountDetail(), Boolean.FALSE);
inProgressVO = inProgressCalculate(orderPageVO, vehicleItemDTO, useDays, oad, Boolean.FALSE);
topAmount = vehicleItemDTO.getTopAmount(useDays);
totalDeductAmount = oad.realTotalDeduct();
......
......@@ -161,7 +161,7 @@ public class OrderCancelBiz {
//结合
//退款子流程: 订单基础,退款描述,退款金额
orderAccountBiz.refundSubProcess(baseOrder, "", baseOrder.getRealAmount().subtract(orvd.getDeposit()), oad.getDepositAmount().add(oad.getOrderAmount()), AccountTypeEnum.OUT_ORDER_FUND.getCode(), RefundStatusEnum.ALL.getCode(), oad);
orderAccountBiz.refundSubProcess(baseOrder, "", baseOrder.getRealAmount(), oad.getDepositAmount().add(oad.getOrderAmount()), AccountTypeEnum.OUT_ORDER_FUND.getCode(), RefundStatusEnum.ALL.getCode(), oad);
//生成额外的费用明细
......
......@@ -396,7 +396,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
}});
orv.setAmount(baseOrder.getRealAmount().multiply(new BigDecimal("100")).intValue());
orv.setOrderNo(baseOrder.getNo());
orv.setRefundDesc("退款");
orv.setRefundDesc("退款订单号:"+ no);
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
ObjectRestResponse<String> result = thirdFeign.refund(orv);
return ObjectRestResponse.succ(result);
......
......@@ -23,6 +23,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
......@@ -69,18 +70,18 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* @param vehicleModelCalendarPrices
* @param userId
*/
public void addVehicleModelCalendarPrice(List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPrices, Integer userId) {
if (CollectionUtils.isNotEmpty(vehicleModelCalendarPrices)) {
public void addVehicleModelCalendarPrice(List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPrices, String date,Integer userId) {
vehicleModelCalendarPrices = vehicleModelCalendarPrices==null?Collections.EMPTY_LIST:vehicleModelCalendarPrices;
List<VehicleModelCalendarPrice> vehicleModelCalendarPriceList = new ArrayList<>();
List<Date> dateList = vehicleModelCalendarPrices.stream().peek(x -> {
VehicleModelCalendarPrice calendarPrice = new VehicleModelCalendarPrice();
BeanUtils.copyProperties(x, calendarPrice);
Date date = DateUtils.localDateToDate(LocalDate.parse(x.getDate()));
calendarPrice.setVehicleModelDay(date);
Date dte = DateUtils.localDateToDate(LocalDate.parse(x.getDate()));
calendarPrice.setVehicleModelDay(dte);
calendarPrice.setCrtTime(new Date());
calendarPrice.setCrtUserId(userId);
calendarPrice.setIsDel(0);
x.setVehicleModelDay(date);
x.setVehicleModelDay(dte);
vehicleModelCalendarPriceList.add(calendarPrice);
}).map(VehicleModelCalendarPriceSaveDTO::getVehicleModelDay).distinct().collect(Collectors.toList());
......@@ -92,11 +93,17 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
vehicleModelCalendarPrice.setIsDel(1);
Example example = new Example(VehicleModelCalendarPrice.class);
Example.Criteria criteria = example.createCriteria();
criteria.andIn("vehicleModelDay", dateList);
if (CollectionUtils.isEmpty(dateList) && StringUtils.hasText(date)){
criteria.andEqualTo("vehicleModelDay",DateUtils.localDateToDate(LocalDate.parse(date)));
}else{
criteria.andIn("vehicleModelDay", dateList);
}
mapper.updateByExampleSelective(vehicleModelCalendarPrice, example);
//2.插入新的数据
mapper.insertList(vehicleModelCalendarPriceList);
}
if (CollectionUtils.isNotEmpty(dateList)) {
mapper.insertList(vehicleModelCalendarPriceList);
}
}
......
......@@ -30,9 +30,10 @@ public class VehicleModelCalendarPriceAdminController {
private final VehicleModelCalendarPriceBiz vehicleModelCalendarPriceBiz;
@ApiOperation("车型日历价格设置")
@PostMapping("/add_edit")
public ObjectRestResponse<Void> add(@RequestBody List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPriceSaveDTO, UserDTO userDTO){
vehicleModelCalendarPriceBiz.addVehicleModelCalendarPrice(vehicleModelCalendarPriceSaveDTO,userDTO.getId());
@PostMapping(value = {"/add_edit/{date}","/add_edit"})
public ObjectRestResponse<Void> add(@RequestBody(required = false) List<VehicleModelCalendarPriceSaveDTO> vehicleModelCalendarPriceSaveDTO,
@PathVariable(name = "date",required = false) String date ,UserDTO userDTO){
vehicleModelCalendarPriceBiz.addVehicleModelCalendarPrice(vehicleModelCalendarPriceSaveDTO,date,userDTO.getId());
return ObjectRestResponse.succ();
}
......
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