|
@@ -3116,12 +3116,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (inchargerCell != null) {
|
|
|
String inchargerName = inchargerCell.getStringCellValue().trim();
|
|
|
if (!StringUtils.isEmpty(inchargerName)) {
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(inchargerName)).findFirst();
|
|
|
+ String s1;
|
|
|
+ if(inchargerName.startsWith("/")){
|
|
|
+ s1=inchargerName.substring(1,inchargerName.length());
|
|
|
+ }else s1=inchargerName;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
if (first.isPresent()) {
|
|
|
project.setInchargerId(first.get().getId());
|
|
|
- project.setInchargerName(inchargerName);
|
|
|
+ project.setInchargerName(first.get().getName());
|
|
|
} else {
|
|
|
- throw new Exception("项目负责人["+inchargerName+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("项目负责人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+ case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3188,14 +3208,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Participation> participationList = new ArrayList<>();
|
|
|
if(inchargerCell!=null){
|
|
|
String value = inchargerCell.getStringCellValue();
|
|
|
+ String s1;
|
|
|
+ if(value.startsWith("/")){
|
|
|
+ s1=value.substring(1,value.length());
|
|
|
+ }else s1=value;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
Participation p = new Participation();
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(value)).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
p.setUserId(first.get().getId());
|
|
|
p.setProjectId(project.getId());
|
|
|
participationList.add(p);
|
|
|
} else {
|
|
|
- throw new Exception("参与人["+value+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+
|
|
|
+ case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (participatorCell != null) {
|
|
@@ -3204,7 +3245,24 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String[] partSplit = part.split("\\,|\\,");
|
|
|
for (String str : partSplit) {
|
|
|
Participation p = new Participation();
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(str)).findFirst();
|
|
|
+ String s1;
|
|
|
+ if(str.startsWith("/")){
|
|
|
+ s1=str.substring(1,str.length());
|
|
|
+ }else s1=str;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = str.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
if (first.isPresent()) {
|
|
|
User partMemb = first.get();
|
|
|
// System.out.println("参与人:"+partMemb.getName());
|
|
@@ -3214,7 +3272,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
participationList.add(p);
|
|
|
}
|
|
|
} else {
|
|
|
- throw new Exception("参与人["+str+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+
|
|
|
+ case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3232,10 +3295,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
|
if (existCodeList.size() > 0) {
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
- if(key==1){
|
|
|
- //msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
- msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
- }else msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
+ msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
}
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
@@ -3554,12 +3614,32 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (inchargerCell != null) {
|
|
|
String inchargerName = inchargerCell.getStringCellValue().trim();
|
|
|
if (!StringUtils.isEmpty(inchargerName)) {
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(inchargerName)).findFirst();
|
|
|
+ String s1;
|
|
|
+ if(inchargerName.startsWith("/")){
|
|
|
+ s1=inchargerName.substring(1,inchargerName.length());
|
|
|
+ }else s1=inchargerName;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
if (first.isPresent()) {
|
|
|
project.setInchargerId(first.get().getId());
|
|
|
- project.setInchargerName(inchargerName);
|
|
|
+ project.setInchargerName(first.get().getName());
|
|
|
} else {
|
|
|
- throw new Exception("项目负责人["+inchargerName+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("项目负责人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+ case 1:throw new Exception("项目负责人["+split[0]+"]姓名与工号不匹配");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4106,14 +4186,35 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Participation> participationList = new ArrayList<>();
|
|
|
if(inchargerCell!=null){
|
|
|
String value = inchargerCell.getStringCellValue();
|
|
|
+ String s1;
|
|
|
+ if(value.startsWith("/")){
|
|
|
+ s1=value.substring(1,value.length());
|
|
|
+ }else s1=value;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
Participation p = new Participation();
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(value)).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
p.setUserId(first.get().getId());
|
|
|
p.setProjectId(project.getId());
|
|
|
participationList.add(p);
|
|
|
} else {
|
|
|
- throw new Exception("参与人["+value+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+
|
|
|
+ case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (participatorCell != null) {
|
|
@@ -4121,8 +4222,25 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (!StringUtils.isEmpty(part)) {
|
|
|
String[] partSplit = part.split("\\,|\\,");
|
|
|
for (String str : partSplit) {
|
|
|
+ String s1;
|
|
|
+ if(str.startsWith("/")){
|
|
|
+ s1=str.substring(1,str.length());
|
|
|
+ }else s1=str;
|
|
|
+ String s2;
|
|
|
+ if(s1.endsWith("/")){
|
|
|
+ s2=s1.substring(0,s1.length()-1);
|
|
|
+ }else s2=s1;
|
|
|
+ String[] split = s2.split("/");
|
|
|
+ Optional<User> first;
|
|
|
+ Integer exception;
|
|
|
+ if(split.length==1){
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
|
|
|
+ exception=0;
|
|
|
+ }else {
|
|
|
+ first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
|
|
|
+ exception=1;
|
|
|
+ }
|
|
|
Participation p = new Participation();
|
|
|
- Optional<User> first = userList.stream().filter(u -> u.getName().equals(str)).findFirst();
|
|
|
if (first.isPresent()) {
|
|
|
User partMemb = first.get();
|
|
|
// System.out.println("参与人:"+partMemb.getName());
|
|
@@ -4132,7 +4250,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
participationList.add(p);
|
|
|
}
|
|
|
} else {
|
|
|
- throw new Exception("参与人["+str+"]不存在");
|
|
|
+ switch (exception){
|
|
|
+ case 0:throw new Exception("参与人姓名/工号为["+split[0]+"]的人员不存在");
|
|
|
+
|
|
|
+ case 1:throw new Exception("参与人["+split[0]+"]姓名工号不匹配");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4150,10 +4272,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
|
if (existCodeList.size() > 0) {
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
- if(key==1){
|
|
|
- //msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
- msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
- }else msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
+ msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
}
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setCompanyId(user.getCompanyId());
|