From c25b7f4ee685a3d73818ef7719c9bac7e9996683 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Thu, 23 Jul 2026 15:42:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingtao/net/service/ProductService.java | 64 +++ .../net/vo/ShengDaPriceRequstItemVo.java | 7 + src/main/webapp/views/product/workPermit.jsp | 416 ++++++++++++++++++ 3 files changed, 487 insertions(+) create mode 100644 src/main/webapp/views/product/workPermit.jsp diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 9977115..170fa09 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4618,12 +4618,76 @@ public class ProductService { case "UV磁吸贴": priceList = getMagneticStickerPrice(dto, width, length); return chucklePrice(role, priceList, dto); + case "工作证": + priceList = getWorkPermitPrice(dto, width, length); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getWorkPermitPrice(Product dto, Double width, Double length) { + List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List priceList = new ArrayList<>(); + + int count = dto.getCount(); + int number = dto.getNumber(); + + ShengDaPriceNoPartsRequstVo requstVo = new ShengDaPriceNoPartsRequstVo(); + requstVo.setProductCategory("YAKELIZHENGJIAN"); + if ("1".equals(dto.getKind())) { + requstVo.setPaper("亚克力工作证"); + } + requstVo.setWidth(width * 10); + requstVo.setHeight(length * 10); + requstVo.setSizeUnit("MM"); + requstVo.setNum(count); + requstVo.setStyleNum(number); + + requstVo.setPrintSide(1); + + if (craft_list.contains("双面")) { + requstVo.setPrintSide(2); + requstVo.setDoubleSideType("不同"); + } + List crafts = new ArrayList<>(); + + crafts.add(new ShengDaPriceRequstItemVo("打孔")); + + if (craft_list.contains("背喷全打白")) { + crafts.add(new ShengDaPriceRequstItemVo("背喷全打白")); + } + if (craft_list.contains("背喷彩白打局部")) { + crafts.add(new ShengDaPriceRequstItemVo("背喷彩白打局部")); + } + if (craft_list.contains("镭射膜")) { + crafts.add(new ShengDaPriceRequstItemVo("镭射膜")); + } + if (craft_list.contains("模切") || craft_list.contains("镂空")) { + crafts.add(new ShengDaPriceRequstItemVo("镂空")); + } + if (craft_list.contains("挂绳")) { + ShengDaPriceRequstItemVo baseCrafts = new ShengDaPriceRequstItemVo("挂绳"); + Map map = new HashMap<>(); + map.put("颜色", dto.getShen_color()); + baseCrafts.setParameters(map); + crafts.add(baseCrafts); + } + requstVo.setCrafts(crafts); + ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo); + System.out.println(result); + double price = Math.ceil(result.getData().getPrice() / (1 - 0.65)); + double designPrice = number * 8; + + Product product = new Product(); + product.setPrice(Math.ceil(Math.max(price, 30) + designPrice)); + product.setCount(dto.getCount()); + product.setNumber(dto.getNumber()); + priceList.add(product); + return priceList; + } + private List getMagneticStickerPrice(Product dto, Double width, Double length) { List craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List priceList = new ArrayList<>(); diff --git a/src/main/java/lingtao/net/vo/ShengDaPriceRequstItemVo.java b/src/main/java/lingtao/net/vo/ShengDaPriceRequstItemVo.java index 98482c4..538b441 100644 --- a/src/main/java/lingtao/net/vo/ShengDaPriceRequstItemVo.java +++ b/src/main/java/lingtao/net/vo/ShengDaPriceRequstItemVo.java @@ -7,6 +7,13 @@ import java.util.Map; @Data public class ShengDaPriceRequstItemVo { + public ShengDaPriceRequstItemVo() { + } + + public ShengDaPriceRequstItemVo(String name) { + this.name = name; + } + private String name; private Map parameters; diff --git a/src/main/webapp/views/product/workPermit.jsp b/src/main/webapp/views/product/workPermit.jsp new file mode 100644 index 0000000..fdb282f --- /dev/null +++ b/src/main/webapp/views/product/workPermit.jsp @@ -0,0 +1,416 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + Insert title here + <%@include file="/views/common.jsp" %> + + + +
+
+

工作证

+
+
+ +

+ 材质 +

+
+ +
+ +

+ 尺寸(CM/厘米) +

+
+ +
+

+ 数量(个) +

+
+ +
+

+ 款数 +

+
+ +
+

+ 客户旺旺 +

+
+ +
+

+ 工艺 +

+
+
+ 印面: + + +
+
+ 裁切工艺: + + + +
+
+ 常见工艺: + + +
+
+ 特殊工艺: + +
+
+ 打印效果: + + +
+
+ 配件: + + +
+
+
+ + +
+
+
+ + +
+

计算结果- + +

+
+ + <%@include file="../acountExpressFee.jsp" %> +
+
+
+
+
+
+
+ +
+
+ +<%@include file="/views/copyResult.jsp" %> + + \ No newline at end of file