打印实体更改名称

This commit is contained in:
Jack 2025-11-28 10:48:14 +08:00
parent 7e4c2a9ccf
commit e1bd542c12
12 changed files with 141 additions and 39 deletions

View File

@ -22,7 +22,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "订单商品打印对象", description = "订单商品打印对象")
public class ShopStoreOrderProductPrintVO implements Serializable {
public class OrderItemPrintVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "商品名")
private String item_name;
@ -47,11 +47,11 @@ public class ShopStoreOrderProductPrintVO implements Serializable {
@ApiModelProperty(value = "金额额定字节长度")
private Integer amount_blen;
public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn) {
new ShopStoreOrderProductPrintVO(itemName, orderItemQuantity, orderItemAmount, productSn, 18, 6, 8);
public OrderItemPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn) {
new OrderItemPrintVO(itemName, orderItemQuantity, orderItemAmount, productSn, 18, 6, 8);
}
public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn, int titleBlen, int quantityBlen, int amountBlen) {
public OrderItemPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn, int titleBlen, int quantityBlen, int amountBlen) {
this.item_name = itemName;
this.order_item_quantity = orderItemQuantity;
this.order_item_amount = orderItemAmount;
@ -90,8 +90,8 @@ public class ShopStoreOrderProductPrintVO implements Serializable {
*
* @return
*/
public ShopStoreOrderProductPrintVO rebuild() {
return new ShopStoreOrderProductPrintVO(this.item_name, this.order_item_quantity, this.order_item_amount, this.product_sn, 18, 6, 8);
public OrderItemPrintVO rebuild() {
return new OrderItemPrintVO(this.item_name, this.order_item_quantity, this.order_item_amount, this.product_sn, 18, 6, 8);
}
/**

View File

@ -0,0 +1,25 @@
package com.suisung.mall.common.pojo.vo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 退货单打印对象
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "(退款)订单主信息打印对象", description = "(退款)订单主信息打印对象")
public class OrderPrintVO implements Serializable {
private static final long serialVersionUID = 1L;
}

View File

@ -107,7 +107,7 @@ public class ShopStoreOrderPrintVO implements Serializable {
// 订单商品详情信息
@ApiModelProperty(value = "订单商品详情信息")
private ShopStoreOrderProductPrintVO order_items;
private OrderItemPrintVO order_items;
@ApiModelProperty(value = "状态1-有效2-无效;")
private Integer status;

View File

@ -522,7 +522,7 @@ public interface ShopOrderBaseService extends IBaseService<ShopOrderBase> {
* @param payState 支付状态参考StateCode.ORDER_PAID_STATE_YES
* @return
*/
Map getOrderPrintInfo(Integer storeId, String orderId, Integer payState);
Map fetchOrderPrintInfo(Integer storeId, String orderId, Integer payState);
/**

View File

@ -2,7 +2,7 @@ package com.suisung.mall.shop.order.service;
import com.suisung.mall.common.modules.order.ShopOrderItem;
import com.suisung.mall.common.modules.pay.dto.ItemActivityInfoDTO;
import com.suisung.mall.common.pojo.vo.ShopStoreOrderProductPrintVO;
import com.suisung.mall.common.pojo.vo.OrderItemPrintVO;
import com.suisung.mall.core.web.service.IBaseService;
import java.util.List;
@ -30,5 +30,5 @@ public interface ShopOrderItemService extends IBaseService<ShopOrderItem> {
* @param orderId
* @return
*/
List<ShopStoreOrderProductPrintVO> selectOrderItemPrintInfo(String orderId);
List<OrderItemPrintVO> selectOrderItemPrintInfo(String orderId);
}

View File

@ -65,7 +65,7 @@ import com.suisung.mall.common.pojo.to.MsgTO;
import com.suisung.mall.common.pojo.to.PayMoneyTO;
import com.suisung.mall.common.pojo.to.PayPointTO;
import com.suisung.mall.common.pojo.to.UserLevelTO;
import com.suisung.mall.common.pojo.vo.ShopStoreOrderProductPrintVO;
import com.suisung.mall.common.pojo.vo.OrderItemPrintVO;
import com.suisung.mall.common.service.MessageService;
import com.suisung.mall.common.service.impl.CommonService;
import com.suisung.mall.common.utils.*;
@ -8765,8 +8765,16 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
return data;
}
/**
* 获取订单打印信息
*
* @param storeId
* @param orderId
* @param payState
* @return
*/
@Override
public Map getOrderPrintInfo(Integer storeId, String orderId, Integer payState) {
public Map fetchOrderPrintInfo(Integer storeId, String orderId, Integer payState) {
if (StrUtil.isBlank(orderId)) {
logger.error("缺少必要参数orderId:{}");
return null;
@ -8778,14 +8786,14 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
}
// 订单商品列表
List<ShopStoreOrderProductPrintVO> shopStoreOrderProductPrintVOList = shopOrderItemService.selectOrderItemPrintInfo(orderId);
if (CollUtil.isEmpty(shopStoreOrderProductPrintVOList)) {
List<OrderItemPrintVO> orderItemPrintVOList = shopOrderItemService.selectOrderItemPrintInfo(orderId);
if (CollUtil.isEmpty(orderItemPrintVOList)) {
return null;
}
// 重构实体类处理标题数量价格适应长度
List<ShopStoreOrderProductPrintVO> orderItems = new ArrayList<>();
for (ShopStoreOrderProductPrintVO ent : shopStoreOrderProductPrintVOList) {
List<OrderItemPrintVO> orderItems = new ArrayList<>();
for (OrderItemPrintVO ent : orderItemPrintVOList) {
orderItems.add(ent.rebuild());
}

View File

@ -17,7 +17,7 @@ import com.suisung.mall.common.modules.order.ShopOrderDeliveryAddress;
import com.suisung.mall.common.modules.order.ShopOrderInfo;
import com.suisung.mall.common.modules.order.ShopOrderItem;
import com.suisung.mall.common.modules.pay.dto.ItemActivityInfoDTO;
import com.suisung.mall.common.pojo.vo.ShopStoreOrderProductPrintVO;
import com.suisung.mall.common.pojo.vo.OrderItemPrintVO;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
import com.suisung.mall.shop.activity.service.ShopActivityGroupbookingHistoryService;
import com.suisung.mall.shop.order.mapper.ShopOrderItemMapper;
@ -226,7 +226,7 @@ public class ShopOrderItemServiceImpl extends BaseServiceImpl<ShopOrderItemMappe
}
@Override
public List<ShopStoreOrderProductPrintVO> selectOrderItemPrintInfo(String orderId) {
public List<OrderItemPrintVO> selectOrderItemPrintInfo(String orderId) {
// 输入验证
if (StrUtil.isBlank(orderId)) {
return Collections.emptyList();
@ -238,7 +238,7 @@ public class ShopOrderItemServiceImpl extends BaseServiceImpl<ShopOrderItemMappe
}
return mList.stream().map(map -> {
ShopStoreOrderProductPrintVO vo = new ShopStoreOrderProductPrintVO();
OrderItemPrintVO vo = new OrderItemPrintVO();
vo.setProduct_sn(Convert.toStr(map.get("product_sn")));
vo.setItem_name(Convert.toStr(map.get("item_name")));
vo.setOrder_item_amount(Convert.toBigDecimal(map.get("order_item_amount")));

View File

@ -1580,12 +1580,12 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
QueryWrapper<ShopOrderReturnItem> returnItemQueryWrapper = new QueryWrapper<>();
returnItemQueryWrapper.in("return_id", return_ids);
List<ShopOrderReturnItem> returnItems = orderReturnItemService.find(returnItemQueryWrapper);
QueryWrapper<ShopOrderReturn> shopOrderReturnQueryWrapper= new QueryWrapper<>();
QueryWrapper<ShopOrderReturn> shopOrderReturnQueryWrapper = new QueryWrapper<>();
shopOrderReturnQueryWrapper.in("return_id", return_ids);
List<ShopOrderReturn> shopOrderReturnList= shopOrderReturnService.find(shopOrderReturnQueryWrapper);
Map<String,Long> shopOrderReturnMap=new HashMap<>();
if(!shopOrderReturnList.isEmpty()){
shopOrderReturnMap=shopOrderReturnList.stream().collect(Collectors.toMap(ShopOrderReturn::getReturn_id, s->s.getUpdated_at().getTime()));
List<ShopOrderReturn> shopOrderReturnList = shopOrderReturnService.find(shopOrderReturnQueryWrapper);
Map<String, Long> shopOrderReturnMap = new HashMap<>();
if (!shopOrderReturnList.isEmpty()) {
shopOrderReturnMap = shopOrderReturnList.stream().collect(Collectors.toMap(ShopOrderReturn::getReturn_id, s -> s.getUpdated_at().getTime()));
}
if (CollUtil.isNotEmpty(returnItems)) {
for (ShopOrderReturnItem returnItem : returnItems) {
@ -1637,17 +1637,17 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
// RMK 第三方数据同步相关redis 新增返还思迅库存
Map<String, Integer> stockDeltaMap = new HashMap<>();
String item_src_id = productItem.getItem_src_id();
String mapKey=item_src_id + "-" + shopOrderItem.getOrder_id() + "-" + shopOrderItem.getOrder_item_unit_price();
if(null!=shopOrderReturnMap.get(returnItem.getReturn_id())){
mapKey=mapKey+"-" + shopOrderReturnMap.get(returnItem.getReturn_id());//时间
String mapKey = item_src_id + "-" + shopOrderItem.getOrder_id() + "-" + shopOrderItem.getOrder_item_unit_price();
if (null != shopOrderReturnMap.get(returnItem.getReturn_id())) {
mapKey = mapKey + "-" + shopOrderReturnMap.get(returnItem.getReturn_id());//时间
}
stockDeltaMap.put(mapKey, returnNum);
syncThirdDataService.incrProductStockToRedis(stockDeltaMap, returnItem.getReturn_item_subtotal());
logger.info("退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{},mapKey:{}", item_src_id, shopOrderItem.getOrder_id(), returnNum,mapKey);
logger.info("退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{},mapKey:{}", item_src_id, shopOrderItem.getOrder_id(), returnNum, mapKey);
} else {
logger.warn("退货数量为空无法增加库存订单项ID: {}", orderItemId);
}
}else {//没有出库也要做思迅出库在客户端计算支付流水防止部分数据有出无进
} else {//没有出库也要做思迅出库在客户端计算支付流水防止部分数据有出无进
Long orderItemId = returnItem.getOrder_item_id();
ShopOrderItem shopOrderItem = shopOrderItemService.get(orderItemId);
if (shopOrderItem == null) {
@ -1669,13 +1669,13 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
// RMK 第三方数据同步相关redis 新增返还思迅库存
Map<String, Integer> stockDeltaMap = new HashMap<>();
String item_src_id = productItem.getItem_src_id();
String mapKey=item_src_id + "-" + shopOrderItem.getOrder_id() + "-" + shopOrderItem.getOrder_item_unit_price();
if(null!=shopOrderReturnMap.get(returnItem.getReturn_id())){
mapKey=mapKey+"-" + shopOrderReturnMap.get(returnItem.getReturn_id());//时间
String mapKey = item_src_id + "-" + shopOrderItem.getOrder_id() + "-" + shopOrderItem.getOrder_item_unit_price();
if (null != shopOrderReturnMap.get(returnItem.getReturn_id())) {
mapKey = mapKey + "-" + shopOrderReturnMap.get(returnItem.getReturn_id());//时间
}
stockDeltaMap.put(mapKey, returnNum);
syncThirdDataService.incrProductStockToRedis(stockDeltaMap, returnItem.getReturn_item_subtotal());
logger.info("未出库退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{},mapKey:{}", item_src_id, shopOrderItem.getOrder_id(), returnNum,mapKey);
logger.info("未出库退货返回给思迅,存入redis成功,item_src_id:{},订单号:{},数量:{},mapKey:{}", item_src_id, shopOrderItem.getOrder_id(), returnNum, mapKey);
}
}
}
@ -2564,7 +2564,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
}
/**
* 对已存在部分退款的订单进行剩余商品的全部退款(前提是未发货之前)
* 对已存在部分退款的订单进行剩余商品的全部退款也适合全部退款(前提是未发货之前)
* 该方法用于处理订单中部分商品已经申请退款后对剩余商品进行整单退款的场景
*
* @param orderId 订单ID

View File

@ -341,7 +341,7 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
public Boolean printShopStoreOrder(Integer storeId, String orderId) {
logger.debug("#### 调用飞鹅打票机的打印操作开始 ####");
logger.debug("#### 店铺:{},打印订单:{} ####", storeId, orderId);
// 获取订单包含所有所需的字段参考实体类ShopStoreOrderPrintVO ShopStoreOrderProductPrintVO
// 获取订单包含所有所需的字段参考实体类ShopStoreOrderPrintVO OrderItemPrintVO
if (StrUtil.isBlank(orderId)) {
logger.error("订单为空,无法打印小票。");
@ -349,7 +349,7 @@ public class ShopStorePrinterServiceImpl extends BaseServiceImpl<ShopStorePrinte
}
// 获取打印的订单信息判断订单支付状态已支付
Map<String, Object> binding = shopOrderBaseService.getOrderPrintInfo(storeId, orderId, StateCode.ORDER_PAID_STATE_YES);
Map<String, Object> binding = shopOrderBaseService.fetchOrderPrintInfo(storeId, orderId, StateCode.ORDER_PAID_STATE_YES);
if (binding == null) {
logger.error("订单{}信息无法获取,无法打印小票。", orderId);
return false;

View File

@ -6,7 +6,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.suisung.mall.common.pojo.res.FeiePrinterApiRes;
import com.suisung.mall.common.pojo.vo.ShopStoreOrderProductPrintVO;
import com.suisung.mall.common.pojo.vo.OrderItemPrintVO;
import com.suisung.mall.common.utils.JsonUtil;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpEntity;
@ -330,7 +330,7 @@ public class FeieUtil {
* @param amountLen 金额字节数最大8个字节
* @return
*/
public String genProductStr(List<ShopStoreOrderProductPrintVO> productList, int titleLen, int numLen, int amountLen) {
public String genProductStr(List<OrderItemPrintVO> productList, int titleLen, int numLen, int amountLen) {
String resultStr = "";
resultStr += "<L>商品名称 数量 金额</L><BR>";
resultStr += "--------------------------------<BR>";

View File

@ -565,6 +565,38 @@
</where>
</select>
<select id="getReturnOrderPrintInfo" resultType="java.util.Map">
select
a.order_id,a.store_id,a.store_name,a.buyer_user_id,
a.buyer_user_name,a.order_time,a.order_payment_amount,a.order_product_amount,
b.order_title, b.delivery_type_id, b.payment_type_id, b.payment_time, b.order_pickup_num,
CASE WHEN b.booking_state = 2 THEN 2 ELSE 1 END AS booking_state, b.booking_begin_time,
c.order_message, c.order_item_amount, c.order_shipping_fee, c.order_shipping_fee_amount, c.delivery_time,
(c.order_discount_amount + c.voucher_price + c.order_points_fee + c.order_adjust_fee) as total_discount_amount,
c.packing_fee,
e.store_tel,
f.da_province,f.da_city,f.da_address,f.da_mobile, f.order_id
from shop_order_base a
inner join shop_order_info b on a.order_id=b.order_id
inner join shop_order_data c on a.order_id=c.order_id
inner join shop_store_base d on a.store_id=d.store_id
inner join shop_store_info e on a.store_id=e.store_id
inner join shop_order_delivery_address f on a.order_id=f.order_id
<where>
<if test="storeId!=null and storeId > 0">
and a.store_id=#{storeId}
</if>
<if test="orderId!=null and orderId != ''">
and a.order_id=#{orderId}
</if>
<if test="payState!=null">
and b.order_is_paid=#{payState}
</if>
</where>
</select>
<resultMap id="MchOrderResult" type="com.suisung.mall.common.modules.order.dto.MchOrderInfoDTO">
<!--订单对象映射-->

View File

@ -37,7 +37,44 @@
--------------------------------<BR>
操作员:李小明<BR>
格式化模版:
############################################
修改后的模版
<CB>小发同城</CB><BR>
--------------------------------<BR>
<CB>#00019232</CB><BR>
<L>退款原因:不用敲门,放在门口旁边的外卖箱,打个电话告知送达就行,谢谢!!!</L><BR>
<BOLD>配送时间2024-10-25 14:00-14:30</BOLD><BR>
--------------------------------<BR>
订单编号ES20231026111444527685<BR>
退单编号ES20231026111444527685<BR>
订单来源:微信小程序<BR>
支付方式:微信支付<BR>
配送来源:顺丰同城<BR>
付款时间2024-10-25 14:00:23<BR>
申请退款2024-10-27 14:05:23<BR>
确认退款2024-10-27 14:8:23<BR>
--------------------------------<BR>
<C>******* 退款商品 ******</C><BR>
--------------------------------<BR>
<L>可口可乐CocaC</L> <L><BOLD> x110 </BOLD></L><L> 8100.45</L><BR>
<L>ola经典美味汽水1.2</L><BR>
<L>5L/瓶</L><BR>
<BOLD>6970448170051</BOLD><BR>
<L>排骨约350g默 </L><L><BOLD> 1 </BOLD></L><L> 150.13 </L><BR>
<L>认砍小块)</L><BR>
<BOLD>6970448170053</BOLD><BR>
--------------------------------<BR>
实付金额:<BOLD>¥428.9元</BOLD><BR>
申请退款:<BOLD>¥32.7</BOLD><BR>
退款方式:<BOLD>仅退款</BOLD><BR>
商家审批备注:<BOLD>商家发货少了</BOLD><BR>
--------------------------------<BR>
<BOLD>会员名称:张三</BOLD><BR>
<BOLD>会员手机13128778765</BOLD><BR>
--------------------------------<BR>
操作员:李小明<BR>
原模版: