|
@@ -18,8 +18,6 @@ import com.dingtalk.api.response.OapiUserListidResponse;
|
|
|
import com.dingtalk.api.response.OapiV2DepartmentListsubidResponse;
|
|
|
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.McR;
|
|
|
import com.malk.server.dingtalk.DDR_New;
|
|
|
import com.malk.service.dingtalk.DDClient;
|
|
@@ -100,9 +98,11 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
String body = rsp.getBody();
|
|
|
//通过fastjson工具转换成json对象,逐层解析
|
|
|
JSONObject jsonObject = JSON.parseObject(body);
|
|
|
- JSONObject result = jsonObject.getJSONObject("result");
|
|
|
- unionid = result.getString("unionid");
|
|
|
- System.out.println("根据钉钉userId获取的unionid:" + unionid);
|
|
|
+ if (jsonObject != null){
|
|
|
+ JSONObject result = jsonObject.getJSONObject("result");
|
|
|
+ unionid = result.getString("unionid");
|
|
|
+ System.out.println("根据钉钉userId获取的unionid:" + unionid);
|
|
|
+ }
|
|
|
} catch (ApiException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -377,20 +377,24 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
/**根据参会人员userId获取unionId*/
|
|
|
String canhuirenyuanUnionId1 = getUnionId(kezhangUserId);
|
|
|
|
|
|
- Map canhuirenyuanMap1 = new HashMap<>();
|
|
|
- canhuirenyuanMap1.put("id", canhuirenyuanUnionId1);
|
|
|
- canhuirenyuanMap1.put("isOptional", true);
|
|
|
- canhuirenyuanList.add(canhuirenyuanMap1);
|
|
|
+ if (canhuirenyuanUnionId1 != null){
|
|
|
+ Map canhuirenyuanMap1 = new HashMap<>();
|
|
|
+ canhuirenyuanMap1.put("id", canhuirenyuanUnionId1);
|
|
|
+ canhuirenyuanMap1.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap1);
|
|
|
+ }
|
|
|
|
|
|
String fukezhangUserId = yidaObj.getString("fukezhangUserId");
|
|
|
System.out.println("副科长userId:" + fukezhangUserId);
|
|
|
/**根据参会人员userId获取unionId*/
|
|
|
String canhuirenyuanUnionId2 = getUnionId(fukezhangUserId);
|
|
|
|
|
|
- Map canhuirenyuanMap2 = new HashMap<>();
|
|
|
- canhuirenyuanMap2.put("id", canhuirenyuanUnionId2);
|
|
|
- canhuirenyuanMap2.put("isOptional", true);
|
|
|
- canhuirenyuanList.add(canhuirenyuanMap2);
|
|
|
+ if (canhuirenyuanUnionId2 != null){
|
|
|
+ Map canhuirenyuanMap2 = new HashMap<>();
|
|
|
+ canhuirenyuanMap2.put("id", canhuirenyuanUnionId2);
|
|
|
+ canhuirenyuanMap2.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap2);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (canhuibumen.equals("信息技术科")){
|