|
@@ -17,6 +17,8 @@ import com.jeeplus.common.web.BaseController;
|
|
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.ActUtils;
|
|
import com.jeeplus.modules.act.utils.ActUtils;
|
|
|
|
+import com.jeeplus.modules.projectConstruction.entity.ConstructionContract;
|
|
|
|
+import com.jeeplus.modules.projectConstruction.service.ContractService;
|
|
import com.jeeplus.modules.projectType.entity.ProjectTemplateType;
|
|
import com.jeeplus.modules.projectType.entity.ProjectTemplateType;
|
|
import com.jeeplus.modules.projectType.service.ProjectResultsFileTemplateService;
|
|
import com.jeeplus.modules.projectType.service.ProjectResultsFileTemplateService;
|
|
import com.jeeplus.modules.projectType.service.ProjectTypeService;
|
|
import com.jeeplus.modules.projectType.service.ProjectTypeService;
|
|
@@ -24,9 +26,11 @@ import com.jeeplus.modules.projectcontentinfo.entity.*;
|
|
import com.jeeplus.modules.projectcontentinfo.service.*;
|
|
import com.jeeplus.modules.projectcontentinfo.service.*;
|
|
import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
|
|
import com.jeeplus.modules.projectcontroltable.entity.ProjectControlTable;
|
|
import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
|
|
import com.jeeplus.modules.projectcontroltable.service.ProjectControlTableService;
|
|
|
|
+import com.jeeplus.modules.projectrecord.entity.ProjectImplementEarly;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecordTreeData;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
|
|
import com.jeeplus.modules.projectrecord.enums.ProjectStatusEnum;
|
|
|
|
+import com.jeeplus.modules.projectrecord.service.ProjectImplementEarlyService;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
|
|
import com.jeeplus.modules.projectrecord.service.early.ProjectEarlyReviewService;
|
|
import com.jeeplus.modules.projectrecord.service.early.ProjectEarlyReviewService;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
@@ -93,6 +97,12 @@ public class ContractController extends BaseController {
|
|
private ProjectReportDataService projectReportDataService;
|
|
private ProjectReportDataService projectReportDataService;
|
|
@Autowired
|
|
@Autowired
|
|
private ProjectcontentinfoService projectcontentinfoService;
|
|
private ProjectcontentinfoService projectcontentinfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ContractService contractService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProjectContentDataService projectContentDataService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ProjectImplementEarlyService projectImplementEarlyService;
|
|
|
|
|
|
private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
|
|
private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
|
|
private static String template_name = "咨询工作方案.xlsx";
|
|
private static String template_name = "咨询工作方案.xlsx";
|
|
@@ -113,49 +123,84 @@ public class ContractController extends BaseController {
|
|
* 项目列表页面
|
|
* 项目列表页面
|
|
*/
|
|
*/
|
|
@RequiresPermissions("project:constructionContract:list")
|
|
@RequiresPermissions("project:constructionContract:list")
|
|
- @RequestMapping(value = {"list", ""})
|
|
|
|
- public String list(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
|
|
+ /* @RequestMapping(value = {"list", ""})
|
|
|
|
+ public String list(ConstructionContract constructionContract, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+
|
|
|
|
+
|
|
if(UserUtils.isManager()){
|
|
if(UserUtils.isManager()){
|
|
model.addAttribute("flag","1");
|
|
model.addAttribute("flag","1");
|
|
}
|
|
}
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ Page<ConstructionContract> page = contractService.findPage(new Page<ConstructionContract>(request, response), constructionContract);
|
|
|
|
+ model.addAttribute("page", page);
|
|
|
|
+ return "modules/projectConstruction/projectConstructionList";
|
|
|
|
+ }*/
|
|
|
|
+ @RequestMapping(value = {"list", ""})
|
|
|
|
+ public String list(WorkClientInfo workClientInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ WorkClientLinkman workClientLinkman = workClientInfo.getWorkClientLinkman();
|
|
|
|
+ if(workClientLinkman != null){
|
|
|
|
+ workClientLinkman.setId("");
|
|
|
|
+ }
|
|
|
|
+ workClientInfo.setWorkClientLinkman(workClientLinkman);
|
|
|
|
+ if(UserUtils.isManager()){
|
|
|
|
+ model.addAttribute("flag","1");
|
|
}
|
|
}
|
|
|
|
+ Page<WorkClientInfo> page = workClientInfoService.findPage(new Page<WorkClientInfo>(request, response), workClientInfo);
|
|
model.addAttribute("page", page);
|
|
model.addAttribute("page", page);
|
|
return "modules/projectConstruction/projectConstructionList";
|
|
return "modules/projectConstruction/projectConstructionList";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * 项目列表页面
|
|
|
|
|
|
+ * 跳转添加合同页面
|
|
*/
|
|
*/
|
|
- @RequestMapping(value = "getProjectList")
|
|
|
|
- @ResponseBody
|
|
|
|
- public Map<String,List> getProjectList(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
|
|
+ @RequestMapping(value = "form")
|
|
|
|
+ public String form(ProjectRecords projectRecords, Model model) {
|
|
|
|
+ ConstructionContract constructionContract = new ConstructionContract();
|
|
|
|
+ model.addAttribute("constructionContract", constructionContract);
|
|
|
|
+ /*if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
|
|
|
|
+ projectRecords = projectRecordsService.get(projectRecords.getId());
|
|
|
|
+ projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
|
+ }else {
|
|
|
|
+ projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
|
+ projectRecords.setCreateDate(new Date());
|
|
|
|
+ }
|
|
|
|
+ model.addAttribute("projectRecords", projectRecords);*/
|
|
|
|
+ return "modules/projectConstruction/projectConstructionForm";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加合同数据
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping(value = "save")
|
|
|
|
+ public String save(ConstructionContract constructionContract, Model model) {
|
|
|
|
+ int count=contractService.insertContract(constructionContract);
|
|
|
|
+ return "modules/projectConstruction/projectConstructionForm";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping("selectcontent")
|
|
|
|
+ public String gridSelect(ProjectImplementEarly projectRecords, String searchLabel ,HttpServletRequest request, HttpServletResponse response, Model model) throws UnsupportedEncodingException {
|
|
|
|
+ /*Page<ProjectContentData> page = projectContentDataService.findPage(new Page<ProjectContentData>(request, response), projectContentData);
|
|
|
|
+ model.addAttribute("obj", projectContentData);
|
|
|
|
+ model.addAttribute("page", page);
|
|
|
|
+ searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
|
|
|
|
+ model.addAttribute("searchLabel",searchLabel);*/
|
|
|
|
+
|
|
|
|
+
|
|
if(UserUtils.isManager()){
|
|
if(UserUtils.isManager()){
|
|
model.addAttribute("flag","1");
|
|
model.addAttribute("flag","1");
|
|
}
|
|
}
|
|
- Page<ProjectRecords> page = projectRecordsService.findPage(new Page<ProjectRecords>(request, response), projectRecords);
|
|
|
|
|
|
+ Page<ProjectImplementEarly> page = projectImplementEarlyService.findProjectPage(new Page<ProjectImplementEarly>(request, response), projectRecords);
|
|
//无合同状态下,获取委托方的名称
|
|
//无合同状态下,获取委托方的名称
|
|
- List<ProjectRecords> list = page.getList();
|
|
|
|
|
|
+ List<ProjectImplementEarly> list = page.getList();
|
|
List<ProjectRecordTreeData> projectRecordTreeDataList = new ArrayList<>();
|
|
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++) {
|
|
for (int i = 0; i < list.size(); i++) {
|
|
ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
|
|
ProjectRecordTreeData projectRecordTreeData = new ProjectRecordTreeData();
|
|
- ProjectRecords records1 = list.get(i);
|
|
|
|
|
|
+ ProjectImplementEarly records1 = list.get(i);
|
|
if (records1.getWorkContractInfo() == null) {
|
|
if (records1.getWorkContractInfo() == null) {
|
|
- projectRecordsService.queryLinkmanInfos(records1);
|
|
|
|
if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
|
|
if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
|
|
WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
|
|
WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
|
|
WorkContractInfo contractInfo = new WorkContractInfo();
|
|
WorkContractInfo contractInfo = new WorkContractInfo();
|
|
@@ -167,33 +212,57 @@ public class ContractController extends BaseController {
|
|
projectRecordTreeData.setId(records1.getId());
|
|
projectRecordTreeData.setId(records1.getId());
|
|
projectRecordTreeData.setProjectName(records1.getProjectName());
|
|
projectRecordTreeData.setProjectName(records1.getProjectName());
|
|
projectRecordTreeData.setProjectId(records1.getProjectId());
|
|
projectRecordTreeData.setProjectId(records1.getProjectId());
|
|
- projectRecordTreeData.setContractName(records1.getWorkContractInfo().getName());
|
|
|
|
|
|
+ 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.setProjectStatus(records1.getProjectStatus());
|
|
projectRecordTreeData.setProjectRegistrant(records1.getProjectRegistrant());
|
|
projectRecordTreeData.setProjectRegistrant(records1.getProjectRegistrant());
|
|
projectRecordTreeData.setCreateDate(records1.getCreateDate());
|
|
projectRecordTreeData.setCreateDate(records1.getCreateDate());
|
|
projectRecordTreeData.setCreateId(records1.getCreateBy().getId());
|
|
projectRecordTreeData.setCreateId(records1.getCreateBy().getId());
|
|
//父节点的pid设置为0
|
|
//父节点的pid设置为0
|
|
projectRecordTreeData.setPid("0");
|
|
projectRecordTreeData.setPid("0");
|
|
- projectRecordTreeData.setClientName(records1.getWorkContractInfo().getClient().getName());
|
|
|
|
//遍历项目负责人信息
|
|
//遍历项目负责人信息
|
|
List<User> masterUserList = records1.getProjectLeaders();
|
|
List<User> masterUserList = records1.getProjectLeaders();
|
|
List<String> masterList = new ArrayList<>();
|
|
List<String> masterList = new ArrayList<>();
|
|
|
|
+ Set masterIdSet = new HashSet();
|
|
for (User masterUser:masterUserList) {
|
|
for (User masterUser:masterUserList) {
|
|
masterList.add(masterUser.getName());
|
|
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
|
|
//项目负责人list数据转String
|
|
String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
|
|
String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
|
|
- System.out.println(projectLeader);
|
|
|
|
projectRecordTreeData.setProjectLeader(projectLeader);
|
|
projectRecordTreeData.setProjectLeader(projectLeader);
|
|
projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
|
|
projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
|
|
projectRecordTreeDataList.add(projectRecordTreeData);
|
|
projectRecordTreeDataList.add(projectRecordTreeData);
|
|
|
|
|
|
|
|
+ //获取阶段Type父节点信息
|
|
|
|
+ String projectType = projectImplementEarlyService.getProjectType(records1.getProjectTypeId(), "实施前期");
|
|
//根据项目id查询相关的项目阶段内容
|
|
//根据项目id查询相关的项目阶段内容
|
|
- List<ProjectRecordTreeData> reportDataList = projectReportDataService.getProjectRecordDataList(records1.getId());
|
|
|
|
|
|
+ List<ProjectRecordTreeData> reportDataList = projectContentDataService.getProjectContentDataList(records1.getId(),projectType);
|
|
if(0 != reportDataList.size()){
|
|
if(0 != reportDataList.size()){
|
|
Projectcontentinfo select = new Projectcontentinfo();
|
|
Projectcontentinfo select = new Projectcontentinfo();
|
|
- select.setProject(records1);
|
|
|
|
|
|
+ ProjectRecords project = new ProjectRecords();
|
|
|
|
+ project.setId(records1.getId());
|
|
select.setParentIds("0,");
|
|
select.setParentIds("0,");
|
|
|
|
+ select.setProject(project);
|
|
List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
|
|
List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
|
|
for (ProjectRecordTreeData reportData : reportDataList) {
|
|
for (ProjectRecordTreeData reportData : reportDataList) {
|
|
//添加工作内容id
|
|
//添加工作内容id
|
|
@@ -202,541 +271,141 @@ public class ContractController extends BaseController {
|
|
reportData.setParentIds("0,");
|
|
reportData.setParentIds("0,");
|
|
reportData.setDictType("");
|
|
reportData.setDictType("");
|
|
}
|
|
}
|
|
|
|
+ //将项目所属类型名称放入树形列表的projectId中
|
|
|
|
+ reportData.setProjectId(reportData.getProjectLeader());
|
|
|
|
+ //添加项目负责人
|
|
|
|
+ reportData.setProjectLeader(projectLeader);
|
|
//添加登陆者id
|
|
//添加登陆者id
|
|
reportData.setLoginId(UserUtils.getUser().getId());
|
|
reportData.setLoginId(UserUtils.getUser().getId());
|
|
reportData.setCreateId(records1.getCreateBy().getId());
|
|
reportData.setCreateId(records1.getCreateBy().getId());
|
|
|
|
+ //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
|
|
|
|
+ for (String masterId : masterIdList) {
|
|
|
|
+ if(masterId.equals(UserUtils.getUser().getId())){
|
|
|
|
+ reportData.setOperationSign(1);
|
|
|
|
+ break;
|
|
|
|
+ }else{
|
|
|
|
+ reportData.setOperationSign(0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
projectRecordTreeDataList.addAll(reportDataList);
|
|
projectRecordTreeDataList.addAll(reportDataList);
|
|
|
|
|
|
}
|
|
}
|
|
- map.put("data",projectRecordTreeDataList);
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查看,增加,编辑项目表单页面
|
|
|
|
- */
|
|
|
|
- @RequestMapping(value = "form")
|
|
|
|
- public String form(ProjectRecords projectRecords, Model model) {
|
|
|
|
- WorkContentContractinfo workContentContractinfo = new WorkContentContractinfo();
|
|
|
|
- model.addAttribute("workContentContractinfo", workContentContractinfo);
|
|
|
|
- /*if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
|
|
|
|
- projectRecords = projectRecordsService.get(projectRecords.getId());
|
|
|
|
- projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
|
- }else {
|
|
|
|
- projectRecords.setCreateBy(UserUtils.getUser());
|
|
|
|
- projectRecords.setCreateDate(new Date());
|
|
|
|
- }
|
|
|
|
- model.addAttribute("projectRecords", projectRecords);*/
|
|
|
|
- return "modules/projectConstruction/projectConstructionForm";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查看
|
|
|
|
- * @param projectRecords
|
|
|
|
- * @param model
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions(value={"project:projectRecords:view"})
|
|
|
|
- @RequestMapping(value = "view")
|
|
|
|
- public String view(ProjectRecords projectRecords, Model model) {
|
|
|
|
- if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
|
|
|
|
- projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
|
- }
|
|
|
|
- model.addAttribute("projectRecords", projectRecords);
|
|
|
|
- return "modules/projectrecord/projectRecordsView";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 保存项目
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions(value={"project:projectRecords:add","project:projectRecords:edit"},logical=Logical.OR)
|
|
|
|
- @RequestMapping(value = "save")
|
|
|
|
- public String save(ProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) {
|
|
|
|
- if (!beanValidator(model, projectRecords)){
|
|
|
|
- return form(projectRecords, model);
|
|
|
|
- }
|
|
|
|
- try {
|
|
|
|
-// projectRecords.setProjectStatus(ProjectStatusEnum.IN_APRL.getValue());
|
|
|
|
- if (!projectRecords.getIsNewRecord()) {//编辑表单保存
|
|
|
|
- ProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
|
- projectRecordsService.saveProject(t,ProjectStatusEnum.IN_APRL);//保存
|
|
|
|
- } else {//新增表单保存
|
|
|
|
- projectRecordsService.saveProject(projectRecords,ProjectStatusEnum.IN_APRL);//保存
|
|
|
|
- }
|
|
|
|
- addMessage(redirectAttributes, "保存项目成功");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- logger.error("保存项目异常:",e);
|
|
|
|
- addMessage(redirectAttributes, "保存项目异常:"+e.getMessage());
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
- * 保存项目
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions(value={"project:projectRecords:add","project:projectRecords:edit"},logical=Logical.OR)
|
|
|
|
- @RequestMapping(value = "tstore")
|
|
|
|
- public String tStore(ProjectRecords projectRecords, Model model, RedirectAttributes redirectAttributes) throws Exception{
|
|
|
|
- if (!beanValidator(model, projectRecords)){
|
|
|
|
- return form(projectRecords, model);
|
|
|
|
- }
|
|
|
|
- try {
|
|
|
|
-// projectRecords.setProjectStatus(ProjectStatusEnum.TSTORE.getValue());
|
|
|
|
- if (!projectRecords.getIsNewRecord()) {//编辑表单保存
|
|
|
|
- ProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
|
- projectRecordsService.saveProject(t,ProjectStatusEnum.TSTORE);//保存
|
|
|
|
- } else {//新增表单保存
|
|
|
|
- projectRecordsService.saveProject(projectRecords,ProjectStatusEnum.TSTORE);//保存
|
|
|
|
- }
|
|
|
|
- addMessage(redirectAttributes, "暂存项目成功");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- logger.error("暂存项目异常:",e);
|
|
|
|
- addMessage(redirectAttributes, "暂存项目异常:"+e.getMessage());
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 编辑项目表单页面
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions(value={"project:projectRecords:edit"},logical=Logical.OR)
|
|
|
|
- @RequestMapping(value = "modify")
|
|
|
|
- public String modify(ProjectRecords projectRecords, Model model,RedirectAttributes redirectAttributes) {
|
|
|
|
- projectRecords=projectRecordsService.get(projectRecords.getId());
|
|
|
|
- ProcessInstance processInstance = actTaskService.getProcIns(projectRecords.getProcessInstanceId());
|
|
|
|
- if (processInstance!=null) {
|
|
|
|
- Task taskInfok = actTaskService.getCurrentTaskInfo(processInstance);
|
|
|
|
- Act act = new Act();
|
|
|
|
- act.setTaskId(taskInfok.getId());
|
|
|
|
- act.setTaskName(taskInfok.getName());
|
|
|
|
- act.setTaskDefKey(taskInfok.getTaskDefinitionKey());
|
|
|
|
- act.setProcDefId(taskInfok.getProcessDefinitionId());
|
|
|
|
- act.setProcInsId(taskInfok.getProcessInstanceId());
|
|
|
|
- act.setTask(taskInfok);
|
|
|
|
- projectRecords.setAct(act);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
|
- model.addAttribute("projectRecords", projectRecords);
|
|
|
|
- return "modules/projectrecord/projectRecordsModify";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 删除项目
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("project:projectRecords:del")
|
|
|
|
- @RequestMapping(value = "delete")
|
|
|
|
- public String delete(ProjectRecords projectRecords, RedirectAttributes redirectAttributes) {
|
|
|
|
- int status = projectRecords.getProjectStatus();
|
|
|
|
- if(status==ProjectStatusEnum.TSTORE.getValue()||status==ProjectStatusEnum.REJECTED.getValue()||status==ProjectStatusEnum.RECALL.getValue()){
|
|
|
|
- projectRecordsService.delete(projectRecords);
|
|
|
|
- addMessage(redirectAttributes, "删除项目成功");
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }else {
|
|
|
|
- addMessage(redirectAttributes, "删除项目失败,只有“暂存”、“驳回”、“撤回”状态的项目才能删除");
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 批量删除项目
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("project:projectRecords:del")
|
|
|
|
- @RequestMapping(value = "deleteAll")
|
|
|
|
- public String deleteAll(String ids, RedirectAttributes redirectAttributes) {
|
|
|
|
- String idArray[] =ids.split(",");
|
|
|
|
- for(String id : idArray){
|
|
|
|
- projectRecordsService.delete(projectRecordsService.get(id));
|
|
|
|
- }
|
|
|
|
- addMessage(redirectAttributes, "删除项目成功");
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * 导出excel文件
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("project:projectRecords:export")
|
|
|
|
- @RequestMapping(value = "export", method= RequestMethod.POST)
|
|
|
|
- public String exportFile(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
- try {
|
|
|
|
- String fileName = "项目"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
|
- Page<ProjectRecords> page = projectRecordsService.findPage(new Page<ProjectRecords>(request, response, -1), projectRecords);
|
|
|
|
- new ExportExcel("项目", ProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
|
- return null;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
|
|
+ return "modules/sys/gridselectProjcontent";
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 下载导入项目数据模板
|
|
|
|
|
|
+ * 项目列表页面
|
|
*/
|
|
*/
|
|
- @RequiresPermissions("project:projectRecords:import")
|
|
|
|
- @RequestMapping(value = "import/template")
|
|
|
|
- public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
- try {
|
|
|
|
- String fileName = "项目数据导入模板.xlsx";
|
|
|
|
- List<ProjectRecords> list = Lists.newArrayList();
|
|
|
|
- new ExportExcel("项目数据", ProjectRecords.class, 1).setDataList(list).write(response, fileName).dispose();
|
|
|
|
- return null;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @RequestMapping("getContractInfo")
|
|
|
|
|
|
+ @RequestMapping(value = "getProjectList")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public WorkContractInfo queryContractInfo(WorkContractInfo contractInfo){
|
|
|
|
- WorkContractInfo workContractInfo = contractInfoService.get(contractInfo.getId());
|
|
|
|
- if(workContractInfo==null){
|
|
|
|
- return workContractInfo;
|
|
|
|
|
|
+ public Map<String,List> getProjectList(ProjectImplementEarly projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
+ if(UserUtils.isManager()){
|
|
|
|
+ model.addAttribute("flag","1");
|
|
}
|
|
}
|
|
- workContractInfo.setConstructionProjectTypeStr(DictUtils.getDictLabel(String.valueOf(workContractInfo.getConstructionProjectType()),"construction_project_type",""));
|
|
|
|
- if(workContractInfo.getWorkClientInfoList()!=null&&!workContractInfo.getWorkClientInfoList().isEmpty()){
|
|
|
|
- StringBuilder workClinetInfoIds = new StringBuilder();
|
|
|
|
- for (WorkClientInfo workClientInfo : workContractInfo.getWorkClientInfoList()) {
|
|
|
|
- workClinetInfoIds.append(workClientInfo.getId()).append(",");
|
|
|
|
|
|
+ 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);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- workClinetInfoIds.deleteCharAt(workClinetInfoIds.length()-1);
|
|
|
|
- workContractInfo.setWorkClinetInfoIds(workClinetInfoIds.toString());
|
|
|
|
- }
|
|
|
|
- return workContractInfo;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 审批页面
|
|
|
|
- @RequestMapping(value = "projectRecordsAudit")
|
|
|
|
- public String workContractInfoAudit(Act act, ProjectRecords projectRecords, Model model) {
|
|
|
|
-
|
|
|
|
- if (act.getProcInsId() != null) {
|
|
|
|
- if (actTaskService.getProcIns(act.getProcInsId()) != null) {
|
|
|
|
- act.setProcIns(actTaskService.getProcIns(act.getProcInsId()));
|
|
|
|
- } else {
|
|
|
|
- act.setFinishedProcIns(actTaskService.getFinishedProcIns(act.getProcInsId()));
|
|
|
|
|
|
+ //将界面需要展示数据放入类中
|
|
|
|
+ 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("");
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (act != null && StringUtils.isNotBlank(act.getTaskId())) {
|
|
|
|
- projectRecords.setAct(act);
|
|
|
|
- model.addAttribute("processInstanceId", projectRecords.getProcessInstanceId());
|
|
|
|
- }
|
|
|
|
- if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
|
|
|
|
- projectRecordsService.queryProjectDetail(projectRecords);
|
|
|
|
- }
|
|
|
|
- model.addAttribute("projectRecords", projectRecords);
|
|
|
|
- return "modules/projectrecord/projectRecordsAudit";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @RequestMapping(value = "getProcess")
|
|
|
|
- public String getProcess(ProjectRecords projectRecords, Model model,HttpServletRequest request){
|
|
|
|
- model.addAttribute("processInstanceId", projectRecords.getProcessInstanceId());
|
|
|
|
- return "modules/projectrecord/projectRecordsTask";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @RequestMapping(value = "revoke")
|
|
|
|
- public String revoke(HttpServletRequest request, RedirectAttributes redirectAttributes) {
|
|
|
|
- HashMap<String, String> requestMap = findRequestMap(request);
|
|
|
|
- String processInstanceId = requestMap.get("processInstanceId");
|
|
|
|
- String id = requestMap.get("id");
|
|
|
|
- try {
|
|
|
|
- ProjectRecords projectRecords = projectRecordsService.get(id);
|
|
|
|
- if(5==projectRecords.getProjectStatus()){
|
|
|
|
- addMessage(redirectAttributes, "项目登记已审批通过,无法撤回");
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
|
|
+ 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());
|
|
}
|
|
}
|
|
- projectRecordsService.cancelProcess(projectRecords);
|
|
|
|
- addMessage(redirectAttributes, "撤回该项目登记成功");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- logger.info(e.getMessage());
|
|
|
|
- addMessage(redirectAttributes, "撤回该项目登记失败");
|
|
|
|
- }
|
|
|
|
- return "redirect:" + Global.getAdminPath() + "/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询待办任务
|
|
|
|
- *
|
|
|
|
- * @param act
|
|
|
|
- * @param model
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @RequestMapping("/toDoList")
|
|
|
|
- public String queryToList(Act act, Model model) {
|
|
|
|
-
|
|
|
|
- //合同申请流程
|
|
|
|
- act.setProcDefKey(ActUtils.PD_PROJECTRECORD[0]);
|
|
|
|
- List<Act> list = actTaskService.todoList(act);
|
|
|
|
- Office office = UserUtils.getSelectCompany();
|
|
|
|
- String companyId = office==null?"":office.getId();
|
|
|
|
- List<Activity> activities = activityService.groupByActivityMenu("7854872f45b84acd893010e66a3db2c8",companyId);
|
|
|
|
- for (Activity activity:activities){
|
|
|
|
- act.setProcDefKey(activity.getProcessKey());
|
|
|
|
- list.addAll(actTaskService.todoList(act));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Role role = UserUtils.getSelectRole().get(0);
|
|
|
|
- List<ProjectRecords> lists = new ArrayList<ProjectRecords>();
|
|
|
|
- for (Act a : list) {
|
|
|
|
- if (a.getTask().getTaskDefinitionKey()!=null) {
|
|
|
|
- ProjectRecords projectRecords = projectRecordsService.getByProcessInstanceId(a.getProcInsId());
|
|
|
|
- if (projectRecords==null){continue;}
|
|
|
|
- projectRecordsService.queryContractInfos(projectRecords);
|
|
|
|
- projectRecords.setAuditType("项目登记");
|
|
|
|
- if(projectRecords.getProjectStatus()!= ProjectStatusEnum.RECALL.getValue()) {
|
|
|
|
- User user1 = UserUtils.get(projectRecords.getCreateBy().getId());
|
|
|
|
- if (projectRecords != null && user1.getCompany().getId().equals(companyId)) {
|
|
|
|
- projectRecords.setCreateBy(user1);
|
|
|
|
- if (a.getVars().getMap().get("applyUserId") != null) {
|
|
|
|
- User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
|
|
|
|
- if (user != null) {
|
|
|
|
- a.getVars().getMap().put("applyUserId", UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- projectRecords.setAct(a);
|
|
|
|
- lists.add(projectRecords);
|
|
|
|
- }
|
|
|
|
|
|
+ //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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- /*------变更--------*/
|
|
|
|
- act.setProcDefKey("projectAlter");
|
|
|
|
- List<Act> list3 = actTaskService.todoList(act);
|
|
|
|
- Office office3 = UserUtils.getSelectCompany();
|
|
|
|
- String companyId3 = office3==null?"":office3.getId();
|
|
|
|
- List<Activity> activities3 = activityService.groupByActivityMenu("807c6d4b5623474792fe78ff1fd1cdff",companyId3);
|
|
|
|
- for (Activity activity:activities3){
|
|
|
|
- act.setProcDefKey(activity.getProcessKey());
|
|
|
|
- list3.addAll(actTaskService.todoList(act));
|
|
|
|
- }
|
|
|
|
|
|
+ //项目负责人list数据转String
|
|
|
|
+ String projectLeader = masterList.toString().replaceAll("(?:\\[|null|\\]| +)", "");
|
|
|
|
+ projectRecordTreeData.setProjectLeader(projectLeader);
|
|
|
|
+ projectRecordTreeData.setLoginId(UserUtils.getUser().getId());
|
|
|
|
+ projectRecordTreeDataList.add(projectRecordTreeData);
|
|
|
|
|
|
- for (Act a : list3) {
|
|
|
|
- ProjectRecords projectRecords = projectRecordsService.getByAlterProcessInstanceId(a.getTask().getProcessInstanceId());
|
|
|
|
- if (projectRecords!=null){
|
|
|
|
- projectRecordsService.queryContractInfos(projectRecords);
|
|
|
|
- }
|
|
|
|
- if (projectRecords != null && projectRecords.getCompany().getId().equals(companyId3)&& projectRecords.getProjectStatus()==ProjectStatusEnum.ON_CHANGE.getValue()) {
|
|
|
|
- if (a.getVars().getMap().get("applyUserId") != null) {
|
|
|
|
- User user = UserUtils.get(a.getVars().getMap().get("applyUserId").toString());
|
|
|
|
- if (user != null) {
|
|
|
|
- a.getVars().getMap().put("applyUserId", UserUtils.get(a.getVars().getMap().get("applyUserId").toString()).getName());
|
|
|
|
|
|
+ //获取阶段Type父节点信息
|
|
|
|
+ String projectType = projectImplementEarlyService.getProjectType(records1.getProjectTypeId(), "实施前期");
|
|
|
|
+ //根据项目id查询相关的项目阶段内容
|
|
|
|
+ List<ProjectRecordTreeData> reportDataList = projectContentDataService.getProjectContentDataList(records1.getId(),projectType);
|
|
|
|
+ if(0 != reportDataList.size()){
|
|
|
|
+ Projectcontentinfo select = new Projectcontentinfo();
|
|
|
|
+ ProjectRecords project = new ProjectRecords();
|
|
|
|
+ project.setId(records1.getId());
|
|
|
|
+ select.setParentIds("0,");
|
|
|
|
+ select.setProject(project);
|
|
|
|
+ List<Projectcontentinfo> p = projectcontentinfoService.findListByProject(select);
|
|
|
|
+ for (ProjectRecordTreeData reportData : reportDataList) {
|
|
|
|
+ //添加工作内容id
|
|
|
|
+ if(p.size()>0){
|
|
|
|
+ reportData.setContentPId(p.get(0).getId());
|
|
|
|
+ reportData.setParentIds("0,");
|
|
|
|
+ reportData.setDictType("");
|
|
|
|
+ }
|
|
|
|
+ //将项目所属类型名称放入树形列表的projectId中
|
|
|
|
+ reportData.setProjectId(reportData.getProjectLeader());
|
|
|
|
+ //添加项目负责人
|
|
|
|
+ reportData.setProjectLeader(projectLeader);
|
|
|
|
+ //添加登陆者id
|
|
|
|
+ reportData.setLoginId(UserUtils.getUser().getId());
|
|
|
|
+ reportData.setCreateId(records1.getCreateBy().getId());
|
|
|
|
+ //如果当前登录人为项目登记者或项目负责人则允许其添加子节点信息
|
|
|
|
+ for (String masterId : masterIdList) {
|
|
|
|
+ if(masterId.equals(UserUtils.getUser().getId())){
|
|
|
|
+ reportData.setOperationSign(1);
|
|
|
|
+ break;
|
|
|
|
+ }else{
|
|
|
|
+ reportData.setOperationSign(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- projectRecords.setAct(a);
|
|
|
|
- projectRecords.setAuditType("项目变更");
|
|
|
|
- lists.add(projectRecords);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //排除 重新申请|撤销
|
|
|
|
- Iterator<ProjectRecords> it = lists.iterator();
|
|
|
|
- while(it.hasNext()){
|
|
|
|
- ProjectRecords w = it.next();
|
|
|
|
- if(w.getAct()!=null && w.getAct().getTaskDefKey().equals("reapply")){
|
|
|
|
- it.remove();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- model.addAttribute("list", lists);
|
|
|
|
- return "modules/projectrecord/projectRecordsToDoList";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 审批
|
|
|
|
- * @param projectRecords
|
|
|
|
- * @param model
|
|
|
|
- * @param upload_files
|
|
|
|
- * @param redirectAttributes
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @RequestMapping("saveAudit")
|
|
|
|
- public String saveAudit(ProjectRecords projectRecords, Model model,
|
|
|
|
- @RequestParam(value = "upload_files", required = false) MultipartFile[] upload_files,
|
|
|
|
- RedirectAttributes redirectAttributes) {
|
|
|
|
- String home = projectRecords.getHome();
|
|
|
|
- try {
|
|
|
|
- String taskDefKey = projectRecords.getAct().getTaskDefKey();
|
|
|
|
- //当状态为未通过时,重新修改数据
|
|
|
|
- if ("modifyApply".equals(taskDefKey)) {
|
|
|
|
- projectRecords.getAct().setComment("重新申请");
|
|
|
|
- }
|
|
|
|
- List<User> users = UserUtils.getByProssType(projectRecords.getProcessInstanceId(),1);
|
|
|
|
- String flag = projectRecords.getAct().getFlag();
|
|
|
|
- if ("yes".equals(flag) && (users==null || users.size()==0)){
|
|
|
|
- addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
|
|
|
|
- }else {
|
|
|
|
- String str = projectRecordsService.auditSave(projectRecords,users);
|
|
|
|
- addMessage(redirectAttributes, str);
|
|
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
- addMessage(redirectAttributes, "项目登记流程审批失败");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotBlank(home) && "home".equals(home)){
|
|
|
|
- return "redirect:" + Global.getAdminPath() + "/home/?repage";
|
|
|
|
- }else {
|
|
|
|
- return "redirect:" + Global.getAdminPath() + "/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询已办列表
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @RequestMapping("/queryCompleteList")
|
|
|
|
- public String queryCompleteList(Act act,HttpServletRequest request,HttpServletResponse response,Model model){
|
|
|
|
- act.setProcDefKey("projectAudit");
|
|
|
|
- List<ProjectRecords> list = projectRecordsService.historicList(act);
|
|
|
|
- Office office = UserUtils.getSelectCompany();
|
|
|
|
- String companyId = office==null?"":office.getId();
|
|
|
|
- List<Activity> activities = activityService.groupByActivityMenu("7854872f45b84acd893010e66a3db2c8",companyId);
|
|
|
|
- for (Activity activity:activities){
|
|
|
|
- act.setProcDefKey(activity.getProcessKey());
|
|
|
|
- list.addAll(projectRecordsService.historicList(act));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //合同变更
|
|
|
|
- act.setProcDefKey("projectAlter");
|
|
|
|
- List<Activity> activities3 = activityService.groupByActivityMenu("807c6d4b5623474792fe78ff1fd1cdff",companyId);
|
|
|
|
- for (Activity activity:activities3){
|
|
|
|
- act.setProcDefKey(activity.getProcessKey());
|
|
|
|
- list.addAll(projectRecordsService.historicAlterList(act));
|
|
|
|
- }
|
|
|
|
- model.addAttribute("list",list);
|
|
|
|
- return "modules/projectrecord/projectRecordsHistoricList";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 选择合同
|
|
|
|
- */
|
|
|
|
- @RequestMapping(value = "selectcontract")
|
|
|
|
- public String selectcontractId(WorkContractInfo contract, String url,String type,String isTotal, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
- if(!"1".equals(UserUtils.getSelectCompany().getId())){
|
|
|
|
- contract.setOfficeId(UserUtils.getSelectOffice().getId());
|
|
|
|
- contract.setChargeCompany(UserUtils.getSelectOffice().getId());
|
|
|
|
- contract.setCreateBy(UserUtils.getUser());
|
|
|
|
- }
|
|
|
|
- contract.setContractState("5");
|
|
|
|
- Page<WorkContractInfo> page = contractInfoService.findPageReceipts(new Page<WorkContractInfo>(request, response), contract);
|
|
|
|
- try {
|
|
|
|
- fieldLabels = URLDecoder.decode(fieldLabels, "UTF-8");
|
|
|
|
- fieldKeys = URLDecoder.decode(fieldKeys, "UTF-8");
|
|
|
|
- searchLabel = URLDecoder.decode(searchLabel, "UTF-8");
|
|
|
|
- searchKey = URLDecoder.decode(searchKey, "UTF-8");
|
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- model.addAttribute("labelNames", fieldLabels.split("\\|"));
|
|
|
|
- model.addAttribute("labelValues", fieldKeys.split("\\|"));
|
|
|
|
- model.addAttribute("fieldLabels", fieldLabels);
|
|
|
|
- model.addAttribute("fieldKeys", fieldKeys);
|
|
|
|
- model.addAttribute("url", url);
|
|
|
|
- model.addAttribute("searchLabel", searchLabel);
|
|
|
|
- model.addAttribute("searchKey", searchKey);
|
|
|
|
- model.addAttribute("type", type);
|
|
|
|
- model.addAttribute("isTotal", isTotal);
|
|
|
|
- model.addAttribute("obj", contract);
|
|
|
|
- model.addAttribute("page", page);
|
|
|
|
- return "modules/sys/gridselectContractDetail";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @RequestMapping(value = "detailList")
|
|
|
|
- @RequiresPermissions("project:projectRecordsDetail:list")
|
|
|
|
- public String detailList(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
|
- if(UserUtils.isManager()){
|
|
|
|
- model.addAttribute("flag","1");
|
|
|
|
- }
|
|
|
|
- Page<ProjectRecords> page = projectRecordsService.findPageDetail(new Page<ProjectRecords>(request, response), projectRecords);
|
|
|
|
- model.addAttribute("page", page);
|
|
|
|
- return "modules/projectrecord/projectRecordsDetailList";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 导出excel文件
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("project:projectRecordsDetail:export")
|
|
|
|
- @RequestMapping(value = "exportDetail", method=RequestMethod.POST)
|
|
|
|
- public String exportDetailFile(ProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
|
- try {
|
|
|
|
- String fileName = "项目"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
|
- Page<ProjectRecords> page = projectRecordsService.findPageDetail(new Page<ProjectRecords>(request, response, -1), projectRecords);
|
|
|
|
- new ExportExcel("项目", ProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
|
- return null;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
|
|
|
|
- }
|
|
|
|
- return "redirect:"+Global.getAdminPath()+"/project/projectRecords/?repage";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 下载导入项目数据模板
|
|
|
|
- */
|
|
|
|
- @RequiresPermissions("project:projectRecords:edit")
|
|
|
|
- @RequestMapping(value = "downloadTemplate")
|
|
|
|
- public void downloadTemplate(HttpServletRequest request,HttpServletResponse response) {
|
|
|
|
- try {
|
|
|
|
- new OSSClientUtil().downByStream(template_path,template_name,response,request.getHeader("USER-AGENT"));
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.error("项目计划模板下载失败!",e);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ projectRecordTreeDataList.addAll(reportDataList);
|
|
|
|
|
|
- /**
|
|
|
|
- * 项目登记新增客户管理
|
|
|
|
- */
|
|
|
|
- @RequestMapping(value = "linkManSave")
|
|
|
|
- @ResponseBody
|
|
|
|
- public Object linkManSave(WorkClientInfo workClientInfo,
|
|
|
|
- Model model, RedirectAttributes redirectAttributes,
|
|
|
|
- HttpServletRequest request
|
|
|
|
- ) throws Exception{
|
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
|
- try {
|
|
|
|
- //保存当前人的公司
|
|
|
|
- workClientInfo.setCompanyId(UserUtils.getSelectCompany().getId());
|
|
|
|
- workClientInfo.setOfficeId(UserUtils.getSelectOffice().getId());
|
|
|
|
- workClientInfoService.save(workClientInfo);//保存
|
|
|
|
- WorkClientLinkman linkman = workClientInfo.getWorkClientLinkmanList().get(0);
|
|
|
|
- map.put("id",linkman.getId());
|
|
|
|
- map.put("clientId",workClientInfo.getId());
|
|
|
|
- map.put("clientName",workClientInfo.getName());
|
|
|
|
- map.put("linkName",linkman.getName());
|
|
|
|
- map.put("linkMobile",linkman.getLinkMobile());
|
|
|
|
- map.put("linkPhone",linkman.getLinkPhone());
|
|
|
|
- map.put("str","新增客户信息成功!");
|
|
|
|
- }catch (Exception e){
|
|
|
|
- e.printStackTrace();
|
|
|
|
}
|
|
}
|
|
|
|
+ map.put("data",projectRecordTreeDataList);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- *选择合同-Ajax自动映射联系人
|
|
|
|
- * @param clientId
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @ResponseBody
|
|
|
|
- @RequestMapping(value = "getLinkManByClientId")
|
|
|
|
- public Map<String, Object> queryWorkClientLinkMen(String clientId){
|
|
|
|
- WorkClientLinkman linkman = workClientInfoService.queryLinkManByClientId(clientId);
|
|
|
|
- if (linkman != null) {
|
|
|
|
- WorkClientInfo workClientInfo = workClientInfoService.get(clientId);
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
- map.put("id", linkman.getId());
|
|
|
|
- map.put("clientId", workClientInfo.getId());
|
|
|
|
- map.put("clientName", workClientInfo.getName());
|
|
|
|
- map.put("uscCode",workClientInfo.getUscCode());
|
|
|
|
- map.put("linkName", linkman.getName());
|
|
|
|
- map.put("linkMobile", linkman.getLinkMobile());
|
|
|
|
- map.put("linkPhone", linkman.getLinkPhone());
|
|
|
|
- return map;
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|