lgy %!s(int64=6) %!d(string=hai) anos
pai
achega
15a1cfcf62
Modificáronse 1 ficheiros con 19 adicións e 25 borrados
  1. 19 25
      src/main/java/com/persagy/controller/OrdinaryController.java

+ 19 - 25
src/main/java/com/persagy/controller/OrdinaryController.java

@@ -115,6 +115,7 @@ public class OrdinaryController {
     public List<ReservationVo> findAllReservationByRoomId(@RequestBody String id) throws Exception {
         JSONObject jsonObject = JSONObject.parseObject(id);
         Integer roomId = jsonObject.getInteger("id");
+        String date = jsonObject.getString("date");
         List<ReservationVo> list = null;
         list = reservationService.findByRoomId(roomId);
         return list;
@@ -164,11 +165,14 @@ public class OrdinaryController {
         JSONArray enterUsers = jsonObject.getJSONArray("enterUsers");
 
         JSONArray dateArray = jsonObject.getJSONArray("dateArray");
+        String date = "";
+        String beginTime = "";
+        String endTime = "";
         for (int i = 0; i <dateArray.size() ; i++) {
             JSONObject json = dateArray.getJSONObject(i);
-            String date = json.getString("date");
-            String beginTime = json.getString("beginTime");
-            String endTime = json.getString("endTime");
+            date = json.getString("date");
+            beginTime = json.getString("beginTime");
+            endTime = json.getString("endTime");
 //            String a = date+""+
             ReservationCustom reservationCustom = new ReservationCustom();
             reservationCustom.setDate(date);
@@ -199,22 +203,18 @@ public class OrdinaryController {
             }
         }
         result.put("users",users);
-       JSONObject message = new JSONObject();
+        JSONObject result2 = new JSONObject();
+        JSONObject message = new JSONObject();
         JSONObject head = new JSONObject();
         head.put("title","会议参加提醒");
         JSONObject first = new JSONObject();
-        head.put("first","欢迎参加“"+userName+"”组织的【"+theme+"】会议,会议将于");
-//        message.put("head,new )
-//        {
-//            "head":{
-//            "title":"会议室提醒"
-//        },
-//            "first":{
-//            "content":"2019-08-24"
-//        }
-
-        result.put("text","theme");
-//        sendMessage(result.toString());
+        first.put("first","欢迎参加“"+userName+"”组织的【"+theme+"】会议," +
+                "会议将于"+date+" "+beginTime+"-"+endTime+"召开,请届时参见");
+        message.put("head",head);
+        message.put("first",first);
+        result2.put("composite",message);
+        result.put("text",result2);
+        sendMessage(result.toString());
 
         return "success";
     }
@@ -432,19 +432,13 @@ public class OrdinaryController {
         obj.put("corpId",corpId);
         JSONObject jsonObject = JSONObject.parseObject(jsonStr);
         //消息内容
-        String text = jsonObject.getString("text");
+        JSONObject text = jsonObject.getJSONObject("text");
         //发送人
         JSONArray users = jsonObject.getJSONArray("users");
 
-
-//        JSONArray users = new JSONArray();
-//        users.add("FSUID_782A9585B3CEB91B9DC0C709FA4D3119");
-
         obj.put("toUser",users);
-        obj.put("msgType","text");
-        JSONObject content = new JSONObject();
-        content.put("content","luo nb");
-        obj.put("text",content);
+        obj.put("msgType","composite");
+        obj.put("composite",text);
 
         String result = httpPostRequest(messageURL, obj);
         return result;