|
|
@@ -160,38 +160,54 @@ public class serviceorder extends Controller {
|
|
|
RowsMap cityRowsMap = serviceagents.toRowsMap("city");
|
|
|
RowsMap provinceRowsMap = serviceagents.toRowsMap("province");
|
|
|
if (countyRowsMap.containsKey(rows.get(0).getString("county"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", countyRowsMap.get(rows.get(0).getString("county")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :countyRowsMap.get(rows.get(0).getString("county"))){
|
|
|
+ if(row.getString("province").equals(rows.get(0).getString("province"))
|
|
|
+ && row.getString("city").equals(rows.get(0).getString("city"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (cityRowsMap.containsKey(rows.get(0).getString("city"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", cityRowsMap.get(rows.get(0).getString("city")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :cityRowsMap.get(rows.get(0).getString("city"))){
|
|
|
+ if(row.getString("province").equals(rows.get(0).getString("province"))
|
|
|
+ && StringUtils.isBlank(row.getString("county"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else if (provinceRowsMap.containsKey(rows.get(0).getString("province"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", provinceRowsMap.get(rows.get(0).getString("province")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :provinceRowsMap.get(rows.get(0).getString("province"))){
|
|
|
+ if(StringUtils.isBlank(row.getString("city"))
|
|
|
+ && StringUtils.isBlank(row.getString("county"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
@@ -200,38 +216,54 @@ public class serviceorder extends Controller {
|
|
|
RowsMap cityRowsMap = serviceagents.toRowsMap("city");
|
|
|
RowsMap provinceRowsMap = serviceagents.toRowsMap("province");
|
|
|
if (countyRowsMap.containsKey(rows.get(0).getString("county"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", countyRowsMap.get(rows.get(0).getString("county")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :countyRowsMap.get(rows.get(0).getString("county"))){
|
|
|
+ if(row.getString("province").equals(rows.get(0).getString("province"))
|
|
|
+ && row.getString("city").equals(rows.get(0).getString("city"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (cityRowsMap.containsKey(rows.get(0).getString("city"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", cityRowsMap.get(rows.get(0).getString("city")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :cityRowsMap.get(rows.get(0).getString("city"))){
|
|
|
+ if(row.getString("province").equals(rows.get(0).getString("province"))
|
|
|
+ && StringUtils.isBlank(row.getString("county"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else if (provinceRowsMap.containsKey(rows.get(0).getString("province"))) {
|
|
|
- UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
- updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
- updateSQL.setSiteid(siteid);
|
|
|
- updateSQL.setValue("status", "待受理");
|
|
|
- updateSQL.setValue("sys_enterpriseid_service", provinceRowsMap.get(rows.get(0).getString("province")).get(0).getLong("sys_enterpriseid"));
|
|
|
- updateSQL.setDateValue("allocationdate");
|
|
|
- updateSQL.setValue("allocationby", username);
|
|
|
- sqlList.add(updateSQL.getSQL());
|
|
|
- sqlList.add(
|
|
|
- DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ for(Row row :provinceRowsMap.get(rows.get(0).getString("province"))){
|
|
|
+ if(StringUtils.isBlank(row.getString("city"))
|
|
|
+ && StringUtils.isBlank(row.getString("county"))){
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
|
|
|
+ updateSQL.setUniqueid(sa_serviceorderid);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setValue("status", "待受理");
|
|
|
+ updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
|
|
|
+ updateSQL.setDateValue("allocationdate");
|
|
|
+ updateSQL.setValue("allocationby", username);
|
|
|
+ sqlList.add(updateSQL.getSQL());
|
|
|
+ sqlList.add(
|
|
|
+ DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Rows workersRows = dbConnect.runSqlQuery(
|