huangzhiguo 1 年之前
父節點
當前提交
bfa91e7528

+ 18 - 18
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -1053,23 +1053,23 @@
          normalPrice,
          price,
          ladderPriceFlag,
-         <if test="costPrice != null and costPrice != ''">
+         <if test="costPrice != null">
             costprice,
          </if>
-         <if test="organizeCostPrice != null and organizeCostPrice != ''">
+         <if test="organizeCostPrice != null">
             organizeCostPrice,
          </if>
-         <if test="cmCostPrice != null and cmCostPrice != ''">
+         <if test="cmCostPrice != null">
             cmCostPrice,
          </if>
          stock,
-         <if test="shopPercent != null and shopPercent != ''">
+         <if test="shopPercent != null">
             shopPercent,
          </if>
-         <if test="organizePercent != null and organizePercent != ''">
+         <if test="organizePercent != null">
             organizePercent,
          </if>
-         <if test="cmPercent != null and cmPercent != ''">
+         <if test="cmPercent != null">
             cmPercent,
          </if>
          organizeId,
@@ -1079,23 +1079,23 @@
                 #{normalPrice},
                 #{price},
                 #{ladderPriceFlag},
-                <if test="costPrice != null and costPrice != ''">
+                <if test="costPrice != null">
                     #{costPrice},
                 </if>
-                <if test="organizeCostPrice != null and organizeCostPrice != ''">
+                <if test="organizeCostPrice != null">
                     #{organizeCostPrice},
                 </if>
-                <if test="cmCostPrice != null and cmCostPrice != ''">
+                <if test="cmCostPrice != null">
                     #{cmCostPrice},
                 </if>
                 #{stock},
-                <if test="shopPercent != null and shopPercent != ''">
+                <if test="shopPercent != null">
                     #{shopPercent},
                 </if>
-                <if test="organizePercent != null and organizePercent != ''">
+                <if test="organizePercent != null">
                     #{organizePercent},
                 </if>
-                <if test="cmPercent != null and cmPercent != ''">
+                <if test="cmPercent != null">
                     #{cmPercent},
                 </if>
                 #{organizeId},
@@ -1740,22 +1740,22 @@
             normalPrice=#{normalPrice},
             price=#{price},
             organizeId=#{organizeId},
-            <if test="shopPercent != null and shopPercent !=''">
+            <if test="shopPercent != null">
                 shopPercent=#{shopPercent},
             </if>
-            <if test="organizePercent != null and organizePercent !=''">
+            <if test="organizePercent != null">
                 organizePercent=#{organizePercent},
             </if>
-            <if test="cmPercent != null and cmPercent !=''">
+            <if test="cmPercent != null">
                 cmPercent=#{cmPercent},
             </if>
-            <if test="costPrice != null and costPrice !=''">
+            <if test="costPrice != null">
                 costPrice=#{costPrice},
             </if>
-            <if test="organizeCostPrice != null and organizeCostPrice !=''">
+            <if test="organizeCostPrice != null">
                 organizeCostPrice = #{organizeCostPrice},
             </if>
-            <if test="cmCostPrice != null and cmCostPrice !=''">
+            <if test="cmCostPrice != null">
                 cmCostPrice = #{cmCostPrice},
             </if>
             stock=#{stock},

+ 4 - 2
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -2182,6 +2182,7 @@
     }
     $(".addSku").click(function () {
         var skuTemplate = $('#skuTemplate').html()
+        var costCheckFlag = $("input[name='costCheckFlag']:checked").val();
         $("#skus").append(skuTemplate).show();
         var current = $("#skus").find('.sku').eq(-1);
         if(skuList.length>0 || mallSkuList.length >0){
@@ -2191,7 +2192,7 @@
         }
         var product = {
             skuIndex: ++skuIndex-1,
-            costCheckFlag: '1',
+            costCheckFlag: costCheckFlag,
             ladderPriceFlag: '0'
         }
         setSkuPrototypeValues(current, product, 0);
@@ -2200,6 +2201,7 @@
 
     $(".addMallSku").click(function () {
         var skuTemplate = $('#skuTemplate').html()
+        var mallCostCheckFlag = $("input[name='mallCostCheckFlag']:checked").val();
         $("#mallSkus").append(skuTemplate).show();
         var current = $("#mallSkus").find('.sku').eq(-1);
         if(skuList.length>0 || mallSkuList.length >0){
@@ -2209,7 +2211,7 @@
         }
         var product = {
             skuIndex: ++skuIndex-1,
-            costCheckFlag: '1',
+            costCheckFlag: mallCostCheckFlag,
             ladderPriceFlag: '0'
         }
         setSkuPrototypeValues(current, product, 4);