Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
package com.czg.order.service;
|
||||
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单RpcService
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-28 11:28
|
||||
*/
|
||||
public interface OrderInfoRpcService {
|
||||
|
||||
/**
|
||||
* 交班现金支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 现金支付总额
|
||||
*/
|
||||
BigDecimal getHandoverCashAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班微信支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 现金支付总额
|
||||
*/
|
||||
BigDecimal getHandoverWechatAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班支付宝支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 支付宝支付总额
|
||||
*/
|
||||
BigDecimal getHandoverAlipayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班VIP支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return VIP支付总额
|
||||
*/
|
||||
BigDecimal getHandoverVipPayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班VIP充值统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return VIP充值总额
|
||||
*/
|
||||
BigDecimal getHandoverVipChargeAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班快捷支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 快捷支付总额
|
||||
*/
|
||||
BigDecimal getHandoverQuickPayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班退款统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 退款总额
|
||||
*/
|
||||
BigDecimal getHandoverRefundAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班挂账统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 挂账总额
|
||||
*/
|
||||
BigDecimal getHandoverCreditAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班营业额统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 营业额
|
||||
*/
|
||||
BigDecimal getHandoverTotalAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班订单数统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 交班订单数
|
||||
*/
|
||||
int getHandoverOrderNum(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班售出商品明细
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 交班售出商品明细
|
||||
*/
|
||||
List<HandoverProductListVo> getHandoverDetailList(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班售出商品分类统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 售出商品分类统计
|
||||
*/
|
||||
List<HandoverCategoryListVo> getHandoverCategoryList(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.czg.order.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.order.dto.CheckOrderPay;
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
@@ -17,7 +15,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表 服务层。
|
||||
@@ -40,124 +37,4 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
||||
void upOrderInfo(OrderInfo orderInfo, BigDecimal payAmount, LocalDateTime payTime, Long payOrderId, PayEnums payType);
|
||||
|
||||
void expired(Long orderId);
|
||||
|
||||
/**
|
||||
* 交班现金支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 现金支付总额
|
||||
*/
|
||||
BigDecimal getHandoverCashAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班微信支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 现金支付总额
|
||||
*/
|
||||
BigDecimal getHandoverWechatAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班支付宝支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 支付宝支付总额
|
||||
*/
|
||||
BigDecimal getHandoverAlipayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班VIP支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return VIP支付总额
|
||||
*/
|
||||
BigDecimal getHandoverVipPayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班VIP充值统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return VIP充值总额
|
||||
*/
|
||||
BigDecimal getHandoverVipChargeAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班快捷支付统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 快捷支付总额
|
||||
*/
|
||||
BigDecimal getHandoverQuickPayAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班退款统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 退款总额
|
||||
*/
|
||||
BigDecimal getHandoverRefundAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班挂账统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 挂账总额
|
||||
*/
|
||||
BigDecimal getHandoverCreditAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班营业额统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 营业额
|
||||
*/
|
||||
BigDecimal getHandoverTotalAmount(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班订单数统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 交班订单数
|
||||
*/
|
||||
int getHandoverOrderNum(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班售出商品明细
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 交班售出商品明细
|
||||
*/
|
||||
List<HandoverProductListVo> getHandoverDetailList(Long shopId, String loginTime, String handoverTime);
|
||||
|
||||
/**
|
||||
* 交班售出商品分类统计
|
||||
*
|
||||
* @param shopId 店铺id
|
||||
* @param loginTime 上岗时间
|
||||
* @param handoverTime 交班时间
|
||||
* @return 售出商品分类统计
|
||||
*/
|
||||
List<HandoverCategoryListVo> getHandoverCategoryList(Long shopId, String loginTime, String handoverTime);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.czg.account.service.HandoverRecordService;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.account.vo.HandoverTotalVo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.order.service.OrderInfoRpcService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.HandoverRecordMapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
@@ -35,7 +35,7 @@ import java.util.List;
|
||||
public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper, HandoverRecord> implements HandoverRecordService {
|
||||
|
||||
@DubboReference
|
||||
private OrderInfoService orderInfoService;
|
||||
private OrderInfoRpcService orderInfoRpcService;
|
||||
|
||||
private QueryWrapper buildQueryWrapper(HandoverRecordDTO param) {
|
||||
QueryWrapper queryWrapper = PageUtil.buildSortQueryWrapper();
|
||||
@@ -95,13 +95,13 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
|
||||
String loginTimeStr = LocalDateTimeUtil.formatNormal(loginTime);
|
||||
String handoverTimeStr = LocalDateTimeUtil.formatNormal(handoverTime);
|
||||
HandoverRecord entity = BeanUtil.copyProperties(data, HandoverRecord.class);
|
||||
entity.setWechatAmount(orderInfoService.getHandoverWechatAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setAlipayAmount(orderInfoService.getHandoverAlipayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setVipPay(orderInfoService.getHandoverVipPayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setVipRecharge(orderInfoService.getHandoverVipChargeAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setQuickInAmount(orderInfoService.getHandoverQuickPayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setCreditAmount(orderInfoService.getHandoverCreditAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
List<HandoverCategoryListVo> categoryData = orderInfoService.getHandoverCategoryList(shopId, loginTimeStr, handoverTimeStr);
|
||||
entity.setWechatAmount(orderInfoRpcService.getHandoverWechatAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setAlipayAmount(orderInfoRpcService.getHandoverAlipayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setVipPay(orderInfoRpcService.getHandoverVipPayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setVipRecharge(orderInfoRpcService.getHandoverVipChargeAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setQuickInAmount(orderInfoRpcService.getHandoverQuickPayAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
entity.setCreditAmount(orderInfoRpcService.getHandoverCreditAmount(shopId, loginTimeStr, handoverTimeStr));
|
||||
List<HandoverCategoryListVo> categoryData = orderInfoRpcService.getHandoverCategoryList(shopId, loginTimeStr, handoverTimeStr);
|
||||
entity.setCategoryData(JSON.toJSONString(categoryData, JSONWriter.Feature.WriteMapNullValue));
|
||||
List<HandoverProductListVo> productData = data.getDetailList();
|
||||
entity.setProductData(JSON.toJSONString(productData, JSONWriter.Feature.WriteMapNullValue));
|
||||
@@ -110,22 +110,22 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
|
||||
}
|
||||
|
||||
private BigDecimal sumCashAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoService.getHandoverCashAmount(shopId, loginTime, handoverTime);
|
||||
return orderInfoRpcService.getHandoverCashAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
private BigDecimal sumRefundAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoService.getHandoverRefundAmount(shopId, loginTime, handoverTime);
|
||||
return orderInfoRpcService.getHandoverRefundAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
private BigDecimal sumHandAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoService.getHandoverTotalAmount(shopId, loginTime, handoverTime);
|
||||
return orderInfoRpcService.getHandoverTotalAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
private int countOrderNum(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoService.getHandoverOrderNum(shopId, loginTime, handoverTime);
|
||||
return orderInfoRpcService.getHandoverOrderNum(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
private List<HandoverProductListVo> getDetailList(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoService.getHandoverDetailList(shopId, loginTime, handoverTime);
|
||||
return orderInfoRpcService.getHandoverDetailList(shopId, loginTime, handoverTime);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,9 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
queryWrapper.and(q -> {
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 0).eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
});
|
||||
queryWrapper.eq(PictureClassify::getIsDel, DeleteEnum.NORMAL.value());
|
||||
@@ -56,7 +58,9 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
boolean exists = super.exists(query().eq(PictureClassify::getName, dto.getName())
|
||||
.and(q -> {
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 0).eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -78,7 +82,9 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
.ne(PictureClassify::getId, dto.getId())
|
||||
.and(q -> {
|
||||
q.eq(PictureClassify::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureClassify::getShopId, 0).eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(PictureClassify::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(PictureClassify::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -102,6 +108,7 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
}
|
||||
|
||||
private void checkPictureClassify(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
PictureClassify entity = super.getById(id);
|
||||
if (entity == null) {
|
||||
throw new CzgException("图片分类不存在");
|
||||
@@ -109,6 +116,9 @@ public class PictureClassifyServiceImpl extends ServiceImpl<PictureClassifyMappe
|
||||
if (entity.getIsSystem() == YesNoEnum.YES.value()) {
|
||||
throw new CzgException("系统预设分类不可操作");
|
||||
}
|
||||
if (!shopId.equals(entity.getShopId())) {
|
||||
throw new CzgException("公共分类不可操作");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.czg.account.entity.PictureGallery;
|
||||
import com.czg.account.param.PictureGalleryParam;
|
||||
import com.czg.account.service.PictureGalleryService;
|
||||
import com.czg.enums.DeleteEnum;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.PictureGalleryMapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
@@ -33,8 +34,13 @@ public class PictureGalleryServiceImpl extends ServiceImpl<PictureGalleryMapper,
|
||||
if (ObjUtil.isNotNull(param.getPictureClassifyId())) {
|
||||
queryWrapper.eq(PictureGallery::getPictureClassifyId, param.getPictureClassifyId());
|
||||
}
|
||||
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
queryWrapper.eq(PictureGallery::getShopId, shopId);
|
||||
queryWrapper.and(q -> {
|
||||
q.eq(PictureGallery::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(PictureGallery::getShopId, 1L);
|
||||
});
|
||||
});
|
||||
queryWrapper.eq(PictureGallery::getIsDel, DeleteEnum.NORMAL.value());
|
||||
queryWrapper.orderBy(PictureGallery::getId, false);
|
||||
return queryWrapper;
|
||||
@@ -61,7 +67,11 @@ public class PictureGalleryServiceImpl extends ServiceImpl<PictureGalleryMapper,
|
||||
|
||||
@Override
|
||||
public void deletePictureGallery(Long id) {
|
||||
PictureGallery entity = super.getById(id);
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
if (!shopId.equals(entity.getShopId())) {
|
||||
throw new CzgException("公共图片不可操作");
|
||||
}
|
||||
UpdateChain.of(PictureGallery.class)
|
||||
.set(PictureGallery::getIsDel, DeleteEnum.DELETED.value())
|
||||
.eq(PictureGallery::getShopId, shopId)
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.czg.service.order.service.impl;
|
||||
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.order.service.OrderInfoRpcService;
|
||||
import com.czg.service.order.mapper.OrderInfoMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Rpc ServiceImpl
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-02-28 11:29
|
||||
*/
|
||||
@DubboService
|
||||
@Service
|
||||
@Slf4j
|
||||
public class OrderInfoRpcServiceImpl implements OrderInfoRpcService {
|
||||
|
||||
@Resource
|
||||
private OrderInfoMapper orderInfoMapper;
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverWechatAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverWechatAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverAlipayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverAlipayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverVipPayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverVipPayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverVipChargeAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverVipChargeAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverQuickPayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverQuickPayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverCashAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverCashAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverRefundAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverRefundAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverCreditAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverCreditAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverTotalAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverTotalAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHandoverOrderNum(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverOrderNum(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HandoverProductListVo> getHandoverDetailList(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverDetailList(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HandoverCategoryListVo> getHandoverCategoryList(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverCategoryList(shopId, loginTime, handoverTime);
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,6 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
||||
import com.czg.account.entity.*;
|
||||
import com.czg.account.service.*;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.entity.notify.CzgPayNotifyDTO;
|
||||
@@ -48,7 +46,6 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -65,7 +62,6 @@ import java.util.*;
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
@Slf4j
|
||||
@DubboService
|
||||
@Service
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
|
||||
|
||||
@@ -568,66 +564,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverWechatAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverAlipayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverAlipayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverVipPayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverVipPayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverVipChargeAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverVipChargeAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverQuickPayAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverQuickPayAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverCashAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverCashAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverRefundAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverRefundAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverCreditAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverCreditAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverTotalAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverTotalAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHandoverOrderNum(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverOrderNum(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HandoverProductListVo> getHandoverDetailList(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverDetailList(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HandoverCategoryListVo> getHandoverCategoryList(Long shopId, String loginTime, String handoverTime) {
|
||||
return super.mapper.getHandoverCategoryList(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化订单信息
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,9 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
queryWrapper.and(q -> {
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 0).eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
});
|
||||
queryWrapper.orderBy(ShopProdUnit::getId, false);
|
||||
@@ -70,7 +72,9 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
boolean exists = super.exists(query().eq(ShopProdUnit::getName, dto.getName())
|
||||
.and(q -> {
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 0).eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
}));
|
||||
if (exists) {
|
||||
@@ -95,7 +99,9 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
.ne(ShopProdUnit::getId, dto.getId())
|
||||
.and(q -> {
|
||||
q.eq(ShopProdUnit::getShopId, shopId).or(q1 -> {
|
||||
q1.eq(ShopProdUnit::getShopId, 0).eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
q1.eq(ShopProdUnit::getShopId, 1L);
|
||||
}).or(q2 -> {
|
||||
q2.eq(ShopProdUnit::getIsSystem, YesNoEnum.YES.value());
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -136,6 +142,7 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
}
|
||||
|
||||
private void checkShopProdUnit(Long id) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
ShopProdUnit entity = super.getById(id);
|
||||
if (entity == null) {
|
||||
throw new CzgException("单位信息不存在");
|
||||
@@ -143,5 +150,8 @@ public class ShopProdUnitServiceImpl extends ServiceImpl<ShopProdUnitMapper, Sho
|
||||
if (entity.getIsSystem() == YesNoEnum.YES.value()) {
|
||||
throw new CzgException("系统预设单位不可操作");
|
||||
}
|
||||
if (!shopId.equals(entity.getShopId())) {
|
||||
throw new CzgException("公共单位不可操作");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user