Browse Source

添加重量。修改扇子异形工艺

zhuyiyi 4 months ago
parent
commit
28d4b5682a

+ 24 - 7
src/main/java/lingtao/net/service/ProductService.java

@@ -2578,6 +2578,7 @@ public class ProductService {
 
                         for (Product product : priceList) {
                             product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
+                            product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
                         }
 
                         return priceList;
@@ -2606,9 +2607,9 @@ public class ProductService {
                         }
                     }
 //                    double base = number < 6 && number > 1 ? 5 : 0;
-//                    for (Product product : priceList) {
-//                        product.setPrice(product.getPrice() + base);
-//                    }
+                    for (Product product : priceList) {
+                        product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
+                    }
 
                     /* } */
 
@@ -3515,7 +3516,14 @@ public class ProductService {
                 for (Product product : priceList) {
                     product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple()));
                 }
-
+                if (!StringUtils.isEmpty(dto.getCraft())) {
+                    List<String> craftList = Arrays.asList(dto.getCraft());
+                    if (craftList.contains("异形")) {
+                        for (Product product : priceList) {
+                            product.setPrice(Math.floor(product.getPrice() * 1.2));
+                        }
+                    }
+                }
                 // 异形工艺
                 //getCraft(dto, priceList, null, null, 0);
 
@@ -3530,7 +3538,7 @@ public class ProductService {
                     product.setPrice(Math.floor(product.getPrice() * number));
                 }
                 // 根据款数重新算重量(重量在数据库中)
-                if (!StringUtils.isEmpty(priceList.get(0).getWeight())) {
+                if (priceList.size() > 0 && !StringUtils.isEmpty(priceList.get(0).getWeight())) {
                     for (Product product : priceList) {
                         product.setWeight(df.format(Double.valueOf(product.getWeight()) * number));
                     }
@@ -4712,7 +4720,12 @@ public class ProductService {
                 count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000};
                 areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150};
                 area = length * width;
-                return getAreaCenterPrice(count_list, count, area, prices, areas, number);
+                priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
+                for (Product product : priceList) {
+                    product.setWeight(df.format(width / 100 * length / 100 * product.getCount() * 0.48 * 1.4));
+                }
+
+                return priceList;
             case "澜达海报":
                 //铜版纸200g (售价)
                 prices = new int[][]{
@@ -4825,7 +4838,11 @@ public class ProductService {
             int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000};
             double[] areas = new double[]{16, 25, 30.25, 36, 42.25, 49, 56.25, 64, 72.25, 81, 90.25, 100, 110.25, 121};
             double area = length * width;
-            return getAreaCenterPrice(count_list, count, area, prices, areas, number);
+            List<Product> productList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
+            for (Product product : productList) {
+                product.setWeight(df.format(product.getCount() / (product.getCount() / (width * length / 10000) / 0.76 / 1.47) * product.getCount()));
+            }
+            return productList;
         }
         return new ArrayList<>();
     }

+ 2 - 2
src/main/webapp/views/product/coupon.jsp

@@ -542,8 +542,8 @@
                         <span class="tj">
                             <input type="checkbox" name="craft" lay-filter="switchCraft" value="烫金" title="烫金"
                                    lay-skin="primary" class="tjCraft">
-                            <input type="checkbox" name="craft" lay-filter="switchCraft" value="彩色印刷+烫金"
-                                   title="彩色印刷+烫金" lay-skin="primary" class="tjCraft">
+<%--                            <input type="checkbox" name="craft" lay-filter="switchCraft" value="彩色印刷+烫金"--%>
+<%--                                   title="彩色印刷+烫金" lay-skin="primary" class="tjCraft">--%>
                         </span>
                     </div>
                 </form>

+ 10 - 9
src/main/webapp/views/product/fan.jsp

@@ -163,17 +163,18 @@
         //建造实例
         ins = carousel.render({});
 
-        form.on('checkbox(switch)', function (data) {
-            if (!data.elem.checked && data.value == "异形") {
-                layer.msg('不能取消 [异形] 工艺!', {offset: ['300px', '300px']}, function () {
-                });
-                $('#mq').prop('checked', true);
-                form.render('checkbox');
-                return false;
-            }
-        })
+        // form.on('checkbox(switch)', function (data) {
+        //     if (!data.elem.checked && data.value == "异形") {
+        //         layer.msg('不能取消 [异形] 工艺!', {offset: ['300px', '300px']}, function () {
+        //         });
+        //         $('#mq').prop('checked', true);
+        //         form.render('checkbox');
+        //         return false;
+        //     }
+        // })
         $(".kind2").find(":input").attr("disabled", true);
         $(".kind3").find(":input").attr("disabled", true);
+        $(".kind4").find(":input").attr("disabled", true);
         // 没切换款式的时候默认禁用其它的下拉框,(防止提交表单)
         $(".kind2").find(":input").attr("disabled", true);
         form.on('radio(kindValue)', function (data) {