|
@@ -11,11 +11,9 @@ import common.data.Row;
|
|
|
import common.data.Rows;
|
|
|
import common.data.RowsMap;
|
|
|
import common.data.SQLFactory;
|
|
|
-import common.data.db.DataPool;
|
|
|
import restcontroller.R;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
|
|
|
@API(title = "提报")
|
|
|
public class submitedit extends Controller {
|
|
@@ -55,7 +53,7 @@ public class submitedit extends Controller {
|
|
|
ArrayList<Long> sa_saleareaids = userInfo.getSaleAreaIds();
|
|
|
sa_saleareaids.add((long) 0);
|
|
|
//查询条件
|
|
|
- String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentsId() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
+ String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentID() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
String whereSql = defSql + " AND isonlymanager = 0";
|
|
|
|
|
|
//是否是负责人
|
|
@@ -69,7 +67,7 @@ public class submitedit extends Controller {
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
sqlFactory.addParameter_SQL("whereSql", whereSql);
|
|
|
sqlFactory.addParameter("createuserid", userid);
|
|
|
- sqlFactory.addParameter("sa_agentsid", userInfo.getAgentsId() == 0 ? -1 : userInfo.getAgentsId());
|
|
|
+ sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID() == 0 ? -1 : userInfo.getAgentID());
|
|
|
sqlFactory.addParameter("hrid", hrid);
|
|
|
String sqlTest = sqlFactory.getSQL();
|
|
|
Rows submitrows = dbConnect.runSqlQuery(sqlTest);
|
|
@@ -104,7 +102,7 @@ public class submitedit extends Controller {
|
|
|
ArrayList<Long> sa_saleareaids = userInfo.getSaleAreaIds();
|
|
|
sa_saleareaids.add((long) 0);
|
|
|
//查询条件
|
|
|
- String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentsId() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
+ String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentID() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
String whereSql = defSql + " AND isonlymanager = 0";
|
|
|
whereSql = whereSql.replace("[", "(").replace("]", ")");
|
|
|
//是否是负责人
|
|
@@ -128,7 +126,7 @@ public class submitedit extends Controller {
|
|
|
ArrayList<Long> sa_saleareaids = userInfo.getSaleAreaIds();
|
|
|
sa_saleareaids.add((long) 0);
|
|
|
//查询条件
|
|
|
- String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentsId() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
+ String defSql = "SELECT sat_submiteditmodelid FROM sat_submiteditmodel_auth WHERE (departmentid IN ('" + departmentid + "') OR hrid in ('" + hrid + "') OR sa_agentsid in ('" + userInfo.getAgentID() + "') or sa_saleareaid in " + sa_saleareaids + ") ";
|
|
|
String whereSql = defSql + " AND isonlymanager = 0";
|
|
|
whereSql = whereSql.replace("[", "(").replace("]", ")");
|
|
|
//是否是负责人
|
|
@@ -222,10 +220,10 @@ public class submitedit extends Controller {
|
|
|
//查询提报明细是否存在
|
|
|
Rows sqlQuery;
|
|
|
//判断经销商是否存在
|
|
|
- if ( userInfo.getAgentsId() == 0) {
|
|
|
+ if ( userInfo.getAgentID() == 0) {
|
|
|
sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditmodelid='" + sat_submiteditmodelid + "' and siteid='" + siteid + "' and hrid='" + hrid + "'");
|
|
|
} else {
|
|
|
- sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditmodelid='" + sat_submiteditmodelid + "' and siteid='" + siteid + "' and sa_agentsid='" + userInfo.getAgentsId() + "'");
|
|
|
+ sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditmodelid='" + sat_submiteditmodelid + "' and siteid='" + siteid + "' and sa_agentsid='" + userInfo.getAgentID() + "'");
|
|
|
}
|
|
|
if (!sqlQuery.isEmpty()) {
|
|
|
if (rows.getRow(0).getBoolean("onceonly")) {
|
|
@@ -244,10 +242,10 @@ public class submitedit extends Controller {
|
|
|
//查询提报明细是否存在
|
|
|
Rows sqlQuery;
|
|
|
//判断经销商是否存在
|
|
|
- if ( userInfo.getAgentsId() == 0) {
|
|
|
+ if ( userInfo.getAgentID() == 0) {
|
|
|
sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditid='" + sat_submiteditid + "' and siteid='" + siteid + "' and hrid='" + hrid + "'");
|
|
|
} else {
|
|
|
- sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditid='" + sat_submiteditid + "' and siteid='" + siteid + "' and sa_agentsid='" + userInfo.getAgentsId() + "'");
|
|
|
+ sqlQuery = this.dbConnect.runSqlQuery("select sat_submiteditid,status from sat_submitedit where sat_submiteditid='" + sat_submiteditid + "' and siteid='" + siteid + "' and sa_agentsid='" + userInfo.getAgentID() + "'");
|
|
|
}
|
|
|
if (sqlQuery.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("该提报明细不存在").toString();
|
|
@@ -266,7 +264,7 @@ public class submitedit extends Controller {
|
|
|
sqlFactory.addParameter("hrid", hrid);
|
|
|
sqlFactory.addParameter("createdepid", departmentid);
|
|
|
sqlFactory.addParameter("authdepid", departmentid);
|
|
|
- sqlFactory.addParameter("sa_agentsid", userInfo.getAgentsId());
|
|
|
+ sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("authuserid", userid);
|
|
|
sqlFactory.addParameter("changeuserid", userid);
|
|
@@ -343,7 +341,7 @@ public class submitedit extends Controller {
|
|
|
public String selectdetailssubmit() throws YosException {
|
|
|
long sat_submiteditmodelid = content.getLongValue("sat_submiteditmodelid");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "查询具体经销商提报");
|
|
|
- sqlFactory.addParameter("sa_agentsid", userInfo.getAgentsId());
|
|
|
+ sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
sqlFactory.addParameter("sat_submiteditmodelid", sat_submiteditmodelid);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|