|
@@ -4,6 +4,7 @@ import beans.data.BatchDeleteErr;
|
|
|
import camundajar.impl.fastparse.internal.Msgs;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import common.BaseClass;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
import common.annotation.API;
|
|
@@ -32,6 +33,7 @@ public class aftersalesbom_pjs extends Controller {
|
|
|
/*
|
|
|
* 过滤条件设置
|
|
|
*/
|
|
|
+ String productcategories=content.getStringValue("productcategories");
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
@@ -46,9 +48,17 @@ public class aftersalesbom_pjs extends Controller {
|
|
|
}
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item", "*");
|
|
|
+
|
|
|
querySQL.setTableAlias("t1");
|
|
|
+ querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "sa_itemsalebom", "t2", "t1.itemid=t2.itemid and t1.siteid=t2.siteid");
|
|
|
+ querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "plm_bom", "t3", "t2.plm_bomid=t3.plm_bomid and t2.siteid=t3.siteid");
|
|
|
+ querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "plm_bom", "t4", "t3.parentid=t4.plm_bomid and t3.siteid=t4.siteid");
|
|
|
+ querySQL.addJoinTable(BaseClass.JOINTYPE.inner, "plm_bom", "t5", "t4.parentid=t5.plm_bomid and t4.siteid=t5.siteid");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("isused=1 and status='审核' and ismodule=1 ");
|
|
|
+ querySQL.addQueryFields("module","t5.bomname");
|
|
|
+ querySQL.addQueryFields("component","t4.bomname");
|
|
|
+ querySQL.addQueryFields("accessorie","t3.bomname");
|
|
|
+ querySQL.setWhere("isused=1 and status='审核' and ismodule=1 and t3.bomfullname like '"+productcategories+"%'");
|
|
|
querySQL.setWhere(where.toString());
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
querySQL.setOrderBy(pageSorting);
|