|
@@ -385,34 +385,34 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
XSSFCell reportDateCell = firstRow.getCell(1);
|
|
XSSFCell reportDateCell = firstRow.getCell(1);
|
|
XSSFCell expenseTypeCell = firstRow.getCell(2);
|
|
XSSFCell expenseTypeCell = firstRow.getCell(2);
|
|
XSSFCell remarksCell = firstRow.getCell(3);
|
|
XSSFCell remarksCell = firstRow.getCell(3);
|
|
- List<String> userNameList=new ArrayList<>();
|
|
|
|
- String value = reimburserCell.getStringCellValue();
|
|
|
|
- if(!value.equals("")){
|
|
|
|
- userNameList.add(value);
|
|
|
|
- }
|
|
|
|
- System.out.println("参与搜素的人员列表"+userNameList);
|
|
|
|
- HttpRespMsg respMsg=new HttpRespMsg();
|
|
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
- respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
|
|
- if(respMsg.code.equals("0")){
|
|
|
|
- msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- List<User> targetUserList= (List<User>) respMsg.data;
|
|
|
|
|
|
+
|
|
if (reimburserCell != null) reimburserCell.setCellType(CellType.STRING);
|
|
if (reimburserCell != null) reimburserCell.setCellType(CellType.STRING);
|
|
if (reportDateCell != null) reportDateCell.setCellType(CellType.NUMERIC);
|
|
if (reportDateCell != null) reportDateCell.setCellType(CellType.NUMERIC);
|
|
if (expenseTypeCell != null) expenseTypeCell.setCellType(CellType.STRING);
|
|
if (expenseTypeCell != null) expenseTypeCell.setCellType(CellType.STRING);
|
|
if (remarksCell != null) remarksCell.setCellType(CellType.STRING);
|
|
if (remarksCell != null) remarksCell.setCellType(CellType.STRING);
|
|
- if (reimburserCell == null) {//报销人为空的直接跳过
|
|
|
|
|
|
+ if (reimburserCell == null || StringUtils.isEmpty(reimburserCell.getStringCellValue())) {//报销人为空的直接跳过
|
|
throw new Exception("报销人名称不能为空");
|
|
throw new Exception("报销人名称不能为空");
|
|
}
|
|
}
|
|
if (expenseTypeCell == null) {
|
|
if (expenseTypeCell == null) {
|
|
throw new Exception("费用类型不能为空");
|
|
throw new Exception("费用类型不能为空");
|
|
}
|
|
}
|
|
- if (reportDateCell == null) {
|
|
|
|
|
|
+ if (reportDateCell == null || StringUtils.isEmpty(reportDateCell.getStringCellValue())) {
|
|
throw new Exception("填报日期不能为空");
|
|
throw new Exception("填报日期不能为空");
|
|
}
|
|
}
|
|
|
|
+ //做完非空校验后,进行姓名处理
|
|
|
|
+ List<String> userNameList=new ArrayList<>();
|
|
|
|
+ String reimburserName = reimburserCell.getStringCellValue();
|
|
|
|
+ userNameList.add(reimburserName);
|
|
|
|
+ HttpRespMsg respMsg= null;
|
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
|
+ System.out.println("参与搜素的人员列表"+userNameList);
|
|
|
|
+ respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
|
|
|
|
+ if(respMsg.code.equals("0")){
|
|
|
|
+ msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<User> targetUserList= (List<User>) respMsg.data;
|
|
ExpenseSheet expenseSheet = new ExpenseSheet();
|
|
ExpenseSheet expenseSheet = new ExpenseSheet();
|
|
if(functionList.size()>0){
|
|
if(functionList.size()>0){
|
|
expenseSheet.setStatus(0);
|
|
expenseSheet.setStatus(0);
|
|
@@ -441,10 +441,10 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
expenseSheet.setCreateDate(localDate);
|
|
expenseSheet.setCreateDate(localDate);
|
|
Optional<User> first;
|
|
Optional<User> first;
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
- Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(reimburserCell.getStringCellValue())).findFirst();
|
|
|
|
- first = userList.stream().filter(us -> us.getName().equals(reimburserCell.getStringCellValue())||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserCell.getStringCellValue()))||(optional.isPresent()&&us.getCorpwxUserid()!=null&&us.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
|
|
|
|
+ Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(reimburserName)).findFirst();
|
|
|
|
+ first = userList.stream().filter(us -> us.getName().equals(reimburserName)||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserName))||(optional.isPresent()&&us.getCorpwxUserid()!=null&&us.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
|
|
}else {
|
|
}else {
|
|
- first = userList.stream().filter(us -> us.getName().equals(reimburserCell.getStringCellValue())).findFirst();
|
|
|
|
|
|
+ first = userList.stream().filter(us -> us.getName().equals(reimburserName)).findFirst();
|
|
}
|
|
}
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
expenseSheet.setOwnerId(first.get().getId());
|
|
expenseSheet.setOwnerId(first.get().getId());
|