zhuyiyi 6 月之前
父节点
当前提交
2aa81bb41a

+ 56 - 3
src/main/java/lingtao/net/service/ProductService.java

@@ -2375,6 +2375,59 @@ public class ProductService {
                         }
                     }
                 } else if ("UV转印贴".equals(dto.getKind())) {
+                    List<String> craft_list = dto.getCraft() == null ? null : Arrays.asList(dto.getCraft());
+                    if (dto.getCraft() != null && craft_list.size() > 0 && (craft_list.contains("冷转印") || craft_list.contains("烫画"))) {
+                        int[] quantitySteps = {10, 20, 30, 50, 100, 200, 300, 400, 500, 800, 1000, 2000, 3000, 5000, 10000, 20000, 30000, 40000, 50000};
+                        double paperLength = 0, paperWidth = 0;
+                        length += 0.6;
+                        width += 0.6;
+                        if (craft_list.contains("冷转印")) {
+                            paperLength = 20;
+                            paperWidth = 27;
+                        }
+                        if (craft_list.contains("烫画")) {
+                            paperLength = 100;
+                            paperWidth = 57;
+                        }
+                        //一张大纸能放几个
+                        double num = Math.max(Math.ceil(paperLength / length) * Math.ceil(paperWidth / width), Math.ceil(paperLength / width) * Math.ceil(paperWidth / length));
+
+
+                        double baseCount = Math.max(Math.ceil(dto.getCount() * dto.getNumber() / num), 1);
+                        int coNumber = dto.getCo_number();
+                        if (coNumber <= 0) {
+                            coNumber = 1;
+                        }
+
+                        double price = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber);
+
+                        Product pro = new Product();
+                        pro.setCount(dto.getCount());
+                        pro.setPrice(price);
+                        priceList.add(pro);
+                        for (int i = 0; i < quantitySteps.length; i++) {
+                            if (dto.getCount() >= quantitySteps[i]) {
+                                continue;
+                            }
+                            if (priceList.size() >= 4) {
+                                break;
+                            }
+                            baseCount = Math.max(Math.ceil(quantitySteps[i] * dto.getNumber() / num), 1);
+                            double currentPrice = new PriceUtils().CalculatePrice(craft_list, baseCount, coNumber);
+
+                            pro = new Product();
+
+                            pro.setCount(quantitySteps[i]);
+                            pro.setPrice(currentPrice);
+                            priceList.add(pro);
+                        }
+
+                        for (Product product : priceList) {
+                            product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
+                        }
+
+                        return priceList;
+                    }
                     if (length <= 2) {
                         length = 2.0;
                     }
@@ -5349,11 +5402,11 @@ public class ProductService {
             }
             if (craftList.contains("打码")) {
                 double danjia = 0.0;
-                // 5000张以上,一张5
+                // 5000张以上,一张10
                 if (dto.getCount() > 5000) {
-                    danjia = 0.04;
+                    danjia = 0.1;
                 } else {
-                    danjia = 0.04;
+                    danjia = 0.1;
                 }
                 if ("上下编码".equals(dto.getBianma())) {
                     for (Product product : priceList) {

+ 19 - 0
src/main/java/lingtao/net/util/PriceUtils.java

@@ -3439,4 +3439,23 @@ public class PriceUtils {
         }
         return price;
     }
+
+    public double CalculatePrice(List<String> craft_list, double count, int coNumber) {
+        if (craft_list.contains("烫画")) {
+            return (int) count * 120;
+        }
+        double price = 0;
+        if (craft_list.contains("冷转印")) {
+            if (count <= 5) {
+                price = 260;
+            } else if (count < 100) {
+                price = 12 * count + 200;
+            } else {
+                price = 14 * count;
+            }
+            price = price + (coNumber - 1) * 100;
+        }
+
+        return price;
+    }
 }

+ 3 - 4
src/main/webapp/views/main.jsp

@@ -428,9 +428,7 @@
             <!--向上轮播-->
             <div class="swiper" style="height: 100%;width: 800px;">
                 <div class="swiper-wrapper">
-                    <div class="swiper-slide" data-swiper-autoplay="10000">【新增】金属标-UV转印贴-添加烫金工艺</div>
-                    <div class="swiper-slide" data-swiper-autoplay="10000">【新增】卡片-腰封-吸管套-添加250克牛皮纸</div>
-                    <div class="swiper-slide" data-swiper-autoplay="10000">【调整】不干胶-不干胶-隐藏双面印不干胶选项</div>
+                    <div class="swiper-slide" data-swiper-autoplay="10000">【新增】不干胶新增划线工艺 客户需要划线工艺的  划线工艺必选</div>
                 </div>
             </div>
         </div>
@@ -438,7 +436,8 @@
             .swiper-slide {
                 color: orange;
                 display: flex;
-                font-size: 16px;
+                font-weight: bold;
+                font-size: 20px;
                 align-items: center;
                 justify-content: center;
             }

+ 58 - 5
src/main/webapp/views/product/metal.jsp

@@ -9,6 +9,9 @@
 </head>
 <!-- 金属标 -->
 <style>
+    #sehu_number .layui-form-select .layui-edge {
+        right: 0;
+    }
 </style>
 <body>
 <div class="big_box">
@@ -134,6 +137,10 @@
                 <p>
                     工艺
                 </p>
+                <div class="layui-form-item">
+                    <input type="radio" name="craftQie" calss="moqie" value="模切" lay-skin="primary" title="模切"
+                           checked="checked">
+                </div>
                 <div class="layui-form-item">
                     <input type="checkbox" name="craft" lay-filter="craftZhuan" value="专金" title="专金"
                            class="craftZhuan">
@@ -163,8 +170,22 @@
                            class="craftZhuan">
                 </div>
                 <div class="layui-form-item">
-                    <input type="radio" name="craftQie" calss="moqie" value="模切" lay-skin="primary" title="模切"
-                           checked="checked">
+                    <input type="checkbox" name="craft" lay-filter="craftZhuan" value="烫画" title="烫画"
+                           class="craftZhuan">
+                    <input type="checkbox" name="craft" lay-filter="craftZhuan" value="冷转印" title="冷转印"
+                           class="craftZhuan">
+                    <span id="sehu_number" style="display:none">
+                        <span>色数:</span>
+                        <div class="layui-inline" style="width:60px;">
+                            <select name="co_number" class="select">
+                                <option value="1" selected>1</option>
+                                <option value="2">2</option>
+                                <option value="3">3</option>
+                                <option value="4">4</option>
+                                <option value="5">5</option>
+                            </select>
+                        </div>
+                    </span>
                 </div>
             </div>
             <div class="layui-form-item">
@@ -323,6 +344,13 @@
                 layer.msg('[专金 - 专银]不能同时选择!', {offset: ['300px', '300px']}, {icon: 5});
                 return false;
             }
+            if (data.value == "冷转印") {
+                if ($(data.elem).is(":checked")) {
+                    $("#sehu_number").show();
+                } else {
+                    $("#sehu_number").hide();
+                }
+            }
             getProductImage()
         })
 
@@ -363,16 +391,36 @@
                     return false;
                 }
             } else {
-                if ((size.split("*")[0] > 500 || size.split("*")[1] > 58) && (size.split("*")[0] > 58 || size.split("*")[1] > 500)) {
+                if (craftShua != "" && craftShua != "烫画" && (size.split("*")[0] > 500 || size.split("*")[1] > 58) && (size.split("*")[0] > 58 || size.split("*")[1] > 500)) {
                     layer.msg("【UV转印贴】尺寸不能超过500*58 cm", {offset: ['300px', '300px']}, function () {
                     });
                     return false;
                 }
-                if (craftShua != "" && craftShua != "双面贴" && (size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[0] > 28.5 || size.split("*")[1] > 42)) {
+                if (craftShua != "" && craftShua == "冷转印" && (size.split("*")[0] > 20 || size.split("*")[1] > 27) && (size.split("*")[0] > 27 || size.split("*")[1] > 20)) {
+                    layer.msg("【UV转印贴】冷转印工艺尺寸不能超过20*27 cm", {offset: ['300px', '300px']}, function () {
+                    });
+                    return false;
+                }
+                if (craftShua != "" && craftShua == "烫画" && (size.split("*")[0] > 100 || size.split("*")[1] > 57) && (size.split("*")[0] > 57 || size.split("*")[1] > 100)) {
+                    layer.msg("【UV转印贴】烫画工艺尺寸不能超过100*57 cm", {offset: ['300px', '300px']}, function () {
+                    });
+                    return false;
+                }
+                if (craftShua != "" && craftShua != "双面贴" && craftShua != "烫画" && craftShua != "冷转印" && (size.split("*")[0] > 42 || size.split("*")[1] > 28.5) && (size.split("*")[0] > 28.5 || size.split("*")[1] > 42)) {
                     layer.msg("【UV转印贴】带工艺尺寸不能超过42*28.5 cm", {offset: ['300px', '300px']}, function () {
                     });
                     return false;
                 }
+                if (craftShua != "" && craftShua == "冷转印" && (size.split("*")[0] < 0.3 || size.split("*")[1] < 0.3)) {
+                    layer.msg("【UV转印贴】冷转印工艺尺寸不能小于0.3*0.3 cm", {offset: ['300px', '300px']}, function () {
+                    });
+                    return false;
+                }
+                if (craftShua != "" && craftShua == "烫画" && (size.split("*")[0] < 0.3 || size.split("*")[1] < 0.3)) {
+                    layer.msg("【UV转印贴】烫画工艺尺寸不能小于0.3*0.3 cm", {offset: ['300px', '300px']}, function () {
+                    });
+                    return false;
+                }
             }
             $.ajax({
                 url: "${path}/getThanSum",
@@ -399,7 +447,12 @@
                             }
                         }
                     } else {
-                        var span_result = 'UV转印贴 - ' + craftShua + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n';
+                        if (craftShua.includes("冷转印")) {
+                            let co_count = $("select[name='co_number'] option:selected").val();
+                            craftShua.push(co_count + "色数");
+                        }
+                        craftShua = craftShua.filter(item => item !== null && item != "");
+                        var span_result = 'UV转印贴 - ' + craftShua.join(" - ") + ' - ' + size + '厘米 -(同款内容) - ' + [data[0].msg] + '\n';
                         if (number > 1) {
                             let numberType = $("#desType option:selected").text();
                             span_result += "款数:" + number + "-" + numberType + "\n";