|
|
@@ -228,15 +228,21 @@ public class itemgroup extends Controller {
|
|
|
// SQLFactory sqlFactoryquery = new SQLFactory(this, "商品组状态查询");
|
|
|
// sqlFactoryquery.addParameter("siteid", siteid);
|
|
|
// sqlFactoryquery.addParameter_in("sa_itemgroupids", stringArray);
|
|
|
- String whereSql = "select isonsale,groupname from sa_itemgroup where sa_itemgroupid in " + list + " and siteid='" + siteid + "'";
|
|
|
+ String whereSql = "select isonsale,groupname,sa_itemgroupid from sa_itemgroup where sa_itemgroupid in " + list + " and siteid='" + siteid + "'";
|
|
|
whereSql = whereSql.replace("[", "(").replace("]", ")");
|
|
|
Rows rows = dbConnect.runSqlQuery(whereSql);
|
|
|
for (Row row : rows) {
|
|
|
if (row.getBoolean("isonsale")) {
|
|
|
return getErrReturnObject().setErrMsg("【" + row.getString("groupname") + "】商品组已上架,无法再次上架").toString();
|
|
|
}
|
|
|
+ Rows rowscount = dbConnect.runSqlQuery("select distinct ifnull(t2.sa_customschemeid,0) sa_customschemeid from sa_itemgroupmx t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.siteid='"+siteid+"' and t1.sa_itemgroupid="+row.getLong("sa_itemgroupid"));
|
|
|
+ if(rowscount.size()>1){
|
|
|
+ return getErrReturnObject().setErrMsg("【" + row.getString("groupname") + "】商品组存在两个以上方案的商品,无法上架").toString();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
SQLFactory sqlFactoryupdate = new SQLFactory(this, "商品组上架");
|
|
|
sqlFactoryupdate.addParameter("siteid", siteid);
|
|
|
sqlFactoryupdate.addParameter_in("sa_itemgroupids", stringArray);
|