|
@@ -1,5 +1,6 @@
|
|
|
package restcontroller.sale.order;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
@@ -24,21 +25,16 @@ public class Order extends Controller {
|
|
|
|
|
|
@API(title = "查询订单列表(经销商)", apiversion = R.ID20221224180302.v1.class)
|
|
|
public String selectList() throws YosException, IOException {
|
|
|
+ ArrayList<String> statusList = new ArrayList<>();
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
- if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where.append(" and(");
|
|
|
- where.append("t1.sonum like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
- where.append("or t4.name like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
- where.append("or t1.remarks like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
- where.append(")");
|
|
|
- }
|
|
|
//状态
|
|
|
if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
|
|
|
- where.append(" and(");
|
|
|
- where.append("t1.status like'%").append(whereObject.getString("status")).append("%' ");
|
|
|
- where.append(")");
|
|
|
+ JSONArray statusArray = whereObject.getJSONArray("status");
|
|
|
+ for (int i = 0; i < statusArray.size(); i++) {
|
|
|
+ statusList.add(statusArray.getString(i));
|
|
|
+ }
|
|
|
}
|
|
|
//品牌
|
|
|
if (whereObject.containsKey("brandname") && !"".equals(whereObject.getString("brandname"))) {
|
|
@@ -66,12 +62,12 @@ public class Order extends Controller {
|
|
|
}
|
|
|
boolean isExport = content.getBooleanValue("isExport");
|
|
|
QuerySQL querySQL = queryList(where.toString());
|
|
|
- querySQL.setOrderBy(pageSorting);
|
|
|
- Rows rows;
|
|
|
-// if (!isExport) {
|
|
|
+ if (!statusList.isEmpty()) {
|
|
|
+ querySQL.setWhere("t1.status", statusList);
|
|
|
+ }
|
|
|
+ querySQL.setOrderBy("t1.sa_orderid desc");
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
-// }
|
|
|
- rows = querySQL.query();
|
|
|
+ Rows rows = querySQL.query();
|
|
|
|
|
|
//查询数据:amount,defaultamount,qty
|
|
|
ArrayList<Long> sa_orderids = rows.toArrayList("sa_orderid", new ArrayList<>());
|
|
@@ -90,22 +86,6 @@ public class Order extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// if (isExport) {
|
|
|
-// //去除不需要导出项
|
|
|
-// rows.getFieldList().remove("sa_orderid");
|
|
|
-// rows.getFieldList().remove("submitdate");
|
|
|
-// rows.getFieldList().remove("checkdate");
|
|
|
-// rows.getFieldList().remove("typemx");
|
|
|
-// rows.getFieldList().remove("sys_enterpriseid");
|
|
|
-// //添加
|
|
|
-// rows.getFieldList().add("amount");
|
|
|
-// rows.getFieldList().add("qty");
|
|
|
-// Rows uploadRows = uploadExcelToObs("order", "订单列表", rows, getTitleMap());
|
|
|
-// return getSucReturnObject().setData(uploadRows).toString();
|
|
|
-// }
|
|
|
-// if (systemclient.equalsIgnoreCase("web")) {
|
|
|
-// return getSucReturnObject().setData(rows).toString();
|
|
|
-// }
|
|
|
|
|
|
sqlFactory = new SQLFactory(this, "订单-查询筛选出的价格");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
@@ -127,6 +107,7 @@ public class Order extends Controller {
|
|
|
"brandname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_contacts", "t4", "t4.contactsid = t1.rec_contactsid and t4.siteid = t1.siteid",
|
|
|
"name");
|
|
|
+ querySQL.setCondition("t1.sonum", "t4.name", "t1.remarks");
|
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
|
querySQL.setWhere(where);
|
|
|
querySQL.setWhere("t1.sys_enterpriseid = $sys_enterpriseid$");
|