Procházet zdrojové kódy

造假审核B类项目批量上传

user5 před 3 roky
rodič
revize
304109301e
20 změnil soubory, kde provedl 1010 přidání a 52 odebrání
  1. 7 0
      src/main/java/com/jeeplus/modules/projectEngineering/dao/ProjectEngineeringInfoDao.java
  2. 9 0
      src/main/java/com/jeeplus/modules/projectEngineering/service/ProjectEngineeringService.java
  3. 7 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  4. 192 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ImportBRuralProjectRecords.java
  5. 9 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  6. 393 4
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  7. 38 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  8. 14 0
      src/main/java/com/jeeplus/modules/sys/dao/AreaDao.java
  9. 18 1
      src/main/java/com/jeeplus/modules/sys/service/AreaService.java
  10. 7 0
      src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientInfoDao.java
  11. 38 0
      src/main/java/com/jeeplus/modules/workclientinfo/service/WorkClientInfoService.java
  12. 7 0
      src/main/java/com/jeeplus/modules/workcontractinfo/dao/WorkContractInfoDao.java
  13. 93 0
      src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoService.java
  14. 8 0
      src/main/resources/mappings/modules/projectEngineering/PeojectEngineeringDao.xml
  15. 12 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  16. 69 47
      src/main/resources/mappings/modules/sys/AreaDao.xml
  17. 12 0
      src/main/resources/mappings/modules/workclientinfo/WorkClientInfoDao.xml
  18. 74 0
      src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml
  19. binární
      src/main/webapp/dot/审核类项目批量导入模板.xlsx
  20. 3 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsList.jsp

+ 7 - 0
src/main/java/com/jeeplus/modules/projectEngineering/dao/ProjectEngineeringInfoDao.java

@@ -42,4 +42,11 @@ public interface ProjectEngineeringInfoDao extends CrudDao<ProjectEngineeringInf
     ProjectEngineeringInfo getProjectReportedType(String id);
 
     List<ProjectEngineeringInfo> getProjectReportedTypeList(ProjectEngineeringInfo info);
+
+    /**
+     * 根据父节点id查询字节带你信息
+     * @param parentId
+     * @return
+     */
+    List<ProjectEngineeringInfo> getChildInfoList(String parentId);
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/projectEngineering/service/ProjectEngineeringService.java

@@ -198,4 +198,13 @@ public class ProjectEngineeringService extends TreeService<ProjectEngineeringInf
         sortList(listReturn,projectEngineeringInfoList,"0",true);
         return listReturn;
     }
+
+    /**
+     * 根据父节点id查询子节点信息
+     * @param parentId
+     * @return
+     */
+    public List<ProjectEngineeringInfo> getChildInfoList(String parentId) {
+        return engineeringInfoDao.getChildInfoList(parentId);
+    }
 }

+ 7 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -238,4 +238,11 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     List<User> getProjectCreateUserAndChargeUser(String projectId);
+
+    /**
+     * 根据项目名称查询项目存在数量
+     * @param projectNameList
+     * @return
+     */
+    Integer getProjectByNameList(@Param("projectNameList") List<String> projectNameList);
 }

+ 192 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ImportBRuralProjectRecords.java

@@ -0,0 +1,192 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+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级项目信息表
+ * @author 徐滕
+ * @version 2021-10-08 09:45
+ */
+public class ImportBRuralProjectRecords extends ActEntity<ImportBRuralProjectRecords> {
+
+	private static final long serialVersionUID = 1L;
+	private String whetherContract;	//是否有合同	是/无(必填)
+	private String contractNumber;	//合同编号	填写合同编号(有合同必填,无合同不读取)
+	private String projectName;		//项目名称	必填
+	private String areaName;		//项目所在地	格式:省-市-区	例子:江苏省-南京市-鼓楼区(可只填写省市)
+	private String projectProperties;	//投资性质	必填
+	private String projectSite;		//建设地点
+	private String leaderName;		//项目责任人	必填
+	private String projectMasterName;		//项目负责人
+	private String engineeringName;	//工程类型名称
+	private String engineeringType;	//工程类型
+	private String whetherReportNumber;	//是否生成报告
+	private String submitScaleStr;	//送审规模(万元)
+	private BigDecimal submitScale;	//送审规模(万元)
+	private Date beginDate;			//项目开始日期	同步到项目计划,“收集及熟悉资料”开始和结算时间
+	private Date endDate;			//项目结束日期	同步到项目计划,“出具报告”开始和结算时间
+	private String attachmentProjectSort;   //项目类别	必填
+	private String clientNumber;	//客户编号	无合同项目必填,有合同项目不读取
+
+	@ExcelField(title="是否有合同", align=2, sort=1)
+	public String getWhetherContract() {
+		return whetherContract;
+	}
+	@ExcelField(title="合同编号", align=2, sort=2)
+	public String getContractNumber() {
+		return contractNumber;
+	}
+	@ExcelField(title="项目名称", align=2, sort=3)
+	public String getProjectName() {
+		return projectName;
+	}
+	@ExcelField(title="项目所在地", align=2, sort=4)
+	public String getAreaName() {
+		return areaName;
+	}
+
+	@ExcelField(title="投资性质", align=2, sort=5)
+	public String getProjectProperties() {
+		return projectProperties;
+	}
+
+	@ExcelField(title="建设地点", align=2, sort=6)
+	public String getProjectSite() {
+		return projectSite;
+	}
+	@ExcelField(title="项目责任人", align=2, sort=7)
+	public String getLeaderName() {
+		return leaderName;
+	}
+	@ExcelField(title="项目负责人", align=2, sort=8)
+	public String getProjectMasterName() {
+		return projectMasterName;
+	}
+	@ExcelField(title="工程类型名称", align=2, sort=9)
+	public String getEngineeringName() {
+		return engineeringName;
+	}
+	@ExcelField(title="是否生成报告", align=2, sort=10)
+	public String getWhetherReportNumber() {
+		return whetherReportNumber;
+	}
+	public BigDecimal getSubmitScale() {
+		return submitScale;
+	}
+	@ExcelField(title="项目开始日期", align=2, sort=12)
+	public Date getBeginDate() {
+		return beginDate;
+	}
+	@ExcelField(title="项目结束日期", align=2, sort=13)
+	public Date getEndDate() {
+		return endDate;
+	}
+	@ExcelField(title="项目类别", align=2, sort=14)
+	public String getAttachmentProjectSort() {
+		return attachmentProjectSort;
+	}
+	@ExcelField(title="客户编号", align=2, sort=15)
+	public String getClientNumber() {
+		return clientNumber;
+	}
+
+	@ExcelField(title="送审规模", align=2, sort=11)
+	public String getSubmitScaleStr() {
+		return submitScaleStr;
+	}
+
+
+	public void setSubmitScaleStr(String submitScaleStr) {
+		this.submitScaleStr = submitScaleStr;
+	}
+
+
+	public void setWhetherContract(String whetherContract) {
+		this.whetherContract = whetherContract;
+	}
+
+	public void setContractNumber(String contractNumber) {
+		this.contractNumber = contractNumber;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+
+	public void setAreaName(String areaName) {
+		this.areaName = areaName;
+	}
+
+	public void setProjectProperties(String projectProperties) {
+		this.projectProperties = projectProperties;
+	}
+
+	public void setProjectSite(String projectSite) {
+		this.projectSite = projectSite;
+	}
+
+	public void setLeaderName(String leaderName) {
+		this.leaderName = leaderName;
+	}
+
+	public void setProjectMasterName(String projectMasterName) {
+		this.projectMasterName = projectMasterName;
+	}
+
+	public void setEngineeringName(String engineeringName) {
+		this.engineeringName = engineeringName;
+	}
+
+	public void setWhetherReportNumber(String whetherReportNumber) {
+		this.whetherReportNumber = whetherReportNumber;
+	}
+
+	public void setSubmitScale(BigDecimal submitScale) {
+		this.submitScale = submitScale;
+	}
+
+	public void setBeginDate(Date beginDate) {
+		this.beginDate = beginDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public void setAttachmentProjectSort(String attachmentProjectSort) {
+		this.attachmentProjectSort = attachmentProjectSort;
+	}
+
+	public void setClientNumber(String clientNumber) {
+		this.clientNumber = clientNumber;
+	}
+
+	public String getEngineeringType() {
+		return engineeringType;
+	}
+
+	public void setEngineeringType(String engineeringType) {
+		this.engineeringType = engineeringType;
+	}
+}

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -255,6 +255,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 
 	private String money; //收费金额
 	private String prdAuditDate; //报告审批通过时间时间
+	private String whetherReportNumber; //是否需要报告号
 
 	private List<String> civilProjectList = Lists.newArrayList();
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
@@ -1857,4 +1858,12 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setPrdAuditDate(String prdAuditDate) {
 		this.prdAuditDate = prdAuditDate;
 	}
+
+	public String getWhetherReportNumber() {
+		return whetherReportNumber;
+	}
+
+	public void setWhetherReportNumber(String whetherReportNumber) {
+		this.whetherReportNumber = whetherReportNumber;
+	}
 }

+ 393 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -19,6 +19,7 @@ import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
 import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.projectAccessory.service.ProjectAccessoryRelationService;
+import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
@@ -36,15 +37,15 @@ import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
+import com.jeeplus.modules.ruralprojectrecords.entity.ImportBRuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.entity.SubProjectInfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
-import com.jeeplus.modules.sys.entity.MainDictDetail;
-import com.jeeplus.modules.sys.entity.Office;
-import com.jeeplus.modules.sys.entity.User;
-import com.jeeplus.modules.sys.entity.Workattachment;
+import com.jeeplus.modules.sys.dao.UserDao;
+import com.jeeplus.modules.sys.entity.*;
+import com.jeeplus.modules.sys.service.AreaService;
 import com.jeeplus.modules.sys.service.OfficeService;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
@@ -85,6 +86,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.*;
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.util.*;
 
@@ -161,6 +163,10 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	private WorkContractInfoService workContractInfoService;
 	@Autowired
 	private ProjectReportNumService projectReportNumService;
+	@Autowired
+	private AreaService areaService;
+	@Autowired
+	private UserDao userDao;
 
 	/**
 	 * 获取咨询项目类别
@@ -2368,4 +2374,387 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			projectReportDataTwoDao.updateStatus(projectReportDataTwo);
 		}
 	}
+
+	/**
+	 * B类项目批量导入
+	 * @param list
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public String disposeImportBRuralProjectRecords(List<ImportBRuralProjectRecords> list){
+		Set<String> projectNameSet = new HashSet<>();
+		Iterator<ImportBRuralProjectRecords> iterator = list.iterator();
+		while(iterator.hasNext()){
+			ImportBRuralProjectRecords info = iterator.next();
+			if(StringUtils.isBlank(info.getWhetherContract())
+					&& StringUtils.isBlank(info.getProjectName())
+					&& StringUtils.isBlank(info.getAreaName())
+					&& StringUtils.isBlank(info.getLeaderName())
+					&& StringUtils.isBlank(info.getEngineeringName())
+					&& StringUtils.isBlank(info.getWhetherReportNumber())
+					&& StringUtils.isBlank(info.getSubmitScaleStr())
+					&& StringUtils.isBlank(info.getAttachmentProjectSort())){
+				iterator.remove();
+			}
+		}
+		for (ImportBRuralProjectRecords importBRuralProjectRecords : list){
+			//将项目名放入set中
+			projectNameSet.add(importBRuralProjectRecords.getProjectName());
+		}
+		//将set转换为list
+		List<String> projectNameList = new ArrayList<>(projectNameSet);
+		//判断项目名list长度和导入数据的list长度是否一样,不一样则说明导入数据中项目名存在重复数据
+		if(projectNameList.size() != list.size()){
+			return "数据中存在重复项目名";
+		}else{
+			//根据项目名称集合查询项目信息是否存在
+			Integer projectByNameList = dao.getProjectByNameList(projectNameList);
+			if(projectByNameList>0){
+				return "数据中存在重复项目名";
+			}
+		}
+
+		List<RuralProjectRecords> projectRecordsList = Lists.newArrayList();
+		for (ImportBRuralProjectRecords importBRuralProjectRecords : list){
+			try{
+				RuralProjectRecords projectRecords = new RuralProjectRecords();
+				//判定必填项是否填完
+				if(StringUtils.isBlank(importBRuralProjectRecords.getWhetherContract())
+						|| 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 "必填项没有填全";
+				}
+				//设置项目类型为造价审核类型
+				projectRecords.setProjectType("2");
+				//设置为B类项目
+				projectRecords.setSubmitMoney("1");
+				//默认设置为紧急项目
+				projectRecords.setEmergencyProject("1");
+				//设置项目状态为5
+				projectRecords.setProjectStatus(5);
+				//填入项目名称
+				projectRecords.setProjectName(importBRuralProjectRecords.getProjectName());
+
+				if(null != importBRuralProjectRecords.getBeginDate() && null != importBRuralProjectRecords.getEndDate()){
+					int compareTo = importBRuralProjectRecords.getEndDate().compareTo(importBRuralProjectRecords.getBeginDate());
+					if(compareTo < 0){
+						return "项目开始时间不能小于结束时间";
+					}
+				}
+
+				//处理项目开始时间
+				if(null != importBRuralProjectRecords.getBeginDate()){
+					projectRecords.setStartDate(importBRuralProjectRecords.getBeginDate());
+				}
+				//处理项目结束时间
+				if(null != importBRuralProjectRecords.getEndDate()){
+					projectRecords.setEndingDate(importBRuralProjectRecords.getEndDate());
+				}
+
+
+				//项目所在地处理
+				List<String> areaNameList = Arrays.asList(importBRuralProjectRecords.getAreaName().split("-"));
+				if(areaNameList.size() == 2){
+					//根据名称查询省级单位信息
+					Area province = areaService.getByNameAndParentId(areaNameList.get(0),"1");
+					if(null == province ){
+						return "项目所在地填写错误,查询不到省级信息";
+					}
+					//根据名称查询市级单位信息
+					Area city = areaService.getByNameAndParentId(areaNameList.get(1),province.getId());
+					if(null == city){
+						return "项目所在地填写错误,查询不到市级信息";
+					}
+					projectRecords.setArea(city);
+					projectRecords.setProvince(province.getName());
+					projectRecords.setCity(city.getName());
+				}else if(areaNameList.size() == 3){
+					//根据名称查询省级单位信息
+					Area province = areaService.getByNameAndParentId(areaNameList.get(0),"1");
+					if(null == province ){
+						return "项目所在地填写错误,查询不到省级信息";
+					}
+					//根据名称查询市级单位信息
+					Area city = areaService.getByNameAndParentId(areaNameList.get(1),province.getId());
+					if(null == city){
+						return "项目所在地填写错误,查询不到市级信息";
+					}
+					//根据名称查询区级单位信息
+					Area district = areaService.getByNameAndParentId(areaNameList.get(2),city.getId());
+					if(null == district){
+						return "项目所在地填写错误,查询不到区级信息";
+					}
+					projectRecords.setProvince(province.getName());
+					projectRecords.setCity(city.getName());
+					projectRecords.setCounty(district.getName());
+					projectRecords.setArea(district);
+				}else{
+					return "项目所在地填写错误";
+				}
+
+				//判断投资性质
+				List<MainDictDetail> projectPropertiesList = DictUtils.getMainDictList("project_properties");
+				for (MainDictDetail projectProperties: projectPropertiesList) {
+					if(projectProperties.getLabel().equals(importBRuralProjectRecords.getProjectProperties())){
+						projectRecords.setProjectProperties(projectProperties.getValue());
+						break;
+					}
+				}
+				if(StringUtils.isBlank(projectRecords.getProjectProperties())){
+					return "投资性质填写有误";
+				}
+
+				//判断项目类别
+				List<MainDictDetail> attachmentProjectSortCostList = DictUtils.getMainDictList("attachment_project_sort_cost");
+				for (MainDictDetail attachmentProjectSortCost: attachmentProjectSortCostList) {
+					if(attachmentProjectSortCost.getLabel().equals(importBRuralProjectRecords.getAttachmentProjectSort())){
+						projectRecords.setAttachmentProjectSort(attachmentProjectSortCost.getValue());
+						break;
+					}
+				}
+				if(StringUtils.isBlank(projectRecords.getAttachmentProjectSort())){
+					return "项目类别填写有误";
+				}
+				if("5".equals(projectRecords.getAttachmentProjectSort()) || "6".equals(projectRecords.getAttachmentProjectSort())){
+					projectRecords.setReportedState("10");
+				}else{
+					projectRecords.setReportedState(null);
+				}
+
+				//判断工程类型
+				List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
+				for (ProjectEngineeringInfo engineeringInfo: engineeringInfos) {
+					if(engineeringInfo.getEngineeringName().equals(importBRuralProjectRecords.getEngineeringName())){
+						//判定当前的数据是否存在子集,如果存在子集则不允许添加
+						List<ProjectEngineeringInfo> childInfoList = engineeringService.getChildInfoList(engineeringInfo.getId());
+						if(childInfoList.size()>0){
+							return "工程类型必须选择最低节点,填写有误";
+						}
+						projectRecords.setEngineeringType(engineeringInfo.getId());
+						break;
+					}
+				}
+				if(StringUtils.isBlank(projectRecords.getEngineeringType())){
+					return "工程类型填写有误";
+				}
+
+				Office company= new Office();
+				Office office =  new Office();
+
+				if("是".equals(importBRuralProjectRecords.getWhetherContract())){
+					//判断当是否有合同为是时,合同编号是否为空
+					if(StringUtils.isBlank(importBRuralProjectRecords.getContractNumber())){
+						return "是否有合同选择是的情况下合同编号为空";
+					}
+					//根据合同编号查询合同信息
+					//判断当前的合同是否被作废或者删除
+					WorkContractInfo workContractInfo = contractInfoService.getByContractNum(importBRuralProjectRecords.getContractNumber());
+					if(null == workContractInfo){
+						return "合同编号:"+ importBRuralProjectRecords.getContractNumber() + "  不存在或已删除";
+					}else{
+						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 "是否有合同栏填写不正确";
+				}
+				projectRecords.setCompany(company);
+				projectRecords.setOffice(office);
+
+				//判定送审规模
+				//将字符串转换为BigDecimal
+				BigDecimal submitScale=new BigDecimal(importBRuralProjectRecords.getSubmitScaleStr());
+				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());
+				if(null == userLeader){
+					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());
+				}
+				List<User> userMasterList = userDao.findUserByOfficeIdAndNameOnReported(user);
+				if(userMasterList.size() == 0){
+					return "项目负责人必须有一级造价师资格证";
+				}else{
+					projectRecords.setProjectMasterId(userMasterList.get(0).getId());
+					projectRecords.setProjectMasterName(userMasterList.get(0).getName());
+				}
+
+
+				User createBy = projectRecords.getCreateBy();
+				if(createBy != null){
+					createBy = UserUtils.get(createBy.getId());
+				}else {
+					createBy = UserUtils.getUser();
+				}
+				//添加项目编号
+				synchronized (SYN_BYTE) {
+					if (StringUtils.isBlank(projectRecords.getProjectId())) {
+						if ("1".equals(projectRecords.getProjectType())) {
+							if(projectRecords.getAttachmentProjectSort().equals("6")){
+								projectRecords.setProjectId(serialNumTplService.genSerialNum(createBy.getCompany(), RuralProjectRecords.PROJECT_COST_APPRAISAL));
+							}else if(projectRecords.getAttachmentProjectSort().equals("7")){
+								projectRecords.setProjectId(serialNumTplService.genSerialNum(createBy.getCompany(), RuralProjectRecords.ECONOMIC_EVALUATION));
+							}else{
+								projectRecords.setProjectId(serialNumTplService.genSerialNum(createBy.getCompany(), RuralProjectRecords.SERIAL_BIZCODE));
+							}
+						} else if ("2".equals(projectRecords.getProjectType())) {
+							projectRecords.setProjectId(serialNumTplService.genSerialNum(createBy.getCompany(), RuralProjectRecords.SERIAL_COST_BIZCODE));
+						}
+					}
+				}
+				//判断是否需要生成报告号
+				if("是".equals(importBRuralProjectRecords.getWhetherReportNumber())){
+
+				}else if("否".equals(importBRuralProjectRecords.getWhetherReportNumber())){
+
+				}else{
+					return "是否生成报告填写不正确";
+				}
+				//添加是否生成报告标识
+				projectRecords.setWhetherReportNumber(importBRuralProjectRecords.getWhetherReportNumber());
+				projectRecordsList.add(projectRecords);
+
+			}catch (Exception ex) {
+				ex.getMessage();
+			}
+		}
+
+		//对数据进行新增处理
+		for (RuralProjectRecords projectRecords: projectRecordsList) {
+			//添加创建人信息
+			projectRecords.preInsert();
+			dao.insert(projectRecords);
+			//保存项目负责人
+			List<User> leaders = projectRecords.getProjectLeaders();
+			this.saveProjectUsers(projectRecords.getId(), leaders, true);
+
+			//保存委托方联系人1
+			List<WorkClientLinkman> workClientLinkmanList = projectRecords.getWorkClientLinkmanList();
+			this.saveLinkmanInfos(projectRecords.getId(), workClientLinkmanList, 1);
+
+			//项目送审之后处理项目合同文件信息
+			//查询咨询合同附件类型id
+			ProjectTemplateInfo projectTemplateInfo = projectTemplateDao.getProjectTemplateInfoByName("咨询合同");
+			//删除该项目咨询合同类型中老合同对应的附件信息
+			WorkClientAttachment attchment = new WorkClientAttachment();
+			attchment.setAttachmentId(projectTemplateInfo.getId());
+			attchment.setProjectId(projectRecords.getId());
+			//将新合同对应的附件信息添加到咨询合同中
+
+			if(null != projectRecords.getWorkContractInfo() && null != projectRecords.getWorkContractInfo().getWorkAttachments()){
+				WorkClientAttachment workattachment = new WorkClientAttachment();
+				for (WorkClientAttachment info:projectRecords.getWorkContractInfo().getWorkAttachments()) {
+					workattachment.setType(info.getType());
+					workattachment.setAttachmentName(info.getAttachmentName());
+					workattachment.setUrl(info.getUrl());
+					workattachment.setAttachmentUser(info.getAttachmentUser());
+					workattachment.setAttachmentFlag(info.getAttachmentFlag());
+					workattachment.setAttachmentId(projectTemplateInfo.getId());
+					workattachment.setProjectId(projectRecords.getId());
+					switch (uploadMode){
+						case "1":
+							workattachment.setUrl(workattachment.getUrl().replace(bosUrl,""));
+							break;
+						case "2":
+							workattachment.setUrl(workattachment.getUrl().replace(aliyunUrl,""));
+							break;
+					}
+					workattachment.preInsert();
+					workClientAttachmentDao.insert(workattachment);
+				}
+			}
+			//判断是否需要生成报告号
+			if("是".equals(projectRecords.getWhetherReportNumber())){
+				this.createReportDataId(projectRecords);
+			}else if("否".equals(projectRecords.getWhetherReportNumber())){
+
+			}else{
+				return "是否生成报告填写不正确";
+			}
+
+			//添加项目工作内容表
+			Projectcontentinfo projectcontentinfo = null;
+			if(StringUtils.isNotBlank(projectRecords.getId())){
+				projectcontentinfo = projectcontentinfoDao.getByProjectId(projectRecords.getId());
+			}
+			if (null==projectcontentinfo){
+				projectcontentinfo = new Projectcontentinfo();
+			}
+			projectcontentinfo.setProjectOnRural(projectRecords);
+			projectcontentinfo.setCompanyId(projectRecords.getCompany().getId());
+			projectcontentinfo.setOfficeId(projectRecords.getOffice().getId());
+			projectcontentinfo.setSort(30);
+			projectcontentinfo.setParentIds("0,");
+			projectcontentinfo.setParent(new Projectcontentinfo("0"));
+			projectcontentinfo.setName(projectRecords.getProjectId());
+			if (StringUtils.isNotBlank(projectcontentinfo.getId())){
+				projectcontentinfoDao.update(projectcontentinfo);
+			}else{
+				projectcontentinfo.preInsert();
+				projectcontentinfoDao.insertOnRural(projectcontentinfo);
+			}
+
+		}
+		return "导入B类项目成功";
+	}
 }

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

@@ -10,11 +10,14 @@ import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
 import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
+import com.jeeplus.modules.alterinfo.entity.AlterInfo;
 import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -22,6 +25,7 @@ import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
+import com.jeeplus.modules.ruralprojectrecords.entity.ImportBRuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
@@ -58,6 +62,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.ConstraintViolationException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.util.*;
@@ -537,6 +542,39 @@ public class RuralCostProjectRecordsController extends BaseController {
     }
 
 	/**
+	 * 导入造价审核B类项目数据
+	 */
+	@RequiresPermissions("ruralProject:ruralCostProjectRecords:importB")
+	@RequestMapping(value = "importB", method=RequestMethod.POST)
+	public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+		try {
+			StringBuilder failureMsg = new StringBuilder();
+			ImportExcel ei = new ImportExcel(file, 1, 0);
+			List<ImportBRuralProjectRecords> list = ei.getDataList(ImportBRuralProjectRecords.class);
+			//对数据进行处理
+			String resultStr = projectRecordsService.disposeImportBRuralProjectRecords(list);
+			addMessage(redirectAttributes, resultStr);
+		} catch (Exception e) {
+			addMessage(redirectAttributes, "导入B类项目失败!失败信息:"+e.getMessage());
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+
+	/**
+	 * 下载导入造价审核B类项目数据模板
+	 */
+	@RequestMapping(value = "importB/template")
+	public String importFileTemplateB(HttpServletResponse response, HttpServletRequest request) {
+		try {
+			ThisLocalityDownloadUtil download = new ThisLocalityDownloadUtil();
+			download.download("审核类项目批量导入模板.xlsx",request,response);
+		} catch (Exception e) {
+			logger.error("审核类项目批量导入模板下载失败!",e);
+		}
+		return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
+	}
+
+	/**
 	 * 下载导入项目数据模板
 	 */
 	@RequiresPermissions("ruralProject:ruralCostProjectRecords:import")

+ 14 - 0
src/main/java/com/jeeplus/modules/sys/dao/AreaDao.java

@@ -30,4 +30,18 @@ public interface AreaDao extends TreeDao<Area> {
     Area findAraeByid(String id);
 
 	List<Area> findAraeByParentId(String id);
+
+	/**
+	 * 根据名称查询地点信息
+	 * @param name
+	 * @return
+	 */
+	Area getByName(String name);
+
+	/**
+	 * 根据名称查询地点信息
+	 * @param name
+	 * @return
+	 */
+	Area getByNameAndParentId(@Param("name") String name,@Param("parentId") String parentId);
 }

+ 18 - 1
src/main/java/com/jeeplus/modules/sys/service/AreaService.java

@@ -64,7 +64,7 @@ public class AreaService extends TreeService<AreaDao, Area> {
 		super.save(area);
 		UserUtils.removeCache(UserUtils.CACHE_AREA_LIST);
 	}
-	
+
 	@Transactional(readOnly = false)
 	public void delete(Area area) {
 		super.delete(area);
@@ -107,4 +107,21 @@ public class AreaService extends TreeService<AreaDao, Area> {
 	public List<Area> getParents(String parentId){
 		return areaDao.findByPIds(parentId);
 	}
+
+	/**
+	 * 根据名称查询区域信息
+	 * @param name
+	 * @return
+	 */
+	public Area getByName(String name){
+		return areaDao.getByName(name);
+	}
+	/**
+	 * 根据名称和父节点id查询区域信息
+	 * @param name
+	 * @return
+	 */
+	public Area getByNameAndParentId(String name,String parentId){
+		return areaDao.getByNameAndParentId(name,parentId);
+	}
 }

+ 7 - 0
src/main/java/com/jeeplus/modules/workclientinfo/dao/WorkClientInfoDao.java

@@ -53,4 +53,11 @@ public interface WorkClientInfoDao extends CrudDao<WorkClientInfo> {
      * @return
      */
     String getJobTypeStr(String clientId);
+
+    /**
+     * 根据用户编码查询用户信息
+     * @param name
+     * @return
+     */
+    WorkClientInfo getByName(String name);
 }

+ 38 - 0
src/main/java/com/jeeplus/modules/workclientinfo/service/WorkClientInfoService.java

@@ -857,4 +857,42 @@ public class WorkClientInfoService extends CrudService<WorkClientInfoDao, WorkCl
         return work;
 
     }
+
+    /**
+     * 根据用户编码查询用户信息
+     * @param name
+     * @return
+     */
+    public WorkClientInfo getByName(String name) {
+        if(StringUtils.isBlank(name)){
+            return new WorkClientInfo();
+        }
+        WorkClientInfo workClientInfo = dao.getByName(name);
+        //获取一个客户所关联的联系人信息
+        if(workClientInfo != null){
+            workClientInfo.setWorkClientLinkmanList(workClientLinkmanDao.findList(new WorkClientLinkman(workClientInfo)));
+            //获取一个客户关联的银行信息
+            workClientInfo.setWorkClientBankList(workClientBankDao.findList(new WorkClientBank(workClientInfo)));
+            //获取附件信息
+            WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+            workClientAttachment.setAttachmentId(workClientInfo.getId());
+            workClientAttachment.setAttachmentFlag(VarStr.attachmentFlag[0]);
+            workClientInfo.setWorkAttachments(workattachmentService.getAttachmentList(workClientAttachment));
+
+            //多个联系人
+            List<WorkClientLinkman> linkman = workClientLinkmanDao.findByClientId(workClientInfo.getId());
+//        workClientInfo.setWorkClientLinkman(linkman);
+            workClientInfo.setWorkClientLinkmanList(linkman);
+            WorkClientAttachment attchment = new WorkClientAttachment();
+            attchment.setAttachmentId(workClientInfo.getId());
+            List<WorkClientAttachment> attachments = workattachmentService.getAttachmentList(attchment);
+            workClientInfo.setWorkAttachments(attachments);
+
+            //添加当前文件服务器类型
+            workClientInfo.setUploadMode(uploadMode);
+            //数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+            workattachmentService.clientAttachmentManageOnUrl(workClientInfo.getWorkAttachments());
+        }
+        return workClientInfo;
+    }
 }

+ 7 - 0
src/main/java/com/jeeplus/modules/workcontractinfo/dao/WorkContractInfoDao.java

@@ -97,4 +97,11 @@ public interface WorkContractInfoDao extends CrudDao<WorkContractInfo> {
      * @return
      */
     Integer findContractBycount(String id);
+
+    /**
+     * 根据合同编号查询合同信息
+     * @param contractNum
+     * @return
+     */
+    WorkContractInfo getByContractNum(String contractNum);
 }

+ 93 - 0
src/main/java/com/jeeplus/modules/workcontractinfo/service/WorkContractInfoService.java

@@ -3289,4 +3289,97 @@ public class WorkContractInfoService extends CrudService<WorkContractInfoDao, Wo
 	public int deleteByLogic(String id){
 		return dao.deleteByLogic(id);
 	}
+
+
+	public WorkContractInfo getByContractNum(String contractNum) {
+		WorkContractInfo workContractInfo = dao.getByContractNum(contractNum);
+		/*合同投标项目,则查投标。不是投标项目,不去查*/
+		if (workContractInfo != null && "0".equals(workContractInfo.getExt()) && workContractInfo.getProject()!=null && StringUtils.isNotBlank(workContractInfo.getProject().getId())) {
+			WorkBidProject workBidProject = workBidProjectDao.get(workContractInfo.getProject().getId());
+			if (workBidProject != null) {
+				workContractInfo.setProject(workBidProject);
+				workContractInfo.setProjectName(workBidProject.getProjectName());
+			}
+		}
+
+		if(workContractInfo != null){
+			WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+			workClientAttachment.setAttachmentId(workContractInfo.getId());
+			workClientAttachment.setAttachmentFlag("44");
+			workContractInfo.setWorkAttachments(workattachmentService.getAttachmentList(workClientAttachment));
+			WorkClientAttachment workClientAttachment2 = new WorkClientAttachment();
+			workClientAttachment2.setAttachmentId(workContractInfo.getId());
+			workClientAttachment2.setAttachmentFlag("81");
+			workContractInfo.setWorkAttachmentAlters(workattachmentService.getAttachmentList(workClientAttachment2));
+			if(StringUtils.isNotBlank(workContractInfo.getAlterBeforeId())){
+				WorkContractInfo oldWorkContractInfo = this.getInfo(workContractInfo.getAlterBeforeId());
+				workContractInfo.setOldWorkContractInfo(oldWorkContractInfo);
+			}
+			String totalContractId = workContractInfo.getTotalContractId();
+			if(!Strings.isNullOrEmpty(totalContractId)){
+				WorkContractInfo wc = workContractInfoDao.get(totalContractId);
+				if(wc != null){
+					workContractInfo.setTotalContractName(wc.getName());
+				}
+			}
+			WorkContractReview workContractReview = workContractReviewDao.getByContractId(workContractInfo.getId());
+			if (workContractReview!=null){
+				WorkClientAttachment clientAttachment = new WorkClientAttachment();
+				clientAttachment.setAttachmentId(workContractReview.getId());
+				clientAttachment.setAttachmentFlag("80");
+				workContractReview.setWorkAttachments(workattachmentService.getAttachmentList(clientAttachment));
+				workContractInfo.setWorkContractReview(workContractReview);
+			}
+			AlterInfo alterInfo = new AlterInfo();
+			alterInfo.setBeforeId(workContractInfo.getId());
+			List<AlterInfo> list = alterInfoService.findList(alterInfo);
+			if(list!=null && list.size()>0){
+				workContractInfo.setAlterInfo(list.get(0));
+			}
+			WorkContractClient workContractClient = new WorkContractClient();
+			workContractClient.setContractId(workContractInfo.getId());
+			List<WorkContractClient> list1 = workContractClientService.findList(workContractClient);
+			List<WorkClientInfo> list2 = new ArrayList<>();
+			if(list1!=null && list1.size()>0){
+				for(WorkContractClient w :list1){
+					WorkClientInfo workClientInfo = workClientInfoService.get(w.getClientId());
+					list2.add(workClientInfo);
+				}
+			}
+			if ("5".equals(workContractInfo.getContractState())){
+				WorkInvoiceDetail invoice = new WorkInvoiceDetail();
+				invoice.setId(workContractInfo.getId());
+				List<WorkInvoiceDetail> invoiceDetails =workInvoiceDetailDao.findListByContractInfo(invoice);
+				List<WorkInvoiceDetail> invoiceDetailList =new ArrayList<>();
+				if (invoiceDetails!=null && invoiceDetails.size()!=0){
+					WorkInvoiceDetail workInvoiceDetailTotal = new WorkInvoiceDetail();
+					BigDecimal totalMoneys = new BigDecimal("0.00");
+					BigDecimal taxMoneys = new BigDecimal("0.00");
+					BigDecimal taxRates = new BigDecimal("0.00");
+					BigDecimal incomeMoneys = new BigDecimal("0.00");
+					workInvoiceDetailTotal.setCode("合计");
+					for (WorkInvoiceDetail workInvoiceDetail :invoiceDetails){
+						totalMoneys = totalMoneys.add(new BigDecimal(StringUtils.isBlank(workInvoiceDetail.getTotalMoney())?"0.00":workInvoiceDetail.getTotalMoney()));
+						taxMoneys = incomeMoneys.add(new BigDecimal(StringUtils.isBlank(workInvoiceDetail.getTaxMoney())?"0.00":workInvoiceDetail.getTaxMoney()));
+						taxRates = taxRates.add(new BigDecimal(StringUtils.isBlank(workInvoiceDetail.getTaxRate())?"0.00":workInvoiceDetail.getTaxRate()));
+						incomeMoneys = incomeMoneys.add(new BigDecimal(StringUtils.isBlank(workInvoiceDetail.getIncomeMoney())?"0.00":workInvoiceDetail.getIncomeMoney()));
+						invoiceDetailList.add(workInvoiceDetail);
+					}
+					workInvoiceDetailTotal.setTotalMoney(totalMoneys+"");
+					workInvoiceDetailTotal.setTaxMoney(taxMoneys+"");
+					workInvoiceDetailTotal.setTaxRate(taxRates+"");
+					workInvoiceDetailTotal.setIncomeMoney(incomeMoneys+"");
+					invoiceDetailList.add(workInvoiceDetailTotal);
+					workContractInfo.setInvoiceDetails(invoiceDetailList);
+				}
+			}
+			workContractInfo.setWorkClientInfoList(list2);
+
+			//添加当前文件服务器类型
+			workContractInfo.setUploadMode(uploadMode);
+			//数据处理(如果为阿里云文件服务器,则对查看的路径进行处理)
+			workattachmentService.clientAttachmentManageOnUrl(workContractInfo.getWorkAttachments());
+		}
+		return workContractInfo;
+	}
 }

+ 8 - 0
src/main/resources/mappings/modules/projectEngineering/PeojectEngineeringDao.xml

@@ -159,4 +159,12 @@
         </choose>
     </select>
 
+
+    <select id="getChildInfoList" resultType="com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo" >
+        SELECT
+        <include refid="engineeringColumns"/>
+        FROM project_engineering_info a
+        WHERE a.parent_id = #{parentId}
+    </select>
+
 </mapper>

+ 12 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -1841,4 +1841,16 @@
 		) z
 		group by z.id
 	</select>
+
+	<select id="getProjectByNameList" resultType="java.lang.Integer">
+		select count(1) from rural_project_records a
+		<where>
+			<if test="projectNameList!=null and projectNameList.size!=0">
+				and a.project_name in
+				<foreach collection="projectNameList" item="projectName" separator="," open="(" close=")">
+					#{projectName}
+				</foreach>
+			</if>
+		</where>
+	</select>
 </mapper>

+ 69 - 47
src/main/resources/mappings/modules/sys/AreaDao.xml

@@ -27,11 +27,11 @@
 		a.del_flag,
 		p.name AS "parent.name"
 	</sql>
-	
+
 	<sql id="areaJoins">
 		LEFT JOIN sys_area p ON p.id = a.parent_id
     </sql>
-    
+
 	<select id="get" resultType="Area">
 		SELECT
 			<include refid="areaColumns"/>
@@ -39,7 +39,7 @@
 		<include refid="areaJoins"/>
 		WHERE a.id = #{id}
 	</select>
-	
+
 	<select id="findList" resultType="Area">
 		SELECT
 			<include refid="areaColumns"/>
@@ -125,71 +125,71 @@
 			a.parent_id = #{parentId}
 		</where>
 	</select>
-	
+
 	<insert id="insert">
 		INSERT INTO sys_area(
-			id, 
-			parent_id, 
-			parent_ids, 
-			code, 
-			name, 
+			id,
+			parent_id,
+			parent_ids,
+			code,
+			name,
 			sort,
-			type, 
-			create_by, 
-			create_date, 
-			update_by, 
-			update_date, 
-			remarks, 
+			type,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			remarks,
 			del_flag
 		) VALUES (
-			#{id}, 
-			#{parent.id}, 
-			#{parentIds}, 
-			#{code}, 
-			#{name}, 
-			#{sort}, 
-			#{type}, 
-			#{createBy.id}, 
-			#{createDate}, 
-			#{updateBy.id}, 
-			#{updateDate}, 
-			#{remarks}, 
+			#{id},
+			#{parent.id},
+			#{parentIds},
+			#{code},
+			#{name},
+			#{sort},
+			#{type},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
 			#{delFlag}
 		)
 	</insert>
-	
+
 	<update id="update">
-		UPDATE sys_area SET 
-			parent_id = #{parent.id}, 
-			parent_ids = #{parentIds}, 
-			code = #{code}, 
-			name = #{name}, 
-			sort = #{sort}, 
-			type = #{type}, 
-			update_by = #{updateBy.id}, 
-			update_date = #{updateDate}, 
+		UPDATE sys_area SET
+			parent_id = #{parent.id},
+			parent_ids = #{parentIds},
+			code = #{code},
+			name = #{name},
+			sort = #{sort},
+			type = #{type},
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
 			remarks = #{remarks}
 		WHERE id = #{id}
 	</update>
-	
+
 	<update id="updateParentIds">
-		UPDATE sys_area SET 
-			parent_id = #{parent.id}, 
+		UPDATE sys_area SET
+			parent_id = #{parent.id},
 			parent_ids = #{parentIds}
 		WHERE id = #{id}
 	</update>
-	
+
 	<update id="delete">
-		DELETE FROM sys_area 
-		WHERE id = #{id} OR parent_ids LIKE 
+		DELETE FROM sys_area
+		WHERE id = #{id} OR parent_ids LIKE
 					<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
 					<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
 	</update>
-	
+
 	<update id="deleteByLogic">
-		UPDATE sys_area SET 
+		UPDATE sys_area SET
 			del_flag = #{DEL_FLAG_DELETE}
-		WHERE id = #{id} OR parent_ids LIKE 
+		WHERE id = #{id} OR parent_ids LIKE
 					<if test="dbName == 'oracle'">'%,'||#{id}||',%'</if>
 					<if test="dbName == 'mysql'">CONCAT('%,', #{id}, ',%')</if>
 	</update>
@@ -231,4 +231,26 @@
 		</where>
 		ORDER BY a.sort=29 desc, a.code
 	</select>
-</mapper>
+
+
+	<select id="getByName" resultType="com.jeeplus.modules.sys.entity.Area">
+		SELECT
+		<include refid="areaColumns"/>
+		FROM sys_area a
+		<include refid="areaJoins"/>
+		<where>
+			a.name= #{name}
+		</where>
+	</select>
+
+	<select id="getByNameAndParentId" resultType="com.jeeplus.modules.sys.entity.Area">
+		SELECT
+		<include refid="areaColumns"/>
+		FROM sys_area a
+		<include refid="areaJoins"/>
+		<where>
+			a.name= #{name}
+			and a.parent_id = #{parentId}
+		</where>
+	</select>
+</mapper>

+ 12 - 0
src/main/resources/mappings/modules/workclientinfo/WorkClientInfoDao.xml

@@ -713,4 +713,16 @@
 		where md.del_flag = 0 and c.type_name = 'job_type' and a.work_client_id = #{clientId}
 
 	</select>
+
+
+
+	<select id="getByName" resultType="WorkClientInfo" >
+		SELECT
+		<include refid="workClientInfoColumns"/>
+		FROM work_client_info a
+		<include refid="workClientInfoJoins"/>
+		WHERE a.name = #{name}
+		order by a.id
+		limit 1
+	</select>
 </mapper>

+ 74 - 0
src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml

@@ -1337,4 +1337,78 @@
 		where a.id=#{id}
 	</select>
 
+
+
+	<select id="getByContractNum" resultType="WorkContractInfo" >
+		SELECT
+		a.id AS "id",
+		a.project_id AS "project.id",
+		a.ext AS  "ext",
+		u.name AS "createBy.name",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.remarks AS "remarks",
+		a.client_id AS "client.id",
+		a.contract_date AS "contractDate",
+		a.effective_date AS "effectiveDate",
+		a.closing_date AS "closingDate",
+		a.name AS "name",
+		a.contract_num_path AS "contractNumPath",
+		a.create_name AS "createName",
+		a.contract_category AS "contractCategory",
+		a.contract_num AS "contractNum",
+		a.contract_price AS "contractPrice",
+		a.contract_opposite AS "contractOpposite",
+		a.contract_type AS "contractType",
+		a.contract_fee AS "contractFee",
+		a.contract_special AS "contractSpecial",
+		a.contract_state AS "contractState",
+		a.office_id AS "chargeCompany",
+		a.charge_company_name AS "chargeCompanyName",
+		a.contract_file_id AS "contractFileId",
+		a.contract_role AS "contractRole",
+		a.apply_view AS "applyView",
+		a.process_instance_id AS "processInstanceId",
+		a.company_id as companyId,
+		a.contractFeeDoc AS "contractFeeDoc",
+		a.contractTypeDoc AS "contractTypeDoc",
+		a.another_contract_num AS "anotherContractNum",
+		client.name AS "client.name",
+		client.telephone AS "client.telephone",
+		a.is_total AS "isTotal",
+		a.total_contract_id AS "totalContractId",
+		a.status AS "status",
+		a.investment_scale AS "investmentScale",
+		a.summary_payment AS "summaryPayment",
+		a.investment_amount AS "investmentAmount",
+		a.create_bys AS "createBys",
+		a.construction_project_type AS "constructionProjectType",
+		a.invalidate_process_instance_id AS "invalidateProcessInstanceId",
+		a.alter_process_instance_id AS "alterProcessInstanceId",
+		a.invalidate_status AS "invalidateStatus",
+		a.invalidate_user AS "invalidateUserId",
+		a.alter_state AS "alterState",
+		a.alter_sign AS "alterSign",
+		a.record_state AS "recordState",
+		a.alterbefore_id AS "alterBeforeId",
+		a.completion_status AS "completionStatus",
+		a.common_flag AS "commonFlag",
+		a.office_id AS "officeId",
+		a.signature_status as "signatureStatus",
+		a.charge_criterion as "chargeCriterion",
+		a.other_details as "otherDetails",
+		a.contract_information as "contractInformation",
+		wcr.file_num as "fileNum",
+		wcr.file_num_tow as "fileNumTow",
+		a.describe_content AS "describeContent"
+		FROM work_contract_info a
+		<include refid="workContractInfoJoins"/>
+		LEFT JOIN work_contract_record wcr ON wcr.contract_info_id = a.id
+		WHERE a.contract_num = #{contractNum}
+		order by a.id
+		limit 1
+	</select>
 </mapper>

binární
src/main/webapp/dot/审核类项目批量导入模板.xlsx


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

@@ -459,6 +459,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:import">
+							<table:importExcel url="${ctx}/ruralProject/ruralCostProjectRecords/importB"></table:importExcel><!-- 导入按钮 -->
+						</shiro:hasPermission>
 						<shiro:hasPermission name="ruralProject:ruralCostProjectRecords:export">
 							<table:exportExcel url="${ctx}/ruralProject/ruralCostProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->
 						</shiro:hasPermission>