From 4888ef96061e19769427bf52b0a644da7910331e Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Fri, 18 Jul 2025 16:31:56 +0800
Subject: [PATCH] feat(clothes): 添加服装打印相关功能
---
src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java | 67 +++++++++++++++++++++++++++++++++
1 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java b/src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java
index 182908d..7aa560b 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java
@@ -20,11 +20,17 @@
import cc.mrbird.febs.mall.dto.clothes.*;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.service.ClothesTypeService;
+import cc.mrbird.febs.mall.vo.clothes.AdminClothesPrintLocationVo;
+import cc.mrbird.febs.mall.vo.clothes.AdminClothesPrintMemberStatureVo;
+import cc.mrbird.febs.mall.vo.clothes.AdminClothesPrintOrderVo;
+import cc.mrbird.febs.mall.vo.clothes.AdminClothesPrintPatternVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSON;
+import cn.hutool.json.JSONUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -38,6 +44,7 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
+import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
@@ -343,6 +350,66 @@
return clothesTypeService.printOrder(dto);
}
+ public static void main(String[] args) {
+ AdminClothesPrintOrderVo vo = new AdminClothesPrintOrderVo();
+ vo.setOrderNo("20201201");
+ vo.setTypeName("T恤");
+ vo.setTypeFront("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/1752740706568ab67808fb49940a7930b9e0ab0793238.png");
+ vo.setTypeBack("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/1752740734639227e7f5a0f3a4de097a2785305bff825.png");
+ vo.setClothName("棉");
+ vo.setClothCode("TX");
+ vo.setSizeName("XL");
+ vo.setSizeCode("XL");
+ vo.setArtName("印花");
+ vo.setArtCode("C");
+ List<AdminClothesPrintPatternVo> patterns = new ArrayList<>();
+ AdminClothesPrintPatternVo pattern = new AdminClothesPrintPatternVo();
+ pattern.setPatternName("胸口");
+ pattern.setPatternCode("front-one");
+ pattern.setPatternText("胸口");
+ pattern.setPatternImage("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/17527407868773d1ad92c4c2e454396a6fc051c2219bc.png");
+ patterns.add(pattern);
+
+ AdminClothesPrintPatternVo pattern1 = new AdminClothesPrintPatternVo();
+ pattern1.setPatternName("左下");
+ pattern1.setPatternCode("front-two");
+ pattern1.setPatternText("左下");
+ pattern1.setPatternImage("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/17527407868773d1ad92c4c2e454396a6fc051c2219bc.png");
+ patterns.add(pattern1);
+ AdminClothesPrintPatternVo pattern2 = new AdminClothesPrintPatternVo();
+ pattern2.setPatternName("袖口");
+ pattern2.setPatternCode("front-three");
+ pattern2.setPatternText("袖口");
+ pattern2.setPatternImage("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/17527407868773d1ad92c4c2e454396a6fc051c2219bc.png");
+ patterns.add(pattern2);
+ vo.setPatterns( patterns);
+
+ List<AdminClothesPrintLocationVo> locations = new ArrayList<>();
+ AdminClothesPrintLocationVo location = new AdminClothesPrintLocationVo();
+ location.setLocationName("后背");
+ location.setLocationCode("back-one");
+ location.setLocationText("后背");
+ location.setLocationImage("https://excoin.oss-cn-hangzhou.aliyuncs.com/clothes/17527407868773d1ad92c4c2e454396a6fc051c2219bc.png");
+ locations.add(location);
+ vo.setLocations(locations);
+
+ AdminClothesPrintMemberStatureVo adminClothesPrintMemberStatureVo = new AdminClothesPrintMemberStatureVo();
+ adminClothesPrintMemberStatureVo.setName("会员身高");
+ adminClothesPrintMemberStatureVo.setHeightLine(new BigDecimal("170"));
+ adminClothesPrintMemberStatureVo.setBustLine(new BigDecimal("90"));
+ adminClothesPrintMemberStatureVo.setWaistLine(new BigDecimal("80"));
+ adminClothesPrintMemberStatureVo.setWideLine(new BigDecimal("100"));
+ adminClothesPrintMemberStatureVo.setHipLine(new BigDecimal("100"));
+ vo.setMemberStature(adminClothesPrintMemberStatureVo);
+
+
+ //将vo转换成json字符串
+ JSON parse = JSONUtil.parse(vo);
+ System.out.println(parse.toString());
+
+
+ }
+
/**
* 订单列表-修改物流编号
*/
--
Gitblit v1.9.1