Explorar o código

商品上架状态无法反审核

hu %!s(int64=3) %!d(string=hai) anos
pai
achega
11a696946e
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      src/custom/restcontroller/webmanage/sale/item/Item.java

+ 12 - 1
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -371,7 +371,7 @@ public class Item extends Controller {
         if(!brandRows.isEmpty()){
             sa_brandid=brandRows.get(0).getLong("sa_brandid");
         }
-        Rows itemRows = dbConnect.runSqlQuery("select itemid,itemno,itemname,sa_customschemeid from plm_item where siteid='"+siteid+"'");
+        Rows itemRows = dbConnect.runSqlQuery("select itemid,itemno,itemname,sa_customschemeid,isonsale from plm_item where siteid='"+siteid+"'");
         RowsMap itemRowsMap = itemRows.toRowsMap("itemid");
 
         Rows tradefieldRows = dbConnect.runSqlQuery("select itemid,tradefield from plm_item_tradefield where siteid='"+siteid+"'");
@@ -385,6 +385,17 @@ public class Item extends Controller {
             sqlFactory.addParameter("siteid", siteid);
             sqlFactory.addParameter("username", username);
             sqlFactory.addParameter("status", status.equals("0") ? "新建" : "审核");
+            if(status.equals("0")){
+                if(itemRowsMap.containsKey(String.valueOf(id))){
+                    if(!itemRowsMap.get(String.valueOf(id)).isEmpty()){
+                        if(itemRowsMap.get(String.valueOf(id)).get(0).getBoolean("isonsale")){
+                            return getErrReturnObject().setErrMsg("上架状态无法反审核").toString();
+                        }
+                    }
+
+                }
+
+            }
             //审核商品时,自动添加至商品组中
             if(itemRowsMap.containsKey(String.valueOf(obj))){
                 if(!itemRowsMap.get(String.valueOf(obj)).isEmpty()){