Enford 5 years ago
parent
commit
8c935656da

+ 8 - 9
src/main/java/com/jeeplus/modules/sg/managementcenter/project/entity/Project.java

@@ -410,7 +410,6 @@ public class Project extends DataEntity<Project> {
         this.runTheClass = runTheClass;
         this.runTheClass = runTheClass;
     }
     }
 
 
-    @ExcelField(title = "项目组", align = 2, sort = 31)
     public String getProjectTeam() {
     public String getProjectTeam() {
         return projectTeam;
         return projectTeam;
     }
     }
@@ -655,7 +654,7 @@ public class Project extends DataEntity<Project> {
     public void setPreConstruction(Integer preConstruction) {
     public void setPreConstruction(Integer preConstruction) {
         this.preConstruction = preConstruction;
         this.preConstruction = preConstruction;
     }
     }
-
+    @ExcelField(title = "储备编号", align = 2, sort = 31)
     public String getReserveNumber() {
     public String getReserveNumber() {
         return reserveNumber;
         return reserveNumber;
     }
     }
@@ -663,7 +662,7 @@ public class Project extends DataEntity<Project> {
     public void setReserveNumber(String reserveNumber) {
     public void setReserveNumber(String reserveNumber) {
         this.reserveNumber = reserveNumber;
         this.reserveNumber = reserveNumber;
     }
     }
-
+    @ExcelField(title = "项目管理中心技经专职", align = 2, sort = 56)
     public String getSkillByFull() {
     public String getSkillByFull() {
         return skillByFull;
         return skillByFull;
     }
     }
@@ -671,7 +670,7 @@ public class Project extends DataEntity<Project> {
     public void setSkillByFull(String skillByFull) {
     public void setSkillByFull(String skillByFull) {
         this.skillByFull = skillByFull;
         this.skillByFull = skillByFull;
     }
     }
-
+    @ExcelField(title = "运行单位角色(运检", align = 2, sort = 57)
     public String getRunUnitInspectionRole() {
     public String getRunUnitInspectionRole() {
         return runUnitInspectionRole;
         return runUnitInspectionRole;
     }
     }
@@ -679,7 +678,7 @@ public class Project extends DataEntity<Project> {
     public void setRunUnitInspectionRole(String runUnitInspectionRole) {
     public void setRunUnitInspectionRole(String runUnitInspectionRole) {
         this.runUnitInspectionRole = runUnitInspectionRole;
         this.runUnitInspectionRole = runUnitInspectionRole;
     }
     }
-
+    @ExcelField(title = "施工合同单位", align = 2, sort = 58)
     public String getConstructionContractUnit() {
     public String getConstructionContractUnit() {
         return constructionContractUnit;
         return constructionContractUnit;
     }
     }
@@ -687,7 +686,7 @@ public class Project extends DataEntity<Project> {
     public void setConstructionContractUnit(String constructionContractUnit) {
     public void setConstructionContractUnit(String constructionContractUnit) {
         this.constructionContractUnit = constructionContractUnit;
         this.constructionContractUnit = constructionContractUnit;
     }
     }
-
+    @ExcelField(title = "施工合同率", align = 2, sort =59)
     public Double getConstructionContractRate() {
     public Double getConstructionContractRate() {
         return constructionContractRate;
         return constructionContractRate;
     }
     }
@@ -695,7 +694,7 @@ public class Project extends DataEntity<Project> {
     public void setConstructionContractRate(Double constructionContractRate) {
     public void setConstructionContractRate(Double constructionContractRate) {
         this.constructionContractRate = constructionContractRate;
         this.constructionContractRate = constructionContractRate;
     }
     }
-
+    @ExcelField(title = "施工分包单位", align = 2, sort = 60)
     public String getConstructionContractSub() {
     public String getConstructionContractSub() {
         return constructionContractSub;
         return constructionContractSub;
     }
     }
@@ -703,7 +702,7 @@ public class Project extends DataEntity<Project> {
     public void setConstructionContractSub(String constructionContractSub) {
     public void setConstructionContractSub(String constructionContractSub) {
         this.constructionContractSub = constructionContractSub;
         this.constructionContractSub = constructionContractSub;
     }
     }
-
+    @ExcelField(title = "施工单位技经专职", align = 2, sort = 61)
     public String getConstructionSkillByFull() {
     public String getConstructionSkillByFull() {
         return constructionSkillByFull;
         return constructionSkillByFull;
     }
     }
@@ -711,7 +710,7 @@ public class Project extends DataEntity<Project> {
     public void setConstructionSkillByFull(String constructionSkillByFull) {
     public void setConstructionSkillByFull(String constructionSkillByFull) {
         this.constructionSkillByFull = constructionSkillByFull;
         this.constructionSkillByFull = constructionSkillByFull;
     }
     }
-
+    @ExcelField(title = "自动化备注", align = 2, sort = 62)
     public String getAutomatedRemarks() {
     public String getAutomatedRemarks() {
         return automatedRemarks;
         return automatedRemarks;
     }
     }

+ 24 - 52
src/main/java/com/jeeplus/modules/sg/managementcenter/project/util/ProExcelInfo.java

@@ -121,47 +121,6 @@ public  class ProExcelInfo {
         return list;
         return list;
     }
     }
 
 
-    /**
-     * 获取表格数据
-     * @param importUtil 项目经理导入
-     * @return List<ErpAccount> 导入表格数据
-     */
-    public static List<Project> getProjectUtilProjectManager(ImportUtil importUtil)  {
-        int lastRow = importUtil.getLastDataRowNum();
-        List<Project> list = new ArrayList<Project>();
-        Project project = null;
-        String costEstimate="";//费用估算
-        for(int i=2; i<=lastRow;i++){
-            project = new Project();
-            Row row = importUtil.getRow(i);
-            String requireCode = (String) importUtil.getCellValue(row,5);//获取需求项目名称
-            if(StringUtils.isNotBlank(requireCode)) {
-                project.setRequireName(requireCode);
-                project.setPowerLine((String)importUtil.getCellValue(row,35));//停电线路
-                project.setPowerScope((String)importUtil.getCellValue(row,36));//停电范围
-                project.setProjectType((String)importUtil.getCellValue(row,37));//项目类型
-                project.setPowerFlagPackage((String)importUtil.getCellValue(row,38));//是否为停电打包项目
-                project.setPreliminaryJudgment((String)importUtil.getCellValue(row,39));//证处初步判断
-                project.setFlagCivilEngineering((String)importUtil.getCellValue(row,40));//是否含土建
-                project.setSteelTubePole((String)importUtil.getCellValue(row,41));//钢管杆基础类型
-                project.setFlagApprovalPlanning((String)importUtil.getCellValue(row,42));//是否需要规划报批
-                project.setEquCreateType((String)importUtil.getCellValue(row,43));//设备改造类型
-                project.setEquCreateSize((String)importUtil.getCellValue(row,44));//间隔数
-                project.setFlagNewEquName((String)importUtil.getCellValue(row,45));//是否新设备命名
-                project.setIncludeBdzNews((String)importUtil.getCellValue(row,46));//是否含变电站新闻格投运
-                project.setFlagNoElectrical((String)importUtil.getCellValue(row,47));//是否非射电电气施工
-                project.setDrawingsWork((String)importUtil.getCellValue(row,48));//图纸标注的带点作业情况
-                project.setFlagAutomation((String)importUtil.getCellValue(row,49));//是否含自动化
-                project.setTwoAndThreeRemote((String)importUtil.getCellValue(row,50));//二遥或三
-                project.setPhoneStyle((String)importUtil.getCellValue(row,51));//通信方式
-                project.setStayOpenArea((String)importUtil.getCellValue(row,52));//柱开集中或就业地
-                project.setRingNetworkCabinet((String)importUtil.getCellValue(row,53));//环网柜
-                project.setStationDtu((String)importUtil.getCellValue(row,54));//站房dtu
-                list.add(project);
-            }
-        }
-        return list;
-    }
     //验证表格数据是否正确
     //验证表格数据是否正确
     public static Boolean getProjectUtilFlag(ImportUtil importUtil){
     public static Boolean getProjectUtilFlag(ImportUtil importUtil){
         Boolean flag = false;
         Boolean flag = false;
@@ -195,6 +154,14 @@ public  class ProExcelInfo {
             if (null==project.getLineName()||"".equals(project.getLineName())){//线路名称
             if (null==project.getLineName()||"".equals(project.getLineName())){//线路名称
                 str+="线路名称不能为空";
                 str+="线路名称不能为空";
             }
             }
+            if (null==project.getProjectManageRole()||"".equals(project.getProjectManageRole())){
+                str+="配网项目经理不能为空;";
+            }else {
+                judgeLoginName = getJudgeLoginName(users, project.getProjectManageRole());
+                if (judgeLoginName){
+                    str+="配网项目经理不存在;";
+                }
+            }
             if (null==project.getDistributionEngineering()||"".equals(project.getDistributionEngineering())){//配网工程专职角色
             if (null==project.getDistributionEngineering()||"".equals(project.getDistributionEngineering())){//配网工程专职角色
                 str+="配网工程专职不能为空;";
                 str+="配网工程专职不能为空;";
             }else {
             }else {
@@ -240,7 +207,7 @@ public  class ProExcelInfo {
             }else {
             }else {
                 flag = getJudge(project.getRunUnit(),PRO_LINGTING);
                 flag = getJudge(project.getRunUnit(),PRO_LINGTING);
                 if (flag){
                 if (flag){
-                    str+="运行单位填写有误";
+                    str+="运行单位填写有误;";
                 }
                 }
             }
             }
             if (null==project.getRunUnitRole()||"".equals(project.getRunUnitRole())){//运行单位角色
             if (null==project.getRunUnitRole()||"".equals(project.getRunUnitRole())){//运行单位角色
@@ -320,14 +287,14 @@ public  class ProExcelInfo {
                     str+="需求提出单位填写有误;";
                     str+="需求提出单位填写有误;";
                 }
                 }
             }
             }
-            if (null==project.getRunUnit()||"".equals(project.getRunUnit())){//设计单位
-                str+="运行单位不能为空;";
-            }else {
-                judgeLoginName = getJudge(project.getRunUnit(), PRO_LINGTING);
-                if (judgeLoginName){
-                    str+="运行单位填写有误;";
-                }
-            }
+//            if (null==project.getRunUnit()||"".equals(project.getRunUnit())){//设计单位
+//                str+="运行单位不能为空;";
+//            }else {
+//                judgeLoginName = getJudge(project.getRunUnit(), PRO_LINGTING);
+//                if (judgeLoginName){
+//                    str+="运行单位填写有误;";
+//                }
+//            }
             if (null==project.getClarificaitonType()||"".equals(project.getClarificaitonType())){//交底类型
             if (null==project.getClarificaitonType()||"".equals(project.getClarificaitonType())){//交底类型
                     str+="交底类型不能为空;";
                     str+="交底类型不能为空;";
             }else {
             }else {
@@ -512,6 +479,7 @@ public  class ProExcelInfo {
                 }
                 }
             }
             }
             if (!"".equals(str)){
             if (!"".equals(str)){
+                str+=":错误项目为:["+project.getRequireName()+"]";
                 return str;
                 return str;
             }
             }
         }
         }
@@ -568,10 +536,14 @@ public  class ProExcelInfo {
 
 
     //进行导入角色筛选 项目经理
     //进行导入角色筛选 项目经理
     public static List<Project> getSureProjectsManager(List<Project> projects){
     public static List<Project> getSureProjectsManager(List<Project> projects){
-        String loginName = UserUtils.getUser().getName();
+        String loginName = UserUtils.getUser().getLoginName();
+        if ("admin".equals(loginName)){
+            return projects;
+        }
+        String name = UserUtils.getUser().getName();
         for (int i = 0; i < projects.size(); i++) {
         for (int i = 0; i < projects.size(); i++) {
             if (null!=projects.get(i).getProjectManageRole()){//项目经理角色
             if (null!=projects.get(i).getProjectManageRole()){//项目经理角色
-                if (!loginName.equals(projects.get(i).getProjectManageRole())){
+                if (!name.equals(projects.get(i).getProjectManageRole())){
                     projects.remove(i);
                     projects.remove(i);
                     i--;
                     i--;
                 }
                 }

+ 2 - 2
src/main/java/com/jeeplus/modules/sg/managementcenter/project/web/ProjectController.java

@@ -352,14 +352,14 @@ public class ProjectController extends BaseController {
 			List<Project> projectLists = ProExcelInfo.getSureProjectsManager(ProExcelInfo.getProjectUtil(importUtil));
 			List<Project> projectLists = ProExcelInfo.getSureProjectsManager(ProExcelInfo.getProjectUtil(importUtil));
 			if (null==projectLists||projectLists.size()<=0){
 			if (null==projectLists||projectLists.size()<=0){
 				j.setSuccess(false);
 				j.setSuccess(false);
-				j.setMsg("导入失败:无符合数据,请检查后再重新导入.");
+				j.setMsg("导入失败:您还没有导入这些数据的权限,请检查项目经理填写是否为本人");
 				return j;
 				return j;
 			}
 			}
 			List<String> users = projectService.findAllUser();
 			List<String> users = projectService.findAllUser();
 			String judgeValue = ProExcelInfo.getJudgeValue(projectLists,users);
 			String judgeValue = ProExcelInfo.getJudgeValue(projectLists,users);
 			if (!"".equals(judgeValue)){
 			if (!"".equals(judgeValue)){
 				j.setSuccess(false);
 				j.setSuccess(false);
-				j.setMsg("导入失败:"+judgeValue+"数据不符合规范!");
+				j.setMsg("导入失败:"+judgeValue);
 				return j;
 				return j;
 			}
 			}
 			projectService.saveList(projectLists);
 			projectService.saveList(projectLists);