zhuyiyi 7 months ago
parent
commit
f929755e73

+ 10 - 20
src/main/java/lingtao/net/service/ProductService.java

@@ -676,15 +676,19 @@ public class ProductService {
                     int tempNumber = dto.getNumber();
                     List<String> craftList = null;
                     if (!StringUtils.isEmpty(dto.getCraft())) {
-                        craftList = Arrays.asList(dto.getCraft());
+                        craftList = new ArrayList<>(Arrays.asList(dto.getCraft()));
                     }
+                    Boolean isMq = false;
                     if (craftList.contains("模切")) {
                         dto.setNumber(1);
+                        isMq = true;
                     }
                     priceList = new CouponPrice().getCouponPrice(min, dto, priceList, count, craftList);
+                    craftList.remove("模切");
+                    dto.setCraft(craftList.toArray(new String[craftList.size()]));
                     //getCraft(dto, priceList, length * 10, width * 10, min);
 
-                    if (craftList.contains("模切")) {
+                    if (isMq) {
                         for (Product product : priceList) {
                             product.setPrice(Math.floor(product.getPrice() * tempNumber));
                             product.setWeight(df.format(number * length / 100 * width / 100 * product.getCount() * 0.3 * 0.86));
@@ -793,7 +797,7 @@ public class ProductService {
                         double w1 = Math.ceil(width / 28.5);
                         double l2 = Math.ceil(width / 21);
                         double w2 = Math.ceil(length / 28.5);
-                        min = (int) Math.min(l1 * w1, l2 * w2);
+                        //min = (int) Math.min(l1 * w1, l2 * w2);
 
                         int[][] prices = {
                                 {245, 580, 798, 1100, 1425},
@@ -854,9 +858,9 @@ public class ProductService {
                             Product product = new Product();
                             product.setCount(item_count);
                             product.setPrice(Math.ceil((price + carft_price) * number));
-                            priceList.add(product);
+//                            priceList.add(product);
                         }
-                        return priceList;
+//                        return priceList;
                     }
                     priceList = getHekaPrice(min, dto, priceList, count);
                     getCraft(dto, priceList, length * 10, width * 10, min);
@@ -2326,7 +2330,7 @@ public class ProductService {
                         }
                     } else {
                         for (Product product : priceList) {
-                            product.setPrice(product.getPrice() + number);
+                            product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
                         }
                     }
 //                    double base = number < 6 && number > 1 ? 5 : 0;
@@ -2342,20 +2346,6 @@ public class ProductService {
 
                     area = length * width * count / 10000;
 
-                    // 根据款数重新算价格
-//				if (number > 1) {
-//					for (Product product : priceList) {
-//						if (area <= 0.005) {
-//							if (count <= 5) {
-//								product.setPrice(Math.ceil(product.getPrice()) + 5 * number);
-//							} else {
-//								product.setPrice(Math.ceil(product.getPrice() * number));
-//							}
-//						} else {
-//							product.setPrice(Math.ceil(product.getPrice() * number));
-//						}
-//					}
-//				}
                     /*
                      * List<Product> priceList2 = new PriceUtils().UVStickerLessPrice(length, width, count, number, dto.getCraft()); // 比较哪个便宜 if ((priceList.get(0).getPrice() > priceList2.get(0).getPrice()) && priceList2.get(0).getPrice() > 0) { // Double minPrice = Math.min(priceList.get(0).getPrice(), // priceList2.get(0).getPrice()); priceList = new ArrayList<Product>(); Product product = new Product(); product.setCount(count); product.setPrice(priceList2.get(0).getPrice());
                      * product.setMsg("大张出货(2-3天发货)"); priceList.add(product); return priceList; }

+ 30 - 0
src/main/webapp/views/product/metal.jsp

@@ -109,6 +109,20 @@
                 <input type="text" placeholder="请输入整数" autocomplete="off" name="number" id="number" value="1"
                        class="layui-input" lay-verify="number">
             </div>
+            <div class="layui-form-item" id="ui_des" style="display:none;">
+                <p>
+                    设计内容
+                </p>
+                <select name="desType" lay-filter="desType" id="desType" class="select" lay-search>
+                    <option value=""></option>
+                    <option value="1">改序号</option>
+                    <option value="2">改名字</option>
+                    <option value="3">改二维码</option>
+                    <option value="4">改图片</option>
+                    <option value="5">改内容模板相同</option>
+                    <option value="6" selected>改内容模板完全不同</option>
+                </select>
+            </div>
             <p>
                 客户旺旺
             </p>
@@ -191,6 +205,16 @@
         var carousel = layui.carousel;
         var table = layui.table;
 
+        $("#number").on("input", function (e) {
+            var number = e.delegateTarget.value;
+            var kind = $("input[name='kind']:checked").val();
+            if (kind == "UV转印贴" && number > 1) {
+                $("#ui_des").show();
+            } else {
+                $("#ui_des").hide();
+            }
+        });
+
         function getProductImage() {
             var html = " ";
             var remark = " ";
@@ -247,6 +271,7 @@
         })
         form.on('radio(kind)', function (kindData) {
             getProductImage()
+            $("#ui_des").hide();
             if (kindData.value == "金属标") {
                 // 切换为品种单选框
                 $(".metal").show();
@@ -265,6 +290,9 @@
                 $(".count").find(":input").attr("disabled", false);
                 $(".metal").hide();
                 $(".metal").find(":input").attr("disabled", true);
+                if ($("#number").val() > 1) {
+                    $("#ui_des").show();
+                }
             }
             form.render();//必须写
         })
@@ -373,6 +401,8 @@
                     } else {
                         var span_result = 'UV转印贴 - ' + craftShua + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n';
                         if (number > 1) {
+                            let numberType = $("#desType option:selected").text();
+                            span_result += "款数:" + number + "-" + numberType + "\n";
                             for (let i = 0; i < data.length; i++) {
                                 span_result += number + '款 各' + data[i].count + "个,共" + data[i].price + "元" + '\n'
                                 data[i].number = number;

+ 4 - 0
src/main/webapp/views/product/stickers.jsp

@@ -1708,6 +1708,9 @@
                             craft_list.push($("input[name='craftQieType']:checked").val())
                         }
                         var yaqian = ''
+                        if ($("input[name='yinbai']:checked").val() != "") {
+                            yaqian = $("input[name='yinbai']:checked").val();
+                        }
                         if (stickerKind == "插旗") {
                             if ($("input[name='craft']:checked").val() != null) {
                                 yinbai = $("input[name='craft']:checked").val() + ":6*18毫米";
@@ -1718,6 +1721,7 @@
                         craft_list.push(...craftMo)
                         craft_list.push(...aotu)
                         craft_list.push(...tangjin)
+                        craft_list.push(...yinbai)
                         craftList = craftMo + aotu + tangjin + yinbai;
                     }
                     if ($("input[name='craftPai']:checked").val() != "") {