Bladeren bron

职业鉴定, 预约会议室同步

pruple_boy 1 maand geleden
bovenliggende
commit
b0f4b047ca

+ 8 - 0
src/main/java/com/malk/pro/zyjn/controller/TongbuController.java

@@ -3,6 +3,7 @@ package com.malk.pro.zyjn.controller;
 
 import com.malk.server.common.McR;
 import com.malk.pro.zyjn.service.TongbuService;
+import com.malk.service.dingtalk.DDClient_Schedule;
 import com.malk.utils.UtilMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -59,4 +60,11 @@ public class TongbuController {
 
         return tongbuService.query(formUuid,conditions,argument,currentPage,pageSize);
     }
+
+    @GetMapping("test")
+    public McR test() {
+
+        tongbuService.test(); // 已手动维护ID到宜搭档案
+        return McR.success();
+    }
 }

+ 3 - 0
src/main/java/com/malk/pro/zyjn/service/TongbuService.java

@@ -19,4 +19,7 @@ public interface TongbuService {
     McR query(String formUuid, Map conditions, Map argument,int currentPage,int pageSize);
 
     McR updateRicheng(Map map);
+
+
+    void  test();
 }

+ 30 - 1
src/main/java/com/malk/pro/zyjn/service/impl/TongbuServiceImpl.java

@@ -20,15 +20,18 @@ import com.dingtalk.api.response.OapiV2UserGetResponse;
 import com.malk.pro.zyjn.service.TongbuService;
 import com.malk.server.aliwork.YDConf;
 import com.malk.server.aliwork.YDParam;
+import com.malk.server.common.McException;
 import com.malk.server.common.McR;
 import com.malk.server.dingtalk.DDR_New;
 import com.malk.service.aliwork.YDClient;
 import com.malk.service.dingtalk.DDClient;
+import com.malk.service.dingtalk.DDClient_Schedule;
 import com.malk.utils.UtilHttp;
 import com.malk.utils.UtilMap;
 import com.taobao.api.ApiException;
 import lombok.extern.slf4j.Slf4j;
 import okhttp3.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -662,7 +665,16 @@ public class TongbuServiceImpl implements TongbuService {
             //根据实例id修改宜搭表单数据
             Map mapData = new HashMap<>();
             mapData.put("textField_m54zg5b1", richengID);
-
+            // prd 25.06.26 同步预约会议室, 于会议室水牌显示日程
+            String roomId = jsonObject.getString("textField_mccrafms");
+            if (StringUtils.isNoneBlank(roomId)) {
+                try {
+                    ddClient_schedule.bookMeetingRoom(getAccessToken(), userId, richengID, Arrays.asList(roomId));
+                } catch (McException e) {
+                    mapData.put("textareaField_mccs33fz", e.getMessage());
+                    e.printStackTrace();
+                }
+            }
             String mapAllString = JSON.toJSONString(mapData);
             System.out.println("封装修改字段:" + mapAllString);
 
@@ -901,4 +913,21 @@ public class TongbuServiceImpl implements TongbuService {
 
         return McR.success();
     }
+
+
+    @Autowired
+    private DDClient_Schedule ddClient_schedule;
+
+    @Autowired
+    private DDClient dddClient;
+
+    @Override
+    public void test() {
+
+        String userId = "253434204020308091";
+
+        List<Map> dataList = (List<Map>) ddClient_schedule.getMeetingRoomList(dddClient.getAccessToken(), userId).getResult();
+        log.info("dataList, {}", dataList);
+
+    }
 }

+ 2 - 1
src/main/resources/application-dev.yml

@@ -16,7 +16,8 @@ logging:
   level:
     com.malk.*: debug
   file:
-    path: /home/server/pro/log/
+    #path: /home/server/pro/log/
+    path: /Users/malk/server/_Tool/var/mjava/log
 
 mybatis-plus:
   configuration:

+ 1 - 1
src/main/resources/logback-spring.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration debug="false" scan="false" scanPeriod="60 seconds">
-    <springProperty scope="context" name="LOG_HOME" source="logging.path" defaultValue="/home/server/log/"/>
+    <springProperty scope="context" name="LOG_HOME" source="logging.path" defaultValue="logging.file.path"/>
     <property name="FileNamePattern" value="${LOG_HOME}%d{yyyyMM}/%d{dd}"/>
 
     <!-- 定义控制台输出 -->