修改打印

This commit is contained in:
韩鹏辉
2024-06-26 11:12:28 +08:00
parent 82935827f5
commit 3668252207
5 changed files with 61 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import com.chaozhanggui.system.cashierservice.entity.po.OrderPo;
import com.chaozhanggui.system.cashierservice.entity.po.SkuInfoPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@@ -42,4 +43,6 @@ public interface TbOrderInfoMapper {
Map<String,String> selectByOrderId(String orderId);
List<SkuInfoPo> selectSkuByOrderId(String orderId);
}

View File

@@ -4,6 +4,7 @@ import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class OrderPo {
@@ -21,5 +22,9 @@ public class OrderPo {
private Integer productNum;
private BigDecimal orderAmount;
private TbOrderDetail orderDetail;
private String outNumber;
private String tableName;
private List<SkuInfoPo> skuInfos;
}

View File

@@ -0,0 +1,12 @@
package com.chaozhanggui.system.cashierservice.entity.po;
import lombok.Data;
@Data
public class SkuInfoPo {
private String productName;
private String productSkuName;
private Integer num;
private String categoryId;
}

View File

@@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.po.CartPo;
import com.chaozhanggui.system.cashierservice.entity.po.OrderPo;
import com.chaozhanggui.system.cashierservice.entity.po.ProductSkuPo;
import com.chaozhanggui.system.cashierservice.entity.po.QueryCartPo;
import com.chaozhanggui.system.cashierservice.entity.po.*;
import com.chaozhanggui.system.cashierservice.entity.vo.CartVo;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
@@ -718,6 +715,14 @@ public class OrderService {
if (StringUtils.isEmpty(orderInfo.getImgUrl())) {
orderInfo.setImgUrl("https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20240223/a04e0d3beef74d099ebd0fd1f7c41873.jpg");
}
List<SkuInfoPo> skuInfoPos=tbOrderInfoMapper.selectSkuByOrderId(orderInfo.getId().toString());
if(Objects.isNull(skuInfoPos)||skuInfoPos.size()<0){
skuInfoPos=new ArrayList<>();
}
orderInfo.setSkuInfos(skuInfoPos);
orderInfo.setZdNo("POS");
orderInfo.setNames(orderInfo.getProductName().split(","));
}