diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 1c3cab1..0b00d86 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4434,12 +4434,100 @@ public class ProductService { case "立牌": priceList = getStandingSignPrice(dto, width, length); return chucklePrice(role, priceList, dto); + case "无纺布手提袋": + priceList = getNonwovensPrice(dto, width, length, height); + return chucklePrice(role, priceList, dto); default: break; } return null; } + private List getNonwovensPrice(Product dto, Double width, Double length, Double height) { + 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("JIZHIWUFANGBUDAI"); + requstVo.setPaper(dto.getKind2Value()); + + requstVo.setWidth(width * 10); + requstVo.setHeight(length * 10); + requstVo.setThickness(height * 10); + requstVo.setSizeUnit("MM"); + requstVo.setNum(count); + requstVo.setStyleNum(number); + + requstVo.setPrintSide(1); + + List crafts = new ArrayList<>(); + + if (craft_list.contains("侧面印刷")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("侧面印刷"); + ceCrafts.setParameters(Collections.singletonMap("颜色", "")); + crafts.add(ceCrafts); + } + if (craft_list.contains("单面")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷面"); + ceCrafts.setParameters(Collections.singletonMap("类型", "单色单面")); + crafts.add(ceCrafts); + } + if (craft_list.contains("双面")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷面"); + ceCrafts.setParameters(Collections.singletonMap("类型", "双面不一样")); + crafts.add(ceCrafts); + } + if (craft_list.contains("增加印刷内容颜色")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("增加印刷内容颜色"); + ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getShen_color())); + crafts.add(ceCrafts); + } + if (craft_list.contains("印刷内容颜色")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷内容颜色"); + ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getTcolor())); + crafts.add(ceCrafts); + } + if (craft_list.contains("空白袋")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("空白袋"); + ceCrafts.setParameters(Collections.singletonMap("个数", "")); + crafts.add(ceCrafts); + } + if (craft_list.contains("加暗扣")) { + ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("加暗扣"); + ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getPlantName())); + crafts.add(ceCrafts); + } + + requstVo.setCrafts(crafts); + ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo); + System.out.println(result); + //这个手提袋100-500的价格按照毛率40% 600-1000毛率38% 2000-5000个35% 6000-1w个32% 2w以上按照30% + + double rate = 0.65; + if (count <= 500) { + rate = 0.4; + } else if (count < 1000) { + rate = 0.38; + } else if (count < 5000) { + rate = 0.35; + } else if (count < 10000) { + rate = 0.32; + } else { + rate = 0.3; + } + double price = Math.ceil(result.getData().getPrice() / (1 - rate)); + 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 getStandingSignPrice(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/ShengDaPriceNoPartsRequstVo.java b/src/main/java/lingtao/net/vo/ShengDaPriceNoPartsRequstVo.java index bf0693e..3157a12 100644 --- a/src/main/java/lingtao/net/vo/ShengDaPriceNoPartsRequstVo.java +++ b/src/main/java/lingtao/net/vo/ShengDaPriceNoPartsRequstVo.java @@ -19,6 +19,7 @@ public class ShengDaPriceNoPartsRequstVo { private String doubleSideType; private Double height; private Double width; + private Double thickness; private Integer printSide; private Integer styleNum; } diff --git a/src/main/webapp/views/product/nonwovens.jsp b/src/main/webapp/views/product/nonwovens.jsp new file mode 100644 index 0000000..b4b6645 --- /dev/null +++ b/src/main/webapp/views/product/nonwovens.jsp @@ -0,0 +1,496 @@ +<%@ 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