zhuyiyi 12 цаг өмнө
parent
commit
1c7a3def12

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

@@ -1663,12 +1663,12 @@ public class ProductService {
                     if ("1".equals(dto.getKindValue())) {
                         // 给产品加上重量 扣除出血的4毫米
                         for (Product product : priceList) {
-                            product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86));
+                            product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.2 * 0.86));
                         }
                     } else {
                         // 给产品加上重量
                         for (Product product : priceList) {
-                            product.setWeight(df.format(number * (length - 4) / 100 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86));
+                            product.setWeight(df.format(number * (length - 4) / 1000 * (width - 4) / 1000 * product.getCount() * 0.3 * 0.86));
                         }
                     }
 
@@ -5071,7 +5071,7 @@ public class ProductService {
             pro = new Product();
             pro.setCount(itemCount);
             pro.setPrice(Math.ceil(unit_prices[base][i] * itemCount * number));
-            pro.setWeight(df.format(width * length * 1.8 * itemCount / 10000 ));
+            pro.setWeight(df.format(width * length * 1.8 * itemCount / 10000));
             priceList.add(pro);
 
         }
@@ -5277,13 +5277,14 @@ public class ProductService {
         max = Math.max(max, 1);
         // 报的数量需要多少张大纸
         // 需要多少张大纸 = 数量 * 款数 /每张做多少个 ===总数量/每张多少个
-        double num = Math.ceil(dto.getCount() * dto.getNumber() / max);
+        double num = Math.ceil(dto.getCount() / max);
         double craft_price = 0;
+        double bao_price = 0;
         if (carftList.contains("单独包装")) {
-            craft_price += Math.ceil(0.2 * dto.getCount() * dto.getNumber());
+            bao_price += Math.ceil(0.2 * dto.getCount() * dto.getNumber());
         }
         if (carftList.contains("真空包装")) {
-            craft_price += Math.ceil(0.35 * dto.getCount() * dto.getNumber());
+            bao_price += Math.ceil(0.35 * dto.getCount() * dto.getNumber());
         }
         if (carftList.contains("配涤纶丝带")) {
             craft_price += Math.ceil(0.1 * dto.getCount() * dto.getNumber());
@@ -5311,7 +5312,7 @@ public class ProductService {
             cardDesignFee = 20.5;
         }
         Product pro = new Product();
-        pro.setPrice(Math.ceil(Math.max(base_price * num + designFee + cardDesignFee, min_price) + craft_price));
+        pro.setPrice(Math.ceil(Math.max((base_price * num + cardDesignFee) * number, min_price) + designFee + bao_price + (craft_price == 0 ? craft_price : Math.max(craft_price, 5))));
         pro.setCount(dto.getCount());
         pro.setNumber(dto.getNumber());
         pro.setWeight(df.format(dto.getNumber() * (length - 4) / 1000 * (width - 4) / 1000 * dto.getCount() * 0.2 * 0.86));

+ 7 - 1
src/main/webapp/views/product/coupon.jsp

@@ -994,6 +994,7 @@
                             remark_html = remark;
                             $("#remark").append(remark);
                         }
+                        $("#test1 .layui-carousel-ind").empty();
                         // 如果没有轮播图就隐藏
                         if (result.length == 0) {
                             document.getElementById("test1").style.display = "none";   //隐藏
@@ -1002,7 +1003,8 @@
                             ins.reload({
                                 elem: '#test1',
                                 width: result[0].imgWidth,  //设置容器宽度
-                                height: result[0].imgHeight
+                                height: result[0].imgHeight,
+                                indicator: 'outside',
                             });
                         }
                     }
@@ -1249,9 +1251,11 @@
                     if ($(data.elem).is(":checked")) {
                         $("#peijian_ui .tscolor").show();
                         $("#peijian_ui .tscolor select").prop("disabled", false);
+                        getProductImage('弹力绳');
                     } else {
                         $("#peijian_ui .tscolor").hide();
                         $("#peijian_ui .tscolor select").prop("disabled", true);
+                        getProductImage('');
                     }
                 }
                 if (data.value == "opp袋") {
@@ -2005,6 +2009,7 @@
                                 remark_html = remark;
                                 $("#remark").append(remark);
                             }
+                            $("#test1 .layui-carousel-ind").empty();
                             // 如果没有轮播图就隐藏
                             if (result.length == 0) {
                                 document.getElementById("test1").style.display = "none";   //隐藏
@@ -2400,6 +2405,7 @@
                                     remark_html = remark;
                                     $("#remark").append(remark);
                                 }
+                                $("#test1 .layui-carousel-ind").empty();
                                 // 如果没有轮播图就隐藏
                                 if (result.length == 0) {
                                     document.getElementById("test1").style.display = "none";   //隐藏