Преглед изворни кода

商品档案级商品组营销分类改为一对多,即一个商品或商品组可以设置多个营销分类

沈静伟 пре 3 година
родитељ
комит
7646e3ea6f

+ 5 - 2
src/apps/saorder/AddRowsMlt.java

@@ -133,7 +133,8 @@ public class AddRowsMlt extends MultiselectDataBeanCust {
                     }
 
                     if (!"".equals(fsaleclsnum)) {
-                        str = str + " or fsaleclsnum ='" + fsaleclsnum + "'";
+                        //str = str + " or fsaleclsnum ='" + fsaleclsnum + "'";
+                        str = str + " or exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + pao.getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno and titem_saleclsnum.fsaleclsnum='" + fsaleclsnum + "')";
                     }
                     i++;
                 }
@@ -157,7 +158,9 @@ public class AddRowsMlt extends MultiselectDataBeanCust {
                     }
 
                     if (!"".equals(fsaleclsnum)) {
-                        str = str + " or FSALECLSNUM ='" + fsaleclsnum + "'";
+                        //str = str + " or FSALECLSNUM ='" + fsaleclsnum + "'";
+                        str = str + " or exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + pao.getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno and titem_saleclsnum.fsaleclsnum='" + fsaleclsnum + "')";
+
                     }
                     i++;
                 }

+ 2 - 1
src/apps/saorder/AddRowsMlt_Prom.java

@@ -41,7 +41,8 @@ public class AddRowsMlt_Prom extends MultiselectDataBeanCust {
                 }
 
                 if (!"".equals(fsaleclsnum)) {
-                    str = str + " or FSALECLSNUM ='" + fsaleclsnum + "'";
+                    //str = str + " or FSALECLSNUM ='" + fsaleclsnum + "'";
+                    str = str + " or exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + pao.getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno and titem_saleclsnum.fsaleclsnum='" + fsaleclsnum + "')";
                 }
                 i++;
             }

+ 4 - 3
src/apps/saorder/QuicklyAddDataBean.java

@@ -38,13 +38,14 @@ public class QuicklyAddDataBean extends DataBeanCust {
 		int i = 0;
 		while (TAGENTAUTHORS.getPao(i) != null) {
 			String fitemno = TAGENTAUTHORS.getPao(i).getString("fitemno");
-			String FSALECLSNUM = TAGENTAUTHORS.getPao(i).getString("FSALECLSNUM");
+			String fsaleclsnum = TAGENTAUTHORS.getPao(i).getString("FSALECLSNUM");
 			if (!"".equals(fitemno)) {
 				str = str + " or fitemno ='" + fitemno + "'";
 			}
 
-			if (!"".equals(FSALECLSNUM)) {
-				str = str + " or FSALECLSNUM ='" + FSALECLSNUM + "'";
+			if (!"".equals(fsaleclsnum)) {
+				//str = str + " or FSALECLSNUM ='" + FSALECLSNUM + "'";
+				str = str + " or exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + pao.getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno and titem_saleclsnum.fsaleclsnum='" + fsaleclsnum + "')";
 			}
 			i++;
 		}

+ 69 - 41
src/apps/titem/titem.java

@@ -244,7 +244,10 @@ public class titem extends PaoCust {
             if (!"审核".equals(getString("fstatus"))) {
                 throw new P2AppException("", "非审核状态不能上架");
             }
-            if ("".equals(getString("fsaleclsnum"))) {
+//            if ("".equals(getString("fsaleclsnum"))) {
+//                throw new P2AppException("", "营销类别为空不能上架");
+//            }
+            if (getPaoSet("titem_saleclsnum").isEmpty()) {
                 throw new P2AppException("", "营销类别为空不能上架");
             }
             if (getDouble("fsaleminqty") <= 0) {
@@ -462,28 +465,41 @@ public class titem extends PaoCust {
             }
             //项目管理类别折扣表
             PaoSetRemote tproject_cartelitemclass = getPaoSet("$tproject_cartelitemclass", "tproject_cartelitemclass", "fprojectnum='" + fprojectnum + "'");
-            String flongsaleclsnum = getString("flongsaleclsnum");
-            if (!tproject_cartelitemclass.isEmpty() && !"".equals(flongsaleclsnum)) {
-                String[] fsaleclsnums = flongsaleclsnum.split("/");
-                int length = fsaleclsnums.length;
-                while (length > 0) {
-                    length--;
-                    //营销类别
-                    String fsaleclsnum = fsaleclsnums[length];
-                    int i = 0;
-                    while (tproject_cartelitemclass.getPao(i) != null) {
-                        //价格协议营销类别
-                        String fsaleclsnum2 = tproject_cartelitemclass.getPao(i).getString("fsaleclsnum");
-                        if (fsaleclsnum.equals(fsaleclsnum2)) {
-                            if ("HY".equals(getString("siteid"))) {
-                                return Math.mul(tproject_cartelitemclass.getPao(i).getDouble("fdiscountrate"), fprice, 0);
-                            } else {
-                                return Math.mul(tproject_cartelitemclass.getPao(i).getDouble("fdiscountrate"), fprice, 2);
+            if (!tproject_cartelitemclass.isEmpty()) {
+                String[] flongsaleclsnums = getDistinctString(getPaoSet("TITEM_SALECLSNUM"), "flongsaleclsnum", false);//货品营销类别
+                double minprice_item = 0;//商品最低价
+                for (String flongsaleclsnum : flongsaleclsnums) {
+                    String[] fsaleclsnums = flongsaleclsnum.split("/");
+                    /**
+                     * 将数组进行倒转后由后往前进行类别遍历
+                     */
+                    fsaleclsnums = array_invert(fsaleclsnums);
+                    out1:
+                    for (String fsaleclsnum : fsaleclsnums) {
+                        int i = 0;
+                        while (tproject_cartelitemclass.getPao(i) != null) {
+                            if (fsaleclsnum.equals(tproject_cartelitemclass.getPao(i).getString("fsaleclsnum"))) {
+                                double price;
+                                if ("HY".equals(getString("siteid"))) {
+                                    price = Math.mul(tproject_cartelitemclass.getPao(i).getDouble("fdiscountrate"), fprice, 0);
+                                } else {
+                                    price = Math.mul(tproject_cartelitemclass.getPao(i).getDouble("fdiscountrate"), fprice, 2);
+                                }
+                                if (minprice_item == 0) {
+                                    minprice_item = price;
+                                } else {
+                                    minprice_item = java.lang.Math.min(minprice_item, price);
+                                }
+                                //结束本类别的循环
+                                break out1;
                             }
+                            i++;
                         }
-                        i++;
                     }
                 }
+                if (minprice_item != 0) {
+                    return minprice_item;
+                }
             }
             //项目管理折扣表
             PaoSetRemote tprojectSet = getPaoSet("$tproject", "tproject", "fprojectnum='" + fprojectnum + "'");
@@ -493,11 +509,10 @@ public class titem extends PaoCust {
                 return Math.mul(tprojectSet.getPao(0).getDouble("fdiscountrate"), fprice, 2);
             }
         } else {
-
             if (getBoolean("fiswuliao") || getBoolean("fistool")) {
                 return fprice;
             }
-
+            //价格协议商品折扣表
             PaoSetRemote tpricecarteldetailSet = getPaoSet("$tpricecarteldetail", "tpricecarteldetail", "fagentnum='" + fagentnum + "' and fitemno='" + getString("fitemno") + "'");
             if (!tpricecarteldetailSet.isEmpty()) {
                 PaoRemote pao = tpricecarteldetailSet.getPao(0);
@@ -511,33 +526,47 @@ public class titem extends PaoCust {
                     return pao.getDouble("fdiscountrate");
                 }
             }
+            //价格协议
             PaoSetRemote tpricecartelSet = getPaoSet("$tpricecartel", "tpricecartel", "fagentnum='" + fagentnum + "' and fstatus='审核' and fbegdate<=GETDATE() and fenddate>=GETDATE()");
-
             if (!tpricecartelSet.isEmpty()) {
                 //价格协议类别折扣表
                 PaoSetRemote tpricecartel_itemclass = tpricecartelSet.getPao(0).getPaoSet("tpricecartel_itemclass");
-                String flongsaleclsnum = getString("flongsaleclsnum");
-                if (!tpricecartel_itemclass.isEmpty() && !"".equals(flongsaleclsnum)) {
-                    String[] fsaleclsnums = flongsaleclsnum.split("/");
-                    int length = fsaleclsnums.length;
-                    while (length > 0) {
-                        length--;
-                        //营销类别
-                        String fsaleclsnum = fsaleclsnums[length];
-                        int i = 0;
-                        while (tpricecartel_itemclass.getPao(i) != null) {
-                            //价格协议营销类别
-                            String fsaleclsnum2 = tpricecartel_itemclass.getPao(i).getString("fsaleclsnum");
-                            if (fsaleclsnum.equals(fsaleclsnum2)) {
-                                if ("HY".equals(getString("siteid"))) {
-                                    return Math.mul(tpricecartel_itemclass.getPao(i).getDouble("fdiscountrate"), fprice, 0);
-                                } else {
-                                    return Math.mul(tpricecartel_itemclass.getPao(i).getDouble("fdiscountrate"), fprice, 2);
+                if (!tpricecartel_itemclass.isEmpty()) {
+                    String[] flongsaleclsnums = getDistinctString(getPaoSet("TITEM_SALECLSNUM"), "flongsaleclsnum", false);//货品营销类别
+                    double minprice_item = 0;//商品最低价
+                    for (String flongsaleclsnum : flongsaleclsnums) {
+                        String[] fsaleclsnums = flongsaleclsnum.split("/");
+                        /**
+                         * 将数组进行倒转后由后往前进行类别遍历
+                         */
+                        fsaleclsnums = array_invert(fsaleclsnums);
+                        out1:
+                        for (String fsaleclsnum : fsaleclsnums) {
+                            int i = 0;
+                            while (tpricecartel_itemclass.getPao(i) != null) {
+                                //价格协议营销类别
+                                if (fsaleclsnum.equals(tpricecartel_itemclass.getPao(i).getString("fsaleclsnum"))) {
+                                    double price;
+                                    if ("HY".equals(getString("siteid"))) {
+                                        price = Math.mul(tpricecartel_itemclass.getPao(i).getDouble("fdiscountrate"), fprice, 0);
+                                    } else {
+                                        price = Math.mul(tpricecartel_itemclass.getPao(i).getDouble("fdiscountrate"), fprice, 2);
+                                    }
+                                    if (minprice_item == 0) {
+                                        minprice_item = price;
+                                    } else {
+                                        minprice_item = java.lang.Math.min(minprice_item, price);
+                                    }
+                                    //结束本类别的循环
+                                    break out1;
                                 }
+                                i++;
                             }
-                            i++;
                         }
                     }
+                    if (minprice_item != 0) {
+                        return minprice_item;
+                    }
                 }
                 if ("HY".equals(getString("siteid"))) {
                     return Math.mul(tpricecartelSet.getPao(0).getDouble("fdiscountrate"), fprice, 0);
@@ -568,7 +597,6 @@ public class titem extends PaoCust {
         return 1;
     }
 
-
     @Override
     public void fieldAction(Object paoField, String fieldname)
             throws P2Exception {

+ 5 - 4
src/apps/titem/titemAppBean.java

@@ -63,13 +63,14 @@ public class titemAppBean extends AppBeanCust {
         int i = 0;
         while (TAGENTAUTHORS.getPao(i) != null) {
             String fitemno = TAGENTAUTHORS.getPao(i).getString("fitemno");
-            String FSALECLSNUM = TAGENTAUTHORS.getPao(i).getString(
-                    "FSALECLSNUM");
+            String fsaleclsnum = TAGENTAUTHORS.getPao(i).getString("FSALECLSNUM");
             if (!"".equals(fitemno)) {
                 str = str + " or fitemno ='" + fitemno + "'";
             }
-            if (!"".equals(FSALECLSNUM)) {
-                str = str + " or FSALECLSNUM ='" + FSALECLSNUM + "'";
+            if (!"".equals(fsaleclsnum)) {
+                //str = str + " or FSALECLSNUM ='" + FSALECLSNUM + "'";
+                str = str + " or exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + getPao().getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno and titem_saleclsnum.fsaleclsnum='" + fsaleclsnum + "')";
+
             }
             i++;
         }

+ 58 - 0
src/apps/titem_saleclsnum/titem_saleclsnum.java

@@ -0,0 +1,58 @@
+package titem_saleclsnum;
+
+import baseclass.PaoCust;
+import p2.p2server.P2Server;
+import p2.pao.PaoSet;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+import titem.titem;
+
+public class titem_saleclsnum extends PaoCust {
+    public titem_saleclsnum(PaoSet arg0) {
+        super(arg0);
+    }
+
+    @Override
+    public void add() throws P2Exception {
+        super.add();
+        if (getOwner() instanceof titem) {
+            setValue("fitemno", getOwner().getString("fitemno"), 11L);
+        }
+    }
+
+    @Override
+    public void init() throws P2Exception {
+        super.init();
+        if (getOwner() instanceof titem) {
+            if (!toBeAdded() && !"н¨".equals(getOwner().getString("fstatus"))) {
+                setFieldFlag("FSALECLSNUM", READONLY, true);
+            }
+        }
+    }
+
+    @Override
+    public void fieldAction(Object paoField, String fieldname)throws P2Exception {
+        super.fieldAction(paoField, fieldname);
+        if ("FSALECLSNUM".equals(fieldname)) {
+            String fsaleclsnum = getString("fsaleclsnum");
+            if ("".equals(fsaleclsnum)) {
+                setValue("flongsaleclsnum", "", 11L);
+            } else {
+                String flongsaleclsnum = fsaleclsnum;
+                boolean hasup = true;
+                while (hasup) {
+                    PaoSetRemote titemclass = P2Server.getP2Server().getPaoSet("titemclass", getUserInfo());
+                    titemclass.setWhere("fitemclsnum='" + fsaleclsnum + "' and fclasstype='ÓªÏúÀà±ð' and fupclass is not null");
+                    titemclass.reset();
+                    if (titemclass.isEmpty()) {
+                        hasup = false;
+                    } else {
+                        fsaleclsnum = titemclass.getPao(0).getString("fupclass");
+                        flongsaleclsnum = fsaleclsnum + "/" + flongsaleclsnum;
+                    }
+                }
+                setValue("flongsaleclsnum", flongsaleclsnum, 11L);
+            }
+        }
+    }
+}

+ 24 - 0
src/apps/titem_saleclsnum/titem_saleclsnumDataBean.java

@@ -0,0 +1,24 @@
+package titem_saleclsnum;
+
+import baseclass.DataBeanCust;
+import p2.util.P2AppException;
+import p2.util.P2Exception;
+
+public class titem_saleclsnumDataBean extends DataBeanCust {
+
+    @Override
+    public int TOGGLEDELETEROW() throws P2Exception {
+        if (!"新建".equals(parent.getString("fstatus"))) {
+            throw new P2AppException("", "非新建状态下不可添加");
+        }
+        return super.TOGGLEDELETEROW();
+    }
+
+    @Override
+    public int ADDROW() throws P2Exception {
+        if (!"新建".equals(parent.getString("fstatus"))) {
+            throw new P2AppException("", "非新建状态下不可删除");
+        }
+        return super.ADDROW();
+    }
+}

+ 2 - 1
src/apps/titemgroup/AddRowsMlt.java

@@ -10,7 +10,8 @@ public class AddRowsMlt extends MultiselectDataBeanCust {
     protected PaoSetRemote getPaoSetRemote() throws P2Exception {
         PaoRemote pao = this.app.getAppBean().getPao();
         PaoSetRemote paoSet = super.getPaoSetRemote();
-        paoSet.setWhere(getworlds(pao.getPaoSet("titem_group"), "fitemno", "fitemno") + " and fsaleclsnum='" + pao.getString("fsaleclsnum") + "' and fieldname='" + pao.getString("fieldname") + "' and fbrand='" + pao.getString("fbrand") + "'");
+        //paoSet.setWhere(getworlds(pao.getPaoSet("titem_group"), "fitemno", "fitemno") + " and fsaleclsnum='" + pao.getString("fsaleclsnum") + "' and fieldname='" + pao.getString("fieldname") + "' and fbrand='" + pao.getString("fbrand") + "'");
+        paoSet.setWhere(getworlds(pao.getPaoSet("titem_group"), "fitemno", "fitemno") + " and fieldname='" + pao.getString("fieldname") + "' and fbrand='" + pao.getString("fbrand") + "'");
         paoSet.reset();
         return paoSet;
     }

+ 1 - 0
src/apps/titemgroup/SQL/商品营销分类查询.sql

@@ -0,0 +1 @@
+select distinct fsaleclsnum from titem_saleclsnum where siteid=$siteid$ and fitemno in $fitemno$

+ 60 - 1
src/apps/titemgroup/titemgroup.java

@@ -2,12 +2,19 @@ package titemgroup;
 
 import baseclass.PaoCust;
 import baseclass.tools.GetFieldsName;
+import openapi.base.SQLFactory;
+import openapi.base.data.Row;
+import openapi.base.data.Rows;
+import openapi.base.data.db.DBConnect;
 import p2.p2server.P2Server;
+import p2.pao.PaoRemote;
 import p2.pao.PaoSet;
 import p2.pao.PaoSetRemote;
 import p2.util.P2AppException;
 import p2.util.P2Exception;
 
+import java.util.ArrayList;
+
 public class titemgroup extends PaoCust {
     public titemgroup(PaoSet arg0) {
         super(arg0);
@@ -62,9 +69,61 @@ public class titemgroup extends PaoCust {
     }
 
     public void additems(PaoSetRemote titemSet) throws P2Exception {
-        BatchAdd(titemSet, new String[]{"fitemno", "$" + getString("fgroupnum")}, getPaoSet("titem_group"), new String[]{"fitemno", "fgroupnum"}, true);
+        PaoSetRemote titem_groupSet = getPaoSet("titem_group");
+        BatchAdd(titemSet, new String[]{"fitemno", "$" + getString("fgroupnum")}, titem_groupSet, new String[]{"fitemno", "fgroupnum"}, true);
+        reflashSaleclsnum();
     }
 
+    /**
+     * 刷新商品组营销分类
+     *
+     * @throws P2Exception
+     */
+    public void reflashSaleclsnum() throws P2Exception {
+        PaoSetRemote titem_groupSet = getPaoSet("titem_group");
+        PaoSetRemote titemgroup_saleclsnumSet = getPaoSet("titemgroup_saleclsnum");
+        String[] fsaleclsnums = getStrings(titemgroup_saleclsnumSet, "fsaleclsnum");//已存在的营销类别
+        String[] fitemnos = getStrings(titem_groupSet, "fitemno");//已存在的商品编号
+        SQLFactory sqlFactory = new SQLFactory(this, "商品营销分类查询");
+        sqlFactory.addParameter("siteid", getString("siteid"));
+        sqlFactory.addParameter_in("fitemno", fitemnos);
+        DBConnect dbConnect = new DBConnect();
+        Rows fsaleclsnumrows = dbConnect.runSqlQuery(sqlFactory.getSQL());//需要授权的营销类别
+
+        for (Row fsaleclsnumrow : fsaleclsnumrows) {
+            boolean isadd = true;
+            for (String fsaleclsnum : fsaleclsnums) {
+                if (fsaleclsnumrow.getString("fsaleclsnum").equals(fsaleclsnum)) {
+                    isadd = false;
+                    break;
+                }
+            }
+            if (isadd) {
+                PaoRemote pao = titemgroup_saleclsnumSet.addAtEnd();
+                pao.setValue("fsaleclsnum", fsaleclsnumrow.getString("fsaleclsnum"), 2L);
+            }
+        }
+
+        ArrayList<PaoRemote> deletepaolist = new ArrayList<>();
+        int i = 0;
+        while (titemgroup_saleclsnumSet.getPao(i) != null) {
+            boolean isdelete = true;
+            for (Row fsaleclsnumrow : fsaleclsnumrows) {
+                if (titemgroup_saleclsnumSet.getPao(i).getString("fsaleclsnum").equals(fsaleclsnumrow.getString("fsaleclsnum"))) {
+                    isdelete = false;
+                }
+            }
+            if (isdelete) {
+                deletepaolist.add(titemgroup_saleclsnumSet.getPao(i));
+            }
+            i++;
+        }
+        for (PaoRemote deletepao : deletepaolist) {
+            deletepao.delete();
+        }
+    }
+
+
     @Override
     public void fieldValidate(Object paoField, String fieldname) throws P2Exception {
         super.fieldValidate(paoField, fieldname);

+ 6 - 3
src/apps/titemgroup/titemgroupDataBean.java

@@ -7,12 +7,15 @@ public class titemgroupDataBean extends DataBeanCust {
 
     @Override
     public int TOGGLEDELETEROW() throws P2Exception {
-
-        return super.TOGGLEDELETEROW();
+        super.TOGGLEDELETEROW();
+        titemgroup titemgroup = (titemgroup) parent.getPao();
+        titemgroup.reflashSaleclsnum();
+        parent.save();
+        byrefresh();
+        return 1;
     }
 
     public int ADDROWS() throws P2Exception {
-
         return 2;
     }
 }

+ 55 - 0
src/apps/titemgroup_saleclsnum/titemgroup_saleclsnum.java

@@ -0,0 +1,55 @@
+package titemgroup_saleclsnum;
+
+import baseclass.PaoCust;
+import p2.p2server.P2Server;
+import p2.pao.PaoSet;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+public class titemgroup_saleclsnum extends PaoCust {
+    public titemgroup_saleclsnum(PaoSet arg0) {
+        super(arg0);
+    }
+
+    @Override
+    public void init() throws P2Exception {
+        super.init();
+    }
+
+    @Override
+    public void add() throws P2Exception {
+        super.add();
+        setValue("fgroupnum", getOwner().getString("fgroupnum"), 11L);
+    }
+
+    @Override
+    public void canDelete() throws P2Exception {
+        super.canDelete();
+    }
+
+    @Override
+    public void fieldAction(Object paoField, String fieldname) throws P2Exception {
+        super.fieldAction(paoField, fieldname);
+        if ("FSALECLSNUM".equals(fieldname)) {
+            String fsaleclsnum = getString("fsaleclsnum");
+            if ("".equals(fsaleclsnum)) {
+                setValue("flongsaleclsnum", "", 11L);
+            } else {
+                String flongsaleclsnum = fsaleclsnum;
+                boolean hasup = true;
+                while (hasup) {
+                    PaoSetRemote titemclass = P2Server.getP2Server().getPaoSet("titemclass", getUserInfo());
+                    titemclass.setWhere("fitemclsnum='" + fsaleclsnum + "' and fclasstype='ÓªÏúÀà±ð' and fupclass is not null");
+                    titemclass.reset();
+                    if (titemclass.isEmpty()) {
+                        hasup = false;
+                    } else {
+                        fsaleclsnum = titemclass.getPao(0).getString("fupclass");
+                        flongsaleclsnum = fsaleclsnum + "/" + flongsaleclsnum;
+                    }
+                }
+                setValue("flongsaleclsnum", flongsaleclsnum, 11L);
+            }
+        }
+    }
+}

+ 17 - 0
src/apps/titemgroup_saleclsnum/titemgroup_saleclsnumDataBean.java

@@ -0,0 +1,17 @@
+package titemgroup_saleclsnum;
+
+import baseclass.DataBeanCust;
+import p2.util.P2Exception;
+
+public class titemgroup_saleclsnumDataBean extends DataBeanCust {
+
+    @Override
+    public int TOGGLEDELETEROW() throws P2Exception {
+        return super.TOGGLEDELETEROW();
+    }
+
+    @Override
+    public int ADDROW() throws P2Exception {
+        return super.ADDROW();
+    }
+}

+ 2 - 1
src/apps/tpriceadjust/AddTitemMlt.java

@@ -11,7 +11,8 @@ public class AddTitemMlt extends MultiselectDataBeanCust {
 		PaoRemote pao = this.app.getAppBean().getPao();
 		PaoSetRemote paoSet = super.getPaoSetRemote();
 		if(pao!=null){
-			paoSet.setWhere(getworlds(pao.getPaoSet("TPRICEADJUSTDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and FSALECLSNUM is not null");
+			//paoSet.setWhere(getworlds(pao.getPaoSet("TPRICEADJUSTDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and FSALECLSNUM is not null");
+			paoSet.setWhere(getworlds(pao.getPaoSet("TPRICEADJUSTDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + getPao().getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno)");
 		}
 		paoSet.reset();
 		return paoSet;

+ 2 - 1
src/apps/tration/AddRowsMlt.java

@@ -11,7 +11,8 @@ public class AddRowsMlt extends MultiselectDataBeanCust {
 		PaoRemote pao = this.app.getAppBean().getPao();
 		PaoSetRemote paoSet = super.getPaoSetRemote();
 		if(pao!=null){
-			paoSet.setWhere(getworlds(pao.getPaoSet("TRATIONDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and FSALECLSNUM is not null");
+			//paoSet.setWhere(getworlds(pao.getPaoSet("TRATIONDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and FSALECLSNUM is not null");
+			paoSet.setWhere(getworlds(pao.getPaoSet("TRATIONDETAIL"),"fitemno", "fitemno")+ " and fstatus='ÉóºË' and exists(select * from titem_saleclsnum where titem_saleclsnum.siteid='" + getPao().getString("siteid") + "' and titem_saleclsnum.fitemno=titem.fitemno)");
 		}
 		paoSet.reset();
 		return paoSet;

+ 3 - 0
src/rest/openapi/restcontroller/wechatapp/titem/SQL/货品营销类别查询.sql

@@ -0,0 +1,3 @@
+select t1.fitemno,t1.fsaleclsnum,t2.fitemclsname from titem_saleclsnum t1
+inner join titemclass t2 on t1.siteid=t2.siteid and t1.fsaleclsnum=t2.fitemclsnum and t2.fclasstype='ÓªÏúÀà±ð'
+where t1.siteid=$siteid$ and t1.fitemno in $fitemno$

+ 105 - 7
src/rest/openapi/restcontroller/wechatapp/titem/Titem.java

@@ -70,7 +70,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fiscollection") && !"".equals(whereObject.getString("fiscollection"))) {
@@ -145,6 +146,13 @@ public class Titem extends Controller {
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
 
         /**
          *更新即时库存
@@ -185,6 +193,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
         titemset.close();
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
@@ -233,7 +243,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    // where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fieldname") && !"".equals(whereObject.getString("fieldname"))) {
@@ -274,6 +285,13 @@ public class Titem extends Controller {
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
 
         /**
          *更新即时库存
@@ -313,6 +331,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
 
         titemset.close();
@@ -362,7 +382,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fieldname") && !"".equals(whereObject.getString("fieldname"))) {
@@ -401,6 +422,13 @@ public class Titem extends Controller {
          *商品安装教程查询参数设置,并将结果存放置map
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
 
 
         /**
@@ -439,6 +467,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
 
         titemset.close();
@@ -488,7 +518,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fiscollection") && !"".equals(whereObject.getString("fiscollection"))) {
@@ -529,6 +560,15 @@ public class Titem extends Controller {
          */
         RowsMap picmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_PIC, rows.toArray("fitemno"));
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", rows.toArray("fitemno"));
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
+
+
         /**
          *更新即时库存
          */
@@ -558,6 +598,8 @@ public class Titem extends Controller {
             itemrow.put("fprice", foldprice);
             //图片
             itemrow.put("pics", picmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
 
         titemset.close();
@@ -611,7 +653,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fiscollection") && !"".equals(whereObject.getString("fiscollection"))) {
@@ -645,6 +688,15 @@ public class Titem extends Controller {
          */
         RowsMap picmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_PIC, rows.toArray("fitemno"));
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", rows.toArray("fitemno"));
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
+
+
         HashMap<String, PaoRemote> itemmap = null;
         if (withprice) {
             /**
@@ -672,6 +724,9 @@ public class Titem extends Controller {
                 itemrow.put("foldprice", foldprice);
                 //销售价
                 itemrow.put("fprice", fprice);
+
+                //营销分类
+                itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
             }
         }
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
@@ -725,7 +780,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fiscollection") && !"".equals(whereObject.getString("fiscollection"))) {
@@ -760,6 +816,15 @@ public class Titem extends Controller {
          */
         RowsMap picmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_PIC, rows.toArray("fitemno"));
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", rows.toArray("fitemno"));
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
+
+
         HashMap<String, PaoRemote> itemmap = null;
         if (withprice) {
             /**
@@ -787,6 +852,9 @@ public class Titem extends Controller {
                 itemrow.put("foldprice", foldprice);
                 //销售价
                 itemrow.put("fprice", fprice);
+
+                //营销分类
+                itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
             }
         }
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
@@ -831,7 +899,8 @@ public class Titem extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titem_saleclsnum where titem_saleclsnum.siteid=t1.siteid and titem_saleclsnum.fitemno=t1.fitemno and titem_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fiscollection") && !"".equals(whereObject.getString("fiscollection"))) {
@@ -884,6 +953,14 @@ public class Titem extends Controller {
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
+
         /**
          *更新即时库存
          */
@@ -920,6 +997,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
         titemset.close();
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
@@ -971,6 +1050,14 @@ public class Titem extends Controller {
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
+
         /**
          *更新即时库存
          */
@@ -1019,6 +1106,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
         titemset.close();
         return getReturnObject_suc(rows, true).toString();
@@ -1071,6 +1160,13 @@ public class Titem extends Controller {
          */
         RowsMap installationtutorialmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_INSTALLATIONTUTORIAL, itemarray);
 
+        /**
+         * 商品营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "货品营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", itemarray);
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fitemno");
 
         /**
          *更新即时库存
@@ -1120,6 +1216,8 @@ public class Titem extends Controller {
             itemrow.put("instructions", instructionsmap.get(fitemno));
             //安装教程
             itemrow.put("installationtutorial", installationtutorialmap.get(fitemno));
+            //营销分类
+            itemrow.put("saleclsnum", saleclsnumRowsMap.get(fitemno));
         }
         titemset.close();
         return getReturnObject_suc(rows, true).toString();

+ 3 - 0
src/rest/openapi/restcontroller/wechatapp/titemgroup/SQL/商品组营销类别查询.sql

@@ -0,0 +1,3 @@
+select t1.fgroupnum,t1.fsaleclsnum,t2.fitemclsname from titemgroup_saleclsnum t1
+inner join titemclass t2 on t1.siteid=t2.siteid and t1.fsaleclsnum=t2.fitemclsnum and t2.fclasstype='ÓªÏúÀà±ð'
+where t1.siteid=$siteid$ and t1.fgroupnum in $fgroupnum$

+ 26 - 4
src/rest/openapi/restcontroller/wechatapp/titemgroup/TitemGroup.java

@@ -40,7 +40,7 @@ public class TitemGroup extends Controller {
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
-                where = where + " and(t1.fgroupname like'%" + whereObject.getString("condition") + "%' or t1.fieldname like'%"+whereObject.getString("condition") +"%' " +
+                where = where + " and(t1.fgroupname like'%" + whereObject.getString("condition") + "%' or t1.fieldname like'%" + whereObject.getString("condition") + "%' " +
                         "or exists(select * from titem_group where siteid=t1.siteid and fgroupnum=t1.fgroupnum and (fitemno like'%" + whereObject.getString("condition") + "%') ))";
 
             }
@@ -52,7 +52,8 @@ public class TitemGroup extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titemgroup_saleclsnum where titemgroup_saleclsnum.siteid=t1.siteid and titemgroup_saleclsnum.fitemno=t1.fitemno and titemgroup_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fbrand") && !"".equals(whereObject.getString("fbrand"))) {
@@ -101,6 +102,15 @@ public class TitemGroup extends Controller {
          *商品组默认商品图片查询参数设置,并将结果存放置map
          */
         RowsMap picmap = RowsPool.getRowsMap(siteid, RowsPool.GroupName.ITEM_PIC, rows.toArray("fitemno"));
+
+        /**
+         * 营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "商品组营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", rows.toArray("fgroupnum"));
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fgroupnum");
+
         /**
          * 遍历商品组,设置价格区间、图片信息
          */
@@ -120,6 +130,7 @@ public class TitemGroup extends Controller {
                 picrows = picmap.get(fitemno);
             }
             row.put("pics", picrows);
+            row.put("saleclsnum", saleclsnumRowsMap.get(fgroupnum));
         }
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
     }
@@ -146,7 +157,7 @@ public class TitemGroup extends Controller {
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
-                where = where + " and(t1.fgroupname like'%" + whereObject.getString("condition") + "%' or t1.fieldname like'%"+whereObject.getString("condition") +"%' " +
+                where = where + " and(t1.fgroupname like'%" + whereObject.getString("condition") + "%' or t1.fieldname like'%" + whereObject.getString("condition") + "%' " +
                         "or exists(select * from titem_group where siteid=t1.siteid and fgroupnum=t1.fgroupnum and (fitemno like'%" + whereObject.getString("condition") + "%') ))";
 
             }
@@ -158,7 +169,8 @@ public class TitemGroup extends Controller {
                 if (flongsaleslsRows.isEmpty()) {
                     where = where + " and 1=2";
                 } else {
-                    where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    //where = where + " and t1.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%'";
+                    where = where + " and exists(select *from titemgroup_saleclsnum where titemgroup_saleclsnum.siteid=t1.siteid and titemgroup_saleclsnum.fitemno=t1.fitemno and titemgroup_saleclsnum.flongsaleclsnum like'" + flongsaleslsRows.get(0).getString("flongsaleslsnum") + "%') ";
                 }
             }
             if (whereObject.containsKey("fbrand") && !"".equals(whereObject.getString("fbrand"))) {
@@ -203,6 +215,15 @@ public class TitemGroup extends Controller {
         grouppicfactory.addParameter("siteid", siteid);
         RowsMap grouppicmap = drpConnect.runSqlQuery(grouppicfactory.getSQL()).toRowsMap("fgroupnum");
 
+        /**
+         * 营销类别
+         */
+        SQLFactory saleclsnumsqlFactory = new SQLFactory(this, "商品组营销类别查询");
+        saleclsnumsqlFactory.addParameter("siteid", siteid);
+        saleclsnumsqlFactory.addParameter_in("fitemno", rows.toArray("fgroupnum"));
+        RowsMap saleclsnumRowsMap = drpConnect.runSqlQuery(saleclsnumsqlFactory.getSQL()).toRowsMap("fgroupnum");
+
+
         /**
          *商品组默认商品图片查询参数设置,并将结果存放置map
          */
@@ -223,6 +244,7 @@ public class TitemGroup extends Controller {
                 picrows = picmap.get(fitemno);
             }
             row.put("pics", picrows);
+            row.put("saleclsnum", saleclsnumRowsMap.get(fgroupnum));
         }
         return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
     }