交班相关代码
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.czg.service.account.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.dto.HandoverRecordDTO;
|
||||
import com.czg.account.entity.HandoverRecord;
|
||||
import com.czg.account.service.HandoverRecordRpcService;
|
||||
import com.czg.service.account.mapper.HandoverRecordMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
/**
|
||||
* 交班记录RPC服务实现
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2025-03-01 15:35
|
||||
*/
|
||||
@DubboService
|
||||
public class HandoverRecordRpcServiceImpl implements HandoverRecordRpcService {
|
||||
|
||||
@Resource
|
||||
private HandoverRecordMapper handoverRecordMapper;
|
||||
|
||||
@Override
|
||||
public HandoverRecordDTO getHandoverRecordById(Long handoverRecordId) {
|
||||
HandoverRecord record = handoverRecordMapper.selectOneById(handoverRecordId);
|
||||
return BeanUtil.copyProperties(record, HandoverRecordDTO.class);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,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.enums.YesNoEnum;
|
||||
import com.czg.order.service.OrderInfoRpcService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.account.mapper.HandoverRecordMapper;
|
||||
@@ -138,6 +139,13 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHandoverReceipt(Long handoverRecordId, Integer isPrint) {
|
||||
if (isPrint == YesNoEnum.YES.value()) {
|
||||
orderInfoRpcService.sendHandoverReceiptPrintMsgToMq(handoverRecordId);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal sumCashAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoRpcService.getHandoverCashAmount(shopId, loginTime, handoverTime);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.czg.service.order.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.order.entity.OrderDetail;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
@@ -46,6 +48,9 @@ public class OrderInfoRpcServiceImpl implements OrderInfoRpcService {
|
||||
@DubboReference
|
||||
private ProductRpcService productRpcService;
|
||||
|
||||
@Resource
|
||||
private RabbitPublisher rabbitPublisher;
|
||||
|
||||
@Override
|
||||
public BigDecimal getHandoverWechatAmount(Long shopId, String loginTime, String handoverTime) {
|
||||
return orderInfoMapper.getHandoverWechatAmount(shopId, loginTime, handoverTime);
|
||||
@@ -167,4 +172,9 @@ public class OrderInfoRpcServiceImpl implements OrderInfoRpcService {
|
||||
// 调用商品服务恢复库存
|
||||
productRpcService.orderCancelRecoverStock(orderId, dataList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendHandoverReceiptPrintMsgToMq(Long handoverRecordId) {
|
||||
rabbitPublisher.sendHandoverPrintMsg(Convert.toStr(handoverRecordId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user