浏览代码

Merge remote-tracking branch 'origin/master'

user7 5 年之前
父节点
当前提交
eb03218f1b

+ 25 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectPlanDao.java

@@ -0,0 +1,25 @@
+package com.jeeplus.modules.projectrecord.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@MyBatisDao
+public interface ProjectPlanDao extends CrudDao<ProjectPlanInfo> {
+    /**
+     * 根据用户名称获取用户id
+     * @param userName
+     * @return
+     */
+    User getUserId(String userName);
+
+    List<ProjectPlanInfo> getProjectPlanList(ProjectPlanInfo projectPlanInfo);
+
+    String getProjectTypeName(@Param("projectStage") String projectStage , @Param("parentId") String parentId);
+
+}

+ 2 - 0
src/main/java/com/jeeplus/modules/projectrecord/dao/ProjectRecordsDao.java

@@ -5,6 +5,7 @@ package com.jeeplus.modules.projectrecord.dao;
 
 
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.CrudDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.projectType.entity.ProjectType;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 
 
 import java.util.List;
 import java.util.List;
@@ -33,5 +34,6 @@ public interface ProjectRecordsDao extends CrudDao<ProjectRecords> {
     int queryCount(ProjectRecords records);
     int queryCount(ProjectRecords records);
     int queryCountByStatus(ProjectRecords records);
     int queryCountByStatus(ProjectRecords records);
 
 
+    List<ProjectType> getProjectType(String projectTypeId);
 
 
 }
 }

+ 78 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectPlanInfo.java

@@ -0,0 +1,78 @@
+package com.jeeplus.modules.projectrecord.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import com.jeeplus.common.utils.excel.annotation.ExcelField;
+
+
+public class ProjectPlanInfo extends DataEntity<ProjectPlanInfo> {
+    private String projectId;     //项目id
+    private String projectStage;  //项目阶段信息
+    private String beginDate;       //计划开始时间
+    private String endDate;         //计划结束时间
+    private String remindName;    //提醒人
+    private String finishName;    //完成人
+
+    private String loginId;
+
+
+    public String getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(String projectId) {
+        this.projectId = projectId;
+    }
+
+    @ExcelField(title="项目阶段信息", align=2, sort=1)
+    public String getProjectStage() {
+        return projectStage;
+    }
+
+    public void setProjectStage(String projectStage) {
+        this.projectStage = projectStage;
+    }
+
+    @ExcelField(title="计划开始时间", align=2, sort=2)
+    public String getBeginDate() {
+        return beginDate;
+    }
+
+    public void setBeginDate(String beginDate) {
+        this.beginDate = beginDate;
+    }
+
+    @ExcelField(title="计划结束时间", align=2, sort=3)
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
+    @ExcelField(title="提醒人", align=2, sort=4)
+    public String getRemindName() {
+        return remindName;
+    }
+
+    public void setRemindName(String remindName) {
+        this.remindName = remindName;
+    }
+
+    @ExcelField(title="完成人", align=2, sort=5)
+    public String getFinishName() {
+        return finishName;
+    }
+
+    public void setFinishName(String finishName) {
+        this.finishName = finishName;
+    }
+
+    public String getLoginId() {
+        return loginId;
+    }
+
+    public void setLoginId(String loginId) {
+        this.loginId = loginId;
+    }
+}

+ 29 - 0
src/main/java/com/jeeplus/modules/projectrecord/entity/ProjectRecords.java

@@ -58,6 +58,9 @@ public class ProjectRecords extends ActEntity<ProjectRecords> {
 	private Double totalFees;        //总合同额
 	private Double totalFees;        //总合同额
 	private String projectRegistrant;  //项目登记人
 	private String projectRegistrant;  //项目登记人
 
 
+	private String view;   //显示判断条件
+	private Integer operationSign;
+
 	//新添代码
 	//新添代码
 	private String projectTypeId; //项目类型
 	private String projectTypeId; //项目类型
 
 
@@ -111,6 +114,8 @@ public class ProjectRecords extends ActEntity<ProjectRecords> {
 
 
 	private List<ProjectReportData> projectReportData = Lists.newArrayList();
 	private List<ProjectReportData> projectReportData = Lists.newArrayList();
 
 
+	private List<ProjectPlanInfo> projectPlanList= Lists.newArrayList();;//项目计划信息
+
 	public ProjectRecords() {
 	public ProjectRecords() {
 		super();
 		super();
 	}
 	}
@@ -616,4 +621,28 @@ public class ProjectRecords extends ActEntity<ProjectRecords> {
 	public void setWorkDesignLinkmanList(List<WorkClientLinkman> workDesignLinkmanList) {
 	public void setWorkDesignLinkmanList(List<WorkClientLinkman> workDesignLinkmanList) {
 		this.workDesignLinkmanList = workDesignLinkmanList;
 		this.workDesignLinkmanList = workDesignLinkmanList;
 	}
 	}
+
+	public List<ProjectPlanInfo> getProjectPlanList() {
+		return projectPlanList;
+	}
+
+	public void setProjectPlanList(List<ProjectPlanInfo> projectPlanList) {
+		this.projectPlanList = projectPlanList;
+	}
+
+	public String getView() {
+		return view;
+	}
+
+	public void setView(String view) {
+		this.view = view;
+	}
+
+	public Integer getOperationSign() {
+		return operationSign;
+	}
+
+	public void setOperationSign(Integer operationSign) {
+		this.operationSign = operationSign;
+	}
 }
 }

+ 129 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectPlanService.java

@@ -0,0 +1,129 @@
+package com.jeeplus.modules.projectrecord.service;
+
+
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectrecord.dao.ProjectPlanDao;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.dao.WorkClientAttachmentDao;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
+import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+@Service
+@Transactional(readOnly = true)
+public class ProjectPlanService extends CrudService<ProjectPlanDao, ProjectPlanInfo> {
+
+    @Autowired
+    private WorkClientAttachmentDao workClientAttachmentDao;
+    @Autowired
+    private WorkProjectNotifyService workProjectNotifyService;
+
+
+    public List<ProjectPlanInfo> getProjectPlanList(ProjectPlanInfo projectPlanInfo){
+        return dao.getProjectPlanList(projectPlanInfo);
+    }
+
+    public List<WorkClientAttachment> getWorkAttachment(String projectId) {
+        WorkClientAttachment attchment = new WorkClientAttachment();
+        attchment.setAttachmentId(projectId);
+        attchment.setAttachmentFlag("131");
+        List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
+        return attachments;
+    }
+
+
+    @Transactional(readOnly = false)
+    public void saveProjectPlanInfo(ProjectRecords projectRecords){
+
+        Set masterIdSet = new HashSet();
+        //项目计划信息
+        for (ProjectPlanInfo projectPlanInfo : projectRecords.getProjectPlanList()){
+            if (projectPlanInfo.getId() == null){
+                continue;
+            }
+            //根据用户姓名查询用户id
+            //获取提醒人信息
+            User userR = dao.getUserId(projectPlanInfo.getRemindName());
+            projectPlanInfo.setRemindName(userR.getId());
+            //获取完成人信息
+            User userF = dao.getUserId(projectPlanInfo.getFinishName());
+            projectPlanInfo.setFinishName(userF.getId());
+            //根据项目类型查询typeId
+            String projectTypeId = dao.getProjectTypeName(projectPlanInfo.getProjectStage(),projectRecords.getProjectTypeId());
+            projectPlanInfo.setProjectStage(projectTypeId);
+
+            masterIdSet.add(userR.getId());
+
+
+            projectPlanInfo.setProjectId(projectRecords.getId());
+            if (ProjectPlanInfo.DEL_FLAG_NORMAL.equals(projectPlanInfo.getDelFlag())){
+                if (StringUtils.isBlank(projectPlanInfo.getId())){
+                    projectPlanInfo.preInsert();
+                    dao.insert(projectPlanInfo);
+                }else{
+                    projectPlanInfo.preUpdate();
+                    dao.update(projectPlanInfo);
+                }
+            }else{
+                dao.delete(projectPlanInfo);
+            }
+        }
+
+        String notifyStr = "项目编号:"+projectRecords.getProjectId()+",项目名称:"+ projectRecords.getProjectName();
+        String titleStr = "项目名称:"+ projectRecords.getProjectName();
+        //Set转List
+        List<String> masterIdList = new ArrayList<>(masterIdSet);
+        List<User> userList = new ArrayList<>();
+        for (String userId: masterIdList) {
+            User user = UserUtils.get(userId);
+            userList.add(user);
+        }
+        for(int i=0;i<masterIdList.size();i++){
+            workProjectNotifyService
+                    .save(UtilNotify
+                            .saveNotify(projectRecords.getId(),
+                                    userList.get(i),
+                                    projectRecords.getCompany().getId(),
+                                    titleStr,
+                                    notifyStr,
+                                    "131",
+                                    "0",
+                                    "待通知",
+                                    ""));
+        }
+
+        //项目计划附件信息
+        for (WorkClientAttachment workClientAttachment : projectRecords.getWorkAttachments()){
+            if (workClientAttachment.getId() == null){
+                continue;
+            }
+            if (WorkClientAttachment.DEL_FLAG_NORMAL.equals(workClientAttachment.getDelFlag())){
+                workClientAttachment.setAttachmentId(projectRecords.getId());
+                workClientAttachment.setAttachmentFlag("131");
+                workClientAttachment.setAttachmentUser(UserUtils.getUser().getId());
+                if (StringUtils.isBlank(workClientAttachment.getId()) || "null".equals(workClientAttachment.getId())){
+                    workClientAttachment.preInsert();
+                    workClientAttachmentDao.insert(workClientAttachment);
+                }else{
+                    workClientAttachment.preUpdate();
+                    workClientAttachmentDao.update(workClientAttachment);
+                }
+            }else{
+                workClientAttachmentDao.delete(workClientAttachment);
+            }
+        }
+    }
+
+}

+ 7 - 0
src/main/java/com/jeeplus/modules/projectrecord/service/ProjectRecordsService.java

@@ -13,6 +13,7 @@ import com.jeeplus.common.utils.MenuStatusEnum;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ProcessDefCache;
 import com.jeeplus.modules.act.utils.ProcessDefCache;
+import com.jeeplus.modules.projectType.entity.ProjectType;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
 import com.jeeplus.modules.projectcontentinfo.dao.ProjectcontentinfoDao;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
@@ -320,6 +321,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
         }
         }
         for (WorkClientAttachment workClientAttachment : projectRecords.getWorkAttachments()) {
         for (WorkClientAttachment workClientAttachment : projectRecords.getWorkAttachments()) {
             workClientAttachment.setAttachmentId(projectRecords.getId());
             workClientAttachment.setAttachmentId(projectRecords.getId());
+			workClientAttachment.setAttachmentFlag("82");
             workClientAttachment.setId(null);
             workClientAttachment.setId(null);
             workClientAttachment.setIsNewRecord(false);
             workClientAttachment.setIsNewRecord(false);
             workClientAttachment.preInsert();
             workClientAttachment.preInsert();
@@ -1089,6 +1091,7 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 	public void queryWorkAttachment(ProjectRecords projectRecords) {
 	public void queryWorkAttachment(ProjectRecords projectRecords) {
 		WorkClientAttachment attchment = new WorkClientAttachment();
 		WorkClientAttachment attchment = new WorkClientAttachment();
 		attchment.setAttachmentId(projectRecords.getId());
 		attchment.setAttachmentId(projectRecords.getId());
+		attchment.setAttachmentFlag("82");
 		List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 		List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 		projectRecords.setWorkAttachments(attachments);
 		projectRecords.setWorkAttachments(attachments);
 	}
 	}
@@ -1241,5 +1244,9 @@ public class ProjectRecordsService extends CrudService<ProjectRecordsDao, Projec
 		return clientLinkmanDao.getLinkManByNameAndOffice(workClientLinkman);
 		return clientLinkmanDao.getLinkManByNameAndOffice(workClientLinkman);
 	}
 	}
 
 
+	public List<ProjectType> getProjectType(String projectTypeId){
+		return dao.getProjectType(projectTypeId);
+	}
+
 
 
 }
 }

+ 171 - 0
src/main/java/com/jeeplus/modules/projectrecord/web/ProjectPlanController.java

@@ -0,0 +1,171 @@
+package com.jeeplus.modules.projectrecord.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.web.BaseController;
+import com.jeeplus.modules.projectType.entity.ProjectType;
+import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
+import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
+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.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+
+/**
+ * 项目计划Controller
+ * @author ppt
+ * @version 2018-05-02
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/project/projectPlan")
+public class ProjectPlanController extends BaseController {
+
+    @Autowired
+    private ProjectRecordsService projectRecordsService;
+
+    @Autowired
+    private ProjectPlanService projectPlanService;
+
+    @ModelAttribute
+    public ProjectRecords get(@RequestParam(required=false) String id) {
+        ProjectRecords entity = null;
+        if (StringUtils.isNotBlank(id)){
+            entity = projectRecordsService.get(id);
+        }
+        if (entity == null){
+            entity = new ProjectRecords();
+        }
+        return entity;
+    }
+
+    /**
+     * 项目列表页面
+     */
+    @RequiresPermissions("project:projectPlan:list")
+    @RequestMapping(value = {"list", ""})
+    public String list(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
+        if(UserUtils.isManager()){
+            model.addAttribute("flag","1");
+        }
+        projectRecords.setProjectStatus(5);
+        Page<ProjectRecords> page = projectRecordsService.findPage(new Page<ProjectRecords>(request, response), projectRecords);
+        //无合同状态下,获取委托方的名称
+        List<ProjectRecords> list = page.getList();
+        for (int i = 0; i < list.size(); i++) {
+            ProjectRecords records1 = list.get(i);
+            if (records1.getWorkContractInfo() == null) {
+                projectRecordsService.queryLinkmanInfos(records1);
+                if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
+                    WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
+                    WorkContractInfo contractInfo = new WorkContractInfo();
+                    contractInfo.setClient(linkman.getClientId());
+                    records1.setWorkContractInfo(contractInfo);
+                }
+            }
+            Set masterIdSet = new HashSet();
+            for (User masterUser:records1.getProjectLeaders()) {
+                masterIdSet.add(masterUser.getId());
+            }
+            //Set转List
+            List<String> masterIdList = new ArrayList<>(masterIdSet);
+            //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
+            for (String masterId : masterIdList) {
+                if(masterId.equals(UserUtils.getUser().getId())){
+                    records1.setOperationSign(1);
+                    break;
+                }else{
+                    records1.setOperationSign(0);
+                }
+            }
+        }
+        model.addAttribute("page", page);
+        return "modules/projectrecord/plan/projectPlanList";
+    }
+
+    @RequestMapping(value = {"form"})
+    public String form(ProjectRecords projectRecords, Model model) {
+        boolean flag = false;
+        if("view".equals(projectRecords.getView())){
+            flag = true;
+        }
+        //获取项目信息
+        if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+            projectRecords = projectRecordsService.get(projectRecords.getId());
+        }else {
+            projectRecords.setCreateBy(UserUtils.getUser());
+            projectRecords.setCreateDate(new Date());
+        }
+
+        List<ProjectType> projectTypeList = projectRecordsService.getProjectType(projectRecords.getProjectTypeId());
+        ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+        projectPlanInfo.setProjectId(projectRecords.getId());
+        //获取项目计划信息
+        List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+        //获取 项目计划附件信息
+        List<WorkClientAttachment> workAttachmentList = projectPlanService.getWorkAttachment(projectRecords.getId());
+        projectRecords.setProjectPlanList(projectPlanList);
+        projectRecords.setWorkAttachments(workAttachmentList);
+        model.addAttribute("projectRecords", projectRecords);
+        model.addAttribute("projectTypeList", projectTypeList);
+        if(flag){
+            return "modules/projectrecord/plan/projectPlanView";
+        }
+        return "modules/projectrecord/plan/projectPlanForm";
+    }
+
+    /**
+     * 保存客户管理
+     */
+    @RequiresPermissions(value={"project:projectPlan:add","project:projectPlan:edit"})
+    @RequestMapping(value = "save")
+    public String save(ProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) throws Exception{
+
+        projectPlanService.saveProjectPlanInfo(projectRecords);//保存
+        addMessage(redirectAttributes, "保存项目计划成功");
+        return "redirect:"+ Global.getAdminPath()+"/project/projectPlan/?repage";
+    }
+
+    /**
+     * 导出excel文件
+     */
+    @RequestMapping(value = "export")
+    public String exportFile(ProjectRecords projectRecords, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String fileName = projectRecords.getProjectName()+"-项目计划.xlsx";
+            ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+            projectPlanInfo.setProjectId(projectRecords.getId());
+            //获取项目计划信息
+            List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+            new ExportExcel(projectRecords.getProjectName()+"-项目计划", ProjectPlanInfo.class).setDataList(projectPlanList).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导出项目计划记录失败!失败信息:"+e.getMessage());
+        }
+        return "redirect:"+Global.getAdminPath()+"/project/projectPlan/?repage";
+    }
+
+}

+ 34 - 1
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -36,6 +36,7 @@ import com.jeeplus.modules.oabuy.service.OaBuyService;
 import com.jeeplus.modules.oaperformance.entity.OaPerformance;
 import com.jeeplus.modules.oaperformance.entity.OaPerformance;
 import com.jeeplus.modules.oaperformance.service.OaPerformanceService;
 import com.jeeplus.modules.oaperformance.service.OaPerformanceService;
 import com.jeeplus.modules.officeintroduce.dao.OfficeintroduceDao;
 import com.jeeplus.modules.officeintroduce.dao.OfficeintroduceDao;
+import com.jeeplus.modules.projectType.entity.ProjectType;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportRecord;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
 import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
@@ -43,8 +44,10 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordsAlter;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecordsAlter;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsAlterService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsAlterService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
@@ -83,6 +86,7 @@ import com.jeeplus.modules.workchangejob.entity.WorkChangeJob;
 import com.jeeplus.modules.workchangejob.entity.WorkChangeJobUser;
 import com.jeeplus.modules.workchangejob.entity.WorkChangeJobUser;
 import com.jeeplus.modules.workchangejob.service.WorkChangeJobService;
 import com.jeeplus.modules.workchangejob.service.WorkChangeJobService;
 import com.jeeplus.modules.workchangejob.service.WorkChangeJobUserService;
 import com.jeeplus.modules.workchangejob.service.WorkChangeJobUserService;
+import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workcontractinfo.service.WorkContractInfoService;
 import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
 import com.jeeplus.modules.workcontractrecord.entity.WorkContractRecord;
@@ -411,6 +415,8 @@ public class WorkProjectNotifyController extends BaseController {
 	private WorkSingleWageService workSingleWageService;
 	private WorkSingleWageService workSingleWageService;
 	@Autowired
 	@Autowired
 	private WorkRepayService workRepayService;
 	private WorkRepayService workRepayService;
+	@Autowired
+	private ProjectPlanService projectPlanService;
 
 
 	@ModelAttribute
 	@ModelAttribute
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
 	public WorkProjectNotify get(@RequestParam(required=false) String id) {
@@ -1118,7 +1124,34 @@ public class WorkProjectNotifyController extends BaseController {
 						}
 						}
 					}
 					}
 
 
-				} else if (workProjectNotify.getType().equals("41")) {    //项目变更
+				}else if (workProjectNotify.getType().equals("131")) {    //项目计划通知
+					boolean flag = false;
+					//通过通知信息id获取项目登记对象
+					ProjectRecords projectRecords = projectRecordsService.get(workProjectNotify.getNotifyId());
+					//获取项目信息
+					if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
+						projectRecords = projectRecordsService.get(projectRecords.getId());
+					}else {
+						projectRecords.setCreateBy(UserUtils.getUser());
+						projectRecords.setCreateDate(new Date());
+					}
+
+					List<ProjectType> projectTypeList = projectRecordsService.getProjectType(projectRecords.getProjectTypeId());
+					ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+					projectPlanInfo.setProjectId(projectRecords.getId());
+					projectPlanInfo.setLoginId(UserUtils.getUser().getId());
+					//获取项目计划信息
+					List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+					//获取 项目计划附件信息
+					List<WorkClientAttachment> workAttachmentList = projectPlanService.getWorkAttachment(projectRecords.getId());
+					projectRecords.setProjectPlanList(projectPlanList);
+					projectRecords.setWorkAttachments(workAttachmentList);
+					model.addAttribute("projectRecords", projectRecords);
+					model.addAttribute("projectTypeList", projectTypeList);
+					return "modules/projectrecord/plan/projectPlanView";
+
+				}
+				else if (workProjectNotify.getType().equals("41")) {    //项目变更
 					boolean flag = false;
 					boolean flag = false;
 					ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
 					ProjectRecordsAlter projectRecordsAlter = projectRecordsAlterService.get(workProjectNotify.getNotifyId());
 					if (projectRecordsAlter != null && StringUtils.isNotBlank(projectRecordsAlter.getId())) {
 					if (projectRecordsAlter != null && StringUtils.isNotBlank(projectRecordsAlter.getId())) {

+ 114 - 0
src/main/resources/mappings/modules/projectrecord/ProjectPlanDao.xml

@@ -0,0 +1,114 @@
+<?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.projectrecord.dao.ProjectPlanDao">
+
+	<sql id="projectPlanColumns">
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.remarks AS "remarks",
+
+		a.project_id as projectId,
+		a.project_stage as projectStage,
+		DATE_FORMAT(a.begin_date,'%Y-%m-%d') as beginDate,
+		DATE_FORMAT(a.end_date,'%Y-%m-%d') as endDate,
+		a.remind_name as remindName,
+		a.finish_name as finishName
+	</sql>
+	
+    
+	<select id="getUserId" resultType="com.jeeplus.modules.sys.entity.User">
+		select * from sys_user where name = #{userName}
+	</select>
+
+	<insert id="insert">
+		insert into project_plan_info (
+		  id,
+		  create_by,
+		  create_date,
+		  update_by,
+		  update_date,
+		  remarks,
+		  del_flag,
+		  project_id,
+		  project_stage,
+		  begin_date,
+		  end_date,
+		  remind_name,
+		  finish_name
+		)
+		values
+		  (
+		  	#{id},
+			#{createBy.id},
+			#{createDate},
+			#{updateBy.id},
+			#{updateDate},
+			#{remarks},
+			#{delFlag},
+		  	#{projectId},
+		  	#{projectStage},
+		  	#{beginDate},
+		  	#{endDate},
+		  	#{remindName},
+		  	#{finishName}
+		  )
+	</insert>
+
+	<update id="update">
+		update
+  			project_plan_info
+		set
+		  update_by = #{updateBy.id},
+		  update_date = #{updateDate},
+		  remarks = #{remarks},
+		  del_flag = #{delFlag},
+		  project_id = #{projectId},
+		  project_stage = #{projectStage},
+		  begin_date = #{beginDate},
+		  end_date = #{endDate},
+		  remind_name = #{remindName},
+		  finish_name = #{finishName}
+		where id = #{id}
+	</update>
+
+	<delete id="delete">
+		update project_plan_info set del_flag=1 where id = #{id}
+	</delete>
+
+	<select id="getProjectPlanList" resultType="com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo">
+		select
+		a.id AS "id",
+		a.create_by AS "createBy.id",
+		a.create_date AS "createDate",
+		a.update_by AS "updateBy.id",
+		a.update_date AS "updateDate",
+		a.del_flag AS "delFlag",
+		a.remarks AS "remarks",
+		a.project_id as projectId,
+		pt.type_name as projectStage,
+		DATE_FORMAT(a.begin_date,'%Y-%m-%d') as beginDate,
+		DATE_FORMAT(a.end_date,'%Y-%m-%d') as endDate,
+		sur.name as remindName,
+		suf.name as finishName
+		from project_plan_info a
+		left join project_type pt on a.project_stage = pt.type_id
+		left join sys_user sur on a.remind_name = sur.id
+		left join sys_user suf on a.finish_name = suf.id
+		<where>
+			a.del_flag=0 and a.project_id = #{projectId}
+			<if test="loginId!= null and loginId!= ''">
+				AND a.remind_name  = #{loginId}
+			</if>
+		</where>
+		order by a.update_date desc
+	</select>
+
+	<select id="getProjectTypeName" resultType="java.lang.String">
+		select type_id as typeId from project_type where type_name = #{projectStage} and parent_id = #{parentId}
+	</select>
+
+</mapper>

+ 4 - 0
src/main/resources/mappings/modules/projectrecord/ProjectRecordsDao.xml

@@ -650,4 +650,8 @@
 		</choose>
 		</choose>
 	</select>
 	</select>
 
 
+	<select id="getProjectType" resultType="com.jeeplus.modules.projectType.entity.ProjectType">
+		select type_id as typeId,type_name as typeName from project_type where parent_id = #{projectTypeId}
+	</select>
+
 </mapper>
 </mapper>

+ 97 - 0
src/main/webapp/WEB-INF/tags/sys/treeselecttPlanUser.tag

@@ -0,0 +1,97 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="树结构数据地址"%>
+<%@ attribute name="checked" type="java.lang.Boolean" required="false" description="是否显示复选框,如果不需要返回父节点,请设置notAllowSelectParent为true"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="排除掉的编号(不能选择的编号)"%>
+<%@ attribute name="isAll" type="java.lang.Boolean" required="false" description="是否列出全部数据,设置true则不进行数据权限过滤(目前仅对Office有效)"%>
+<%@ attribute name="notAllowSelectRoot" type="java.lang.Boolean" required="false" description="不允许选择根节点"%>
+<%@ attribute name="notAllowSelectParent" type="java.lang.Boolean" required="false" description="不允许选择父节点"%>
+<%@ attribute name="module" type="java.lang.String" required="false" description="过滤栏目模型(只显示指定模型,仅针对CMS的Category树)"%>
+<%@ attribute name="selectScopeModule" type="java.lang.Boolean" required="false" description="选择范围内的模型(控制不能选择公共模型,不能选择本栏目外的模型)(仅针对CMS的Category树)"%>
+<%@ attribute name="allowClear" type="java.lang.Boolean" required="false" description="是否允许清除"%>
+<%@ attribute name="allowInput" type="java.lang.Boolean" required="false" description="文本框可填写"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="smallBtn" type="java.lang.Boolean" required="false" description="缩小按钮显示"%>
+<%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
+	<input id="${id}Id" name="${name}" class="${cssClass}" type="hidden" value="${value}"/>
+	<div class="input-group">
+		<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+       		
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
+<script type="text/javascript">
+	$("#${id}Button, #${id}Name").click(function(){
+		// 是否限制选择,如果限制,设置为disabled
+		if ($("#${id}Button").hasClass("disabled")){
+			return true;
+		}
+		// 正常打开	
+		top.layer.open({
+		    type: 2, 
+		    area: ['300px', '420px'],
+		    title:"选择${title}",
+		    ajaxData:{selectIds: $("#${id}Id").val()},
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}" ,
+		    btn: ['确定', '关闭']
+    	       ,yes: function(index, layero){ //或者使用btn1
+						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
+						var ids = [], names = [], nodes = [];
+						if ("${checked}" == "true"){
+							nodes = tree.getCheckedNodes(true);
+						}else{
+							nodes = tree.getSelectedNodes();
+						}
+						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
+							if (nodes[i].isParent){
+								continue; // 如果为复选框选择,则过滤掉父节点
+							}//</c:if><c:if test="${notAllowSelectRoot}">
+							if (nodes[i].level == 0){
+								//top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
+								top.layer.msg("不能选择根节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}//</c:if><c:if test="${notAllowSelectParent}">
+							if (nodes[i].isParent){
+								//top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
+								//layer.msg('有表情地提示');
+								top.layer.msg("不能选择父节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}//</c:if><c:if test="${not empty module && selectScopeModule}">
+							if (nodes[i].module == ""){
+								//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
+								top.layer.msg("不能选择公共模型("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}else if (nodes[i].module != "${module}"){
+								//top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
+								top.layer.msg("不能选择当前栏目以外的栏目模型,请重新选择。", {icon: 0});
+								return false;
+							}//</c:if>
+							ids.push(nodes[i].id);
+							names.push(nodes[i].name);//<c:if test="${!checked}">
+							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
+						}
+						if(ids.length>1){
+							top.layer.msg("不能进行多选,请重新选择。", {icon: 0});
+							return false;
+						}
+						$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
+						$("#${id}Name").val(names.join(","));
+						$("#${id}Name").focus();
+						top.layer.close(index);
+				    	       },
+    	cancel: function(index){ //或者使用btn2
+    	           //按钮【按钮二】的回调
+    	       }
+		}); 
+	
+	});
+</script>

+ 101 - 0
src/main/webapp/WEB-INF/tags/sys/treeselecttUser.tag

@@ -0,0 +1,101 @@
+<%@ tag language="java" pageEncoding="UTF-8"%>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
+<%@ attribute name="name" type="java.lang.String" required="true" description="隐藏域名称(ID)"%>
+<%@ attribute name="value" type="java.lang.String" required="true" description="隐藏域值(ID)"%>
+<%@ attribute name="labelName" type="java.lang.String" required="true" description="输入框名称(Name)"%>
+<%@ attribute name="labelValue" type="java.lang.String" required="true" description="输入框值(Name)"%>
+<%@ attribute name="title" type="java.lang.String" required="true" description="选择框标题"%>
+<%@ attribute name="url" type="java.lang.String" required="true" description="树结构数据地址"%>
+<%@ attribute name="checked" type="java.lang.Boolean" required="false" description="是否显示复选框,如果不需要返回父节点,请设置notAllowSelectParent为true"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="排除掉的编号(不能选择的编号)"%>
+<%@ attribute name="isAll" type="java.lang.Boolean" required="false" description="是否列出全部数据,设置true则不进行数据权限过滤(目前仅对Office有效)"%>
+<%@ attribute name="notAllowSelectRoot" type="java.lang.Boolean" required="false" description="不允许选择根节点"%>
+<%@ attribute name="notAllowSelectParent" type="java.lang.Boolean" required="false" description="不允许选择父节点"%>
+<%@ attribute name="module" type="java.lang.String" required="false" description="过滤栏目模型(只显示指定模型,仅针对CMS的Category树)"%>
+<%@ attribute name="selectScopeModule" type="java.lang.Boolean" required="false" description="选择范围内的模型(控制不能选择公共模型,不能选择本栏目外的模型)(仅针对CMS的Category树)"%>
+<%@ attribute name="allowClear" type="java.lang.Boolean" required="false" description="是否允许清除"%>
+<%@ attribute name="allowInput" type="java.lang.Boolean" required="false" description="文本框可填写"%>
+<%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
+<%@ attribute name="smallBtn" type="java.lang.Boolean" required="false" description="缩小按钮显示"%>
+<%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
+<%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
+	<input id="${id}Id" name="${name}" class="${cssClass}" type="hidden" value="${value}"/>
+	<div class="input-group">
+		<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
+		class="${cssClass}" style="${cssStyle}"/>
+       		 <span class="input-group-btn">
+	       		 <button type="button"  id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if>  btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
+	             </button>
+       		 </span>
+       		
+    </div>
+	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
+<script type="text/javascript">
+	$("#${id}Button, #${id}Name").click(function(){
+		// 是否限制选择,如果限制,设置为disabled
+		if ($("#${id}Button").hasClass("disabled")){
+			return true;
+		}
+		// 正常打开	
+		top.layer.open({
+		    type: 2, 
+		    area: ['300px', '420px'],
+		    title:"选择${title}",
+		    ajaxData:{selectIds: $("#${id}Id").val()},
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}" ,
+		    btn: ['确定', '关闭']
+    	       ,yes: function(index, layero){ //或者使用btn1
+						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
+						var ids = [], names = [], nodes = [];
+						if ("${checked}" == "true"){
+							nodes = tree.getCheckedNodes(true);
+						}else{
+							nodes = tree.getSelectedNodes();
+						}
+						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
+							if (nodes[i].isParent){
+								continue; // 如果为复选框选择,则过滤掉父节点
+							}//</c:if><c:if test="${notAllowSelectRoot}">
+							if (nodes[i].level == 0){
+								//top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
+								top.layer.msg("不能选择根节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}//</c:if><c:if test="${notAllowSelectParent}">
+							if (nodes[i].isParent){
+								//top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
+								//layer.msg('有表情地提示');
+								top.layer.msg("不能选择父节点("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}//</c:if><c:if test="${not empty module && selectScopeModule}">
+							if (nodes[i].module == ""){
+								//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
+								top.layer.msg("不能选择公共模型("+nodes[i].name+")请重新选择。", {icon: 0});
+								return false;
+							}else if (nodes[i].module != "${module}"){
+								//top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
+								top.layer.msg("不能选择当前栏目以外的栏目模型,请重新选择。", {icon: 0});
+								return false;
+							}//</c:if>
+							ids.push(nodes[i].id);
+							names.push(nodes[i].name);//<c:if test="${!checked}">
+							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
+						}
+						if(ids.length>1){
+							top.layer.msg("不能进行多选,请重新选择。", {icon: 0});
+							return false;
+						}
+						$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
+						$("#${id}Name").val(names.join(","));
+						$("#${id}Name").focus();
+						top.layer.close(index);
+				    	       },
+    	cancel: function(index){ //或者使用btn2
+    	           //按钮【按钮二】的回调
+    	       }
+		}); 
+	
+	});
+</script>

+ 343 - 0
src/main/webapp/webpage/modules/projectrecord/plan/projectPlanForm.jsp

@@ -0,0 +1,343 @@
+<%@ 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}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+
+    <link rel='layuicss' type="text/css" href="${ctxp}/static/layui/css/layui.css"/>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:0px !important;
+            height: 42px !important;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                if(i==2){
+                    $("#inputForm").attr("action","${ctx}/project/projectPlan/save");
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            var radioVal ;
+            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 insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "131";
+                /*console.log(file);*/
+                var timestamp=new Date().getTime();
+
+                var storeAs = "attachment-file/projectRecords/"+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,0);}
+        }
+
+
+        laydate.render({
+            elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+            type : 'date'
+        });
+        laydate.render({
+            elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+            type : 'date'
+        });
+
+        function func(idx){
+            var ids = "projectPlanList";
+            //获取被选中的option标签
+            var vs = document.getElementById("projectPlanList"+idx+"_projectStage").value;
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#projectPlanList tr").length;
+            idx+=1;
+            bornTemplete(list, idx, tpl, row, idx1);
+        }
+
+        function bornTemplete(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");
+                    }
+                }
+            });
+
+            laydate.render({
+                elem : (list+idx+"_beginDate"),
+                event: 'focus',
+                type : 'date',
+                trigger: 'click'
+            });
+            laydate.render({
+                elem : (list+idx+"_endDate"),
+                event: 'focus',
+                type : 'date',
+                trigger: 'click'
+            });
+        }
+        function delRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            if (id.val() == ""){
+                $(obj).parent().parent().remove();
+            }else if(delFlag.val() == "0"){
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            }else if(delFlag.val() == "1"){
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+
+        }
+
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="projectRecords" action="${ctx}/project/projectPlan/save" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目计划信息</h2></div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectName" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
+                        <form:hidden path="createBy.id" htmlEscape="false"   readonly="true"  class="form-control  layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建日期:</label>
+                    <div class="layui-input-block">
+                        <input id="createDate" name="createDate" htmlEscape="false"  value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>" readonly="readonly"  class="form-control required layui-input"/>
+                    </div>
+                </div>
+            </div>
+
+        <div class="form-group layui-row">
+            <div class="layui-item layui-col-sm12 lw7">
+                <label class="layui-form-label double-line">项目计划列表:</label>
+                <div class="layui-input-block">
+                    <div class="layui-item nav-btns" style="padding-left:0px;">
+                        <a class="nav-btn nav-btn-add"
+                           onclick="addRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl);workClientBankRowIdx = workClientBankRowIdx + 1;"
+                           title="新增"><i class="fa fa-plus"></i> 新增</a>
+                        <shiro:hasPermission name="project:projectPlan:export">
+                            <a class="nav-btn nav-btn-export" title="导出"  onclick="return confirmx('确认要导出该项目计划列表吗?', '${ctx}/project/projectPlan/export?id=${projectRecords.id}');"><i class="fa fa-file-excel-o"></i> 导出</a>
+                        </shiro:hasPermission>
+                    </div>
+                    <table id="bankinfo" class="table table-bordered table-condensed can-edit">
+                        <thead>
+                        <tr>
+                            <th width="60px">编号</th>
+                            <th >任务阶段</th>
+                            <th >计划开始时间</th>
+                            <th >计划结束时间</th>
+                            <th >提醒人</th>
+                            <th >完成人</th>
+                            <th width="100px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="projectPlanList">
+
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workClientBankTpl">//<!--
+                                <tr id="projectPlanList{{idx}}">
+                                    <td class="hide">
+                                        <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                        <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                    </td>
+
+                                    <td width="60px">
+                                        <input id="projectPlanList{{idx}}_costNum" name="projectPlanList[{{idx}}].costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_projectStage" name="projectPlanList[{{idx}}].projectStage" list ="num" value="{{row.projectStage}}" class="form-control required datetime"/>
+                                        <datalist id ="num" >
+                                            <c:forEach items="${projectTypeList}" var="projectType">
+                                                <option>${projectType.typeName}</option>
+                                            </c:forEach>
+                                        </datalist>
+                                    </td>
+
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_beginDate" name="projectPlanList[{{idx}}].beginDate" type="text" value="{{row.beginDate}}"  class="form-control required datetime"/>
+                        </td>
+                        <td>
+                            <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_endDate" name="projectPlanList[{{idx}}].endDate" type="text" value="{{row.endDate}}"  class="form-control required datetime"/>
+                        </td>
+
+                                    <td>
+                                        <sys:treeselecttPlanUser id="projectPlanList{{idx}}_remindName" name="remindName" value="${projectRecords.leaderIds}" labelName="projectPlanList[{{idx}}].remindName" labelValue="{{row.remindName}}"
+                                         title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                    </td>
+
+                                    <td>
+                                        <sys:treeselecttPlanUser id="projectPlanList{{idx}}_finishName" name="finishName" value="${projectRecords.leaderIds}" labelName="projectPlanList[{{idx}}].finishName" labelValue="{{row.finishName}}"
+                                         title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                    </td>
+
+                                    <td class="text-center op-td" width="10">
+                                        {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#projectPlanList{{idx}}')" title="删除"><i class="fa fa-trash"></i>&nbsp;删除</span>{{/delBtn}}
+                                    </td>
+                                </tr>//-->
+                    </script>
+                </div>
+            </div>
+        </div>
+
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目计划附件信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
+                    <%--<a class="nav-btn nav-btn-export" title="下载模板"  onclick="window.location.href='${ctx}/project/projectPlan/downloadTemplate';"><i class="fa fa-download"></i>&nbsp;下载模板</a>--%>
+                </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 form-table-container">
+                    <table id="listAttachment" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th width="25%">文件</th>
+                            <th width="25%">上传人</th>
+                            <th width="25%">上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${projectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr class="trIdAdds">
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                        <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workClientAttachment.url}&id=${workClientAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+<script type="text/javascript">
+    var workClientBankRowIdx = 0,
+        workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    $(document).ready(function () {
+        var dataBank = ${fns:toJson(projectRecords.projectPlanList)};
+        for (var i = 0; i < dataBank.length; i++) {
+            addRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, dataBank[i]);
+            workClientBankRowIdx = workClientBankRowIdx + 1;
+        }
+    });
+
+</script>
+</body>
+</html>

+ 296 - 0
src/main/webapp/webpage/modules/projectrecord/plan/projectPlanList.jsp

@@ -0,0 +1,296 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>项目登记</title>
+	<meta name="decorator" content="default"/>
+	<link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
+	<style>
+		.layui-table th{
+			font-size: 14px;
+			/*表头内容居中显示*/
+			text-align: center;
+		}
+		.pid{
+			font-size:14px;
+			font-weight:400;
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+
+			//搜索框收放
+			$('#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'
+			});
+			laydate.render({
+				elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+				event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+				type : 'date'
+			});
+		});
+
+		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: ['提交', '关闭'],
+				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 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) {
+				}
+			});
+		}
+	</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>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+	<sys:message content="${message}"/>
+	<div class="layui-row">
+		<div class="full-width fl">
+			<div class="layui-row contentShadow shadowLR" id="queryDiv">
+				<form:form id="searchForm" modelAttribute="projectRecords" action="${ctx}/project/projectPlan/" 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}"/>
+					<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 with-icon">
+                                    <form:input path="projectId" 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">
+								<form:input path="projectName" 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>
+								<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">
+								<form:input path="leaderNameStr" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">合同名称:</label>
+							<div class="layui-input-block">
+								<input type="text" input="workContractInfoName" name="workContractInfo.name" value="" htmlEscape="false" maxlength="255"  class=" form-control layui-input">
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">委托方:</label>
+							<div class="layui-input-block">
+								<input type="text" input="workContractInfoClientName" name="workContractInfo.client.name" value="" htmlEscape="false" maxlength="255"  class=" form-control layui-input">
+							</div>
+						</div>
+						<div class="layui-item query athird ">
+							<label class="layui-form-label">创建时间:</label>
+							<div class="layui-input-block">
+								<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 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">
+					<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 }
+			,elem: '#contentTable1'
+			,page: false
+			,cols: [[
+				// {checkbox: true, fixed: true},
+				{field:'index',align:'center', title: '序号',width:40}
+				,{field:'projName',align:'center', title: '项目名称',minWidth:200,templet:function(d){
+						return "<a class=\"attention-info\" title=\"" + d.projName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目', '${ctx}/project/projectRecords/view?id=" + d.id +"','95%', '95%')\">" + d.projName + "</a>";
+					}}
+				,{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}/project/projectRecords/view?id=" + d.id + "','95%', '95%')\">" + d.projId + "</a>";
+					}}
+				,{field:'contract', align:'center',title: '合同名称',minWidth:200,templet:function(d){
+						return "<span title='"+ d.contract +"'>" + d.contract + "</span>";
+					}}
+				,{field:'projMaster', align:'center',title: '负责人', width:65,templet:function(d){
+						return "<span title=\"" + d.projMaster + "\">" + d.projMaster + "</span>";
+					}}
+				,{field:'client',align:'center', title: '主委托方',  width:150,templet:function(d){
+						return "<span title=\"" + d.client + "\">" + d.client + "</span>";
+					}}
+				,{field:'createDate',align:'center', title: '创建日期',  width:80}
+				,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
+						////对操作进行初始化
+						var xml="";
+						if(d.canedit3 != undefined && d.canedit3 =="1")
+						{
+							xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogView('查看项目计划信息', '${ctx}/project/projectPlan/form?view=view&id='+encodeURIComponent('" + d.id + "'),'95%','95%')\" style=\"color: white;background: darkseagreen\" class=\"op-btn op-btn-op-btn-revert\" ><i class=\"fa fa-search-plus\"></i> 详情</a>";
+							if(d.operationSign ==1){
+								xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('编辑项目计划信息', '${ctx}/project/projectPlan/form?view=form&id='+encodeURIComponent('" + d.id + "'),'95%','95%','')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 编辑</a>";
+							}
+						}
+						return xml;
+
+					}}
+			]]
+			,data: [
+				<c:if test="${ not empty page.list}">
+				<c:forEach items="${page.list}" var="projectRecords" varStatus="index">
+				<c:if test="${index.index != 0}">,</c:if>
+				{
+					"index":"${index.index+1}"
+					,"id":"${projectRecords.id}"
+					,"projId":"${projectRecords.projectId}"
+					,"projName":"<c:out value="${projectRecords.projectName}" escapeXml="true"/>"
+					,"projMaster":"<c:forEach items="${projectRecords.projectLeaders}" var="leader" varStatus="status"><c:choose><c:when test="${status.last}">${leader.name}</c:when><c:otherwise>${leader.name},</c:otherwise></c:choose></c:forEach>"
+					,"contract":"${projectRecords.workContractInfo.name}"
+					,"client":"${projectRecords.workContractInfo.client.name}"
+					,"createDate":"<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>"
+					,"projectStatus":"${projectRecords.projectStatus}"
+					,"procId":"${projectRecords.processInstanceId}"
+					,"operationSign":"${projectRecords.operationSign}"
+					<shiro:hasPermission name="project:projectRecords: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>
+				}
+				</c:forEach>
+				</c:if>
+			]
+			// ,even: true
+			// ,height: 315
+		});
+	})
+
+	resizeListTable();
+	$("a").on("click",addLinkVisied);
+</script>
+<script>
+	resizeListWindow2();
+	$(window).resize(function(){
+		resizeListWindow2();
+	});
+</script>
+</body>
+</html>

+ 305 - 0
src/main/webapp/webpage/modules/projectrecord/plan/projectPlanView.jsp

@@ -0,0 +1,305 @@
+<%@ 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}/helloweba_editable-select/jquery.editable-select.min.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
+
+    <link rel='layuicss' type="text/css" href="${ctxp}/static/layui/css/layui.css"/>
+    <style>
+        #projectDesc-error{
+            left:0;
+            top:82px;
+        }
+        .layui-layer-dialog{
+            background: red;
+        }
+        td input{
+            margin-left:0px !important;
+            height: 42px !important;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                if(i==2){
+                    $("#inputForm").attr("action","${ctx}/project/projectPlan/save");
+                }
+                $("#inputForm").submit();
+                return true;
+            }
+
+            return false;
+        }
+        $(document).ready(function() {
+            var radioVal ;
+            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 insertTitle(tValue){
+            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
+                var attachmentId = "";
+                var attachmentFlag = "131";
+                /*console.log(file);*/
+                var timestamp=new Date().getTime();
+
+                var storeAs = "attachment-file/projectRecords/"+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,0);}
+        }
+
+
+        laydate.render({
+            elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+            type : 'date'
+        });
+        laydate.render({
+            elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
+            event: 'focus', //响应事件。如果没有传入event,则按照默认的click
+            type : 'date'
+        });
+
+        function func(idx){
+            var ids = "projectPlanList";
+            //获取被选中的option标签
+            var vs = document.getElementById("projectPlanList"+idx+"_projectStage").value;
+        }
+
+        function addFile() {
+            $("#attachment_file").click();
+        }
+
+        function addRow(list, idx, tpl, row){
+            var idx1 = $("#projectPlanList tr").length;
+            idx+=1;
+            bornTemplete(list, idx, tpl, row, idx1);
+        }
+
+        function bornTemplete(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 delRow(obj, prefix){
+            var id = $(prefix+"_id");
+            var delFlag = $(prefix+"_delFlag");
+            if (id.val() == ""){
+                $(obj).parent().parent().remove();
+            }else if(delFlag.val() == "0"){
+                delFlag.val("1");
+                $(obj).html("&divide;").attr("title", "撤回删除");
+                $(obj).parent().parent().addClass("error");
+                $(obj).parent().parent().addClass("hide");
+            }else if(delFlag.val() == "1"){
+                delFlag.val("0");
+                $(obj).html("&times;").attr("title", "删除");
+                $(obj).parent().parent().removeClass("error");
+            }
+
+        }
+
+
+    </script>
+</head>
+<body>
+<div class="single-form">
+    <div class="container">
+        <sys:message content="${message}"/>
+        <form:form id="inputForm" modelAttribute="projectRecords" action="${ctx}/project/projectPlan/save" method="post" class="form-horizontal">
+            <form:hidden path="id"/>
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>项目计划信息</h2></div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目名称:</label>
+                    <div class="layui-input-block">
+                        <form:input path="projectName" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">项目编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="projectId" htmlEscape="false"  readonly="true" class="form-control layui-input"/>
+                        </div>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建人:</label>
+                    <div class="layui-input-block">
+                        <form:input path="createBy.name" htmlEscape="false"  readonly="true"  class="form-control  layui-input"/>
+                        <form:hidden path="createBy.id" htmlEscape="false"   readonly="true"  class="form-control  layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6 lw7">
+                    <label class="layui-form-label">创建日期:</label>
+                    <div class="layui-input-block">
+                        <input id="createDate" name="createDate" htmlEscape="false"  value="<fmt:formatDate value="${projectRecords.createDate}" pattern="yyyy-MM-dd"/>" readonly="readonly"  class="form-control required layui-input"/>
+                    </div>
+                </div>
+            </div>
+
+        <div class="form-group layui-row">
+            <div class="layui-item layui-col-sm12 lw7">
+                <label class="layui-form-label double-line">项目计划列表:</label>
+                <div class="layui-input-block">
+                    <table id="bankinfo" class="table table-bordered table-condensed can-edit">
+                        <thead>
+                        <tr>
+                            <th width="80px">任务编码</th>
+                            <th >任务阶段</th>
+                            <th >计划开始时间</th>
+                            <th >计划结束时间</th>
+                            <th >提醒人</th>
+                            <th >完成人</th>
+                        </tr>
+                        </thead>
+                        <tbody id="projectPlanList">
+
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="workClientBankTpl">//<!--
+                                <tr id="projectPlanList{{idx}}">
+                                    <td class="hide">
+                                        <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                        <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                    </td>
+
+                                    <td width="60px">
+                                        <input id="projectPlanList{{idx}}_costNum" name="projectPlanList[{{idx}}].costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                    <td>
+                                       <input id="projectPlanList{{idx}}_projectStage" name="projectPlanList[{{idx}}].projectStage" readonly="readonly" value="{{row.projectStage}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_beginDate" readonly="readonly" name="projectPlanList[{{idx}}].beginDate" type="text" value="{{row.beginDate}}"  class="form-control required datetime"/>
+                                    </td>
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_endDate" readonly="readonly" name="projectPlanList[{{idx}}].endDate" type="text" value="{{row.endDate}}"  class="form-control required datetime"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_remindName" name="projectPlanList[{{idx}}].remindName" readonly="readonly" style="text-align: center"  value="{{row.remindName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_finishName" name="projectPlanList[{{idx}}].finishName" readonly="readonly" style="text-align: center"  value="{{row.finishName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                </tr>//-->
+                    </script>
+                </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 form-table-container">
+                    <table id="listAttachment" class="table table-bordered table-condensed details">
+                        <thead>
+                        <tr>
+                                <%-- <th>序号</th>--%>
+                            <th width="25%">文件</th>
+                            <th width="25%">上传人</th>
+                            <th width="25%">上传时间</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="file_attachment">
+                        <c:forEach items="${projectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
+                            <tr class="trIdAdds">
+                                    <%-- <td>${status.index + 1}</td>--%>
+                                <c:choose>
+                                    <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'gif')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'bmp')
+                                                           or fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpeg')}">
+                                        <td><img src="${workClientAttachment.url}" width="50" height="50" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workClientAttachment.url}','90%','90%')" alt="${workClientAttachment.attachmentName}">
+                                    </c:when>
+                                    <c:otherwise>
+                                        <c:choose>
+                                            <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'pdf')}">
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%','1')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:when>
+                                            <c:otherwise>
+                                                <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workClientAttachment.url}','90%','90%')">${workClientAttachment.attachmentName}</a></td>
+                                            </c:otherwise>
+                                        </c:choose>
+                                    </c:otherwise>
+                                </c:choose>
+                                <td>${workClientAttachment.createBy.name}</td>
+                                <td><fmt:formatDate value="${workClientAttachment.createDate}" type="both"/></td>
+                                <td class="op-td">
+                                    <div class="op-btn-box" >
+                                        <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent(encodeURIComponent('${workClientAttachment.url}'));" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
+                                    </div>
+                                </td>
+                            </tr>
+                        </c:forEach>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
+</div>
+<script type="text/javascript">
+    var workClientBankRowIdx = 0,
+        workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    $(document).ready(function () {
+        var dataBank = ${fns:toJson(projectRecords.projectPlanList)};
+        for (var i = 0; i < dataBank.length; i++) {
+            addRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, dataBank[i]);
+            workClientBankRowIdx = workClientBankRowIdx + 1;
+        }
+    });
+
+</script>
+</body>
+</html>

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

@@ -1088,13 +1088,13 @@
                         <form:input path="projectSite" htmlEscape="false"  class="form-control layui-input"/>
                         <form:input path="projectSite" htmlEscape="false"  class="form-control layui-input"/>
                     </div>
                     </div>
                 </div>
                 </div>
-                <%--<div class="layui-item layui-col-sm6 lw7">
+                <div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
                     <label class="layui-form-label"><span class="require-item">*</span>项目负责人:</label>
                     <div class="layui-input-block  with-icon">
                     <div class="layui-input-block  with-icon">
                         <sys:treeselectt id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}"
                         <sys:treeselectt id="master" name="projectLeaders" value="${projectRecords.leaderIds}" labelName="leaderNameStr" labelValue="${projectRecords.leaderNameStr}"
                                          title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                                          title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                     </div>
                     </div>
-                </div>--%>
+                </div>
 
 
                 <%--<div class="layui-item layui-col-sm6 lw7">
                 <%--<div class="layui-item layui-col-sm6 lw7">
                     <label class="layui-form-label"><span class="require-item">*</span>项目类型:</label>
                     <label class="layui-form-label"><span class="require-item">*</span>项目类型:</label>