|
@@ -64,15 +64,6 @@ public class Order extends Controller {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
boolean isExport = content.getBooleanValue("isExport");
|
|
boolean isExport = content.getBooleanValue("isExport");
|
|
|
-// SQLFactory sqlFactory = new SQLFactory(this, "订单_列表", pageSize, pageNumber, pageSorting);
|
|
|
|
|
-// if (isExport) {
|
|
|
|
|
-// sqlFactory = new SQLFactory(this, "订单_列表");
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// sqlFactory.addParameter("siteid", siteid);
|
|
|
|
|
-// sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
|
|
-// sqlFactory.addParameter_SQL("where", where);
|
|
|
|
|
-// Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
QuerySQL querySQL = queryList(where.toString());
|
|
QuerySQL querySQL = queryList(where.toString());
|
|
|
querySQL.setOrderBy(pageSorting);
|
|
querySQL.setOrderBy(pageSorting);
|
|
|
Rows rows;
|
|
Rows rows;
|
|
@@ -88,19 +79,18 @@ public class Order extends Controller {
|
|
|
sqlFactory.addParameter_in("sa_orderid", sa_orderids);
|
|
sqlFactory.addParameter_in("sa_orderid", sa_orderids);
|
|
|
RowsMap dataRowsMap = dbConnect.runSqlQuery(sqlFactory).toRowsMap("sa_orderid");
|
|
RowsMap dataRowsMap = dbConnect.runSqlQuery(sqlFactory).toRowsMap("sa_orderid");
|
|
|
//查询收货人信息
|
|
//查询收货人信息
|
|
|
- ArrayList<Long> rec_contactsids = rows.toArrayList("rec_contactsid", new ArrayList<>());
|
|
|
|
|
- RowsMap contactsidRowsMap = beans.order.Order.getContactsRowsMap(this, rec_contactsids);
|
|
|
|
|
|
|
+// ArrayList<Long> rec_contactsids = rows.toArrayList("rec_contactsid", new ArrayList<>());
|
|
|
|
|
+// RowsMap contactsidRowsMap = beans.order.Order.getContactsRowsMap(this, rec_contactsids);
|
|
|
for (Row row : rows) {
|
|
for (Row row : rows) {
|
|
|
Rows dataRows = dataRowsMap.getOrDefault(row.getString("sa_orderid"), new Rows());
|
|
Rows dataRows = dataRowsMap.getOrDefault(row.getString("sa_orderid"), new Rows());
|
|
|
if (dataRows.isNotEmpty()) {
|
|
if (dataRows.isNotEmpty()) {
|
|
|
row.putAll(dataRows.get(0));
|
|
row.putAll(dataRows.get(0));
|
|
|
} else {
|
|
} else {
|
|
|
row.put("amount", 0);
|
|
row.put("amount", 0);
|
|
|
- row.put("defaultamount", 0);
|
|
|
|
|
row.put("qty", 0);
|
|
row.put("qty", 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- row.put("contacts", contactsidRowsMap.getOrDefault(row.getString("rec_contactsid"), new Rows()));
|
|
|
|
|
|
|
+// row.put("contacts", contactsidRowsMap.getOrDefault(row.getString("rec_contactsid"), new Rows()));
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -117,11 +107,15 @@ public class Order extends Controller {
|
|
|
Rows uploadRows = uploadExcelToObs("order", "订单列表", rows, getTitleMap());
|
|
Rows uploadRows = uploadExcelToObs("order", "订单列表", rows, getTitleMap());
|
|
|
return getSucReturnObject().setData(uploadRows).toString();
|
|
return getSucReturnObject().setData(uploadRows).toString();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (systemclient.equals("web")) {
|
|
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
sqlFactory = new SQLFactory(this, "订单-查询筛选出的价格");
|
|
sqlFactory = new SQLFactory(this, "订单-查询筛选出的价格");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
|
|
+
|
|
|
Rows amountrows = dbConnect.runSqlQuery(sqlFactory);
|
|
Rows amountrows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -130,19 +124,20 @@ public class Order extends Controller {
|
|
|
|
|
|
|
|
//查询订单列表(经销商)
|
|
//查询订单列表(经销商)
|
|
|
public QuerySQL queryList(String where) throws YosException {
|
|
public QuerySQL queryList(String where) throws YosException {
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_order");
|
|
|
|
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_order",
|
|
|
|
|
+ "sa_orderid","sonum","status","type","billdate","tradefield","remarks");
|
|
|
querySQL.setTableAlias("t1");
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_brand", "t3", "t3.sa_brandid = t1.sa_brandid",
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_brand", "t3", "t3.sa_brandid = t1.sa_brandid",
|
|
|
"brandname");
|
|
"brandname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_contacts", "t4", "t4.contactsid = t1.rec_contactsid and t4.siteid = t1.siteid",
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise_contacts", "t4", "t4.contactsid = t1.rec_contactsid and t4.siteid = t1.siteid",
|
|
|
- "name", "province", "city", "county", "address", "phonenumber");
|
|
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sys_dataextend", "t5", "t5.ownerid=t1.sa_orderid and t5.siteid=t1.siteid and t5.ownertable='sa_order'",
|
|
|
|
|
- "backreason");
|
|
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sys_hr", "t6", "t6.hrid = t1.saler_hrid and t6.siteid = t1.siteid");
|
|
|
|
|
- //设置别名
|
|
|
|
|
- querySQL.addQueryFields("salename", "t6.name");
|
|
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sa_project", "t7", "t7.sa_projectid = t1.sa_projectid and t7.siteid = t1.siteid",
|
|
|
|
|
- "projectname");
|
|
|
|
|
|
|
+ "name");
|
|
|
|
|
+// querySQL.addJoinTable(JOINTYPE.left, "sys_dataextend", "t5", "t5.ownerid=t1.sa_orderid and t5.siteid=t1.siteid and t5.ownertable='sa_order'",
|
|
|
|
|
+// "backreason");
|
|
|
|
|
+// querySQL.addJoinTable(JOINTYPE.left, "sys_hr", "t6", "t6.hrid = t1.saler_hrid and t6.siteid = t1.siteid");
|
|
|
|
|
+// //设置别名
|
|
|
|
|
+// querySQL.addQueryFields("salename", "t6.name");
|
|
|
|
|
+// querySQL.addJoinTable(JOINTYPE.left, "sa_project", "t7", "t7.sa_projectid = t1.sa_projectid and t7.siteid = t1.siteid",
|
|
|
|
|
+// "projectname");
|
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
|
querySQL.setWhere(where);
|
|
querySQL.setWhere(where);
|
|
|
querySQL.setWhere("t1.type!='工具借用单'");
|
|
querySQL.setWhere("t1.type!='工具借用单'");
|