EquipmentResourceLibrary.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. package restcontroller.webmanage.saletool.sharematerial;
  2. import beans.attachment.Attachment;
  3. import beans.datacontrllog.DataContrlLog;
  4. import beans.parameter.Parameter;
  5. import beans.remind.Remind;
  6. import com.alibaba.fastjson.JSONArray;
  7. import com.alibaba.fastjson.JSONObject;
  8. import common.Controller;
  9. import common.YosException;
  10. import common.annotation.API;
  11. import common.data.*;
  12. import restcontroller.R;
  13. import utility.email.EmailContent;
  14. import java.util.ArrayList;
  15. /**
  16. * 装备资源库
  17. */
  18. public class EquipmentResourceLibrary extends Controller {
  19. /**
  20. * 构造函数
  21. *
  22. * @param content
  23. */
  24. public EquipmentResourceLibrary(JSONObject content) throws YosException {
  25. super(content);
  26. }
  27. String sat_sharematerial = "sat_sharematerial";
  28. @API(title = "装备资源库新增或编辑", apiversion = R.ID20240407094502.v1.class)
  29. public String insertOrUpdate() throws YosException {
  30. Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
  31. JSONArray sat_sharematerial_classids = new JSONArray();
  32. if (content.containsKey("sat_sharematerial_classids")) {
  33. sat_sharematerial_classids = content.getJSONArray("sat_sharematerial_classids");
  34. for (Object obj : sat_sharematerial_classids) {
  35. if (!(obj instanceof JSONArray)) {
  36. return getErrReturnObject().setErrMsg("格式不正确,正确的为[[1,2,3]]").toString();
  37. }
  38. }
  39. }
  40. if (sat_sharematerialid <= 0) {
  41. sat_sharematerialid = createTableID(sat_sharematerial);
  42. InsertSQL sqlFactory = SQLFactory.createInsertSQL(this, sat_sharematerial);
  43. sqlFactory.setUniqueid(sat_sharematerialid);
  44. sqlFactory.setSiteid(siteid);
  45. sqlFactory.setValue("sys_enterpriseid", sys_enterpriseid);
  46. sqlFactory.setValue("classid", 3);
  47. sqlFactory.setValue("title", content.getStringValue("title"));
  48. sqlFactory.setValue("sat_sharematerial_classids", sat_sharematerial_classids);
  49. sqlFactory.setValue("type", content.getIntValue("type"));
  50. sqlFactory.setValue("sequence", content.getLongValue("sequence"));
  51. sqlFactory.setValue("isqrcode", content.getBooleanValue("isqrcode"));
  52. sqlFactory.setValue("qrcodecontent", content.getStringValue("qrcodecontent", true));
  53. sqlFactory.setValue("canshared_c", content.getBooleanValue("canshared_c"));
  54. sqlFactory.setValue("candownload", content.getBooleanValue("candownload"));
  55. sqlFactory.setValue("candownload_c", content.getBooleanValue("candownload_c"));
  56. sqlFactory.setValue("ispicture", content.getBooleanValue("ispicture"));
  57. sqlFactory.insert();
  58. content.put("sat_sharematerialid", sat_sharematerialid);
  59. DataContrlLog.createLog(this, "sat_sharematerial", sat_sharematerialid, "新建", "新建资料 " + content.getStringValue("title")).insert();
  60. } else {
  61. UpdateSQL sqlFactory = SQLFactory.createUpdateSQL(this, sat_sharematerial);
  62. sqlFactory.setUniqueid(sat_sharematerialid);
  63. sqlFactory.setSiteid(siteid);
  64. sqlFactory.setValue("sys_enterpriseid", sys_enterpriseid);
  65. sqlFactory.setValue("title", content.getStringValue("title"));
  66. sqlFactory.setValue("sat_sharematerial_classids", sat_sharematerial_classids);
  67. sqlFactory.setValue("type", content.getIntValue("type"));
  68. sqlFactory.setValue("sequence", content.getLongValue("sequence"));
  69. sqlFactory.setValue("isqrcode", content.getBooleanValue("isqrcode"));
  70. sqlFactory.setValue("qrcodecontent", content.getStringValue("qrcodecontent", true));
  71. sqlFactory.setValue("canshared_c", content.getBooleanValue("canshared_c"));
  72. sqlFactory.setValue("candownload", content.getBooleanValue("candownload"));
  73. sqlFactory.setValue("candownload_c", content.getBooleanValue("candownload_c"));
  74. sqlFactory.setValue("ispicture", content.getBooleanValue("ispicture"));
  75. sqlFactory.update();
  76. DataContrlLog.createLog(this, "sat_sharematerial", sat_sharematerialid, "编辑", "编辑资料 " + content.getStringValue("title")).insert();
  77. }
  78. return detail();
  79. }
  80. @API(title = "装备资源库详情", apiversion = R.ID20240407094602.v1.class)
  81. public String detail() throws YosException {
  82. String ownertable = "sat_sharematerial";
  83. Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
  84. QuerySQL sqlFactory = SQLFactory.createQuerySQL(this, sat_sharematerial
  85. , "sat_sharematerialid", "type", "status", "sequence", "title", "canshared_c", "candownload_c", "candownload"
  86. , "sat_sharematerial_classids", "mailcount", "canshared", "downloadcount", "isqrcode", "qrcodecontent", "sharecount", "readcount"
  87. , "createby", "createdate", "checkby", "checkdate", "changeby", "changedate", "ispicture")
  88. .setTableAlias("t1");
  89. sqlFactory.setUniqueid(sat_sharematerialid);
  90. sqlFactory.setSiteid(siteid);
  91. Rows rows = sqlFactory.query();
  92. QuerySQL dataauth = SQLFactory.createQuerySQL(this, "sys_dataauth").setTableAlias("t1");
  93. dataauth.setWhere("siteid", siteid);
  94. dataauth.setWhere("ownertable", "sat_sharematerial");
  95. dataauth.setWhere("ownerid", sat_sharematerialid);
  96. Rows dataauthRows = dataauth.query();
  97. QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_dataauths",
  98. "roleid");
  99. querySQL.addJoinTable(JOINTYPE.inner, "sys_role", "t2", "t1.roleid=t2.roleid and t1.siteid=t2.siteid",
  100. "rolename");
  101. querySQL.setTableAlias("t1");
  102. querySQL.setWhere("t1.siteid", siteid);
  103. querySQL.setWhere("t1.ownertable", "sat_sharematerial");
  104. querySQL.setWhere("t1.ownerid", sat_sharematerialid);
  105. Rows roleRows = querySQL.query();
  106. Row detailRow = new Row();
  107. if (rows.isNotEmpty()) {
  108. detailRow = rows.get(0);
  109. Rows attRows = getAttachmentUrl("sat_sharematerial", sat_sharematerialid);
  110. attRows.sortby("sequence", "linksid");
  111. detailRow.put("attinfos", attRows);
  112. detailRow.putIfAbsent("checkdate", "");
  113. if (detailRow.getInteger("type") == 1) {
  114. detailRow.put("typestr", "图片");
  115. }
  116. if (detailRow.getInteger("type") == 2) {
  117. detailRow.put("typestr", "视频");
  118. }
  119. if (detailRow.getInteger("type") == 3) {
  120. detailRow.put("typestr", "图文");
  121. }
  122. detailRow.put("role", roleRows.toArrayList("roleid", new ArrayList<Long>()));
  123. detailRow.put("dataauth", dataauthRows);
  124. }
  125. QuerySQL attachmentQuery = SQLFactory.createQuerySQL(this, "sys_attachment_links").setTableAlias("t1");
  126. attachmentQuery.setSiteid(siteid);
  127. attachmentQuery.setWhere("ownertable", ownertable);
  128. attachmentQuery.setWhere("ownerid", sat_sharematerialid);
  129. attachmentQuery.setWhere("usetype", ownertable);
  130. attachmentQuery.setOrderBy("t1.sequence,t1.linksid");
  131. Rows attachmentRows = attachmentQuery.query();
  132. ArrayList<Long> ids = attachmentRows.toArrayList("attachmentid", new ArrayList<>());
  133. RowsMap attRowsMap = Attachment.get(this, ids).toRowsMap("attachmentid");
  134. for (Row row : attachmentRows) {
  135. Rows attPicRows = new Rows();
  136. Rows tempAttRows = attRowsMap.getOrDefault(row.getString("attachmentid"), new Rows());
  137. for (Row tempAttRow : tempAttRows) {
  138. // if (tempAttRow.getString("usetype").equals(ownertable)) {
  139. attPicRows.add(tempAttRow);
  140. // }
  141. }
  142. row.put("attinfos", attPicRows);
  143. }
  144. detailRow.put("attinfos_pic", attachmentRows);
  145. SharematerialHelper.updateReadLog(this, sat_sharematerialid, 0);
  146. return getSucReturnObject().setData(detailRow).toString();
  147. }
  148. @API(title = "装备资源库列表", apiversion = R.ID20240407094702.v1.class)
  149. public String list() throws YosException {
  150. /*
  151. 过滤条件设置
  152. */
  153. StringBuffer where = new StringBuffer(" 1=1 ");
  154. if (content.containsKey("where")) {
  155. JSONObject whereObject = content.getJSONObject("where");
  156. if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
  157. where.append(" and (");
  158. where.append("t1.title like'%").append(whereObject.getString("condition")).append("%' ");
  159. where.append(")");
  160. }
  161. if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
  162. where.append(" and (");
  163. where.append("t1.status ='").append(whereObject.getString("status")).append("' ");
  164. where.append(")");
  165. }
  166. if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
  167. where.append(" and (");
  168. where.append("t1.type ='").append(whereObject.getString("type")).append("' ");
  169. where.append(")");
  170. }
  171. if (whereObject.containsKey("begindate_create") && !"".equals(whereObject.getString("begindate_create"))) {
  172. where.append(" and (");
  173. where.append("t1.createdate >='").append(whereObject.getString("begindate_create")).append("' ");
  174. where.append(")");
  175. }
  176. if (whereObject.containsKey("enddate_create") && !"".equals(whereObject.getString("enddate_create"))) {
  177. where.append(" and (");
  178. where.append("t1.createdate <='").append(whereObject.getString("enddate_create")).append(" 23:59:59' ");
  179. where.append(")");
  180. }
  181. if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
  182. where.append(" and (");
  183. where.append("t1.checkdate >='").append(whereObject.getString("begindate")).append("' ");
  184. where.append(")");
  185. }
  186. if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
  187. where.append(" and (");
  188. where.append("t1.checkdate <='").append(whereObject.getString("enddate")).append(" 23:59:59' ");
  189. where.append(")");
  190. }
  191. if (whereObject.containsKey("sat_sharematerial_classids") && !"".equals(whereObject.getString("sat_sharematerial_classids"))) {
  192. JSONArray sat_courseware_classids = whereObject.getJSONArray("sat_sharematerial_classids");
  193. if (sat_courseware_classids.size() > 0) {
  194. where.append(" and (1=2");
  195. for (Object obj : sat_courseware_classids) {
  196. JSONArray array = (JSONArray) obj;
  197. if (array.size() > 0) {
  198. where.append(" or (");
  199. where.append("JSON_CONTAINS(t1.sat_sharematerial_classids,'" + array.get(array.size() - 1) + "')");
  200. where.append(")");
  201. }
  202. }
  203. where.append(")");
  204. }
  205. }
  206. }
  207. boolean isDataAuth = content.getBooleanValue("isDataAuth");
  208. QuerySQL sqlFactory = SQLFactory.createQuerySQL(this, sat_sharematerial,
  209. "sat_sharematerialid", "title", "type", "status", "mailcount",
  210. "readcount", "downloadcount", "createdate", "checkdate",
  211. "sat_sharematerial_classids", "ispicture")
  212. .setTableAlias("t1");
  213. sqlFactory.setSiteid(siteid);
  214. sqlFactory.setWhere("classid", 3);
  215. sqlFactory.setWhere(where.toString());
  216. sqlFactory.setOrderBy(pageSorting).setPage(pageSize, pageNumber);
  217. if (isDataAuth) {
  218. sqlFactory.setDataAuth(true);
  219. }
  220. Rows rows = sqlFactory.query();
  221. ArrayList<Long> ids = rows.toArrayList("sat_sharematerialid", new ArrayList<>());
  222. // 附件
  223. RowsMap RowsMap = getAttachmentUrl(sat_sharematerial, ids);
  224. for (Row row : rows) {
  225. Rows attRows = RowsMap.getOrDefault(row.getString("sat_sharematerialid"), new Rows());
  226. attRows.sortby("sequence", "linksid");
  227. row.put("attinfos", attRows);
  228. row.putIfAbsent("checkdate", "");
  229. if (row.getInteger("type") == 1) {
  230. row.put("typestr", "图片");
  231. }
  232. if (row.getInteger("type") == 2) {
  233. row.put("typestr", "视频");
  234. }
  235. if (row.getInteger("type") == 3) {
  236. row.put("typestr", "图文");
  237. }
  238. }
  239. return getSucReturnObject().setData(rows).toString();
  240. }
  241. @API(title = "图片新增或编辑", apiversion = R.ID20240407135802.v1.class)
  242. public String attachmentInsertOrUpdate() throws YosException {
  243. Long linksid = content.getLongValue("linksid");
  244. String ownertable = content.getStringValue("ownertable");
  245. Long ownerid = content.getLongValue("ownerid");
  246. String title = "";
  247. String classStr = "";
  248. String typeStr = "";
  249. if (ownertable.equals("sat_sharematerial")) {
  250. Row row = dbConnect.runSqlQuery(0, "SELECT * from sat_sharematerial WHERE siteid='" + siteid + "' and sat_sharematerialid=" + ownerid);
  251. title = row.getString("title");
  252. int classid = row.getInteger("classid");
  253. if (classid == 2) {
  254. classStr = "长图文";
  255. }
  256. if (classid == 3) {
  257. classStr = "资料";
  258. }
  259. if (classid == 4) {
  260. classStr = "效果图";
  261. }
  262. if (classid == 5) {
  263. classStr = "设计实景";
  264. typeStr = "视频图";
  265. }
  266. int type = row.getInteger("type");
  267. if (type == 1) {
  268. typeStr = "图片";
  269. }
  270. if (type == 2) {
  271. typeStr = "视频";
  272. }
  273. }
  274. if (ownertable.equals("sa_fad")) {
  275. Row row = dbConnect.runSqlQuery(0, "SELECT * from sa_fad WHERE siteid='" + siteid + "' and sa_fadid=" + ownerid);
  276. title = row.getString("name");
  277. int classid = row.getInteger("classid");
  278. if (classid == 1) {
  279. classStr = "单品";
  280. typeStr = "";
  281. }
  282. if (classid == 2) {
  283. classStr = "商品";
  284. typeStr = "图片";
  285. }
  286. }
  287. if (linksid <= 0) {
  288. linksid = createTableID("sys_attachment_links");
  289. InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
  290. insertSQL.setSiteid(siteid);
  291. insertSQL.setUniqueid(linksid);
  292. insertSQL.setValue("usetype", ownertable);
  293. insertSQL.setValue("attachmentid", content.getLongValue("attachmentid"));
  294. insertSQL.setValue("jumpurl", content.getStringValue("jumpurl", true));
  295. insertSQL.setValue("sequence", content.getLongValue("sequence"));
  296. insertSQL.setValue("ownertable", ownertable);
  297. insertSQL.setValue("ownerid", ownerid);
  298. insertSQL.insert();
  299. DataContrlLog.createLog(this, ownertable, ownerid, "新建", "新建" + typeStr + "于" + classStr + " " + title).insert();
  300. }
  301. if (linksid > 0) {
  302. UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_attachment_links");
  303. updateSQL.setSiteid(siteid);
  304. updateSQL.setUniqueid(linksid);
  305. updateSQL.setValue("jumpurl", content.getStringValue("jumpurl", true));
  306. updateSQL.setValue("sequence", content.getLongValue("sequence"));
  307. updateSQL.setValue("attachmentid", content.getLongValue("attachmentid"));
  308. updateSQL.update();
  309. DataContrlLog.createLog(this, ownertable, ownerid, "编辑", "编辑" + typeStr + "于" + classStr + " " + title).insert();
  310. }
  311. String sql = "SELECT * from sys_attachment_links WHERE linksid=" + linksid + " and siteid='" + siteid + "'";
  312. Rows rows = dbConnect.runSqlQuery(sql);
  313. return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
  314. }
  315. @API(title = "图片批量新增", apiversion = R.ID20240425102102.v1.class)
  316. public String attachmentInserts() throws YosException {
  317. String ownertable = content.getStringValue("ownertable");
  318. Long ownerid = content.getLongValue("ownerid");
  319. JSONArray jsonArray = content.getJSONArray("items");
  320. ArrayList<String> listSql = new ArrayList<>();
  321. for (Object obj : jsonArray) {
  322. if (obj instanceof JSONObject) {
  323. JSONObject jsonObject = (JSONObject) obj;
  324. InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
  325. insertSQL.setSiteid(siteid);
  326. insertSQL.setUniqueid(createTableID("sys_attachment_links"));
  327. insertSQL.setValue("usetype", ownertable);
  328. insertSQL.setValue("attachmentid", jsonObject.getLongValue("attachmentid"));
  329. insertSQL.setValue("jumpurl", jsonObject.getStringValue("jumpurl", true));
  330. insertSQL.setValue("sequence", jsonObject.getLongValue("sequence"));
  331. insertSQL.setValue("ownertable", ownertable);
  332. insertSQL.setValue("ownerid", ownerid);
  333. listSql.add(insertSQL.getSQL());
  334. }
  335. }
  336. dbConnect.runSqlUpdate(listSql);
  337. return getSucReturnObject().toString();
  338. }
  339. @API(title = "图片删除", apiversion = R.ID20240407135902.v1.class)
  340. public String attachmentDelete() throws YosException {
  341. JSONArray linksids = content.getJSONArray("linksids");
  342. for (Object object : linksids) {
  343. Row row = dbConnect.runSqlQuery(0, "select * from sys_attachment_links where linksid=" + object);
  344. String ownertable = row.getString("ownertable");
  345. Long ownerid = row.getLong("ownerid");
  346. String classStr = "";
  347. String typeStr = "";
  348. if (ownertable.equals("sat_sharematerial")) {
  349. row = dbConnect.runSqlQuery(0, "SELECT * from sat_sharematerial WHERE siteid='" + siteid + "' and sat_sharematerialid=" + ownerid);
  350. int classid = row.getInteger("classid");
  351. if (classid == 2) {
  352. classStr = "长图文";
  353. }
  354. if (classid == 3) {
  355. classStr = "资料";
  356. }
  357. if (classid == 4) {
  358. classStr = "效果图";
  359. }
  360. if (classid == 5) {
  361. classStr = "设计实景";
  362. typeStr = "视频图";
  363. }
  364. int type = row.getInteger("type");
  365. if (type == 1) {
  366. typeStr = "图片";
  367. }
  368. if (type == 2) {
  369. typeStr = "视频";
  370. }
  371. DataContrlLog.createLog(this, ownertable, ownerid, "删除", "删除" + typeStr + "于" + classStr + " " + row.getString("name")).insert();
  372. }
  373. if (ownertable.equals("sa_fad")) {
  374. row = dbConnect.runSqlQuery(0, "SELECT * from sa_fad WHERE siteid='" + siteid + "' and sa_fadid=" + ownerid);
  375. int classid = row.getInteger("classid");
  376. if (classid == 1) {
  377. classStr = "单品";
  378. typeStr = "";
  379. }
  380. if (classid == 2) {
  381. classStr = "商品";
  382. typeStr = "图片";
  383. }
  384. }
  385. DataContrlLog.createLog(this, ownertable, ownerid, "删除", "删除" + typeStr + "于" + classStr + " " + row.getString("name")).insert();
  386. }
  387. DeleteSQL deleteSQL = SQLFactory.createDeleteSQL(this, "sys_attachment_links");
  388. deleteSQL.setSiteid(siteid);
  389. deleteSQL.setWhere("linksid", linksids);
  390. deleteSQL.delete();
  391. return getSucReturnObject().toString();
  392. }
  393. @API(title = "图片列表", apiversion = R.ID20240407140002.v1.class)
  394. public String attachmentList() throws YosException {
  395. StringBuffer where = new StringBuffer(" 1=1 ");
  396. if (content.containsKey("where")) {
  397. JSONObject whereObject = content.getJSONObject("where");
  398. if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
  399. where.append(" and (");
  400. where.append("t1.attachmentid like'%").append(whereObject.getString("condition")).append("%' ");
  401. where.append(")");
  402. }
  403. }
  404. String ownertable = content.getStringValue("ownertable");
  405. Long ownerid = content.getLongValue("ownerid");
  406. QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_attachment_links").setTableAlias("t1");
  407. querySQL.setSiteid(siteid);
  408. querySQL.setWhere(where.toString());
  409. querySQL.setWhere("ownertable", ownertable);
  410. querySQL.setWhere("ownerid", ownerid);
  411. querySQL.setWhere("usetype", ownertable);
  412. querySQL.setPage(pageSize, pageNumber).setOrderBy(pageSorting);
  413. Rows rows = querySQL.query();
  414. ArrayList<Long> ids = rows.toArrayList("attachmentid", new ArrayList<>());
  415. RowsMap attRowsMap = Attachment.get(this, ids).toRowsMap("attachmentid");
  416. for (Row row : rows) {
  417. Rows attRows = new Rows();
  418. Rows tempAttRows = attRowsMap.getOrDefault(row.getString("attachmentid"), new Rows());
  419. for (Row tempAttRow : tempAttRows) {
  420. // if (tempAttRow.getString("usetype").equals(ownertable)) {
  421. attRows.add(tempAttRow);
  422. // }
  423. }
  424. row.put("attinfos", attRows);
  425. }
  426. return getSucReturnObject().setData(rows).toString();
  427. }
  428. @API(title = "发送邮件", apiversion = R.ID20240408154702.v1.class)
  429. public String sendMail() throws Exception {
  430. Long sat_sharematerialid = content.getLongValue("sat_sharematerialid");
  431. String email = content.getStringValue("email");
  432. if (!Parameter.get(siteid, "remind_mail").equalsIgnoreCase("1")) {
  433. return getErrReturnObject().setErrMsg("邮件功能未开启").toString();
  434. }
  435. Rows rows = dbConnect.runSqlQuery("SELECT * from sat_sharematerial where sat_sharematerialid=" + sat_sharematerialid);
  436. if (rows.isEmpty()) {
  437. return getErrReturnObject().setErrMsg("数据不存在").toString();
  438. }
  439. Rows rowsAtt = Attachment.get(this, "sat_sharematerial", sat_sharematerialid, "sat_sharematerial");
  440. EmailContent emailContent = new EmailContent();
  441. emailContent.addText(rows.get(0).getString("content"));
  442. for (Row rowAtt : rowsAtt) {
  443. emailContent.addFile(rowAtt.getString("url"));
  444. }
  445. Remind remind = new Remind(siteid);
  446. remind.setTitle(rows.get(0).getString("title"));
  447. remind.setToemail(email);
  448. remind.setContent(emailContent);
  449. remind.sendByMail();
  450. SharematerialHelper.updateReadLog(this, sat_sharematerialid, 2);
  451. return getSucReturnObject().toString();
  452. }
  453. }