|
|
@@ -7,6 +7,7 @@ import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.data.*;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
|
import restcontroller.R;
|
|
|
import restcontroller.webmanage.saletool.orderclue.ExportExcel;
|
|
|
@@ -106,29 +107,49 @@ public class personnelstatistics extends Controller {
|
|
|
// return getSucReturnObject().setData(arearows).toString();
|
|
|
// }
|
|
|
|
|
|
+ @API(title = "查询当前账户负责的区域", apiversion = R.ID20231108160203.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryList_currentArea() throws YosException {
|
|
|
+ SQLFactory hrsqlFactory = new SQLFactory(this, "业务员列表查询");
|
|
|
+ hrsqlFactory.addParameter("siteid", siteid);
|
|
|
+ hrsqlFactory.addParameter("hrid", hrid);
|
|
|
+ Rows hrrows = dbConnect.runSqlQuery(hrsqlFactory.getSQL());
|
|
|
+ return getSucReturnObject().setData(hrrows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "人员目标统计(区域经理)", apiversion = R.ID20231018103203.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryList_areamanager() throws YosException {
|
|
|
//年份
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
-
|
|
|
- Rows billRows = dbConnect.runSqlQuery("SELECT sa_salestargetbillid,assessmentindicators FROM sa_salestargetbill WHERE year="+year+" AND siteid ='" + siteid + "' and targettype = '人员目标'");
|
|
|
+ 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, "业务员列表查询");
|
|
|
hrsqlFactory.addParameter("siteid", siteid);
|
|
|
hrsqlFactory.addParameter("hrid", hrid);
|
|
|
Rows hrrows = dbConnect.runSqlQuery(hrsqlFactory.getSQL());
|
|
|
- long sa_saleareaid=0;
|
|
|
- if(hrrows.isNotEmpty()){
|
|
|
- sa_saleareaid=hrrows.get(0).getLong("sa_saleareaid");
|
|
|
+
|
|
|
+ if(sa_saleareaid==0){
|
|
|
+ if(hrrows.isNotEmpty()){
|
|
|
+ sa_saleareaid=hrrows.get(0).getLong("sa_saleareaid");
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
//考核指标类型
|
|
|
long sa_salestargetbillid = 0;
|
|
|
String assessmentindicators="";
|
|
|
+ //统计维度
|
|
|
+ String statisticaldimension="";
|
|
|
+ //账户
|
|
|
+ String sa_accountclassids="";
|
|
|
if (billRows.isNotEmpty()) {
|
|
|
sa_salestargetbillid=billRows.get(0).getLong("sa_salestargetbillid");
|
|
|
assessmentindicators=billRows.get(0).getString("assessmentindicators");
|
|
|
+ statisticaldimension=billRows.get(0).getString("statisticaldimension");
|
|
|
+ sa_accountclassids=billRows.get(0).getString("sa_accountclassids");
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -193,9 +214,26 @@ public class personnelstatistics extends Controller {
|
|
|
Rows actualRows = new Rows();
|
|
|
//开票
|
|
|
if (assessmentindicators .equals("开票")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-开票");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
@@ -203,27 +241,78 @@ public class personnelstatistics extends Controller {
|
|
|
}
|
|
|
//订单
|
|
|
if (assessmentindicators .equals("订单")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-订单");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//出货
|
|
|
if (assessmentindicators .equals("出货")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-出货");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//收款
|
|
|
if (assessmentindicators .equals("收款")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-收款");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(statisticaldimension)){
|
|
|
+ if(isJSONArray(statisticaldimension)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
@@ -284,7 +373,7 @@ public class personnelstatistics extends Controller {
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
int year = cal.get(Calendar.YEAR);
|
|
|
|
|
|
- Rows billRows = dbConnect.runSqlQuery("SELECT sa_salestargetbillid,assessmentindicators FROM sa_salestargetbill WHERE year="+year+" AND siteid ='" + siteid + "' and targettype = '人员目标'");
|
|
|
+ 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, "业务员列表查询");
|
|
|
hrsqlFactory.addParameter("siteid", siteid);
|
|
|
@@ -302,9 +391,15 @@ public class personnelstatistics extends Controller {
|
|
|
//考核指标类型
|
|
|
long sa_salestargetbillid = 0;
|
|
|
String assessmentindicators="";
|
|
|
+ //统计维度
|
|
|
+ String statisticaldimension="";
|
|
|
+ //账户
|
|
|
+ String sa_accountclassids="";
|
|
|
if (billRows.isNotEmpty()) {
|
|
|
sa_salestargetbillid=billRows.get(0).getLong("sa_salestargetbillid");
|
|
|
assessmentindicators=billRows.get(0).getString("assessmentindicators");
|
|
|
+ statisticaldimension=billRows.get(0).getString("statisticaldimension");
|
|
|
+ sa_accountclassids=billRows.get(0).getString("sa_accountclassids");
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -369,9 +464,26 @@ public class personnelstatistics extends Controller {
|
|
|
Rows actualRows = new Rows();
|
|
|
//开票
|
|
|
if (assessmentindicators .equals("开票")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-开票");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
@@ -379,27 +491,78 @@ public class personnelstatistics extends Controller {
|
|
|
}
|
|
|
//订单
|
|
|
if (assessmentindicators .equals("订单")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-订单");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//出货
|
|
|
if (assessmentindicators .equals("出货")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-出货");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//收款
|
|
|
if (assessmentindicators .equals("收款")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-收款");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(statisticaldimension)){
|
|
|
+ if(isJSONArray(statisticaldimension)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
@@ -453,13 +616,19 @@ public class personnelstatistics extends Controller {
|
|
|
public String queryList() throws YosException {
|
|
|
//年份
|
|
|
Long sa_salestargetbillid = content.getLong("sa_salestargetbillid");
|
|
|
- Rows billRows = dbConnect.runSqlQuery("SELECT assessmentindicators,year FROM sa_salestargetbill WHERE sa_salestargetbillid=" + sa_salestargetbillid + " AND siteid ='" + siteid + "'");
|
|
|
+ Rows billRows = dbConnect.runSqlQuery("SELECT assessmentindicators,year,statisticaldimension,sa_accountclassids FROM sa_salestargetbill WHERE sa_salestargetbillid=" + sa_salestargetbillid + " AND siteid ='" + siteid + "'");
|
|
|
|
|
|
//考核指标类型
|
|
|
String assessmentindicators = "";
|
|
|
+ //统计维度
|
|
|
+ String statisticaldimension="";
|
|
|
+ //账户
|
|
|
+ String sa_accountclassids="";
|
|
|
long year = 2023;
|
|
|
if (billRows.isNotEmpty()) {
|
|
|
assessmentindicators=billRows.get(0).getString("assessmentindicators");
|
|
|
+ statisticaldimension=billRows.get(0).getString("statisticaldimension");
|
|
|
+ sa_accountclassids=billRows.get(0).getString("sa_accountclassids");
|
|
|
year=billRows.get(0).getLong("year");
|
|
|
}
|
|
|
|
|
|
@@ -537,9 +706,26 @@ public class personnelstatistics extends Controller {
|
|
|
Rows actualRows = new Rows();
|
|
|
//开票
|
|
|
if (assessmentindicators .equals("开票")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-开票");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
@@ -547,31 +733,82 @@ public class personnelstatistics extends Controller {
|
|
|
}
|
|
|
//订单
|
|
|
if (assessmentindicators .equals("订单")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-订单");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(statisticaldimension.equals("订单审核")){
|
|
|
+ where1=where1+" and t2.status='审核'";
|
|
|
+ }else{
|
|
|
+ where1=where1+" and t2.status='提交'";
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//出货
|
|
|
if (assessmentindicators .equals("出货")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-出货");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t2.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
//收款
|
|
|
if (assessmentindicators .equals("收款")) {
|
|
|
+ String where1 =" 1=1 ";
|
|
|
sqlFactory = new SQLFactory(this, "人员目标统计-收款");
|
|
|
sqlFactory.addParameter("sa_salestargetbillid", sa_salestargetbillid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
+ if(StringUtils.isNotBlank(statisticaldimension)){
|
|
|
+ if(isJSONArray(statisticaldimension)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(statisticaldimension);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1= where1+ " and (t1.class in"+jsonArrayResult+" or t1.subclass in"+jsonArrayResult+")";
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(sa_accountclassids)){
|
|
|
+ if(isJSONArray(sa_accountclassids)){
|
|
|
+ JSONArray jsonArrayResult = JSONArray.parseArray(sa_accountclassids);
|
|
|
+ if(!jsonArrayResult.isEmpty()){
|
|
|
+ where1=where1+ " and t1.sa_accountclassid in"+jsonArrayResult;
|
|
|
+ where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter_SQL("where1",where1);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("year", year);
|
|
|
actualRows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
}
|
|
|
+
|
|
|
if(!saleareas.isEmpty() && saleareas.size()==1){
|
|
|
for (Row row :actualRows) {
|
|
|
if(row.getLong("parentid")==0){
|