eganwu 1 yıl önce
ebeveyn
işleme
4c81e7c1b0

+ 23 - 23
src/custom/restcontroller/saletool/notice/notice.java

@@ -156,29 +156,29 @@ public class notice extends Controller {
         return getSucReturnObject().toString();
     }
 
-//    @API(title = "通告详情")
-//    public String queryNoticeMain() throws YosException {
-//        Long sat_noticeid = content.getLong("sat_noticeid");
-//        // 新增记录
-//        addReadRecord(sat_noticeid);
-//        SQLFactory sqlFactory = new SQLFactory(this, "通告详情查询");
-//        sqlFactory.addParameter("sat_noticeid", sat_noticeid);
-//        sqlFactory.addParameter("userid", userid);
-//        Rows rows = dbConnect.runSqlQuery(sqlFactory);
-//
-//        // 附件
-//        ArrayList<Long> ids = rows.toArrayList("sat_noticeid", new ArrayList<Long>());
-//        RowsMap attRowsMap = getAttachmentUrl("sat_notice", ids);
-//        for (Row row : rows) {
-//            Rows Rows = attRowsMap.get(row.getString("sat_noticeid"));
-//            if (Rows.isEmpty()) {
-//                row.put("attinfos", new Rows());
-//            } else {
-//                row.put("attinfos", Rows);
-//            }
-//        }
-//        return getSucReturnObject().setData(rows.get(0)).toString();
-//    }
+    @API(title = "通告详情")
+    public String queryNoticeMain() throws YosException {
+        Long sat_noticeid = content.getLong("sat_noticeid");
+        // 新增记录
+        addReadRecord(sat_noticeid);
+        SQLFactory sqlFactory = new SQLFactory(this, "通告详情查询");
+        sqlFactory.addParameter("sat_noticeid", sat_noticeid);
+        sqlFactory.addParameter("userid", userid);
+        Rows rows = dbConnect.runSqlQuery(sqlFactory);
+
+        // 附件
+        ArrayList<Long> ids = rows.toArrayList("sat_noticeid", new ArrayList<Long>());
+        RowsMap attRowsMap = getAttachmentUrl("sat_notice", ids);
+        for (Row row : rows) {
+            Rows Rows = attRowsMap.get(row.getString("sat_noticeid"));
+            if (Rows.isEmpty()) {
+                row.put("attinfos", new Rows());
+            } else {
+                row.put("attinfos", Rows);
+            }
+        }
+        return getSucReturnObject().setData(rows.get(0)).toString();
+    }
 
     /**
      * 查询阅读记录(通告留言和打分)

+ 3 - 0
src/custom/restcontroller/system/datacollect/datacollect.java

@@ -22,12 +22,14 @@ public class datacollect extends Controller {
     public String isCollect() throws YosException {
         String ownertable = content.getStringValue("ownertable");
         Long ownerid = content.getLongValue("ownerid");
+        int type = content.getIntValue("type");
 
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_datacollect");
         querySQL.setSiteid(siteid);
         querySQL.setWhere("userid", userid);
         querySQL.setWhere("ownertable", ownertable);
         querySQL.setWhere("ownerid", ownerid);
+        querySQL.setWhere("type", type);
         Rows rows = querySQL.query();
         if (rows.isNotEmpty()) {
             DeleteSQL deleteSQL = SQLFactory.createDeleteSQL(this, "sys_datacollect");
@@ -41,6 +43,7 @@ public class datacollect extends Controller {
             insertSQL.setValue("userid", userid);
             insertSQL.setValue("ownertable", ownertable);
             insertSQL.setValue("ownerid", ownerid);
+            insertSQL.setValue("type", type);
             insertSQL.insert();
         }
 

+ 1 - 1
src/custom/restcontroller/webmanage/saletool/sharematerial/Renderings.java

@@ -81,7 +81,7 @@ public class Renderings extends Controller {
 
         QuerySQL querySQ = SQLFactory.createQuerySQL(this, "sat_sharematerial")
                 .setTableAlias("t1");
-        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
+        querySQ.addJoinTable(JOINTYPE.left, "sys_datacollect", "t2", "t2.siteid=t1.siteid and t2.ownertable='sat_sharematerial' and type=1 and t2.ownerid=t1.sat_sharematerialid and t2.userid='" + userid + "'");
         querySQ.addQueryFields("iscollect", "CASE WHEN t2.sys_datacollectid>0 THEN 1 ELSE 0 END");
         querySQ.setSiteid(siteid);
         querySQ.setWhere("sat_sharematerialid", sat_sharematerialid);