|  | @@ -17,6 +17,7 @@ import com.jeeplus.common.web.BaseController;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.act.entity.Act;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.act.service.ActTaskService;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.act.utils.ActUtils;
 | 
	
		
			
				|  |  | +import com.jeeplus.modules.project.entity.Project;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectConstruction.service.ContractService;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectType.entity.ProjectTemplateType;
 | 
	
	
		
			
				|  | @@ -27,10 +28,7 @@ import com.jeeplus.modules.projectcontentinfo.entity.*;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectcontentinfo.service.*;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
 | 
	
		
			
				|  |  | -import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
 | 
	
		
			
				|  |  | -import com.jeeplus.modules.projectrecord.entity.ProjectPaymentTreeData;
 | 
	
		
			
				|  |  | -import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
 | 
	
		
			
				|  |  | -import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
 | 
	
		
			
				|  |  | +import com.jeeplus.modules.projectrecord.entity.*;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 | 
	
	
		
			
				|  | @@ -79,7 +77,6 @@ import java.util.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 施工合同管理Controller
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  @Controller
 | 
	
		
			
				|  |  |  @RequestMapping(value = "${adminPath}/project/constructionContract")
 | 
	
	
		
			
				|  | @@ -96,6 +93,8 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      private ProjectContentDataService projectContentDataService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private ProjectcontentinfoService projectcontentinfoService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private ProjectControlTableService projectControlTableService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /*@ModelAttribute
 | 
	
		
			
				|  |  |      public ConstructionContract get(@RequestParam(required=false) String id) {
 | 
	
	
		
			
				|  | @@ -131,8 +130,8 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
 | 
	
		
			
				|  |  |          model.addAttribute("page", page);*/
 | 
	
		
			
				|  |  | -        if(UserUtils.isManager()){
 | 
	
		
			
				|  |  | -            model.addAttribute("flag","1");
 | 
	
		
			
				|  |  | +        if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  | +            model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
	
		
			
				|  | @@ -146,15 +145,15 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "getProjectList")
 | 
	
		
			
				|  |  |      @ResponseBody
 | 
	
		
			
				|  |  | -    public Map<String,List> getProjectList(ProjectImplementEarly projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
 | 
	
		
			
				|  |  | -        if(UserUtils.isManager()){
 | 
	
		
			
				|  |  | -            model.addAttribute("flag","1");
 | 
	
		
			
				|  |  | +    public Map<String, List> getProjectList(ProjectImplementEarly projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
 | 
	
		
			
				|  |  | +        if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  | +            model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  |          //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  |          List<ProjectImplementEarly> list = page.getList();
 | 
	
		
			
				|  |  |          List<ProjectRecordTreeData> projectRecordTreeDataList = new ArrayList<>();
 | 
	
		
			
				|  |  | -        Map<String,List> map = new HashMap<>();
 | 
	
		
			
				|  |  | +        Map<String, List> map = new HashMap<>();
 | 
	
		
			
				|  |  |          for (int i = 0; i < list.size(); i++) {
 | 
	
		
			
				|  |  |              ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
 | 
	
		
			
				|  |  |              ProjectImplementEarly records1 = list.get(i);
 | 
	
	
		
			
				|  | @@ -171,10 +170,10 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |              projectRecordTreeData.setProjectName(records1.getProjectName());
 | 
	
		
			
				|  |  |              projectRecordTreeData.setProjectId(records1.getProjectId());
 | 
	
		
			
				|  |  |              projectRecordTreeData.setProjectContentId(records1.getProjectContentId());
 | 
	
		
			
				|  |  | -            if(null!= records1.getWorkContractInfo()){
 | 
	
		
			
				|  |  | +            if (null != records1.getWorkContractInfo()) {
 | 
	
		
			
				|  |  |                  projectRecordTreeData.setContractName(records1.getWorkContractInfo().getName());
 | 
	
		
			
				|  |  |                  projectRecordTreeData.setClientName(records1.getWorkContractInfo().getClient().getName());
 | 
	
		
			
				|  |  | -            }else{
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  |                  projectRecordTreeData.setContractName("");
 | 
	
		
			
				|  |  |                  projectRecordTreeData.setClientName("");
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -188,7 +187,7 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |              List<User> masterUserList = records1.getProjectLeaders();
 | 
	
		
			
				|  |  |              List<String> masterList = new ArrayList<>();
 | 
	
		
			
				|  |  |              Set masterIdSet = new HashSet();
 | 
	
		
			
				|  |  | -            for (User masterUser:masterUserList) {
 | 
	
		
			
				|  |  | +            for (User masterUser : masterUserList) {
 | 
	
		
			
				|  |  |                  masterList.add(masterUser.getName());
 | 
	
		
			
				|  |  |                  masterIdSet.add(masterUser.getId());
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -197,10 +196,10 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |              List<String> masterIdList = new ArrayList<>(masterIdSet);
 | 
	
		
			
				|  |  |              //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
 | 
	
		
			
				|  |  |              for (String masterId : masterIdList) {
 | 
	
		
			
				|  |  | -                if(masterId.equals(UserUtils.getUser().getId())){
 | 
	
		
			
				|  |  | +                if (masterId.equals(UserUtils.getUser().getId())) {
 | 
	
		
			
				|  |  |                      projectRecordTreeData.setOperationSign(1);
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  | -                }else{
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  |                      projectRecordTreeData.setOperationSign(0);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -213,12 +212,11 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              //根据项目id查询合同的集合
 | 
	
		
			
				|  |  |              List<ConstructionContract> contractList = contractService.find(records1.getId());
 | 
	
		
			
				|  |  | -            if(0 != contractList.size()){
 | 
	
		
			
				|  |  | -                for(int j=0;j<contractList.size();j++){
 | 
	
		
			
				|  |  | -                    ProjectRecordTreeData treeNew=new ProjectRecordTreeData();
 | 
	
		
			
				|  |  | -                    ConstructionContract contract=contractList.get(j);
 | 
	
		
			
				|  |  | +            if (0 != contractList.size()) {
 | 
	
		
			
				|  |  | +                for (int j = 0; j < contractList.size(); j++) {
 | 
	
		
			
				|  |  | +                    ProjectRecordTreeData treeNew = new ProjectRecordTreeData();
 | 
	
		
			
				|  |  | +                    ConstructionContract contract = contractList.get(j);
 | 
	
		
			
				|  |  |                      treeNew.setId(contract.getId()); //合同Id
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                      treeNew.setPid(records1.getId());//子类父id也就是项目Id
 | 
	
		
			
				|  |  |                      treeNew.setProjectId(contract.getCnumber());
 | 
	
		
			
				|  |  |                      treeNew.setProjectName(contract.getContractName());
 | 
	
	
		
			
				|  | @@ -229,10 +227,10 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |                      treeNew.setCreateDate(contract.getCreateDate());
 | 
	
		
			
				|  |  |                      //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
 | 
	
		
			
				|  |  |                      for (String masterId : masterIdList) {
 | 
	
		
			
				|  |  | -                        if(masterId.equals(UserUtils.getUser().getId())){
 | 
	
		
			
				|  |  | +                        if (masterId.equals(UserUtils.getUser().getId())) {
 | 
	
		
			
				|  |  |                              treeNew.setOperationSign(1);
 | 
	
		
			
				|  |  |                              break;
 | 
	
		
			
				|  |  | -                        }else{
 | 
	
		
			
				|  |  | +                        } else {
 | 
	
		
			
				|  |  |                              treeNew.setOperationSign(0);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -241,18 +239,17 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        map.put("data",projectRecordTreeDataList);
 | 
	
		
			
				|  |  | +        map.put("data", projectRecordTreeDataList);
 | 
	
		
			
				|  |  |          return map;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 跳转添加合同页面
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "form")
 | 
	
		
			
				|  |  |      public String form(ConstructionContract constructionContract, Model model) {
 | 
	
		
			
				|  |  | -        if (constructionContract!=null&&StringUtils.isNotBlank(constructionContract.getId())) {
 | 
	
		
			
				|  |  | +        if (constructionContract != null && StringUtils.isNotBlank(constructionContract.getId())) {
 | 
	
		
			
				|  |  |              constructionContract = contractService.get(constructionContract.getId());
 | 
	
		
			
				|  |  |              ProjectRecords projectRecords = projectRecordsService.get(constructionContract.getProjectId());
 | 
	
		
			
				|  |  |              constructionContract.setProjectName(projectRecords.getProjectName());
 | 
	
	
		
			
				|  | @@ -261,8 +258,8 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |              attchment.setAttachmentId(constructionContract.getId());
 | 
	
		
			
				|  |  |              List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 | 
	
		
			
				|  |  |              constructionContract.setWorkAttachments(attachments);
 | 
	
		
			
				|  |  | -        }else {
 | 
	
		
			
				|  |  | -            ProjectRecords records =contractService.getRecords(constructionContract.getProjectId());
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            ProjectRecords records = contractService.getRecords(constructionContract.getProjectId());
 | 
	
		
			
				|  |  |              constructionContract.setCreateBy(UserUtils.getUser());
 | 
	
		
			
				|  |  |              constructionContract.setCreateDate(new Date());
 | 
	
		
			
				|  |  |              constructionContract.setProjectName(records.getProjectName());
 | 
	
	
		
			
				|  | @@ -272,9 +269,9 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 查看
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  |       * @param
 | 
	
		
			
				|  |  |       * @param model
 | 
	
		
			
				|  |  |       * @return
 | 
	
	
		
			
				|  | @@ -305,12 +302,12 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |          constructionContract.setTitularAmt(shiftDouble(constructionContract.getTitularAmtStr()));
 | 
	
		
			
				|  |  |          constructionContract.setStopAmt(shiftDouble(constructionContract.getStopAmtStr()));
 | 
	
		
			
				|  |  |          contractService.insertContract(constructionContract);
 | 
	
		
			
				|  |  | -        return "redirect:"+Global.getAdminPath()+"/project/constructionContract/?repage";
 | 
	
		
			
				|  |  | +        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/?repage";
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    private static Double shiftDouble(String moneyStr){
 | 
	
		
			
				|  |  | -        if(StringUtils.isNotBlank(moneyStr)){
 | 
	
		
			
				|  |  | -            moneyStr = moneyStr.replaceAll(",","");
 | 
	
		
			
				|  |  | +    private static Double shiftDouble(String moneyStr) {
 | 
	
		
			
				|  |  | +        if (StringUtils.isNotBlank(moneyStr)) {
 | 
	
		
			
				|  |  | +            moneyStr = moneyStr.replaceAll(",", "");
 | 
	
		
			
				|  |  |              Double money = Double.parseDouble(moneyStr);
 | 
	
		
			
				|  |  |              return money;
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -318,12 +315,12 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @RequestMapping("selectcontent")
 | 
	
		
			
				|  |  | -    public String gridSelect(ProjectImplementEarly projectRecords, String searchLabel ,HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
 | 
	
		
			
				|  |  | +    public String gridSelect(ProjectImplementEarly projectRecords, String searchLabel, HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
 | 
	
		
			
				|  |  |          model.addAttribute("obj", projectRecords);
 | 
	
		
			
				|  |  |          Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  | -        model.addAttribute("page",page);
 | 
	
		
			
				|  |  | +        model.addAttribute("page", page);
 | 
	
		
			
				|  |  |          searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
 | 
	
		
			
				|  |  | -        model.addAttribute("searchLabel",searchLabel);
 | 
	
		
			
				|  |  | +        model.addAttribute("searchLabel", searchLabel);
 | 
	
		
			
				|  |  |          return "modules/sys/gridselectProjectList";
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -343,19 +340,197 @@ public class ContractController extends BaseController {
 | 
	
		
			
				|  |  |       */
 | 
	
		
			
				|  |  |      @RequestMapping(value = "delete")
 | 
	
		
			
				|  |  |      @ResponseBody
 | 
	
		
			
				|  |  | -    public Map<String,Object> delete(ConstructionContract constructionContract, RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  | -        Map<String,Object> j= new HashMap<>();
 | 
	
		
			
				|  |  | +    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","删除成功");
 | 
	
		
			
				|  |  | +            j.put("status", true);
 | 
	
		
			
				|  |  | +            j.put("msg", "删除成功");
 | 
	
		
			
				|  |  |              addMessage(redirectAttributes, "删除成功");
 | 
	
		
			
				|  |  | -        }catch (Exception e){
 | 
	
		
			
				|  |  | -            j.put("status",false);
 | 
	
		
			
				|  |  | -            j.put("msg","删除失败");
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            j.put("status", false);
 | 
	
		
			
				|  |  | +            j.put("msg", "删除失败");
 | 
	
		
			
				|  |  |              addMessage(redirectAttributes, "删除失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return j;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 跟踪咨询报告页面
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @RequiresPermissions("project:constructionContract:list")
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "projectFollow")
 | 
	
		
			
				|  |  | +    public String projectFollowList(HttpServletRequest request, HttpServletResponse response, Model model, ProjectImplementEarly projectRecords) {
 | 
	
		
			
				|  |  | +        if (UserUtils.isManager()) {
 | 
	
		
			
				|  |  | +            model.addAttribute("flag", "1");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
 | 
	
		
			
				|  |  | +        //无合同状态下,获取委托方的名称
 | 
	
		
			
				|  |  | +        List<ProjectImplementEarly> list = page.getList();
 | 
	
		
			
				|  |  | +        model.addAttribute("page", page);
 | 
	
		
			
				|  |  | +        return "modules/ProjectFollowReport/ProjectFollowReportList";
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 跟踪咨询报告页面数据列表
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @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();
 | 
	
		
			
				|  |  | +        List<ProjectRecordTreeData> projectRecordTreeDataList = new ArrayList<>();
 | 
	
		
			
				|  |  | +        Map<String, List> map = new HashMap<>();
 | 
	
		
			
				|  |  | +        for (int i = 0; i < list.size(); i++) {
 | 
	
		
			
				|  |  | +            //树形结构返回
 | 
	
		
			
				|  |  | +            ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
 | 
	
		
			
				|  |  | +            ProjectImplementEarly records1 = list.get(i);
 | 
	
		
			
				|  |  | +            if (records1.getWorkContractInfo() == null) {
 | 
	
		
			
				|  |  | +                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);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //将界面需要展示数据放入类中
 | 
	
		
			
				|  |  | +            //获取项目id
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setId(records1.getId());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectName(records1.getProjectName());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectId(records1.getProjectId());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectContentId(records1.getProjectContentId());
 | 
	
		
			
				|  |  | +            if (null != records1.getWorkContractInfo()) {
 | 
	
		
			
				|  |  | +                projectRecordTreeData.setContractName(records1.getWorkContractInfo().getName());
 | 
	
		
			
				|  |  | +                projectRecordTreeData.setClientName(records1.getWorkContractInfo().getClient().getName());
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                projectRecordTreeData.setContractName("");
 | 
	
		
			
				|  |  | +                projectRecordTreeData.setClientName("");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectStatus(records1.getProjectStatus());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectRegistrant(records1.getProjectRegistrant());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setCreateDate(records1.getCreateDate());
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setCreateId(records1.getCreateBy().getId());
 | 
	
		
			
				|  |  | +            //父节点的pid设置为0
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setPid("0");
 | 
	
		
			
				|  |  | +            //遍历项目负责人信息
 | 
	
		
			
				|  |  | +            List<User> masterUserList = records1.getProjectLeaders();
 | 
	
		
			
				|  |  | +            List<String> masterList = new ArrayList<>();
 | 
	
		
			
				|  |  | +            Set masterIdSet = new HashSet();
 | 
	
		
			
				|  |  | +            for (User masterUser : masterUserList) {
 | 
	
		
			
				|  |  | +                masterList.add(masterUser.getName());
 | 
	
		
			
				|  |  | +                masterIdSet.add(masterUser.getId());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //masterIdSet.add(records1.getCreateBy().getId());
 | 
	
		
			
				|  |  | +            //Set转List
 | 
	
		
			
				|  |  | +            List<String> masterIdList = new ArrayList<>(masterIdSet);
 | 
	
		
			
				|  |  | +            //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
 | 
	
		
			
				|  |  | +            for (String masterId : masterIdList) {
 | 
	
		
			
				|  |  | +                if (masterId.equals(UserUtils.getUser().getId())) {
 | 
	
		
			
				|  |  | +                    projectRecordTreeData.setOperationSign(1);
 | 
	
		
			
				|  |  | +                    break;
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    projectRecordTreeData.setOperationSign(0);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //项目负责人list数据转String
 | 
	
		
			
				|  |  | +            String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setProjectLeader(projectLeader);
 | 
	
		
			
				|  |  | +            projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
 | 
	
		
			
				|  |  | +            projectRecordTreeDataList.add(projectRecordTreeData);
 | 
	
		
			
				|  |  | +            //获取子集数据
 | 
	
		
			
				|  |  | +            String id = records1.getId();
 | 
	
		
			
				|  |  | +            if (null != id && !"".equals(id)) {
 | 
	
		
			
				|  |  | +                List<ProjectFollowReport> contractList = projectImplementEarlyService.find(id);
 | 
	
		
			
				|  |  | +                if (contractList.size() > 0) {
 | 
	
		
			
				|  |  | +                    for (int j = 0; j < contractList.size(); j++) {
 | 
	
		
			
				|  |  | +                        ProjectRecordTreeData treeNew = new ProjectRecordTreeData();
 | 
	
		
			
				|  |  | +                        ProjectFollowReport report = contractList.get(j);
 | 
	
		
			
				|  |  | +                        treeNew.setId(report.getId());
 | 
	
		
			
				|  |  | +                        treeNew.setPid(report.getProject().getId());
 | 
	
		
			
				|  |  | +                        treeNew.setProjectId(report.getProjectFollowId());
 | 
	
		
			
				|  |  | +                        treeNew.setProjectName(report.getProjectFollowName());
 | 
	
		
			
				|  |  | +                        treeNew.setCreateDate(report.getCreateDate());
 | 
	
		
			
				|  |  | +                        treeNew.setProjectLeader(projectLeader);
 | 
	
		
			
				|  |  | +                        User user = UserUtils.get(report.getCreateBy().getId());
 | 
	
		
			
				|  |  | +                        treeNew.setProjectRegistrant(user.getName());
 | 
	
		
			
				|  |  | +                        treeNew.setOperationSign(1);
 | 
	
		
			
				|  |  | +                        projectRecordTreeDataList.add(treeNew);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        map.put("data", projectRecordTreeDataList);
 | 
	
		
			
				|  |  | +        return map;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "followForm")
 | 
	
		
			
				|  |  | +    public String followForm(ProjectFollowReport projectFollowReport, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
 | 
	
		
			
				|  |  | +        String id = projectFollowReport.getId();
 | 
	
		
			
				|  |  | +        if (null != id && !"".equals(id)) {
 | 
	
		
			
				|  |  | +            //通过id获取跟踪咨询报告信息
 | 
	
		
			
				|  |  | +            ProjectFollowReport follow = projectImplementEarlyService.getFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +            //判断是否有project.Id值
 | 
	
		
			
				|  |  | +            //有project.Id需要查询
 | 
	
		
			
				|  |  | +            if (null == follow.getProject()) {
 | 
	
		
			
				|  |  | +                ProjectRecords project = new ProjectRecords();
 | 
	
		
			
				|  |  | +                follow.setProject(project);
 | 
	
		
			
				|  |  | +                follow.getProject().setId(projectFollowReport.getProject().getId());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            /**获取项目的附件信息*/
 | 
	
		
			
				|  |  | +            WorkClientAttachment attchment = new WorkClientAttachment();
 | 
	
		
			
				|  |  | +            attchment.setAttachmentId(projectFollowReport.getId());
 | 
	
		
			
				|  |  | +            List<WorkClientAttachment> attachments = workClientAttachmentDao.findList(attchment);
 | 
	
		
			
				|  |  | +            follow.setWorkAttachments(attachments);
 | 
	
		
			
				|  |  | +            model.addAttribute("projectFollowReport", follow);
 | 
	
		
			
				|  |  | +            return "modules/projectrecord/workContentFromAndView/workFollowForm";
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //查询是否含有上传或者引用的依据性文件信息
 | 
	
		
			
				|  |  | +        if(com.jeeplus.common.utils.StringUtils.isNotBlank(id)){
 | 
	
		
			
				|  |  | +            List<ProjectControlTable> controlData = projectControlTableService.getControlData(id,"");
 | 
	
		
			
				|  |  | +//            projectFollowReport.setProjectControlTableList(controlData);
 | 
	
		
			
				|  |  | +//            projectContentDataService.queryBasedData(projectFollowReport);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        model.addAttribute("projectFollowReport", projectFollowReport);
 | 
	
		
			
				|  |  | +        model.addAttribute("flag", "complement");
 | 
	
		
			
				|  |  | +        return "modules/projectrecord/workContentFromAndView/workFollowForm";
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "saveFollow")
 | 
	
		
			
				|  |  | +    public String saveFollow(ProjectFollowReport projectFollowReport, Model model, RedirectAttributes redirectAttributes) {
 | 
	
		
			
				|  |  | +//        projectImplementEarlyService.insertFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +        if (null != projectFollowReport.getId() && !"".equals(projectFollowReport.getId())) {
 | 
	
		
			
				|  |  | +            projectImplementEarlyService.updateFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            projectImplementEarlyService.insertFollow(projectFollowReport);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return "redirect:" + Global.getAdminPath() + "/project/constructionContract/projectFollow";
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 删除依据性资料
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +    @RequestMapping(value = "deleteFollow")
 | 
	
		
			
				|  |  | +    @ResponseBody
 | 
	
		
			
				|  |  | +    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", "删除成功");
 | 
	
		
			
				|  |  | +            addMessage(redirectAttributes, "删除成功");
 | 
	
		
			
				|  |  | +        } catch (Exception e) {
 | 
	
		
			
				|  |  | +            j.put("status", false);
 | 
	
		
			
				|  |  | +            j.put("msg", "删除失败");
 | 
	
		
			
				|  |  | +            addMessage(redirectAttributes, "删除失败");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return j;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |