|
@@ -161,27 +161,30 @@ public class item extends Controller {
|
|
|
sqlFactory.addParameter("status",customitemRows.get(0).getString("status"));
|
|
|
sqlFactory.addParameter("isonsale",customitemRows.get(0).getString("isonsale"));
|
|
|
}else {
|
|
|
- logger.info("new:"+flong+":"+fcolour+":"+fbx+":"+fbk);
|
|
|
- logger.info("old:"+customitemRows.get(0).getString("spec")+":"+customitemRows.get(0).getString("color")+":"+customitemRows.get(0).getString("material")+":"+customitemRows.get(0).getString("cheek"));
|
|
|
- if(customitemRows.get(0).getBoolean("isonsale")){
|
|
|
- InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_contrllog");
|
|
|
- insertSQL.setValue("sys_contrllogid", this.createTableID("sys_contrllog"));
|
|
|
- insertSQL.setValue("ownertable", "plm_item");
|
|
|
- insertSQL.setValue("ownerid", itemid);
|
|
|
- insertSQL.setValue("action", "商品自动下架");
|
|
|
- insertSQL.setValue("remarks", "商品自动下架成功");
|
|
|
- insertSQL.setValue("actionuserid",1);
|
|
|
- insertSQL.setValue("actionby","admin");
|
|
|
- insertSQL.setValue("siteid", "lsa");
|
|
|
- insertSQL.setDateValue("actiondate");
|
|
|
- sqllist.add(insertSQL.getSQL());
|
|
|
- }
|
|
|
- sqlFactory.addParameter("status","新建");
|
|
|
- sqlFactory.addParameter("isonsale",0);
|
|
|
- if(customitemRows.get(0).getLong("sa_customschemeid")==0){
|
|
|
- sqllist.add("delete from sa_itemgroup where sa_itemgroupid in(select sa_itemgroupid from sa_itemgroupmx where itemid=" + itemid + " and siteid='lsa')");
|
|
|
- sqllist.add("delete from sa_itemgroupmx where itemid=" + itemid + " and siteid='lsa'");
|
|
|
+ Rows rowscount = dbConnect.runSqlQuery("select count(1) count from sa_itemgroupmx where sa_itemgroupid in(select t1.sa_itemgroupid from sa_itemgroupmx t1 inner join sa_itemgroup t2 on t1.sa_itemgroupid=t2.sa_itemgroupid and t1.siteid=t2.siteid where itemid="+itemid+")");
|
|
|
+ if(rowscount.isNotEmpty()){
|
|
|
+ if(rowscount.get(0).getInteger("count")>1){
|
|
|
+ logger.info("new:"+flong+":"+fcolour+":"+fbx+":"+fbk);
|
|
|
+ logger.info("old:"+customitemRows.get(0).getString("spec")+":"+customitemRows.get(0).getString("color")+":"+customitemRows.get(0).getString("material")+":"+customitemRows.get(0).getString("cheek"));
|
|
|
+ if(customitemRows.get(0).getBoolean("isonsale")){
|
|
|
+ InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_contrllog");
|
|
|
+ insertSQL.setValue("sys_contrllogid", this.createTableID("sys_contrllog"));
|
|
|
+ insertSQL.setValue("ownertable", "plm_item");
|
|
|
+ insertSQL.setValue("ownerid", itemid);
|
|
|
+ insertSQL.setValue("action", "商品自动下架");
|
|
|
+ insertSQL.setValue("remarks", "商品自动下架成功");
|
|
|
+ insertSQL.setValue("actionuserid",1);
|
|
|
+ insertSQL.setValue("actionby","admin");
|
|
|
+ insertSQL.setValue("siteid", "lsa");
|
|
|
+ insertSQL.setDateValue("actiondate");
|
|
|
+ sqllist.add(insertSQL.getSQL());
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter("status","审核");
|
|
|
+ sqlFactory.addParameter("isonsale",0);
|
|
|
+ sqllist.add("delete from sa_itemgroupmx where itemid=" + itemid + " and siteid='lsa'");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
sqlFactory.addParameter("sa_customschemeid", itemRows.get(0).getLong("sa_customschemeid"));
|