套娃生成待补单,退款待补单

This commit is contained in:
曹磊 2024-06-21 14:47:16 +08:00
parent 2346d8e735
commit 000d901f00
1 changed files with 290 additions and 265 deletions

View File

@ -1662,6 +1662,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
private Result cancelSupplementMassageOrders(Long userId, Orders orders, Integer isAuto, Integer type) {
if(type == 1){
if(orders.getTaxiMoney().compareTo(BigDecimal.ZERO) != 0){
//退车费或扣车费成为待补单
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = simpleDateFormat.format(new Date());
@ -1759,6 +1760,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
data.put("time14", new TemplateMessageItem(DateUtils.format(new Date()), "#d71345"));
userService.sendWxMessage(apkey, data, userEntity.getWxOpenId());
}
}
if(isAuto == 1){
//按照比例 将扣除的车费钱
@ -1802,10 +1804,21 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
userMoneyDetails.setBlFlag(1);
userMoneyDetailsService.save(userMoneyDetails);
}
}
if(orders.getOldOrdersId() !=null){
//此笔单子退车费并改为取消再将原单改成待补单
orders.setRefusalContent("");
orders.setTaxiMoney(BigDecimal.ZERO);
orders.setStatus(4);
baseMapper.updateById(orders);
cancelSupplementOrders(userId, orders.getOldOrdersId(), isAuto, 1);//退原单原单的车费已被退/所以只退项目
}else{
orders.setRefusalContent("");
orders.setTaxiMoney(BigDecimal.ZERO);
orders.setStatus(10);
baseMapper.updateById(orders);
}
}
if(type == 2){
//退项目费
String couponIds = orders.getCouponId();
@ -2034,7 +2047,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
}
if(orders.getOldOrdersId()!=null){
cancelSupplementOrders(userId, orders.getOldOrdersId(), 0, 2);//退原单原单的车费已被退/所以只退项目
cancelSupplementOrders(userId, orders.getOldOrdersId(), isAuto, 2);//退原单原单的车费已被退/所以只退项目
}
}
return Result.success();
@ -2042,6 +2055,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
private Result cancelSupplementPackageOrders(Long userId, Orders orders, Integer isAuto, Integer type) {
if(type == 1){
if(orders.getTaxiMoney().compareTo(BigDecimal.ZERO) != 0) {
//退车费或扣车费成为待补单
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = simpleDateFormat.format(new Date());
@ -2182,10 +2196,21 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
userMoneyDetails.setBlFlag(1);
userMoneyDetailsService.save(userMoneyDetails);
}
}
if(orders.getOldOrdersId() !=null){
//此笔单子退车费并改为取消再将原单改成待补单
orders.setRefusalContent("");
orders.setTaxiMoney(BigDecimal.ZERO);
orders.setStatus(4);
baseMapper.updateById(orders);
cancelSupplementOrders(userId, orders.getOldOrdersId(), isAuto, 1);//退原单原单的车费已被退/所以只退项目
}else{
orders.setRefusalContent("");
orders.setTaxiMoney(BigDecimal.ZERO);
orders.setStatus(10);
baseMapper.updateById(orders);
}
}
if(type == 2){
//退项目费
//释放