|
@@ -191,6 +191,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
GroupTemplateMapper GroupTemplateMapper;
|
|
GroupTemplateMapper GroupTemplateMapper;
|
|
@Resource
|
|
@Resource
|
|
WxCorpInfoMapper wxCorpInfoMapper;
|
|
WxCorpInfoMapper wxCorpInfoMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ WxCorpInfoService wxCorpInfoService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private HttpServletResponse response;
|
|
private HttpServletResponse response;
|
|
@@ -3095,7 +3097,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
User user = userMapper.selectById(userId);
|
|
User user = userMapper.selectById(userId);
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
- WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
|
|
|
+ WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
|
|
//然后处理文件
|
|
//然后处理文件
|
|
String fileName = multipartFile.getOriginalFilename();
|
|
String fileName = multipartFile.getOriginalFilename();
|
|
File file = new File(fileName == null ? "file" : fileName);
|
|
File file = new File(fileName == null ? "file" : fileName);
|
|
@@ -3144,6 +3146,37 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
projectLevelMap.put(MessageUtils.message("excel.MedRisk"), 6);
|
|
projectLevelMap.put(MessageUtils.message("excel.MedRisk"), 6);
|
|
projectLevelMap.put(MessageUtils.message("excel.highRisk"), 7);
|
|
projectLevelMap.put(MessageUtils.message("excel.highRisk"), 7);
|
|
List<String> existCodeList = new ArrayList<>();
|
|
List<String> existCodeList = new ArrayList<>();
|
|
|
|
+ List<String> userNameList=new ArrayList<>();
|
|
|
|
+ for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
|
|
+ XSSFRow row = sheet.getRow(rowIndex);
|
|
|
|
+ if (row == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //跳过空行
|
|
|
|
+ if (ExcelUtil.isRowEmpty(row)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ XSSFCell participatorCell = row.getCell(5);
|
|
|
|
+ if (participatorCell!=null)participatorCell.setCellType(CellType.STRING);
|
|
|
|
+ String part = participatorCell.getStringCellValue().trim();
|
|
|
|
+ String[] partSplit = part.split("\\,|\\,");
|
|
|
|
+ for (String s : partSplit) {
|
|
|
|
+ if(userNameList.contains(s)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ userNameList.add(s);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList);
|
|
|
|
+ HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
|
|
|
|
+ if(respMsg.code.equals("0")){
|
|
|
|
+ msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<User> targetUserList= (List<User>) respMsg.data;
|
|
int importCount = 0;
|
|
int importCount = 0;
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
|
@@ -3243,15 +3276,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
project.setInchargerId(first.get().getId());
|
|
project.setInchargerId(first.get().getId());
|
|
@@ -3339,15 +3378,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Participation p = new Participation();
|
|
Participation p = new Participation();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
@@ -3379,15 +3424,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
User partMemb = first.get();
|
|
User partMemb = first.get();
|
|
@@ -3482,6 +3533,46 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
projectLevelMap.put(MessageUtils.message("excel.MedRisk"), 6);
|
|
projectLevelMap.put(MessageUtils.message("excel.MedRisk"), 6);
|
|
projectLevelMap.put(MessageUtils.message("excel.highRisk"), 7);
|
|
projectLevelMap.put(MessageUtils.message("excel.highRisk"), 7);
|
|
}
|
|
}
|
|
|
|
+ List<String> userNameList=new ArrayList<>();
|
|
|
|
+ for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
|
|
+ HSSFRow row = sheet.getRow(rowIndex);
|
|
|
|
+ if (row == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //跳过空行
|
|
|
|
+ if (ExcelUtil.isRowEmpty(row)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ HSSFCell participatorCell=null;
|
|
|
|
+ int c=0;
|
|
|
|
+ if(company.getId()==936){
|
|
|
|
+ c++;
|
|
|
|
+ }
|
|
|
|
+ if(timeType.getMainProjectState()==1){
|
|
|
|
+ participatorCell = row.getCell(4+c);
|
|
|
|
+ }else {
|
|
|
|
+ participatorCell = row.getCell(5+c);
|
|
|
|
+ }
|
|
|
|
+ if (participatorCell!=null)participatorCell.setCellType(CellType.STRING);
|
|
|
|
+ String part = participatorCell.getStringCellValue().trim();
|
|
|
|
+ String[] partSplit = part.split("\\,|\\,");
|
|
|
|
+ for (String s : partSplit) {
|
|
|
|
+ if(userNameList.contains(s)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ userNameList.add(s);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList);
|
|
|
|
+ HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList);
|
|
|
|
+ if(respMsg.code.equals("0")){
|
|
|
|
+ msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<User> targetUserList= (List<User>) respMsg.data;
|
|
List<String> existCodeList = new ArrayList<>();
|
|
List<String> existCodeList = new ArrayList<>();
|
|
int importCount = 0;
|
|
int importCount = 0;
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
@@ -3754,22 +3845,28 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
project.setInchargerId(first.get().getId());
|
|
project.setInchargerId(first.get().getId());
|
|
project.setInchargerName(first.get().getName());
|
|
project.setInchargerName(first.get().getName());
|
|
} else {
|
|
} else {
|
|
switch (exception){
|
|
switch (exception){
|
|
- case 0:throw new Exception(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1?"项目负责人工号为["+split[0]+"]的人员不存在":"项目负责人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
|
|
|
+ case 0:throw new Exception((wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1)?"项目负责人工号为["+split[0]+"]的人员不存在":"项目负责人姓名/工号为["+split[0]+"]的人员不存在");
|
|
case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
|
|
case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4330,15 +4427,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Participation p = new Participation();
|
|
Participation p = new Participation();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
@@ -4369,15 +4472,21 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
Integer exception=null;
|
|
Integer exception=null;
|
|
if(split.length==1){
|
|
if(split.length==1){
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ }else {
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
- }else {first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();}
|
|
|
|
|
|
+ }
|
|
exception=0;
|
|
exception=0;
|
|
}else {
|
|
}else {
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()!=1){
|
|
|
|
- first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
|
|
|
|
+ first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
exception=1;
|
|
exception=1;
|
|
- }else first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
|
|
+ }else {
|
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
Participation p = new Participation();
|
|
Participation p = new Participation();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
@@ -4565,6 +4674,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
List<String> nameList= (List<String>) resultMap.get("nameList");
|
|
List<String> nameList= (List<String>) resultMap.get("nameList");
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
Company company = companyMapper.selectById(user.getCompanyId());
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", company.getId()));
|
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
|
|
List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
|
|
List<String> headList = new ArrayList<String>();
|
|
List<String> headList = new ArrayList<String>();
|
|
// headList.add("项目编号");
|
|
// headList.add("项目编号");
|
|
@@ -4577,6 +4687,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
// headList.add("结束日期");
|
|
// headList.add("结束日期");
|
|
// headList.add("创建人");
|
|
// headList.add("创建人");
|
|
// headList.add("创建日期");
|
|
// headList.add("创建日期");
|
|
|
|
+ if(timeType.getMainProjectState()==1){
|
|
|
|
+ headList.add(MessageUtils.message("entry.mainProject"));
|
|
|
|
+ headList.add(MessageUtils.message("entry.mainProjectCode"));
|
|
|
|
+ }
|
|
headList.add(MessageUtils.message("entry.projectId"));
|
|
headList.add(MessageUtils.message("entry.projectId"));
|
|
headList.add(MessageUtils.message("entry.projectType"));
|
|
headList.add(MessageUtils.message("entry.projectType"));
|
|
headList.add(MessageUtils.message("entry.publicProject"));
|
|
headList.add(MessageUtils.message("entry.publicProject"));
|
|
@@ -4588,7 +4702,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
headList.add(MessageUtils.message("entry.creator"));
|
|
headList.add(MessageUtils.message("entry.creator"));
|
|
headList.add(MessageUtils.message("entry.creDate"));
|
|
headList.add(MessageUtils.message("entry.creDate"));
|
|
//自定义维度
|
|
//自定义维度
|
|
- TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
|
if (timeType.getCustomDegreeActive() == 1) {
|
|
if (timeType.getCustomDegreeActive() == 1) {
|
|
headList.add(timeType.getCustomDegreeName());
|
|
headList.add(timeType.getCustomDegreeName());
|
|
}
|
|
}
|
|
@@ -4652,11 +4765,23 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
collect.add(-1);
|
|
collect.add(-1);
|
|
List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
|
|
List<ProjectSeparate> projectSeparateList= projectSeparateMapper.selectList(new QueryWrapper<ProjectSeparate>().in("id", collect));
|
|
List<ProjectKeyNodes> nodesList = projectKeyNodesMapper.selectList(new QueryWrapper<ProjectKeyNodes>().in("project_id", collect));
|
|
List<ProjectKeyNodes> nodesList = projectKeyNodesMapper.selectList(new QueryWrapper<ProjectKeyNodes>().in("project_id", collect));
|
|
|
|
+ List<ProjectMain> projectMainList = projectMainMapper.selectList(new QueryWrapper<ProjectMain>().eq("company_id", company.getId()));
|
|
LocalDateTime d=LocalDateTime.now();
|
|
LocalDateTime d=LocalDateTime.now();
|
|
Duration between1 = Duration.between(c, d);
|
|
Duration between1 = Duration.between(c, d);
|
|
System.out.println("此处耗时----------------"+between1.toMillis());
|
|
System.out.println("此处耗时----------------"+between1.toMillis());
|
|
for (ProjectVO projectVO : projectVOList) {
|
|
for (ProjectVO projectVO : projectVOList) {
|
|
List<String> rowData = new ArrayList<>();
|
|
List<String> rowData = new ArrayList<>();
|
|
|
|
+ if(timeType.getMainProjectState()==1){
|
|
|
|
+ Optional<ProjectMain> first = projectMainList.stream().filter(pl -> pl.getId().equals(projectVO.getProjectMainId())).findFirst();
|
|
|
|
+ if(first.isPresent()){
|
|
|
|
+ rowData.add(first.get().getName());
|
|
|
|
+ rowData.add(first.get().getCode());
|
|
|
|
+ }else {
|
|
|
|
+ rowData.add("");
|
|
|
|
+ rowData.add("");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
rowData.add(projectVO.getProjectCode());
|
|
rowData.add(projectVO.getProjectCode());
|
|
rowData.add(projectVO.getCategoryName());
|
|
rowData.add(projectVO.getCategoryName());
|
|
//rowData.add(("1".equals(projectVO.getIsPublic())?"是":"否"));
|
|
//rowData.add(("1".equals(projectVO.getIsPublic())?"是":"否"));
|