fix
This commit is contained in:
@@ -23,11 +23,9 @@ import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderComplaintInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderEvaluateInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderRandomInfoEntity;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderComplaintInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderEvaluateInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderRandomInfoService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayClerkGiftInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayGiftInfoEntity;
|
||||
@@ -105,8 +103,6 @@ public class WxCustomController {
|
||||
@Resource
|
||||
private IPlayOrderEvaluateInfoService playOrderEvaluateInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayOrderRandomInfoService playOrderRandomInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayCustomGiftInfoService playCustomGiftInfoService;
|
||||
@@ -206,19 +202,14 @@ public class WxCustomController {
|
||||
MoneyUtils.verificationTypeIsNormal(vo.getMoney());
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClerkId());
|
||||
if (new BigDecimal(vo.getMoney()).compareTo(customUserInfo.getAccountBalance()) > 0) {
|
||||
throw new ServiceException("余额不足", 998);
|
||||
}
|
||||
String orderId = IdUtils.getUuid();
|
||||
// 记录订单信息
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "0", "1", "", "0", BigDecimal.ZERO, "", "", "0", new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(), vo.getRemark());
|
||||
//
|
||||
// playOrderInfoService.createRewardOrder(orderId, new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), userId, clerkUserInfo.getId(), vo.getRemark(), vo.getWeiChatCode());
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "0", "1", "", "0", BigDecimal.ZERO, "", "", "0", new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(), vo.getRemark(), "", "", "");
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(new BigDecimal(vo.getMoney())), "1", "打赏", new BigDecimal(vo.getMoney()), BigDecimal.ZERO, orderId);
|
||||
// 陪聊增加余额
|
||||
// clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(new BigDecimal(vo.getMoney())), "2", "打赏", new BigDecimal(vo.getMoney()), orderId);
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
@@ -232,20 +223,16 @@ public class WxCustomController {
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayGiftInfoEntity giftInfo = giftInfoService.selectPlayGiftInfoById(vo.getGiftId());
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClerkId());
|
||||
BigDecimal money = giftInfo.getPrice().multiply(new BigDecimal(vo.getGiftQuantity()));
|
||||
if (money.compareTo(customUserInfo.getAccountBalance()) > 0) {
|
||||
throw new ServiceException("余额不足", 998);
|
||||
}
|
||||
String orderId = IdUtils.getUuid();
|
||||
// 记录订单信息
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "1", "1", giftInfo.getId(), "0", giftInfo.getPrice(), "", giftInfo.getName(), String.valueOf(vo.getGiftQuantity()), money, money, BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(), vo.getRemark());
|
||||
|
||||
// playOrderInfoService.createGiftOrder(orderId, vo.getGiftId(), giftInfo.getPrice(), String.valueOf(vo.getGiftQuantity()), money, money, userId, clerkUserInfo.getId(), vo.getRemark(), vo.getWeiChatCode());
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "1", "1", giftInfo.getId(), "0", giftInfo.getPrice(), "", giftInfo.getName(), String.valueOf(vo.getGiftQuantity()), money, money, BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(), vo.getRemark(), "", "", "");
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "1", "赠送礼物", money, BigDecimal.ZERO, orderId);
|
||||
// 陪聊增加余额
|
||||
// clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(money), "2", "赠送礼物", money, orderId);
|
||||
// 修改顾客和礼物消息
|
||||
PlayCustomGiftInfoEntity customGiftInfoEntity = playCustomGiftInfoService.selectByGiftIdAndCustomId(vo.getGiftId(), userId);
|
||||
if (customGiftInfoEntity == null) {
|
||||
@@ -311,12 +298,11 @@ public class WxCustomController {
|
||||
String orderId = IdUtils.getUuid();
|
||||
String orderNo = playOrderInfoService.getOrderNo();
|
||||
// 记录订单信息
|
||||
playOrderInfoService.createOrderInfo(orderId, orderNo, "0", "2", "0", "", "1", commodityInfo.getCommodityId(), "1", commodityInfo.getCommodityPrice(), commodityInfo.getServiceDuration(), commodityInfo.getCommodityName(), String.valueOf(vo.getCommodityQuantity()), money, money, BigDecimal.ZERO, customId, clerkUserInfo.getId(), vo.getWeiChatCode(), vo.getCouponIds(), vo.getRemark());
|
||||
playOrderInfoService.createOrderInfo(orderId, orderNo, "0", "2", "0", "", "1", commodityInfo.getCommodityId(), "1", commodityInfo.getCommodityPrice(), commodityInfo.getServiceDuration(), commodityInfo.getCommodityName(), String.valueOf(vo.getCommodityQuantity()), money, money, BigDecimal.ZERO, customId, clerkUserInfo.getId(), vo.getWeiChatCode(), vo.getCouponIds(), vo.getRemark(), "", "", "");
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "1", "下单-指定单", money, BigDecimal.ZERO, orderId);
|
||||
// 发送通知给店员
|
||||
wxCustomMpService.sendCreateOrderMessage(clerkUserInfo.getTenantId(), clerkUserInfo.getOpenid(), clerkUserInfo.getNickname(), orderNo, orderId, DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"), money.toString(), commodityInfo.getCommodityName());
|
||||
// wxCustomMpService.sendNewOrderMessageForClerk(clerkUserInfo, orderNo, commodityInfo.getCommodityName(), money);
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
@@ -339,19 +325,8 @@ public class WxCustomController {
|
||||
throw new ServiceException("余额不足", 998);
|
||||
}
|
||||
String orderId = IdUtils.getUuid();
|
||||
|
||||
PlayOrderRandomInfoEntity orderRandomInfo = ConvertUtil.entityToVo(vo, PlayOrderRandomInfoEntity.class);
|
||||
orderRandomInfo.setCommodityId(commodityInfo.getCommodityId());
|
||||
orderRandomInfo.setCommodityName(commodityInfo.getCommodityName());
|
||||
orderRandomInfo.setCommodityPrice(commodityInfo.getCommodityPrice());
|
||||
orderRandomInfo.setCommodityNumber(String.valueOf(vo.getCommodityQuantity()));
|
||||
orderRandomInfo.setServiceDuration(commodityInfo.getServiceDuration());
|
||||
orderRandomInfo.setId(orderId);
|
||||
playOrderRandomInfoService.create(orderRandomInfo);
|
||||
// 记录订单信息
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "0", "2", "1", "", "1", commodityInfo.getCommodityId(), "1", commodityInfo.getCommodityPrice(), commodityInfo.getServiceDuration(), commodityInfo.getCommodityName(), String.valueOf(vo.getCommodityQuantity()), money, money, BigDecimal.ZERO, customId, "", vo.getWeiChatCode(), vo.getCouponIds(), vo.getRemark());
|
||||
|
||||
// playOrderInfoService.createRandomOrder(orderId, customUserInfo.getId(), commodityInfo.getCommodityPrice(), String.valueOf(vo.getCommodityQuantity()), commodityInfo.getServiceDuration(), commodityInfo.getCommodityName(), money, money, customId, vo.getRemark(), vo.getWeiChatCode());
|
||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "0", "2", "1", "", "1", commodityInfo.getCommodityId(), "1", commodityInfo.getCommodityPrice(), commodityInfo.getServiceDuration(), commodityInfo.getCommodityName(), String.valueOf(vo.getCommodityQuantity()), money, money, BigDecimal.ZERO, customId, "", vo.getWeiChatCode(), vo.getCouponIds(), vo.getRemark(), vo.getSex(), vo.getLevelId(), vo.getExcludeHistory());
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "1", "下单-随机单", money, BigDecimal.ZERO, orderId);
|
||||
// 记录订单,指定指定未接单后,进行退款处理
|
||||
|
||||
@@ -9,11 +9,14 @@ import com.starry.admin.modules.order.module.entity.PlayOrderContinueInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderContinueQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderContinueReturnVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderDetailsReturnVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderReviewStateEditVo;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderContinueInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderRandomInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.order.*;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderInfoContinueAdd;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderInfoContinueQueryVo;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderInfoRandomQueryVo;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayRewardOrderQueryVo;
|
||||
import com.starry.common.result.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -41,10 +44,6 @@ public class WxOrderInfoController {
|
||||
private IPlayOrderContinueInfoService playOrderContinueInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayOrderRandomInfoService playOrderRandomInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 续单申请-店员发起
|
||||
*
|
||||
@@ -89,7 +88,7 @@ public class WxOrderInfoController {
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/clerk/selectRandomOrderByPage")
|
||||
public R selectUnacceptedOrderByPage(@Validated @RequestBody PlayOrderInfoRandomQueryVo vo) {
|
||||
return R.ok(playOrderRandomInfoService.selectByPage(vo));
|
||||
return R.ok(playOrderInfoService.selectRandomOrderByPage(vo,ThreadLocalRequestDetail.getClerkUserInfo().getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +100,7 @@ public class WxOrderInfoController {
|
||||
@ClerkUserLogin
|
||||
@GetMapping("/clerk/selectRandomOrderById")
|
||||
public R selectUnacceptedOrderByPage(@RequestParam("id") String id) {
|
||||
PlayClerkRandomOrderDetailReturnVo vo = playOrderRandomInfoService.clerkSelectOrderDetails(id,ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
||||
PlayOrderDetailsReturnVo vo = playOrderInfoService.selectById(id);
|
||||
if (vo == null) {
|
||||
throw new CustomException("订单不存在");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user