Compare commits

6 Commits

Author SHA1 Message Date
c3ae15c7cc 耗材 检测开关 默认值问题 2026-04-22 15:00:39 +08:00
3558e99784 商品缓存 2026-04-22 14:35:23 +08:00
ddf33515e0 交班 打印 2026-04-22 13:50:18 +08:00
e7c6561db4 退菜 开关 2026-04-22 13:48:09 +08:00
3848beb184 数据打印 2026-04-22 11:12:24 +08:00
4d059a2f84 金额问题 2026-04-22 10:59:26 +08:00
9 changed files with 27 additions and 13 deletions

View File

@@ -5,6 +5,7 @@ import com.czg.order.param.FinanceStsQueryParam;
import com.czg.order.param.SaleSummaryCountParam; import com.czg.order.param.SaleSummaryCountParam;
import com.czg.order.service.FinanceStsService; import com.czg.order.service.FinanceStsService;
import com.czg.resp.CzgResult; import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -46,6 +47,9 @@ public class FinanceStsController {
*/ */
@GetMapping("/printDayReport") @GetMapping("/printDayReport")
public CzgResult<Void> printDayReport(SaleSummaryCountParam param) { public CzgResult<Void> printDayReport(SaleSummaryCountParam param) {
if (param.getShopId() == null) {
param.setShopId(StpKit.USER.getShopId());
}
financeStsService.printDayReport(param); financeStsService.printDayReport(param);
return CzgResult.success(); return CzgResult.success();
} }
@@ -55,6 +59,9 @@ public class FinanceStsController {
*/ */
@GetMapping("/printDaySettle") @GetMapping("/printDaySettle")
public CzgResult<Void> printDaySettle(SaleSummaryCountParam param) { public CzgResult<Void> printDaySettle(SaleSummaryCountParam param) {
if (param.getShopId() == null) {
param.setShopId(StpKit.USER.getShopId());
}
financeStsService.printDaySettle(param); financeStsService.printDaySettle(param);
return CzgResult.success(); return CzgResult.success();
} }

View File

@@ -13,7 +13,6 @@ import com.czg.account.entity.HandoverRecord;
import com.czg.account.service.HandoverRecordService; import com.czg.account.service.HandoverRecordService;
import com.czg.account.vo.HandoverProductListVo; import com.czg.account.vo.HandoverProductListVo;
import com.czg.account.vo.HandoverTotalVo; import com.czg.account.vo.HandoverTotalVo;
import com.czg.constants.SystemConstants;
import com.czg.exception.CzgException; import com.czg.exception.CzgException;
import com.czg.order.service.OrderInfoRpcService; import com.czg.order.service.OrderInfoRpcService;
import com.czg.sa.StpKit; import com.czg.sa.StpKit;
@@ -129,8 +128,6 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
@Override @Override
public void printHandoverReceipt(HandoverRecord record, Integer isPrint) { public void printHandoverReceipt(HandoverRecord record, Integer isPrint) {
if (isPrint == SystemConstants.OneZero.ONE) {
orderInfoRpcService.sendHandoverReceiptPrintMsgToMq(record.getShopId(), record); orderInfoRpcService.sendHandoverReceiptPrintMsgToMq(record.getShopId(), record);
} }
} }
}

View File

@@ -143,6 +143,7 @@ public class FinanceStsServiceImpl implements FinanceStsService {
DayReportPrintDTO dayReportPrintDTO = new DayReportPrintDTO(); DayReportPrintDTO dayReportPrintDTO = new DayReportPrintDTO();
FinanceStsQueryParam financeStsQueryParam = new FinanceStsQueryParam(); FinanceStsQueryParam financeStsQueryParam = new FinanceStsQueryParam();
financeStsQueryParam.setQueryDate(localDate); financeStsQueryParam.setQueryDate(localDate);
financeStsQueryParam.setShopId(param.getShopId());
ShopOrderStatistic statisticData = getStatisticData(financeStsQueryParam); ShopOrderStatistic statisticData = getStatisticData(financeStsQueryParam);
// ====================== 核心填充DTO ====================== // ====================== 核心填充DTO ======================
// 1. 填充基础信息 // 1. 填充基础信息
@@ -228,6 +229,8 @@ public class FinanceStsServiceImpl implements FinanceStsService {
DaySettlePrintDTO printDTO = new DaySettlePrintDTO(); DaySettlePrintDTO printDTO = new DaySettlePrintDTO();
FinanceStsQueryParam param1 = new FinanceStsQueryParam(); FinanceStsQueryParam param1 = new FinanceStsQueryParam();
param1.setQueryDate(localDate); param1.setQueryDate(localDate);
param1.setShopId(param.getShopId());
ShopOrderStatistic data = getStatisticData(param1); ShopOrderStatistic data = getStatisticData(param1);
printDTO.setOperator(param.getOperator()); printDTO.setOperator(param.getOperator());
// ===================== 1.基础信息 ===================== // ===================== 1.基础信息 =====================

View File

@@ -1865,7 +1865,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
} }
} else if (shopInfo.getRefundMode().equals(2)) { } else if (shopInfo.getRefundMode().equals(2)) {
//单商品 //单商品
refundMode = 2; refundMode = product.getRefundMode();
} else { } else {
log.error("退菜模式错误 店铺{},退款模式{},商品Id{}分类Id{}", shopInfo.getShopName(), shopInfo.getRefundMode(), product.getId(), product.getCategoryId()); log.error("退菜模式错误 店铺{},退款模式{},商品Id{}分类Id{}", shopInfo.getShopName(), shopInfo.getRefundMode(), product.getId(), product.getCategoryId());
throw new CzgException("退菜模式错误"); throw new CzgException("退菜模式错误");

View File

@@ -525,7 +525,7 @@ public class OrderPayServiceImpl implements OrderPayService {
FunUtils.safeRunVoid(() -> printConfig.kitchenRefundAllHandler(StrUtil.isNotBlank(param.getOperator()) ? param.getOperator() : "", orderInfo, param.getRefundDetails()), FunUtils.safeRunVoid(() -> printConfig.kitchenRefundAllHandler(StrUtil.isNotBlank(param.getOperator()) ? param.getOperator() : "", orderInfo, param.getRefundDetails()),
"订单id:{} 退款,后厨退菜单打印消息失败", orderInfo.getId()); "订单id:{} 退款,后厨退菜单打印消息失败", orderInfo.getId());
//退款返还库存 //退款返还库存
if (!productStockMap.isEmpty()) { if (CollUtil.isNotEmpty(productStockMap)) {
FunUtils.safeRunVoid(() -> orderInfoCustomService.refundStock(shopInfo, orderInfo.getId(), productStockMap, param.isRefundStock()), FunUtils.safeRunVoid(() -> orderInfoCustomService.refundStock(shopInfo, orderInfo.getId(), productStockMap, param.isRefundStock()),
"订单id:{} 退款,库存处理失败", orderInfo.getId()); "订单id:{} 退款,库存处理失败", orderInfo.getId());
} }

View File

@@ -84,8 +84,8 @@
SELECT SELECT
sum(detail.num-detail.return_num) as saleCount, sum(detail.num-detail.return_num) as saleCount,
sum(detail.pay_amount) as totalAmount, sum(detail.pay_amount) as totalAmount,
sum(detail.refund_num) refundCount, sum(detail.refund_num) as refundCount,
sum(detail.return_amount) refundAmount sum(detail.return_amount) as refundAmount
FROM FROM
tb_order_info `order` tb_order_info `order`
INNER JOIN tb_order_detail detail ON `order`.id = detail.order_id INNER JOIN tb_order_detail detail ON `order`.id = detail.order_id
@@ -104,7 +104,7 @@
<select id="summaryCountSingleDate" resultType="com.czg.order.vo.SaleSummaryCountVo"> <select id="summaryCountSingleDate" resultType="com.czg.order.vo.SaleSummaryCountVo">
SELECT SELECT
sum(statistic.sale_count) AS saleCount, sum(statistic.sale_count) AS saleCount,
sum(statistic.sale_amount) AS saleAmount, sum(statistic.sale_amount) AS totalAmount,
sum(statistic.refund_count) AS refundCount, sum(statistic.refund_count) AS refundCount,
sum(statistic.refund_amount) AS refundAmount sum(statistic.refund_amount) AS refundAmount
FROM FROM

View File

@@ -126,7 +126,9 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
entity.setStockNumber(BigDecimal.ZERO); entity.setStockNumber(BigDecimal.ZERO);
entity.setStatus(SystemConstants.OneZero.ONE); entity.setStatus(SystemConstants.OneZero.ONE);
//entity.setConWarning(BigDecimal.ZERO); //entity.setConWarning(BigDecimal.ZERO);
if (dto.getIsStock() == null) {
entity.setIsStock(SystemConstants.OneZero.ZERO); entity.setIsStock(SystemConstants.OneZero.ZERO);
}
entity.setShopId(shopId); entity.setShopId(shopId);
super.save(entity); super.save(entity);
dto.setId(entity.getId()); dto.setId(entity.getId());

View File

@@ -158,7 +158,6 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
stockPrint.setPrintTime(LocalDateTime.now()); stockPrint.setPrintTime(LocalDateTime.now());
stockPrint.setInStockTime(LocalDateTime.now()); stockPrint.setInStockTime(LocalDateTime.now());
stockPrint.setOperator(param.getOperator()); stockPrint.setOperator(param.getOperator());
stockPrint.setConsCount(param.getBodyList().size());
List<StockPrintDTO.InStockItem> items = new ArrayList<>(); List<StockPrintDTO.InStockItem> items = new ArrayList<>();
BigDecimal totalInOutNumber = BigDecimal.ZERO; BigDecimal totalInOutNumber = BigDecimal.ZERO;
BigDecimal totalAmount = BigDecimal.ZERO; BigDecimal totalAmount = BigDecimal.ZERO;
@@ -175,6 +174,7 @@ public class ConsStockFlowServiceImpl extends ServiceImpl<ConsStockFlowMapper, C
totalInOutNumber = NumberUtil.add(totalInOutNumber, cons.getInOutNumber()); totalInOutNumber = NumberUtil.add(totalInOutNumber, cons.getInOutNumber());
totalAmount = NumberUtil.add(totalAmount, cons.getSubTotal()); totalAmount = NumberUtil.add(totalAmount, cons.getSubTotal());
} }
stockPrint.setConsCount(items.size());
stockPrint.setStockNumberCount(totalInOutNumber); stockPrint.setStockNumberCount(totalInOutNumber);
stockPrint.setAmountCount(totalAmount); stockPrint.setAmountCount(totalAmount);
stockPrint.setItems(items); stockPrint.setItems(items);

View File

@@ -389,11 +389,16 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
@Override @Override
public void clearProductCache(Long... categoryIds) { public void clearProductCache(Long... categoryIds) {
Long shopId = StpKit.USER.getShopId(0L); Long shopId = StpKit.USER.getShopId(0L);
//分类缓存
String prefix = ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId + "::"; String prefix = ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId + "::";
for (Long categoryId : categoryIds) { for (Long categoryId : categoryIds) {
redisService.del(prefix + categoryId); redisService.del(prefix + categoryId);
} }
redisService.del(ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId); redisService.del(ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId);
//用户端分组缓存
redisService.del(CacheConstant.USER_CLIENT_GROUPS_PRODUCT + "::" + shopId);
//用户端热销缓存
redisService.del(CacheConstant.USER_CLIENT_HOTS_PRODUCT + "::" + shopId);
} }
/** /**