|
|
@@ -1,5 +1,6 @@
|
|
|
package restcontroller.sale.customer;
|
|
|
|
|
|
+import beans.CommonHepler;
|
|
|
import beans.brand.Brand;
|
|
|
import beans.datacontrllog.DataContrlLog;
|
|
|
import beans.dataextend.DataExtend;
|
|
|
@@ -756,8 +757,8 @@ public class Hospital extends Controller {
|
|
|
querySQL.setOrderBy("t1.createdate desc");
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
- RowsMap areaRowsMap = getAreaRowsMap(rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
- RowsMap salerRowsMap = getSalerNameRowsMap(rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
+ RowsMap areaRowsMap = CommonHepler.getAreaRowsMap(this, rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
+ RowsMap salerRowsMap = CommonHepler.getSalerNameRowsMap(this, rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
for (Row row : rows) {
|
|
|
row.put("p_c_c", row.getString("province") + "-" + row.getString("city") + "-" + row.getString("county"));
|
|
|
Rows areaRows = areaRowsMap.getOrDefault(row.getString("sa_agentsid"), new Rows());
|
|
|
@@ -770,31 +771,6 @@ public class Hospital extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
- public RowsMap getAreaRowsMap(ArrayList<Long> sa_agentsids) throws YosException {
|
|
|
- if (sa_agentsids.size() == 0) {
|
|
|
- return new RowsMap();
|
|
|
- }
|
|
|
-
|
|
|
- String sql = "SELECT DISTINCT t2.areaname,t1.sa_agentsid from sys_enterprise_tradefield t1 " +
|
|
|
- "INNER JOIN sa_salearea t2 ON t2.sa_saleareaid=t1.sa_saleareaid " +
|
|
|
- "WHERE t1.siteid='YOSTEST1' and t1.sa_agentsid in " + sa_agentsids;
|
|
|
- sql = sql.replace("[", "(").replace("]", ")");
|
|
|
-
|
|
|
- return dbConnect.runSqlQuery(sql).toRowsMap("sa_agentsid");
|
|
|
- }
|
|
|
-
|
|
|
- public RowsMap getSalerNameRowsMap(ArrayList<Long> sa_agentsids) throws YosException {
|
|
|
- if (sa_agentsids.size() == 0) {
|
|
|
- return new RowsMap();
|
|
|
- }
|
|
|
- String sql = "SELECT DISTINCT t2.name,t1.sa_agentsid from sys_enterprise_tradefield t1 " +
|
|
|
- "INNER JOIN sys_hr t2 ON t2.hrid=t1.hrid " +
|
|
|
- "WHERE t1.siteid='YOSTEST1' and t1.sa_agentsid in " + sa_agentsids;
|
|
|
- sql = sql.replace("[", "(").replace("]", ")");
|
|
|
-
|
|
|
- return dbConnect.runSqlQuery(sql).toRowsMap("sa_agentsid");
|
|
|
- }
|
|
|
-
|
|
|
@API(title = "添加经销商", apiversion = R.ID2025102713181402.v1.class)
|
|
|
public String addAgents() throws YosException {
|
|
|
|
|
|
@@ -881,8 +857,8 @@ public class Hospital extends Controller {
|
|
|
querySQL.setOrderBy("t1.createdate desc");
|
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
- RowsMap areaRowsMap = getAreaRowsMap(rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
- RowsMap salerRowsMap = getSalerNameRowsMap(rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
+ RowsMap areaRowsMap = CommonHepler.getAreaRowsMap(this, rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
+ RowsMap salerRowsMap = CommonHepler.getSalerNameRowsMap(this, rows.toArrayList("sa_agentsid", new ArrayList<>()));
|
|
|
for (Row row : rows) {
|
|
|
row.put("p_c_c", row.getString("province") + "-" + row.getString("city") + "-" + row.getString("county"));
|
|
|
Rows areaRows = areaRowsMap.getOrDefault(row.getString("sa_agentsid"), new Rows());
|