wu 4 tháng trước cách đây
mục cha
commit
b914735a9d

+ 1 - 2
src/custom/restcontroller/system/datafollowup/SQL/数据跟进日志修改.sql

@@ -8,8 +8,7 @@ set type=$type$,
     changeby=$username$,
     changedate=now(),
     dataextend=$dataextend$,
-    iswrite=1,
-    squarestage=$squarestage$
+    iswrite=1
 where siteid = $siteid$
   and ownertable = $ownertable$
   and ownerid = $ownerid$

+ 2 - 3
src/custom/restcontroller/system/datafollowup/SQL/数据跟进日志创建.sql

@@ -15,7 +15,7 @@ insert into sys_datafollowup(sys_datafollowupid,
                              target,
                              results,
                              nextplan,
-                             iswrite,resource,squarestage)
+                             iswrite,resource)
 select $sys_datafollowupid$,
        $siteid$,
        $type$,
@@ -34,5 +34,4 @@ select $sys_datafollowupid$,
        $results$,
        $nextplan$,
        1,
-       $resource$,
-       $squarestage$
+       $resource$

+ 1 - 2
src/custom/restcontroller/system/datafollowup/SQL/数据跟进日志查询.sql

@@ -13,8 +13,7 @@ select sys_datafollowupid,
        nextplan,
        iswrite,
        ownertable,
-       resource,
-       squarestage
+       resource
 from sys_datafollowup t
 where siteid = $siteid$
   and ownertable = $ownertable$

+ 2 - 4
src/custom/restcontroller/system/datafollowup/SQL/数据跟进日志查询_通讯录.sql

@@ -14,8 +14,7 @@ from (select sys_datafollowupid,
              nextplan,
              iswrite,
              ownertable,
-             resource,
-             squarestage
+             resource
       from sys_datafollowup
       where siteid = $siteid$
         and ownertable = $ownertable$
@@ -37,8 +36,7 @@ from (select sys_datafollowupid,
              t1.nextplan,
              t1.iswrite,
              t1.ownertable,
-             t1.resource,
-             t1.squarestage
+             t1.resource
       from sys_datafollowup t1
                left join sa_customers t2
                          on t1.siteid = t2.siteid and t1.ownerid = t2.sa_customersid and t1.ownertable = 'sa_customers'

+ 1 - 2
src/custom/restcontroller/system/datafollowup/SQL/数据跟进日志详情查询.sql

@@ -13,8 +13,7 @@ select sys_datafollowupid,
        nextplan,
        iswrite,
        ownertable,
-       resource,
-       squarestage
+       resource
 from sys_datafollowup
 where siteid = $siteid$
   and sys_datafollowupid = $sys_datafollowupid$

+ 1 - 23
src/custom/restcontroller/system/datafollowup/datafollowup.java

@@ -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();
     }