hxh 4 недель назад
Родитель
Сommit
b27c508592

+ 27 - 2
src/custom/restcontroller/sale/itemgroup/itemgroup.java

@@ -87,6 +87,18 @@ public class itemgroup extends Controller {
             where = where + " and exists(select 1 from sa_itemgroupmx s1 left join plm_item s2 on s1.itemid=s2.itemid and  s1.siteid=s2.siteid where s2.standards='"
                     + content_where.getString("standards") + "' and s1.sa_itemgroupid=t1.sa_itemgroupid) ";
         }
+        StringBuilder itemclassids_where=new StringBuilder();
+        if (!content_where.getStringValue("itemclassid").isEmpty()) {
+            ArrayList<Long> itemclassid = ItemClass.getSubItemClassIds(this, content_where.getLong("itemclassid"));
+            itemclassid.add(content_where.getLong("itemclassid"));
+            for(long id:itemclassid){
+                if(!itemclassids_where.toString().isEmpty()){
+                    itemclassids_where.append(",");
+                }
+                itemclassids_where.append(id);
+            }
+        }
+
 
         //品牌过滤
         JSONArray brandids = content.getJSONArray("brandids");
@@ -97,7 +109,7 @@ public class itemgroup extends Controller {
                 brandids = dbConnect.runSqlQuery("select sa_brandid from sa_brand where siteid='" + siteid + "'").toJsonArray("sa_brandid");
             }
         }
-
+        Rows tradefieldrows = dbConnect.runSqlQuery("SELECT tradefield from sys_enterprise_tradefield WHERE sys_enterpriseid =" + sys_enterpriseid + " and siteid ='" + siteid + "'");
         /*
          * SQL查询参数设置并查询
          */
@@ -111,16 +123,23 @@ public class itemgroup extends Controller {
             //如果企业有营销授权,则查询授权商品组
             itemGroupQuery.addJoinTable(JOINTYPE.inner, "sys_enterprise_itemgroupauth_view", "t7", "t7.sa_itemgroupid = t1.sa_itemgroupid and t7.sys_enterpriseid=" + sys_enterpriseid);
         }
+        itemGroupQuery.setWhere("tradefield",tradefieldrows.toArrayList("tradefield"));
 
         itemGroupQuery.setSiteid(siteid);
         itemGroupQuery.setCondition("t1.groupname", "t1.groupnum", "t2.model");
         itemGroupQuery.setWhere("t1.isonsale=1");
-        itemGroupQuery.setWhere("t2.ismodule", content.getLongValue("ismodule"));
+        //itemGroupQuery.setWhere("t2.ismodule", content.getLongValue("ismodule"));
         itemGroupQuery.setWhere("t1.sa_brandid", brandids.toArray());
         itemGroupQuery.setWhere(where);
         if (!content_where.getStringValue("condition").isEmpty()) {
             itemGroupQuery.setOrderBy("t1.groupname like'%" + content_where.getString("condition") + "%' desc");
         }
+        if(!itemclassids_where.toString().isEmpty()){
+            itemGroupQuery.setWhere("exists(" +
+                    "select * from sa_itemgroupmx t10 " +
+                    "inner join sa_itemsaleclass t11 on t10.itemid=t11.itemid " +
+                    "where t10.sa_itemgroupid=t1.sa_itemgroupid and t11.itemclassid in("+itemclassids_where+"))");
+        }
         itemGroupQuery.setPage(pageSize, pageNumber);
         Rows itemGroupRows = itemGroupQuery.query();
 
@@ -131,6 +150,12 @@ public class itemgroup extends Controller {
         itempriceQuery.addQueryFields("minprice", "min(t2.price)");
         itempriceQuery.setWhere("t1.sa_itemgroupid", itemGroupRows.toArrayList("sa_itemgroupid"));
         itempriceQuery.setWhere("t2.pricegrade", pricegrade);
+        if(!itemclassids_where.toString().isEmpty()){
+            itemGroupQuery.setWhere("exists(" +
+                    "select * from sa_itemsaleclass t11 " +
+                    "where t1.itemid=t11.itemid and t11.itemclassid in("+itemclassids_where+"))");
+        }
+
         itempriceQuery.addGroupBy("t1.sa_itemgroupid");
         RowsMap itemGroupPriceRowsMap = itempriceQuery.query().toRowsMap("sa_itemgroupid");
 

+ 2 - 2
src/custom/restcontroller/webmanage/sale/customscheme/customschemeItems.java

@@ -44,7 +44,7 @@ public class customschemeItems  extends Controller {
         JSONObject jsonObject2 =new JSONObject();
         JSONObject jsonObject3 =new JSONObject();
         JSONObject jsonObject4 =new JSONObject();
-        if(siteid.equalsIgnoreCase("DLB")){
+        if(siteid.equalsIgnoreCase("DLB")||siteid.equalsIgnoreCase("CCYOSG")){
             jsonObject1.put("value", "spec");
             jsonObject1.put("description", "尺寸");
             jsonObject2.put("value", "material");
@@ -53,7 +53,7 @@ public class customschemeItems  extends Controller {
             jsonObject3.put("description", "颜色");
             jsonObject4.put("value", "cheek");
             jsonObject4.put("description", "工艺");
-        }else {
+        } else {
             jsonObject1.put("value", "spec");
             jsonObject1.put("description", "尺寸");
             jsonObject2.put("value", "material");

+ 1 - 1
src/custom/restcontroller/webmanage/sale/paybill/SQL/打款凭证详情.sql

@@ -2,7 +2,7 @@ select t1.sa_paybillid,
        t1.sys_enterpriseid,
        t1.billno,
        t1.payer,
-       t1.paydate,
+       DATE_FORMAT(t1.paydate,'%Y-%m-%d')  paydate,
        t1.period,
        t1.amount,
        t1.status,

+ 7 - 2
src/custom/restcontroller/webmanage/sale/promotion/promotion.java

@@ -375,6 +375,8 @@ public class promotion extends Controller {
     @CACHEING
     public String querypromotionList() throws YosException {
         StringBuffer where = new StringBuffer(" 1=1 ");
+        StringBuffer wherebegindate = new StringBuffer(" 1=1 ");
+        StringBuffer whereenddate = new StringBuffer(" 1=1 ");
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
             if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
@@ -388,12 +390,15 @@ public class promotion extends Controller {
                 where.append(" and t1.status ='").append(whereObject.getString("status")).append("' ");
             }
             if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
-                where.append(" and DATE_FORMAT(t1.begdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
+                wherebegindate.append(" and DATE_FORMAT(t1.begdate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
+                whereenddate.append(" and DATE_FORMAT(t1.enddate, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
             }
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
-                where.append(" and DATE_FORMAT(t1.enddate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
+                wherebegindate.append(" and DATE_FORMAT(t1.begdate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
+                whereenddate.append(" and DATE_FORMAT(t1.enddate, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
             }
         }
+        where.append("and ((").append(wherebegindate).append(") or (").append(whereenddate).append("))");
 //        SQLFactory sqlFactory = new SQLFactory(this, "促销方案列表查询", pageSize, pageNumber, pageSorting);
 //        sqlFactory.addParameter("siteid", siteid);
 //        sqlFactory.addParameter_SQL("where", where);