|
@@ -1983,4 +1983,72 @@ public class RuralCostProjectMessageNewController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 项目上报
|
|
|
+ * @param projectRecords
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "submitReportedProvincialStanding")
|
|
|
+ public String submitReportedProvincialStanding(RuralProjectRecords projectRecords, Model model) {
|
|
|
+ //查询上报信息表中是否含有数据,没有则进行获取基础数据
|
|
|
+ RuralProjectRecordsReported reported = ruralProjectMessageService.getRuralProjectRecordsReported(projectRecords.getId());
|
|
|
+ ProcessInstance processInstance = actTaskService.getProcIns(reported.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);
|
|
|
+ reported.setAct(act);
|
|
|
+ }
|
|
|
+ RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(reported.getProjectId());
|
|
|
+ //根据上报id查询上报咨询员的信息
|
|
|
+ List<RuralReportConsultant> reportedConsultants=ruralProjectMessageS.getReportedConsultantsList(reported.getId());
|
|
|
+ //对上报的咨询员进行处理
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageS.disposereportedConsultant(reportedConsultants);
|
|
|
+
|
|
|
+ //获取工程类型
|
|
|
+ ProjectEngineeringInfo engineeringInfos=engineeringService.getProjectReportedType(reported.getPorjectUse());
|
|
|
+ model.addAttribute("engineeringInfo", engineeringInfos);
|
|
|
+ List<Area> areaList = ruralProjectMessageS.getProjectReportedAreaByParentId(reported.getS1());
|
|
|
+ model.addAttribute("cityList", areaList);
|
|
|
+ //查询项目信息
|
|
|
+ model.addAttribute("ruralProjectRecords", records);
|
|
|
+ model.addAttribute("consultantInfo", consultantList);
|
|
|
+ model.addAttribute("ruralProjectRecordsReported", reported);
|
|
|
+ return "modules/ruralprojectrecords/cost/newReported/submitReportedProvincialStandingForm";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 工单执行(完成任务)
|
|
|
+ * @param model
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "saveReportedProvincialStanding")
|
|
|
+ public String saveReportedProvincialStanding(RuralProjectRecordsReported reported, Model model,
|
|
|
+ RedirectAttributes redirectAttributes) {
|
|
|
+ try {
|
|
|
+ ruralProjectMessageService.disposeList(reported);
|
|
|
+ RuralProjectRecordsReported t = ruralProjectMessageService.getRuralProjectRecordsReportedById(reported.getId());;//从数据库取出记录的值
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(reported, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+
|
|
|
+ String str = ruralProjectMessageService.saveReportedProvincialStanding(t);
|
|
|
+
|
|
|
+ addMessage(redirectAttributes, str);
|
|
|
+ }catch (Exception e){
|
|
|
+ addMessage(redirectAttributes, "上报流程审批失败");
|
|
|
+ logger.error("上报流程审批失败:",e);
|
|
|
+ }
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.get(reported.getProjectId());
|
|
|
+
|
|
|
+ if("1".equals(ruralProjectRecords.getProjectType())){
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessage/?repage";
|
|
|
+ }else if("2".equals(ruralProjectRecords.getProjectType())){
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessage/?repage";
|
|
|
+ }
|
|
|
}
|