zhuyiyi пре 2 месеци
родитељ
комит
41b4f5fba5

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

@@ -818,6 +818,16 @@ public class ProductService {
                         }
                         return priceList;
                     }
+
+                    if (!"7".equals(dto.getKind()) && !"8".equals(dto.getKind()) && !"1".equals(dto.getKind())) {
+                        if ((length < 4 || width < 4)) {
+                            for (int i = 0; i < dto.getCraft().length; i++) {
+                                if ("直角裁切".equals(dto.getCraft()[i])) {
+                                    dto.getCraft()[i] = "模切";
+                                }
+                            }
+                        }
+                    }
                     int min = getNum(length, width);
                     String[] kind_list = {"3", "4", "5", "7"};
                     dto.setD("");
@@ -825,7 +835,7 @@ public class ProductService {
                     boolean isyaofeng = false;
 
                     double moqiePrice = 0;
-                    if ("1".equals(dto.getKind()) && !craft_list.contains("模切") && (craft_list.contains("压痕") || craft_list.contains("压点线"))) {
+                    if (!craft_list.contains("模切") && (craft_list.contains("压痕") || craft_list.contains("压点线"))) {
                         //压1痕最小尺寸10.8*5.4cm,压2痕最小尺寸13.5*5.4CM按照贺卡模切价格算
                         boolean is_moqie = false;
                         if ((craft_list.contains("压痕") && dto.getYaheng() == 1) || (craft_list.contains("压点线") && dto.getDadianxian() == 1)) {
@@ -898,8 +908,14 @@ public class ProductService {
                     }
                     //300克铜版纸 贺卡 优惠券 抽奖券 存酒卡价格重新计算
                     if ((Arrays.asList(kind_list).contains(dto.getKind()) && "2".equals(dto.getKindValue2())) || isyaofeng) {
+                        boolean is_moqie = false;
                         if (dto.getCraft() != null && Arrays.asList(dto.getCraft()).contains("模切")) {
+                            is_moqie = true;
+                        }
+
+                        if (is_moqie) {
                             priceList = getOtherHekaPrice(dto, width, length);
+                            moqiePrice = 0;
                             for (int i = 0; i < dto.getCraft().length; i++) {
                                 if ("模切".equals(dto.getCraft()[i])) {
                                     dto.getCraft()[i] = "";
@@ -4957,7 +4973,7 @@ public class ProductService {
         for (Product product : priceList) {
             product.setWeight(df.format(width / 100 * length / 100 * product.getCount() * 0.48 * 1.4));
             if (carftList.contains("装opp袋")) {
-                product.setPrice(Math.ceil(product.getPrice() + product.getCount() * dto.getNumber() * 0.33));
+                product.setPrice(Math.ceil(product.getPrice() + Math.max(product.getCount() * dto.getNumber() * 0.33, 100)));
             }
         }
         return priceList;
@@ -5114,7 +5130,8 @@ public class ProductService {
         return new ArrayList<>();
     }
 
-    private List<Product> getAreaNextPrice(int[] count_list, int count, double area, double[][] prices, double[] areas, int number) {
+    private List<Product> getAreaNextPrice(int[] count_list, int count, double area, double[][] prices,
+                                           double[] areas, int number) {
         List<Product> priceList = new ArrayList<>();
         for (int i = 0; i < count_list.length; i++) {
             int count_item = count_list[i];

+ 12 - 18
src/main/webapp/views/product/coupon.jsp

@@ -229,7 +229,7 @@
                         </div>
                         <div id="3z_yuan_size" style="display: none">
                             <select name="z3size1" lay-filter="z3size1" class="select">
-<%--                                <option value="8.5*8.5">8.5*8.5 cm</option>--%>
+                                <%--                                <option value="8.5*8.5">8.5*8.5 cm</option>--%>
                                 <option value="9*9">9*9 cm</option>
                             </select>
                         </div>
@@ -456,10 +456,10 @@
                         <p>
                             工艺&nbsp;<span style="font-size:12px;color:red">优惠券异形模切+打码限于简单刀版(无法做圆形  椭圆机)最小9*5.4 300克腰封压1痕最小尺寸10.8*5.4cm,压2痕最小尺寸13.5*5.4CM,低于最小尺寸按异形模切报价</span>
                         </p>
-<%--                        <div class="layui-input-block doublefumo" style="display:inline-block;">--%>
-<%--                            <input type="checkbox" class="ui_double_fm" name="craft" lay-filter="ui_fm" value="双面覆哑膜"--%>
-<%--                                   title="双面覆哑膜">--%>
-<%--                        </div>--%>
+                        <%--                        <div class="layui-input-block doublefumo" style="display:inline-block;">--%>
+                        <%--                            <input type="checkbox" class="ui_double_fm" name="craft" lay-filter="ui_fm" value="双面覆哑膜"--%>
+                        <%--                                   title="双面覆哑膜">--%>
+                        <%--                        </div>--%>
 
                         <div class="layui-input-block craft tj" style="display:inline-block;">
                             <input type="checkbox" name="craft" class="tangjin" lay-filter="switch" value="单面烫金"
@@ -481,7 +481,7 @@
                             <input type="checkbox" name="craft" class="yh disab max ya cjkDisab" lay-filter="switch"
                                    value="压痕" title="压痕">
                             <div class="layui-inline edge yahenHide" style="width:60px; display:none">
-                                <select name="yahen" class="select yahen" lay-filter="yahen">
+                                <select name="yaheng" class="select yahen" lay-filter="yahen">
                                     <option value="1" selected>1</option>
                                     <option value="2">2</option>
                                 </select>
@@ -491,7 +491,7 @@
                                            lay-filter="switch" value="压点线" title="压点线">
 							      </span>
                             <div class="layui-inline edge yadianxianHide" style="width:60px;display:none">
-                                <select name="yadianxian" class="select yadianxian" lay-filter="yadianxian">
+                                <select name="dadianxian" class="select yadianxian" lay-filter="yadianxian">
                                     <option value="1" selected>1</option>
                                     <option value="2">2</option>
                                 </select>
@@ -1528,6 +1528,8 @@
                 $('input[class = mq]').prop('checked', false);
                 $('input[class = mq][value=直角裁切]').prop('checked', true);
                 if (data.value == 0 || data.value == 1) {
+                    $(".count").show();
+                    $(".count").find(":input").attr("disabled", false);
                     $("#kindValueForm")[0].reset();
                     $(".kindValue").show();
                     $(".kindValue").attr("disabled", false);
@@ -2664,17 +2666,9 @@
                             var length = size.split("*")[0];
                             var width = size.split("*")[1];
                             if ($(".yahen").val() == 1) {
-                                if ((length < 10.8 || width < 6) && (length < 6 || width < 10.8)) {
-                                    $('input[class = disab]').prop('checked', false);
-                                    $(".disab").attr("disabled", true);
-                                    $('input[class = mq]').prop('checked', true);
-                                }
+
                             } else {
-                                if ((length < 13.5 || width < 5.4) && (length < 5.4 || width < 13.5)) {
-                                    $('input[class = disab]').prop('checked', false);
-                                    $(".disab").attr("disabled", true);
-                                    $('input[class = mq]').prop('checked', true);
-                                }
+
                             }
                         } else {
                             $(".yahenHide").hide();
@@ -3292,7 +3286,7 @@
                 var w2 = Math.ceil(size.split("*")[0] / 5.4);
                 var min = Math.min(l1 * w1, l2 * w2);
                 if (couponKind == '常用种类') {
-                    if (kind != 7 && kind != 8) {
+                    if (kind ==1) {
                         if ((size.split("*")[0] <= 9 && size.split("*")[1] <= 5.4) || (size.split("*")[0] <= 5.4 && size.split("*")[1] <= 9)) {
                             if ((size.split("*")[0] < 4 || size.split("*")[1] < 4)) {
                                 layer.msg("[ 卡片 ]9*5.4 cm以内,尺寸小于4 cm请以 [ 插卡 - 异形插牌 ] 报价!", {offset: ['300px', '300px']}, function () {