Kaynağa Gözat

新增活动删除接口
调整其他数据删除逻辑

沈静伟 4 yıl önce
ebeveyn
işleme
d6e808ae62

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/customer/noticemag/SQL/公告删除.sql

@@ -1 +1,2 @@
-delete from tnotice where siteid = $siteid$ and tnoticeid=$tnoticeid$
+delete from tnotice where siteid = $siteid$ and tnoticeid=$tnoticeid$
+delete from tnotice_userdata where siteid = $siteid$ and tnoticeid=$tnoticeid$

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/customer/products/SQL/商品删除.sql

@@ -0,0 +1,2 @@
+delete from tagents_product where siteid=$siteid$ and tagentsid=$tagentsid$ and tagents_productid=$tagents_productid$
+delete from tactivity_agentproducts where siteid=$siteid$ and tagentsid=$tagentsid$ and tagents_productid=$tagents_productid$

+ 6 - 1
src/dsb/com/cnd3b/restcontroller/customer/products/products.java

@@ -177,7 +177,12 @@ public class products extends Controller {
         if (!rows.isEmpty() && rows.get(0).getBoolean("fisonsale")) {
             return getErrReturnObject().setErrMsg("上架商品不可删除").toString();
         }
-        String status = dbConnect.runSqlUpdate("delete from tagents_product where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and tagents_productid='" + tagents_productid + "'");
+        SQLFactory sqlFactory=new SQLFactory(this,"商品删除");
+        sqlFactory.addParameter("siteid",siteid);
+        sqlFactory.addParameter("tagentsid",tagentsid);
+        sqlFactory.addParameter("tagents_productid",tagents_productid);
+
+        String status = dbConnect.runSqlUpdate(sqlFactory.getSQL());
         if ("true".equals(status)) {
             return getSucReturnObject().toString();
         } else {

+ 1 - 0
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/供需删除.sql

@@ -0,0 +1 @@
+delete from tsupplyanddemand where siteid=$siteid$ and tagentsid=$tagentsid$ and tsupplyanddemandid=$tsupplyanddemandid$

+ 5 - 1
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -270,7 +270,11 @@ public class supplyanddemand extends Controller {
         if (!rows.isEmpty() && !"新建".equals(rows.get(0).getString("fstatus"))) {
             return getErrReturnObject().setErrMsg("当前状态不可删除").toString();
         }
-        String status = dbConnect.runSqlUpdate("delete from tsupplyanddemand where siteid='" + siteid + "' and tagentsid='" + tagentsid + "' and tsupplyanddemandid='" + tsupplyanddemandid + "'");
+        SQLFactory sqlFactory=new SQLFactory(this,"供需删除");
+        sqlFactory.addParameter("siteid",siteid);
+        sqlFactory.addParameter("tagentsid",tagentsid);
+        sqlFactory.addParameter("tsupplyanddemandid",tsupplyanddemandid);
+        String status = dbConnect.runSqlUpdate(sqlFactory.getSQL());
         if ("true".equals(status)) {
             return getSucReturnObject().toString();
         } else {

+ 2 - 0
src/dsb/com/cnd3b/restcontroller/customer/tagents/SQL/解除合作关系.sql

@@ -0,0 +1,2 @@
+delete from tagents_cooperation
+where siteid=$siteid$ and tagentsid=$tagentsid$ and tcooperationagentsid=$tcooperationagentsid$

+ 5 - 3
src/dsb/com/cnd3b/restcontroller/customer/tagents/tagents.java

@@ -198,9 +198,11 @@ public class tagents extends Controller {
      */
     public String delete_cooperation() throws P2Exception {
         long tcooperationagentsid = content.getLong("tcooperationagentsid");//ºÏ×÷ÉÌID
-
-        String status = dbConnect.runSqlUpdate("delete from tagents_cooperation where (tagentsid='" + tagentsid + "' and tcooperationagentsid='" + tcooperationagentsid + "') or (tagentsid='" + tcooperationagentsid + "' and tcooperationagentsid='" + tagentsid + "')");
-
+        SQLFactory sqlFactory=new SQLFactory(this,"¹©Ðèɾ³ý");
+        sqlFactory.addParameter("siteid",siteid);
+        sqlFactory.addParameter("tagentsid",tagentsid);
+        sqlFactory.addParameter("tcooperationagentsid",tcooperationagentsid);
+        String status = dbConnect.runSqlUpdate(sqlFactory.getSQL());
         if ("true".equals(status)) {
             return getSucReturnObject().toString();
         } else {

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/SQL/活动删除.sql

@@ -0,0 +1,3 @@
+delete from tactivity where siteid=$siteid$ and tactivityid=$tactivity$
+delete from tactivity_agentmsg where siteid=$siteid$ and tactivityid=$tactivity$
+delete from tactivity_agentproducts where siteid=$siteid$ and tactivityid=$tactivity$

+ 20 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/activity/activity.java

@@ -252,4 +252,24 @@ public class activity extends Controller {
         tactivity_agentproductsSet.save();
         return getSucReturnObject().toString();
     }
+
+    /**
+     * »î¶¯É¾³ý
+     *
+     * @return
+     */
+    public String delete_activity() {
+        long tactivityid = content.getLong("tactivityid");
+        SQLFactory sqlFactory = new SQLFactory(this, "»î¶¯É¾³ý");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("tactivityid", tactivityid);
+
+        String status = dbConnect.runSqlUpdate(sqlFactory.getSQL());
+        if ("true".equalsIgnoreCase(status)) {
+            return getSucReturnObject().toString();
+        } else {
+            return getErrReturnObject().toString();
+        }
+    }
+
 }

+ 5 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/live/SQL/直播间删除.sql

@@ -0,0 +1,5 @@
+delete from tlive where siteid=$siteid$ and tliveid=$tliveid$
+delete from tlive_data where siteid=$siteid$ and tliveid=$tliveid$
+delete from tlive_usercount where siteid=$siteid$ and tliveid=$tliveid$
+delete from tlive_usermessages where siteid=$siteid$ and tliveid=$tliveid$
+delete from tlive_viewlog where siteid=$siteid$ and tliveid=$tliveid$

+ 4 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/live/live.java

@@ -213,7 +213,10 @@ public class live extends Controller {
         String channelid = rows.get(0).getString("channelid");
         Polyv polyv = new Polyv();
         if (polyv.deleteChannel(channelid)) {
-            dbConnect.runSqlUpdate("delete from tlive where siteid='" + siteid + "' and tliveid='" + tliveid + "'");
+            SQLFactory sqlFactory=new SQLFactory(this,"Ö±²¥¼äɾ³ý");
+            sqlFactory.addParameter("siteid",siteid);
+            sqlFactory.addParameter("tliveid",tliveid);
+            dbConnect.runSqlUpdate(sqlFactory.getSQL());
         }
         return getSucReturnObject().toString();
     }

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/notice/SQL/公告删除.sql

@@ -1 +1,2 @@
-delete from tnotice where siteid = $siteid$ and tnoticeid=$tnoticeid$
+delete from tnotice where siteid = $siteid$ and tnoticeid=$tnoticeid$
+delete from tnotice_userdata where siteid = $siteid$ and tnoticeid=$tnoticeid$

+ 3 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/system/SQL/权限组删除.sql

@@ -0,0 +1,3 @@
+update tenterprise_users set tauthgroupid=null where siteid=$siteid$ and tauthgroupid=$tauthgroupid$
+delete from tauthgroup where siteid=$siteid$ and tauthgroupid=$tauthgroupid$
+delete from tauthgroup_apps where siteid=$siteid$ and tauthgroupid=$tauthgroupid$

+ 2 - 5
src/dsb/com/cnd3b/restcontroller/enterprise/system/authgroup.java

@@ -112,11 +112,8 @@ public class authgroup extends Controller {
      */
     public String authgroupDelete() {
         String tauthgroupid = content.getString("tauthgroupid");
-        ArrayList<String> SQLlist = new ArrayList<>();
-        SQLlist.add("delete from tauthgroup where siteid='" + siteid + "' and tauthgroupid='" + tauthgroupid + "'");
-        SQLlist.add("delete from tauthgroup_apps where siteid='" + siteid + "' and tauthgroupid='" + tauthgroupid + "'");
-        SQLlist.add("update tenterprise_users set tauthgroupid=null where siteid='" + siteid + "' and tauthgroupid='" + tauthgroupid + "'");
-        String result = dbConnect.runSqlUpdate(SQLlist);
+        SQLFactory sqlFactory = new SQLFactory(this, "ȨÏÞ×éɾ³ý");
+        String result = dbConnect.runSqlUpdate(sqlFactory.getSQL());
         if ("true".equals(result)) {
             return getSucReturnObject().toString();
         } else {

+ 18 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/tagents/SQL/商户档案删除.sql

@@ -1 +1,18 @@
-delete from tagents where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tagents where siteid=$siteid$ and tagentsid=$tagentsid$
+
+delete from tenterprise_users where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tuserrequestlog where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tattachment_downlog where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tpayinfo where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tagents_product where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tmaxbillnum where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tnotice where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tagents_cooperation where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tliveapply where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tlive where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tactivity_agentmsg where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tactivity_agentproducts where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tagents_prodclass where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tagents_msgchangeapp where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tsupplyanddemand where siteid=$siteid$ and tagentsid=$tagentsid$
+delete from tnotice_userdata where siteid=$siteid$ and tagentsid=$tagentsid$

+ 6 - 1
src/dsb/com/cnd3b/service/ObsAutoDelete.java

@@ -3,9 +3,11 @@ package com.cnd3b.service;
 import com.cnd3b.common.BaseClass;
 import com.cnd3b.common.data.Row;
 import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.SQLFactory;
 import com.cnd3b.common.data.db.DBConnect;
 import com.cnd3b.common.data.db.SQLiteJDBC;
 import com.cnd3b.utility.obs.BucketFile;
+import org.apache.ibatis.jdbc.SQL;
 import p2.util.P2Exception;
 
 import java.util.Calendar;
@@ -55,7 +57,10 @@ public class ObsAutoDelete extends BaseClass implements Runnable {
                 }
                 if (!bucketFile.doesObjectExist(serialnumber)) {
                     printInfoOut("云存储文件清理", siteid + "-表名:" + objectname + ";附件ID:" + tattachmentid + ";云存储文件名:" + serialnumber + ";文件名:" + fdocument);
-                    dbConnect.runSqlUpdate("delete from tattachment where siteid='" + siteid + "' and tattachmentid=" + tattachmentid);
+                    SQLFactory sqlFactory=new SQLFactory(this,"附件信息删除");
+                    sqlFactory.addParameter("siteid",siteid);
+                    sqlFactory.addParameter("tattachmentid",tattachmentid);
+                    dbConnect.runSqlUpdate(sqlFactory.getSQL());
                 }
                 bucketFile.close();
             }

+ 2 - 0
src/dsb/com/cnd3b/service/SQL/附件信息删除.sql

@@ -0,0 +1,2 @@
+delete from tattachment where siteid=$siteid$ and (tattachmentid=$tattachmentid$ or fparentid=$tattachmentid$)
+delete from tattachment_downlog where siteid=$siteid$ and tattachmentid=$tattachmentid$