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.service.FinanceStsService;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated;
@@ -46,6 +47,9 @@ public class FinanceStsController {
*/
@GetMapping("/printDayReport")
public CzgResult<Void> printDayReport(SaleSummaryCountParam param) {
if (param.getShopId() == null) {
param.setShopId(StpKit.USER.getShopId());
}
financeStsService.printDayReport(param);
return CzgResult.success();
}
@@ -55,6 +59,9 @@ public class FinanceStsController {
*/
@GetMapping("/printDaySettle")
public CzgResult<Void> printDaySettle(SaleSummaryCountParam param) {
if (param.getShopId() == null) {
param.setShopId(StpKit.USER.getShopId());
}
financeStsService.printDaySettle(param);
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.vo.HandoverProductListVo;
import com.czg.account.vo.HandoverTotalVo;
import com.czg.constants.SystemConstants;
import com.czg.exception.CzgException;
import com.czg.order.service.OrderInfoRpcService;
import com.czg.sa.StpKit;
@@ -129,8 +128,6 @@ public class HandoverRecordServiceImpl extends ServiceImpl<HandoverRecordMapper,
@Override
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();
FinanceStsQueryParam financeStsQueryParam = new FinanceStsQueryParam();
financeStsQueryParam.setQueryDate(localDate);
financeStsQueryParam.setShopId(param.getShopId());
ShopOrderStatistic statisticData = getStatisticData(financeStsQueryParam);
// ====================== 核心填充DTO ======================
// 1. 填充基础信息
@@ -228,6 +229,8 @@ public class FinanceStsServiceImpl implements FinanceStsService {
DaySettlePrintDTO printDTO = new DaySettlePrintDTO();
FinanceStsQueryParam param1 = new FinanceStsQueryParam();
param1.setQueryDate(localDate);
param1.setShopId(param.getShopId());
ShopOrderStatistic data = getStatisticData(param1);
printDTO.setOperator(param.getOperator());
// ===================== 1.基础信息 =====================

View File

@@ -1865,7 +1865,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
}
} else if (shopInfo.getRefundMode().equals(2)) {
//单商品
refundMode = 2;
refundMode = product.getRefundMode();
} else {
log.error("退菜模式错误 店铺{},退款模式{},商品Id{}分类Id{}", shopInfo.getShopName(), shopInfo.getRefundMode(), product.getId(), product.getCategoryId());
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()),
"订单id:{} 退款,后厨退菜单打印消息失败", orderInfo.getId());
//退款返还库存
if (!productStockMap.isEmpty()) {
if (CollUtil.isNotEmpty(productStockMap)) {
FunUtils.safeRunVoid(() -> orderInfoCustomService.refundStock(shopInfo, orderInfo.getId(), productStockMap, param.isRefundStock()),
"订单id:{} 退款,库存处理失败", orderInfo.getId());
}

View File

@@ -84,8 +84,8 @@
SELECT
sum(detail.num-detail.return_num) as saleCount,
sum(detail.pay_amount) as totalAmount,
sum(detail.refund_num) refundCount,
sum(detail.return_amount) refundAmount
sum(detail.refund_num) as refundCount,
sum(detail.return_amount) as refundAmount
FROM
tb_order_info `order`
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
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_amount) AS refundAmount
FROM

View File

@@ -87,7 +87,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
@Override
public List<ConsInfoDTO> getConsInfoList(ConsInfoDTO param) {
QueryWrapper queryWrapper = buildQueryWrapper(param);
queryWrapper.eq(ConsInfo::getStatus,SystemConstants.OneZero.ONE);
queryWrapper.eq(ConsInfo::getStatus, SystemConstants.OneZero.ONE);
List<ConsInfoDTO> list = super.listAs(queryWrapper, ConsInfoDTO.class);
List<ConsGroup> consGroupList = consGroupMapper.selectListByQuery(QueryWrapper.create().eq(ConsGroup::getShopId, param.getShopId()));
Map<Long, String> collect = consGroupList.stream().collect(Collectors.toMap(ConsGroup::getId, ConsGroup::getName));
@@ -126,7 +126,9 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
entity.setStockNumber(BigDecimal.ZERO);
entity.setStatus(SystemConstants.OneZero.ONE);
//entity.setConWarning(BigDecimal.ZERO);
entity.setIsStock(SystemConstants.OneZero.ZERO);
if (dto.getIsStock() == null) {
entity.setIsStock(SystemConstants.OneZero.ZERO);
}
entity.setShopId(shopId);
super.save(entity);
dto.setId(entity.getId());
@@ -168,7 +170,7 @@ public class ConsInfoServiceImpl extends ServiceImpl<ConsInfoMapper, ConsInfo> i
public void enableConsInfo(Long id) {
Long shopId = StpKit.USER.getShopId(0L);
UpdateChain.of(ConsInfo.class)
.set(ConsInfo::getStatus,SystemConstants.OneZero.ONE)
.set(ConsInfo::getStatus, SystemConstants.OneZero.ONE)
.eq(ConsInfo::getId, id)
.eq(ConsInfo::getShopId, shopId)
.update();

View File

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

View File

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