|
@@ -171,54 +171,115 @@ public class ProExcelInfo {
|
|
|
/*
|
|
|
对值进行验证 配网工程专职验证
|
|
|
*/
|
|
|
- public static String getJudgeValue(List<Project> projects){
|
|
|
+ public static String getJudgeValue(List<Project> projects,List<String> users){
|
|
|
Boolean flag = false;
|
|
|
String str = "";
|
|
|
+ boolean judgeLoginName = false;
|
|
|
for (Project project:projects){
|
|
|
if (null==project.getDistributionEngineering()||"".equals(project.getDistributionEngineering())){//配网工程专职角色
|
|
|
str+="配网工程专职角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getDistributionEngineering());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="配网工程专职角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getDistributionMaterials()||"".equals(project.getDistributionMaterials())){//配网物资专职角色
|
|
|
str+="配网物资专职角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users,project.getDistributionMaterials());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="配网物资专职角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getDistributionSystem()||"".equals(project.getDistributionSystem())){//配网系统专职角色
|
|
|
str+="配网系统专职角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getDistributionSystem());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="配网系统专职角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getDistributionPolicy()||"".equals(project.getDistributionPolicy())){//配网政策处理专职角色
|
|
|
str+="配网政策处理专职角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getDistributionPolicy());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="配网政策处理专职角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getManagementLeader()||"".equals(project.getManagementLeader())){//项目管理中心领导角色
|
|
|
str+="项目管理中心领导角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getManagementLeader());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="项目管理中心领导角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getRunUnit()||"".equals(project.getRunUnit())){//运行单位
|
|
|
str+="运行单位不能为空;";
|
|
|
}
|
|
|
if (null==project.getRunUnitRole()||"".equals(project.getRunUnitRole())){//运行单位角色
|
|
|
str+="运行单位角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getRunUnitRole());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="运行单位角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getThroughResearchRole()||"".equals(project.getThroughResearchRole())){//经研所角色
|
|
|
str+="经研所角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getThroughResearchRole());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="经研所角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getConstructionUnit()||"".equals(project.getConstructionUnit())){//施工单位
|
|
|
str+="施工单位不能为空;";
|
|
|
}
|
|
|
if (null==project.getConstructionUnitRole()||"".equals(project.getConstructionUnitRole())){//施工单位:施工单位角色
|
|
|
str+="施工单位角色不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getConstructionUnitRole());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="施工单位角色不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getConstructionUnitManage()||"".equals(project.getConstructionUnitManage())){//施工单位:施工单位角色
|
|
|
str+="施工单位项目经理不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getConstructionUnitManage());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="施工单位项目经理不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getConstructionUnitLeader()||"".equals(project.getConstructionUnitLeader())){//施工单位:施工单位角色
|
|
|
str+="施工单位领导不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getConstructionUnitLeader());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="施工单位领导不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getDesignUnit()||"".equals(project.getDesignUnit())){//设计单位
|
|
|
str+="设计单位不能为空;";
|
|
|
}
|
|
|
if (null==project.getDesignUnitManage()||"".equals(project.getDesignUnitManage())){//设计单位角色
|
|
|
str+="设计单位项目经理不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users,project.getDesignUnitManage());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="设计单位项目经理不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null==project.getDesignUnitLeader()||"".equals(project.getDesignUnitLeader())){//设计单位
|
|
|
str+="设计单位领导不能为空;";
|
|
|
+ }else {
|
|
|
+ judgeLoginName = getJudgeLoginName(users, project.getDesignUnitLeader());
|
|
|
+ if (judgeLoginName){
|
|
|
+ str+="设计单位领导不存在;";
|
|
|
+ }
|
|
|
}
|
|
|
if (null!=project.getType()){//类型
|
|
|
flag = getJudge(project.getType(), PRO_TYPE);
|
|
@@ -238,13 +299,24 @@ public class ProExcelInfo {
|
|
|
str+="交底类型填写有误;";
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (!"".equals(str)){
|
|
|
- return str;
|
|
|
+ if (!"".equals(str)){
|
|
|
+ return str;
|
|
|
+ }
|
|
|
}
|
|
|
return str;
|
|
|
}
|
|
|
|
|
|
+ //对登录人进行验证
|
|
|
+ public static boolean getJudgeLoginName(List<String> users,String string){
|
|
|
+ boolean flag = true;
|
|
|
+ for (String user:users){
|
|
|
+ if (string.equals(user)){
|
|
|
+ flag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
/*
|
|
|
对值进行验证:项目经理验证
|
|
|
*/
|