Sfoglia il codice sorgente

商品同步更新

hu 1 anno fa
parent
commit
46ac1baa12

+ 7 - 2
src/custom/restcontroller/sale/salestarget/enterprise.java

@@ -57,6 +57,13 @@ public class enterprise extends Controller {
           过滤条件设置
          */
         StringBuffer where = new StringBuffer(" 1=1 ");
+         if(sys_enterpriseid!=0){
+             where.append(" and(");
+             where.append("sys_enterpriseid ='").append(sys_enterpriseid).append("' ");
+             where.append(")");
+         }
+
+
         StringBuffer where2 = new StringBuffer(" 1=1 ");
         long curryear=0;
         if (content.containsKey("where")) {
@@ -89,8 +96,6 @@ public class enterprise extends Controller {
 
         SQLFactory sqlFactory = new SQLFactory(this, "企业-业绩目标完成列表");
         sqlFactory.addParameter_SQL("where", where);
-        sqlFactory.addParameter_in("sys_enterpriseid", sys_enterpriseid);
-        sqlFactory.addParameter_SQL("where", where);
         sqlFactory.addParameter("siteid", siteid);
         String sql = sqlFactory.getSQL();
         Rows rows = dbConnect.runSqlQuery(sql);

+ 23 - 20
src/custom/restcontroller/webmanage/lsak3/item/item.java

@@ -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"));