套餐加钟

This commit is contained in:
曹磊 2024-07-05 15:09:45 +08:00
parent ccf502ee1e
commit abaa324583
1 changed files with 24 additions and 10 deletions

View File

@ -648,6 +648,16 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
if(userPackageDetail.getStatus().equals(1)){ if(userPackageDetail.getStatus().equals(1)){
return Result.error("此服务项目已经被使用,无法重复使用!"); return Result.error("此服务项目已经被使用,无法重复使用!");
} }
Artificer artificer = artificerService.getById(orders.getArtificerId());
orders.setTechnicianType(artificer.getTechnicianType());
BigDecimal artificerVipRate = BigDecimal.ZERO;
VipDetails artificerVipDetails = vipDetailsDao.selectOne(new QueryWrapper<VipDetails>().eq("vip_name_type", artificer.getTechnicianType()));
if (artificerVipDetails != null) {
artificerVipRate = artificerVipDetails.getRate();
}
orders.setTechnicianRate(artificerVipRate);
BigDecimal price = BigDecimal.ZERO; BigDecimal price = BigDecimal.ZERO;
BigDecimal packagePrice = BigDecimal.ZERO; BigDecimal packagePrice = BigDecimal.ZERO;
String massageTypeName = ""; String massageTypeName = "";
@ -787,14 +797,6 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
//加上车费 //加上车费
orders.setPayMoney(payMoney.add(taxiMoney)); orders.setPayMoney(payMoney.add(taxiMoney));
Artificer artificer = artificerService.getById(orders.getArtificerId());
orders.setTechnicianType(artificer.getTechnicianType());
BigDecimal artificerVipRate = BigDecimal.ZERO;
VipDetails artificerVipDetails = vipDetailsDao.selectOne(new QueryWrapper<VipDetails>().eq("vip_name_type", artificer.getTechnicianType()));
if (artificerVipDetails != null) {
artificerVipRate = artificerVipDetails.getRate();
}
orders.setTechnicianRate(artificerVipRate);
//查询是否计算出租车扣费 //查询是否计算出租车扣费
String taxi = commonInfoService.findOne(394).getValue(); String taxi = commonInfoService.findOne(394).getValue();
//计算技师出租车收益按照技师表收益计算 //计算技师出租车收益按照技师表收益计算
@ -4394,7 +4396,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
if (orders.getParentId() != null && orders.getParentId() != 0) { if (orders.getParentId() != null && orders.getParentId() != 0) {
Orders orders1 = baseMapper.selectById(orders.getParentId()); Orders orders1 = baseMapper.selectById(orders.getParentId());
OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper<OrdersMassage>().eq("orders_id", orders1.getOrdersId())); OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper<OrdersMassage>().eq("orders_id", orders1.getOrdersId()));
MassageType massageType = massageTypeService.getById(ordersMassage.getMassageId()); MassageType massageType = null;
if(orders1.getUserPackageDetailId() !=null){
UserPackageDetail userPackageDetail = userPackageDetailService.getById(ordersMassage.getMassageId());
massageType = massageTypeService.getById(userPackageDetail.getMassageTypeId());
}else{
massageType = massageTypeService.getById(ordersMassage.getMassageId());
}
if (massageType.getAddNum() == null || massageType.getAddNum() == 0) { if (massageType.getAddNum() == null || massageType.getAddNum() == 0) {
return Result.error("当前项目不允许加钟!"); return Result.error("当前项目不允许加钟!");
} else if (massageType.getAddNum() > 0) { } else if (massageType.getAddNum() > 0) {
@ -4717,7 +4725,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
if (orders.getParentId() != null && orders.getParentId() != 0) { if (orders.getParentId() != null && orders.getParentId() != 0) {
Orders orders1 = baseMapper.selectById(orders.getParentId()); Orders orders1 = baseMapper.selectById(orders.getParentId());
OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper<OrdersMassage>().eq("orders_id", orders1.getOrdersId())); OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper<OrdersMassage>().eq("orders_id", orders1.getOrdersId()));
MassageType massageType = massageTypeService.getById(ordersMassage.getMassageId()); MassageType massageType = null;
if(orders1.getUserPackageDetailId() !=null){
UserPackageDetail userPackageDetail = userPackageDetailService.getById(ordersMassage.getMassageId());
massageType = massageTypeService.getById(userPackageDetail.getMassageTypeId());
}else{
massageType = massageTypeService.getById(ordersMassage.getMassageId());
}
if (massageType.getAddNum() == null || massageType.getAddNum() == 0) { if (massageType.getAddNum() == null || massageType.getAddNum() == 0) {
return Result.error("当前项目不允许加钟!"); return Result.error("当前项目不允许加钟!");
} else if (massageType.getAddNum() > 0) { } else if (massageType.getAddNum() > 0) {