Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

[user3] 3 tahun lalu
induk
melakukan
f06bef2ae0
21 mengubah file dengan 1051 tambahan dan 155 penghapusan
  1. 8 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportDataDao.java
  2. 11 0
      src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportDataService.java
  3. 7 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  4. 9 9
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/Location.java
  5. 18 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  6. 548 51
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java
  7. 133 30
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  8. 10 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  9. 25 8
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  10. 8 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageElectronicSealController.java
  11. 57 3
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureCallBackController.java
  12. 5 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectViewController.java
  13. 6 47
      src/main/resources/freemarker/projectSignature.ftl
  14. 26 0
      src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml
  15. 4 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml
  16. 1 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml
  17. 25 1
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  18. 3 0
      src/main/resources/mappings/modules/sys/WorkattachmentDao.xml
  19. 8 1
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/downloadType/importWordReportForm.jsp
  20. 84 4
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp
  21. 55 0
      src/main/webapp/webpage/modules/ruralprojectrecords/view/ruralProjectRecordsView.jsp

+ 8 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/dao/ProjectReportDataDao.java

@@ -8,6 +8,7 @@ import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectReportData;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
 import com.jeeplus.modules.sys.entity.Workattachment;
@@ -156,6 +157,13 @@ public interface ProjectReportDataDao extends CrudDao<ProjectReportData> {
     Integer updateSignatureInfo(ProjectReportData projectReportData);
 
     /**
+     * 修改报告签章 项目重的信息
+     * @param records
+     * @return
+     */
+    Integer updateReportSignatureInfo(RuralProjectRecords records);
+
+    /**
      * 根据签章的contractId查询报告信息
      * @param contractId
      * @return

+ 11 - 0
src/main/java/com/jeeplus/modules/projectcontentinfo/service/ProjectReportDataService.java

@@ -22,6 +22,7 @@ import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectReportData;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralReportConsultant;
 import com.jeeplus.modules.serialnum.service.SerialNumTplService;
@@ -1623,6 +1624,16 @@ public class ProjectReportDataService extends CrudService<ProjectReportDataDao,
 	}
 
 	/**
+	 * 修改报告签章 项目重的信息
+	 * @param records
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public void updateReportSignatureInfo(RuralProjectRecords records) {
+		dao.updateReportSignatureInfo(records);
+	}
+
+	/**
 	 * 根据签章contractId查询报告信息
 	 * @param contractId
 	 * @return

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

@@ -245,4 +245,11 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
      * @return
      */
     Integer getProjectByNameList(@Param("projectNameList") List<String> projectNameList);
+
+    /**
+     * 根据签章id查询信息
+     * @param contractId
+     * @return
+     */
+    RuralProjectRecords getProjectRecordsByContractId(String contractId);
 }

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

@@ -9,11 +9,11 @@ public class Location {
     private String id;
     private String documentId ; //合同文档ID
     private String rectType ;   //签章类型
-    private Integer page ;      //签署页码,坐标指定位置时必须,0:全部页,-1:最后一页,其他:第page页
+    private String page ;      //签署页码,坐标指定位置时必须,0:全部页,-1:最后一页,其他:第page页
     private String keyword ;    //关键字,关键字指定位置时必须
     private Integer keywordIndex ;  //第几个关键字,0:全部,-1:最后一个,其他:第keyIndex 个,默认为1
-    private Double offsetX ;    //X轴坐标,坐标定位时必传,关键字定位时选传
-    private Double offsetY ;    //Y轴坐标,坐标定位时必传,关键字定位时选传
+    private String offsetX ;    //X轴坐标,坐标定位时必传,关键字定位时选传
+    private String offsetY ;    //Y轴坐标,坐标定位时必传,关键字定位时选传
     private String contractId ;
     private String signatoryId ;
     private String actionId ;
@@ -42,11 +42,11 @@ public class Location {
         this.rectType = rectType;
     }
 
-    public Integer getPage() {
+    public String getPage() {
         return page;
     }
 
-    public void setPage(Integer page) {
+    public void setPage(String page) {
         this.page = page;
     }
 
@@ -66,19 +66,19 @@ public class Location {
         this.keywordIndex = keywordIndex;
     }
 
-    public Double getOffsetX() {
+    public String getOffsetX() {
         return offsetX;
     }
 
-    public void setOffsetX(Double offsetX) {
+    public void setOffsetX(String offsetX) {
         this.offsetX = offsetX;
     }
 
-    public Double getOffsetY() {
+    public String getOffsetY() {
         return offsetY;
     }
 
-    public void setOffsetY(Double offsetY) {
+    public void setOffsetY(String offsetY) {
         this.offsetY = offsetY;
     }
 

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

@@ -268,6 +268,8 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String approvalSignatureProcessInstanceId; //审定单申请流程id
 	private Integer reportSignatureStatus; //报告签章申请状态
 	private String reportSignatureProcessInstanceId; //报告签章申请流程id
+	private String prsiId; //报告签章数据信息id
+	private String signatureDownloadUrl; //报告签章文档下载链接
 
 
 	private Integer reportSignatureFlag;		//是否审定单签章(1为已签章)
@@ -2009,4 +2011,20 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setReportSignatureUploadDate(Date reportSignatureUploadDate) {
 		this.reportSignatureUploadDate = reportSignatureUploadDate;
 	}
+
+	public String getPrsiId() {
+		return prsiId;
+	}
+
+	public void setPrsiId(String prsiId) {
+		this.prsiId = prsiId;
+	}
+
+	public String getSignatureDownloadUrl() {
+		return signatureDownloadUrl;
+	}
+
+	public void setSignatureDownloadUrl(String signatureDownloadUrl) {
+		this.signatureDownloadUrl = signatureDownloadUrl;
+	}
 }

+ 548 - 51
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageElectronicSealService.java

@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.ImageUtil;
 import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.oa.entity.OaNotify;
@@ -19,10 +21,14 @@ import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 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.service.OfficeService;
 import com.jeeplus.modules.sys.service.UserService;
+import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.tools.utils.TwoDimensionCode;
+import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.workactivity.dao.WorkActivityProcessDao;
 import com.jeeplus.modules.workactivity.entity.Activity;
 import com.jeeplus.modules.workactivity.entity.WorkActivityProcess;
@@ -45,9 +51,13 @@ import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -59,6 +69,10 @@ import java.util.*;
 @Transactional(readOnly = true)
 public class RuralProjectMessageElectronicSealService extends CrudService<RuralProjectMessageElectronicSealDao, ProjectReportSignatureInfo> {
 
+    //生产环境域名
+    @Value("${serverDomain}")
+    private String serverDomain;
+
     @Autowired
     private UserService userService;
     @Autowired
@@ -87,6 +101,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     private ActivityService activityService;
     @Autowired
     private WorkActivityProcessDao workActivityProcessDao;
+    @Autowired
+    private WorkattachmentService workattachmentService;
 
     /**
      * 根据项目id查询审定单是否存在送审信息
@@ -1250,6 +1266,8 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     public Map<String,Object> disposeProjectReportdata(ProjectReportData projectReportData){
         //获取报告信息
         projectReportData = projectReportDataService.get(projectReportData.getId());
+        //查询签章数据信息
+        ProjectReportSignatureInfo projectReportSignatureInfo = dao.get(projectReportData.getNumber());
         //获取项目信息
         RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
         ruralProjectRecordsService.queryUserNames(ruralProjectRecords);
@@ -1353,7 +1371,11 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         //如果项目负责人名称为空
         if(StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
             User user=userService.get(projectReportData.getBzshbUserId());
-            bzshbConsultant.setZixunyuanName(user.getName());
+            if(null == user){
+                bzshbConsultant.setZixunyuanName("");
+            }else{
+                bzshbConsultant.setZixunyuanName(user.getName());
+            }
         }
 
 
@@ -1393,10 +1415,12 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         }
         //约定作业期处理
         String promiseTime = "";
-        if(null!= ruralProjectRecords.getStartDate() && null != ruralProjectRecords.getEndingDate()){
-            String startDateStr = dateStr(ruralProjectRecords.getStartDate());
-            String endingDateStr = dateStr(ruralProjectRecords.getEndingDate());
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getAgreedStartDate() && null != projectReportSignatureInfo.getAgreedEndDate()){
+            String startDateStr = dateStr(projectReportSignatureInfo.getAgreedStartDate());
+            String endingDateStr = dateStr(projectReportSignatureInfo.getAgreedEndDate());
             promiseTime = startDateStr + "至" + endingDateStr;
+        }else{
+            promiseTime = "";
         }
 
         //freemarker参数值准备
@@ -1430,70 +1454,521 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
         //约定作业期
         data.put("promiseTime",promiseTime);
         data.put("projectMaster",ruralProjectRecords.getLeaderNameStr());
+
         //咨询员信息
-        data.put("consultantName0","");
-        data.put("consultantProfession0","");
-        data.put("consultantQualification0","");
+        if(null != consultants){
+            data.put("consultantName0",consultants.get(0).getZixunyuanName());
+            data.put("consultantProfession0",consultants.get(0).getMajor());
+            data.put("consultantQualification0",consultants.get(0).getZhucezigezh());
+        }
+        //根据咨询员id查询咨询员信息以及咨询员的专业和资格
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConsultant())){
+            RuralReportConsultant consultantUserConsultant = new RuralReportConsultant();
+            User consultantUser = UserUtils.get(projectReportSignatureInfo.getConsultant());
+            data.put("consultantName1",consultantUser.getName());
+            data.put("zixunyuanName",consultantUser.getName());
+            data.put("consultantProfession1","");
+            data.put("consultantQualification1","");
+            List<WorkStaffCertificate> certificateByUser = ruralProjectMessageService.getCertificateByUser(consultantUser.getId());
+            for (WorkStaffCertificate certificateInfo: certificateByUser) {
+                consultantUserConsultant.setZhucezigezhID(certificateInfo.getNum());
+                consultantUserConsultant.setZhucezigezhKey(certificateInfo.getName());
+                for (MainDictDetail type : certificateMajor) {
+                    if(certificateInfo.getMajor().equals(type.getValue())){
+                        data.put("consultantProfession1",type.getLabel());
+                        break;
+                    }
+                }
+            }
 
-        if(null != projectReportData.getPrincipalDate()){
+            for (MainDictDetail type : certificateType) {
+                if(consultantUserConsultant.getZhucezigezhKey().equals(type.getValue())){
+                    data.put("consultantQualification1",type.getLabel());
+                    break;
+                }
+            }
+        }else{
+            data.put("zixunyuanName","");
+            data.put("consultantName1","");
+            data.put("consultantProfession1","");
+            data.put("consultantQualification1","");
+        }
+        //咨询员意见
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSelfCalibrationOpinion())){
+            data.put("auditOpinion",projectReportSignatureInfo.getSelfCalibrationOpinion());
+        }else{
+            data.put("auditOpinion","");
+        }
+        //复核日期
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getReviewDate()){
+
+            data.put("ziDate",dateStr(projectReportSignatureInfo.getReviewDate()));
+            data.put("shenDate",dateStr(projectReportSignatureInfo.getReviewDate()));
+        }else{
+            data.put("ziDate","");
+            data.put("shenDate","");
+        }
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getReviewDate()){
+            data.put("projectMasterRemarks",projectReportSignatureInfo.getReviewOpinion());
+        }else{
+            data.put("projectMasterRemarks","");
+        }
+        if(null != currentConsultant && StringUtils.isNotBlank(currentConsultant.getZixunyuanName())){
             //项目负责人
             data.put("projectMaster",currentConsultant.getZixunyuanName());
-            if(StringUtils.isBlank(currentConsultant.getAuditOpinion())){
-                data.put("projectMasterRemarks","");
-            }else{
-                data.put("projectMasterRemarks",currentConsultant.getAuditOpinion());
-            }
-            data.put("projectYear","");
-            data.put("projectMonth","");
-            data.put("projectDay","");
         }else{
             //项目负责人
             data.put("projectMaster","");
-            data.put("projectMasterRemarks","");
-            data.put("projectYear","");
-            data.put("projectMonth","");
-            data.put("projectDay","");
+        }
+        //技术负责人信息
+        data.put("technicistName","");
+        data.put("technicistRemarks","");
+        //项目登记人
+        User projectRecordsCreateUser = UserUtils.get(ruralProjectRecords.getCreateBy().getId());
+        data.put("projectCreateName",projectRecordsCreateUser.getName());
+        data.put("projectType","");
+        //工程咨询
+        if("1".equals(ruralProjectRecords.getProjectType())){
+            mainDictList = DictUtils.getMainDictList("attachment_project_sort");
+            //造价审核
+        } else if("2".equals(ruralProjectRecords.getProjectType())){
+            mainDictList = DictUtils.getMainDictList("attachment_project_sort_cost");
+        }
+        if(StringUtils.isNotBlank(ruralProjectRecords.getAttachmentProjectSort())){
+            //处理项目类别
+            for (MainDictDetail info: mainDictList) {
+                if(ruralProjectRecords.getAttachmentProjectSort().equals(info.getValue())){
+                    data.put("projectType",info.getLabel());
+                    break;
+                }
+            }
+        }
+        //咨询报告日期
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getDateOfConsultationReport()){
+            data.put("projectReportDate",dateStr(projectReportSignatureInfo.getDateOfConsultationReport()));
+        }else{
+            data.put("projectReportDate","");
         }
 
-        if(null != projectReportData.getTechnicistDate()){
-            //技术负责人
-            if(StringUtils.isBlank(bzshbConsultant.getZixunyuanName())){
-                data.put("technicistName","");
-            }else{
-                data.put("technicistName",bzshbConsultant.getZixunyuanName());
+        //咨询作业期处理
+        data.put("consultOperationalPeriod","");
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getStartDateOfConsultingOperation() && null != projectReportSignatureInfo.getEndDateOfConsultation()){
+            String startDateStr = dateStr(projectReportSignatureInfo.getStartDateOfConsultingOperation());
+            String endingDateStr = dateStr(projectReportSignatureInfo.getEndDateOfConsultation());
+            data.put("consultOperationalPeriod",startDateStr + "至" + endingDateStr);
+        }else{
+            data.put("consultOperationalPeriod","");
+        }
+        //项目所在地
+        data.put("projectArea",ruralProjectRecords.getProvince() + ruralProjectRecords.getCity()  + ruralProjectRecords.getCounty());
+        //工程规模、范围和内容
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getProjectScaleContentScope()){
+            data.put("projectScaleScopeDetails",projectReportSignatureInfo.getProjectScaleContentScope());
+        }else{
+            data.put("projectScaleScopeDetails","");
+        }
+        //工程主要内容
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getMainContentsOfProject()){
+            data.put("mainContent",projectReportSignatureInfo.getMainContentsOfProject());
+        }else{
+            data.put("mainContent","");
+        }
+        //施工单位
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getConstructionUnit()){
+            data.put("constructionOrganization",projectReportSignatureInfo.getConstructionUnit());
+        }else{
+            data.put("constructionOrganization","");
+        }
+        //合同签订日期
+        if(null != ruralProjectRecords.getWorkContractInfo() && null != ruralProjectRecords.getWorkContractInfo().getContractDate()){
+            data.put("contractSignedDate",dateStr(ruralProjectRecords.getWorkContractInfo().getContractDate()));
+        }else{
+            data.put("contractSignedDate","");
+        }
+        //合同总价
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTotalContractPrice())){
+            data.put("contractAllMoney",projectReportSignatureInfo.getTotalContractPrice());
+        }else{
+            data.put("contractAllMoney","");
+        }
+        //合同开工日期
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getContractStartDate()){
+            data.put("contractBeginDate",dateStr(projectReportSignatureInfo.getContractStartDate()));
+        }else{
+            data.put("contractBeginDate","");
+        }
+        //合同竣工日期
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getContractEndDate()){
+            data.put("contractEndDate",dateStr(projectReportSignatureInfo.getContractEndDate()));
+        }else{
+            data.put("contractEndDate","");
+        }
+
+        //工期总日历天数
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getContractStartDate() && null!= projectReportSignatureInfo.getContractEndDate()){
+            try {
+                String interval = this.getInterval(projectReportSignatureInfo.getContractStartDate(), projectReportSignatureInfo.getContractEndDate());
+                data.put("contractDurationDays",interval);
+            } catch (Exception e) {
+                e.printStackTrace();
             }
-            if(StringUtils.isBlank(bzshbConsultant.getAuditOpinion())){
-                data.put("technicistRemarks","");
-            }else{
-                data.put("technicistRemarks",bzshbConsultant.getAuditOpinion());
+        }else{
+            data.put("contractDurationDays","");
+        }
+        //实际开工日期
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getActualStartDate()){
+            data.put("contractPracticalBeginDate",dateStr(projectReportSignatureInfo.getActualStartDate()));
+        }else{
+            data.put("contractPracticalBeginDate","");
+        }
+        //实际竣工日期
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getActualEndDate()){
+            data.put("contractPracticalEndDate",dateStr(projectReportSignatureInfo.getActualEndDate()));
+        }else{
+            data.put("contractPracticalEndDate","");
+        }
+        //验收日期
+        if(null != projectReportSignatureInfo && null!= projectReportSignatureInfo.getCompletionAcceptanceDate()){
+            data.put("checkAndAcceptDate",dateStr(projectReportSignatureInfo.getCompletionAcceptanceDate()));
+        }else{
+            data.put("checkAndAcceptDate","");
+        }
+        //设计单位
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getDesignUnit())){
+            data.put("designOrganization",projectReportSignatureInfo.getDesignUnit());
+        }else{
+            data.put("designOrganization","");
+        }
+        //监理单位
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionControlUnit())){
+            data.put("supervisionUnit",projectReportSignatureInfo.getConstructionControlUnit());
+        }else{
+            data.put("supervisionUnit","");
+        }
+        //跟踪审计单位
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getFollowUpAuditUnit())){
+            data.put("followUpAuditUnit",projectReportSignatureInfo.getFollowUpAuditUnit());
+        }else{
+            data.put("followUpAuditUnit","");
+        }
+        //工程设计变更单
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getEngineeringDesignChangeOrder())){
+            data.put("projectDesignInventory",projectReportSignatureInfo.getEngineeringDesignChangeOrder());
+        }else{
+            data.put("projectDesignInventory","无");
+        }
+        //工程量确认单
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConfirmationSheetOfQuantities())){
+            data.put("workAmountVoucher",projectReportSignatureInfo.getConfirmationSheetOfQuantities());
+        }else{
+            data.put("workAmountVoucher","无");
+        }
+        //工程签证
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getProjectVisa())){
+            data.put("projectVisa",projectReportSignatureInfo.getProjectVisa());
+        }else{
+            data.put("projectVisa","无");
+        }
+        //工程材料设备认质认价单
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getQualityPriceConfirmationOfEngineeringMaterials())){
+            data.put("equipmentPrice",projectReportSignatureInfo.getQualityPriceConfirmationOfEngineeringMaterials());
+        }else{
+            data.put("equipmentPrice","无");
+        }
+        //工程甲供材料设备清单
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getListmaterialsEquipmentByA())){
+            data.put("whichMaterialInventory",projectReportSignatureInfo.getListmaterialsEquipmentByA());
+        }else{
+            data.put("whichMaterialInventory","无");
+        }
+        //工程索赔奖励及违约费用
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getProjectRewardAndDamages())){
+            data.put("claimDefaultPrice",projectReportSignatureInfo.getProjectRewardAndDamages());
+        }else{
+            data.put("claimDefaultPrice","无");
+        }
+        //取费
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getCharge())){
+            data.put("fee",projectReportSignatureInfo.getCharge());
+        }else{
+            data.put("fee","");
+        }
+        //税金
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTaxes())){
+            data.put("taxationExpense",projectReportSignatureInfo.getTaxes());
+        }else{
+            data.put("taxationExpense","");
+        }
+        //工期差异原因与责任
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getDurationDifferenceCausesAndResponsibilities())){
+            data.put("durationDuty",projectReportSignatureInfo.getDurationDifferenceCausesAndResponsibilities());
+        }else{
+            data.put("durationDuty","");
+        }
+        //质量差异原因与责任
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getQualityDifferenceCausesAndResponsibilities())){
+            data.put("qualityDuty",projectReportSignatureInfo.getQualityDifferenceCausesAndResponsibilities());
+        }else{
+            data.put("qualityDuty","");
+        }
+        //其他内容及费用
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getOtherContentsAndExpenses())){
+            data.put("otherDetailsFee",projectReportSignatureInfo.getOtherContentsAndExpenses());
+        }else{
+            data.put("otherDetailsFee","无");
+        }
+        //工程造价咨询合同
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getProjectCostConsultingContract())){
+            data.put("projectCostContract",projectReportSignatureInfo.getProjectCostConsultingContract());
+        }else{
+            data.put("projectCostContract","");
+        }
+        //现行相关预结算计价依据文件
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSettlementPricingBasisDocument())){
+            data.put("accordingToTheFile",projectReportSignatureInfo.getSettlementPricingBasisDocument());
+        }else{
+            data.put("accordingToTheFile","");
+        }
+        //合同金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTotalContractPrice())){
+            data.put("contractMoney",projectReportSignatureInfo.getTotalContractPrice());
+        }else{
+            data.put("contractMoney","");
+        }
+        //送审金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSubmitFee())){
+            data.put("submitFee",projectReportSignatureInfo.getSubmitFee());
+        }else{
+            data.put("submitFee","");
+        }
+        //审定金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee())){
+            data.put("examineAndApproveFee",projectReportSignatureInfo.getAuthorizeFee());
+        }else{
+            data.put("examineAndApproveFee","");
+        }
+        //核减金额  核减金额=送审金额-审定金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSubmitFee()) && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee())){
+            BigDecimal submitFee=new BigDecimal(projectReportSignatureInfo.getSubmitFee());
+            BigDecimal authorizeFee=new BigDecimal(projectReportSignatureInfo.getAuthorizeFee());
+            BigDecimal subtract = submitFee.subtract(authorizeFee);
+            data.put("decreaseAccountingFee",subtract.toString());
+        }else{
+            data.put("decreaseAccountingFee","");
+        }
+        //核减率	核减率=核减金额/送审金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getSubmitFee()) && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFee())){
+            BigDecimal submitFee=new BigDecimal(projectReportSignatureInfo.getSubmitFee());
+            BigDecimal authorizeFee=new BigDecimal(projectReportSignatureInfo.getAuthorizeFee());
+            BigDecimal subtract = submitFee.subtract(authorizeFee);
+            BigDecimal divide = subtract.divide(submitFee,2,BigDecimal.ROUND_HALF_UP);
+            data.put("decreaseAccountingRate",divide.toString());
+        }else{
+            data.put("decreaseAccountingRate","");
+        }
+        //考核费
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionUnitAssessmentFee())){
+            data.put("inspectionFee",projectReportSignatureInfo.getConstructionUnitAssessmentFee());
+        }else{
+            data.put("inspectionFee","");
+        }
+        //考核后审定金额
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getAuthorizeFeeDeductAssessmentFee())){
+            data.put("examineAndApproveInspectionFee",projectReportSignatureInfo.getAuthorizeFeeDeductAssessmentFee());
+        }else{
+            data.put("examineAndApproveInspectionFee","");
+        }
+        if(null != ruralProjectRecords.getWorkContractInfo()){
+            if(null != ruralProjectRecords.getWorkContractInfo().getContractTypeDoc()){
+                ruralProjectRecords.getWorkContractInfo().setContractType(DictUtils.getMainDictLabel(String.valueOf(ruralProjectRecords.getWorkContractInfo().getContractTypeDoc()),"contract_info_type",""));
             }
-            data.put("technicistYear","");
-            data.put("technicistMonth","");
-            data.put("technicistDay","");
+        }
+        //合同金额类别
+        if(null != ruralProjectRecords.getWorkContractInfo() && null != ruralProjectRecords.getWorkContractInfo().getContractType()){
+            data.put("contractType",ruralProjectRecords.getWorkContractInfo().getContractType());
+        }else{
+            data.put("contractType","");
+        }
+        //合同名称
+        if(null != ruralProjectRecords.getWorkContractInfo() && null != ruralProjectRecords.getWorkContractInfo().getName()){
+            data.put("contractName",ruralProjectRecords.getWorkContractInfo().getName());
+        }else{
+            data.put("contractName","");
+        }
+        //核减情况说明
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getDescriptionOfDeduction())){
+            data.put("decreaseAccountingExplain",projectReportSignatureInfo.getDescriptionOfDeduction());
+        }else{
+            data.put("decreaseAccountingExplain","");
+        }
+        //超合同额情况说明
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getDescriptionOfExceedingTheContractAmount())){
+            data.put("exceedContractFeeExplain",projectReportSignatureInfo.getDescriptionOfExceedingTheContractAmount());
+        }else{
+            data.put("exceedContractFeeExplain","");
+        }
+        //特殊事项说明
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getDescriptionOfSpecialMatters())){
+            data.put("specialItemExplain",projectReportSignatureInfo.getDescriptionOfSpecialMatters());
+        }else{
+            data.put("specialItemExplain","");
+        }
+        //甲供材料及设备情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getMaterialsAndEquipmentByA())){
+            data.put("whichMaterialEquipmentCondition",projectReportSignatureInfo.getMaterialsAndEquipmentByA());
+        }else{
+            data.put("whichMaterialEquipmentCondition","");
+        }
+        //甲控乙供材情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getaMaterialsByB())){
+            data.put("bmaterialCondition",projectReportSignatureInfo.getaMaterialsByB());
+        }else{
+            data.put("bmaterialCondition","无");
+        }
+        //奖惩费情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getRewardAndPunishmentFees())){
+            data.put("rewardsAndPunishmentsFee",projectReportSignatureInfo.getRewardAndPunishmentFees());
+        }else{
+            data.put("rewardsAndPunishmentsFee","无");
+        }
+        //水电费处理情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getWaterAndElectricityFeesHandleSituation())){
+            data.put("waterAndElectricity",projectReportSignatureInfo.getWaterAndElectricityFeesHandleSituation());
+        }else{
+            data.put("waterAndElectricity","");
+        }
+        //工程质量保修金处理情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getConstructionQualityWarrantyDeposit())){
+            data.put("warrantyPremium",projectReportSignatureInfo.getConstructionQualityWarrantyDeposit());
+        }else{
+            data.put("warrantyPremium","");
+        }
+        //税金差额计算处理情况
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getTaxDifferenceCalculationAndProcessing())){
+            data.put("taxationExpenseDifference",projectReportSignatureInfo.getTaxDifferenceCalculationAndProcessing());
+        }else{
+            data.put("taxationExpenseDifference","");
+        }
+        //盖章日期
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getStampDate()){
+            data.put("stampDate",dateStr(projectReportSignatureInfo.getStampDate()));
+        }else{
+            data.put("stampDate","");
+        }
+        //打印数量
+        if(null != projectReportSignatureInfo && StringUtils.isNotBlank(projectReportSignatureInfo.getPrintQuantity())){
+            data.put("printCount",projectReportSignatureInfo.getPrintQuantity());
+        }else{
+            data.put("printCount","");
+        }
+        //报告编制日期
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getReportPreparationDate()){
+            data.put("reportStaffingDate",dateStr(projectReportSignatureInfo.getReportPreparationDate()));
         }else{
-            //技术负责人
-            data.put("technicistName","");
-            data.put("technicistRemarks","");
-            data.put("technicistYear","");
-            data.put("technicistMonth","");
-            data.put("technicistDay","");
-        }
-        //获取报告发起时间
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年 MM月 dd日");
-        Date ziDate=projectReportData.getCreateDate();
-        String str = sdf.format(ziDate);
-        data.put("ziDate",str);
-        //报告状态
-        String dataStatus=projectReportData.getStatus();
-        if (dataStatus.equals("5")){
-            String ss = sdf.format(projectReportData.getAuditPassDate());
-            data.put("shenDate",ss);
+            data.put("reportStaffingDate","");
+        }
+        //开始审核日期
+        if(null != projectReportSignatureInfo && null != projectReportSignatureInfo.getStartAuditDate()){
+            data.put("auditBeginDate",dateStr(projectReportSignatureInfo.getStartAuditDate()));
         }else{
-            data.put("shenDate","    年   月   日");
+            data.put("auditBeginDate","");
+        }
+
+        //咨询项目委托方全称
+        data.put("entrustingParty","咨询项目委托方全称");
+        data.put("querySite","ccpm.xgccpm.com");
+
+        String querySite = serverDomain+"/ruralProject/ruralProjectRecords/getDownloadProjectView?id="+projectReportData.getProject().getId();
+        //生成二维码图片和doc文档 缓存文件的共用名称
+        String commonFileName = UUID.randomUUID().toString();
+        String tempPath = this.getClass().getResource("/").getPath()+"/temp/";
+        File temP = new File(tempPath);
+        if(!temP.exists()){
+            temP.mkdirs();
         }
+        String qrCodePath = tempPath + commonFileName + ".png";
+        TwoDimensionCode.encoderQRCode(querySite, qrCodePath, "png");//执行生成二维码
+        String imageStr = ImageUtil.getImageStr(qrCodePath);
+        data.put("qrcode",imageStr);
+
         return data;
     }
 
+    /**
+     * 将文件上传到阿里云中
+     * @param projectReportData
+     */
+    @Transactional(readOnly = false)
+    public String uploadOss(ProjectReportData projectReportData,File docFile){
+        //获取报告信息
+        projectReportData = projectReportDataService.get(projectReportData.getId());
+        //查询签章数据信息
+        ProjectReportSignatureInfo projectReportSignatureInfo = dao.get(projectReportData.getNumber());
+        if(null == projectReportSignatureInfo){
+            return "该项目未上传报告签章内容信息";
+        }
+        //获取项目信息
+        RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.get(projectReportData.getProject().getId());
+        ruralProjectRecordsService.queryUserNames(ruralProjectRecords);
+
+        //将file文件上传到阿里云并进行与项目变绑定预留以后的下载
+        //File转MultipartFile文件
+        SftpClientUtil sftpClientUtil = new SftpClientUtil();
+        MultipartFile mFile = sftpClientUtil.transformFile(docFile);
+        //文件上传oss
+        String uploadPath = null;
+        try {
+            uploadPath = ResponseUtil.uploadOss(mFile, "reportSignature");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if(StringUtils.isNotBlank(uploadPath)){
+            //将备考表添加到附件中
+            Workattachment workattachment = new Workattachment();
+            workattachment.setAttachmentId(projectReportSignatureInfo.getId());
+            workattachment.setProjectId(ruralProjectRecords.getId());
+            workattachment.setUrl(uploadPath);
+            workattachment.setType("docx");
+            workattachment.setAttachmentFlag("199");
+            workattachment.setAttachmentName(ruralProjectRecords.getProjectName() + "报告签章.docx");
+            workattachment.setAttachmentUser(UserUtils.getUser().getId());
+
+
+            WorkClientAttachment workClientAttachment = new WorkClientAttachment();
+            workClientAttachment.setProjectId(ruralProjectRecords.getId());
+            workClientAttachment.setAttachmentId(projectReportSignatureInfo.getId());
+            workClientAttachment.setAttachmentName(ruralProjectRecords.getProjectName() + "报告签章.docx");
+            //删除原有数据信息
+            workattachmentService.deleteByAttachIdAndProject(workClientAttachment);
+            //新增新的数据信息
+            workattachmentService.insertOnWorkAttachment(workattachment);
+
+        }
+        return "";
+    }
+
+    public void getFile(RuralProjectRecords ruralProjectRecords){
+        if(StringUtils.isNotBlank(ruralProjectRecords.getId())){
+            //获取报告信息
+            ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(ruralProjectRecords.getId());
+            if(null != projectReportData && StringUtils.isNotBlank(projectReportData.getNumber())){
+                //查询签章数据信息
+                ProjectReportSignatureInfo projectReportSignatureInfo = dao.get(projectReportData.getNumber());
+                if(null != projectReportSignatureInfo){
+                    //将备考表添加到附件中
+                    Workattachment workattachment = new Workattachment();
+                    workattachment.setAttachmentId(projectReportSignatureInfo.getId());
+                    workattachment.setProjectId(ruralProjectRecords.getId());
+                    List<Workattachment> list = workattachmentService.findList(workattachment);
+                    workattachmentService.attachmentManageOnUrl(list);
+                    if(null != list && list.size()>0){
+                        ruralProjectRecords.setSignatureDownloadUrl(list.get(0).getTemporaryUrl());
+                    }
+                }
+            }
+        }
+    }
+
 
     /**
      * date转String
@@ -1508,6 +1983,28 @@ public class RuralProjectMessageElectronicSealService extends CrudService<RuralP
     }
 
     /**
+     * 计算两日期相差天数
+     * @param begin_date
+     * @param end_date
+     * @return
+     * @throws Exception
+     */
+    public String getInterval(Date begin_date, Date end_date) throws Exception{
+        long day = 0;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        if(begin_date != null){
+            String begin = sdf.format(begin_date);
+            begin_date  = sdf.parse(begin);
+        }
+        if(end_date!= null){
+            String end= sdf.format(end_date);
+            end_date= sdf.parse(end);
+        }
+        day = (end_date.getTime()-begin_date.getTime())/(24*60*60*1000);
+        return String.valueOf(day);
+    }
+
+    /**
      * B类项目批量导入
      * @param list
      * @return

+ 133 - 30
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3874,12 +3874,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         List<Location> locations = Lists.newArrayList();
         Location location = new Location();
         location.setDocumentId(documentList.get(0));
-        location.setPage(0);
+        location.setPage("0");
         location.setRectType("SEAL_CORPORATE");
         //location.setKeyword("咨询企业(章)");
         location.setKeywordIndex(-1);
-        location.setOffsetX(0.7749);
-        location.setOffsetY(0.2725);
+        location.setOffsetX("0.7749");
+        location.setOffsetY("0.2725");
         locations.add(location);
         companyAction.setLocations(locations);
         actions.add(companyAction);
@@ -3902,12 +3902,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     List<Location> principalLocations = Lists.newArrayList();
                     Location principalLocation = new Location();
                     principalLocation.setDocumentId(documentList.get(0));
-                    principalLocation.setPage(0);
+                    principalLocation.setPage("0");
                     principalLocation.setRectType("SEAL_CORPORATE");
                     //principalLocation.setKeyword("项目负责人(签字盖章)");
                     principalLocation.setKeywordIndex(-1);
-                    principalLocation.setOffsetX(0.7759);
-                    principalLocation.setOffsetY(0.1934);
+                    principalLocation.setOffsetX("0.7759");
+                    principalLocation.setOffsetY("0.1934");
                     principalLocations.add(principalLocation);
                     actionUser.setLocations(principalLocations);
                     actions.add(actionUser);
@@ -3930,12 +3930,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 List<Location> principalLocations = Lists.newArrayList();
                 Location principalLocation = new Location();
                 principalLocation.setDocumentId(documentList.get(0));
-                principalLocation.setPage(0);
+                principalLocation.setPage("0");
                 principalLocation.setRectType("SEAL_CORPORATE");
                 //principalLocation.setKeyword("签发人");
                 principalLocation.setKeywordIndex(-1);
-                principalLocation.setOffsetX(0.7518);
-                principalLocation.setOffsetY(0.1642);
+                principalLocation.setOffsetX("0.7518");
+                principalLocation.setOffsetY("0.1642");
                 principalLocations.add(principalLocation);
                 actionUser.setLocations(principalLocations);
                 actions.add(actionUser);
@@ -4040,9 +4040,70 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     stamper.setDocumentId(invalidDocumentId);
                     stamper.setType("SEAL_CORPORATE");
                     stamper.setSealId(location.getSealId());
-                    stamper.setPage(location.getPage());
-                    stamper.setX(location.getOffsetX());
-                    stamper.setY(location.getOffsetY());
+                    stamper.setPage(Integer.parseInt(location.getPage()));
+                    stamper.setX(Double.valueOf(location.getOffsetX()));
+                    stamper.setY(Double.valueOf(location.getOffsetY()));
+                    stampers.add(stamper);
+                }
+                signByCompanyInfo.setStampers(stampers);
+                //将数据转换为jsonString
+                Object obj = com.alibaba.fastjson.JSONArray.toJSON(signByCompanyInfo);
+                String signByCompanyInfoJsonStr = obj.toString();
+                //进行静默签署
+                String signByCompanyStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/signbycompany", signByCompanyInfoJsonStr);
+                HashMap signByCompanyStrMap = JSON.parseObject(signByCompanyStr, HashMap.class);
+                String signByCompanyStrResult = signByCompanyStrMap.get("code").toString();
+                if (!"0".equals(signByCompanyStrResult)) {
+                    return null;
+                }
+            }
+        }
+        return "";
+    }
+
+    /**
+     * 根据contractId进行静默签署(非坐标)
+     * @param contractId
+     * @return
+     */
+    public String signbyCompanyByKeyWord (String contractId,List<String> invalidDocumentIdList){
+
+        //根据合同id查询坐标
+        Map map = new HashMap();
+        map.put("contractId",contractId);
+        String coordinateMapStr = SignaturePostUtil.doGet( map,HTTPTOP + "/contract/query/location");
+        HashMap hashMap = JSON.parseObject(coordinateMapStr, HashMap.class);
+        String resultStr = hashMap.get("result").toString();
+        Map  classMap = new HashMap();
+        classMap.put("locations", Location.class);
+        //2、使用JSONArray
+        JSONArray jsonArray= JSONArray.fromObject(resultStr);
+        //获得jsonArray的第一个元素
+        Object o=jsonArray.get(0);
+        net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(o);
+        //对json数据进行实例化
+        CoordinateInfo coordinateInfo = (CoordinateInfo) net.sf.json.JSONObject.toBean(jsonObject, CoordinateInfo.class, classMap);
+        //发起合同
+        Map sendContractMap = new HashMap();
+        sendContractMap.put("contractId",contractId);
+        String sendContractJsonString = JSON.toJSONString(sendContractMap);
+        String sendContractStr = SignaturePostUtil.sendPostApplicationJson( HTTPTOP + "/contract/send",sendContractJsonString);
+        HashMap signUrlHashMap = JSON.parseObject(sendContractStr, HashMap.class);
+        String sendContractResult = signUrlHashMap.get("code").toString();
+        if("0".equals(sendContractResult)) {
+            List<Location> locations = coordinateInfo.getLocations();
+
+            SignByCompanyInfo signByCompanyInfo = new SignByCompanyInfo();
+            signByCompanyInfo.setContractId(contractId);
+            signByCompanyInfo.setTenantName("江苏兴光项目管理有限公司");
+
+            for (Location location : locations) {
+                List<Stamper> stampers = Lists.newArrayList();
+                for (String invalidDocumentId : invalidDocumentIdList) {
+                    Stamper stamper = new Stamper();
+                    stamper.setDocumentId(invalidDocumentId);
+                    stamper.setType("SEAL_CORPORATE");
+                    stamper.setSealId(location.getSealId());
                     stampers.add(stamper);
                 }
                 signByCompanyInfo.setStampers(stampers);
@@ -4076,23 +4137,44 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         List<Action> actions = Lists.newArrayList();
         Action companyAction = new Action();
         companyAction.setType("CORPORATE");
-        companyAction.setName("公司印章");
+        companyAction.setName("公司执业印章");
         companyAction.setSerialNo("1");
-        companyAction.setSealId("2894161942659543252");
+        //公司方章编号
+        companyAction.setSealId("2894163220106129636");
         //添加盖章位置
         List<Location> locations = Lists.newArrayList();
         Location location = new Location();
         location.setDocumentId(documentList.get(0));
-        location.setPage(0);
+        //location.setPage(0);
         location.setRectType("SEAL_CORPORATE");
-        //location.setKeyword("咨询企业(章)");
-        location.setKeywordIndex(-1);
-        location.setOffsetX(0.7749);
-        location.setOffsetY(0.2725);
+        location.setKeyword("咨询企业执业印章");
+        location.setKeywordIndex(1);
+        /*location.setOffsetX(0.7749);
+        location.setOffsetY(0.2725);*/
         locations.add(location);
         companyAction.setLocations(locations);
         actions.add(companyAction);
 
+        Action companyActionCircle = new Action();
+        companyActionCircle.setType("CORPORATE");
+        companyActionCircle.setName("公司印章");
+        companyActionCircle.setSerialNo("1");
+        //公司圆章编号
+        companyActionCircle.setSealId("2894161942659543252");
+        //添加盖章位置
+        List<Location> locationCircles = Lists.newArrayList();
+        Location locationCircle = new Location();
+        locationCircle.setDocumentId(documentList.get(0));
+        //location.setPage(0);
+        locationCircle.setRectType("SEAL_CORPORATE");
+        locationCircle.setKeyword("江苏兴光项目管理有限公司(印章)");
+        locationCircle.setKeywordIndex(1);
+        locationCircle.setOffsetX("-0.2");
+        //locationCircle.setOffsetY("0.2725");
+        locationCircles.add(locationCircle);
+        companyActionCircle.setLocations(locationCircles);
+        actions.add(companyActionCircle);
+
         //根据角色信息录入签署方信息
         //负责人
         if(StringUtils.isNotBlank(principalUserId)){
@@ -4111,15 +4193,36 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                     List<Location> principalLocations = Lists.newArrayList();
                     Location principalLocation = new Location();
                     principalLocation.setDocumentId(documentList.get(0));
-                    principalLocation.setPage(0);
+                    //principalLocation.setPage(0);
                     principalLocation.setRectType("SEAL_CORPORATE");
-                    //principalLocation.setKeyword("项目负责人(签字盖章)");
-                    principalLocation.setKeywordIndex(-1);
-                    principalLocation.setOffsetX(0.7759);
-                    principalLocation.setOffsetY(0.1934);
+                    principalLocation.setKeyword("项目负责人");
+                    principalLocation.setKeywordIndex(3);
+                    /*principalLocation.setOffsetX(0.7759);
+                    principalLocation.setOffsetY(0.1934);*/
                     principalLocations.add(principalLocation);
                     actionUser.setLocations(principalLocations);
                     actions.add(actionUser);
+
+
+                    Action actionUserSign = new Action();
+                    actionUserSign.setType("CORPORATE");
+                    actionUserSign.setName(user.getName() + "印章");    //填写人员信息
+                    actionUserSign.setSerialNo("1");
+                    actionUserSign.setSealId(userSealId);   //人员印章id
+
+                    //添加盖章位置
+                    List<Location> principalLocationSigns = Lists.newArrayList();
+                    Location principalLocationSign = new Location();
+                    principalLocationSign.setDocumentId(documentList.get(0));
+                    //principalLocation.setPage(0);
+                    principalLocationSign.setRectType("SEAL_CORPORATE");
+                    principalLocationSign.setKeyword("项目负责人署名");
+                    principalLocationSign.setKeywordIndex(1);
+                    /*principalLocation.setOffsetX(0.7759);
+                    principalLocation.setOffsetY(0.1934);*/
+                    principalLocationSigns.add(principalLocationSign);
+                    actionUserSign.setLocations(principalLocationSigns);
+                    actions.add(actionUserSign);
                 }
             }
         }
@@ -4127,7 +4230,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         User technologyPrincipalUser = UserUtils.getByLoginName("陈红星");
         if(null != technologyPrincipalUser){
             //获取成员印章id信息
-            String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈红星个人签名章");
+            String userSealId = SignaturePostUtil.getUserSealByMobile(technologyPrincipalUser.getMobile(),"","陈星造价工程师印章");
             if(StringUtils.isNotBlank(userSealId)){
                 Action actionUser = new Action();
                 actionUser.setType("CORPORATE");
@@ -4139,12 +4242,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                 List<Location> principalLocations = Lists.newArrayList();
                 Location principalLocation = new Location();
                 principalLocation.setDocumentId(documentList.get(0));
-                principalLocation.setPage(0);
+                //principalLocation.setPage(0);
                 principalLocation.setRectType("SEAL_CORPORATE");
-                //principalLocation.setKeyword("签发人");
-                principalLocation.setKeywordIndex(-1);
-                principalLocation.setOffsetX(0.7518);
-                principalLocation.setOffsetY(0.1642);
+                principalLocation.setKeyword("技术负责人");
+                principalLocation.setKeywordIndex(2);
+                /*principalLocation.setOffsetX(0.7518);
+                principalLocation.setOffsetY(0.1642);*/
                 principalLocations.add(principalLocation);
                 actionUser.setLocations(principalLocations);
                 actions.add(actionUser);

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

@@ -2763,4 +2763,14 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		}
 		return "导入B类项目成功";
 	}
+
+	/**
+	 * 根据签章contractId查询报告信息
+	 * @param contractId
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public RuralProjectRecords getProjectRecordsByContractId(String contractId) {
+		return dao.getProjectRecordsByContractId(contractId);
+	}
 }

+ 25 - 8
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -38,6 +38,7 @@ import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsReportedDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.*;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageElectronicSealService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.utils.FileUtil;
@@ -121,6 +122,8 @@ public class RuralProjectMessageController extends BaseController {
     private RuralProjectRecordsReportedDao ruralProjectRecordsReportedDao;
     @Autowired
     private ProjectEngineeringService engineeringService;
+    @Autowired
+    private RuralProjectMessageElectronicSealService ruralProjectMessageElectronicSealService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -1912,6 +1915,16 @@ public class RuralProjectMessageController extends BaseController {
             }
             //MultipartFile转File
             File srcFile = FileUtil.transformMultipartFile(uploadFile);
+            //上传到阿里云上的文件
+            File uploadOssFile = FileUtil.transformMultipartFile(uploadFile);
+            ProjectReportData projectReportData = projectReportDataService.getReportDataByProjectId(records.getId());
+            //将文件上传到阿里云中 并替换已存在的相关文件
+            String uploadOssResult = ruralProjectMessageElectronicSealService.uploadOss(projectReportData, uploadOssFile);
+            if(StringUtils.isNotBlank(uploadOssResult)){
+                map.put("str",uploadOssResult);
+                return map;
+            }
+
             //截取文件名称
             String fileName = srcFile.getName().substring(0,srcFile.getName().lastIndexOf("."));
             //截取文件后缀名
@@ -1934,7 +1947,11 @@ public class RuralProjectMessageController extends BaseController {
                 return map;
             }
             //进行静默签署
-            ruralProjectMessageService.signbyCompany(contractId,documentList);
+            String signbyCompany = ruralProjectMessageService.signbyCompanyByKeyWord(contractId, documentList);
+            if(StringUtils.isNotBlank(signbyCompany)){
+                map.put("str",signbyCompany);
+                return map;
+            }
 
             //获取contractUrl路径
             /*String contractUrl = ruralProjectMessageService.getSignatureContractUrl(contractId);
@@ -1944,14 +1961,14 @@ public class RuralProjectMessageController extends BaseController {
             }*/
             //将documentId 和contractId存储到质量复核对应的数据种
             //签章完成则进行数据的保存
-            /*projectReportData.setSignatureFlag(1);
-            projectReportData.setSignatureDocumentId(documentId);
-            projectReportData.setSignatureContractId(contractId);
-            projectReportData.setSignatureFileName(fileName);
-            projectReportData.setSignatureUploadFileUser(UserUtils.getUser());
-            projectReportData.setSignatureUploadDate(new Date());
+            records.setReportSignatureFlag(1);
+            records.setReportSignatureDocumentId(documentId);
+            records.setReportSignatureContractId(contractId);
+            records.setReportSignatureFileName(fileName);
+            records.setReportSignatureUploadFileUser(UserUtils.getUser());
+            records.setReportSignatureUploadDate(new Date());
             //修改签章对应信息文件
-            projectReportDataService.updateSignatureInfo(projectReportData);*/
+            projectReportDataService.updateReportSignatureInfo(records);
             map.put("contractUrl","");
             map.put("str","审定单签章成功");
 

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

@@ -25,9 +25,11 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageNewSer
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.UserService;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.utils.SftpClientUtil;
 import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import freemarker.template.Configuration;
@@ -78,6 +80,8 @@ public class RuralProjectMessageElectronicSealController extends BaseController
     private ProjectReportDataService projectReportDataService;
     @Autowired
     private ActTaskService actTaskService;
+    @Autowired
+    private RuralProjectRecordsService ruralProjectRecordsService;
 
     @ModelAttribute
     public RuralProjectRecords get(@RequestParam(required=false) String id) {
@@ -153,6 +157,8 @@ public class RuralProjectMessageElectronicSealController extends BaseController
                     records1.getWorkContractInfo().setClientName(records1.getWorkContractInfo().getClient().getName());
                 }
             }
+            //将生成的文件上传到阿里云中
+            ruralProjectMessageElectronicSealService.getFile(records1);
         }
         if(StringUtils.isNotBlank(oldSubmitMoney)){
             projectRecords.setSubmitMoney(oldSubmitMoney);
@@ -658,7 +664,8 @@ public class RuralProjectMessageElectronicSealController extends BaseController
         File docFile = new File(projectName + " 报告签章.doc");
         FreemarkerUtil.generateFile(data,template,docFile);
         ResponseUtil.docResponse(projectName + " 报告签章.doc",docFile,response);
-
+        //将生成的文件上传到阿里云中
+        ruralProjectMessageElectronicSealService.uploadOss(projectReportData,docFile);
     }
 
     /**

+ 57 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureCallBackController.java

@@ -189,9 +189,9 @@ public class RuralProjectSignatureCallBackController extends BaseController {
                     stamper.setDocumentId(invalidDocumentId);
                     stamper.setType("SEAL_CORPORATE");
                     stamper.setSealId(location.getSealId());
-                    stamper.setPage(location.getPage());
-                    stamper.setX(location.getOffsetX());
-                    stamper.setY(location.getOffsetY());
+                    stamper.setPage(Integer.parseInt(location.getPage()));
+                    stamper.setX(Double.valueOf(location.getOffsetX()));
+                    stamper.setY(Double.valueOf(location.getOffsetY()));
                     stampers.add(stamper);
                 }
                 signByCompanyInfo.setStampers(stampers);
@@ -267,4 +267,58 @@ public class RuralProjectSignatureCallBackController extends BaseController {
         }
         return resultMap;
     }
+
+    /**
+     * 查看附件
+     */
+    @RequestMapping(value = "/getViewUrlByReportContractId", method=RequestMethod.GET)
+    @ResponseBody
+    public Map getViewUrlByReportContractId(String contractId) {
+        Map resultMap = new HashMap();
+        resultMap.put("success",false);
+        //根据contractId查询对应的报告信息
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.getProjectRecordsByContractId(contractId);
+        if(null == ruralProjectRecords || StringUtils.isBlank(ruralProjectRecords.getReportSignatureContractId())){
+            return resultMap;
+        }
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头c
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+
+        Map map =new HashMap();
+        map.put("contractId",contractId);
+        String viewUrlStr = SignaturePostUtil.doGet(map, HTTPTOP + "/contract/viewurl");
+        HashMap viewUrlStrMap = JSON.parseObject(viewUrlStr, HashMap.class);
+        String code = viewUrlStrMap.get("code").toString();
+        if("0".equals(code)){
+            resultMap.put("success",true);
+            resultMap.put("viewUrl",viewUrlStrMap.get("viewUrl").toString());
+            return resultMap;
+        }
+        return resultMap;
+    }
+
+
+
+    /**
+     * 下载附件
+     */
+    @RequestMapping(value = "/downLoadReportAttach", method=RequestMethod.GET)
+    public void downLoadReportAttach(String contractId,HttpServletResponse response) {
+        //根据contractId查询对应的报告信息
+        RuralProjectRecords ruralProjectRecords = projectRecordsService.getProjectRecordsByContractId(contractId);
+        if(null == ruralProjectRecords || StringUtils.isBlank(ruralProjectRecords.getReportSignatureContractId())){
+            return ;
+        }
+        //根据contractId将文件下载下来 并上传到阿里云服务种
+        //添加请求头
+        Map<String,String> requestHeaderMap = new HashMap<>();
+        requestHeaderMap.put("x-qys-accesstoken", apptoken);
+        requestHeaderMap.put("x-qys-signature", signature);
+        requestHeaderMap.put("x-qys-timestamp", "0");
+        SignaturePostUtil.downloadZipGet(HTTPTOP + "/contract/download?contractId="+contractId,requestHeaderMap,ruralProjectRecords.getReportSignatureFileName()+".zip","",response);
+    }
 }

+ 5 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectViewController.java

@@ -129,6 +129,11 @@ public class RuralProjectViewController extends BaseController {
         if (projectRecords!=null&& StringUtils.isNotBlank(projectRecords.getId())) {
             projectRecords = projectRecordsService.get(projectRecords.getId());
             projectRecordsService.queryProjectDetail(projectRecords);
+
+            if(null != projectRecords.getReportSignatureUploadFileUser() && StringUtils.isNotBlank(projectRecords.getReportSignatureUploadFileUser().getId())){
+                projectRecords.setReportSignatureUploadFileUser(UserUtils.get(projectRecords.getReportSignatureUploadFileUser().getId()));
+            }
+
             ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
             projectPlanInfo.setProjectId(projectRecords.getId());
             if(null != projectRecords.getWorkContractInfo()){

+ 6 - 47
src/main/resources/freemarker/projectSignature.ftl

@@ -837,7 +837,7 @@
 						<w:sz w:val="20"/>
 						<w:sz-cs w:val="20"/>
 					</w:rPr>
-					<w:t>编号:${number}</w:t>
+					<w:t>编号:${number}</w:t>
 				</w:r>
 			</w:p>
 			<w:tbl>
@@ -6921,7 +6921,7 @@
 						<w:sz-cs w:val="30"/>
 						<w:u w:val="single"/>
 					</w:rPr>
-					<w:t>${projectType}</w:t>
+					<w:t>工程${projectType}</w:t>
 				</w:r>
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
@@ -7102,7 +7102,7 @@
 						<w:sz-cs w:val="30"/>
 						<w:u w:val="single"/>
 					</w:rPr>
-					<w:t></w:t>
+					<w:t></w:t>
 				</w:r>
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
@@ -7228,7 +7228,7 @@
 													<w:sz w:val="15"/>
 													<w:sz-cs w:val="15"/>
 												</w:rPr>
-												<w:t>报告编号:${number}</w:t>
+												<w:t>报告编号:${number}</w:t>
 											</w:r>
 										</w:p>
 										<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
@@ -7987,7 +7987,7 @@
 						<w:sz w:val="28"/>
 						<w:sz-cs w:val="28"/>
 					</w:rPr>
-					<w:t>${number}</w:t>
+					<w:t>${number}</w:t>
 				</w:r>
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
@@ -10427,7 +10427,7 @@
 						<w:sz w:val="28"/>
 						<w:sz-cs w:val="28"/>
 					</w:rPr>
-					<w:t>签订的《${projectName}》</w:t>
+					<w:t>签订的《${contractName}》</w:t>
 				</w:r>
 				<w:r>
 					<w:rPr>
@@ -11132,14 +11132,6 @@
 						<w:sz-cs w:val="28"/>
 					</w:rPr>
 				</w:pPr>
-				<w:r>
-					<w:rPr>
-						<w:sz w:val="28"/>
-					</w:rPr>
-					<w:pict>
-						<v:oval id="椭圆 17" o:spid="_x0000_s1041" style="position:absolute;margin-left:225.8pt;margin-top:3.15pt;width:162pt;height:108pt;z-index:-7;mso-wrap-style:square;v-text-anchor:top" strokecolor="red"/>
-					</w:pict>
-				</w:r>
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
 				<w:pPr>
@@ -11151,39 +11143,6 @@
 						<w:sz-cs w:val="28"/>
 					</w:rPr>
 				</w:pPr>
-				<w:r>
-					<w:rPr>
-						<w:sz w:val="28"/>
-					</w:rPr>
-					<w:pict>
-						<v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
-							<v:stroke joinstyle="miter"/>
-							<v:path gradientshapeok="t" o:connecttype="rect"/>
-						</v:shapetype>
-						<v:shape id="文本框 18" o:spid="_x0000_s1042" type="#_x0000_t202" style="position:absolute;margin-left:257.4pt;margin-top:1.05pt;width:98.9pt;height:16.5pt;z-index:8;mso-wrap-style:square;v-text-anchor:top" strokecolor="red">
-							<v:textbox style="mso-fit-shape-to-text:t">
-								<w:txbxContent>
-									<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
-										<w:pPr>
-											<w:spacing w:after="78"/>
-											<w:rPr>
-												<w:color w:val="FF0000"/>
-											</w:rPr>
-										</w:pPr>
-										<w:r>
-											<w:rPr>
-												<w:rFonts w:hint="fareast"/>
-												<wx:font wx:val="宋体"/>
-												<w:color w:val="FF0000"/>
-											</w:rPr>
-											<w:t>公司公章、电子章</w:t>
-										</w:r>
-									</w:p>
-								</w:txbxContent>
-							</v:textbox>
-						</v:shape>
-					</w:pict>
-				</w:r>
 			</w:p>
 			<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00DE62EF">
 				<w:pPr>

+ 26 - 0
src/main/resources/mappings/modules/projectcontentinfo/ProjectReportDataDao.xml

@@ -1126,6 +1126,32 @@
 		WHERE id = #{id}
 	</update>
 
+	<update id="updateReportSignatureInfo">
+		UPDATE rural_project_records SET
+			<if test="reportSignatureDocumentId != null and reportSignatureDocumentId != ''">
+				report_signature_document_id = #{reportSignatureDocumentId}
+			</if>
+			<if test="reportSignatureInvalidDocumentId != null and reportSignatureInvalidDocumentId != ''">
+				,report_signature_invalid_document_id = #{reportSignatureInvalidDocumentId}
+			</if>
+			<if test="reportSignatureContractId != null and reportSignatureContractId != ''">
+				,report_signature_contract_id = #{reportSignatureContractId}
+			</if>
+			<if test="reportSignatureFlag != null and reportSignatureFlag != ''">
+				,report_signature_flag = #{reportSignatureFlag}
+			</if>
+			<if test="reportSignatureFileName != null and reportSignatureFileName != ''">
+				,report_signature_file_name = #{reportSignatureFileName}
+			</if>
+			<if test="reportSignatureUploadFileUser != null and reportSignatureUploadFileUser.id != null and reportSignatureUploadFileUser.id != ''">
+				,report_signature_upload_file_user = #{reportSignatureUploadFileUser.id}
+			</if>
+			<if test="reportSignatureUploadDate != null and reportSignatureUploadDate != ''">
+				,report_signature_upload_date = #{reportSignatureUploadDate}
+			</if>
+		WHERE id = #{id}
+	</update>
+
 	<select id="getProjectReportDataByContractId" resultType="ProjectReportData" >
 		SELECT
 		<include refid="projectReportDataColumns"/>

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

@@ -377,6 +377,9 @@ END) as projectScale*/
 		,prd.ZiXunShouRu as "money"
 		,prd.signature_flag as "signatureFlag"
 		,prd.signature_contract_id as "signatureContractId"
+		,a.report_signature_flag as "reportSignatureFlag"
+		,a.report_signature_contract_id as "reportSignatureContractId"
+		,prsi.id as "prsiId"
 		FROM rural_project_records a
 		LEFT JOIN sys_area area ON area.id = a.area_id
 		left join rural_project_records_reported rprr on rprr.id = a.id
@@ -401,6 +404,7 @@ END) as projectScale*/
 		left join project_paper_filing ppf on ppf.project_id = a.id
 		left join project_approval_signature pas on pas.project_id = a.id
 		left join project_report_signature prs on prs.project_id = a.id
+		left join project_report_signature_info prsi on prsi.project_report_id = prd.number
 		/*LEFT JOIN work_invoice_project_relation wip ON wip.project_id = a.id
 		LEFT JOIN work_invoice wi ON wi.id = wip.invoice_id*/
 		<where>

+ 1 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageElectronicSealDao.xml

@@ -3,6 +3,7 @@
 <mapper namespace="com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageElectronicSealDao">
 
 	<sql id="projectReportRecordColumns">
+			a.id as "id",
 			a.project_report_id,
 			a.submit_fee as "submit_fee",
 			a.authorize_fee as "authorize_fee",

+ 25 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -61,7 +61,7 @@
 		a.report_signature_contract_id as "reportSignatureContractId",
 		a.report_signature_invalid_document_id as "reportSignatureInvalidDocumentId",
 		a.report_signature_file_name as "reportSignatureFileName",
-		a.report_signature_upload_file_user as "reportSignatureUploadFileUser",
+		a.report_signature_upload_file_user as "reportSignatureUploadFileUser.id",
 		a.report_signature_upload_date as "reportSignatureUploadDate"
 	</sql>
 
@@ -94,6 +94,30 @@
 		WHERE a.id = #{id}
 	</select>
 
+	<select id="getProjectRecordsByContractId" resultType="RuralProjectRecords" >
+		SELECT
+			<include refid="projectRecordsColumns"/>
+		,a.file_num AS "fileNum"
+	    ,a.check_process_instance_id AS "checkProcessInstanceId"
+        ,su.name AS "createBy.name"
+        ,o.top_company AS "office.name"
+		,prd.number AS "projectReportNumber"
+		,prd.id AS "prdId"
+		,prr.id As "prrid"
+		,a.project_master_id as "projectMasterId"
+		,a.submit_money as "submitMoney"
+		,a.engineering_type as "engineeringType"
+		,supmi.name as "projectMasterName"
+        FROM rural_project_records a
+        <include refid="projectRecordsJoins"/>
+        LEFT JOIN sys_user su ON su.id = a.create_by
+        LEFT JOIN sys_user supmi ON supmi.id = a.project_master_id
+		left join project_report_data prd on prd.project_id = a.id
+		LEFT JOIN rural_project_report_record prr on prd.id = prr.report_id
+		LEFT JOIN sys_office o ON o.id = a.office_id
+		WHERE a.report_signature_contract_id = #{contractId}
+	</select>
+
 
 	<select id="getById" resultType="RuralProjectRecords" >
 		SELECT

+ 3 - 0
src/main/resources/mappings/modules/sys/WorkattachmentDao.xml

@@ -182,6 +182,9 @@
 			<if test="divIdType != null and divIdType != ''">
 				AND div_id_type = #{divIdType}
 			</if>
+			<if test="projectId != null and projectId != ''">
+				and project_id = #{projectId}
+			</if>
 		</where>
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 8 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/downloadType/importWordReportForm.jsp

@@ -37,13 +37,20 @@
 <div >
 	<div class="container view-form">
 		<form:form id="inputForm" modelAttribute="projectReportData" enctype="multipart/form-data" action="${ctx}/ruralProject/ruralProjectMessage/importReportFile" method="post" class="form-horizontal">
-			<form:hidden path="project.id" htmlEscape="false" value="${projectId}" class="form-control layui-input required"/>
+			<input type="hidden" id="projectId" name="projectId" value="${projectId}">
 			<input type="hidden" id="visitType" name="visitType" value="${visitType}">
 			<div class="form-group layui-row first">
 				<div class="layui-item layui-col-sm12 ">
 					<input id="uploadFile" name="uploadFile" type="file" style="width:330px"/>导入文件不能超过5M,仅允许导入“doc”或“docx”格式文件!<br/> 
 				</div>
 			</div>
+			<div class="layui-item layui-col-sm12">
+				<label class="layui-form-label double-line" style="padding-left: 0px"><span class="require-item">*</span>项目负责人:</label>
+				<div class="layui-input-block  ">
+					<sys:reportedtreeselectUserZXY id="principalUserId" name="principalUserId" value="" labelName="principalUserName" labelValue=""
+												   cssStyle="background-color: #fff" title="用户" url="/sys/office/treeDataAll?type=5" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+				</div>
+			</div>
 		</form:form>
 	</div>
 </div>

+ 84 - 4
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList.jsp

@@ -238,6 +238,77 @@
 			});
 		}
 
+
+		function openDialogreByReportImportFile(title,url,width,height,target,buttons) {
+			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
+				width = 'auto';
+				height = 'auto';
+			} else {//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			var split = buttons.split(",");
+			top.layer.open({
+				type: 2,
+				area: [width, height],
+				title: title,
+				maxmin: true, //开启最大化最小化按钮
+				skin: 'three-btns',
+				content: url,
+				btn: split,
+				btn1: function(index, layero){
+					//关闭当前页
+					top.layer.close(index)
+
+					/*parent.layer.msg('正在进行签章,大概需要5秒钟,请稍等', {
+						icon: 1,
+						time: 5000 //2秒关闭(如果不配置,默认是3秒)
+					}, function(){
+						//do something
+					});*/
+					parent.layer.msg("正在进行签章,大概需要5秒钟,请稍等",{icon:1});
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					inputForm.attr("action","${ctx}/ruralProject/ruralProjectMessage/importReportFile");//表单提交成功后,从服务器返回的url在当前tab中展示
+					var $document = iframeWin.contentWindow.document;
+
+					formSubmitsignature($document,"inputForm",index);
+					/*if(iframeWin.contentWindow.doSubmit(1) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}*/
+				},
+				btn2:function(index,layero){
+					if(split.length==2){return}
+					var body = top.layer.getChildFrame('body', index);
+					var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+					var inputForm = body.find('#inputForm');
+					var top_iframe;
+					if(target){
+						top_iframe = target;//如果指定了iframe,则在改frame中跳转
+					}else{
+						top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
+					}
+					inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
+					if(iframeWin.contentWindow.doSubmit(2) ){
+						// top.layer.close(index);//关闭对话框。
+						setTimeout(function(){top.layer.close(index)}, 100);//延时0.1秒,对应360 7.1版本bug
+					}else {
+						return false;
+					}
+				},
+				btn3: function (index) {
+				}
+			});
+		}
+
 		function openDialogre(title,url,width,height,target,buttons) {
 
 			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
@@ -1134,11 +1205,17 @@
 							}else if(d.reportSignatureStatus == 5){
 								//上传审定单进行签章
 								<shiro:hasPermission name="ruralProject:ruralProjectMessage:importReportFile">
-								if(d.signatureFlag != "1"){
-									xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogreByImportFile('上传报告签章', '${ctx}/ruralProject/ruralProjectMessage/skipImportReportWord?id=" + d.id + "&visitType=1','400px', '35%','','导入,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 报告签章</a>";
+								if(d.reportSignatureFlag != "1"){
+									xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogreByReportImportFile('上传报告签章', '${ctx}/ruralProject/ruralProjectMessage/skipImportReportWord?id=" + d.id + "&visitType=1','500px', '300px','','导入,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 报告签章</a>";
+								}
+								if(d.signatureDownloadUrl != null && d.signatureDownloadUrl != undefined && d.signatureDownloadUrl != ""){
+									xml+="<a href=\""+d.signatureDownloadUrl+"\" class=\"layui-btn  layui-btn-xs\">报告下载</a>"
+								}else{
+									if(d.prsiId != null && d.prsiId != undefined && d.prsiId != ""){
+										//报告下载
+										xml+="<a href=\"${ctx}/ruralProject/electronicSeal/downloadMassControl?id="+ d.pidId +"\" class=\"layui-btn  layui-btn-xs\">报告下载</a>"
+									}
 								}
-								//报告下载
-								xml+="<a href=\"javascript:location.href='${ctx}/ruralProject/electronicSeal/downloadMassControl?id="+ d.pidId +"\" class=\"layui-btn  layui-btn-xs\">报告下载</a>"
 								//自动生成电子签章报告(在有报告的前提下可使用,没有报告信息则不进行展示该按钮)
 								//xml+="<a href=\"${ctx}/ruralProject/electronicSeal/downloadMassControl?id="+ d.pidId +"\" onclick=\"return confirmx('确认要自动生成报告签章吗?', this.href)\" class=\"layui-btn  layui-btn-xs\" > 自动生成报告签章</a>";
 								</shiro:hasPermission>
@@ -1201,11 +1278,14 @@
 					,"submitMoney":"${projectRecords.submitMoney}"
 					,"money":"${projectRecords.money}"
 					,"signatureFlag":"${projectRecords.signatureFlag}"
+					,"reportSignatureFlag":"${projectRecords.reportSignatureFlag}"
 					,"signatureContractId":"${projectRecords.signatureContractId}"
 					,"approvalSignatureStatus":"${projectRecords.approvalSignatureStatus}"
 					,"approvalSignatureProcessInstanceId":"${projectRecords.approvalSignatureProcessInstanceId}"
 					,"reportSignatureStatus":"${projectRecords.reportSignatureStatus}"
 					,"reportSignatureProcessInstanceId":"${projectRecords.reportSignatureProcessInstanceId}"
+					,"prsiId":"${projectRecords.prsiId}"
+					,"signatureDownloadUrl":"${projectRecords.signatureDownloadUrl}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">

+ 55 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/view/ruralProjectRecordsView.jsp

@@ -65,6 +65,24 @@
 			<%--}--%>
 		})
 
+
+		function openSignatureview(contractId){
+			$.ajax({
+				type:"get",
+				url:'${ctx}/ruralProject/signatureCallBack/getViewUrlByReportContractId',
+				data:{
+					"contractId":contractId
+				},
+				dataType:"json",
+				success:function(data){
+					if(data.success) {
+						window.open(data.viewUrl);
+					}else {
+						top.layer.msg("文件预览页打开失败", {icon: 0});
+					}
+				}
+			})
+		}
 	</script>
 </head>
 <body>
@@ -384,6 +402,43 @@
 					</table>
 				</div>
 			</div>
+			<c:if test="${projectRecords.reportSignatureFlag == 1}">
+				<div class="form-group layui-row">
+					<div class="form-group-label"><h2>审定单签章附件表</h2></div>
+					<div class="layui-item layui-col-xs12 form-table-container" >
+						<table id="contentTable" class="table table-bordered table-condensed no-bottom-margin details">
+							<thead>
+							<tr>
+
+								<th>文件</th>
+								<th>上传人</th>
+								<th>上传时间</th>
+								<th width="180px">操作</th>
+							</tr>
+							</thead>
+							<tbody>
+							<c:choose>
+								<c:when test="${projectRecords.reportSignatureFlag == 1}">
+									<tr>
+										<td><a class="attention-info" href="javascript:void(0)" onclick="openSignatureview('${projectRecords.reportSignatureContractId}')">${projectRecords.reportSignatureFileName}.zip</a></td>
+										<td>${projectRecords.reportSignatureUploadFileUser.name}</td>
+										<td><fmt:formatDate value="${projectRecords.reportSignatureUploadDate}" type="both"/></td>
+										<td class="op-td">
+											<a href="javascript:location.href='${ctx}/ruralProject/signatureCallBack/downLoadReportAttach?contractId=${projectRecords.reportSignatureContractId}'" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+										</td>
+									</tr>
+								</c:when>
+								<c:otherwise>
+									<tr>
+										<td colspan="4" align="center">暂无数据</td>
+									</tr>
+								</c:otherwise>
+							</c:choose>
+							</tbody>
+						</table>
+					</div>
+				</div>
+			</c:if>
 			<div class="form-group layui-row">
 				<div class="form-group-label"><h2>审批流程</h2></div>
 				<div class="layui-item layui-col-xs12 form-table-container" >