Ver código fonte

创建话题时可以不传话题内容

沈静伟 4 anos atrás
pai
commit
4015ff931b

+ 8 - 7
src/dsb/com/cnd3b/restcontroller/system/im/imdialog/imdialog.java

@@ -213,7 +213,6 @@ public class imdialog extends Controller {
     public String createSubject() throws D3bException, P2Exception {
         long timsubjectid = content.getLongValue("timsubjectid"); //话题ID 新增时默认传0
         long timdialogid = content.getLongValue("timdialogid");
-        String fcontent = content.getString("timsubject", "timsubject.fcontent", "话题内容");//话题内容
 
         boolean ischange = timsubjectid > 0;
 
@@ -233,12 +232,14 @@ public class imdialog extends Controller {
         }
         PaoSetRemote timsubjectcontentSet = timsubject.getPaoSet("$timsubjectcontent", "timsubjectcontent");
 
-        PaoRemote timsubjectcontent = timsubjectcontentSet.addAtEnd();
-        timsubjectcontent.setValue("siteid", siteid, 11L);
-        timsubjectcontent.setValue("createdate", sysdate, 11L);
-        timsubjectcontent.setValue("timsubjectid", timsubjectid, 11L);
-        timsubjectcontent.setValue("fcontent", fcontent, 11L);
-
+        if(content.containsKey("fcontent")&&!"".equals(content.getString("fcontent"))){
+            String fcontent = content.getString("timsubject", "timsubject.fcontent", "话题内容");//话题内容
+            PaoRemote timsubjectcontent = timsubjectcontentSet.addAtEnd();
+            timsubjectcontent.setValue("siteid", siteid, 11L);
+            timsubjectcontent.setValue("createdate", sysdate, 11L);
+            timsubjectcontent.setValue("timsubjectid", timsubjectid, 11L);
+            timsubjectcontent.setValue("fcontent", fcontent, 11L);
+        }
         timsubjectSet.save();
         content.put("timsubjectid", timsubjectid);
         if (ischange) {//话题内容变更,通知前端进行数据刷新