Quellcode durchsuchen

新增报告,修改添加历史记录以及查看功能

user5 vor 4 Jahren
Ursprung
Commit
1057350742
17 geänderte Dateien mit 897 neuen und 26 gelöschten Zeilen
  1. 6 6
      src/main/java/com/jeeplus/common/persistence/DataEntity.java
  2. 2 2
      src/main/java/com/jeeplus/common/persistence/TreeEntity.java
  3. 23 0
      src/main/java/com/jeeplus/modules/historical/dao/HistoricalDao.java
  4. 77 0
      src/main/java/com/jeeplus/modules/historical/entity/HistoricalData.java
  5. 47 0
      src/main/java/com/jeeplus/modules/historical/service/HistoricalService.java
  6. 72 5
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java
  7. 77 3
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java
  8. 78 6
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java
  9. 61 0
      src/main/resources/mappings/modules/historical/HistoricalDao.xml
  10. 2 2
      src/main/webapp/webpage/modules/projectrecord/projectRecordsModify.jsp
  11. 1 0
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/projectEarlyForm.jsp
  12. 1 0
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/projectReportRecordForm.jsp
  13. 2 2
      src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp
  14. 1 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp
  15. 90 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalListView.jsp
  16. 356 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalView.jsp
  17. 1 0
      src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

+ 6 - 6
src/main/java/com/jeeplus/common/persistence/DataEntity.java

@@ -23,12 +23,12 @@ public abstract class DataEntity<T> extends BaseEntity<T> {
 
 	private static final long serialVersionUID = 1L;
 	
-	protected String remarks;	// 备注
-	protected User createBy;	// 创建者
-	protected Date createDate;	// 创建日期
-	protected User updateBy;	// 更新者
-	protected Date updateDate;	// 更新日期
-	protected String delFlag; 	// 删除标记(0:正常;1:删除;2:审核)
+	protected transient String remarks;	// 备注
+	protected transient User createBy;	// 创建者
+	protected transient Date createDate;	// 创建日期
+	protected transient User updateBy;	// 更新者
+	protected transient Date updateDate;	// 更新日期
+	protected transient String delFlag; 	// 删除标记(0:正常;1:删除;2:审核)
 
 	public DataEntity() {
 		super();

+ 2 - 2
src/main/java/com/jeeplus/common/persistence/TreeEntity.java

@@ -21,8 +21,8 @@ public abstract class TreeEntity<T> extends DataEntity<T> {
 	private static final long serialVersionUID = 1L;
 
 	protected T parent;	// 父级编号
-	protected String parentIds; // 所有父级编号
-	protected String name; 	// 机构名称
+	protected transient String parentIds; // 所有父级编号
+	protected transient String name; 	// 机构名称
 	protected Integer sort;		// 排序
 	
 	public TreeEntity() {

+ 23 - 0
src/main/java/com/jeeplus/modules/historical/dao/HistoricalDao.java

@@ -0,0 +1,23 @@
+package com.jeeplus.modules.historical.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.historical.entity.HistoricalData;
+
+import java.util.List;
+
+/**
+ * 操作历史数据记录dao
+ * @author: 大猫
+ * @create: 2021-01-07 14:16
+ **/
+@MyBatisDao
+public interface HistoricalDao extends CrudDao<HistoricalData> {
+
+    /**
+     * 根据参数获取数据信息集合
+     * @param data
+     * @return
+     */
+    List<HistoricalData> getHistoricalDataList(HistoricalData data);
+}

+ 77 - 0
src/main/java/com/jeeplus/modules/historical/entity/HistoricalData.java

@@ -0,0 +1,77 @@
+package com.jeeplus.modules.historical.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+
+import java.util.Date;
+
+/**
+ * 操作历史数据表
+ * @author: 大猫
+ * @create: 2021-01-07 14:12
+ **/
+public class HistoricalData extends DataEntity<HistoricalData>  {
+
+    private String dataType;        //业务模块类型,项目归档:1(后续具体业务模块调用继续增加,业务模块对应数据库类型值需在代码中用静态类维护)
+    private String dataId;          //业务数据id,如项目归档中保存归档数据id
+    private String ip;              //操作IP地址
+    private String operator;        //操作用户id
+    private String operatorName;        //操作用户名称
+    private Date operateTime;       //保存操作时间
+    private String dataObj;         //具体历史数据,保存历史数据对象的json格式字符串(历史文件保存文件名)
+
+    public String getDataType() {
+        return dataType;
+    }
+
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+
+    public String getDataId() {
+        return dataId;
+    }
+
+    public void setDataId(String dataId) {
+        this.dataId = dataId;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public Date getOperateTime() {
+        return operateTime;
+    }
+
+    public void setOperateTime(Date operateTime) {
+        this.operateTime = operateTime;
+    }
+
+    public String getDataObj() {
+        return dataObj;
+    }
+
+    public void setDataObj(String dataObj) {
+        this.dataObj = dataObj;
+    }
+}

+ 47 - 0
src/main/java/com/jeeplus/modules/historical/service/HistoricalService.java

@@ -0,0 +1,47 @@
+package com.jeeplus.modules.historical.service;
+
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.modules.historical.dao.HistoricalDao;
+import com.jeeplus.modules.historical.entity.HistoricalData;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 操作历史数据记录service
+ * @author: 大猫
+ * @create: 2021-01-07 14:11
+ **/
+@Service
+@Transactional(readOnly = true)
+public class HistoricalService  extends CrudService<HistoricalDao, HistoricalData> {
+
+    /**
+     * 根据id获取数据信息
+     * @param id
+     * @return
+     */
+    public HistoricalData get(String id) {
+        return super.get(id);
+    }
+
+    /**
+     * 根据参数获取数据信息集合
+     * @param data
+     * @return
+     */
+    public List<HistoricalData> getHistoricalDataList(HistoricalData data){
+        return dao.getHistoricalDataList(data);
+    }
+
+    /**
+     * 新增数据信息
+     * @param data
+     */
+    @Transactional(readOnly = false)
+    public void save(HistoricalData data){
+        super.save(data);
+    }
+
+}

+ 72 - 5
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -1,20 +1,27 @@
 package com.jeeplus.modules.ruralprojectrecords.service;
 
 import com.google.common.collect.Maps;
+import com.google.gson.Gson;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.service.CrudService;
 import com.jeeplus.common.utils.Collections3;
 import com.jeeplus.common.utils.DateUtils;
 import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.historical.entity.HistoricalData;
+import com.jeeplus.modules.historical.service.HistoricalService;
 import com.jeeplus.modules.isignature.service.ISignatureDocumentService;
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
+import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 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.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
+import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
@@ -22,10 +29,7 @@ import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectMessageDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralProjectRecordsReportedDao;
 import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
-import com.jeeplus.modules.ruralprojectrecords.entity.ReportedConsultant;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsReported;
-import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectReportData;
+import com.jeeplus.modules.ruralprojectrecords.entity.*;
 import com.jeeplus.modules.ruralprojectrecords.utils.RuralProjectReportedUtil;
 import com.jeeplus.modules.sys.dao.WorkattachmentDao;
 import com.jeeplus.modules.sys.entity.*;
@@ -64,6 +68,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -127,6 +132,12 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
     private RuralProjectRecordsReportedDao ruralProjectRecordsReportedDao;
     @Autowired
     private RuralProjectRecordsService ruralProjectRecordsService;
+    @Autowired
+    private HistoricalService historicalService;
+    @Autowired
+    private ProjectcontentinfoService projectcontentinfoService;
+    @Autowired
+    private ProjectTemplateService projectTemplateService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -307,9 +318,64 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
         return "true";
     }
 
+    public String getReportToJson(Projectcontentinfo projectcontentinfo){
+        RuralProjectcontentinfo info = new RuralProjectcontentinfo();
+        try {
+            MyBeanUtils.copyBeanNotNull2Bean(projectcontentinfo,info);//将编辑表单中的非NULL值覆盖数据库记录中的值
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProject().getId());
+        String dictType = projectcontentinfo.getDictType();
+        RuralProjectRecords records = ruralProjectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+        info.setProject(records);
+        ProjectReportData projectReportData = new ProjectReportData();
+        projectReportData.setType(dictType);
+        if (com.jeeplus.common.utils.StringUtils.isNotBlank(projectcontentinfo1.getInfoId())){
+            projectReportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+        }else if (info.getProjectReportData()!=null && com.jeeplus.common.utils.StringUtils.isNotBlank(info.getProjectReportData().getId())) {
+            projectReportData = projectReportDataService.get(info.getProjectReportData().getId());
+        }else {
+            projectReportData.setNumber("");
+        }
+        if (projectReportData.getMaster()==null || com.jeeplus.common.utils.StringUtils.isBlank(projectReportData.getMaster().getId())){
+            projectReportData.setMaster(UserUtils.getUser());
+        }
+        if (com.jeeplus.common.utils.StringUtils.isBlank(projectReportData.getStatus())){
+            projectReportData.setFileStatus("1");
+        }
+        info.setProjectReportData(projectReportData);
+        //查询报告文件、依据性文件、其他文件必填列表以及数据
+        List<MainDictDetail> mainDictDetails = projectTemplateService.attachmentTemplateList();
+        for (MainDictDetail mainDict:mainDictDetails) {
+            ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
+            //添加项目类型
+            relateInfo.setProjectType("1");
+            //添加报告类型
+            relateInfo.setRequiredStage(1);
+            relateInfo.setId(records.getId());
+            relateInfo.setAttachType(mainDict.getValue());
+            switch(mainDict.getValue()){
+                case "11" :
+                    info.setFileAttachmentList(projectTemplateService.getProjectTemplateList(relateInfo));
+                    break;
+                case "12" :
+                    info.setFileGistdataList(projectTemplateService.getProjectTemplateList(relateInfo));
+                    break;
+                case "13" :
+                    info.setFileOtherList(projectTemplateService.getProjectTemplateList(relateInfo));
+                    break;
+            }
+        }
+
+        Gson gson = new Gson();
+        String toJson = gson.toJson(info);
+        return toJson;
+    }
+
 
     @Transactional(readOnly = false)
-    public String adminModifyReport(Projectcontentinfo projectcontentinfo) {
+    public String adminModifyReport(Projectcontentinfo projectcontentinfo,HistoricalData historicalData) {
         Projectcontentinfo s = new Projectcontentinfo();
         s.setParentIds("0,");
         s.setProject(projectcontentinfo.getProject());
@@ -339,6 +405,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             contentinfo.setInfoId(projectReportData.getId());
             projectcontentinfoDao.updateInfoId(contentinfo);
         }
+        historicalService.save(historicalData);
         return "true";
     }
 

+ 77 - 3
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java

@@ -1,5 +1,6 @@
 package com.jeeplus.modules.ruralprojectrecords.web;
 
+import com.google.gson.Gson;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.MyBeanUtils;
@@ -7,6 +8,8 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
+import com.jeeplus.modules.historical.entity.HistoricalData;
+import com.jeeplus.modules.historical.service.HistoricalService;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -83,6 +86,8 @@ public class RuralCostProjectMessageController extends BaseController {
     private ProjectPlanService projectPlanService;
     @Autowired
     private ProjectTemplateService projectTemplateService;
+    @Autowired
+    private HistoricalService historicalService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -133,7 +138,7 @@ public class RuralCostProjectMessageController extends BaseController {
                 records1.setView("false");
             }
             //判断是否为admin
-            if (UserUtils.isManager()){
+            if (UserUtils.getUser().isAdmin()){
                 records1.setFlagAdmin("1");
             }else{
                 records1.setFlagAdmin("0");
@@ -280,9 +285,16 @@ public class RuralCostProjectMessageController extends BaseController {
      * @return
      */
     @RequestMapping(value = {"adminModifyReport"})
-    public String adminModifyReport(Projectcontentinfo projectcontentinfo, Model model,RedirectAttributes redirectAttributes)  {
+    public String adminModifyReport(Projectcontentinfo projectcontentinfo,HttpServletRequest request, Model model,RedirectAttributes redirectAttributes)  {
         try{
-            String str = ruralProjectMessageService.adminModifyReport(projectcontentinfo);
+            String toJson = ruralProjectMessageService.getReportToJson(projectcontentinfo);
+            HistoricalData historicalData = new HistoricalData();
+            historicalData.setDataType("1");
+            historicalData.setDataId(projectcontentinfo.getProjectReportData().getId());
+            historicalData.setIp(StringUtils.getRemoteAddr(request));
+            historicalData.setOperator(UserUtils.getUser().getId());
+            historicalData.setDataObj(toJson);
+            String str = ruralProjectMessageService.adminModifyReport(projectcontentinfo,historicalData);
             addMessage(redirectAttributes, "修改报告"+(str.equals("true")?"成功":"失败"));
             ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
             if (projectReportData!=null){
@@ -301,6 +313,68 @@ public class RuralCostProjectMessageController extends BaseController {
         ProjectRecords projectRecords = projectcontentinfo.getProject()==null?new ProjectRecords():projectcontentinfo.getProject();
         return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
     }
+    /**
+     * 查询管理员变更的所有新增报告数据信息
+     * @param projectcontentinfo
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequestMapping("getReportModifyList")
+    public String getReportModifyList(RuralProjectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
+        model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
+        String dictType = projectcontentinfo.getDictType();
+        RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+        model.addAttribute("projectRecords", records);
+        projectcontentinfo.setProject(records);
+        ProjectReportData projectReportData = new ProjectReportData();
+        projectReportData.setType(dictType);
+        if (StringUtils.isNotBlank(projectcontentinfo1.getInfoId())){
+            projectReportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+        }else if (projectcontentinfo.getProjectReportData()!=null && StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
+            projectReportData = projectReportDataService.get(projectcontentinfo.getProjectReportData().getId());
+        }else {
+            projectReportData.setNumber("");
+        }
+        HistoricalData historicalData = new HistoricalData();
+        historicalData.setDataType("1");
+        historicalData.setDataId(projectReportData.getId());
+        List<HistoricalData> historicalDataList = historicalService.getHistoricalDataList(historicalData);
+        model.addAttribute("historicalDataList",historicalDataList);
+        return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalListView";
+    }
+
+    /**
+     * 根据id获取报告历史变更数据信息
+     * @param historicalData
+     * @return
+     */
+    @RequestMapping("/getReportHistoricalInfo")
+    public String getReportHistoricalInfo(HistoricalData historicalData,Model model){
+        RuralProjectcontentinfo projectcontentinfo = new RuralProjectcontentinfo();
+        historicalData = historicalService.get(historicalData);
+        Gson gson = new Gson();
+        if(StringUtils.isNotBlank(historicalData.getDataObj())){
+            projectcontentinfo = gson.fromJson(historicalData.getDataObj(), RuralProjectcontentinfo.class);
+        }
+        //获取历史报告信息并处理成果类型数据信息
+        ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
+        if(null != projectReportData){
+            List<MainDictDetail> achievementTypes = DictUtils.getMainDictList("achievement_type");
+            if(null != achievementTypes){
+                for (MainDictDetail achievementType:achievementTypes) {
+                    if(achievementType.getValue().equals(projectReportData.getAchievementType())){
+                        projectReportData.setAchievementType(achievementType.getLabel());
+                        break;
+                    }
+                }
+            }
+        }
+        model.addAttribute("projectcontentinfo",projectcontentinfo);
+        return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalView";
+    }
 
 
     /**

+ 78 - 6
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -1,14 +1,15 @@
 package com.jeeplus.modules.ruralprojectrecords.web;
 
+import com.google.gson.Gson;
 import com.jeeplus.common.config.Global;
-import com.jeeplus.common.json.AjaxJson;
 import com.jeeplus.common.persistence.Page;
 import com.jeeplus.common.utils.MyBeanUtils;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
-import com.jeeplus.modules.oa.entity.OaNotify;
+import com.jeeplus.modules.historical.entity.HistoricalData;
+import com.jeeplus.modules.historical.service.HistoricalService;
 import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
 import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -86,6 +87,8 @@ public class RuralProjectMessageController extends BaseController {
     private ProjectPlanService projectPlanService;
     @Autowired
     private ProjectTemplateService projectTemplateService;
+    @Autowired
+    private HistoricalService historicalService;
 
     private static byte[] SYN_BYTE = new byte[0];
 
@@ -136,7 +139,7 @@ public class RuralProjectMessageController extends BaseController {
                 records1.setView("false");
             }
             //判断是否为admin
-            if (UserUtils.isManager()){
+            if (UserUtils.getUser().isAdmin()){
                 records1.setFlagAdmin("1");
             }else{
                 records1.setFlagAdmin("0");
@@ -281,9 +284,16 @@ public class RuralProjectMessageController extends BaseController {
      * @return
      */
     @RequestMapping(value = {"adminModifyReport"})
-    public String adminModifyReport(Projectcontentinfo projectcontentinfo, Model model,RedirectAttributes redirectAttributes)  {
+    public String adminModifyReport(Projectcontentinfo projectcontentinfo,HttpServletRequest request, Model model,RedirectAttributes redirectAttributes)  {
         try{
-            String str = ruralProjectMessageService.adminModifyReport(projectcontentinfo);
+            String toJson = ruralProjectMessageService.getReportToJson(projectcontentinfo);
+            HistoricalData historicalData = new HistoricalData();
+            historicalData.setDataType("1");
+            historicalData.setDataId(projectcontentinfo.getProjectReportData().getId());
+            historicalData.setIp(StringUtils.getRemoteAddr(request));
+            historicalData.setOperator(UserUtils.getUser().getId());
+            historicalData.setDataObj(toJson);
+            String str = ruralProjectMessageService.adminModifyReport(projectcontentinfo,historicalData);
             addMessage(redirectAttributes, "修改报告"+(str.equals("true")?"成功":"失败"));
             ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
             if (projectReportData!=null){
@@ -304,6 +314,69 @@ public class RuralProjectMessageController extends BaseController {
     }
 
     /**
+     * 查询管理员变更的所有新增报告数据信息
+     * @param projectcontentinfo
+     * @param request
+     * @param response
+     * @param model
+     * @return
+     */
+    @RequestMapping("getReportModifyList")
+    public String getReportModifyList(RuralProjectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
+        model.addAttribute("parentIds", projectcontentinfo1.getParentIds());
+        String dictType = projectcontentinfo.getDictType();
+        RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
+        model.addAttribute("projectRecords", records);
+        projectcontentinfo.setProject(records);
+        ProjectReportData projectReportData = new ProjectReportData();
+        projectReportData.setType(dictType);
+        if (StringUtils.isNotBlank(projectcontentinfo1.getInfoId())){
+            projectReportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
+        }else if (projectcontentinfo.getProjectReportData()!=null && StringUtils.isNotBlank(projectcontentinfo.getProjectReportData().getId())) {
+            projectReportData = projectReportDataService.get(projectcontentinfo.getProjectReportData().getId());
+        }else {
+            projectReportData.setNumber("");
+        }
+        HistoricalData historicalData = new HistoricalData();
+        historicalData.setDataType("1");
+        historicalData.setDataId(projectReportData.getId());
+        List<HistoricalData> historicalDataList = historicalService.getHistoricalDataList(historicalData);
+        model.addAttribute("historicalDataList",historicalDataList);
+        return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalListView";
+    }
+
+    /**
+     * 根据id获取报告历史变更数据信息
+     * @param historicalData
+     * @return
+     */
+    @RequestMapping("/getReportHistoricalInfo")
+    public String getReportHistoricalInfo(HistoricalData historicalData,Model model){
+        RuralProjectcontentinfo projectcontentinfo = new RuralProjectcontentinfo();
+        historicalData = historicalService.get(historicalData);
+        Gson gson = new Gson();
+        if(StringUtils.isNotBlank(historicalData.getDataObj())){
+            projectcontentinfo = gson.fromJson(historicalData.getDataObj(), RuralProjectcontentinfo.class);
+        }
+        //获取历史报告信息并处理成果类型数据信息
+        ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
+        if(null != projectReportData){
+            List<MainDictDetail> achievementTypes = DictUtils.getMainDictList("achievement_type");
+            if(null != achievementTypes){
+                for (MainDictDetail achievementType:achievementTypes) {
+                    if(achievementType.getValue().equals(projectReportData.getAchievementType())){
+                        projectReportData.setAchievementType(achievementType.getLabel());
+                        break;
+                    }
+                }
+            }
+        }
+        model.addAttribute("projectcontentinfo",projectcontentinfo);
+        return "modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalView";
+    }
+
+    /**
      * 判断是否含有报告信息
      * @param id
      * @return
@@ -328,7 +401,6 @@ public class RuralProjectMessageController extends BaseController {
     @RequiresPermissions(value={"ruralProject:ruralProjectMessage:edit"},logical= Logical.OR)
     @RequestMapping(value = "modify")
     public String modify(RuralProjectcontentinfo projectcontentinfo,Integer status, Model model, RedirectAttributes redirectAttributes) {
-        System.out.println(status);
         Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
         ProjectReportData projectReportData = projectReportDataService.getOnRural(projectcontentinfo1.getInfoId());
         Projectcontentinfo projectcontent = projectcontentinfoService.getByInfoId(projectReportData.getId());

+ 61 - 0
src/main/resources/mappings/modules/historical/HistoricalDao.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.modules.historical.dao.HistoricalDao">
+    
+	<sql id="historicalColumns">
+		a.id as "id",
+		a.data_type as "dataType",
+		a.data_id as "dataId",
+		a.ip as "ip",
+		a.create_by as "createBy.id",
+		a.create_date as "createDate",
+		a.operator as "operator",
+		a.operate_time as "operateTime",
+		a.data_obj as "dataObj"
+	</sql>
+
+	<select id="get" resultType="com.jeeplus.modules.historical.entity.HistoricalData" >
+		SELECT 
+			<include refid="historicalColumns"/>
+		,su.name as "operatorName"
+		FROM historical_data a
+		left join sys_user su on su.id = a.operator
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="getHistoricalDataList" resultType="com.jeeplus.modules.historical.entity.HistoricalData" >
+		SELECT
+			<include refid="historicalColumns"/>
+			,su.name as "operatorName"
+		FROM historical_data a
+		left join sys_user su on su.id = a.operator
+		WHERE a.data_type = #{dataType} and a.data_id = #{dataId}
+		order by a.operate_time asc
+	</select>
+	
+	<insert id="insert">
+		insert into historical_data (
+		  id,
+		  data_type,
+		  data_id,
+		  ip,
+		  create_by,
+		  create_date,
+		  operator,
+		  operate_time,
+		  data_obj
+		)
+		values
+		  (
+			#{id},
+			#{dataType},
+			#{dataId},
+			#{ip},
+			#{createBy.id},
+			#{createDate},
+			#{operator},
+			now(),
+			#{dataObj}
+		  ) ;
+	</insert>
+</mapper>

+ 2 - 2
src/main/webapp/webpage/modules/projectrecord/projectRecordsModify.jsp

@@ -811,8 +811,8 @@
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>审批流程</h2></div>
                 <div class="layui-item layui-col-xs12 form-table-container" >
-                    <act:flowChart procInsId="${processInstanceId}"/>
-                    <act:histoicFlow procInsId="${processInstanceId}"/>
+                    <act:flowChart procInsId="${projectRecords.processInstanceId}"/>
+                    <act:histoicFlow procInsId="${projectRecords.processInstanceId}"/>
                 </div>
             </div>
             <div class="form-group layui-row page-end"></div>

+ 1 - 0
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/projectEarlyForm.jsp

@@ -96,6 +96,7 @@
 			<form:hidden path="id"/>
 			<form:hidden path="numberCount"/>
 			<form:hidden id="reportId" path="report.id"/>
+			<form:hidden path="report.project.id"/>
 			<%-- 全过程中实施前期进行归档则添加判定字符 方便调转 --%>
 			<input type="hidden" input="condition" name="condition" value="earlyArchive">
 

+ 1 - 0
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/projectReportRecordForm.jsp

@@ -96,6 +96,7 @@
 			<form:hidden path="id"/>
 			<form:hidden path="numberCount"/>
 			<form:hidden id="reportId" path="report.id"/>
+			<form:hidden path="report.project.id"/>
 			<%-- 全过程中竣工阶段进行归档则添加判定字符 方便调转 --%>
 			<input type="hidden" input="condition" name="condition" value="completionArchive">
 

+ 2 - 2
src/main/webapp/webpage/modules/projectrecord/workContentFromAndView/workFollowModify.jsp

@@ -869,8 +869,8 @@
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>审批流程</h2></div>
                 <div class="layui-item layui-col-xs12 form-table-container" >
-                    <act:flowChart procInsId="${processInstanceId}"/>
-                    <act:histoicFlow procInsId="${processInstanceId}"/>
+                    <act:flowChart procInsId="${projectFollowReport.processInstanceId}"/>
+                    <act:histoicFlow procInsId="${projectFollowReport.processInstanceId}"/>
                 </div>
             </div>
         </form:form>

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

@@ -525,6 +525,7 @@
 						if(d.deleteAdmin != undefined && d.deleteAdmin =="1")
 						{
 							xml+="<a href=\"#\" onclick=\"openDialogre('修改项目报告', '${ctx}/ruralProject/ruralCostProjectMessage/adminModifyForm?projectId=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改报告</a>";
+							xml+="<a href=\"#\" onclick=\"openDialogView('历史报告', '${ctx}/ruralProject/ruralProjectMessage/getReportModifyList?projectId=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-delete\" style=\"background-color:#5FB878;\" ><i class=\"fa fa-eye\"></i> 历史报告</a>";
 						}
                         return xml;
 

+ 90 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalListView.jsp

@@ -0,0 +1,90 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>收文管理管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+			if(validateForm.form()){
+				$("#inputForm").submit();
+				return true;
+			}
+
+			return false;
+		}
+		$(document).ready(function() {
+			validateForm = $("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+			$("#attachment_btn").click(function () {
+				$("#attachment_file").click();
+			});
+		});
+
+		function insertTitle(tValue){
+			var list = "${workIncomingMessage.workAttachments}";
+			var size = (list.split('url')).length-1;
+			var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+				var attachmentId = "";
+				var attachmentFlag = "100";
+				console.log(file);
+				var timestamp=new Date().getTime();
+
+				var storeAs = "attachment-file/workIncomingMessage/"+timestamp+"/"+file['name'];
+				var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
+				var divId = "_attachment";
+				$("#addFile"+divId).show();
+				multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>报告历史变更信息</h2></div>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+								<%-- <th>序号</th>--%>
+							<th>修改人</th>
+							<th>修改时间</th>
+							<th width="150px">操作</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${historicalDataList}" var = "data" varStatus="status">
+							<tr>
+									<%-- <td>${status.index + 1}</td>--%>
+								<td>${data.operatorName}</td>
+								<td><fmt:formatDate value="${data.createDate}" type="both"/></td>
+								<td class="op-td">
+									<div class="op-btn-box" >
+										<a href="javascript:void(0)"  onclick="openDialogView('历史详情', '${ctx}/ruralProject/ruralProjectMessage/getReportHistoricalInfo?id=${data.id}','95%','95%')" class="op-btn op-btn-edit" ><i class="fa fa-eye"></i> 查看详情</a>
+									</div>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+	</div>
+</div>
+</body>
+</html>

+ 356 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/reportHistoricalView.jsp

@@ -0,0 +1,356 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>报告详情管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+
+	</script>
+</head>
+
+<body>
+<div class="single-form">
+	<div class="container${container}  view-form">
+		<form:form id="inputForm" modelAttribute="projectcontentinfo" action="${ctx}/ruralProject/ruralProjectMessage/reportAudit" method="post" class="form-horizontal">
+			<div class="form-group layui-row first lw12">
+				<div class="form-group-label"><h2>基本信息</h2></div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label"><span class="require-item">*</span>成果类型:</label>
+					<div class="layui-input-block">
+						<form:input path="projectReportData.achievementType" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+					<%--<div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label">签章类型:</label>
+                        <div class="layui-input-block">
+                            <form:input path="projectReportData.ReportType" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+                        </div>
+                    </div>--%>
+			</div>
+			<div class="form-group layui-row first lw12">
+				<div class="form-group-label"><h2>项目信息</h2></div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">送审价(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="reviewFee" path="projectReportData.reviewFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">审定价(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="approvalFee" path="projectReportData.approvalFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">合同价(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="contractFee" path="projectReportData.contractFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">核增核减额(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="verifyFee" path="projectReportData.verifyFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">核增核减率(%):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="verifyRate" path="projectReportData.verifyRate" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">咨询标的额(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="consultFee" path="projectReportData.consultFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">土建造价(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="buildingFee" path="projectReportData.buildingFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">安装造价(元):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="installFee" path="projectReportData.installFee" htmlEscape="false"  class="form-control layui-input" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">土建比例(%):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="buildingRate" path="projectReportData.buildingRate" htmlEscape="false"  class="form-control layui-input number" readonly="true"/>
+					</div>
+				</div>
+				<div class="layui-item layui-col-sm6">
+					<label class="layui-form-label">安装比例(%):</label>
+					<div class="layui-input-block with-icon">
+						<form:input id="installRate" path="projectReportData.installRate" htmlEscape="false"  class="form-control layui-input number" readonly="true"/>
+					</div>
+				</div>
+			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>报告文件</h2></div>
+				<div id="addFile_attachment" style="display: none" class="upload-progress">
+					<span id="fileName_attachment" ></span>
+					<b><span id="baifenbi_attachment" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
+				<span id="attachment_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th width="200px">电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="200px">类型限制</th>
+							<th>文件名</th>
+						</tr>
+						</thead>
+						<tbody id="file_attachment">
+						<c:forEach items="${projectcontentinfo.fileAttachmentList}" var = "fileAttachment" varStatus="status">
+							<tr>
+								<td style="display:none">${fileAttachment.id}</td>
+								<td>${fileAttachment.attachName}</td>
+								<td>${fileAttachment.attachLength}</td>
+								<td>${fileAttachment.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileAttachment.workAttachments}" var = "workAttachment" varStatus="status">
+										<span>${workAttachment.attachmentName} ; </span>
+									</c:forEach>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>依据性资料</h2></div>
+				<div id="addFile_gistdata" style="display: none" class="upload-progress">
+					<span id="fileName_gistdata" ></span>
+					<b><span id="baifenbi_gistdata" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_gistdata" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="gistdata_file" type="file" name="gistdata_file" multiple="multiple" style="display: none;" onChange="if(this.value)gistdataInsertTitle(this.value);"/>
+				<span id="gistdata_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="gistdata_upTable" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th width="200px">电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="200px">类型限制</th>
+							<th>文件名</th>
+						</tr>
+						</thead>
+						<tbody id="file_gistdata">
+						<c:forEach items="${projectcontentinfo.fileGistdataList}" var = "fileGistdata" varStatus="status">
+							<tr>
+								<td style="display:none">${fileGistdata.id}</td>
+								<td>${fileGistdata.attachName}</td>
+								<td>${fileGistdata.attachLength}</td>
+								<td>${fileGistdata.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileGistdata.workAttachments}" var = "workAttachment" varStatus="status">
+										<span>${workAttachment.attachmentName} ; </span>
+									</c:forEach>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>其他文件</h2></div>
+				<div id="addFile_other" style="display: none" class="upload-progress">
+					<span id="fileName_other" ></span>
+					<b><span id="baifenbi_other" ></span></b>
+					<div class="progress">
+						<div id="jindutiao_other" class="progress-bar" style="width: 0%" aria-valuenow="0">
+						</div>
+					</div>
+				</div>
+				<input id="other_file" type="file" name="other_file" multiple="multiple" style="display: none;" onChange="if(this.value)otherInsertTitle(this.value);"/>
+				<span id="other_title"></span>
+				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
+					<table id="upTable_other" class="table table-bordered table-condensed details">
+						<thead>
+						<tr>
+							<th width="200px">电子件名称</th>
+							<th width="100px">最大容量(M)</th>
+							<th width="200px">类型限制</th>
+							<th>文件名</th>
+						</tr>
+						</thead>
+						<tbody id="file_other">
+						<c:forEach items="${projectcontentinfo.fileOtherList}" var = "fileOther" varStatus="status">
+							<tr>
+								<td style="display:none">${fileOther.id}</td>
+								<td>${fileOther.attachName}</td>
+								<td>${fileOther.attachLength}</td>
+								<td>${fileOther.attachTypes}</td>
+								<td>
+									<c:forEach items="${fileOther.workAttachments}" var = "workAttachment" varStatus="status">
+										<span>${workAttachment.attachmentName} ; </span>
+									</c:forEach>
+								</td>
+							</tr>
+						</c:forEach>
+						</tbody>
+					</table>
+				</div>
+			</div>
+
+
+			<c:if test="${not empty projectcontentinfo.projectReportData.act.procInsId}">
+				<div class="form-group layui-row">
+					<div class="form-group-label"><h2>审批流程</h2></div>
+					<div class="layui-item layui-col-xs12 form-table-container" >
+						<act:flowChart procInsId="${projectcontentinfo.projectReportData.act.procInsId}"/>
+						<act:histoicFlow procInsId="${projectcontentinfo.projectReportData.act.procInsId}"/>
+					</div>
+				</div>
+			</c:if>
+			<div class="form-group layui-row page-end"></div>
+		</form:form>
+	</div>
+</div>
+<script>
+	function openBill2(title,url,width,height,target,formId,tableId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url+"&index="+frameIndex;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				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}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+
+				formSubmit2($document,formId,index,tableId);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function formSubmit2($document,inputForm,index,tableId){
+
+		var validateForm = $($document.getElementById(inputForm)).validate({
+			submitHandler: function(form){
+				loading('正在提交,请稍等...');
+				form.submit();
+			},
+			errorContainer: "#messageBox",
+			errorPlacement: function(error, element) {
+				$($document.getElementById("#messageBox")).text("输入有误,请先更正。");
+				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+					error.appendTo(element.parent().parent());
+				} else {
+					error.insertAfter(element);
+				}
+			}
+		});
+		if(validateForm.form()){
+			$($document.getElementById(inputForm)).ajaxSubmit({
+				success:function(data) {
+					var d = data;
+					//输出提示信息
+					if(d.str.length>0){
+						parent.layer.msg(d.str,{icon:1});
+					}
+					$("#"+tableId).load(location.href + " #"+tableId);
+					//关闭当前页
+					top.layer.close(index)
+				}
+			});
+		}
+	}
+
+	function formAttachment(title,url,width,height,target,formId){
+		var rows = $(this).parent().prevAll().length + 1;
+		var frameIndex = parent.layer.getFrameIndex(window.name);
+		var urls = url;
+		if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+			width='auto';
+			height='auto';
+		}else{//如果是PC端,根据用户设置的width和height显示。
+
+		}
+		top.layer.open({
+			type: 2,
+			area: [width, height],
+			title: title,
+			skin:"two-btns",
+			maxmin: false, //开启最大化最小化按钮
+			content: urls ,
+			btn: ['确定','关闭'],
+			yes: function(index, layero){
+				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}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
+				var $document = iframeWin.contentWindow.document;
+				var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var item = iframeWin.getSelectedItem();
+				setValuee(item);
+
+			},
+			cancel: function(index){
+			}
+		});
+	}
+	function setValuee(obj){
+		for(var i=0;i<obj.length;i++){
+			var idArr = $("#file_attachment tr:visible .clientId");
+			if(obj[i].id!=''&&!hasInArr(obj[i].id,idArr)){
+				addRowBaseData("#workBaseDataList",workBaseDataRowIdx,workBaseDataTpl,obj[i]);
+				$("#workBaseDataList"+workBaseDataRowIdx+"_nature").html("引用");
+				workBaseDataRowIdx=workBaseDataRowIdx+1;
+			}
+		}
+	}
+</script>
+</body>
+</html>

+ 1 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

@@ -524,6 +524,7 @@
 						if(d.deleteAdmin != undefined && d.deleteAdmin =="1")
 						{
 							xml+="<a href=\"#\" onclick=\"openDialogre('修改项目报告', '${ctx}/ruralProject/ruralProjectMessage/adminModifyForm?projectId=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改报告</a>";
+							xml+="<a href=\"#\" onclick=\"openDialogView('历史报告', '${ctx}/ruralProject/ruralProjectMessage/getReportModifyList?projectId=" + d.id + "','95%', '95%')\" class=\"op-btn op-btn-delete\" style=\"background-color:#5FB878;\" ><i class=\"fa fa-eye\"></i> 历史报告</a>";
 						}
                         return xml;