打印数据
This commit is contained in:
@@ -82,6 +82,16 @@ public class RabbitConfig {
|
||||
return BindingBuilder.bind(otherPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue otherPrintLocalQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOtherPrintLocalExchange(Queue otherPrintLocalQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(otherPrintLocalQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单取消
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
@@ -115,6 +125,7 @@ public class RabbitConfig {
|
||||
public Binding bindingProductInfoChange(Queue productInfoChangeQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(productInfoChangeQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 耗材信息更新
|
||||
@Bean
|
||||
public Queue consInfoChangeQueue() {
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface RabbitConstants {
|
||||
public static final String ORDER_MACHINE_PRINT_QUEUE = "order.machine.print.queue";
|
||||
|
||||
public static final String OTHER_PRINT_QUEUE = "other.print.queue";
|
||||
public static final String OTHER_PRINT_LOCAL_QUEUE = "other.print.local.queue";
|
||||
public static final String PRODUCT_INFO_CHANGE_QUEUE = "product.info.change.queue";
|
||||
public static final String CONS_INFO_CHANGE_QUEUE = "cons.info.change.queue";
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ public class RabbitPublisher {
|
||||
* STOCK_CHECK 库存盘点
|
||||
* HANDOVER 交班单
|
||||
* CALL 排队取号
|
||||
*
|
||||
* @param printType {@link com.czg.service.order.print.PrinterHandler.PrintTypeEnum}
|
||||
*/
|
||||
public void sendOtherPrintMsg(Long shopId, Object data, String printType) {
|
||||
@@ -167,4 +168,14 @@ public class RabbitPublisher {
|
||||
rabbitTemplate.convertAndSend(exchange, queueName, msg);
|
||||
}
|
||||
|
||||
public void sendOtherPrintLocalMsg(Long shopId, String printType, Long dataId) {
|
||||
String exchange = activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE;
|
||||
String queueName = activeProfile + "-" + RabbitConstants.Queue.OTHER_PRINT_LOCAL_QUEUE;
|
||||
Map<String, Object> msg = new HashMap<>();
|
||||
msg.put("shopId", shopId);
|
||||
msg.put("dataId", dataId);
|
||||
msg.put("printType", printType);
|
||||
rabbitTemplate.convertAndSend(exchange, queueName, msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -32,11 +33,12 @@ public interface MkShopRechargeService extends IService<MkShopRecharge> {
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*
|
||||
* @param isNoJoin 是否没有执行 加入会员的方法
|
||||
* 会员如果是条件开通 则 需要统计
|
||||
* 会员如果是条件开通 则 需要统计
|
||||
*/
|
||||
void recharge(Long shopId, Long shopUserId, Long rechargeDetailId, BigDecimal amount, Long paymentId,
|
||||
String payType, ShopUserFlowBizEnum bizEnum, boolean isNoJoin);
|
||||
String payType, LocalDateTime payTime, ShopUserFlowBizEnum bizEnum, boolean isNoJoin, String operator);
|
||||
|
||||
List<RechargeListVO> getList(long loginIdAsLong);
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
package com.czg.order.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 数据打印表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-04-16
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class SysPrintDataDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 打印数据 Json格式
|
||||
*/
|
||||
private String data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.czg.order.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 数据打印表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-04-16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("sys_print_data")
|
||||
public class SysPrintData implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 打印类型
|
||||
*
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 打印数据 Json格式
|
||||
*/
|
||||
private String data;
|
||||
|
||||
}
|
||||
@@ -56,4 +56,9 @@ public class SaleSummaryCountParam implements Serializable {
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
private String operator;
|
||||
}
|
||||
|
||||
@@ -23,22 +23,30 @@ public interface ShopProdStatisticService extends IService<ShopProdStatistic> {
|
||||
*/
|
||||
SaleSummaryCountVo summaryCount(SaleSummaryCountParam param);
|
||||
|
||||
/**
|
||||
* 打印 商品交易数据
|
||||
*/
|
||||
void summaryPrint(SaleSummaryCountParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 获取某一段时间的商品交易数据
|
||||
* shopId 店铺id
|
||||
* rangeType 时间范围类型
|
||||
* TODAY, // 今天
|
||||
* YESTERDAY, // 昨天
|
||||
* LAST_7_DAYS, // 最近7天
|
||||
* LAST_30_DAYS,// 最近30天
|
||||
* THIS_WEEK, // 本周
|
||||
* THIS_MONTH // 本月
|
||||
* CUSTOM // 自定义时间范围
|
||||
* start 开始时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* end 结束时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* shopId 店铺id
|
||||
* rangeType 时间范围类型
|
||||
* TODAY, // 今天
|
||||
* YESTERDAY, // 昨天
|
||||
* LAST_7_DAYS, // 最近7天
|
||||
* LAST_30_DAYS,// 最近30天
|
||||
* THIS_WEEK, // 本周
|
||||
* THIS_MONTH // 本月
|
||||
* CUSTOM // 自定义时间范围
|
||||
* start 开始时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
* end 结束时间 格式yyyy-MM-dd 今天/昨天不用传
|
||||
*
|
||||
* @return 商品数据
|
||||
*/
|
||||
List<ShopProdStatistic> getArchiveTradeData(SaleSummaryCountParam param);
|
||||
|
||||
List<ShopProdStatistic> getArchiveTradeDataBy10(Long shopId, Integer day);
|
||||
|
||||
//------------------------------------------------------------下列为 后台使用------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.czg.order.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.order.entity.SysPrintData;
|
||||
|
||||
/**
|
||||
* 数据打印表 服务层。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2026-04-16
|
||||
*/
|
||||
public interface SysPrintDataService extends IService<SysPrintData> {
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商品报表打印实体
|
||||
@@ -50,9 +49,39 @@ public class ProductReportPrintDTO {
|
||||
* 商品明细列表
|
||||
* 分类名称,商品集合
|
||||
*/
|
||||
private Map<String, List<ProductItem>> items;
|
||||
private List<CategoryItem> items;
|
||||
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class CategoryItem {
|
||||
|
||||
/**
|
||||
* 商品名称(第二列商品名称)
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 数量(第三列数量)
|
||||
*/
|
||||
private BigDecimal number;
|
||||
|
||||
/**
|
||||
* 实收(第四列)
|
||||
*/
|
||||
private BigDecimal actualAmount;
|
||||
|
||||
/**
|
||||
* 销售额(第五列)
|
||||
*/
|
||||
private BigDecimal salesAmount;
|
||||
|
||||
/**
|
||||
* 商品明细列表
|
||||
*/
|
||||
private List<ProductItem> productItems;
|
||||
}
|
||||
|
||||
public ProductItem createProductItem(String productName, BigDecimal number, BigDecimal actualAmount, BigDecimal salesAmount) {
|
||||
ProductItem item = new ProductItem();
|
||||
item.setProductName(productName);
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
|
||||
public class RechargePrintDTO {
|
||||
//店铺名称
|
||||
private String shopName;
|
||||
private String userId;
|
||||
private Long userId;
|
||||
private String userName;
|
||||
private String userPhone;
|
||||
//支付时间
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mybatisflex.core.service.IService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 店铺商品分类
|
||||
@@ -26,15 +27,22 @@ public interface ShopProdCategoryService extends IService<ShopProdCategory> {
|
||||
|
||||
/**
|
||||
* 获取店铺商品分类列表
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return 店铺商品分类列表
|
||||
*/
|
||||
List<ShopProdCategoryDTO> getShopProdCategoryList(ShopProdCategoryDTO param);
|
||||
|
||||
/**
|
||||
* 根据店铺id获取分类id和名称的映射
|
||||
*/
|
||||
Map<Long, String> getCategoryIdNameMap(Long shopId);
|
||||
|
||||
void exportShopProdCategory(ShopProdCategoryDTO param, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 获取店铺商品分类详情
|
||||
*
|
||||
* @param id id
|
||||
* @return 店铺商品分类详情
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user