Quellcode durchsuchen

2022/6/30 材料库提交

guoxu vor 3 Jahren
Ursprung
Commit
b10699353a
25 geänderte Dateien mit 1724 neuen und 8 gelöschten Zeilen
  1. 17 0
      src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java
  2. 18 0
      src/main/java/com/jeeplus/modules/projectmaterialstorage/dao/ProjectMaterialStorageDao.java
  3. 149 0
      src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorage.java
  4. 115 0
      src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorageExport.java
  5. 60 0
      src/main/java/com/jeeplus/modules/projectmaterialstorage/service/ProjectMaterialStorageService.java
  6. 200 0
      src/main/java/com/jeeplus/modules/projectmaterialstorage/web/ProjectMaterialStorageController.java
  7. 4 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java
  8. 20 2
      src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java
  9. 12 1
      src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java
  10. 9 0
      src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java
  11. 10 0
      src/main/java/com/jeeplus/modules/sys/dao/WorkattachmentDao.java
  12. 11 1
      src/main/java/com/jeeplus/modules/sys/entity/Workattachment.java
  13. 15 0
      src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java
  14. 20 0
      src/main/java/com/jeeplus/modules/sys/web/WorkattachmentController.java
  15. 3 3
      src/main/resources/jeeplus.properties
  16. 159 0
      src/main/resources/mappings/modules/projectMaterialStorage/ProjectMaterialStorageDao.xml
  17. 1 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml
  18. 11 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml
  19. 1 0
      src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectReportDao.xml
  20. 22 0
      src/main/resources/mappings/modules/sys/WorkattachmentDao.xml
  21. 1 1
      src/main/resources/spring-context-jedis.xml
  22. 15 0
      src/main/webapp/static/common/jeeplus.js
  23. 189 0
      src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageForm.jsp
  24. 592 0
      src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageList.jsp
  25. 70 0
      src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp

+ 17 - 0
src/main/java/com/jeeplus/modules/projectAccessory/web/ProjectAccessoryController.java

@@ -23,9 +23,11 @@ import com.jeeplus.modules.projectAccessory.service.ProjectTemplateService;
 import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectBasedDataService;
+import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.ruralprojectrecords.web.RuralProjectRecordsController;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
@@ -74,6 +76,8 @@ public class ProjectAccessoryController extends BaseController {
 	private CollectAccessoryService collectAccessoryService;
 	@Autowired
 	private ProjectBasedDataService projectBasedDataService;
+	@Autowired
+	private RuralProjectRecordsController ruralProjectRecordsController;
 
 	@ModelAttribute
 	public ProjectAccessoryInfo get(@RequestParam(required=false) String id) {
@@ -441,6 +445,19 @@ public class ProjectAccessoryController extends BaseController {
 			map.put("str","");
 		}
 
+		if("cf70486864254239b3533eba5c19c19e".equals(projectAccessory.getId())) {
+			RuralProjectRecords ruralProjectRecords =  ruralProjectRecordsController.get(projectAccessory.getProjectId());
+			Workattachment workattachment1 = new Workattachment();
+			workattachment1.setProjectId(projectAccessory.getProjectId());
+			if(workattachmentService.queryMaterialListFile(workattachment1) != 0){
+				ruralProjectRecords.setprojectMaterialStorageStatus("1");
+			}else{
+				ruralProjectRecords.setprojectMaterialStorageStatus("0");
+			}
+
+			ruralProjectRecordsController.modfiyRuralProjectRecordsMaterialStorageStatus(ruralProjectRecords);
+		}
+
 		long t2 = System.currentTimeMillis();
 		System.out.println("上传文件controller层消耗时间:" + (t2-t1));
 		return map;

+ 18 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/dao/ProjectMaterialStorageDao.java

@@ -0,0 +1,18 @@
+package com.jeeplus.modules.projectmaterialstorage.dao;
+
+
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
+
+
+/**
+ * 材料库Dao接口
+ */
+@MyBatisDao
+public interface ProjectMaterialStorageDao extends CrudDao<ProjectMaterialStorage> {
+
+
+
+}

+ 149 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorage.java

@@ -0,0 +1,149 @@
+package com.jeeplus.modules.projectmaterialstorage.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.project.entity.Project;
+import com.jeeplus.modules.sys.entity.Area;
+
+import java.util.Date;
+
+public class ProjectMaterialStorage extends DataEntity<ProjectMaterialStorage> {
+
+    private static final long serialVersionUID = 1707305231298038352L;
+
+    private String id;
+
+    private String projectNumber;  //项目id
+
+    private double price ; //材料价格
+
+    public Date getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(Date beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+
+    private String materialName; //材料名称
+
+    private Date beginDate;  //开始时间
+
+    private Date endDate;  //结束时间
+
+    private Project project;  //项目
+
+    private String unit; //单位
+
+    @ExcelField(title="报告号", type=1, align=2, sort=1)
+    public String getReportId() {
+        return reportId;
+    }
+
+    public void setReportId(String reportId) {
+        this.reportId = reportId;
+    }
+
+    private String projectName; //项目名称
+
+    public Area getArea() {
+        return area;
+    }
+
+    public void setArea(Area area) {
+        this.area = area;
+    }
+
+    private String areaName;  //地点
+
+    private Area area;
+
+    private String reportId; //报告号
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
+
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public ProjectMaterialStorage(){
+
+    };
+
+    public ProjectMaterialStorage(String id){
+        super(id);
+    }
+    @ExcelField(title="价格", type=1, align=2, sort=3)
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+
+    @ExcelField(title="材料名称", type=1, align=2, sort=2)
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    public Project getProject() {
+        return project;
+    }
+
+    public void setProject(Project project) {
+        this.project = project;
+    }
+
+    @ExcelField(title="单位", type=1, align=2, sort=4)
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+}

+ 115 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/entity/ProjectMaterialStorageExport.java

@@ -0,0 +1,115 @@
+/**
+ * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.modules.projectmaterialstorage.entity;
+
+import com.jeeplus.common.persistence.ActEntity;
+import com.jeeplus.modules.project.entity.Project;
+
+import java.util.Date;
+
+/**
+ * 材料库导出模板
+ */
+public class ProjectMaterialStorageExport extends ActEntity<ProjectMaterialStorageExport> {
+
+	public static final String SERIAL_BIZCODE ="1";
+	public static final String PROJECT_COST_APPRAISAL ="100";//材料库鉴定模板key
+	public static final String ECONOMIC_EVALUATION="101";//材料库模板key
+	public static final String SERIAL_COST_BIZCODE ="1004";
+	private static final long serialVersionUID = 1L;
+
+
+	private String id;
+
+	private String projectNumber;  //项目id
+
+	private double price ; //材料价格
+
+	private String materialName; //材料名称
+
+	private Date beginDate;  //开始时间
+
+	private Date endDate;  //结束时间
+
+	private String status;  //状态 0代表无文件  1 代表有文件 2代表已处理
+
+	private Project project;  //项目
+
+	private String projectName; //项目名称
+
+
+	@Override
+	public String getId() {
+		return id;
+	}
+
+	@Override
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getProjectNumber() {
+		return projectNumber;
+	}
+
+	public void setProjectNumber(String projectNumber) {
+		this.projectNumber = projectNumber;
+	}
+
+	public double getPrice() {
+		return price;
+	}
+
+	public void setPrice(double price) {
+		this.price = price;
+	}
+
+	public String getMaterialName() {
+		return materialName;
+	}
+
+	public void setMaterialName(String materialName) {
+		this.materialName = materialName;
+	}
+
+	public Date getBeginDate() {
+		return beginDate;
+	}
+
+	public void setBeginDate(Date beginDate) {
+		this.beginDate = beginDate;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public Project getProject() {
+		return project;
+	}
+
+	public void setProject(Project project) {
+		this.project = project;
+	}
+
+	public String getProjectName() {
+		return projectName;
+	}
+
+	public void setProjectName(String projectName) {
+		this.projectName = projectName;
+	}
+}

+ 60 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/service/ProjectMaterialStorageService.java

@@ -0,0 +1,60 @@
+package com.jeeplus.modules.projectmaterialstorage.service;
+
+
+import afu.org.checkerframework.checker.igj.qual.I;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.modules.projectmaterialstorage.dao.ProjectMaterialStorageDao;
+import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
+import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorageExport;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsExport;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 项目表Service
+ * @author gx
+ * @version 2022-6-28
+ */
+@Service
+@Transactional(readOnly = true)
+public class ProjectMaterialStorageService extends CrudService<ProjectMaterialStorageDao, ProjectMaterialStorage> {
+
+    @Autowired
+    private ProjectMaterialStorageDao projectMaterialStorageDao;
+
+    public ProjectMaterialStorage get(String id){
+        return super.get(id);
+    }
+
+    public Page<ProjectMaterialStorage> findPage(Page<ProjectMaterialStorage> page,ProjectMaterialStorage projectMaterialStorage){
+//       调用方法
+        return super.findPage(page,projectMaterialStorage);
+    }
+
+//    /**
+//     * 查询分页导出用
+//     */
+//    public List<ProjectMaterialStorageExport> findPageExport(Page<ProjectMaterialStorage> page, ProjectMaterialStorage projectMaterialStorage) {
+//        //设置数据权限
+//        if(!UserUtils.getUser().isAdmin()) {
+//            String dataScopeSql = null;
+//            projectMaterialStorage.getSqlMap().put("dsf", dataScopeSql);
+//            projectMaterialStorage.getSqlMap().put("delFlag", "AND a.del_flag = 0");
+//        }
+//        projectMaterialStorage.setPage(page);
+//        List<ProjectMaterialStorageExport> projectMaterialStorageExportList = dao.findExportList(projectMaterialStorage);
+//        return projectMaterialStorageExportList;
+//    }
+
+    public Integer update(ProjectMaterialStorage projectMaterialStorage){
+       return projectMaterialStorageDao.update(projectMaterialStorage);
+    }
+}

+ 200 - 0
src/main/java/com/jeeplus/modules/projectmaterialstorage/web/ProjectMaterialStorageController.java

@@ -0,0 +1,200 @@
+package com.jeeplus.modules.projectmaterialstorage.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.DateUtils;
+import com.jeeplus.common.utils.MyBeanUtils;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.utils.excel.ExportExcel;
+import com.jeeplus.common.utils.excel.ImportExcel;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage;
+import com.jeeplus.modules.projectmaterialstorage.service.ProjectMaterialStorageService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecordsExport;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
+import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
+import com.jeeplus.modules.sys.entity.Area;
+import com.jeeplus.modules.workcontent.entity.WorkPreliminaryDesignEstimate;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
+import org.apache.shiro.authz.annotation.Logical;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Controller
+@RequestMapping(value = "${adminPath}/project/projectMaterialStorage")
+public class ProjectMaterialStorageController extends BaseController {
+
+    @Autowired
+    private ProjectMaterialStorageService projectMaterialStorageService;
+    @Autowired
+    private RuralProjectRecordsService projectRecordsService;
+
+    @ModelAttribute
+    public ProjectMaterialStorage get(@RequestParam(required = false) String id){
+//        创建一个ProjectMaterialStorage
+        ProjectMaterialStorage entity = null;
+//        对于id进行是否为空的判断,如果不会空,就通过get方法获取材料库对象
+        if(StringUtils.isNotBlank(id)){
+            entity = projectMaterialStorageService.get(id);
+        }
+        if(entity == null){
+            entity = new ProjectMaterialStorage();
+        }
+//        返回ProjectMaterialStorage
+        return entity;
+
+    }
+
+
+    /**
+     * 材料库列表页面
+     */
+    @RequiresPermissions("project:projectMaterialStorage:list")
+    @RequestMapping(value = {"list",""})
+    public String list(ProjectMaterialStorage projectMaterialStorage, HttpServletRequest request, HttpServletResponse response, Model model){
+
+        Page<ProjectMaterialStorage> page =  projectMaterialStorageService.findPage(new Page<ProjectMaterialStorage>(request,response),projectMaterialStorage);
+        model.addAttribute("page",page);
+        model.addAttribute("projectMaterialStorage",projectMaterialStorage);
+        return "modules/projectMaterialStorage/projectMaterialStorageList";
+    }
+
+//    /**
+//     * 材料库新增跳转页面功能
+//     */
+//    @RequiresPermissions(value={"project:projectMaterialStorage:view","project:projectMaterialStorage:add","project:projectMaterialStorage:edit"},logical= Logical.OR)
+//    @RequestMapping(value = "form")
+//    public String form(ProjectMaterialStorage projectMaterialStorage, Model model) {
+//        if(StringUtils.isBlank(projectMaterialStorage.getId())){
+//            ProjectMaterialStorage projectMaterialStorage1=new ProjectMaterialStorage();
+//            Area area=new Area();
+//            area.setId("9AF3266E03384019BFE935DD9F35332F");
+//            area.setName("南京");
+//            projectMaterialStorage1.setArea(area);
+//            model.addAttribute("projectMaterialStorage", projectMaterialStorage1);
+//            return "modules/projectMaterialStorage/workClientInfoForm";
+//        }
+//
+//        model.addAttribute("projectMaterialStorage", projectMaterialStorage);
+//
+//        return "modules/projectMaterialStorage/workClientInfoForm";
+//    }
+
+    //@RequiresPermissions(value={"project:projectMaterialStorage:add","project:projectMaterialStorage:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(ProjectMaterialStorage projectMaterialStorage, Model model, RedirectAttributes redirectAttributes) throws Exception {
+        projectMaterialStorageService.save(projectMaterialStorage);
+        return "redirect:"+Global.getAdminPath()+"/projectMaterialStorage/projectMaterialStorageList/?repage";
+    }
+
+
+    /**
+     * 修改材料库
+     */
+    @RequestMapping(value = "Update")
+    public String adminUpdate(ProjectMaterialStorage projectMaterialStorage, RedirectAttributes redirectAttributes){
+        try {
+            ProjectMaterialStorage t = projectMaterialStorageService.get(projectMaterialStorage.getId());//从数据库取出记录的值
+            MyBeanUtils.copyBeanNotNull2Bean(projectMaterialStorage, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
+            if(projectMaterialStorageService.update(t) == 1){
+                addMessage(redirectAttributes, "修改成功");
+            }
+        }catch (Exception e){
+            logger.error("修改项目异常:",e);
+            addMessage(redirectAttributes, "修改项目:"+e.getMessage());
+        }
+        return "redirect:"+Global.getAdminPath()+"/projectMaterialStorage/projectMaterialStorageList/?repage";
+    }
+    /**
+     * 删除材料库
+     */
+    @RequiresPermissions("project:projectMaterialStorage:del")
+    @RequestMapping(value = "delete")
+    public String delete(ProjectMaterialStorage projectMaterialStorage, RedirectAttributes redirectAttributes) {
+
+            projectMaterialStorageService.delete(projectMaterialStorage);
+            return "redirect:"+Global.getAdminPath()+"/projectMaterialStorage/projectMaterialStorageList/?repage";
+        }
+
+
+    /**
+     * 导出excel文件
+     */
+//    @RequiresPermissions("project:projectMaterialStorage:export")
+//    @RequestMapping(value = "export", method= RequestMethod.POST)
+//    public String exportFile(ProjectMaterialStorage projectMaterialStorage, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+//        try {
+//            //添加查询类型(造价审核)
+//            String fileName = "材料库"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+//            List<RuralProjectRecordsExport> list = projectRecordsService.findPageExport(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
+//            new ExportExcel("项目", RuralProjectRecordsExport.class).setDataList(list).write(response, fileName).dispose();
+//            return null;
+//        } catch (Exception e) {
+//            addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
+//            logger.error("Exception e:"+e);
+//        }
+//        return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
+//    }
+
+
+    /**
+     * 文件上传页面跳转
+     * @param projectRecords
+     * @param model
+     * @return
+     */
+    @RequestMapping(value = "form")
+    public String form(RuralProjectRecords projectRecords, Model model) {
+        if (projectRecords != null && StringUtils.isNotBlank(projectRecords.getId())) {
+            projectRecords = projectRecordsService.getQueryProjectUsers(projectRecords.getId());
+//            RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
+//            projectRecordsService.disposeData(ruralProjectcontentinfo);
+//            model.addAttribute("projectcontentinfo", ruralProjectcontentinfo);
+        }
+        model.addAttribute("projectRecords",projectRecords);
+        return "modules/projectMaterialStorage/projectMaterialStorageForm";
+    }
+
+
+    /**
+     * 导入Excel数据
+     */
+    @ResponseBody
+    @RequestMapping(value = "import", method=RequestMethod.POST)
+    public Object importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
+        ResponseEntity<ProjectMaterialStorage> responseEntity = new ResponseEntity<>();
+        try {
+            ImportExcel ei = new ImportExcel(file, 1, 0);
+            List<ProjectMaterialStorage> list = ei.getDataList(ProjectMaterialStorage.class);
+            List<ProjectMaterialStorage> listAll = new ArrayList<>();
+            for (ProjectMaterialStorage materialStorage : list) {
+                if(StringUtils.isNotBlank(materialStorage.getMaterialName()) && null != new Double(materialStorage.getPrice() ) && null != materialStorage.getReportId() ){
+                    listAll.add(materialStorage);
+                }
+            }
+            responseEntity.setData(listAll);
+        } catch (Exception e) {
+            logger.error("导入材料费用失败!",e);
+            responseEntity.setCode(400);
+            responseEntity.setMessage("导入材料费用失败!"+e.getMessage());
+        }
+        return responseEntity;
+    }
+
+}

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

@@ -375,4 +375,8 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
     List<RuralProjectRecordsExport> findExportList(RuralProjectRecords projectRecords);
 
 
+    /**
+     * 修改项目表中的材料库状态信息
+     */
+    Integer modfiyProjectMaterialStorageStatus(RuralProjectRecords ruralProjectRecords);
 }

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

@@ -111,8 +111,8 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private String flagArchive;  //归档员判定
 	private String projectProperties;//投资性质
 	private List<String> permissionOfficeIdList;	//查询部门权限列表
-
-	
+	private String projectMaterialStorageStatus; //项目材料状态  0 为无文件 1为有文件 2为已处理
+	private String id;
 
 
 
@@ -2254,4 +2254,22 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setPermissionOfficeIdList(List<String> permissionOfficeIdList) {
 		this.permissionOfficeIdList = permissionOfficeIdList;
 	}
+
+	public String getProjectMaterialStorageStatus() {
+		return projectMaterialStorageStatus;
+	}
+
+	public void setprojectMaterialStorageStatus(String projectMaterialStorageStatus) {
+		this.projectMaterialStorageStatus = projectMaterialStorageStatus;
+	}
+
+	@Override
+	public String getId() {
+		return id;
+	}
+
+	@Override
+	public void setId(String id) {
+		this.id = id;
+	}
 }

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

@@ -190,6 +190,8 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	private ProjectPlanDao projectPlanDao;
 	@Autowired
 	private StatementCompanyComprehensiveService statementCompanyComprehensiveService;
+	@Autowired
+	private RuralProjectRecordsDao ruralProjectRecordsDao;
 
 	/**
 	 * 获取咨询项目类别
@@ -4650,6 +4652,15 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		}
 	}
 
-
+	/**
+	 * 修改项目表中的材料库状态信息
+	 */
+	@Transactional(readOnly = false)
+	public String modfiyProjectMaterialStorageStatus(RuralProjectRecords ruralProjectRecords){
+		 if(ruralProjectRecordsDao.modfiyProjectMaterialStorageStatus(ruralProjectRecords) == 1){
+		 	return "修改成功";
+		 }
+		 return "修改失败";
+	}
 
 }

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java

@@ -50,6 +50,7 @@ import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workreimbursement.service.WorkReimbursementService;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
+import org.apache.regexp.RE;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.json.JSONArray;
@@ -1241,4 +1242,12 @@ public class RuralProjectRecordsController extends BaseController {
 		Integer count = projectRecordsService.reProjectName(projectName);
 		return count;
 	}
+
+	/**
+	 * 上传材料库文件修改项目材料库状态
+	 */
+	@RequestMapping(value = "")
+	public String modfiyRuralProjectRecordsMaterialStorageStatus(RuralProjectRecords ruralProjectRecords){
+		return projectRecordsService.modfiyProjectMaterialStorageStatus(ruralProjectRecords);
+	}
 }

+ 10 - 0
src/main/java/com/jeeplus/modules/sys/dao/WorkattachmentDao.java

@@ -91,4 +91,14 @@ public interface WorkattachmentDao extends CrudDao<Workattachment> {
      * @return
      */
     Integer deleteWorkattachment(Workattachment workattachment);
+
+    /**
+     * 查找材料表文件
+     */
+    Integer queryMaterialListFile(Workattachment workattachment);
+
+    /**
+     * 根据id获取对象
+     */
+//    Workattachment getWorkattachmentById(String id);
 }

+ 11 - 1
src/main/java/com/jeeplus/modules/sys/entity/Workattachment.java

@@ -34,7 +34,7 @@ public class Workattachment extends DataEntity<Workattachment> {
 	private String projectId;	//项目id
 	private String sort;	//排序
 	private String description;	//文件描述
-
+	private String id;
 
 	public String getDivIdType() {
 		return divIdType;
@@ -184,4 +184,14 @@ public class Workattachment extends DataEntity<Workattachment> {
 	public void setDescription(String description) {
 		this.description = description;
 	}
+
+	@Override
+	public String getId() {
+		return id;
+	}
+
+	@Override
+	public void setId(String id) {
+		this.id = id;
+	}
 }

+ 15 - 0
src/main/java/com/jeeplus/modules/sys/service/WorkattachmentService.java

@@ -790,4 +790,19 @@ public class WorkattachmentService extends CrudService<WorkattachmentDao, Workat
 	public void deleteWorkattachment(Workattachment workattachment) {
 		dao.deleteWorkattachment(workattachment);
 	}
+
+
+	/**
+	 * 查询项目里面是否还有材料表文件
+	 */
+	public Integer queryMaterialListFile(Workattachment workattachment){
+		return workattachmentDao.queryMaterialListFile(workattachment);
+	}
+
+	/**
+	 * 根据id获取对象
+	 */
+//	public Workattachment getWorkattachmentById(String id){
+//		return workattachmentDao.getWorkattachmentById(id);
+//	}
 }

+ 20 - 0
src/main/java/com/jeeplus/modules/sys/web/WorkattachmentController.java

@@ -14,6 +14,8 @@ import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.ruralprojectrecords.web.RuralProjectRecordsController;
 import com.jeeplus.modules.sys.entity.Workattachment;
 import com.jeeplus.modules.sys.service.WorkattachmentService;
 import com.jeeplus.modules.sys.utils.UserUtils;
@@ -49,6 +51,8 @@ public class WorkattachmentController extends BaseController {
 
 	@Autowired
 	private WorkattachmentService workattachmentService;
+	@Autowired
+	private RuralProjectRecordsController ruralProjectRecordsController;
 
 	@ModelAttribute
 	public Workattachment get(@RequestParam(required=false) String id) {
@@ -233,6 +237,7 @@ public class WorkattachmentController extends BaseController {
 	@RequestMapping("/deleteFileFromAliyun")
 	@ResponseBody
 	public HashMap<Object, Object> deleteFileFromAliyun(String id,String type,String url,Model model){
+		Workattachment workAttachment1 = workattachmentService.get(id);
 		if(StringUtils.isNotBlank(id)) {
 			Workattachment workattachment = workattachmentService.get(id);
 			if("1".equals(uploadMode) || "2".equals(uploadMode)) {
@@ -256,6 +261,21 @@ public class WorkattachmentController extends BaseController {
 		}
 		HashMap<Object, Object> map = Maps.newHashMap();
 		map.put("str","success");
+
+	if(StringUtils.isNotBlank(workAttachment1.getProjectId())){
+			if("cf70486864254239b3533eba5c19c19e".equals(workAttachment1.getAttachmentId())){
+				String proId = workAttachment1.getProjectId();
+				RuralProjectRecords ruralProjectRecords = ruralProjectRecordsController.get(proId);
+				if(workattachmentService.queryMaterialListFile(workAttachment1) != 0){
+					ruralProjectRecords.setprojectMaterialStorageStatus("1");
+				}else{
+					ruralProjectRecords.setprojectMaterialStorageStatus("0");
+				}
+				ruralProjectRecordsController.modfiyRuralProjectRecordsMaterialStorageStatus(ruralProjectRecords);
+		}
+		}
+
+
 		return map;
 	}
 

+ 3 - 3
src/main/resources/jeeplus.properties

@@ -9,8 +9,8 @@ db.name=ruihuaoa-activity-data
 #jdbc.url=jdbc:mysql://192.168.2.4:3306/simple_xg_total_process?useUnicode=true&characterEncoding=utf-8
 jdbc.url=jdbc:mysql://127.0.0.1:3306/new_ccpm_2?useUnicode=true&characterEncoding=utf-8
 jdbc.username=root
-#jdbc.password=123456
-jdbc.password=root
+jdbc.password=123456
+#jdbc.password=root
 
 #pool settings
 jdbc.pool.init=20
@@ -37,7 +37,7 @@ redis.host=127.0.0.1
 #redis.port=6380
 redis.port=6379
 redis.timeout = 2000
-redis.password = 123456
+#redis.password = 123456
 
 #============================#
 #===== System settings ======#

+ 159 - 0
src/main/resources/mappings/modules/projectMaterialStorage/ProjectMaterialStorageDao.xml

@@ -0,0 +1,159 @@
+<?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.projectmaterialstorage.dao.ProjectMaterialStorageDao">
+
+	<sql id="projectMaterialStorageColumns">
+		a.id AS "id",
+		a.material_name  As "materialName",
+		a.price AS "price",
+		a.project_number AS "projectNumber",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.remarks AS "remarks",
+		a.del_flag AS "delFlag"
+	</sql>
+
+	<sql id="projectJoins">
+	</sql>
+
+	<!--只是备注该表与其他表的关联关系 -->
+<!--	<sql id="projectJoins2">-->
+<!--		LEFT JOIN work_client_linkman entrustCompany ON entrustCompany.id = a.entrust_company-->
+<!--		LEFT JOIN work_contract_info contractInfo ON contractInfo.id = a.contract_info-->
+<!--		LEFT JOIN project_general projectGeneral ON projectGeneral.id = a.project_general-->
+<!--		LEFT JOIN project_evaluation_record projectEvaluationRecord ON projectEvaluationRecord.id = a.project_evaluation_record-->
+<!--		LEFT JOIN project_group_info workprojectgroup ON workprojectgroup.id = a.project_group_info-->
+<!--	</sql>-->
+
+
+	<select id="get" resultType="com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage" >
+		SELECT
+			<include refid="projectMaterialStorageColumns"/>
+		FROM project_material_storage a
+<!--		<include refid="projectJoins"/>-->
+		WHERE a.id = #{id}
+	</select>
+
+	<select id="findList" resultType="com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage" >
+		SELECT
+		a.id,a.material_name,a.price,a.create_date as createDate,r.project_name,sys_area.name as 'areaName'
+		FROM project_material_storage a
+		left join rural_project_records as r
+		on a.project_number = r.project_id
+		LEFT JOIN sys_area
+		on sys_area.id = r.area_id
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+			<if test="projectNumber != null and projectNumber != ''">
+				AND a.project_number LIKE
+				<if test="dbName == 'oracle'">'%'||#{projectNumber}||'%'</if>
+				<if test="dbName == 'mssql'">'%'+#{projectNumber}+'%'</if>
+				<if test="dbName == 'mysql'">concat('%',#{projectNumber},'%')</if>
+			</if>
+			<if test="projectName != null and projectName != ''">
+				AND r.project_name like concat(concat('%',#{projectName}),'%')
+			</if>
+			<if test="materialName != null and materialName != ''">
+				AND a.material_name like concat(concat('%',#{materialName}),'%')
+			</if>
+			<if test="areaName != null and areaName != ''">
+				AND r.area_name like concat(concat('%',#{areaName}),'%')
+			</if>
+			<if test="beginDate !=null">
+				AND a.create_date >= #{beginDate}
+			</if>
+			<if test="endDate !=null">
+				AND a.create_date &lt; #{endDate}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<select id="findAllList" resultType="com.jeeplus.modules.projectmaterialstorage.entity.ProjectMaterialStorage" >
+		SELECT
+			<include refid="projectMaterialStorageColumns"/>
+		FROM project a
+		<include refid="projectJoins"/>
+		<where>
+			a.del_flag = #{DEL_FLAG_NORMAL}
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				ORDER BY a.update_date DESC
+			</otherwise>
+		</choose>
+	</select>
+
+	<insert id="insert">
+		INSERT INTO project_material_storage(
+			id,
+			create_date,
+			del_flag,
+			material_name,
+			price,
+			remarks,
+			project_number,
+			update_by,
+			update_date,
+			create_by
+		) VALUES (
+			#{id},
+			#{createDate},
+			#{delFlag},
+			#{materialName},
+			#{price},
+			#{remarks},
+			#{projectNumber},
+			#{updateBy},
+			#{updateDate},
+			#{createBy}
+		)
+	</insert>
+
+	<update id="update">
+		UPDATE project SET
+			status = 1,
+			project_number = #{projectNumber},
+			material_name = #{materialName},
+			price = #{price},
+			del_flag = #{delFlag},
+			update_by = #{updateBy.id},
+			update_date = #{updateDate},
+			remarks = #{remarks}
+		WHERE id = #{id}
+	</update>
+
+
+	<!--物理删除-->
+	<update id="delete">
+		DELETE FROM project_material_storage
+		WHERE id = #{id}
+	</update>
+
+	<!--逻辑删除-->
+	<update id="deleteByLogic">
+		UPDATE project_material_storage SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+
+
+
+
+
+
+
+</mapper>

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

@@ -353,6 +353,7 @@
 		ifnull(prd.number ,"") as "projectReportNumber"
 		,ifnull(prd.status,0) as "projectReportStatus"
 		,ifnull(prd.name,"") as "projectReportName"
+		,project_material_storage_status as "projectMaterialStorageStatus"
 		<choose>
 			<when test="projectReportRecordStatus  != null and projectReportRecordStatus != ''">
 				,ifnull(prr.status,#{projectReportRecordStatus}) as "projectReportRecordStatus"

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

@@ -361,6 +361,7 @@
 		,a.report_signature_url as "reportSignatureUrl"
 		,a.report_signature_contract_id as "reportSignatureContractId"
 		,prsi.id as "prsiId"
+		,project_material_storage_status as "projectMaterialStorageStatus"
 		,(SELECT group_concat( su.NAME ) FROM work_project_user wpu LEFT JOIN sys_user su ON su.id = wpu.user_id WHERE wpu.project_id = a.id ) AS "leaderNameStr",
 		(SELECT group_concat( su.id ) FROM work_project_user wpu LEFT JOIN sys_user su ON su.id = wpu.user_id WHERE wpu.project_id = a.id ) AS "leaderNameIds"
 		FROM rural_project_records a
@@ -3803,4 +3804,14 @@
 	</insert>
 
 
+	<update id="modfiyProjectMaterialStorageStatus">
+		update rural_project_records
+		<set>
+			project_material_storage_status = #{projectMaterialStorageStatus}
+		</set>
+		<where>
+			id = #{id}
+		</where>
+	</update>
+
 </mapper>

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

@@ -232,4 +232,5 @@
 			</otherwise>
 		</choose>
 	</select>
+
 </mapper>

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

@@ -22,6 +22,7 @@
 		createBy.name AS "createBy.name"
 		,a.sort as "sort"
 		,a.description as "description"
+		,a.project_id as "projectId"
 	</sql>
 
 	<sql id="workattachmentJoins">
@@ -414,4 +415,25 @@
 		</where>
 	</delete>
 
+<!-- 查找材料表文件-->
+	<select id="queryMaterialListFile" resultType="java.lang.Integer">
+		select count(1) from work_attachment
+		<where>
+			<if test="null != projectId and '' != projectId">
+				and project_id = #{projectId}
+			</if>
+			<if test="null != attachmentId and '' != attachmentId">
+				and attachment_id = 'cf70486864254239b3533eba5c19c19e'
+			</if>
+		</where>
+	</select>
+
+
+<!--		<select id="getWorkattachmentById" resultMap="Workattachment">-->
+<!--			SELECT-->
+<!--			<include refid="workattachmentColumns"/>-->
+<!--			FROM work_attachment a-->
+<!--			where a.id = #{id}-->
+<!--		</select>-->
+
 </mapper>

+ 1 - 1
src/main/resources/spring-context-jedis.xml

@@ -21,7 +21,7 @@
 		<constructor-arg index="1" value="${redis.host}" />
 		<constructor-arg index="2" value="${redis.port}" type="int" />
 		<constructor-arg index="3" value="${redis.timeout}" type="int" />
-		<constructor-arg index="4" value="${redis.password}" />
+<!--		<constructor-arg index="4" value="${redis.password}" />-->
 	</bean>
 
 </beans>

+ 15 - 0
src/main/webapp/static/common/jeeplus.js

@@ -519,6 +519,21 @@ function getReportedState(id)
     return result;
 }
 
+function getProjectMaterialStorageStatus(id)
+{
+    var result ={};
+    result.action = true;
+    switch(id)
+    {
+        case "0":result.label = "tempstore";result.status="无文件";result.action = false;break;
+        case "1":result.label = "tempstore";result.status="有文件";result.action = false;break;
+        case "2":result.label = "auditing";result.status="已处理";break;
+        default:
+            result.label = "unknown";result.status="未知";break;
+    }
+    return result;
+}
+
 function getBorrowState(id)
 {
     var result ={};

+ 189 - 0
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageForm.jsp

@@ -0,0 +1,189 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>材料库处理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		#workInvoiceProjectRelationList td{
+			padding-left: 0px;
+			padding-right: 0px;
+		}
+	</style>
+	<script type="text/javascript">
+		var validateForm;
+		function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+		  if(validateForm.form()){
+              /*if(obj == 1) {
+                  $("#flag").val("yes");
+              }else {
+                  $("#flag").val("no");
+              }*/
+			  $("#inputForm").submit();
+			  return true;
+		  }
+		  return false;
+		}
+		$(document).ready(function() {
+			$("#name").focus();
+			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);
+					}
+				}
+			});
+
+		});
+		function addRow1(list, idx, tpl, row){
+			var idx1 = $("#workInvoiceProjectRelationList tr").length;
+			if(list == '#workInvoiceProjectRelationList'){
+				bornTemplete1(list, idx, tpl, row, idx1);
+			}
+		}
+
+		// function import(){
+		// 	var idx1 = $("#workInvoiceProjectRelationList tr").length;
+		// 	if(list == '#workInvoiceProjectRelationList'){
+		// 		bornTemplete1(list, idx, tpl, row, idx1);
+		// 	}
+		// }
+
+		function bornTemplete1(list, idx, tpl, row, idx1){
+			$(list).append(Mustache.render(tpl, {
+				idx: idx, delBtn: true, row: row,
+				order:idx1 + 1
+			}));
+			$(list+idx).find("select").each(function(){
+				$(this).val($(this).attr("data-value"));
+			});
+			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+				var ss = $(this).attr("data-value").split(',');
+				for (var i=0; i<ss.length; i++){
+					if($(this).val() == ss[i]){
+						$(this).attr("checked","checked");
+					}
+				}
+			});
+		}
+		function f1(row) {
+			// window.parent.document.getElementById('opinion').value = row;
+			$("#opinion").val(row)
+		}
+		function openDialogre(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)
+					document.getElementById('iframe').contentWindow.location.reload();
+				}
+			});
+		}
+	</script>
+</head>
+<body>
+<div class="single-form">
+	<div class="container">
+	<form:form id="inputForm" modelAttribute="projectRecords" action="" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="home"/>
+		<form:hidden path="act.taskId"/>
+		<form:hidden path="act.taskName"/>
+		<form:hidden path="act.taskDefKey"/>
+		<form:hidden path="act.procInsId"/>
+		<form:hidden path="act.procDefId"/>
+		<form:hidden id="flag" path="act.flag"/>
+		<c:set var="status" value="${workInvoice.act.status}" />
+		<input type="hidden" id="opinion" name="act.comment" value="" maxlength="255">
+
+		<div class="form-group layui-row first lw14">
+			<div class="form-group-label"><h2>材料处理</h2></div>
+			<div class="layui-item nav-btns">
+				<a class="nav-btn nav-btn-add" onclick="addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+				<table:importExcelCost url="${ctx}/project/projectMaterialStorage/import"></table:importExcelCost><!-- 导入按钮 -->
+			</div>
+			<div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+				<table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+					<thead>
+					<tr>
+						<th width="200px"><font color="red">*</font>材料名称</th>
+						<th width="200px">价格</th>
+<%--						<th width="200px">单位</th>--%>
+						<th width="200px">项目名称</th>
+						<th width="200px">项目地点</th>
+					</tr>
+					</thead>
+					<tbody id="workInvoiceProjectRelationList">
+					</tbody>
+				</table>
+				<script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
+                    <tr id="workInvoiceProjectRelationList{{idx}}">
+                        <td class="hide">
+                            <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" type="hidden" value="{{row.projectId}}"/>
+							<input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_projectName"   type="text" value="{{row.materialName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_workContractName"   type="text" value="{{row.price}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td style="text-align:center;">
+							<input id="workInvoiceProjectRelationList{{idx}}_projectNum"  type="text" value="{{row.projectName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+                        <td>
+							<input id="workInvoiceProjectRelationList{{idx}}_clientName"  type="text" value="{{row.areaName}}" readonly="readonly"  class="form-control"/>
+                        </td>
+<%--                        <td>--%>
+<%--							<input id="workInvoiceProjectRelationList{{idx}}_reportDataNum"  type="text" value="{{row.reportDataNum}}" readonly="readonly"  class="form-control"/>--%>
+<%--                        </td>--%>
+                    </tr>//-->
+				</script>
+				<script type="text/javascript">
+					var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+					/*if($("#id").val()){
+                        workInvoiceProjectRelationListRowIdx = ${fn:length(workInvoice.workInvoiceProjectRelationList)};
+						}*/
+					$(document).ready(function() {
+						var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
+						for (var i=0; i<data.length; i++){
+							addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
+							workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
+						}
+					});
+				</script>
+			</div>
+		</div>
+
+
+
+
+
+
+		<div class="form-group layui-row page-end"></div>
+	</form:form>
+	</div>
+</div>
+</body>
+</html>

+ 592 - 0
src/main/webapp/webpage/modules/projectMaterialStorage/projectMaterialStorageList.jsp

@@ -0,0 +1,592 @@
+<%@ 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" src="${ctxStatic}/layui/layuidown.js"></script>
+	<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
+	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
+	<script type="text/javascript">
+        $(document).ready(function() {
+			layui.use(['dropdown', 'util', 'layer'], function () {
+				var form = layui.form;
+				$.ajax({
+					type : "POST",
+					url : "${ctx}/ruralProject/ruralProjectRecords/engineeringTreeMenu",
+					//请求成功
+					success : function(result) {
+						var str=jQuery.parseJSON(result);
+						//工程类型树形菜单
+						layui.dropdown.render({
+							elem: '#demo100'
+							,style: 'width: 320px;'
+							,data:str
+							,click: function(item){
+								$("#demo100").val(item.title)
+								$("#demo101").val(item.id)
+							}
+						});
+					}
+				});
+			})
+            //搜索框收放
+            $('#moresee').click(function(){
+                if($('#moresees').is(':visible'))
+                {
+                    $('#moresees').slideUp(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
+                }else{
+                    $('#moresees').slideDown(0,resizeListWindow2);
+                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
+                }
+            });
+            laydate.render({
+                elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+            laydate.render({
+                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+                event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+                type : 'date'
+, trigger: 'click'
+            });
+        });
+
+        function reset() {
+            $("#searchForm").resetForm();
+        }
+
+        function openDialog(title,url,width,height,target) {
+
+            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,
+                maxmin: true, //开启最大化最小化按钮
+                content: url,
+                skin: 'three-btns',
+				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中展示
+
+                    if (iframeWin.contentWindow.doSubmit()) {
+                        // top.layer.close(index);//关闭对话框。
+                        setTimeout(function () {
+                            top.layer.close(index)
+                        }, 100);//延时0.1秒,对应360 7.1版本bug
+                    }
+
+                },*/
+                btn1: 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中展示
+                    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) {
+                }
+            });
+        }
+		//打开对话框(查看)
+		function openDialogReportView(title,url,id,width,height){
+
+
+			if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
+				width='auto';
+				height='auto';
+			}else{//如果是PC端,根据用户设置的width和height显示。
+
+			}
+			$.ajax({
+				async: false,
+				url: "${ctx}/ruralProject/ruralProjectMessage/getReportExist?id="+id,
+				dataType: "json",
+				success: function (data) {
+					if(data.success){
+						top.layer.open({
+							type: 2,
+							skin: 'one-btn',
+							area: [width, height],
+							title: title,
+							maxmin: true, //开启最大化最小化按钮
+							content: url ,
+							btn: ['关闭'],
+							cancel: function(index){
+							}
+						});
+					}else{
+						top.layer.msg("该项目报告信息已删除!", {icon: 0});
+						window.location.reload();
+					}
+				}
+			});
+
+		}
+        function openDialogre(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){
+                    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(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) {
+                }
+            });
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+	<script>
+
+		function notifyDialogre(title,url,width,height,target){
+			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:"three-btns",
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				btn: ['通过','驳回','关闭'],
+				btn1: 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中展示
+					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){
+					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
+					}
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+
+		}
+	</script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<%--<div class="list-form-tab contentShadow shadowLTR" id="tabDiv">
+				<ul class="list-tabs" >
+					<li class="active"><a href="${ctx}/ruralProject/ruralProjectRecords/list">项目登记列表</a></li>
+					<li><a href="${ctx}/ruralProject/ruralProjectRecordsAlter/list">项目变更列表</a></li>
+				</ul>
+			</div>--%>
+
+			<%--<div class="layui-row" id="tabDiv">--%>
+			<%--<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">--%>
+			<%--<ul class="layui-tab-title">--%>
+			<%--<li class="layui-this"><a href="${ctx}/project/projectRecords/list">项目登记列表</a></li>--%>
+			<%--<li><a href="${ctx}/project/projectRecordsAlter/list">项目变更列表</a></li>--%>
+			<%--</ul>--%>
+			<%--</div>--%>
+			<%--</div>--%>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectMaterialStorage" action="${ctx}/project/projectMaterialStorage/" method="post" class="form-inline">
+					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+					<input id="toflag" name="toflag" type="hidden" value="1"/>
+					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+					<div class="commonQuery lw6">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">项目名称:</label>
+							<div class="layui-input-block">
+								<form:input path="projectName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+					</div>
+					<div class="commonQuery lw6">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">材料名称:</label>
+							<div class="layui-input-block">
+								<form:input path="materialName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+						</div>
+					</div>
+
+						<div class="layui-item athird">
+							<div class="input-group">
+								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
+								<div class="layui-btn-group search-spacing">
+									<button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+									<button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
+								</div>
+<%--								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>--%>
+<%--								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>--%>
+<%--								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>--%>
+							</div>
+						</div>
+						<div style="    clear:both;"></div>
+					</div>
+					<div id="moresees" style="clear:both;display:none;" class="lw6">
+						<div class="layui-item query athird">
+							<label class="layui-form-label">地点:</label>
+							<div class="layui-input-block with-icon">
+								<form:input path="areaName" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">创建时间:</label>
+							<div class="layui-input-block readOnlyFFF">
+								<input id="beginDate" name="beginDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+									   value="<fmt:formatDate value="${projectRecords.beginDate}" pattern="yyyy-MM-dd"/>"/>
+								</input>
+                                <span class="group-sep">-</span>
+                                <input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
+                                       value="<fmt:formatDate value="${projectRecords.endDate}" pattern="yyyy-MM-dd"/>"/>
+                                </input>
+							</div>
+						</div>
+<%--						<div class="layui-item query athird ">--%>
+<%--							<label class="layui-form-label">状态:</label>--%>
+<%--							<div class="layui-input-block">--%>
+<%--								<form:select path="projectStatus" class=" form-control  simple-select">--%>
+<%--									<form:option value="" label=""/>--%>
+<%--									<form:options items="${fns:getRuralDictList('rural_project_audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>--%>
+<%--								</form:select>--%>
+<%--							</div>--%>
+<%--						</div>--%>
+
+						<div style="clear:both;"></div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+		<div class="full-width fl">
+			<div class="layui-form contentDetails contentShadow shadowLBR">
+				<div class="nav-btns">
+					<%--此处按钮样式包括 nav-btn-add nav-btn-refresh nav-btn-import nav-btn-export nav-btn-query nav-btn-reset--%>
+					<div class="layui-btn-group">
+<%--						<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">--%>
+<%--							<table:addRow url="${ctx}/ruralProject/ruralProjectRecords/form" title="项目"></table:addRow><!-- 增加按钮 -->--%>
+<%--						</shiro:hasPermission>--%>
+						<shiro:hasPermission name="ruralProject:ruralProjectRecords:export">
+							<table:exportExcel url="${ctx}/ruralProject/ruralProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->
+						</shiro:hasPermission>
+						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+					</div>
+<%--					<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">--%>
+<%--						<table:addRow url="${ctx}/ruralProject/ruralProjectRecords/form" title="项目"></table:addRow><!-- 增加按钮 -->--%>
+<%--					</shiro:hasPermission>--%>
+<%--					<shiro:hasPermission name="ruralProject:ruralProjectRecords:export">--%>
+<%--						<table:exportExcel url="${ctx}/ruralProject/ruralProjectRecords/export"></table:exportExcel><!-- 导出按钮 -->--%>
+<%--					</shiro:hasPermission>--%>
+<%--					<shiro:hasPermission name="ruralProject:ruralProjectRecords:exportAll">--%>
+<%--						<button type="button" data-toggle="tooltip" data-placement="top" class="nav-btn nav-btn-delete" id="delUser"><i class="fa fa-file-excel-o"> 批量下载</i></button>--%>
+<%--					</shiro:hasPermission>--%>
+<%--					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>--%>
+					<div style="clear: both;"></div>
+				</div>
+				<table class="oa-table layui-table" id="contentTable1"></table>
+
+				<!-- 分页代码 -->
+				<table:page page="${page}"></table:page>
+				<div style="clear: both;"></div>
+			</div>
+		</div>
+	</div>
+	<div id="changewidth"></div>
+</div>
+
+<%--<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>--%>
+<script>
+
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+			,id:"checkboxTable"
+            ,elem: '#contentTable1'
+            ,page: false
+            ,cols: [[
+				{checkbox: true, fixed: true},
+                {field:'index',align:'center', title: '序号',width:55}
+				,{field:'materialName',align:'center', title: '材料名称',  width:150}
+				,{field:'price',align:'center', title: '价格',  width:150}
+				,{field:'areaName',align:'center', title: '项目地点',  width:150}
+                ,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
+						if(1 == d.showView && d.showView != undefined){
+							return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectView/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+						}else{
+							return "<span title='"+ d.projName +"'>" +d.projName+ "</span>";
+						}
+                    }}
+
+                /*,{field:'projId',align:'center', title: '项目编号',minWidth:150,templet:function(d){
+                        return "<a class=\"attention-info\" title=\"" + d.projId + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/ruralProject/ruralProjectRecords/view?id=" + d.id + "','95%', '95%')\">" + d.projId + "</a>";
+                    }}*/
+
+
+
+                ,{field:'createDate',align:'center', title: '创建日期',  width:80}
+                ,{field:'op',align:'center',title:"操作",width:240,templet:function(d){
+                        ////对操作进行初始化
+                        var xml="<div class=\"layui-btn-group\">";
+                        if(d.notifyFlag != undefined && d.notifyFlag !=null && "" != d.notifyFlag && d.notifyFlag == 1)
+                        {
+							xml+="<a href=\"#\" onclick=\"notifyDialogre('项目审批', '${ctx}/workprojectnotify/workProjectNotify/form?id=" + d.notifyId +"&home=project','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 审批</a>";
+                        }
+                        if(d.canedit1 != undefined && d.canedit1 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/ruralProject/ruralProjectRecords/form?id=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canedit2 != undefined && d.canedit2 =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/ruralProject/ruralProjectRecords/modify?id=" + d.id + "','95%', '95%','','送审,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.canrecall != undefined && d.canrecall =="1")
+                        {
+                            xml+="<a href=\"#\" onclick=\"openDialogre('调整项目', '${ctx}/ruralProject/ruralProjectRecords/form?id=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        }
+                        if(d.candel != undefined && d.candel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/ruralProject/ruralProjectRecords/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要作废该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 作废</a>";
+                        }
+                        if(d.cancancel != undefined && d.cancancel =="1")
+                        {
+                            xml+="<a href=\"${ctx}/ruralProject/ruralProjectRecords/revoke?id=" + d.id + "&processInstanceId=" + d.procId + "&projectStatus="+d.projectStatus+"\" onclick=\"return confirmx('确认要撤回该项目审批吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\" > 撤回</a>";
+                        }
+                        //项目在没有归档完成之前可对文档进行操作
+                        if(d.recordStatus != undefined && d.recordStatus =="1")
+                        {
+							xml+="<a href=\"#\" onclick=\"openDialogView('文件上传', '${ctx}/ruralProject/ruralProjectRecords/formAccessory?id=" + d.id + "','95%', '95%')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" > 上传文件</a>";
+                        }
+						if(d.reportDataFlag != undefined && d.reportDataFlag =="1")
+						{
+							xml+="<a href=\"${ctx}/ruralProject/ruralCostProjectRecords/createReportDataId?id=" + d.id + "&projectType=1"+"\" onclick=\"return confirmx('确认要生成报告号吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-orange\"> 生成报告号</a>";
+						}
+                        if(d.canedit3 != undefined && d.canedit3 =="1")
+                        {
+                            //xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('项目变更管理', '${ctx}/ruralProject/ruralProjectRecordsAlter/form?alterBeforeRecords.id='+encodeURIComponent('" + d.id + "'),'95%','95%','','送审,暂存,关闭')\" style=\"color: white;background: darkseagreen\" class=\"op-btn op-btn-op-btn-revert\" ><i class=\"fa fa-edit\"></i> 变更</a>";
+                        }
+                        if(d.deleteAdmin != undefined && d.deleteAdmin =="1")
+                        {
+							xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/ruralProject/ruralProjectRecords/adminModify?id=" + d.id + "','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs  layui-bg-green\" > 修改</a>";
+							xml+="<a href=\"${ctx}/ruralProject/ruralProjectRecords/adminDelete?id=" + d.id + "\" onclick=\"return confirmx('确认要删除该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        }
+						if(d.modifyRecords != undefined && d.modifyRecords =="1")
+						{
+							xml+="<a href=\"#\" onclick=\"openDialogre('修改项目', '${ctx}/ruralProject/ruralProjectRecords/form?id=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+							xml+="<a href=\"${ctx}/ruralProject/ruralProjectRecords/delete?id=" + d.id + "\" onclick=\"return confirmx('确认要作废该项目信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 作废</a>";
+						}
+                        xml+="</div>"
+                        return xml;
+
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="projectMaterialStorage" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${projectMaterialStorage.id}"
+					,"materialName":"${projectMaterialStorage.materialName}"
+					,"price":"${projectMaterialStorage.price}"
+                    ,"projName":"<c:out value="${projectMaterialStorage.projectName}" escapeXml="true"/>"
+					,"areaName":"${projectMaterialStorage.areaName}"
+					,"createDate":"<fmt:formatDate value="${projectMaterialStorage.createDate}" pattern="yyyy-MM-dd"/>"
+                    <c:choose><c:when test="${flag == '1' or fns:getUser().id == projectRecords.createBy.id}">
+                    <shiro:hasPermission name="ruralProject:ruralProjectRecords:del">,"candel":	<c:choose><c:when test="${(projectRecords.projectStatus == 1 or projectRecords.projectStatus == 3 or projectRecords.projectStatus == 4) && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+                    <shiro:hasPermission name="ruralProject:ruralProjectRecords:edit">,"canedit1":	<c:choose><c:when test="${projectRecords.projectStatus == 1 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    ,"canedit2":<c:choose><c:when test="${projectRecords.projectStatus == 4 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    ,"canrecall":<c:choose><c:when test="${projectRecords.projectStatus == 3 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+                    </shiro:hasPermission>
+                    ,"cancancel":<c:choose><c:when test="${projectRecords.projectStatus == 2 && fns:getUser().id == projectRecords.createBy.id}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+
+                    ,"deleteAdmin":<c:choose><c:when test="${'1' == projectRecords.flagAdmin && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					,"modifyRecords":<c:choose><c:when test="${fns:getUser().id == projectRecords.createBy.id && '2' != projectRecords.projectReportStatus && '5' != projectRecords.projectReportStatus && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					<c:if test="${'1' == projectRecords.flagAdmin}">
+						,"reportDataFlag":<c:choose><c:when test="${'0' == projectRecords.reportDataFlag && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					</c:if>
+					<c:if test="${'0' == projectRecords.flagAdmin}">
+						,"reportDataFlag":<c:choose><c:when test="${fns:getUser().id == projectRecords.createBy.id && '0' == projectRecords.reportDataFlag && projectRecords.projectStatus == 5}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose>
+					</c:if>
+					</c:when>
+                    <c:otherwise>
+                    ,"candel":"0"
+                    ,"canedit1":"0"
+                    ,"canedit2":"0"
+                    ,"canrecall":"0"
+                    ,"cancancel":"0"
+                    ,"deleteAdmin":"0"
+                    ,"recordStatus":"0"
+                    </c:otherwise>
+                    </c:choose>
+					,"submitMoneyStr":
+							<c:choose>
+							<c:when test="${'2'==projectRecords.submitMoney}">
+							"A级"
+					</c:when>
+					<c:otherwise>
+					"B级"
+					<%--<c:choose>
+                        <c:when test="${'1'==projectRecords.emergencyProject}">
+                            "B级紧急"
+                        </c:when>
+                        <c:otherwise>
+                            "B级非紧急"
+                        </c:otherwise>
+                    </c:choose>--%>
+					</c:otherwise>
+					</c:choose>
+                    <shiro:hasPermission name="ruralProject:ruralProjectRecords:edit">,"canedit3":<c:choose><c:when test="${projectRecords.projectStatus == 5 && fn:contains(projectRecords.leaderIds,fns:getUser().id)}">"1"</c:when><c:otherwise>"0"</c:otherwise></c:choose></shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralProjectRecords:accessory">
+					,"recordStatus":
+					<c:choose>
+							<c:when test="${0 == projectRecords.projectReportRecordStatus && projectRecords.projectStatus != 7}">"1"</c:when>
+							<c:otherwise>"0"</c:otherwise>
+					</c:choose>
+					</shiro:hasPermission>
+					<shiro:hasPermission name="ruralProject:ruralProjectView:consultingView">
+					,"showView":1
+					</shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+		$("#delUser").bind("click",function () {
+			//获得表格CheckBox已经选中的行的信息
+			var checkList = layui.table.checkStatus('checkboxTable').data;
+			//定义数组存放批量删除的行的id
+			var listId = [];
+			//进行遍历所有选中行数据,拿出每一行的id存储到数组中
+			$.each(checkList, function (i, data) {
+				listId.push(data.id);
+			});
+			if (listId.length <= 0) {
+				layer.msg("请选择需要下载的项目信息", {icon: 2})
+			} else {
+				$("#searchForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/exportAll?listId="+ listId);
+				$("#searchForm").submit();
+				return true;
+			}
+		});
+    })
+
+    resizeListTable();
+    $("a").on("click",addLinkVisied);
+</script>
+<script>
+    resizeListWindow2();
+    $(window).resize(function(){
+        resizeListWindow2();
+    });
+</script>
+</body>
+</html>

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

@@ -290,6 +290,62 @@
 		// 	});
 		// }
 
+
+		//材料跳转
+		function openDialogre(title,url,width,height,target){
+			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,
+				maxmin: true, //开启最大化最小化按钮
+				content: url ,
+				skin:"three-btns",
+				btn: ['送审','暂存','关闭'],
+				btn1: 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中展示
+					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){
+					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
+					}
+					return false;
+				},
+				btn3: function(index){
+				}
+			});
+
+		}
+
 		function openDialogreNew(title,url,width,height,target,buttons) {
 
 			if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
@@ -639,6 +695,7 @@
 			})
 		}
 
+
 		function show(d) {
 			////对操作进行初始化
 			var xml = '<div class=\"layui-btn-group\">';
@@ -949,6 +1006,10 @@
 					xml+="<a href=\"#\" onclick=\"projectUpgrade('"+d.id+"','"+d.projectReportRecordStatus+"','"+d.filingProjectStatus+"','"+d.projectReportStatus+"','"+d.projectReportStatusTwo+"')\" class=\"layui-btn layui-btn-xs layui-bg-green\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 项目升级</a>";
 				}
 			}
+			//材料库处理按钮
+			if (d.projectMaterialStorageStatus==1){
+				xml+="<a href=\"#\" onclick=\"openDialogre('添加项目材料信息', '${ctx}/project/projectMaterialStorage/form?id=" + d.id +"','95%', '95%','','提交,关闭')\" class=\"layui-btn layui-btn-xs layui-bg-blue\" style='height: 32px;margin-top: 5px;margin-bottom: 5px;' > 材料库处理</a>";
+			}
 			</shiro:hasPermission>
 			<shiro:hasPermission name="ruralProject:ruralCostProjectMessage:reportedProvincialStanding">
 			if(d.reportedState == 5 || d.reportedState == 7){
@@ -1335,6 +1396,14 @@
 						}
 						return xml;
 					}}
+				,{align:'center', title: '材料库',  width:110,templet:function(d){
+						var st = getProjectMaterialStorageStatus(d.projectMaterialStorageStatus);
+						if(st.action)
+							var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/project/projectMaterialStorage/form?reportedProcessInstanceId=" + d.reportedProcessInstanceId + "','95%','95%')\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status+ "</span>";
+						else
+							var xml = "<span style=\"cursor:default;\" class=\"new-status-label status-label-" + st.label + "\" >" + st.status + "</span>";
+						return xml;
+					}}
 				<%--,{align:'center', title: '纸质',  width:90,templet:function(d){--%>
 				<%--		var st = getRuralProjectArchiveState(d.paperFilingStatus);--%>
 				<%--		if(st.action)--%>
@@ -1401,6 +1470,7 @@
 					,"caseType":"${projectRecords.caseType}"
 					,"caseCreateBy":"${projectRecords.caseCreateBy}"
 					,"caseStatus":"${projectRecords.caseStatus}"
+					,"projectMaterialStorageStatus":"${projectRecords.projectMaterialStorageStatus}"
 					,"falg":
 					<c:choose>
 						<c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">