交班相关代码

This commit is contained in:
Tankaikai
2025-02-28 11:39:41 +08:00
parent 5416d9b556
commit f23517c6c1
5 changed files with 239 additions and 201 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
/**
* 初始化订单信息
*/