|
@@ -124,7 +124,6 @@ public class personnelstatistics extends Controller {
|
|
|
//年份
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
- long sa_saleareaid=content.getLongValue("sa_saleareaid");
|
|
|
Rows billRows = dbConnect.runSqlQuery("SELECT sa_salestargetbillid,assessmentindicators,statisticaldimension,sa_accountclassids FROM sa_salestargetbill WHERE year="+year+" AND siteid ='" + siteid + "' and targettype = '人员目标'");
|
|
|
|
|
|
SQLFactory hrsqlFactory = new SQLFactory(this, "业务员列表查询");
|
|
@@ -137,6 +136,12 @@ public class personnelstatistics extends Controller {
|
|
|
// sa_saleareaid=hrrows.get(0).getLong("sa_saleareaid");
|
|
|
// }
|
|
|
// }
|
|
|
+ SQLFactory areasqlFactory = new SQLFactory(this, "下级区域获取");
|
|
|
+ areasqlFactory.addParameter("siteid", siteid);
|
|
|
+ areasqlFactory.addParameter_in("sa_saleareaid", hrrows.toArrayList("sa_saleareaid",new ArrayList<>()));
|
|
|
+ Rows arearows = dbConnect.runSqlQuery(areasqlFactory.getSQL());
|
|
|
+ ArrayList<Long> areaList = arearows.toArrayList("sa_saleareaid",new ArrayList<Long>());
|
|
|
+
|
|
|
|
|
|
//考核指标类型
|
|
|
long sa_salestargetbillid = 0;
|
|
@@ -155,7 +160,13 @@ public class personnelstatistics extends Controller {
|
|
|
/*
|
|
|
过滤条件设置
|
|
|
*/
|
|
|
- StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+ StringBuffer where = new StringBuffer();
|
|
|
+ if(areaList.size()>0){
|
|
|
+ where = where.append(" 1=1 and t.sa_saleareaid in "+areaList.toString().replace("[", "(").replace("]", ")"));
|
|
|
+ }else{
|
|
|
+ where = where.append(" 1=1 ");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "人员-目标详情列表");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
@@ -342,10 +353,15 @@ public class personnelstatistics extends Controller {
|
|
|
}
|
|
|
Rows rowsResult =new Rows();
|
|
|
for (Row row : rows) {
|
|
|
- if(hrrowsMap.containsKey(row.getString("sa_saleareaid"))){
|
|
|
+ if(hrrows.size()!=0){
|
|
|
+ if(hrrowsMap.containsKey(row.getString("sa_saleareaid"))){
|
|
|
+ rowsResult.add(row);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
rowsResult.add(row);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
for (Row row : rowsResult) {
|