Explorar el Código

crm同步错误修复

shenjingwei hace 5 meses
padre
commit
01c5f568ea
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      src/custom/common/crm/bean/core/CrmBase.java

+ 3 - 3
src/custom/common/crm/bean/core/CrmBase.java

@@ -162,14 +162,14 @@ public abstract class CrmBase extends BaseClass {
 
         public void suc() throws YosException {
             ArrayList<String> sqlist = new ArrayList<>();
-            sqlist.add("update crm_datasync set status=1,changedate=now() where ownertable='" + ownertable + "' and id =" + id);
-            sqlist.add("delete from crm_datasync where ownertable='" + ownertable + "' and id <" + id + " and status=0");
+            sqlist.add("update crm_datasync set status=1,changedate=now() where ownertable='" + ownertable + "' and c=" + ownerid + " and id =" + id);
+            sqlist.add("delete from crm_datasync where ownertable='" + ownertable + "' and ownerid=" + ownerid + " and id <" + id + " and status=0");
             dbConnect.runSqlUpdate(sqlist);
             logger.info(title + " ownertable=" + ownertable + " ownerid=" + ownerid + " 同步成功!");
         }
 
         public void del() throws YosException {
-            dbConnect.runSqlUpdate("delete from crm_datasync where ownertable='" + ownertable + "'and id<=" + id + " and status=0");
+            dbConnect.runSqlUpdate("delete from crm_datasync where ownertable='" + ownertable + "' and ownerid=" + ownerid + " and id<=" + id + " and status=0");
             logger.error(title + " ownertable=" + ownertable + " ownerid=" + ownerid + " 数据已不存在!");
         }