You've already forked FrameTour-BE
feat(printer): 增加打印任务查询功能并完善商品详情展示
- 在 PrinterMapper 中新增 queryTaskByMpId 方法用于查询打印任务 - 扩展 GoodsDetailVO 类,增加打印机名称和纸张类型字段 - 修改 OrderServiceImpl,在商品列表中设置打印机相关信息 - 更新 PrintTaskResp 类,添加纸张类型属性 - 在 PrinterMapper.xml 中实现 queryTaskByMpId 的 SQL 查询逻辑
This commit is contained in:
@@ -55,4 +55,6 @@ public interface PrinterMapper {
|
|||||||
void updateUserPhotoListToPrinter(Long memberId, Long scenicId, Integer printerId);
|
void updateUserPhotoListToPrinter(Long memberId, Long scenicId, Integer printerId);
|
||||||
|
|
||||||
List<MemberPrintResp> listRelationByOrderId(Long orderId);
|
List<MemberPrintResp> listRelationByOrderId(Long orderId);
|
||||||
|
|
||||||
|
PrintTaskResp queryTaskByMpId(Integer id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ public class GoodsDetailVO {
|
|||||||
private Integer isFree;
|
private Integer isFree;
|
||||||
private Integer parts;
|
private Integer parts;
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
private String printerName;
|
||||||
|
private String printerPaper;
|
||||||
|
|
||||||
@JsonProperty("sourceType")
|
@JsonProperty("sourceType")
|
||||||
public Integer getSourceType() {
|
public Integer getSourceType() {
|
||||||
return goodsType;
|
return goodsType;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ public class PrintTaskResp {
|
|||||||
private Integer printerId;
|
private Integer printerId;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
private String printerName;
|
private String printerName;
|
||||||
|
private String paper;
|
||||||
private String url;
|
private String url;
|
||||||
private Integer width;
|
private Integer width;
|
||||||
private Integer height;
|
private Integer height;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import com.ycwl.basic.dto.MobileOrderRequest;
|
import com.ycwl.basic.dto.MobileOrderRequest;
|
||||||
import com.ycwl.basic.model.pc.source.entity.MemberSourceEntity;
|
import com.ycwl.basic.model.pc.source.entity.MemberSourceEntity;
|
||||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||||
|
import com.ycwl.basic.model.printer.resp.PrintTaskResp;
|
||||||
import com.ycwl.basic.order.dto.PaymentParamsRequest;
|
import com.ycwl.basic.order.dto.PaymentParamsRequest;
|
||||||
import com.ycwl.basic.order.dto.PaymentParamsResponse;
|
import com.ycwl.basic.order.dto.PaymentParamsResponse;
|
||||||
import com.ycwl.basic.pricing.dto.CouponUseRequest;
|
import com.ycwl.basic.pricing.dto.CouponUseRequest;
|
||||||
@@ -351,6 +352,11 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
goods.setScenicId(sourceEntity.getScenicId());
|
goods.setScenicId(sourceEntity.getScenicId());
|
||||||
goods.setTemplateCoverUrl(sourceEntity.getCropUrl());
|
goods.setTemplateCoverUrl(sourceEntity.getCropUrl());
|
||||||
goods.setCreateTime(sourceEntity.getCreateTime());
|
goods.setCreateTime(sourceEntity.getCreateTime());
|
||||||
|
PrintTaskResp printTaskResp = printerMapper.queryTaskByMpId(sourceEntity.getId());
|
||||||
|
if (printTaskResp != null) {
|
||||||
|
goods.setPrinterName(printTaskResp.getPrinterName());
|
||||||
|
goods.setPrinterPaper(printTaskResp.getPaper());
|
||||||
|
}
|
||||||
goodsList.add(goods);
|
goodsList.add(goods);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,9 @@
|
|||||||
FROM member_print p
|
FROM member_print p
|
||||||
WHERE p.id in (select order_item.goods_id from order_item where order_item.order_id = #{orderId} and order_item.goods_type = 3)
|
WHERE p.id in (select order_item.goods_id from order_item where order_item.order_id = #{orderId} and order_item.goods_type = 3)
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryTaskByMpId" resultType="com.ycwl.basic.model.printer.resp.PrintTaskResp">
|
||||||
|
SELECT t.*, p.name as printerName FROM print_task t left join printer p on p.id = t.printer_id WHERE mp_id = #{orderId} order by t.create_time desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<insert id="add">
|
<insert id="add">
|
||||||
|
|||||||
Reference in New Issue
Block a user