|
|
@@ -1,6 +1,8 @@
|
|
|
package restcontroller.webmanage.sale.aftersalesmag;
|
|
|
|
|
|
import beans.data.BatchDeleteErr;
|
|
|
+import beans.enterprise.Enterprise;
|
|
|
+import beans.itemclass.ItemClass;
|
|
|
import beans.itemprice.ItemPrice;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
@@ -32,7 +34,9 @@ public class aftersalesmagItems extends Controller {
|
|
|
*/
|
|
|
Long sa_orderid = content.getLong("sa_orderid");
|
|
|
Long sa_aftersalesmagid = content.getLong("sa_aftersalesmagid");
|
|
|
- Long sys_enterpriseid = content.getLong("sys_enterpriseid");
|
|
|
+ if(content.containsKey("sys_enterpriseid")){
|
|
|
+ sys_enterpriseid = content.getLong("sys_enterpriseid");
|
|
|
+ }
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
@@ -48,6 +52,30 @@ public class aftersalesmagItems extends Controller {
|
|
|
sqlFactory = new SQLFactory(this, "返退商品列表查询", pageSize, pageNumber, pageSorting);
|
|
|
} else {
|
|
|
sqlFactory = new SQLFactory(this, "商品列表查询", pageSize, pageNumber, pageSorting);
|
|
|
+ String itemclasssql="select itemclassid from plm_itemclass where siteid='" + siteid +"'";
|
|
|
+ if(!content.containsKey("sys_enterpriseid")){
|
|
|
+ if(sys_enterpriseid>0){
|
|
|
+ Row enterpriseRow = Enterprise.getEnterprise(this, sys_enterpriseid);
|
|
|
+ if (!enterpriseRow.isEmpty()) {
|
|
|
+ //企业营销类别
|
|
|
+ boolean saleclassauth = enterpriseRow.getBoolean("saleclassauth");
|
|
|
+ if (saleclassauth) {
|
|
|
+ itemclasssql = "select itemclassid from plm_itemclass where siteid='" + siteid + "' and itemclassid in ( SELECT itemclassid from sys_enterprise_saleclass WHERE sys_enterpriseid = " + sys_enterpriseid + " and siteid='" + siteid + "')";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Rows itemclassRows = dbConnect.runSqlQuery(itemclasssql);
|
|
|
+
|
|
|
+ ArrayList<Long> itemclassList = new ArrayList<Long>();
|
|
|
+ for (Row row : itemclassRows) {
|
|
|
+ //System.out.println(row.getLong("itemclassid"));
|
|
|
+ itemclassList.add(row.getLong("itemclassid"));
|
|
|
+ itemclassList.addAll(ItemClass.getSubItemClassIds(this, row.getLong("itemclassid")));
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_in("itemclassid", itemclassList);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
sqlFactory.addParameter_SQL("where", where);
|