diff --git a/src/main/java/lingtao/net/service/ProductService.java b/src/main/java/lingtao/net/service/ProductService.java index 88ce561..820b540 100644 --- a/src/main/java/lingtao/net/service/ProductService.java +++ b/src/main/java/lingtao/net/service/ProductService.java @@ -4368,12 +4368,29 @@ public class ProductService { return getYaFenPrice(dto, width, length); case "UV打印亚克力": return getUVDayinYKLPrice(dto, width, length); + case "躺椅": + return getDeckCharitPrice(dto, width, length); default: break; } return null; } + private List getDeckCharitPrice(Product dto, Double width, Double length) { + List craft_lists = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); + List craft_list = new ArrayList<>(craft_lists); + List priceList = new ArrayList<>(); + int count = dto.getCount(); + int number = dto.getNumber(); + Product product = new Product(); + product.setPrice(Math.ceil(150 * count * number)); + product.setCount(dto.getCount()); + product.setNumber(dto.getNumber()); + product.setWeight(df.format(3.3 * count * number)); + priceList.add(product); + return priceList; + } + private List getUVDayinYKLPrice(Product dto, Double width, Double length) { List craft_lists = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft()); List craft_list = new ArrayList<>(craft_lists); @@ -5095,15 +5112,49 @@ public class ProductService { int count = dto.getCount(); int number = dto.getNumber(); double area = length * width / 10000; - if (craft_list.contains("空白") && craft_list.contains("模切")) { - craft_list.add("定制"); - } - priceList = CanopyUtil.getPrice(area, count, priceList, dto.getKindValue(), craft_list); - if (number > 1) { - for (Product product : priceList) { - product.setPrice(Math.floor(product.getPrice() * number)); + Product pro = new Product(); + pro.setCount(count); + pro.setNumber(number); + double price = 0; + if (width == 290 && length == 290) { + price = 250; + if ("黑胶涤纶布".equals(dto.getKindValue())) { + price = price + 10; } + + price = Math.ceil(price * count * number); + } else if ((width == 420 && length == 390) || (length == 420 && width == 390)) { + price = 440; + if ("黑胶涤纶布".equals(dto.getKindValue())) { + price = price + 10; + } + price = Math.ceil(price * count * number); + } else if ((width == 420 && length == 490) || (length == 420 && width == 490)) { + price = 550; + if ("黑胶涤纶布".equals(dto.getKindValue())) { + price = price + 10; + } + price = Math.ceil(price * count * number); + } else { + double basePrice = 0; + if (area <= 4) { + basePrice = 33; + } else if (area <= 6) { + basePrice = 32; + } else if (area <= 9) { + basePrice = 31; + } else { + basePrice = 29; + } + if ("黑胶涤纶布".equals(dto.getKindValue())) { + basePrice = basePrice + 1; + } + price = Math.ceil(basePrice * area * count * number); } + + pro.setPrice(Math.ceil(price)); + priceList.add(pro); + for (Product product : priceList) { if (craft_list.contains("安装包")) { product.setPrice(Math.floor(product.getPrice() + dto.getShuliang() * 50)); @@ -5111,7 +5162,7 @@ public class ProductService { if (craft_list.contains("防风绳")) { product.setPrice(Math.floor(product.getPrice() + dto.getPcount() * 2)); } - product.setWeight(String.valueOf(Double.parseDouble(product.getWeight()) + dto.getShuliang() * 3.3)); + product.setWeight(String.valueOf(area * 0.18 + dto.getShuliang() * 3.3)); } return priceList; @@ -5145,63 +5196,157 @@ public class ProductService { int number = dto.getNumber(); double basePrice = 0; double banfei = 0; - if ("YP".equals(dto.getKindValue())) { - basePrice = 19; - } - if ("XW".equals(dto.getKindValue())) { - basePrice = 31; - } - if ("EP".equals(dto.getKindValue())) { - basePrice = 31; - } - if ("ZT".equals(dto.getKindValue())) { - basePrice = 57; - } - if (!StringUtils.isEmpty(dto.getSize())) { - String[] size_list = dto.getSize().split(","); - for (int i = 0; i < size_list.length; i++) { - double sizePirce = 0; - if ("10*10".equals(size_list[i])) { - sizePirce = 4; - } - if ("15*15".equals(size_list[i])) { - sizePirce = 6; - } - if ("15*20".equals(size_list[i])) { - sizePirce = 8; - } - if ("20*20".equals(size_list[i])) { - sizePirce = 10; - } - if ("25*15".equals(size_list[i])) { - sizePirce = 10; - } - if ("25*25".equals(size_list[i])) { - sizePirce = 12; - } - if ("30*30".equals(size_list[i])) { - sizePirce = 14; - } - if ("30*40".equals(size_list[i])) { - sizePirce = 16; - } - basePrice += sizePirce; + List kindList = Arrays.asList("T恤", "马甲", "工程服"); + + if (kindList.contains(dto.getKindValue())) { + String kind1value = dto.getKind1Value(); + if ("1108T".equals(kind1value)) { + basePrice = 66; + } else if ("2604".equals(kind1value)) { + basePrice = 66; + } else if ("8089".equals(kind1value)) { + basePrice = 88; + } else if ("1101".equals(kind1value)) { + basePrice = 46; + } else if ("1102".equals(kind1value)) { + basePrice = 46; + } else if ("9128".equals(kind1value)) { + basePrice = 72; + } else if ("9129".equals(kind1value)) { + basePrice = 80; + } else if ("9022".equals(kind1value)) { + basePrice = 84; + } else if ("9020".equals(kind1value)) { + basePrice = 84; + } else if ("9008".equals(kind1value)) { + basePrice = 44; + } else if ("9023".equals(kind1value)) { + basePrice = 50; + } else if ("9002".equals(kind1value)) { + basePrice = 48; + } else if ("6010A".equals(kind1value)) { + basePrice = 122; + } else if ("6016".equals(kind1value)) { + basePrice = 106; + } else if ("5608XM".equals(kind1value)) { + basePrice = 140; + } else if ("5608K".equals(kind1value)) { + basePrice = 90; + } else if ("903".equals(kind1value)) { + basePrice = 58; + } else if ("901".equals(kind1value)) { + basePrice = 100; + } + double craftPrice = 0; + if (craft_list.contains("烫画")) { + if (craft_list.contains("前胸")) { + craftPrice += Math.max(5, 3 * dto.getCount() * number); + if (dto.getCount() * number > 5) { + craftPrice = 0; + } + } + if (craft_list.contains("后背")) { + craftPrice += Math.max(10, 5 * dto.getCount() * number); + if (dto.getCount() * number > 10) { + craftPrice = 0; + } + } + } + if (craft_list.contains("刺绣")) { + if (craft_list.contains("前胸")) { + craftPrice += Math.max(30, 3 * dto.getCount() * number); + if (dto.getCount() * number > 15) { + craftPrice = 0; + } + } + if (craft_list.contains("后背")) { + craftPrice += Math.max(50, 6 * dto.getCount() * number); + if (dto.getCount() * number > 20) { + craftPrice = 0; + } + } + } + if (craft_list.contains("丝印")) { + if (craft_list.contains("前胸")) { + craftPrice += Math.max(80, 2 * dto.getCount() * number); + if (dto.getCount() * number > 100) { + craftPrice = 0; + } + } + if (craft_list.contains("后背")) { + craftPrice += Math.max(100, 2 * dto.getCount() * number); + if (dto.getCount() * number > 100) { + craftPrice = 0; + } + } } - } - if (dto.getPo_number() != null && dto.getCo_number() != null) { - if (dto.getPo_number() > 0 || dto.getCo_number() > 0) { - basePrice += dto.getPo_number() * 4 * dto.getCo_number(); - banfei = dto.getPo_number() * 40 * dto.getCo_number(); - } - } - count = dto.getCount(); + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.ceil(basePrice * count * number) + craftPrice); + priceList.add(pro); + + } else { + if ("YP".equals(dto.getKindValue())) { + basePrice = 19; + } + if ("XW".equals(dto.getKindValue())) { + basePrice = 31; + } + if ("EP".equals(dto.getKindValue())) { + basePrice = 31; + } + if ("ZT".equals(dto.getKindValue())) { + basePrice = 57; + } + if (!StringUtils.isEmpty(dto.getSize())) { + String[] size_list = dto.getSize().split(","); + for (int i = 0; i < size_list.length; i++) { + double sizePirce = 0; + if ("10*10".equals(size_list[i])) { + sizePirce = 4; + } + if ("15*15".equals(size_list[i])) { + sizePirce = 6; + } + if ("15*20".equals(size_list[i])) { + sizePirce = 8; + } + if ("20*20".equals(size_list[i])) { + sizePirce = 10; + } + if ("25*15".equals(size_list[i])) { + sizePirce = 10; + } + if ("25*25".equals(size_list[i])) { + sizePirce = 12; + } + if ("30*30".equals(size_list[i])) { + sizePirce = 14; + } + if ("30*40".equals(size_list[i])) { + sizePirce = 16; + } + + basePrice += sizePirce; + } + + } + if (dto.getPo_number() != null && dto.getCo_number() != null) { + if (dto.getPo_number() > 0 || dto.getCo_number() > 0) { + basePrice += dto.getPo_number() * 4 * dto.getCo_number(); + banfei = dto.getPo_number() * 40 * dto.getCo_number(); + } + } + count = dto.getCount(); + + Product pro = new Product(); + pro.setCount(count); + pro.setPrice(Math.max(basePrice * count * number, 30) + banfei); + priceList.add(pro); + } - Product pro = new Product(); - pro.setCount(count); - pro.setPrice(Math.max(basePrice * count * number, 30) + banfei); - priceList.add(pro); return priceList; } diff --git a/src/main/webapp/views/product/canopy.jsp b/src/main/webapp/views/product/canopy.jsp index b952da1..847a12a 100644 --- a/src/main/webapp/views/product/canopy.jsp +++ b/src/main/webapp/views/product/canopy.jsp @@ -38,7 +38,7 @@

@@ -61,35 +61,35 @@ class="layui-input" lay-verify="number">

- 安装包(五件套)伸缩杆:直径2.5厘米2根 (2.4米/根)、防风绳: 4米固定8条、地钉: 8颗、D扣:(车间车在各个吊耳上面)、安装包 + 安装包(五件套)伸缩杆:直径2.5厘米2根、防风绳: 4米固定8条、地钉: 8颗、三角扣:(车间车在各个吊耳上面)、安装包

-
+
+ 配件: - -
-

- 印刷印刷内容空白 工艺是模切的话 文件名要备注定制 -

-
- - -
+ <%--

--%> + <%-- 印刷 + <%-- style="font-size:14px;color:red">印刷内容空白 工艺是模切的话 文件名要备注定制--%> + <%--

--%> + <%--
--%> + <%-- --%> + <%-- --%> + <%--
--%>

工艺

- - - + +

@@ -207,14 +207,14 @@ }); return false; } - const carft2 = carft_list2.filter(craft => craft_list.includes(craft)); - if (carft2.length > 1) { - $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox"); - $(data.elem).prop("checked", false); - layer.msg('防风绳-安装包不能同时选择!', {offset: ['300px', '300px']}, function () { - }); - return false; - } + // const carft2 = carft_list2.filter(craft => craft_list.includes(craft)); + // if (carft2.length > 1) { + // $(data.elem).next().attr("class", "layui-unselect layui-form-checkbox"); + // $(data.elem).prop("checked", false); + // layer.msg('防风绳-安装包不能同时选择!', {offset: ['300px', '300px']}, function () { + // }); + // return false; + // } if (data.value == '安装包') { if (data.elem.checked) { $("#shuliang").css("display", "flex"); @@ -242,10 +242,15 @@ let size = $("#size").val(); let count = $("#count").val(); - let craftys = $("input[name='craftys']:checked").val(); + let craft_list = []; + $("input[name='craft']:checked").each(function () { + if (!$(this).is("disabled")) { + craft_list.push($(this).val()) + } + }) let shuliang = $("input[name='shuliang']").val(); - if (craftys == '五件套' && shuliang == 0) { - layer.msg('请输入五件套数量!', {offset: ['300px', '300px']}, function () { + if (craft_list.includes("安装包") && shuliang == 0) { + layer.msg('请输入安装包数量!', {offset: ['300px', '300px']}, function () { }); return false; } @@ -285,11 +290,8 @@ let data = result.data.proList; let kind = $("select[name='kindValue'] option:selected").val(); let number = $("#number").val(); - let craftQie = $("input[name='craftQie']:checked").val(); - let craftShua = $("input[name='craftShua']:checked").val(); let shuliang = $("input[name='shuliang']").val() || 0; let pcount = $("input[name='pcount']").val() || 0; - let craftys = $("input[name='craftys']:checked").val(); $("input[name='craft']:checked").each(function () { if (!$(this).is("disabled")) { if ($(this).val() == "安装包") { @@ -303,13 +305,6 @@ }) let span_result = kind + ' - ' + size + ' 厘米 -(同款内容)\n' + "工艺 :" + arr.join(",") + "\n"; - if (craftys) { - span_result += "配件:" + craftys - if (shuliang > 0) { - span_result += shuliang + "套"; - } - span_result += "\n" - } if (number > 1) { for (let i = 0; i < data.length; i++) { diff --git a/src/main/webapp/views/product/clothes.jsp b/src/main/webapp/views/product/clothes.jsp index d83f3f9..e18b1cd 100644 --- a/src/main/webapp/views/product/clothes.jsp +++ b/src/main/webapp/views/product/clothes.jsp @@ -26,14 +26,13 @@ 型号

- - - - + + + + + + +

材质 @@ -43,15 +42,18 @@

-

- 款式 -

-
- - +
+

+ 款式 +

+
+ + +
+

尺码

@@ -97,13 +99,13 @@
- -

- 工艺印花最大尺寸32*40CM -

-
- -