|  | @@ -132,6 +132,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  |              model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        //获取已审核的项目信息
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  |          List<ProjectImplementEarly> list = page.getList();
 | 
	
	
		
			
				|  | @@ -148,6 +149,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  |              model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        //获取已审核的项目信息
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  |          List<ProjectImplementEarly> list = page.getList();
 | 
	
	
		
			
				|  | @@ -248,17 +250,26 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "form")
 | 
	
		
			
				|  |  |      public String form(ConstructionContract constructionContract, Model model) {
 | 
	
		
			
				|  |  | +        //判断是否是新增 还是修改
 | 
	
		
			
				|  |  |          if (constructionContract != null && StringUtils.isNotBlank(constructionContract.getId())) {
 | 
	
		
			
				|  |  | +            //修改
 | 
	
		
			
				|  |  | +            //获取实施阶段合同信息
 | 
	
		
			
				|  |  |              constructionContract = contractService.get(constructionContract.getId());
 | 
	
		
			
				|  |  | +            //获取项目信息
 | 
	
		
			
				|  |  |              ProjectRecords projectRecords = projectRecordsService.get(constructionContract.getProjectId());
 | 
	
		
			
				|  |  | +            //填入项目名称
 | 
	
		
			
				|  |  |              constructionContract.setProjectName(projectRecords.getProjectName());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            //获取附件信息  并放入实施阶段合同信息中
 | 
	
		
			
				|  |  |              WorkClientAttachment attchment = new WorkClientAttachment();
 | 
	
		
			
				|  |  |              attchment.setAttachmentId(constructionContract.getId());
 | 
	
		
			
				|  |  |              List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 | 
	
		
			
				|  |  |              constructionContract.setWorkAttachments(attachments);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  | +            //新增
 | 
	
		
			
				|  |  | +            //获取项目信息
 | 
	
		
			
				|  |  |              ProjectRecords records = contractService.getRecords(constructionContract.getProjectId());
 | 
	
		
			
				|  |  | +            //填入创建人信息、创建时间、项目名称等
 | 
	
		
			
				|  |  |              constructionContract.setCreateBy(UserUtils.getUser());
 | 
	
		
			
				|  |  |              constructionContract.setCreateDate(new Date());
 | 
	
		
			
				|  |  |              constructionContract.setProjectName(records.getProjectName());
 | 
	
	
		
			
				|  | @@ -278,10 +289,13 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      /*@RequiresPermissions(value={"project:constructionContract:view"})*/
 | 
	
		
			
				|  |  |      @RequestMapping(value = "view")
 | 
	
		
			
				|  |  |      public String view(ConstructionContract constructionContract, Model model) {
 | 
	
		
			
				|  |  | +        //获取实施阶段合同信息
 | 
	
		
			
				|  |  |          constructionContract = contractService.get(constructionContract.getId());
 | 
	
		
			
				|  |  | +        //获取项目信息
 | 
	
		
			
				|  |  |          ProjectRecords projectRecords = projectRecordsService.get(constructionContract.getProjectId());
 | 
	
		
			
				|  |  | +        //填入项目名称
 | 
	
		
			
				|  |  |          constructionContract.setProjectName(projectRecords.getProjectName());
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        //获取附件信息
 | 
	
		
			
				|  |  |          WorkClientAttachment attchment = new WorkClientAttachment();
 | 
	
		
			
				|  |  |          attchment.setAttachmentId(constructionContract.getId());
 | 
	
		
			
				|  |  |          List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 | 
	
	
		
			
				|  | @@ -296,14 +310,24 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      /*@RequiresPermissions(value={"project:constructionContract:add","project:constructionContract:edit"})*/
 | 
	
		
			
				|  |  |      @RequestMapping(value = "save")
 | 
	
		
			
				|  |  |      public String save(ConstructionContract constructionContract, Model model, RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  | +        //String转double处理
 | 
	
		
			
				|  |  |          constructionContract.setTrueAmt(shiftDouble(constructionContract.getTrueAmtStr()));
 | 
	
		
			
				|  |  | +        //String转double处理
 | 
	
		
			
				|  |  |          constructionContract.setPayAmt(shiftDouble(constructionContract.getPayAmtStr()));
 | 
	
		
			
				|  |  | +        //String转double处理
 | 
	
		
			
				|  |  |          constructionContract.setTitularAmt(shiftDouble(constructionContract.getTitularAmtStr()));
 | 
	
		
			
				|  |  | +        //String转double处理
 | 
	
		
			
				|  |  |          constructionContract.setStopAmt(shiftDouble(constructionContract.getStopAmtStr()));
 | 
	
		
			
				|  |  | +        //新增操作
 | 
	
		
			
				|  |  |          contractService.insertContract(constructionContract);
 | 
	
		
			
				|  |  |          return "redirect:" + Global.getAdminPath() + "/project/constructionContract/?repage";
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * String转double处理
 | 
	
		
			
				|  |  | +     * @param moneyStr
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  |      private static Double shiftDouble(String moneyStr) {
 | 
	
		
			
				|  |  |          if (StringUtils.isNotBlank(moneyStr)) {
 | 
	
		
			
				|  |  |              moneyStr = moneyStr.replaceAll(",", "");
 | 
	
	
		
			
				|  | @@ -342,6 +366,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      public Map<String, Object> delete(ConstructionContract constructionContract, RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  |          Map<String, Object> j = new HashMap<>();
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | +            //删除操作
 | 
	
		
			
				|  |  |              contractService.delete(constructionContract);
 | 
	
		
			
				|  |  |              j.put("status", true);
 | 
	
		
			
				|  |  |              j.put("msg", "删除成功");
 | 
	
	
		
			
				|  | @@ -364,6 +389,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  |              model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        //获取审核通过项目信息
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  |          List<ProjectImplementEarly> list = page.getList();
 | 
	
	
		
			
				|  | @@ -378,7 +404,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      @RequestMapping(value = "getProjectFollowList")
 | 
	
		
			
				|  |  |      @ResponseBody
 | 
	
		
			
				|  |  |      public Map<String, List> getProjectFollowList(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, ProjectImplementEarly projectRecords) {
 | 
	
		
			
				|  |  | -        //查询所有项目信息
 | 
	
		
			
				|  |  | +        //查询审核通过的所有项目信息
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  |          List<ProjectImplementEarly> list = page.getList();
 | 
	
	
		
			
				|  | @@ -480,9 +506,20 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          return map;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 跳转新增页
 | 
	
		
			
				|  |  | +     * @param projectFollowReport
 | 
	
		
			
				|  |  | +     * @param request
 | 
	
		
			
				|  |  | +     * @param response
 | 
	
		
			
				|  |  | +     * @param model
 | 
	
		
			
				|  |  | +     * @param attr
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "followForm")
 | 
	
		
			
				|  |  |      public String followForm(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
 | 
	
		
			
				|  |  | +        //获取id
 | 
	
		
			
				|  |  |          String id = projectFollowReport.getId();
 | 
	
		
			
				|  |  | +        //获取项目信息
 | 
	
		
			
				|  |  |          ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
 | 
	
		
			
				|  |  |          if (null != id && !"".equals(id)) {
 | 
	
		
			
				|  |  |              //通过id获取跟踪咨询报告信息
 | 
	
	
		
			
				|  | @@ -518,21 +555,39 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          return "modules/projectrecord/workContentFromAndView/workFollowForm";
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 新增操作
 | 
	
		
			
				|  |  | +     * @param projectFollowReport
 | 
	
		
			
				|  |  | +     * @param model
 | 
	
		
			
				|  |  | +     * @param redirectAttributes
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     * @throws Exception
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "saveFollow")
 | 
	
		
			
				|  |  |      public String saveFollow(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) throws Exception {
 | 
	
		
			
				|  |  | +        //查询项目信息
 | 
	
		
			
				|  |  |          ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
 | 
	
		
			
				|  |  | +        //将项目信息放入跟踪咨询报告中
 | 
	
		
			
				|  |  |          projectFollowReport.setProject(records);
 | 
	
		
			
				|  |  | +        //判断咨询报告id是否为空
 | 
	
		
			
				|  |  |          if (null != projectFollowReport.getId() && !"".equals(projectFollowReport.getId())) {
 | 
	
		
			
				|  |  | +            //修改
 | 
	
		
			
				|  |  | +            //获取跟踪咨询报告信息
 | 
	
		
			
				|  |  |              ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +            //添加流程id
 | 
	
		
			
				|  |  |              projectFollowReport.setProcessInstanceId(followReport.getProcessInstanceId());
 | 
	
		
			
				|  |  | +            //添加创建人等信息
 | 
	
		
			
				|  |  |              projectFollowReport.setCreateBy(followReport.getCreateBy());
 | 
	
		
			
				|  |  |              projectFollowReport.setCreateDate(followReport.getCreateDate());
 | 
	
		
			
				|  |  |              projectFollowReport.setUpdateBy(followReport.getUpdateBy());
 | 
	
		
			
				|  |  |              projectFollowReport.setUpdateDate(followReport.getUpdateDate());
 | 
	
		
			
				|  |  |              projectFollowReport.setStatus(followReport.getStatus());
 | 
	
		
			
				|  |  | +            //添加项目信息
 | 
	
		
			
				|  |  |              projectFollowReport.setProject(records);
 | 
	
		
			
				|  |  | +            //进行修改操作
 | 
	
		
			
				|  |  |              projectImplementEarlyService.updateFollow(projectFollowReport);
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  | +            //进行新增操作
 | 
	
		
			
				|  |  |              projectImplementEarlyService.insertFollow(projectFollowReport);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
 | 
	
	
		
			
				|  | @@ -547,7 +602,9 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      @RequestMapping("saveAudit")
 | 
	
		
			
				|  |  |      public String saveAudit(ProjectFollowReport projectFollowReport, Model model,
 | 
	
		
			
				|  |  |                              RedirectAttributes redirectAttributes) throws Exception {
 | 
	
		
			
				|  |  | +        //获取项目信息
 | 
	
		
			
				|  |  |          ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProject().getId());
 | 
	
		
			
				|  |  | +        //获取跟踪咨询报告信息
 | 
	
		
			
				|  |  |          ProjectFollowReport followReport = projectImplementEarlyService.getFollow(projectFollowReport);
 | 
	
		
			
				|  |  |          projectFollowReport.setProcessInstanceId(followReport.getProcessInstanceId());
 | 
	
		
			
				|  |  |          projectFollowReport.setCreateBy(followReport.getCreateBy());
 | 
	
	
		
			
				|  | @@ -568,6 +625,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |              if ("yes".equals(flag) && (users==null || users.size()==0)){
 | 
	
		
			
				|  |  |                  addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
 | 
	
		
			
				|  |  |              }else {
 | 
	
		
			
				|  |  | +                //进行审核操作
 | 
	
		
			
				|  |  |                  String str = projectImplementEarlyService.auditSave(projectFollowReport,users);
 | 
	
		
			
				|  |  |                  addMessage(redirectAttributes, str);
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -587,11 +645,16 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "modify")
 | 
	
		
			
				|  |  |      public String modify(ProjectFollowReport projectFollowReport, Model model,RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  | +        //获取跟踪咨询报告信息
 | 
	
		
			
				|  |  |          projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +        //获取项目信息
 | 
	
		
			
				|  |  |          ProjectRecords records = projectRecordsService.getQueryProjectUsers(projectFollowReport.getProjectId());
 | 
	
		
			
				|  |  | +        //项目信息添加到跟踪咨询报告信息中
 | 
	
		
			
				|  |  |          projectFollowReport.setProject(records);
 | 
	
		
			
				|  |  | +        //查询工作流信息
 | 
	
		
			
				|  |  |          ProcessInstance processInstance = actTaskService.getProcIns(projectFollowReport.getProcessInstanceId());
 | 
	
		
			
				|  |  |          if (processInstance!=null) {
 | 
	
		
			
				|  |  | +            //获取当前节点信息
 | 
	
		
			
				|  |  |              Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
 | 
	
		
			
				|  |  |              Act act = new Act();
 | 
	
		
			
				|  |  |              act.setTaskId(taskInfok.getId());
 | 
	
	
		
			
				|  | @@ -608,7 +671,13 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 获取跟踪咨询报告信息
 | 
	
		
			
				|  |  | +     * @param projectFollowReport
 | 
	
		
			
				|  |  | +     * @param model
 | 
	
		
			
				|  |  | +     * @param request
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "getProcess")
 | 
	
		
			
				|  |  |      public String getProcess(ProjectFollowReport projectFollowReport, Model model,HttpServletRequest request){
 | 
	
		
			
				|  |  |          projectFollowReport = projectImplementEarlyService.getFollow(projectFollowReport);
 | 
	
	
		
			
				|  | @@ -616,17 +685,25 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          return "modules/projectrecord/projectRecordsTask";
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 撤回操作
 | 
	
		
			
				|  |  | +     * @param request
 | 
	
		
			
				|  |  | +     * @param redirectAttributes
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     * @throws Exception
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "revoke")
 | 
	
		
			
				|  |  |      public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) throws Exception {
 | 
	
		
			
				|  |  |          HashMap<String, String> requestMap = findRequestMap(request);
 | 
	
		
			
				|  |  | -        String processInstanceId = requestMap.get("processInstanceId");
 | 
	
		
			
				|  |  |          String id = requestMap.get("id");
 | 
	
		
			
				|  |  |          /*try {*/
 | 
	
		
			
				|  |  | +            //获取跟踪咨询报告信息
 | 
	
		
			
				|  |  |              ProjectFollowReport projectFollowReport = projectImplementEarlyService.getFollowById(id);
 | 
	
		
			
				|  |  |              if(5==projectFollowReport.getStatus()){
 | 
	
		
			
				|  |  |                  addMessage(redirectAttributes, "跟踪咨询报告已审批通过,无法撤回");
 | 
	
		
			
				|  |  |                  return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | +            //撤回操作
 | 
	
		
			
				|  |  |              projectImplementEarlyService.cancelProcess(projectFollowReport);
 | 
	
		
			
				|  |  |              addMessage(redirectAttributes, "撤回跟踪咨询报告成功");
 | 
	
		
			
				|  |  |          /*}catch (Exception e){
 | 
	
	
		
			
				|  | @@ -645,6 +722,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      public Map<String, Object> deleteFollow(ProjectFollowReport projectFollowReport, RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  |          Map<String, Object> j = new HashMap<>();
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | +            //删除操作
 | 
	
		
			
				|  |  |              projectImplementEarlyService.deleteFollow(projectFollowReport);
 | 
	
		
			
				|  |  |              j.put("status", true);
 | 
	
		
			
				|  |  |              j.put("msg", "删除成功");
 |