From abaa3245839f51986d96f6aec67245bd50ace30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Fri, 5 Jul 2024 15:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=97=E9=A4=90=E5=8A=A0=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OrdersServiceImpl.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java index a31c00f..92a3ae8 100644 --- a/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java +++ b/src/main/java/com/sqx/modules/artificer/service/impl/OrdersServiceImpl.java @@ -648,6 +648,16 @@ public class OrdersServiceImpl extends ServiceImpl implements if(userPackageDetail.getStatus().equals(1)){ return Result.error("此服务项目已经被使用,无法重复使用!"); } + + Artificer artificer = artificerService.getById(orders.getArtificerId()); + orders.setTechnicianType(artificer.getTechnicianType()); + BigDecimal artificerVipRate = BigDecimal.ZERO; + VipDetails artificerVipDetails = vipDetailsDao.selectOne(new QueryWrapper().eq("vip_name_type", artificer.getTechnicianType())); + if (artificerVipDetails != null) { + artificerVipRate = artificerVipDetails.getRate(); + } + orders.setTechnicianRate(artificerVipRate); + BigDecimal price = BigDecimal.ZERO; BigDecimal packagePrice = BigDecimal.ZERO; String massageTypeName = ""; @@ -787,14 +797,6 @@ public class OrdersServiceImpl extends ServiceImpl implements //加上车费 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().eq("vip_name_type", artificer.getTechnicianType())); - if (artificerVipDetails != null) { - artificerVipRate = artificerVipDetails.getRate(); - } - orders.setTechnicianRate(artificerVipRate); //查询是否计算出租车扣费 String taxi = commonInfoService.findOne(394).getValue(); //计算技师出租车收益(按照技师表收益计算) @@ -4394,7 +4396,13 @@ public class OrdersServiceImpl extends ServiceImpl implements if (orders.getParentId() != null && orders.getParentId() != 0) { Orders orders1 = baseMapper.selectById(orders.getParentId()); OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper().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) { return Result.error("当前项目不允许加钟!"); } else if (massageType.getAddNum() > 0) { @@ -4717,7 +4725,13 @@ public class OrdersServiceImpl extends ServiceImpl implements if (orders.getParentId() != null && orders.getParentId() != 0) { Orders orders1 = baseMapper.selectById(orders.getParentId()); OrdersMassage ordersMassage = ordersMassageService.getOne(new QueryWrapper().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) { return Result.error("当前项目不允许加钟!"); } else if (massageType.getAddNum() > 0) {