|
@@ -3,6 +3,7 @@ package com.management.platform.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.aliyun.dingtalkcontact_1_0.models.SearchUserResponse;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -242,6 +243,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
private HolidaySettingService holidaySettingService;
|
|
|
@Resource
|
|
|
private CompanyDingdingMapper companyDingdingMapper;
|
|
|
+ @Resource
|
|
|
+ private CompanyDingdingService companyDingdingService;
|
|
|
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String path;
|
|
@@ -4408,6 +4411,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
User user = userMapper.selectById(userId);
|
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
|
|
|
+ CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
|
|
|
List<Department> allDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", user.getCompanyId()));
|
|
|
//然后处理文件
|
|
|
String fileName = multipartFile.getOriginalFilename();
|
|
@@ -4508,6 +4512,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
userNameList.add(inchargerName);
|
|
|
}
|
|
|
}
|
|
|
+ List<User> targetUserList=new ArrayList<>();
|
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
|
System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
@@ -4516,8 +4521,26 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
return msg;
|
|
|
}
|
|
|
+ targetUserList= (List<User>) respMsg.data;
|
|
|
+ }
|
|
|
+ if(dingding!=null&&dingding.getSyncContact()==1&&userNameList.size()>0){
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
|
+ for (String name : userNameList) {
|
|
|
+ respMsg= companyDingdingService.getSearchUserInfo(dingding,name,1);
|
|
|
+ SearchUserResponse searchUserResponse = (SearchUserResponse) respMsg.data;
|
|
|
+ if(searchUserResponse.body.totalCount>0){
|
|
|
+ msg.setError("姓名为["+name+"]的人员存在重复,请使用工号!");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(searchUserResponse.body.list.size()>0){
|
|
|
+ User item=new User();
|
|
|
+ //为了修改代码 此处用企业微信同一个字段 setCorpwxUserid
|
|
|
+ item.setName(name);
|
|
|
+ item.setCorpwxUserid(searchUserResponse.body.list.get(0));
|
|
|
+ targetUserList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- List<User> targetUserList= (List<User>) respMsg.data;
|
|
|
int importCount = 0;
|
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
|
@@ -5142,17 +5165,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
userNameList.add(inchargerName);
|
|
|
}
|
|
|
}
|
|
|
- System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
|
+ List<User> targetUserList=new ArrayList<>();
|
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
|
respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
|
if(respMsg.code.equals("0")){
|
|
|
msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
return msg;
|
|
|
}
|
|
|
+ targetUserList= (List<User>) respMsg.data;
|
|
|
+ }
|
|
|
+ if(dingding!=null&&dingding.getSyncContact()==1&&userNameList.size()>0){
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
|
+ for (String name : userNameList) {
|
|
|
+ respMsg= companyDingdingService.getSearchUserInfo(dingding,name,1);
|
|
|
+ SearchUserResponse searchUserResponse = (SearchUserResponse) respMsg.data;
|
|
|
+ if(searchUserResponse.body.totalCount>0){
|
|
|
+ msg.setError("姓名为["+name+"]的人员存在重复,请使用工号!");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(searchUserResponse.body.list.size()>0){
|
|
|
+ User item=new User();
|
|
|
+ //为了修改代码 此处用企业微信同一个字段 setCorpwxUserid
|
|
|
+ item.setName(name);
|
|
|
+ item.setCorpwxUserid(searchUserResponse.body.list.get(0));
|
|
|
+ targetUserList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- List<User> targetUserList= (List<User>) respMsg.data;
|
|
|
- System.out.println(targetUserList);
|
|
|
List<String> existCodeList = new ArrayList<>();
|
|
|
int importCount = 0;
|
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|