Browse Source

bug修复

eganwu 1 year ago
parent
commit
9dc20249c4
1 changed files with 16 additions and 14 deletions
  1. 16 14
      src/custom/restcontroller/webmanage/saletool/fad/FadGoods.java

+ 16 - 14
src/custom/restcontroller/webmanage/saletool/fad/FadGoods.java

@@ -41,6 +41,8 @@ public class FadGoods extends Controller {
             sys_enterpriseid = content.getLongValue("sys_enterpriseid");
         }
 
+        Rows attachmentRows = Attachment.get(this, "sa_fad", sa_fadid);
+
         ArrayList<String> listSQL = new ArrayList<>();
         ArrayList<Long> sa_fadids = new ArrayList<>();
 
@@ -77,7 +79,7 @@ public class FadGoods extends Controller {
             }
             //允许经销商调整,数据是总部的,修改方为经销商
             else if (temp_canadjust && temp_sys_enterpriseid == 0 && sys_enterpriseid > 0) {
-                Rows attachmentRows = Attachment.get(this, "sa_fadid", sa_fadid);
+
 
                 parentid = sa_fadid;
                 sa_fadid = createTableID(sa_fad);
@@ -91,18 +93,18 @@ public class FadGoods extends Controller {
                 listSQL.add(DataAuthHelper.getDataAuthInsertSQL(this, sys_dataauthid).getSQL());
                 listSQL.add(DataAuthHelper.getDataAuthsInsertSQL(this, "sys_enterpriseid", sys_enterpriseid).getSQL());
 
-                for (Row attachmentRow : attachmentRows) {
-                    InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
-                    insertSQL.setSiteid(siteid);
-                    insertSQL.setUniqueid(createTableID("sys_attachment_links"));
-                    insertSQL.setValue("usetype", attachmentRow.getString("usetype"));
-                    insertSQL.setValue("attachmentid", attachmentRow.getLong("attachmentid"));
-                    insertSQL.setValue("sequence", 1);
-                    insertSQL.setValue("ownertable", sa_fad);
-                    insertSQL.setValue("ownerid", sa_fadid);
-                    insertSQL.setWhere("not exists(select 1 from  sys_attachment_links where attachmentid=" + attachmentRow.getLong("attachmentid") + " and ownertable='sa_fad' and siteid='" + siteid + "' and ownerid=" + sa_fadid + " )");
-                    listSQL.add(insertSQL.getSQL());
-                }
+//                for (Row attachmentRow : attachmentRows) {
+//                    InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
+//                    insertSQL.setSiteid(siteid);
+//                    insertSQL.setUniqueid(createTableID("sys_attachment_links"));
+//                    insertSQL.setValue("usetype", attachmentRow.getString("usetype"));
+//                    insertSQL.setValue("attachmentid", attachmentRow.getLong("attachmentid"));
+//                    insertSQL.setValue("sequence", 1);
+//                    insertSQL.setValue("ownertable", sa_fad);
+//                    insertSQL.setValue("ownerid", sa_fadid);
+//                    insertSQL.setWhere("not exists(select 1 from  sys_attachment_links where attachmentid=" + attachmentRow.getLong("attachmentid") + " and ownertable='sa_fad' and siteid='" + siteid + "' and ownerid=" + sa_fadid + " )");
+//                    listSQL.add(insertSQL.getSQL());
+//                }
 
             } else {
                 UpdateSQL sqlFactory = FadHelper.getFadUpdateSQL(this, sa_fadid);
@@ -112,7 +114,7 @@ public class FadGoods extends Controller {
 
         }
 
-        Rows attachmentRows = Attachment.get(this, "sa_fadid", sa_fadid);
+
 
         sa_fadids.add(sa_fadid);
         for (Long id : sa_fadids) {