|
@@ -461,7 +461,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
}
|
|
}
|
|
System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
|
+ boolean isCorpWxUser = false;
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
|
|
|
|
+ isCorpWxUser = true;
|
|
respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
if(respMsg.code.equals("0")){
|
|
if(respMsg.code.equals("0")){
|
|
httpRespMsg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
httpRespMsg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
@@ -514,8 +516,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
String executorColorString="";
|
|
String executorColorString="";
|
|
for (int i=0;i<executorNameList.size();i++) {
|
|
for (int i=0;i<executorNameList.size();i++) {
|
|
String executorName = executorNameList.get(i);
|
|
String executorName = executorNameList.get(i);
|
|
- Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(executorName)).findFirst();
|
|
|
|
- Optional<User> first = allUserList.stream().filter(u ->optional.isPresent()&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid())).findFirst();
|
|
|
|
|
|
+ Optional<User> first = null;
|
|
|
|
+ if (isCorpWxUser) {
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(executorName)).findFirst();
|
|
|
|
+ first = allUserList.stream().filter(u->(optional.isPresent()&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
+ } else {
|
|
|
|
+ first = allUserList.stream().filter(u ->u.getName().equals(executorName)).findFirst();
|
|
|
|
+ }
|
|
|
|
+
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
User find = first.get();
|
|
User find = first.get();
|
|
if(i==executorNameList.size()-1){
|
|
if(i==executorNameList.size()-1){
|
|
@@ -559,14 +567,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
if(levelCell!=null){
|
|
if(levelCell!=null){
|
|
task.setTaskLevel(taskLevelMap.get(levelCell.getStringCellValue()));
|
|
task.setTaskLevel(taskLevelMap.get(levelCell.getStringCellValue()));
|
|
}
|
|
}
|
|
- if(startDateCell.getDateCellValue()!=null){
|
|
|
|
|
|
+ if(startDateCell != null && startDateCell.getDateCellValue()!=null){
|
|
Date dateCellValue = startDateCell.getDateCellValue();
|
|
Date dateCellValue = startDateCell.getDateCellValue();
|
|
System.out.println("日期=="+dateCellValue.toString());
|
|
System.out.println("日期=="+dateCellValue.toString());
|
|
String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);
|
|
String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);
|
|
LocalDate startDate = LocalDate.parse(formatValue, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
LocalDate startDate = LocalDate.parse(formatValue, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
task.setStartDate(startDate);
|
|
task.setStartDate(startDate);
|
|
}
|
|
}
|
|
- if(endDateCell.getDateCellValue()!=null){
|
|
|
|
|
|
+ if(endDateCell != null && endDateCell.getDateCellValue()!=null){
|
|
Date dateCellValue = endDateCell.getDateCellValue();
|
|
Date dateCellValue = endDateCell.getDateCellValue();
|
|
System.out.println("日期=="+dateCellValue.toString());
|
|
System.out.println("日期=="+dateCellValue.toString());
|
|
String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);
|
|
String formatValue = new SimpleDateFormat("yyyy-MM-dd").format(dateCellValue);
|