Bläddra i källkod

项目导入功能修改

user5 3 år sedan
förälder
incheckning
135b777dbc

+ 43 - 30
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ImportBRuralProjectRecords.java

@@ -3,25 +3,11 @@
  */
 package com.jeeplus.modules.ruralprojectrecords.entity;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.google.common.collect.Lists;
 import com.jeeplus.common.persistence.ActEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
-import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
-import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
-import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
-import com.jeeplus.modules.sys.entity.Area;
-import com.jeeplus.modules.sys.entity.Office;
-import com.jeeplus.modules.sys.entity.User;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
-import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
-import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
-import org.hibernate.validator.constraints.NotBlank;
-
-import javax.validation.constraints.NotNull;
+
 import java.math.BigDecimal;
 import java.util.Date;
-import java.util.List;
 
 /**
  * 造价审核导入B级项目信息表
@@ -49,73 +35,92 @@ public class ImportBRuralProjectRecords extends ActEntity<ImportBRuralProjectRec
 	private String attachmentProjectSort;   //项目类别	必填
 	private String clientNumber;	//客户编号	无合同项目必填,有合同项目不读取
 
-	@ExcelField(title="是否有合同", align=2, sort=1)
+	private String reviewerPerson;//审核人名称
+	private String reviewerPersonId;//审核人
+	private String companyType;//单位编号(1:赣能;0:东兴)
+
+	//@ExcelField(title="是否有合同", align=2, sort=1)
 	public String getWhetherContract() {
 		return whetherContract;
 	}
-	@ExcelField(title="合同编号", align=2, sort=2)
+	@ExcelField(title="合同编号", align=2, sort=1)
 	public String getContractNumber() {
 		return contractNumber;
 	}
-	@ExcelField(title="项目名称", align=2, sort=3)
+	@ExcelField(title="项目名称", align=2, sort=2)
 	public String getProjectName() {
 		return projectName;
 	}
-	@ExcelField(title="项目所在地", align=2, sort=4)
+	@ExcelField(title="项目所在地", align=2, sort=3)
 	public String getAreaName() {
 		return areaName;
 	}
 
-	@ExcelField(title="投资性质", align=2, sort=5)
+	@ExcelField(title="投资性质", align=2, sort=4)
 	public String getProjectProperties() {
 		return projectProperties;
 	}
 
-	@ExcelField(title="建设地点", align=2, sort=6)
+	@ExcelField(title="建设地点", align=2, sort=5)
 	public String getProjectSite() {
 		return projectSite;
 	}
-	@ExcelField(title="项目责任人", align=2, sort=7)
+	@ExcelField(title="项目责任人", align=2, sort=6)
 	public String getLeaderName() {
 		return leaderName;
 	}
-	@ExcelField(title="项目负责人", align=2, sort=8)
 	public String 	getProjectMasterName() {
 		return projectMasterName;
 	}
-	@ExcelField(title="工程类型名称", align=2, sort=9)
+	@ExcelField(title="工程类型名称", align=2, sort=8)
 	public String getEngineeringName() {
 		return engineeringName;
 	}
-	@ExcelField(title="是否生成报告", align=2, sort=10)
+	//@ExcelField(title="是否生成报告", align=2, sort=10)
 	public String getWhetherReportNumber() {
 		return whetherReportNumber;
 	}
 	public BigDecimal getSubmitScale() {
 		return submitScale;
 	}
-	@ExcelField(title="项目开始日期", align=2, sort=12)
+	@ExcelField(title="项目开始日期", align=2, sort=10)
 	public Date getBeginDate() {
 		return beginDate;
 	}
-	@ExcelField(title="项目结束日期", align=2, sort=13)
+	@ExcelField(title="项目结束日期", align=2, sort=11)
 	public Date getEndDate() {
 		return endDate;
 	}
-	@ExcelField(title="项目类别", align=2, sort=14)
+	@ExcelField(title="项目类别", align=2, sort=12)
 	public String getAttachmentProjectSort() {
 		return attachmentProjectSort;
 	}
-	@ExcelField(title="客户编号", align=2, sort=15)
+	//@ExcelField(title="客户编号", align=2, sort=15)
 	public String getClientNumber() {
 		return clientNumber;
 	}
 
-	@ExcelField(title="送审规模", align=2, sort=11)
+	@ExcelField(title="送审规模", align=2, sort=9)
 	public String getSubmitScaleStr() {
 		return submitScaleStr;
 	}
 
+	@ExcelField(title="项目审核人", align=2, sort=7)
+	public String getReviewerPerson() {
+		return reviewerPerson;
+	}
+
+	public void setReviewerPerson(String reviewerPerson) {
+		this.reviewerPerson = reviewerPerson;
+	}
+
+	public String getReviewerPersonId() {
+		return reviewerPersonId;
+	}
+
+	public void setReviewerPersonId(String reviewerPersonId) {
+		this.reviewerPersonId = reviewerPersonId;
+	}
 
 	public void setSubmitScaleStr(String submitScaleStr) {
 		this.submitScaleStr = submitScaleStr;
@@ -189,4 +194,12 @@ public class ImportBRuralProjectRecords extends ActEntity<ImportBRuralProjectRec
 	public void setEngineeringType(String engineeringType) {
 		this.engineeringType = engineeringType;
 	}
+
+	public String getCompanyType() {
+		return companyType;
+	}
+
+	public void setCompanyType(String companyType) {
+		this.companyType = companyType;
+	}
 }

+ 43 - 67
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -2995,12 +2995,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			try{
 				RuralProjectRecords projectRecords = new RuralProjectRecords();
 				//判定必填项是否填完
-				if(StringUtils.isBlank(importBRuralProjectRecords.getWhetherContract())
-						|| StringUtils.isBlank(importBRuralProjectRecords.getProjectName())
+				if(StringUtils.isBlank(importBRuralProjectRecords.getProjectName())
 						|| StringUtils.isBlank(importBRuralProjectRecords.getAreaName())
 						|| StringUtils.isBlank(importBRuralProjectRecords.getLeaderName())
 						|| StringUtils.isBlank(importBRuralProjectRecords.getEngineeringName())
-						|| StringUtils.isBlank(importBRuralProjectRecords.getWhetherReportNumber())
 						|| StringUtils.isBlank(importBRuralProjectRecords.getSubmitScaleStr())
 						|| StringUtils.isBlank(importBRuralProjectRecords.getAttachmentProjectSort())){
 					return "必填项没有填全";
@@ -3010,9 +3008,9 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				//设置为B类项目
 				projectRecords.setSubmitMoney("1");
 				//默认设置为紧急项目
-				projectRecords.setEmergencyProject("1");
+				//projectRecords.setEmergencyProject("1");
 				//设置项目状态为5
-				projectRecords.setProjectStatus(5);
+				projectRecords.setProjectStatus(1);
 				//填入项目名称
 				projectRecords.setProjectName(importBRuralProjectRecords.getProjectName());
 
@@ -3122,13 +3120,13 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				Office company= new Office();
 				Office office =  new Office();
 
-				if("是".equals(importBRuralProjectRecords.getWhetherContract())){
-					//判断当是否有合同为是时,合同编号是否为空
-					if(StringUtils.isBlank(importBRuralProjectRecords.getContractNumber())){
-						return "是否有合同选择是的情况下合同编号为空";
-					}
-					//根据合同编号查询合同信息
-					//判断当前的合同是否被作废或者删除
+				//判断当是否有合同为是时,合同编号是否为空
+				if(StringUtils.isBlank(importBRuralProjectRecords.getContractNumber())){
+					return "是否有合同选择是的情况下合同编号为空";
+				}
+				//根据合同编号查询合同信息
+				//判断当前的合同是否被作废或者删除
+				if(StringUtils.isNotBlank(importBRuralProjectRecords.getContractNumber())){
 					WorkContractInfo workContractInfo = contractInfoService.getByContractNum(importBRuralProjectRecords.getContractNumber());
 					if(null == workContractInfo){
 						return "合同编号:"+ importBRuralProjectRecords.getContractNumber() + "  不存在或已删除";
@@ -3136,76 +3134,39 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 						company.setId(workContractInfo.getCompanyId());
 						office.setId(UserUtils.getUser().getOffice().getId());
 						projectRecords.setWorkContractInfo(workContractInfo);
-						//添加委托方联系人信息
-						if(null != workContractInfo.getClient() && StringUtils.isNotBlank(workContractInfo.getClient().getId())){
-							List<WorkClientLinkman> linkmanList = workClientInfoService.queryLinkManByClientId(workContractInfo.getClient().getId());
-							WorkClientLinkman linkman = linkmanList.get(0);
-							WorkClientInfo workClientInfo = workClientInfoService.get(workContractInfo.getClient().getId());
-							linkman.setClientId(workClientInfo);
-							List<WorkClientLinkman> clientLinkmanList = Lists.newArrayList();
-							clientLinkmanList.add(linkman);
-							projectRecords.setWorkClientLinkmanList(clientLinkmanList);
-						}
 					}
-				}else if("否".equals(importBRuralProjectRecords.getWhetherContract())){
-					//判断当是否有合同为否时,客户编号是否为空
-					if(StringUtils.isBlank(importBRuralProjectRecords.getClientNumber())){
-						return "是否有合同选择否的情况下客户编号为空";
-					}
-					//根据客户编号查询客户信息
-					WorkClientInfo workClientInfo = workClientInfoService.getByName(importBRuralProjectRecords.getClientNumber());
-					if(null == workClientInfo){
-						return "客户编号:"+ importBRuralProjectRecords.getClientNumber() + "  不存在或已删除";
-					}
-					List<WorkClientLinkman> linkmanList = workClientInfoService.queryLinkManByClientId(workClientInfo.getId());
-					WorkClientLinkman linkman = linkmanList.get(0);
-					linkman.setClientId(workClientInfo);
-					List<WorkClientLinkman> clientLinkmanList = Lists.newArrayList();
-					clientLinkmanList.add(linkman);
-					projectRecords.setWorkClientLinkmanList(clientLinkmanList);
-					WorkContractInfo workContractInfo = new WorkContractInfo();
-					workContractInfo.setId("");
-					projectRecords.setWorkContractInfo(workContractInfo);
-					//无合同
-					company.setId(UserUtils.getUser().getCompany().getId());
-					office.setId(UserUtils.getUser().getOffice().getId());
 				}else{
-					return "是否有合同栏填写不正确";
+					return "合同编号未填写";
 				}
+
+
 				projectRecords.setCompany(company);
 				projectRecords.setOffice(office);
 
 				//判定送审规模
 				//将字符串转换为BigDecimal
 				BigDecimal submitScale=new BigDecimal(importBRuralProjectRecords.getSubmitScaleStr());
-				BigDecimal twoHundred = new BigDecimal("200");
+				/*BigDecimal twoHundred = new BigDecimal("200");
 				BigDecimal fiveHundred = new BigDecimal("500");
 				if (submitScale.compareTo(fiveHundred) >=0 ){
 					return "送审规模达到A级项目标准,无法进行导入";
 				}
 				if(submitScale.compareTo(twoHundred) >=0 && ("101".equals(projectRecords.getProjectProperties()) || "5".equals(projectRecords.getProjectProperties()))){
 					return "送审规模达到A级项目标准,无法进行导入";
-				}
+				}*/
 				//添加送审规模
 				projectRecords.setSubmitScale(submitScale);
 
 				//处理项目责任人
 				User userLeader = UserUtils.getByUserName(importBRuralProjectRecords.getLeaderName());  //根据姓名转换为ID
-				if(null == userLeader){
-					return "无法查询到项目责人";
+				if(null == userLeader || StringUtils.isBlank(userLeader.getId())){
+					return "无法查询到项目责人";
 				}
-				List<User> userLeaderList = Lists.newArrayList();
-				userLeaderList.add(userLeader);
-				projectRecords.setProjectLeaders(userLeaderList);
-
-
-				//判断项目负责人
-				User userMaster = UserUtils.getByUserName(importBRuralProjectRecords.getProjectMasterName());
 				User user = new User();
-				user.setOffice(userMaster.getOffice());
-				user.setName(importBRuralProjectRecords.getProjectMasterName());
-				if(!userMaster.getCompany().getId().equals("1")) {
-					user.setCompany(userMaster.getCompany());
+				user.setOffice(userLeader.getOffice());
+				user.setName(importBRuralProjectRecords.getLeaderName());
+				if(!userLeader.getCompany().getId().equals("1")) {
+					user.setCompany(userLeader.getCompany());
 				}
 				List<User> userMasterList = userDao.findUserByOfficeIdAndNameOnReported(user);
 				if(userMasterList.size() == 0){
@@ -3214,6 +3175,21 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 					projectRecords.setProjectMasterId(userMasterList.get(0).getId());
 					projectRecords.setProjectMasterName(userMasterList.get(0).getName());
 				}
+				List<User> userLeaderList = Lists.newArrayList();
+				userLeaderList.add(userLeader);
+				projectRecords.setProjectLeaders(userLeaderList);
+				projectRecords.setProjectMasterId(userMasterList.get(0).getId());
+				projectRecords.setProjectMasterName(userMasterList.get(0).getName());
+
+
+				//判断项目审核人
+				User userReviewerPerson = UserUtils.getByUserName(importBRuralProjectRecords.getReviewerPerson());
+				if(null == userReviewerPerson || StringUtils.isBlank(userReviewerPerson.getId())){
+					return "无法查询到项目审核人";
+				}
+				projectRecords.setReviewerPerson(userReviewerPerson.getName());
+				projectRecords.setReviewerPersonId(userReviewerPerson.getId());
+				projectRecords.setCompanyType(importBRuralProjectRecords.getCompanyType());
 
 
 				User createBy = projectRecords.getCreateBy();
@@ -3239,15 +3215,15 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 					}
 				}
 				//判断是否需要生成报告号
-				if("是".equals(importBRuralProjectRecords.getWhetherReportNumber())){
+				/*if("是".equals(importBRuralProjectRecords.getWhetherReportNumber())){
 
 				}else if("否".equals(importBRuralProjectRecords.getWhetherReportNumber())){
 
 				}else{
 					return "是否生成报告填写不正确";
-				}
+				}*/
 				//添加是否生成报告标识
-				projectRecords.setWhetherReportNumber(importBRuralProjectRecords.getWhetherReportNumber());
+				//projectRecords.setWhetherReportNumber(importBRuralProjectRecords.getWhetherReportNumber());
 				projectRecordsList.add(projectRecords);
 
 			}catch (Exception ex) {
@@ -3265,8 +3241,8 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			this.saveProjectUsers(projectRecords.getId(), leaders, true);
 
 			//保存委托方联系人1
-			List<WorkClientLinkman> workClientLinkmanList = projectRecords.getWorkClientLinkmanList();
-			this.saveLinkmanInfos(projectRecords.getId(), workClientLinkmanList, 1);
+			/*List<WorkClientLinkman> workClientLinkmanList = projectRecords.getWorkClientLinkmanList();
+			this.saveLinkmanInfos(projectRecords.getId(), workClientLinkmanList, 1);*/
 
 			//项目送审之后处理项目合同文件信息
 			//查询咨询合同附件类型id
@@ -3300,13 +3276,13 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				}
 			}
 			//判断是否需要生成报告号
-			if("是".equals(projectRecords.getWhetherReportNumber())){
+			/*if("是".equals(projectRecords.getWhetherReportNumber())){
 				this.createReportDataId(projectRecords);
 			}else if("否".equals(projectRecords.getWhetherReportNumber())){
 
 			}else{
 				return "是否生成报告填写不正确";
-			}
+			}*/
 
 			//添加项目工作内容表      电子签章用不上不管
 			Projectcontentinfo projectcontentinfo = null;

+ 4 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -775,6 +775,10 @@ public class RuralCostProjectRecordsController extends BaseController {
             StringBuilder failureMsg = new StringBuilder();
             ImportExcel ei = new ImportExcel(file, 1, 0);
             List<ImportBRuralProjectRecords> list = ei.getDataList(ImportBRuralProjectRecords.class);
+            for (ImportBRuralProjectRecords info :
+            list) {
+                info.setCompanyType(companyType);
+            }
             //对数据进行处理
             String resultStr = projectRecordsService.disposeImportBRuralProjectRecords(list);
             addMessage(redirectAttributes, resultStr);

BIN
src/main/webapp/dot/审核类项目批量导入模板.xlsx


+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsForm.jsp

@@ -1057,7 +1057,7 @@
                     <label class="layui-form-label"><span class="require-item">*</span>审核人:</label>
                     <div class="layui-input-block  with-icon">
                         <sys:reportedtreeselectUser id="projectMaster" name="reviewerPersonId" value="${ruralProjectRecords.reviewerPersonId}" labelName="reviewerPerson" labelValue="${ruralProjectRecords.reviewerPerson}"
-                                                    cssStyle="background-color:#fff" title="审核人" url="/sys/office/treeDataAll?type=4" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                                    cssStyle="background-color:#fff" title="审核人" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">

+ 2 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp

@@ -508,9 +508,9 @@
 						<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:del">
 							<%--<table:delRow url="${ctx}/project/projectRecords/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->--%>
 						</shiro:hasPermission>
-						<%--<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:importB">
+						<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:importB">
 							<table:importMultiparameterExcel url="${ctx}/ruralProject/ruralCostProjectRecords/importB" companyType="${companyType}"></table:importMultiparameterExcel><!-- 导入按钮 -->
-						</shiro:hasPermission>--%>
+						</shiro:hasPermission>
 						<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:export">
 							<table:exportExcel url="${ctx}/ruralProject/ruralCostProjectRecords/export?companyType=${companyType}"></table:exportExcel><!-- 导出按钮 -->
 						</shiro:hasPermission>

+ 1 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsForm.jsp

@@ -1103,7 +1103,7 @@
                     <label class="layui-form-label"><span class="require-item">*</span>审核人:</label>
                     <div class="layui-input-block  with-icon">
                         <sys:reportedtreeselectUser id="projectMaster" name="reviewerPersonId" value="${ruralProjectRecords.reviewerPersonId}" labelName="reviewerPerson" labelValue="${ruralProjectRecords.reviewerPerson}"
-                                                    cssStyle="background-color:#fff" title="审核人" url="/sys/office/treeDataAll?type=4" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                                    cssStyle="background-color:#fff" title="审核人" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw7">