|
@@ -403,11 +403,17 @@ public class salearea extends Controller {
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
ArrayList<Long> ids = rows.toArrayList("sys_enterpriseid", new ArrayList<>());
|
|
|
+ ids.add(0l);
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "查询经销商主账号信息");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter_in("sys_enterpriseid", ids);
|
|
|
RowsMap rowsMap = dbConnect.runSqlQuery(sqlFactory).toRowsMap("sys_enterpriseid");
|
|
|
+ String sql ="select t1.sys_enterpriseid,t2.areaname from sys_enterprise_tradefield t1 inner join sa_salearea t2 on t1.sa_saleareaid=t2.sa_saleareaid and t1.siteid=t2.siteid where t1.siteid='"+siteid+"' and t1.sys_enterpriseid in"+ids;
|
|
|
+ sql = sql.replace("[", "(").replace("]", ")");
|
|
|
+ Rows enterpriseSaleareaRows =dbConnect.runSqlQuery(sql);
|
|
|
+ RowsMap enterpriseSaleareaRowsMap =enterpriseSaleareaRows.toRowsMap("sys_enterpriseid");
|
|
|
+
|
|
|
for (Row row : rows) {
|
|
|
Rows tempRows = rowsMap.getOrDefault(row.getString("sys_enterpriseid"), new Rows());
|
|
|
if (tempRows.isNotEmpty()) {
|
|
@@ -417,6 +423,11 @@ public class salearea extends Controller {
|
|
|
row.put("userid", 0);
|
|
|
row.put("accountno", "");
|
|
|
}
|
|
|
+ if(enterpriseSaleareaRowsMap.containsKey(row.getString("sys_enterpriseid"))){
|
|
|
+ row.put("areaname", enterpriseSaleareaRowsMap.get(row.getString("sys_enterpriseid")).get(0).getString("areaname"));
|
|
|
+ }else{
|
|
|
+ row.put("areaname", "");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|