Browse Source

联合丽格V1.0.2

kaick 1 year ago
parent
commit
5ffaae7c6a

+ 4 - 0
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -486,6 +486,10 @@ public class ProductNewController extends BaseController {
         if (null != product.getSkuList()) {
         if (null != product.getSkuList()) {
             for (CmSku s : product.getSkuList()) {
             for (CmSku s : product.getSkuList()) {
                 if (null != s.getCostCheckFlag() && s.getCostCheckFlag() == 2) {
                 if (null != s.getCostCheckFlag() && s.getCostCheckFlag() == 2) {
+                    if (s.getShopPercent()==0) {
+                        addMessage(redirectAttributes, "保存商品失败,供应商比例必须大于0");
+                        return "redirect:" + Global.getAdminPath() + "/product/new/productEdit?id="+product.getId();
+                    }
                     double v = MathUtil.add(MathUtil.add(s.getShopPercent(), s.getOrganizePercent()), s.getCmPercent()).doubleValue();
                     double v = MathUtil.add(MathUtil.add(s.getShopPercent(), s.getOrganizePercent()), s.getCmPercent()).doubleValue();
                     if (v != 100) {
                     if (v != 100) {
                         addMessage(redirectAttributes, "保存商品失败,佣金比例和必须为100");
                         addMessage(redirectAttributes, "保存商品失败,佣金比例和必须为100");