|
@@ -10,8 +10,12 @@ import com.aliyun.teautil.models.RuntimeOptions;
|
|
|
import com.dingtalk.api.DefaultDingTalkClient;
|
|
|
import com.dingtalk.api.DingTalkClient;
|
|
|
import com.dingtalk.api.request.OapiGettokenRequest;
|
|
|
+import com.dingtalk.api.request.OapiUserListidRequest;
|
|
|
+import com.dingtalk.api.request.OapiV2DepartmentListsubidRequest;
|
|
|
import com.dingtalk.api.request.OapiV2UserGetRequest;
|
|
|
import com.dingtalk.api.response.OapiGettokenResponse;
|
|
|
+import com.dingtalk.api.response.OapiUserListidResponse;
|
|
|
+import com.dingtalk.api.response.OapiV2DepartmentListsubidResponse;
|
|
|
import com.dingtalk.api.response.OapiV2UserGetResponse;
|
|
|
import com.malk.server.common.McR;
|
|
|
import com.malk.service.dingtalk.DDClient;
|
|
@@ -68,7 +72,7 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
try {
|
|
|
OapiGettokenResponse response = client.execute(request);
|
|
|
accessToken = response.getAccessToken();
|
|
|
- System.out.println("申通-设备数字化管理中心-AccessToken:" + accessToken);
|
|
|
+ System.out.println("职业技能-AccessToken:" + accessToken);
|
|
|
} catch (ApiException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -98,6 +102,153 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
return unionid;
|
|
|
}
|
|
|
|
|
|
+ //获取当前部门下一层级的部门id列表
|
|
|
+ public JSONArray getBumenIdList(long bumenid){
|
|
|
+
|
|
|
+ JSONArray dept_id_Array = null;
|
|
|
+ try {
|
|
|
+ DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsubid");
|
|
|
+ OapiV2DepartmentListsubidRequest req = new OapiV2DepartmentListsubidRequest();
|
|
|
+ req.setDeptId(bumenid);
|
|
|
+ OapiV2DepartmentListsubidResponse rsp = client.execute(req, getAccessToken());
|
|
|
+ System.out.println("钉钉【获取子部门id列表】接口返回信息:" + rsp.getBody());
|
|
|
+ JSONObject dingdingBumenIdObj = JSON.parseObject(rsp.getBody());
|
|
|
+ long errcode = dingdingBumenIdObj.getLong("errcode");
|
|
|
+ System.out.println("接口返回状态码:" + errcode);
|
|
|
+ if (errcode == 0){
|
|
|
+ JSONObject resultObj = dingdingBumenIdObj.getJSONObject("result");
|
|
|
+ System.out.println("返回信息result:" + resultObj);
|
|
|
+ dept_id_Array = resultObj.getJSONArray("dept_id_list");
|
|
|
+ }
|
|
|
+ } catch (ApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ System.out.println("封装【当前部门下一层级的部门id列表】jsonArray:" + dept_id_Array);
|
|
|
+
|
|
|
+ return dept_id_Array;
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据部门id获取部门下的人员userId列表
|
|
|
+ public JSONArray getUserIdList(long bumenid){
|
|
|
+
|
|
|
+ JSONArray userid_list = null;
|
|
|
+ try {
|
|
|
+ DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/user/listid");
|
|
|
+ OapiUserListidRequest req = new OapiUserListidRequest();
|
|
|
+ req.setDeptId(bumenid);
|
|
|
+ OapiUserListidResponse rsp = client.execute(req, getAccessToken());
|
|
|
+ System.out.println("钉钉【获取部门用户userId列表】接口返回信息:" + rsp.getBody());
|
|
|
+ JSONObject dingdingUserIdObj = JSON.parseObject(rsp.getBody());
|
|
|
+ long errcode = dingdingUserIdObj.getLong("errcode");
|
|
|
+ System.out.println("接口返回状态码:" + errcode);
|
|
|
+ if (errcode == 0){
|
|
|
+ JSONObject resultObj = dingdingUserIdObj.getJSONObject("result");
|
|
|
+ System.out.println("返回信息result:" + resultObj);
|
|
|
+ userid_list = resultObj.getJSONArray("userid_list");
|
|
|
+ }
|
|
|
+ } catch (ApiException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ System.out.println("封装【当前部门用户userId列表】jsonArray:" + userid_list);
|
|
|
+
|
|
|
+ return userid_list;
|
|
|
+ }
|
|
|
+
|
|
|
+ //根据勾选部门名称获取宜搭表单数据
|
|
|
+ public JSONArray getYidaDeptName(String bumenmingcheng){
|
|
|
+
|
|
|
+ //宜搭表单判断查询条件
|
|
|
+ Map map1 = new HashMap();
|
|
|
+ //字段编号
|
|
|
+ map1.put("key", "textField_m99cq8lt");
|
|
|
+ //同步类型
|
|
|
+ map1.put("value", bumenmingcheng);
|
|
|
+ //控件类型
|
|
|
+ map1.put("type", "TEXT");
|
|
|
+ //逻辑判断符
|
|
|
+ map1.put("operator", "eq");
|
|
|
+ //控件名称
|
|
|
+ map1.put("componentName", "TextField");
|
|
|
+
|
|
|
+ List list11 = new ArrayList();
|
|
|
+ list11.add(map1);
|
|
|
+
|
|
|
+ String listJson = JSON.toJSONString(list11);
|
|
|
+ System.out.println("查询条件listJson:" + listJson);
|
|
|
+
|
|
|
+ JSONObject jsonObject = null;
|
|
|
+
|
|
|
+ int size = 100;
|
|
|
+ int page = 1;
|
|
|
+
|
|
|
+ //查询表单实例数据
|
|
|
+ try {
|
|
|
+ com.aliyun.dingtalkyida_1_0.Client client = createClient2();
|
|
|
+ com.aliyun.dingtalkyida_1_0.models.SearchFormDatasHeaders searchFormDatasHeaders = new com.aliyun.dingtalkyida_1_0.models.SearchFormDatasHeaders();
|
|
|
+ searchFormDatasHeaders.xAcsDingtalkAccessToken = getAccessToken();
|
|
|
+ com.aliyun.dingtalkyida_1_0.models.SearchFormDatasRequest searchFormDatasRequest = new com.aliyun.dingtalkyida_1_0.models.SearchFormDatasRequest()
|
|
|
+ .setSystemToken("U0E66VB1J86UR5RKDPXQTA7WM66K3896KHW8MS5")
|
|
|
+ .setSearchFieldJson(listJson)
|
|
|
+ .setCurrentPage(page)
|
|
|
+ .setPageSize(size)
|
|
|
+ .setFormUuid("FORM-458D5FBCB956415081E7725CA5473ABB0ZR2")
|
|
|
+ .setUserId("yida_pub_account")
|
|
|
+ .setAppType("APP_E0BKS4I6U44824QM1KE5");
|
|
|
+
|
|
|
+ SearchFormDatasResponse searchFormDatasResponse = client.searchFormDatasWithOptions(searchFormDatasRequest, searchFormDatasHeaders, new RuntimeOptions());
|
|
|
+// System.out.println(JSON.toJSONString(searchFormDatasResponse.getBody()));
|
|
|
+ String s = JSON.toJSONString(searchFormDatasResponse.getBody());
|
|
|
+ jsonObject = JSON.parseObject(s);
|
|
|
+ System.out.println("查询【部门档案】接口object对象:" + jsonObject);
|
|
|
+ } catch (TeaException err) {
|
|
|
+ if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
|
|
|
+ // err 中含有 code 和 message 属性,可帮助开发定位问题
|
|
|
+ }
|
|
|
+ } catch (Exception _err) {
|
|
|
+ TeaException err = new TeaException(_err.getMessage(), _err);
|
|
|
+ if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) {
|
|
|
+ // err 中含有 code 和 message 属性,可帮助开发定位问题
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List listAll = new ArrayList();
|
|
|
+ try {
|
|
|
+ JSONArray data = jsonObject.getJSONArray("data");
|
|
|
+ System.out.println("返回的宜搭data:" + data);
|
|
|
+
|
|
|
+ if (!data.isEmpty()) {
|
|
|
+ JSONObject formData = data.getJSONObject(0).getJSONObject("formData");
|
|
|
+ String textField_m99cq8lt = formData.getString("textField_m99cq8lt");
|
|
|
+ System.out.println("部门名称:" + textField_m99cq8lt);
|
|
|
+
|
|
|
+ String kezhangUserId = "";
|
|
|
+ JSONArray jsonArray = formData.getJSONArray("employeeField_m99cq8lu_id");
|
|
|
+ if (jsonArray != null && !jsonArray.isEmpty()){
|
|
|
+ kezhangUserId = jsonArray.getString(0);
|
|
|
+ System.out.println("科长userId:" + kezhangUserId);
|
|
|
+ }
|
|
|
+
|
|
|
+ String fukezhangUserId = "";
|
|
|
+ JSONArray jsonArray1 = formData.getJSONArray("employeeField_m9l4bvrr_id");
|
|
|
+ if (jsonArray1 != null && !jsonArray1.isEmpty()){
|
|
|
+ fukezhangUserId = jsonArray1.getString(0);
|
|
|
+ System.out.println("副科长userId:" + fukezhangUserId);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map map = new HashMap<>();
|
|
|
+ map.put("bumenmingcheng",textField_m99cq8lt);
|
|
|
+ map.put("kezhangUserId",kezhangUserId);
|
|
|
+ map.put("fukezhangUserId",fukezhangUserId);
|
|
|
+ listAll.add(map);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(listAll));
|
|
|
+ System.out.println("封装【部门档案】jsonArray:" + jsonArray);
|
|
|
+
|
|
|
+ return jsonArray;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//宜搭创建会议申请后同步创建钉钉日程
|
|
|
/**
|
|
@@ -121,9 +272,12 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT;
|
|
|
|
|
|
//宜搭数据详情链接
|
|
|
- String yidaURL = "https://so09k2.aliwork.com/APP_E0BKS4I6U44824QM1KE5/processDetail?formUuid=FORM-8039B0A8CD7C48E8B7B1D5FF56AD3EF0VVHP&procInsId="+ formInstId +"&navConfig.layout=1180";
|
|
|
+ String yidaURL = "会议申请记录:" + "https://so09k2.aliwork.com/APP_E0BKS4I6U44824QM1KE5/processDetail?formUuid=FORM-8039B0A8CD7C48E8B7B1D5FF56AD3EF0VVHP&procInsId="+ formInstId +"&navConfig.layout=1180";
|
|
|
System.out.println("宜搭数据详情链接:" + yidaURL);
|
|
|
|
|
|
+ //汇总所有参会人员
|
|
|
+ List canhuirenyuanList = new ArrayList<>();
|
|
|
+
|
|
|
/**宜搭表单字段*/
|
|
|
//创建人userId
|
|
|
String userId = jsonObject.getString("textField_m54zg5b0");
|
|
@@ -135,6 +289,260 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
String huiyizhuti = jsonObject.getString("textField_m523ok9w");
|
|
|
System.out.println("会议主题:" + huiyizhuti);
|
|
|
|
|
|
+
|
|
|
+ //------------------------------------⬇第二版新增⬇-----------------------------------------------
|
|
|
+ //发布部门类型
|
|
|
+ String fabubumenleixing = jsonObject.getString("radioField_m9getzvn");
|
|
|
+ System.out.println("发布部门类型:" + fabubumenleixing);
|
|
|
+ if (fabubumenleixing.equals("组织内部门")){
|
|
|
+ //获取发布部门id
|
|
|
+ long fabubumenId = jsonObject.getJSONArray("departmentSelectField_m99jf2e4").getLong(0);
|
|
|
+ System.out.println("发布部门ID:" + fabubumenId);
|
|
|
+ /**根据发布部门获取当前部门及下级所有部门的人员列表*/
|
|
|
+ List bumenIdList = new ArrayList();
|
|
|
+ bumenIdList.add(fabubumenId);
|
|
|
+ /**调用获取当前部门的下一层级部门id列表*/
|
|
|
+ log.info("获取当前部门的下一层级部门id列表中......");
|
|
|
+ JSONArray nextBumenIdList = getBumenIdList(fabubumenId);
|
|
|
+ if (nextBumenIdList != null && !nextBumenIdList.isEmpty()){
|
|
|
+ System.out.println("【1】当前部门有下级部门,开始循环获取下一层级部门===");
|
|
|
+ for (int i = 0; i < nextBumenIdList.size(); i++) {
|
|
|
+ long deptId = nextBumenIdList.getLong(i);
|
|
|
+ System.out.println("部门ID:" + deptId);
|
|
|
+ bumenIdList.add(deptId);
|
|
|
+
|
|
|
+ JSONArray nextBumenIdList1 = getBumenIdList(deptId);
|
|
|
+ if (nextBumenIdList1 != null && !nextBumenIdList1.isEmpty()){
|
|
|
+ System.out.println("【2】当前部门有下级部门,开始循环获取下一层级部门===");
|
|
|
+ for (int i1 = 0; i1 < nextBumenIdList1.size(); i1++) {
|
|
|
+ long deptId1 = nextBumenIdList1.getLong(i1);
|
|
|
+ System.out.println("部门ID:" + deptId1);
|
|
|
+ bumenIdList.add(deptId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("部门id汇总List:" + bumenIdList);
|
|
|
+ JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(bumenIdList));
|
|
|
+ System.out.println("封装【部门id汇总列表】jsonArray:" + jsonArray);
|
|
|
+
|
|
|
+ /**调用获取每个部门id下的人员userId列表*/
|
|
|
+ log.info("获取每个部门id下的人员userId列表中......");
|
|
|
+ for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
+ long bmid = jsonArray.getLong(i);
|
|
|
+ System.out.println("循环当前部门id:" + bmid);
|
|
|
+
|
|
|
+ JSONArray userIdList = getUserIdList(bmid);
|
|
|
+ if (userIdList != null && !userIdList.isEmpty()){
|
|
|
+ System.out.println("当前部门id中存在人员userIdList:" + userIdList);
|
|
|
+
|
|
|
+ for (int j = 0; j < userIdList.size(); j++) {
|
|
|
+ String renyuanId = userIdList.getString(j);
|
|
|
+ System.out.println("循环当前的人员Id:" + renyuanId);
|
|
|
+
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(renyuanId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //参会部门勾选项
|
|
|
+ JSONArray checkboxField_m99d3k6z = jsonObject.getJSONArray("checkboxField_m99d3k6z");
|
|
|
+ System.out.println("参会部门多选:" + checkboxField_m99d3k6z);
|
|
|
+ if (checkboxField_m99d3k6z != null && !checkboxField_m99d3k6z.isEmpty()){
|
|
|
+ for (int x = 0; x < checkboxField_m99d3k6z.size(); x++) {
|
|
|
+ String canhuibumen = checkboxField_m99d3k6z.getString(x);
|
|
|
+ System.out.println("循环当前参会部门勾选项:" + canhuibumen);
|
|
|
+
|
|
|
+ /**获取维护表的该部门中的「科长」「副科长」userId*/
|
|
|
+ JSONArray yidaDeptName = getYidaDeptName(canhuibumen);
|
|
|
+ if (yidaDeptName != null && !yidaDeptName.isEmpty()){
|
|
|
+ JSONObject yidaObj = yidaDeptName.getJSONObject(0);
|
|
|
+ String kezhangUserId = yidaObj.getString("kezhangUserId");
|
|
|
+ System.out.println("科长userId:" + kezhangUserId);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId1 = getUnionId(kezhangUserId);
|
|
|
+
|
|
|
+ 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 (canhuibumen.equals("信息技术科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr0");
|
|
|
+ System.out.println("信息技术科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("研发管理科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr1");
|
|
|
+ System.out.println("研发管理科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("竞赛管理科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr4");
|
|
|
+ System.out.println("竞赛管理科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("综合办公室")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr5");
|
|
|
+ System.out.println("综合办公室参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("考务管理科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr6");
|
|
|
+ System.out.println("考务管理科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("财务科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr2");
|
|
|
+ System.out.println("财务科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("质量督导科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr7");
|
|
|
+ System.out.println("质量督导科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (canhuibumen.equals("题库管理科")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m99dcmr8");
|
|
|
+ System.out.println("题库管理科参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (canhuibumen.equals("系统实施")){
|
|
|
+ //获取相应人员组件里面的人员id
|
|
|
+ JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m9l7c095");
|
|
|
+ System.out.println("系统实施参会人员(多选):" + canhuirenyuanArray);
|
|
|
+
|
|
|
+ if (canhuirenyuanArray != null && !canhuirenyuanArray.isEmpty()) {
|
|
|
+ for (int y = 0; y < canhuirenyuanArray.size(); y++) {
|
|
|
+ String canhuirenyuanUserId = canhuirenyuanArray.getString(y);
|
|
|
+ /**根据参会人员userId获取unionId*/
|
|
|
+ String canhuirenyuanUnionId = getUnionId(canhuirenyuanUserId);
|
|
|
+
|
|
|
+ Map canhuirenyuanMap = new HashMap<>();
|
|
|
+ canhuirenyuanMap.put("id", canhuirenyuanUnionId);
|
|
|
+ canhuirenyuanMap.put("isOptional", true);
|
|
|
+ canhuirenyuanList.add(canhuirenyuanMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //------------------------------------⬆第二版新增⬆-----------------------------------------------
|
|
|
+
|
|
|
JSONArray timeArray = jsonObject.getJSONArray("cascadeDateField_m523oka0");
|
|
|
//会议开始时间
|
|
|
long huiyikaishishijian = timeArray.getLong(0);
|
|
@@ -170,7 +578,6 @@ public class TongbuServiceImpl implements TongbuService {
|
|
|
JSONArray canhuirenyuanArray = jsonObject.getJSONArray("employeeField_m9atzdf9");
|
|
|
System.out.println("参会人员(多选):" + canhuirenyuanArray);
|
|
|
|
|
|
- List canhuirenyuanList = new ArrayList<>();
|
|
|
for (int i = 0; i < canhuirenyuanArray.size(); i++) {
|
|
|
String canhuirenyuanUserId = canhuirenyuanArray.getString(i);
|
|
|
/**根据参会人员userId获取unionId*/
|