|
@@ -10,10 +10,7 @@ import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
import common.annotation.cm;
|
|
|
-import common.data.Row;
|
|
|
-import common.data.Rows;
|
|
|
-import common.data.RowsMap;
|
|
|
-import common.data.SQLFactory;
|
|
|
+import common.data.*;
|
|
|
import restcontroller.R;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -21,6 +18,10 @@ import java.util.List;
|
|
|
|
|
|
@API(title = "通告")
|
|
|
public class notice extends Controller {
|
|
|
+
|
|
|
+ //表名
|
|
|
+ String sat_notice = "sat_notice";
|
|
|
+
|
|
|
public notice(JSONObject content) throws YosException {
|
|
|
super(content);
|
|
|
}
|
|
@@ -29,72 +30,32 @@ public class notice extends Controller {
|
|
|
@CACHEING_CLEAN(cms = {@cm(clazz = notice.class, method = {"queryNoticeList"})})
|
|
|
public String insertormodify_notice() throws YosException {
|
|
|
long sat_noticeid = content.getLong("sat_noticeid");
|
|
|
- ArrayList<String> sqllist = new ArrayList<>();
|
|
|
- String title = content.getString("title");
|
|
|
- Long sat_notice_classid = content.getLong("sat_notice_classid");
|
|
|
- String summary = content.getString("summary");
|
|
|
- String content1 = content.getString("content", true);
|
|
|
- boolean issecret = content.getBoolean("issecret");
|
|
|
- boolean isontop = content.getBoolean("isontop");
|
|
|
- String begdate = content.getStringValue("begdate");
|
|
|
- String enddate = content.getStringValue("enddate");
|
|
|
- if (sat_noticeid <= 0 || dbConnect
|
|
|
- .runSqlQuery("select sat_noticeid from sat_notice where sat_noticeid=" + sat_noticeid).isEmpty()) {
|
|
|
- sat_noticeid = createTableID("sat_notice");
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "通告新增");
|
|
|
- sqlFactory.addParameter("sat_noticeid", sat_noticeid);
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- sqlFactory.addParameter("createdepid", departmentid);
|
|
|
- sqlFactory.addParameter("createuserid", userid);
|
|
|
- sqlFactory.addParameter("createby", username);
|
|
|
- sqlFactory.addParameter("authuserid", userid);
|
|
|
- sqlFactory.addParameter("authdepid", departmentid);
|
|
|
- sqlFactory.addParameter("changeby", username);
|
|
|
- sqlFactory.addParameter("changeuserid", userid);
|
|
|
- sqlFactory.addParameter("title", title);
|
|
|
- sqlFactory.addParameter("sat_notice_classid", sat_notice_classid);
|
|
|
- sqlFactory.addParameter("summary", summary);
|
|
|
- sqlFactory.addParameter("content", content1);
|
|
|
- sqlFactory.addParameter("issecret", issecret);
|
|
|
- sqlFactory.addParameter("isontop", isontop);
|
|
|
- sqlFactory.addParameter("begdate", begdate.equals("") ? "null" : begdate);
|
|
|
- sqlFactory.addParameter("enddate", enddate.equals("") ? "null" : enddate);
|
|
|
+
|
|
|
+ if (sat_noticeid <= 0 || dbConnect.runSqlQuery("select sat_noticeid from sat_notice where sat_noticeid=" + sat_noticeid).isEmpty()) {
|
|
|
+ sat_noticeid = createTableID(sat_notice);
|
|
|
+ InsertSQL insertSQL = SQLFactory.createInsertSQL(this, sat_notice);
|
|
|
+ insertSQL.setSiteid(siteid);
|
|
|
+ insertSQL.setUniqueid(sat_noticeid);
|
|
|
+ insertSQL.setValue("title", content.getString("title"));
|
|
|
+ insertSQL.setValue("status", content.getString("status"));
|
|
|
+ insertSQL.setValue("publishdate", content.getStringValueForDate("publishdate", "yyyy-MM-dd", "null"));
|
|
|
+ insertSQL.setValue("sat_notice_classid", content.getLongValue("sat_notice_classid"));
|
|
|
+ insertSQL.setValue("content", content.getString("content", true));
|
|
|
+ insertSQL.insert();
|
|
|
content.put("sat_noticeid", sat_noticeid);
|
|
|
- sqllist.add(sqlFactory.getSQL());
|
|
|
- if (isontop) {
|
|
|
- sqllist.add("update sat_notice set isontop=0 where isontop=1 and sat_noticeid !=" + sat_noticeid);
|
|
|
- }
|
|
|
} else {
|
|
|
- Rows rowscount = dbConnect.runSqlQuery("select status from sat_notice where sat_noticeid=" + sat_noticeid);
|
|
|
- if (rowscount.isEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("此通告不存在").toString();
|
|
|
- } else {
|
|
|
- if (!rowscount.get(0).getString("status").equals("新建")) {
|
|
|
- return getErrReturnObject().setErrMsg("非新建状态的通告无法更新").toString();
|
|
|
- }
|
|
|
- }
|
|
|
- SQLFactory sqlFactory = new SQLFactory(this, "通告更新");
|
|
|
- sqlFactory.addParameter("sat_noticeid", sat_noticeid);
|
|
|
- sqlFactory.addParameter("siteid", siteid);
|
|
|
- sqlFactory.addParameter("createdepid", departmentid);
|
|
|
- sqlFactory.addParameter("authuserid", userid);
|
|
|
- sqlFactory.addParameter("authdepid", departmentid);
|
|
|
- sqlFactory.addParameter("changeby", username);
|
|
|
- sqlFactory.addParameter("changeuserid", userid);
|
|
|
- sqlFactory.addParameter("title", title);
|
|
|
- sqlFactory.addParameter("isontop", isontop);
|
|
|
- sqlFactory.addParameter("sat_notice_classid", sat_notice_classid);
|
|
|
- sqlFactory.addParameter("summary", summary);
|
|
|
- sqlFactory.addParameter("content", content1);
|
|
|
- sqlFactory.addParameter("issecret", issecret);
|
|
|
- sqlFactory.addParameter("begdate", begdate.equals("") ? "null" : begdate);
|
|
|
- sqlFactory.addParameter("enddate", enddate.equals("") ? "null" : enddate);
|
|
|
- sqllist.add(sqlFactory.getSQL());
|
|
|
- if (isontop) {
|
|
|
- sqllist.add("update sat_notice set isontop=0 where isontop=1 and sat_noticeid !=" + sat_noticeid);
|
|
|
- }
|
|
|
+ UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, sat_notice);
|
|
|
+ updateSQL.setSiteid(siteid);
|
|
|
+ updateSQL.setUniqueid(sat_noticeid);
|
|
|
+ updateSQL.setValue("title", content.getString("title"));
|
|
|
+ updateSQL.setValue("status", content.getString("status"));
|
|
|
+ updateSQL.setValue("publishdate", content.getStringValueForDate("publishdate", "yyyy-MM-dd", "null"));
|
|
|
+ updateSQL.setValue("sat_notice_classid", content.getLongValue("sat_notice_classid"));
|
|
|
+ updateSQL.setValue("content", content.getString("content", true));
|
|
|
+ updateSQL.update();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
- dbConnect.runSqlUpdate(sqllist);
|
|
|
return queryNoticeMain();
|
|
|
}
|
|
|
|
|
@@ -120,21 +81,22 @@ public class notice extends Controller {
|
|
|
if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
|
|
|
where = where + " and t1.status ='" + whereObject.getString("status") + "' ";
|
|
|
}
|
|
|
+ if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
|
|
|
+ where = where + " and t1.status ='" + whereObject.getString("status") + "' ";
|
|
|
+ }
|
|
|
if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
|
|
|
where = where + " and t1.checkdate >='" + whereObject.getString("begindate") + "'";
|
|
|
}
|
|
|
if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
|
|
|
where = where + " and t1.checkdate <='" + whereObject.getString("enddate") + "'";
|
|
|
}
|
|
|
- if (whereObject.containsKey("isread") && !"".equals(whereObject.getString("isread"))) {
|
|
|
- if(whereObject.getBooleanValue("isread")){
|
|
|
- where = where + " and (CASE WHEN (SELECT COUNT(*) FROM sat_notice_read WHERE siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='已读'";
|
|
|
- }else{
|
|
|
- where = where + " and (CASE WHEN (SELECT COUNT(*) FROM sat_notice_read WHERE siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='未读'";
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
+// if (whereObject.containsKey("isread") && !"".equals(whereObject.getString("isread"))) {
|
|
|
+// if (whereObject.getBooleanValue("isread")) {
|
|
|
+// where = where + " and (CASE WHEN (SELECT COUNT(*) FROM sat_notice_read WHERE siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='已读'";
|
|
|
+// } else {
|
|
|
+// where = where + " and (CASE WHEN (SELECT COUNT(*) FROM sat_notice_read WHERE siteid = t1.siteid AND sat_noticeid = t1.sat_noticeid)>0 THEN '已读' ELSE '未读' END)='未读'";
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
}
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "通告列表查询", pageSize, pageNumber, pageSorting);
|
|
@@ -155,10 +117,6 @@ public class notice extends Controller {
|
|
|
} else {
|
|
|
row.put("attinfos", Rows);
|
|
|
}
|
|
|
-
|
|
|
-// row.put("attinfos", attRowsMap.getOrDefault(row.getString("sat_coursewareid"), new Rows()));
|
|
|
- }
|
|
|
- for (Row row : rows) {
|
|
|
Rows coverRows = coverRowsMap.get(row.getString("sat_noticeid"));
|
|
|
if (coverRows.isEmpty()) {
|
|
|
row.put("cover", "");
|
|
@@ -166,6 +124,7 @@ public class notice extends Controller {
|
|
|
row.put("cover", coverRows.get(0).getString("url"));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
@@ -179,12 +138,24 @@ public class notice extends Controller {
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
- ArrayList<Long> ids = rows.toArrayList("sat_noticeid", new ArrayList<Long>());
|
|
|
+ ArrayList<Long> ids = rows.toArrayList("sat_noticeid", new ArrayList<>());
|
|
|
// 附件
|
|
|
RowsMap attRowsMap = getAttachmentUrl("sat_notice", ids, "default");
|
|
|
// 封面cover
|
|
|
RowsMap coverRowsMap = getAttachmentUrl("sat_notice", ids, "cover");
|
|
|
- for (Row row : rows) {
|
|
|
+
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sat_notice_auth",
|
|
|
+ "roleid");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.inner, "sys_role", "t2", "t1.roleid=t2.roleid and t1.siteid=t2.siteid",
|
|
|
+ "rolename");
|
|
|
+ querySQL.setTableAlias("t1");
|
|
|
+ querySQL.setWhere("t1.siteid", siteid);
|
|
|
+ querySQL.setWhere("t1.sat_noticeid", sat_noticeid);
|
|
|
+ Rows roleRows = querySQL.query();
|
|
|
+
|
|
|
+ Row row = new Row();
|
|
|
+ if (rows.isNotEmpty()) {
|
|
|
+ row = rows.get(0);
|
|
|
Rows coverRows = coverRowsMap.get(row.getString("sat_noticeid"));
|
|
|
if (coverRows.isEmpty()) {
|
|
|
row.put("cover", "");
|
|
@@ -192,9 +163,13 @@ public class notice extends Controller {
|
|
|
row.put("cover", coverRows.get(0).getString("url"));
|
|
|
}
|
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("sat_noticeid"), new Rows()));
|
|
|
+ row.putIfAbsent("publishdate", "");
|
|
|
+
|
|
|
+ row.put("role", roleRows);
|
|
|
}
|
|
|
|
|
|
- return getSucReturnObject().setData(rows.size() > 0 ? rows.get(0) : new Row()).toString();
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(row).toString();
|
|
|
}
|
|
|
|
|
|
@API(title = "删除", apiversion = R.ID20221101095103.v1.class)
|
|
@@ -220,10 +195,8 @@ public class notice extends Controller {
|
|
|
list.add(deletesql);
|
|
|
dbConnect.runSqlUpdate(list);
|
|
|
}
|
|
|
- if (err.length() == 0)
|
|
|
- return getSucReturnObject().toString();
|
|
|
- else
|
|
|
- return getSucReturnObject().setData(err).toString();
|
|
|
+ if (err.length() == 0) return getSucReturnObject().toString();
|
|
|
+ else return getSucReturnObject().setData(err).toString();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -237,8 +210,7 @@ public class notice extends Controller {
|
|
|
JSONArray sat_noticeids = content.getJSONArray("sat_noticeids");
|
|
|
String[] s = {"sat_noticeids"};
|
|
|
for (String s1 : s) {
|
|
|
- if (!content.containsKey(s1))
|
|
|
- return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
+ if (!content.containsKey(s1)) return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
}
|
|
|
List<String> list = sat_noticeids.toJavaList(String.class);
|
|
|
String[] stringArray = list.toArray(new String[0]);
|
|
@@ -258,9 +230,9 @@ public class notice extends Controller {
|
|
|
sqlFactoryupdate.addParameter("checkby", username);
|
|
|
dbConnect.runSqlUpdate(sqlFactoryupdate);
|
|
|
//发送消息
|
|
|
- for (String id : stringArray) {
|
|
|
- //sendMsg(Long.parseLong(id));
|
|
|
- }
|
|
|
+// for (String id : stringArray) {
|
|
|
+// //sendMsg(Long.parseLong(id));
|
|
|
+// }
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
@@ -304,8 +276,7 @@ public class notice extends Controller {
|
|
|
JSONArray sat_noticeids = content.getJSONArray("sat_noticeids");
|
|
|
String[] s = {"sat_noticeids"};
|
|
|
for (String s1 : s) {
|
|
|
- if (!content.containsKey(s1))
|
|
|
- return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
+ if (!content.containsKey(s1)) return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
}
|
|
|
List<String> list = sat_noticeids.toJavaList(String.class);
|
|
|
String[] stringArray = list.toArray(new String[0]);
|
|
@@ -324,11 +295,11 @@ public class notice extends Controller {
|
|
|
sqlFactoryupdate.addParameter_in("sat_noticeids", stringArray);
|
|
|
dbConnect.runSqlUpdate(sqlFactoryupdate);
|
|
|
//发送消息
|
|
|
- for (String id : stringArray) {
|
|
|
- if (rows.isNotEmpty()) {
|
|
|
- //sendOffMsg(Long.parseLong(id), rows.get(0).getString("title"));
|
|
|
- }
|
|
|
- }
|
|
|
+// for (String id : stringArray) {
|
|
|
+// if (rows.isNotEmpty()) {
|
|
|
+// //sendOffMsg(Long.parseLong(id), rows.get(0).getString("title"));
|
|
|
+// }
|
|
|
+// }
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
@@ -371,18 +342,15 @@ public class notice extends Controller {
|
|
|
public String topping() throws YosException {
|
|
|
String[] s = {"sat_noticeid"};
|
|
|
for (String s1 : s) {
|
|
|
- if (!content.containsKey(s1))
|
|
|
- return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
+ if (!content.containsKey(s1)) return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
}
|
|
|
- String sqlName = "SELECT COUNT(*) count FROM sat_notice WHERE sat_noticeid = '"
|
|
|
- + content.getIntValue("sat_noticeid") + "' and isontop=1";
|
|
|
+ String sqlName = "SELECT COUNT(*) count FROM sat_notice WHERE sat_noticeid = '" + content.getIntValue("sat_noticeid") + "' and isontop=1";
|
|
|
Rows rowsName = dbConnect.runSqlQuery(sqlName);
|
|
|
if (rowsName.get(0).getLong("count") > 0) {
|
|
|
return getErrReturnObject().setErrMsg("此通告已置顶,无须再次置顶").toString();
|
|
|
}
|
|
|
dbConnect.runSqlUpdate("update sat_notice set isontop=0 where isontop=1 ");
|
|
|
- dbConnect.runSqlUpdate(
|
|
|
- "update sat_notice set isontop=1 where sat_noticeid=" + content.getIntValue("sat_noticeid"));
|
|
|
+ dbConnect.runSqlUpdate("update sat_notice set isontop=1 where sat_noticeid=" + content.getIntValue("sat_noticeid"));
|
|
|
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
@@ -397,17 +365,14 @@ public class notice extends Controller {
|
|
|
public String cancelTopping() throws YosException {
|
|
|
String[] s = {"sat_noticeid"};
|
|
|
for (String s1 : s) {
|
|
|
- if (!content.containsKey(s1))
|
|
|
- return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
+ if (!content.containsKey(s1)) return getErrReturnObject().setErrMsg("缺少" + s1 + "参数").toString();
|
|
|
}
|
|
|
- String sqlName = "SELECT COUNT(*) count FROM sat_notice WHERE sat_noticeid = '"
|
|
|
- + content.getIntValue("sat_noticeid") + "' and isontop=0";
|
|
|
+ String sqlName = "SELECT COUNT(*) count FROM sat_notice WHERE sat_noticeid = '" + content.getIntValue("sat_noticeid") + "' and isontop=0";
|
|
|
Rows rowsName = dbConnect.runSqlQuery(sqlName);
|
|
|
if (rowsName.get(0).getLong("count") > 0) {
|
|
|
return getErrReturnObject().setErrMsg("此通告已取消置顶,无须再次取消").toString();
|
|
|
}
|
|
|
- dbConnect.runSqlUpdate(
|
|
|
- "update sat_notice set isontop=0 where sat_noticeid=" + content.getIntValue("sat_noticeid"));
|
|
|
+ dbConnect.runSqlUpdate("update sat_notice set isontop=0 where sat_noticeid=" + content.getIntValue("sat_noticeid"));
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
@@ -421,8 +386,7 @@ public class notice extends Controller {
|
|
|
Long sat_noticeid = content.getLong("sat_noticeid");
|
|
|
int score = content.getInteger("score");
|
|
|
String leavemessage = content.getString("leavemessage");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select sat_notice_readid FROM sat_notice_read WHERE siteid = '" + siteid
|
|
|
- + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select sat_notice_readid FROM sat_notice_read WHERE siteid = '" + siteid + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'");
|
|
|
if (rows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("阅读记录不存在,无法更新").toString();
|
|
|
}
|
|
@@ -449,8 +413,7 @@ public class notice extends Controller {
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where = where + " and (t1.leavemessage like'%" + whereObject.getString("condition")
|
|
|
- + "%' or t3.position like '%" + whereObject.getString("condition") + "%' or t1.createby like '%" + whereObject.getString("condition") + "%')";
|
|
|
+ where = where + " and (t1.leavemessage like'%" + whereObject.getString("condition") + "%' or t3.position like '%" + whereObject.getString("condition") + "%' or t1.createby like '%" + whereObject.getString("condition") + "%')";
|
|
|
}
|
|
|
if (whereObject.containsKey("score") && !"".equals(whereObject.getString("score"))) {
|
|
|
where = where + " and t1.score ='" + whereObject.getString("score") + "' ";
|
|
@@ -466,19 +429,14 @@ public class notice extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Rows rows = dbConnect
|
|
|
- .runSqlQuery("select t2.usertype,t3.position,t1.createdate,t1.createby,t1.leavemessage,t1.score,(SELECT count(*) FROM sat_notice_read WHERE siteid ='" + siteid + "' AND sat_noticeid = '" + sat_noticeid + "' and score>0) evaluatecount FROM sat_notice_read t1\n" +
|
|
|
- " left join sys_usersite t2 on t1.createuserid=t2.userid and t1.siteid=t2.siteid\n" +
|
|
|
- " left join sys_enterprise_hr t3 on t1.createuserid=t3.userid and t1.siteid=t3.siteid\n" +
|
|
|
- " WHERE " + where + " and t1.siteid = '" + siteid + "' AND t1.sat_noticeid ='" + sat_noticeid + "' and !(isnull(t1.leavemessage) and t1.score=0)");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select t2.usertype,t3.position,t1.createdate,t1.createby,t1.leavemessage,t1.score,(SELECT count(*) FROM sat_notice_read WHERE siteid ='" + siteid + "' AND sat_noticeid = '" + sat_noticeid + "' and score>0) evaluatecount FROM sat_notice_read t1\n" + " left join sys_usersite t2 on t1.createuserid=t2.userid and t1.siteid=t2.siteid\n" + " left join sys_enterprise_hr t3 on t1.createuserid=t3.userid and t1.siteid=t3.siteid\n" + " WHERE " + where + " and t1.siteid = '" + siteid + "' AND t1.sat_noticeid ='" + sat_noticeid + "' and !(isnull(t1.leavemessage) and t1.score=0)");
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
@API(title = "更新下载附件记录")
|
|
|
public String updateDownloadRecord() throws YosException {
|
|
|
Long sat_noticeid = content.getLong("sat_noticeid");
|
|
|
- dbConnect.runSqlUpdate("UPDATE sat_notice_read SET isdownloadfile=1 WHERE siteid = '" + siteid
|
|
|
- + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'");
|
|
|
+ dbConnect.runSqlUpdate("UPDATE sat_notice_read SET isdownloadfile=1 WHERE siteid = '" + siteid + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'");
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
@@ -546,8 +504,7 @@ public class notice extends Controller {
|
|
|
// 新增浏览次数
|
|
|
dbConnect.runSqlUpdate("UPDATE sat_notice SET readcount=readcount+1 WHERE sat_noticeid='" + sat_noticeid + "'");
|
|
|
// 查询当前用户的阅读记录是否存在
|
|
|
- String sql = "SELECT sat_notice_readid FROM sat_notice_read WHERE siteid = '" + siteid
|
|
|
- + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'";
|
|
|
+ String sql = "SELECT sat_notice_readid FROM sat_notice_read WHERE siteid = '" + siteid + "' AND sat_noticeid = '" + sat_noticeid + "' AND createuserid = '" + userid + "'";
|
|
|
Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
if (rows.isEmpty()) {
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "阅读记录新增");
|
|
@@ -558,7 +515,7 @@ public class notice extends Controller {
|
|
|
sqlFactory.addParameter("sat_noticeid", sat_noticeid);
|
|
|
sqlFactory.addParameter("createuserid", userid);
|
|
|
sqlFactory.addParameter("hrid", hrid);
|
|
|
- sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
+ sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
dbConnect.runSqlUpdate(sqlFactory);
|
|
|
} else {
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "阅读记录次数更新");
|
|
@@ -566,7 +523,7 @@ public class notice extends Controller {
|
|
|
sqlFactory.addParameter("sat_noticeid", sat_noticeid);
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
sqlFactory.addParameter("hrid", hrid);
|
|
|
- sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
+ sqlFactory.addParameter("sa_agentsid", userInfo.getAgentID());
|
|
|
dbConnect.runSqlUpdate(sqlFactory);
|
|
|
}
|
|
|
}
|