|
|
@@ -16,7 +16,6 @@ import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
import common.data.*;
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
import restcontroller.R;
|
|
|
import restcontroller.webmanage.executorService.Executor;
|
|
|
|
|
|
@@ -217,7 +216,6 @@ public class datafollowup extends Controller {
|
|
|
String results = content.getStringValue("results");
|
|
|
String nextplan = content.getStringValue("nextplan");
|
|
|
String resource = content.getStringValue("resource");
|
|
|
- String squarestage = content.getStringValue("squarestage");
|
|
|
if (resource.equals("通讯录")) {
|
|
|
resource = "联系人";
|
|
|
}
|
|
|
@@ -253,10 +251,8 @@ public class datafollowup extends Controller {
|
|
|
|
|
|
}
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
- boolean isInsert = true;
|
|
|
SQLFactory sqlFactory;
|
|
|
if (sys_datafollowupid <= 0 || dbConnect.runSqlQuery("select * from sys_datafollowup where siteid='" + siteid + "' and ownertable='" + ownertable + "' and ownerid='" + ownerid + "' and sys_datafollowupid='" + sys_datafollowupid + "'").isEmpty()) {
|
|
|
- isInsert = true;
|
|
|
sys_datafollowupid = createTableID("sys_datafollowup");
|
|
|
sqlFactory = new SQLFactory(this, "数据跟进日志创建");
|
|
|
sqlFactory.addParameter("sys_datafollowupid", sys_datafollowupid);
|
|
|
@@ -270,13 +266,11 @@ public class datafollowup extends Controller {
|
|
|
sqlFactory.addParameter("target", target);
|
|
|
sqlFactory.addParameter("results", results);
|
|
|
sqlFactory.addParameter("nextplan", nextplan);
|
|
|
- sqlFactory.addParameter("squarestage", squarestage);
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
sqlFactory.addParameter("username", username);
|
|
|
content.put("sys_datafollowupid", sys_datafollowupid);
|
|
|
sqlList.add(DataContrlLog.createLog(this, ownertable, ownerid, "新增跟进动态", "新增跟进动态【" + contentstr + "】").getSQL());
|
|
|
} else {
|
|
|
- isInsert = false;
|
|
|
Rows rows = dbConnect.runSqlQuery("select *from sys_datafollowup where siteid='" + siteid + "' and sys_datafollowupid=" + sys_datafollowupid);
|
|
|
if (rows.get(0).getLong("createuserid") != userid) {
|
|
|
return getReturnObject().setCode("0134", new String[0]).toString();//非跟进创建人不可进行修改操作
|
|
|
@@ -291,7 +285,6 @@ public class datafollowup extends Controller {
|
|
|
sqlFactory.addParameter("target", target);
|
|
|
sqlFactory.addParameter("results", results);
|
|
|
sqlFactory.addParameter("nextplan", nextplan);
|
|
|
- sqlFactory.addParameter("squarestage", squarestage);
|
|
|
sqlFactory.addParameter("dataextend", dataextend.toString());
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
sqlFactory.addParameter("username", username);
|
|
|
@@ -309,7 +302,7 @@ public class datafollowup extends Controller {
|
|
|
sqlList.add(insertSQL.getSQL());
|
|
|
}
|
|
|
//关联线索
|
|
|
- if (ownertable.equals("sys_phonebook") && resource.equals("联系人")) {
|
|
|
+ if (ownertable.equals("sys_phonebook")&&resource.equals("联系人")) {
|
|
|
Rows datafollowuprows = dbConnect.runSqlQuery("select *from sys_datafollowup where siteid='" + siteid + "' and sys_datafollowupid=" + sys_datafollowupid);
|
|
|
//删除数据
|
|
|
if (datafollowuprows.isNotEmpty()) {
|
|
|
@@ -446,21 +439,6 @@ public class datafollowup extends Controller {
|
|
|
if (ownertable.equals("sa_project")) {
|
|
|
Executor.sendEml_controller(this, "project_follow", ownerid, extradata);
|
|
|
}
|
|
|
- if (ownertable.equals("sa_project") && !StringUtils.isBlank(squarestage) && isInsert) {
|
|
|
- sqlList.clear();
|
|
|
- Long sa_projectid = ownerid;
|
|
|
- Long sa_project_stageid = content.getLongValue("sa_project_stageid");
|
|
|
-
|
|
|
- Rows onstageRows = dbConnect.runSqlQuery("select stagename from sa_project_stage where siteid='" + siteid + "' and sa_projectid=" + sa_projectid + " and active=1");
|
|
|
- Rows changestageRows = dbConnect.runSqlQuery("select stagename from sa_project_stage where siteid='" + siteid + "' and sa_project_stageid=" + sa_project_stageid);
|
|
|
- sqlList.add("UPDATE sa_project_stage SET active=0 WHERE active = 1 and siteid='" + siteid + "' AND sa_projectid = " + sa_projectid);
|
|
|
- sqlList.add("UPDATE sa_project_stage SET active=1 WHERE siteid='" + siteid + "' and sa_project_stageid = " + sa_project_stageid);
|
|
|
-
|
|
|
- String onstage = onstageRows.isNotEmpty() ? onstageRows.get(0).getString("stagename") : "";
|
|
|
- String changestage = changestageRows.isNotEmpty() ? changestageRows.get(0).getString("stagename") : "";
|
|
|
- sqlList.add(DataContrlLog.createLog(this, "sa_project", sa_projectid, "阶段变更", "由【" + onstage + "】阶段变更为【" + changestage + "】阶段").getSQL());
|
|
|
- dbConnect.runSqlUpdate(sqlList);
|
|
|
- }
|
|
|
return queryFollowUpMain();
|
|
|
}
|
|
|
|