瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageElectronicSealDao.java
#	src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageElectronicSealController.java
#	src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml
user5 3 年之前
父節點
當前提交
8a5de28145
共有 19 個文件被更改,包括 1409 次插入132 次删除
  1. 849 0
      src/main/java/com/jeeplus/common/utils/excel/ImportExcelNew.java
  2. 35 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageAllDao.java
  3. 3 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageElectronicSealDao.java
  4. 1 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ImportBRuralProjectRecords.java
  5. 12 11
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectReportSignatureInfo.java
  6. 2 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  7. 44 45
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java
  8. 57 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  9. 13 13
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  10. 0 57
      src/main/java/com/jeeplus/modules/ruralprojectrecords/utils/AsposeUtil.java
  11. 1 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java
  12. 7 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageAllController.java
  13. 1 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  14. 39 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageElectronicSealController.java
  15. 1 0
      src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java
  16. 165 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml
  17. 176 3
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml
  18. 二進制
      src/main/webapp/dot/导入数据模板.xlsx
  19. 3 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

+ 849 - 0
src/main/java/com/jeeplus/common/utils/excel/ImportExcelNew.java

@@ -0,0 +1,849 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.common.utils.excel;
+
+import com.google.common.collect.Lists;
+import com.jeeplus.common.utils.Reflections;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.ruralprojectrecords.entity.ProjectReportSignatureInfo;
+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.sys.utils.DictUtils;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workjobgrade.entity.WorkJobGrade;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.text.NumberFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 导入Excel文件(支持“XLS”和“XLSX”格式)
+ * @author jeeplus
+ * @version 2013-03-10
+ */
+public class ImportExcelNew {
+
+	private static Logger log = LoggerFactory.getLogger(ImportExcelNew.class);
+
+	/**
+	 * 工作薄对象
+	 */
+	private Workbook wb;
+
+	/**
+	 * 工作表对象
+	 */
+	private Sheet sheet;
+
+	/**
+	 * 标题行号
+	 */
+	private int headerNum;
+
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportExcelNew(String fileName, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum);
+	}
+	public int sheetCirculation() {
+		int sheetCount = -1;
+		sheetCount = this.wb.getNumberOfSheets();
+		return sheetCount;
+	}
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportExcelNew(File file, int headerNum)
+			throws InvalidFormatException, IOException {
+		this(file, headerNum, 0);
+	}
+
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportExcelNew(String fileName, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		this(new File(fileName), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public ImportExcelNew(File file, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+//		this(file.getName(), new FileInputStream(file), headerNum, sheetIndex);
+	}
+
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public List ImportExcelNew(MultipartFile multipartFile, int headerNum, int sheetIndex)
+			throws InvalidFormatException, IOException {
+		return this.list(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex);
+	}
+
+
+	/**
+	 * 构造函数
+	 * @param headerNum 标题行号,数据行号=标题行号+1
+	 * @param sheetIndex 工作表编号
+	 * @throws InvalidFormatException
+	 * @throws IOException
+	 */
+	public List list(String fileName, InputStream is, int headerNum, int sheetIndex)
+			throws NullPointerException, IOException {
+		if (StringUtils.isBlank(fileName)){
+			throw new RuntimeException("导入文档为空!");
+		}else if(fileName.toLowerCase().endsWith("xls")){
+			this.wb = new HSSFWorkbook(is);
+        }else if(fileName.toLowerCase().endsWith("xlsx")){
+        	this.wb = new XSSFWorkbook(is);
+        }else{
+        	throw new RuntimeException("文档格式不正确!");
+        }
+		if (this.wb.getNumberOfSheets()<sheetIndex){
+			throw new RuntimeException("文档中没有工作表!");
+		}
+		this.sheet = this.wb.getSheetAt(sheetIndex);
+		this.headerNum = headerNum;
+
+		int firstRowNum = sheet.getFirstRowNum();
+		Row firstRow = sheet.getRow(firstRowNum);
+		int lastCellNum = firstRow.getLastCellNum();
+
+		List<ProjectReportSignatureInfo> list = new ArrayList<ProjectReportSignatureInfo>();
+
+		if(lastCellNum<3){
+			throw new RuntimeException("当前表格无数据!");
+		}else{
+			for(int i=2;i<lastCellNum;i++){ //第三列   0,1,2
+				//到每一列   获取对应行单元格数据
+                ProjectReportSignatureInfo projectReportSignatureInfo = new ProjectReportSignatureInfo();
+                if(null != sheet.getRow(0).getCell(i) && StringUtils.isNotBlank(sheet.getRow(0).getCell(i).toString())) {
+                    projectReportSignatureInfo.setProjectReportId(sheet.getRow(0).getCell(i).toString());
+                    if(sheet.getRow(1).getCell(i) != null) {
+						projectReportSignatureInfo.setSubmitFee(sheet.getRow(1).getCell(i).toString());
+					}
+					if(sheet.getRow(2).getCell(i) != null) {
+						projectReportSignatureInfo.setAuthorizeFee(sheet.getRow(2).getCell(i).toString());
+					}
+					if(sheet.getRow(3).getCell(i) != null) {
+						projectReportSignatureInfo.setConstructionUnitAssessmentFee(sheet.getRow(3).getCell(i).toString());
+					}
+					if(sheet.getRow(4).getCell(i) != null) {
+						projectReportSignatureInfo.setAuthorizeFeeDeductAssessmentFee(sheet.getRow(4).getCell(i).toString());
+					}
+					if(sheet.getRow(5).getCell(i) != null) {
+						projectReportSignatureInfo.setConstructionUnit(sheet.getRow(5).getCell(i).toString());
+					}
+					if(sheet.getRow(6).getCell(i) != null) {
+						projectReportSignatureInfo.setDescriptionOfDeduction(sheet.getRow(6).getCell(i).toString());
+					}
+					if(sheet.getRow(7).getCell(i) != null) {
+						projectReportSignatureInfo.setDescriptionOfExceedingTheContractAmount(sheet.getRow(7).getCell(i).toString());
+					}
+					if(sheet.getRow(8).getCell(i) != null) {
+						projectReportSignatureInfo.setDescriptionOfSpecialMatters(sheet.getRow(8).getCell(i).toString());
+					}
+					if(sheet.getRow(9).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(9).getCell(i))){
+							projectReportSignatureInfo.setStampDate(sheet.getRow(9).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(10).getCell(i) != null) {
+						projectReportSignatureInfo.setPrintQuantity(sheet.getRow(10).getCell(i).toString());
+					}
+					if(sheet.getRow(11).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(11).getCell(i))){
+							projectReportSignatureInfo.setReportPreparationDate(sheet.getRow(11).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(12).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(12).getCell(i))){
+							projectReportSignatureInfo.setAgreedStartDate(sheet.getRow(12).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(13).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(13).getCell(i))){
+							projectReportSignatureInfo.setAgreedEndDate(sheet.getRow(13).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(14).getCell(i) != null) {
+						projectReportSignatureInfo.setConsultant(sheet.getRow(14).getCell(i).toString());
+					}
+					if(sheet.getRow(15).getCell(i) != null) {
+						projectReportSignatureInfo.setSelfCalibrationOpinion(sheet.getRow(15).getCell(i).toString());
+					}
+					if(sheet.getRow(16).getCell(i) != null) {
+						projectReportSignatureInfo.setReviewOpinion(sheet.getRow(16).getCell(i).toString());
+					}
+					if(sheet.getRow(17).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(17).getCell(i))){
+							projectReportSignatureInfo.setReviewDate(sheet.getRow(17).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(18).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(18).getCell(i))){
+							projectReportSignatureInfo.setDateOfConsultationReport(sheet.getRow(18).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(19).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(19).getCell(i))){
+							projectReportSignatureInfo.setStartDateOfConsultingOperation(sheet.getRow(19).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(20).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(20).getCell(i))){
+							projectReportSignatureInfo.setEndDateOfConsultation(sheet.getRow(20).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(21).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(21).getCell(i))){
+							projectReportSignatureInfo.setStartAuditDate(sheet.getRow(21).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(22).getCell(i) != null) {
+						projectReportSignatureInfo.setProjectScaleContentScope(sheet.getRow(22).getCell(i).toString());
+					}
+					if(sheet.getRow(23).getCell(i) != null) {
+						projectReportSignatureInfo.setMainContentsOfProject(sheet.getRow(23).getCell(i).toString());
+					}
+					if(sheet.getRow(24).getCell(i) != null) {
+						projectReportSignatureInfo.setTotalContractPrice(sheet.getRow(24).getCell(i).toString());
+					}
+					if(sheet.getRow(25).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(25).getCell(i))){
+							projectReportSignatureInfo.setContractStartDate(sheet.getRow(25).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(26).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(26).getCell(i))){
+							projectReportSignatureInfo.setContractEndDate(sheet.getRow(26).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(27).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(27).getCell(i))){
+							projectReportSignatureInfo.setActualStartDate(sheet.getRow(27).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(28).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(28).getCell(i))){
+							projectReportSignatureInfo.setActualEndDate(sheet.getRow(28).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(29).getCell(i) != null) {
+						if(HSSFDateUtil.isCellDateFormatted(sheet.getRow(29).getCell(i))){
+							projectReportSignatureInfo.setCompletionAcceptanceDate(sheet.getRow(29).getCell(i).getDateCellValue());
+						}
+					}
+					if(sheet.getRow(30).getCell(i) != null) {
+						projectReportSignatureInfo.setDesignUnit(sheet.getRow(30).getCell(i).toString());
+					}
+					if(sheet.getRow(31).getCell(i) != null) {
+						projectReportSignatureInfo.setConstructionControlUnit(sheet.getRow(31).getCell(i).toString());
+					}
+					if(sheet.getRow(32).getCell(i) != null) {
+						projectReportSignatureInfo.setFollowUpAuditUnit(sheet.getRow(32).getCell(i).toString());
+					}
+					if(sheet.getRow(33).getCell(i) != null) {
+						projectReportSignatureInfo.setEngineeringDesignChangeOrder(sheet.getRow(33).getCell(i).toString());
+					}
+					if(sheet.getRow(34).getCell(i) != null) {
+						projectReportSignatureInfo.setConfirmationSheetOfQuantities(sheet.getRow(34).getCell(i).toString());
+					}
+					if(sheet.getRow(35).getCell(i) != null) {
+						projectReportSignatureInfo.setProjectVisa(sheet.getRow(35).getCell(i).toString());
+					}
+					if(sheet.getRow(36).getCell(i) != null) {
+						projectReportSignatureInfo.setQualityPriceConfirmationOfEngineeringMaterials(sheet.getRow(36).getCell(i).toString());
+					}
+					if(sheet.getRow(37).getCell(i) != null) {
+						projectReportSignatureInfo.setListmaterialsEquipmentByA(sheet.getRow(37).getCell(i).toString());
+					}
+					if(sheet.getRow(38).getCell(i) != null) {
+						projectReportSignatureInfo.setProjectRewardAndDamages(sheet.getRow(38).getCell(i).toString());
+					}
+					if(sheet.getRow(39).getCell(i) != null) {
+						projectReportSignatureInfo.setCharge(sheet.getRow(39).getCell(i).toString());
+					}
+					if(sheet.getRow(40).getCell(i) != null) {
+						projectReportSignatureInfo.setTaxes(sheet.getRow(40).getCell(i).toString());
+					}
+					if(sheet.getRow(41).getCell(i) != null) {
+						projectReportSignatureInfo.setDurationDifferenceCausesAndResponsibilities(sheet.getRow(41).getCell(i).toString());
+					}
+					if(sheet.getRow(42).getCell(i) != null) {
+						projectReportSignatureInfo.setQualityDifferenceCausesAndResponsibilities(sheet.getRow(42).getCell(i).toString());
+					}
+					if(sheet.getRow(43).getCell(i) != null) {
+						projectReportSignatureInfo.setOtherContentsAndExpenses(sheet.getRow(43).getCell(i).toString());
+					}
+					if(sheet.getRow(44).getCell(i) != null) {
+						projectReportSignatureInfo.setProjectCostConsultingContract(sheet.getRow(44).getCell(i).toString());
+					}
+					if(sheet.getRow(45).getCell(i) != null) {
+						projectReportSignatureInfo.setSettlementPricingBasisDocument(sheet.getRow(45).getCell(i).toString());
+					}
+					if(sheet.getRow(46).getCell(i) != null) {
+						projectReportSignatureInfo.setMaterialsAndEquipmentByA(sheet.getRow(46).getCell(i).toString());
+					}
+					if(sheet.getRow(47).getCell(i) != null) {
+						projectReportSignatureInfo.setaMaterialsByB(sheet.getRow(47).getCell(i).toString());
+					}
+					if(sheet.getRow(48).getCell(i) != null) {
+						projectReportSignatureInfo.setRewardAndPunishmentFees(sheet.getRow(48).getCell(i).toString());
+					}
+					if(sheet.getRow(49).getCell(i) != null) {
+						projectReportSignatureInfo.setWaterAndElectricityFeesHandleSituation(sheet.getRow(49).getCell(i).toString());
+					}
+					if(sheet.getRow(50).getCell(i) != null) {
+						projectReportSignatureInfo.setConstructionQualityWarrantyDeposit(sheet.getRow(50).getCell(i).toString());
+					}
+					if(sheet.getRow(51).getCell(i) != null) {
+						projectReportSignatureInfo.setTaxDifferenceCalculationAndProcessing(sheet.getRow(51).getCell(i).toString());
+					}
+
+                    list.add(projectReportSignatureInfo);
+                }else {
+                    return list;
+                }
+			}
+		}
+
+		log.debug("Initialize success.");
+		return list;
+	}
+
+    public ImportExcelNew() {
+    }
+
+    /**
+	 * 获取行对象
+	 * @param rownum
+	 * @return
+	 */
+	public Row getRow(int rownum){
+		return this.sheet.getRow(rownum);
+	}
+	/**
+	 * header内容
+	 * @param
+	 * @return
+	 */
+	public String getHeaderStr(){
+		return this.sheet.getSheetName();
+	}
+	/**
+	 * 获取数据行号
+	 * @return
+	 */
+	public int getDataRowNum(){
+		return headerNum+1;
+	}
+
+	/**
+	 * 获取最后一个数据行号
+	 * @return
+	 */
+	public int getLastDataRowNum(){
+		return this.sheet.getLastRowNum()+headerNum;
+	}
+
+	/**
+	 * 获取最后一个列号
+	 * @return
+	 */
+	public int getLastCellNum(){
+		return this.getRow(headerNum).getLastCellNum();
+	}
+
+	//实验
+
+	public int getRowNumNew(){
+		int firstRowNum = sheet.getFirstRowNum();
+		int lastRowNum = sheet.getLastRowNum();
+		Row firstRow = sheet.getRow(firstRowNum);
+		int firstCellNum = firstRow.getFirstCellNum();
+		int lastCellNum = firstRow.getLastCellNum();
+		System.out.println("第一行行号:" + firstRowNum);
+		System.out.println("最后一行行号:" + lastRowNum);
+		System.out.println("第一列列号:" + firstCellNum);
+		System.out.println("最后一列列号:" + lastCellNum);
+		return this.sheet.getFirstRowNum();
+	}
+
+
+	/**
+	 * 获取单元格值
+	 * @param row 获取的行
+	 * @param column 获取单元格列号
+	 * @return 单元格值
+	 */
+	public Object getCellValue(Row row, int column) {
+		Object val = "";
+		try {
+			Cell cell = row.getCell(column);
+
+			if (cell != null) {
+				if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
+					// val = cell.getNumericCellValue();
+					// 当excel 中的数据为数值或日期是需要特殊处理
+					if (HSSFDateUtil.isCellDateFormatted(cell)) {
+						double d = cell.getNumericCellValue();
+						Date date = HSSFDateUtil.getJavaDate(d);
+						SimpleDateFormat dformat = new SimpleDateFormat(
+								"yyyy-MM-dd");
+						val = dformat.format(date);
+					} else {
+						NumberFormat nf = NumberFormat.getInstance();
+						nf.setGroupingUsed(false);// true时的格式:1,234,567,890
+						val = nf.format(cell.getNumericCellValue());// 数值类型的数据为double,所以需要转换一下
+                        if(((String) val).contains(",")){
+                            val = nf.parse(val.toString()).doubleValue();
+                        }
+					}
+				} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
+					val = replaceBlank(cell.getStringCellValue());
+				} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
+					//val = cell.getCellFormula();
+					try {
+						val = String.valueOf(cell.getNumericCellValue());
+						if(String.valueOf(cell.getNumericCellValue()).indexOf("E")==-1){
+							val= String.valueOf(cell.getNumericCellValue());
+						}else {
+							NumberFormat formatter=NumberFormat.getNumberInstance();
+							formatter.setMinimumFractionDigits(4);
+							val=formatter.format(cell.getNumericCellValue());
+                            if(((String) val).contains(",")){
+                              val= val.toString().replaceAll(",","");
+                            }
+						}
+
+						 } catch (IllegalStateException e) {
+						val = String.valueOf(cell.getRichStringCellValue());
+						 }
+				} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
+					val = cell.getBooleanCellValue();
+				} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {
+					val = cell.getErrorCellValue();
+				}
+			}
+		} catch (Exception e) {
+			return val;
+		}
+		return val;
+	}
+
+	/**
+	 * 获取导入数据列表
+	 * @param cls 导入对象类型
+	 * @param groups 导入分组
+	 */
+	public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException{
+		List<Object[]> annotationList = Lists.newArrayList();
+		// Get annotation field
+		Field[] fs = cls.getDeclaredFields();
+		for (Field f : fs){
+			ExcelField ef = f.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, f});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, f});
+				}
+			}
+		}
+		// Get annotation method
+		Method[] ms = cls.getDeclaredMethods();
+		for (Method m : ms){
+			ExcelField ef = m.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, m});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, m});
+				}
+			}
+		}
+		// Field sorting
+		Collections.sort(annotationList, new Comparator<Object[]>() {
+			public int compare(Object[] o1, Object[] o2) {
+				return new Integer(((ExcelField)o1[0]).sort()).compareTo(
+						new Integer(((ExcelField)o2[0]).sort()));
+			};
+		});
+		//log.debug("Import column count:"+annotationList.size());
+		// Get excel data
+		List<E> dataList = Lists.newArrayList();
+		for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) {
+			E e = (E)cls.newInstance();
+			int column = 0;
+			Row row = this.getRow(i);
+			StringBuilder sb = new StringBuilder();
+			for (Object[] os : annotationList){
+                ExcelField ef = (ExcelField)os[0];
+                Object val = null;
+                if (ef.colNum()!=0) {
+                    val = this.getCellValue(row, ef.colNum());
+                }else {
+                    val = this.getCellValue(row, column++);
+                }
+				if (val != null){
+
+					// If is dict type, get dict value
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictValue(val.toString(), ef.dictType(), "");
+						//log.debug("Dictionary type value: ["+i+","+colunm+"] " + val);
+					}
+					if (StringUtils.isNotBlank(ef.mainDictType())){
+						val = DictUtils.getMainDictValue(val.toString(), ef.mainDictType(), "");
+						//log.debug("Dictionary type value: ["+i+","+colunm+"] " + val);
+					}
+					// Get param type and type cast
+					Class<?> valType = Class.class;
+					if (os[1] instanceof Field){
+						valType = ((Field)os[1]).getType();
+					}else if (os[1] instanceof Method){
+						Method method = ((Method)os[1]);
+						if ("get".equals(method.getName().substring(0, 3))){
+							valType = method.getReturnType();
+						}else if("set".equals(method.getName().substring(0, 3))){
+							valType = ((Method)os[1]).getParameterTypes()[0];
+						}
+					}
+					//log.debug("Import value type: ["+i+","+column+"] " + valType);
+					try {
+						//如果导入的java对象,需要在这里自己进行变换。
+						if (valType == String.class){
+							String s = String.valueOf(val.toString());
+							if(StringUtils.endsWith(s, ".0")){
+								val = StringUtils.substringBefore(s, ".0");
+							}else{
+								val = String.valueOf(val.toString());
+							}
+						}else if (valType == Integer.class){
+							val = Double.valueOf(val.toString()).intValue();
+						}else if (valType == Long.class){
+							val = Double.valueOf(val.toString()).longValue();
+						}else if (valType == Double.class){
+                            if(val instanceof String){
+                                val = ((String) val).replaceAll(",","");
+                            }
+							val = Double.valueOf(val.toString());
+						}else if (valType == Float.class){
+							val = Float.valueOf(val.toString());
+						}else if (valType == Date.class){
+							SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+							val=sdf.parse(val.toString());
+						}else if (valType == User.class){
+							val = UserUtils.getByUserName(val.toString());
+						}else if (valType == Office.class){
+							val = UserUtils.getByOfficeName(val.toString());
+						}else if (valType == Area.class){
+							val = UserUtils.getByAreaName(val.toString());
+						}else if (valType == WorkJobGrade.class){
+							val = UserUtils.getByWorkJobGradeName(val.toString());
+						}else{
+							if (ef.fieldType() != Class.class){
+								val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
+							}else{
+								val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(),
+										"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
+							}
+						}
+					} catch (Exception ex) {
+						log.info("Get cell value ["+i+","+column+"] error: " + ex.toString());
+						val = null;
+					}
+					// set entity value
+					if (os[1] instanceof Field){
+						Reflections.invokeSetter(e, ((Field)os[1]).getName(), val);
+					}else if (os[1] instanceof Method){
+						String mthodName = ((Method)os[1]).getName();
+						if ("get".equals(mthodName.substring(0, 3))){
+							mthodName = "set"+StringUtils.substringAfter(mthodName, "get");
+						}
+						try {
+                            Reflections.invokeMethod(e, mthodName, new Class[]{valType}, new Object[]{val});
+                        }catch (Exception e3){
+						    log.error("解析Excel失败。",e3);
+                        }
+					}
+				}
+				sb.append(val+", ");
+			}
+			dataList.add(e);
+			log.debug("Read success: ["+i+"] "+sb.toString());
+		}
+		return dataList;
+	}
+
+	/**
+	 * 客户的报表数据
+	 * @return
+	 * @throws InstantiationException
+	 * @throws IllegalAccessException
+	 *//*
+	public <E> Map<Object,Object> getClientDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException{
+		HashMap<Object, Object> map = Maps.newHashMap();
+		List<Object[]> annotationList = Lists.newArrayList();
+		// Get annotation field
+		Field[] fs = cls.getDeclaredFields();
+		for (Field f : fs){
+			ExcelField ef = f.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, f});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, f});
+				}
+			}
+		}
+		// Get annotation method
+		Method[] ms = cls.getDeclaredMethods();
+		for (Method m : ms){
+			ExcelField ef = m.getAnnotation(ExcelField.class);
+			if (ef != null && (ef.type()==0 || ef.type()==2)){
+				if (groups!=null && groups.length>0){
+					boolean inGroup = false;
+					for (int g : groups){
+						if (inGroup){
+							break;
+						}
+						for (int efg : ef.groups()){
+							if (g == efg){
+								inGroup = true;
+								annotationList.add(new Object[]{ef, m});
+								break;
+							}
+						}
+					}
+				}else{
+					annotationList.add(new Object[]{ef, m});
+				}
+			}
+		}
+		// Field sorting
+		Collections.sort(annotationList, new Comparator<Object[]>() {
+			public int compare(Object[] o1, Object[] o2) {
+				return new Integer(((ExcelField)o1[0]).sort()).compareTo(
+						new Integer(((ExcelField)o2[0]).sort()));
+			};
+		});
+		//log.debug("Import column count:"+annotationList.size());
+		// Get excel data
+		List<E> dataList = Lists.newArrayList();
+		List<String> errList = Lists.newArrayList();
+		for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) {
+			E e = (E)cls.newInstance();
+			int column = 0;
+			Row row = this.getRow(i);
+			StringBuilder sb = new StringBuilder();
+			String errMsg = "";
+			for (Object[] os : annotationList){
+				Object val = this.getCellValue(row, column++);
+				if (val != null){
+					ExcelField ef = (ExcelField)os[0];
+					// If is dict type, get dict value
+					if (StringUtils.isNotBlank(ef.dictType())){
+						val = DictUtils.getDictValue(val.toString(), ef.dictType(), "");
+						//log.debug("Dictionary type value: ["+i+","+colunm+"] " + val);
+					}
+					// Get param type and type cast
+					Class<?> valType = Class.class;
+					if (os[1] instanceof Field){
+						valType = ((Field)os[1]).getType();
+					}else if (os[1] instanceof Method){
+						Method method = ((Method)os[1]);
+						if ("get".equals(method.getName().substring(0, 3))){
+							valType = method.getReturnType();
+						}else if("set".equals(method.getName().substring(0, 3))){
+							valType = ((Method)os[1]).getParameterTypes()[0];
+						}
+					}
+					//log.debug("Import value type: ["+i+","+column+"] " + valType);
+					try {
+						//如果导入的java对象,需要在这里自己进行变换。
+						if (valType == String.class){
+							String s = String.valueOf(val.toString());
+							if(StringUtils.endsWith(s, ".0")){
+								val = StringUtils.substringBefore(s, ".0");
+							}else{
+								val = String.valueOf(val.toString());
+							}
+						}else if (valType == Integer.class){
+							val = Double.valueOf(val.toString()).intValue();
+						}else if (valType == Long.class){
+							val = Double.valueOf(val.toString()).longValue();
+						}else if (valType == Double.class){
+							val = Double.valueOf(val.toString());
+						}else if (valType == Float.class){
+							val = Float.valueOf(val.toString());
+						}else if (valType == Date.class){
+							SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
+							val=sdf.parse(val.toString());
+						}else if (valType == User.class){
+							val = UserUtils.getByUserName(val.toString());
+						}else if (valType == Office.class){
+							val = UserUtils.getByOfficeName(val.toString());
+						}else if (valType == Area.class){
+							val = UserUtils.getByAreaName(val.toString());
+						}else{
+							if (ef.fieldType() != Class.class){
+								val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString());
+							}else{
+								val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(),
+										"fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString());
+							}
+						}
+					} catch (Exception ex) {
+						log.info("Get cell value ["+i+","+column+"] error: " + ex.toString());
+						val = null;
+					}
+					if(column == 1 || column == 2 || column == 3
+							|| column == 4 || column == 5 || column == 6 || column == 7
+							|| column == 8 || column == 9 || column == 10){
+						if(val == null || val == ""){
+							errMsg += "第+i+条,第"+column+"列数据不能为空";
+						}
+					}
+					// set entity value
+					if (os[1] instanceof Field){
+						if(Strings.isNullOrEmpty(errMsg)){
+							Reflections.invokeSetter(e, ((Field)os[1]).getName(), val);
+						}
+
+					}else if (os[1] instanceof Method){
+						String mthodName = ((Method)os[1]).getName();
+						if ("get".equals(mthodName.substring(0, 3))){
+							mthodName = "set"+StringUtils.substringAfter(mthodName, "get");
+						}
+						if(Strings.isNullOrEmpty(errMsg)){
+							Reflections.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val});
+						}
+					}
+				}
+				sb.append(val+", ");
+			}
+			if(!"".equals(errMsg)){
+				errList.add(errMsg);
+			}else{
+				dataList.add(e);
+			}
+			log.debug("Read success: ["+i+"] "+sb.toString());
+		}
+		map.put("dataList",dataList);
+		map.put("errList",errList);
+		return map;
+	}*/
+
+//	/**
+//	 * 导入测试
+//	 */
+//	public static void main(String[] args) throws Throwable {
+//
+//		ImportExcel ei = new ImportExcel("target/export.xlsx", 1);
+//
+//		for (int i = ei.getDataRowNum(); i < ei.getLastDataRowNum(); i++) {
+//			Row row = ei.getRow(i);
+//			for (int j = 0; j < ei.getLastCellNum(); j++) {
+//				Object val = ei.getCellValue(row, j);
+//				System.out.print(val+", ");
+//			}
+//			System.out.print("\n");
+//		}
+//
+//	}
+    public static String replaceBlank(String str) {
+        String dest = "";
+        if (str!=null) {
+            Pattern p = Pattern.compile("\t|\r|\n");
+            Matcher m = p.matcher(str);
+            dest = m.replaceAll("");
+        }
+        return dest;
+    }
+
+ /*   public static void main(String[] args) {
+        replaceBlank("桩基框架-剪力墙结构\n" +
+                "(主体部分)空间钢桁架结构(屋顶部分)");
+    }*/
+}

+ 35 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageAllDao.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.ruralprojectrecords.dao;
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectAccessory.entity.ProjectTemplateInfo;
 import com.jeeplus.modules.ruralprojectrecords.entity.DownloadProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.DownloadProjectReporteds;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
@@ -108,4 +109,38 @@ public interface RuralProjectMessageAllDao extends CrudDao<RuralProjectRecords>
      * @return
      */
     String getListMoney(RuralProjectRecords ruralProjectRecords);
+
+    /**
+     * 根据项目名称查询项目存在数量
+     * @param projectNameList
+     * @return
+     */
+    Integer getProjectByNameList(@Param("projectNameList") List<String> projectNameList);
+
+    /*
+    * 根据报告号查项目编号以此到施工方
+    * */
+    String getIdByReportNumber(String reportNumber);
+
+    /*
+    * 根据报告号查有无
+    * */
+//    String selectByReportNumber();
+
+    /*
+    * 更新records
+    * */
+    void updataReords(RuralProjectRecords ruralProjectRecords);
+
+    //查合同id
+    String getHeTongId(String proId);
+    //依此改合同金额
+    void updateContractPrice(RuralProjectRecords ruralProjectRecords);
+    //查施工单位id
+    String selectIdBySGDW(RuralProjectRecords ruralProjectRecords);
+    //条件查询联系人,补全
+    String selectlxr(String infoid);
+    //添加
+    void insertSGDW(RuralProjectRecords ruralProjectRecords);
+
 }

+ 3 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectMessageElectronicSealDao.java

@@ -66,4 +66,7 @@ public interface RuralProjectMessageElectronicSealDao extends CrudDao<ProjectRep
      * @return
      */
     Integer updateReportSignature(ProjectReportSignature projectApprovalSignature);
+    String getAchivesIdByName(String name);
+    String getId(String staffId);
+    String getProjectReportId(String projectReportId);
 }

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

@@ -80,7 +80,7 @@ public class ImportBRuralProjectRecords extends ActEntity<ImportBRuralProjectRec
 		return leaderName;
 	}
 	@ExcelField(title="项目负责人", align=2, sort=8)
-	public String getProjectMasterName() {
+	public String 	getProjectMasterName() {
 		return projectMasterName;
 	}
 	@ExcelField(title="工程类型名称", align=2, sort=9)

+ 12 - 11
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/ProjectReportSignatureInfo.java

@@ -7,6 +7,7 @@ import com.jeeplus.common.persistence.ActEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
 
 import javax.net.ssl.SSLContext;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -42,8 +43,8 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 	private String projectScaleContentScope;//工程规模内容和范围
 	private String mainContentsOfProject;//工程主要内容
 	private String totalContractPrice; //合同总价
-	private Date ContractStartDate; //合同开工日期
-	private Date ContractEndDate;   //合同竣工日期
+	private Date contractStartDate; //合同开工日期
+	private Date contractEndDate;   //合同竣工日期
 	private Date actualStartDate;   //实际开工日期
 	private Date actualEndDate;     //实际竣工日期
 	private Date completionAcceptanceDate;//竣工验收日期
@@ -64,7 +65,7 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 	private String projectCostConsultingContract;//工程造价咨询合同
 	private String settlementPricingBasisDocument;//结算计价依据文件
 	private String materialsAndEquipmentByA;//甲供材及设备情况
-	private String AMaterialsByB;    //甲控乙供材情况
+	private String aMaterialsByB;    //甲控乙供材情况
 	private String rewardAndPunishmentFees;//奖惩费情况
 	private String waterAndElectricityFeesHandleSituation;//水电费处理情况
 	private String constructionQualityWarrantyDeposit;//工程质量保修金处理情况
@@ -271,19 +272,19 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 	}
 
 	public Date getContractStartDate() {
-		return ContractStartDate;
+		return contractStartDate;
 	}
 
 	public void setContractStartDate(Date contractStartDate) {
-		ContractStartDate = contractStartDate;
+		this.contractStartDate = contractStartDate;
 	}
 
 	public Date getContractEndDate() {
-		return ContractEndDate;
+		return contractEndDate;
 	}
 
 	public void setContractEndDate(Date contractEndDate) {
-		ContractEndDate = contractEndDate;
+		this.contractEndDate = contractEndDate;
 	}
 
 	public Date getActualStartDate() {
@@ -446,12 +447,12 @@ public class ProjectReportSignatureInfo extends ActEntity<ProjectReportSignature
 		this.materialsAndEquipmentByA = materialsAndEquipmentByA;
 	}
 
-	public String getAMaterialsByB() {
-		return AMaterialsByB;
+	public String getaMaterialsByB() {
+		return aMaterialsByB;
 	}
 
-	public void setAMaterialsByB(String AMaterialsByB) {
-		this.AMaterialsByB = AMaterialsByB;
+	public void setaMaterialsByB(String aMaterialsByB) {
+		this.aMaterialsByB = aMaterialsByB;
 	}
 
 	public String getRewardAndPunishmentFees() {

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

@@ -110,6 +110,8 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String flagArchive;  //归档员判定
 	private String projectProperties;//投资性质
 
+
+
 	@NotNull(message = "委托方联系人不能为空")
 	private List<WorkClientLinkman> workClientLinkmanList;		// 委托方联系人
 	private List<WorkClientLinkman> workConstructionLinkmanList;		// 施工方及联系人

+ 44 - 45
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageAllService.java

@@ -1,29 +1,39 @@
 package com.jeeplus.modules.ruralprojectrecords.service;
 
+import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.Collections3;
-import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.projectAccessory.dao.ProjectTemplateDao;
+import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingBatchDao;
 import com.jeeplus.modules.projectFilingBatch.dao.ProjectFilingbatchRelationDao;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingbatchRelation;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
+import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
-import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
+import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageAllDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.*;
+import com.jeeplus.modules.serialnum.service.SerialNumTplService;
+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.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
 import com.jeeplus.modules.workclientinfo.dao.WorkClientLinkmanDao;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workclientinfo.service.WorkClientInfoService;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
-import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
 import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import jersey.repackaged.com.google.common.collect.Lists;
@@ -46,6 +56,14 @@ import java.util.*;
 @Service
 @Transactional(readOnly = true)
 public class RuralProjectMessageAllService extends CrudService<RuralProjectMessageAllDao, RuralProjectRecords> {
+    /**
+     * 阿里云文件服务器前缀
+     */
+    private final static String aliyunUrl = Global.getConfig("aliyunUrl");
+    /**
+     * 百度云文件服务器前缀
+     */
+    private final static String bosUrl = Global.getConfig("bosUrl");
     @Autowired
     private RuralWorkProjectUserDao workProjectUserDao;
     @Autowired
@@ -66,6 +84,28 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
     private WorkProjectNotifyService workProjectNotifyService;
     @Autowired
     private OfficeService officeService;
+    @Autowired
+    private AreaService areaService;
+    @Autowired
+    private ProjectEngineeringService engineeringService;
+    @Autowired
+    private UserDao userDao;
+    @Autowired
+    private SerialNumTplService serialNumTplService;
+    @Autowired
+    private ProjectTemplateDao projectTemplateDao;
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private ProjectReportDataDao projectReportDataDao;
+    @Autowired
+    private ProjectReportNumService projectReportNumService;
+    @Autowired
+    private ProjectcontentinfoDao projectcontentinfoDao;
+    @Autowired
+    private RuralProjectClientLinkmanDao clientLinkmanDao;
+    @Autowired
+    private RuralProjectMessageAllDao ruralProjectMessageAllDao;
 
     public RuralProjectRecords get(String id) {
         return super.get(id);
@@ -73,7 +113,7 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
     public List<RuralProjectRecords> findList(RuralProjectRecords projectRecords) {
         return super.findList(projectRecords);
     }
-
+    private static byte[] SYN_BYTE = new byte[0];
     public Page<RuralProjectRecords> findPage(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords) {
         //查询超期时间天数
         List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_count");
@@ -1067,47 +1107,6 @@ public class RuralProjectMessageAllService extends CrudService<RuralProjectMessa
     }
 
 
-    public Page<RuralProjectRecords> findSignaturePage(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords) {
-        //设置数据权限
-        if(!UserUtils.getUser().isAdmin()) {
-            String dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORD_LIST.getValue());
-            projectRecords.getSqlMap().put("dsf", dataScopeSql);
-        }
-        //查询超期时间天数
-        List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_count");
-        if(adventCount.size()>0){
-            //获取超期时间天数转int
-            Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
-            projectRecords.setEndingCount(endingCount);
-        }
-        if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
-            //查询该选择节点下所有的部门Id
-            List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
-            officeIdList.add(projectRecords.getOffice().getId());
-            projectRecords.setOfficeIdList(officeIdList);
-        }
-
-        int count = dao.queryCount(projectRecords);
-        page.setCount(count);
-        page.setCountFlag(false);
-        projectRecords.setPage(page);
-        List<RuralProjectRecords> recordsList = findList(projectRecords);
-
 
-        //查询负责人信息
-        for (RuralProjectRecords records : recordsList) {
-            if(null != records.getRecordState() && 0 == records.getProjectReportRecordStatus()){
-                records.setProjectReportRecordStatus(records.getRecordState());
-            }
-            this.queryContractInfos(records);
-            //获取项目负责人
-            List<User> users = workProjectUserDao.getProjectprincipalList(records.getId());
-            records.setProjectLeaders(users);
-            records.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
-            records.setLeaderIds(Collections3.extractToString(users, "id", ","));
 
-        }
-        page.setList(recordsList);
-        return page;
-    }
 }

+ 57 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -1506,4 +1506,61 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         return format;
     }
 
+    /**
+     * B类项目批量导入
+     * @param list
+     * @return
+     */
+    @Transactional(readOnly = false)
+    public String disposeImportBRuralProjectRecords(List<ProjectReportSignatureInfo> list){
+        Set<String> projectReportIdSet = new HashSet<>();
+        for (ProjectReportSignatureInfo importInfo : list){
+            //将报告号放入set中
+            projectReportIdSet.add(importInfo.getProjectReportId());
+        }
+        //将set转换为list
+        List<String> projectReportIdList = new ArrayList<>(projectReportIdSet);
+        //判断报告号list长度和导入数据的list长度是否一样,不一样则说明导入数据中项目名存在重复数据
+        if(projectReportIdList.size() != list.size()){
+            return "数据中存在重复报告号";
+        }else{
+            //根据项目名称集合查询项目信息是否存在
+            for(String projectReportId:projectReportIdList) {
+                ProjectReportSignatureInfo info = dao.get(projectReportId);
+                String number = dao.getProjectReportId(projectReportId);
+                if(info != null){
+                    return "数据中已存在重复报告名";
+                }else if(number == null){
+                    return "此报告号不存在";
+                }
+
+            }
+        }
+
+        //对咨询员的一级造价师进行查验
+        Set<String> consultantSet = new HashSet<>();
+        for(ProjectReportSignatureInfo projectReportSignatureInfo:list){
+            consultantSet.add(projectReportSignatureInfo.getConsultant());
+        }
+        Iterator<String> it = consultantSet.iterator();
+        while(it.hasNext()){
+            String staffId = dao.getAchivesIdByName(it.next());
+            String isId = dao.getId(staffId);
+            if(staffId == null){
+                return "未查找到该咨询员";
+            }else if(isId == null){
+                return it.next()+"该咨询员未持有一级造价师证!";
+            }
+        }
+
+
+        //对 (经过判断的) 数据进行新增处理
+        for (ProjectReportSignatureInfo projectReportSignatureInfo: list) {
+            dao.insert(projectReportSignatureInfo);
+
+        }
+        return "导入B类项目成功";
+    }
+
+
 }

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

@@ -2400,21 +2400,21 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 					&& StringUtils.isBlank(info.getWhetherReportNumber())
 					&& StringUtils.isBlank(info.getSubmitScaleStr())
 					&& StringUtils.isBlank(info.getAttachmentProjectSort())){
-				iterator.remove();
+				iterator.remove();   //第一步  项目信息就均为空了,这行数据就不用在往下执行了
 			}
 		}
 		for (ImportBRuralProjectRecords importBRuralProjectRecords : list){
 			//将项目名放入set中
 			projectNameSet.add(importBRuralProjectRecords.getProjectName());
 		}
-		//将set转换为list
+		//将set转换为list    循环放的项目名  组
 		List<String> projectNameList = new ArrayList<>(projectNameSet);
 		//判断项目名list长度和导入数据的list长度是否一样,不一样则说明导入数据中项目名存在重复数据
 		if(projectNameList.size() != list.size()){
 			return "数据中存在重复项目名";
 		}else{
 			//根据项目名称集合查询项目信息是否存在
-			Integer projectByNameList = dao.getProjectByNameList(projectNameList);
+				Integer projectByNameList = dao.getProjectByNameList(projectNameList);
 			if(projectByNameList>0){
 				return "数据中存在重复项目名";
 			}
@@ -2466,7 +2466,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				//项目所在地处理
 				List<String> areaNameList = Arrays.asList(importBRuralProjectRecords.getAreaName().split("-"));
 				if(areaNameList.size() == 2){
-					//根据名称查询省级单位信息
+					//根据名称查询省级单位信息  父节点信息
 					Area province = areaService.getByNameAndParentId(areaNameList.get(0),"1");
 					if(null == province ){
 						return "项目所在地填写错误,查询不到省级信息";
@@ -2504,7 +2504,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				}
 
 				//判断投资性质
-				List<MainDictDetail> projectPropertiesList = DictUtils.getMainDictList("project_properties");
+				List<MainDictDetail> projectPropertiesList = DictUtils.getMainDictList("project_properties");  //获取投资性质?
 				for (MainDictDetail projectProperties: projectPropertiesList) {
 					if(projectProperties.getLabel().equals(importBRuralProjectRecords.getProjectProperties())){
 						projectRecords.setProjectProperties(projectProperties.getValue());
@@ -2527,13 +2527,13 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 					return "项目类别填写有误";
 				}
 				if("5".equals(projectRecords.getAttachmentProjectSort()) || "6".equals(projectRecords.getAttachmentProjectSort())){
-					projectRecords.setReportedState("10");
+					projectRecords.setReportedState("10");   //上报状态
 				}else{
 					projectRecords.setReportedState(null);
 				}
 
 				//判断工程类型
-				List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());
+				List<ProjectEngineeringInfo> engineeringInfos=engineeringService.findList(new ProjectEngineeringInfo());  //这能有数据?
 				for (ProjectEngineeringInfo engineeringInfo: engineeringInfos) {
 					if(engineeringInfo.getEngineeringName().equals(importBRuralProjectRecords.getEngineeringName())){
 						//判定当前的数据是否存在子集,如果存在子集则不允许添加
@@ -2620,7 +2620,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				projectRecords.setSubmitScale(submitScale);
 
 				//处理项目责任人
-				User userLeader = UserUtils.getByUserName(importBRuralProjectRecords.getLeaderName());
+				User userLeader = UserUtils.getByUserName(importBRuralProjectRecords.getLeaderName());  //根据姓名转换为ID
 				if(null == userLeader){
 					return "无法查询到项目责任人";
 				}
@@ -2685,7 +2685,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			}
 		}
 
-		//对数据进行新增处理
+		//对 (经过判断的) 数据进行新增处理
 		for (RuralProjectRecords projectRecords: projectRecordsList) {
 			//添加创建人信息
 			projectRecords.preInsert();
@@ -2700,8 +2700,8 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 
 			//项目送审之后处理项目合同文件信息
 			//查询咨询合同附件类型id
-			ProjectTemplateInfo projectTemplateInfo = projectTemplateDao.getProjectTemplateInfoByName("咨询合同");
-			//删除该项目咨询合同类型中老合同对应的附件信息
+			ProjectTemplateInfo projectTemplateInfo = projectTemplateDao.getProjectTemplateInfoByName("咨询合同");  //根据名称查询信息    11
+			//删除该项目咨询合同类型中老合同对应的附件信息   是不是就是合同附件表
 			WorkClientAttachment attchment = new WorkClientAttachment();
 			attchment.setAttachmentId(projectTemplateInfo.getId());
 			attchment.setProjectId(projectRecords.getId());
@@ -2738,7 +2738,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 				return "是否生成报告填写不正确";
 			}
 
-			//添加项目工作内容表
+			//添加项目工作内容表      电子签章用不上不管
 			Projectcontentinfo projectcontentinfo = null;
 			if(StringUtils.isNotBlank(projectRecords.getId())){
 				projectcontentinfo = projectcontentinfoDao.getByProjectId(projectRecords.getId());
@@ -2753,7 +2753,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 			projectcontentinfo.setParentIds("0,");
 			projectcontentinfo.setParent(new Projectcontentinfo("0"));
 			projectcontentinfo.setName(projectRecords.getProjectId());
-			if (StringUtils.isNotBlank(projectcontentinfo.getId())){
+			if (StringUtils.isNotBlank(projectcontentinfo.getId())){    //id有,就更新,没有就插入(新增)
 				projectcontentinfoDao.update(projectcontentinfo);
 			}else{
 				projectcontentinfo.preInsert();

+ 0 - 57
src/main/java/com/jeeplus/modules/ruralprojectrecords/utils/AsposeUtil.java

@@ -1,57 +0,0 @@
-package com.jeeplus.modules.ruralprojectrecords.utils;
-
-
-import com.aspose.words.Document;
-import com.aspose.words.License;
-import com.aspose.words.SaveFormat;
-
-import java.io.*;
-
-/**
- * @author: 大猫
- * @create: 2021-11-01 09:43
- * description : Aspose工具类
- **/
-
-public class AsposeUtil {
-
-    /**
-     * 加载license 用于破解 不生成水印
-     *
-     * @author LCheng
-     * @date 2020/12/25 13:51
-     */
-    private static void getLicense() {
-        try {
-            InputStream is = AsposeUtil.class.getClassLoader().getResourceAsStream("License.xml");
-            License license = new License();
-            license.setLicense(is);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * word转pdf
-     *
-     * @param wordPath word文件保存的路径
-     * @param pdfPath  转换后pdf文件保存的路径
-     * @author LCheng
-     * @date 2020/12/25 13:51
-     */
-    public static void wordToPdf(String wordPath, String pdfPath) {
-        getLicense();
-        File file = new File(pdfPath);
-        try {
-            FileOutputStream os = new FileOutputStream(file);
-            Document doc = new Document(wordPath);
-            doc.save(os, SaveFormat.PDF);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void main(String[] args) {
-        wordToPdf("E:/桌面/红、绿、蓝——苏兴造字2021【】(1).doc","E:/桌面/test.pdf");
-    }
-}

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

@@ -1010,7 +1010,7 @@ public class RuralCostProjectRecordsController extends BaseController {
 			RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
 			projectRecordsService.disposeData(ruralProjectcontentinfo);
 			model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
-			model.addAttribute("projectRecords", projectRecords);
+		 	model.addAttribute("projectRecords", projectRecords);
 		}else {
 			return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
 		}

+ 7 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageAllController.java

@@ -6,7 +6,9 @@ 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.historical.entity.HistoricalData;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
@@ -37,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
@@ -604,4 +607,8 @@ public class RuralProjectMessageAllController extends BaseController {
         }
         return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
     }
+
+
+
+
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -63,6 +63,7 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;

+ 39 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageElectronicSealController.java

@@ -5,6 +5,9 @@ import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.FreemarkerUtil;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.utils.excel.ImportExcelNew;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
@@ -39,6 +42,8 @@ import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -126,7 +131,7 @@ public class RuralProjectMessageElectronicSealController extends BaseController
         //添加查询类型list
         projectRecords.setTypeList(typeList);
         projectRecords.setSubmitMoney("1");
-        Page<RuralProjectRecords> page = ruralProjectMessageAllService.findSignaturePage(new Page<RuralProjectRecords>(request, response), projectRecords);
+        Page<RuralProjectRecords> page = ruralProjectMessageAllService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
         model.addAttribute("page", page);
         if(null != projectRecords.getWorkContractInfo()){
             model.addAttribute("workContractInfoName", projectRecords.getWorkContractInfo().getName());
@@ -656,5 +661,38 @@ public class RuralProjectMessageElectronicSealController extends BaseController
 
     }
 
+    /**
+     * 导入造价审核B类项目数据
+     */
+    @RequiresPermissions("ruralProject:ruralProjectMessageAll:importB")
+    @RequestMapping(value = "importB", method=RequestMethod.POST)
+    public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        try {
+            ImportExcelNew importExcelNew = new ImportExcelNew();
+            List<ProjectReportSignatureInfo> list = importExcelNew.ImportExcelNew(file,1,0);  //只处理file 1不要也可以,0为sheet编号
+
+            //对数据进行处理
+            String resultStr = ruralProjectMessageElectronicSealService.disposeImportBRuralProjectRecords(list);
+            addMessage(redirectAttributes, resultStr);
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导入B类项目失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+ Global.getAdminPath()+"/ruralProject/electronicSeal/?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/electronicSeal/?repage";
+    }
+
 
 }

+ 1 - 0
src/main/java/com/jeeplus/modules/workinvoice/service/WorkInvoiceService.java

@@ -241,6 +241,7 @@ public class WorkInvoiceService extends CrudService<WorkInvoiceDao, WorkInvoice>
 	public List<WorkInvoice> findMapList(WorkInvoice workInvoice) {
 		return dao.findMapList(workInvoice);
 	}
+
 	public Page<WorkInvoice> findPage(Page<WorkInvoice> page, WorkInvoice workInvoice) {
 		workInvoice.getSqlMap().put("dsf", dataScopeFilter(workInvoice.getCurrentUser(), "o", "u","s", MenuStatusEnum.WORK_INVOICE.getValue()));
 		if(StringUtils.isNotBlank(workInvoice.getOfficeId())){

+ 165 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -2,6 +2,114 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageAllDao">
 
+	<insert id="insert">
+		INSERT INTO rural_project_records(
+			id,
+			create_by,
+			create_date,
+			update_by,
+			update_date,
+			del_flag,
+			contract_id,
+			project_id,
+			project_name,
+			scale_type,
+			scale_unit,
+			scale_quantity,
+			area_id,
+			project_site,
+			project_desc,
+			remarks,
+			status,
+			company_id,
+			office_id,
+			alter_process_id,
+			province,
+			city,
+			area_name,
+			project_structure,
+			on_ground_num,
+			under_ground_num,
+			building_scale,
+			measuring_unit,
+			project_use,
+			install_fees,
+			building_fees,
+			building_percent,
+			install_percent,
+			unit_fees,
+			building_unit_fees,
+			install_unit_fees,
+			total_fees,
+			project_type,
+			start_date,
+			ending_date,
+			estimate_total_fees,
+			construction_unit,
+			construction_linkman,
+			attachment_project_sort,
+			project_master_id,
+			submit_money,
+			engineering_type,
+			project_properties,
+			submit_scale,
+			emergency_project,
+			reported_state
+		) VALUES (
+					 #{id},
+					 #{createBy.id},
+					 #{createDate},
+					 #{updateBy.id},
+					 #{updateDate},
+					 #{delFlag},
+					 #{workContractInfo.id},
+					 #{projectId},
+					 #{projectName},
+					 #{scaleType},
+					 #{scaleUnit},
+					 #{scaleQuantity},
+					 #{area.id},
+					 #{projectSite},
+					 #{projectDesc},
+					 #{remarks},
+					 #{projectStatus},
+					 #{company.id},
+					 #{office.id},
+					 #{alterProcessId},
+					 #{province},
+					 #{city},
+					 #{county},
+					 #{projectStructure},
+					 #{onGroundNum},
+					 #{underGroundNum},
+					 #{buildingScale},
+					 #{measuringUnit},
+					 #{projectUse},
+					 #{installFees},
+					 #{buildingFees},
+					 #{buildingPercent},
+					 #{installPercent},
+					 #{unitFees},
+					 #{buildingUnitFees},
+					 #{installUnitFees},
+					 #{totalFees},
+					 #{projectType},
+					 #{startDate},
+					 #{endingDate},
+					 #{estimateTotalFees},
+					 #{constructionUnit},
+					 #{constructionLinkman},
+					 #{attachmentProjectSort},
+					 #{projectMasterId},
+					 #{submitMoney},
+					 #{engineeringType},
+					 #{projectProperties},
+					 #{submitScale},
+					 #{emergencyProject},
+					 #{reportedState}
+				 )
+	</insert>
+
 	<sql id="projectRecordsColumns">
 		distinct(a.id) AS "id",
 		a.create_by AS "createBy.id",
@@ -1290,4 +1398,61 @@ END) as projectScale*/
 			</if>
 		</where>
 	</select>
+
+	<select id="getProjectByNameList" resultType="java.lang.Integer">
+		select count(1) from project_report_data a
+		<where>
+			<if test="projectNameList!=null and projectNameList.size!=0">
+				and a.number in
+				<foreach collection="projectNameList" item="projectName" separator="," open="(" close=")">
+					#{projectName}
+				</foreach>
+			</if>
+		</where>
+	</select>
+
+	<select id="getIdByReportNumber" resultType="String" parameterType="String">
+		select a.id
+		from rural_project_records a,project_report_data b
+		where a.id=b.project_id
+		and b.number=#{reportNumber}
+	</select>
+
+	<update id="updataReords">
+		update rural_project_records set
+		start_date=#{startDate},
+		ending_date=#{endingDate} where id=#{projectId}
+	</update>
+
+	<select id="getHeTongId" resultType="String" parameterType="String">
+		select contract_id from rural_project_records
+		where id=#{proId}
+	</select>
+
+	<update id="updateContractPrice">
+		update work_contract_info set contract_price=#{workContractInfo.contractPrice} where id=#{workContractInfo.id}
+	</update>
+
+	<select id="selectIdBySGDW" resultType="String">
+		select id from work_client_info where name=#{constructionUnit}
+	</select>
+
+	<select id="selectlxr" resultType="String">
+		select id from work_client_linkman where client_id=#{infoid} order by create_date desc limit 1
+	</select>
+
+	<insert id="insertSGDW">
+		insert into project_client_linkman(
+		    project_id,
+		    linkman_id,
+		    client_id,
+		    is_entrust)values (
+		    #{projectId},
+		    #{constructionLinkman},
+		    #{constructionUnit},
+		    0
+			)
+	</insert>
+
+
 </mapper>

+ 176 - 3
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml

@@ -3,17 +3,190 @@
 <mapper namespace="com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao">
 
 	<sql id="projectReportRecordColumns">
-
+			a.project_report_id,
+			a.submit_fee as "submit_fee",
+			a.authorize_fee as "authorize_fee",
+			a.construction_unit_assessment_fee as "construction_unit_assessment_fee",
+			a.authorize_fee_deduct_assessment_fee as "authorize_fee_deduct_assessment_fee",
+			a.construction_unit as "construction_unit",
+			a.description_of_deduction as "description_of_deduction",
+			a.description_of_exceeding_the_contract_amount as "description_of_exceeding_the_contract_amount",
+			a.description_of_special_matters as "description_of_special_matters",
+			a.stamp_date as "stamp_date",
+			a.print_quantity as "print_quantity",
+			a.report_preparation_date as "report_preparation_date",
+			a.agreed_start_date as "agreed_start_date",
+			a.agreed_end_date as "agreed_end_date",
+			a.consultant as "consultant",
+			a.self_calibration_opinion as "self_calibration_opinion",
+			a.review_opinion as "review_opinion",
+			a.review_date as "review_date",
+			a.date_of_consultation_report as "date_of_consultation_report",
+			a.start_date_of_consulting_operation as "start_date_of_consulting_operation",
+			a.end_date_of_consultation as "end_date_of_consultation",
+			a.start_audit_date as "start_audit_date",
+			a.project_scale_content_scope as "project_scale_content_scope",
+			a.main_contents_of_project as "main_contents_of_project",
+			a.total_contract_price as "total_contract_price",
+			a.contract_start_date as "contract_start_date",
+			a.contract_end_date as "contract_end_date",
+			a.actual_start_date as "actual_start_date",
+			a.actual_end_date as "actual_end_date",
+			a.completion_acceptance_date as "completion_acceptance_date",
+			a.design_unit as "design_unit",
+			a.construction_control_unit as "construction_control_unit",
+			a.follow_up_audit_unit as "follow_up_audit_unit",
+			a.engineering_design_change_order as "engineering_design_change_order",
+			a.confirmation_sheet_of_quantities as "confirmation_sheet_of_quantities",
+			a.project_visa as "project_visa",
+			a.quality_price_confirmation_of_engineering_materials as "quality_price_confirmation_of_engineering_materials",
+			a.listmaterials_equipment_by_a as "listmaterials_equipment_by_a",
+			a.project_reward_and_damages as "project_reward_and_damages",
+			a.charge as "charge",
+			a.taxes as "taxes",
+			a.duration_difference_causes_and_responsibilities as "duration_difference_causes_and_responsibilities",
+			a.quality_difference_causes_and_responsibilities as "quality_difference_causes_and_responsibilities",
+			a.other_contents_and_expenses as "other_contents_and_expenses",
+			a.project_cost_consulting_contract as "project_cost_consulting_contract",
+			a.settlement_pricing_basis_document as "settlement_pricing_basis_document",
+			a.materials_and_equipment_by_a as "materials_and_equipment_by_a",
+			a.a_materials_by_b as "a_materials_by_b",
+			a.reward_and_punishment_fees as "reward_and_punishment_fees",
+			a.water_and_electricity_fees_handle_situation as "water_and_electricity_fees_handle_situation",
+			a.construction_quality_warranty_deposit as "construction_quality_warranty_deposit",
+			a.tax_difference_calculation_and_processing as "tax_difference_calculation_and_processing"
 	</sql>
 
 
 	<select id="get" resultType="ProjectReportSignatureInfo">
 		SELECT
-		<include refid="projectReportRecordColumns"/>,
-		FROM rural_project_report_record_down a
+		<include refid="projectReportRecordColumns"/>
+		FROM project_report_signature_info a
 		WHERE a.project_report_id = #{projectReportId}
 	</select>
 
+	<insert id="insert">
+		insert into project_report_signature_info(
+			project_report_id,
+			submit_fee,
+			authorize_fee,
+			construction_unit_assessment_fee,
+			authorize_fee_deduct_assessment_fee,
+			construction_unit,
+			description_of_deduction,
+			description_of_exceeding_the_contract_amount,
+			description_of_special_matters,
+			stamp_date,
+			print_quantity,
+			report_preparation_date,
+			agreed_start_date,
+			agreed_end_date,
+			consultant,
+			self_calibration_opinion,
+			review_opinion,
+			review_date,
+			date_of_consultation_report,
+			start_date_of_consulting_operation,
+			end_date_of_consultation,
+			start_audit_date,
+			project_scale_content_scope,
+			main_contents_of_project,
+			total_contract_price,
+			contract_start_date,
+			contract_end_date,
+			actual_start_date,
+			actual_end_date,
+			completion_acceptance_date,
+			design_unit,
+			construction_control_unit,
+			follow_up_audit_unit,
+			engineering_design_change_order,
+			confirmation_sheet_of_quantities,
+			project_visa,
+			quality_price_confirmation_of_engineering_materials,
+			listmaterials_equipment_by_a,
+			project_reward_and_damages,
+			charge,
+			taxes,
+			duration_difference_causes_and_responsibilities,
+			quality_difference_causes_and_responsibilities,
+			other_contents_and_expenses,
+			project_cost_consulting_contract,
+			settlement_pricing_basis_document,
+			materials_and_equipment_by_a,
+			a_materials_by_b,
+			reward_and_punishment_fees,
+			water_and_electricity_fees_handle_situation,
+			construction_quality_warranty_deposit,
+			tax_difference_calculation_and_processing
+		)values (
+							#{projectReportId},
+							#{submitFee},
+							#{authorizeFee},
+							#{constructionUnitAssessmentFee},
+							#{authorizeFeeDeductAssessmentFee},
+							#{constructionUnit},
+							#{descriptionOfDeduction},
+							#{descriptionOfExceedingTheContractAmount},
+							#{descriptionOfSpecialMatters},
+							#{stampDate},
+							#{printQuantity},
+							#{reportPreparationDate},
+							#{agreedStartDate},
+							#{agreedEndDate},
+							#{consultant},
+							#{selfCalibrationOpinion},
+							#{reviewOpinion},
+							#{reviewDate},
+							#{dateOfConsultationReport},
+							#{startDateOfConsultingOperation},
+							#{endDateOfConsultation},
+							#{startAuditDate},
+							#{projectScaleContentScope},
+							#{mainContentsOfProject},
+							#{totalContractPrice},
+							#{contractStartDate},
+							#{contractEndDate},
+							#{actualStartDate},
+							#{actualEndDate},
+							#{completionAcceptanceDate},
+							#{designUnit},
+							#{constructionControlUnit},
+							#{followUpAuditUnit},
+							#{engineeringDesignChangeOrder},
+							#{confirmationSheetOfQuantities},
+							#{projectVisa},
+							#{qualityPriceConfirmationOfEngineeringMaterials},
+							#{listmaterialsEquipmentByA},
+							#{projectRewardAndDamages},
+							#{charge},
+							#{taxes},
+							#{durationDifferenceCausesAndResponsibilities},
+							#{qualityDifferenceCausesAndResponsibilities},
+							#{otherContentsAndExpenses},
+							#{projectCostConsultingContract},
+							#{settlementPricingBasisDocument},
+							#{materialsAndEquipmentByA},
+							#{aMaterialsByB},
+							#{rewardAndPunishmentFees},
+							#{waterAndElectricityFeesHandleSituation},
+							#{constructionQualityWarrantyDeposit},
+							#{taxDifferenceCalculationAndProcessing}
+		)
+	</insert>
+
+	<select id="getAchivesIdByName" resultType="String">
+		select id from work_staff_achives where name=#{name}
+	</select>
+
+	<select id="getId" resultType="String">
+		select id from work_staff_certificate where staff_id=#{staffId}
+	</select>
+
+	<select id="getProjectReportId" resultType="String">
+		select number from project_report_data where number=#{projectReportId}
+	</select>
+
 	<select id="getProjectApprovalSignature" resultType="ProjectApprovalSignature">
 		select
 		  a.id AS "id",

二進制
src/main/webapp/dot/导入数据模板.xlsx


+ 3 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

@@ -999,6 +999,9 @@
 				<div class="nav-btns">
 					<%--此处按钮样式包括 nav-btn-add nav-btn-refresh nav-btn-import nav-btn-export nav-btn-query nav-btn-reset--%>
 					<div class="layui-btn-group">
+						<shiro:hasPermission name="ruralProject:ruralProjectMessageAll:importB">
+							<table:importExcel url="${ctx}/ruralProject/electronicSeal/importB"></table:importExcel><!-- 导入按钮 -->
+						</shiro:hasPermission>
 						<shiro:hasPermission name="ruralProject:ruralProjectMessageAll:export">
 							<table:exportExcel url="${ctx}/ruralProject/ruralProjectMessageAll/export"></table:exportExcel><!-- 导出按钮 -->
 						</shiro:hasPermission>