|
@@ -272,6 +272,17 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
@RequestMapping(value = {"saveReport"})
|
|
|
public String saveReport(Projectcontentinfo projectcontentinfo, Model model,RedirectAttributes redirectAttributes) {
|
|
|
try{
|
|
|
+ Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProject().getId());
|
|
|
+ ProjectReportData reportData = projectReportDataService.get(projectcontentinfo1.getInfoId());
|
|
|
+ if(null != reportData){
|
|
|
+ if(reportData.getStatus().equals("2")){
|
|
|
+ addMessage(redirectAttributes, "报告已送审,请勿重复提交");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ } else if(reportData.getStatus().equals("5")){
|
|
|
+ addMessage(redirectAttributes, "报告已审核完毕,请勿再次送审");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
String str = ruralProjectMessageService.saveData(projectcontentinfo,2);
|
|
|
addMessage(redirectAttributes, "发起报告审批"+(str.equals("true")?"成功":"失败"));
|
|
|
ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
|
|
@@ -377,13 +388,23 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
//报告流程审批
|
|
|
@RequestMapping(value = {"reportAudit"})
|
|
|
public String reportAudit(Projectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response, Model model,
|
|
|
- RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ RedirectAttributes redirectAttributes,Integer saveAuditFlag) throws Exception {
|
|
|
ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
|
|
|
if(StringUtils.isNotBlank(projectReportData.getProcessInstanceId())){
|
|
|
Act act = getByAct(projectReportData.getProcessInstanceId());
|
|
|
projectReportData.setAct(act);
|
|
|
}
|
|
|
ProjectReportData t = projectReportDataService.getOnRural(projectReportData.getId());//从数据库取出记录的值
|
|
|
+ if(null != saveAuditFlag){
|
|
|
+ if(1 == saveAuditFlag && !t.getStatus().equals("4") && !t.getStatus().equals("5")){
|
|
|
+ addMessage(redirectAttributes, "项目报告已送审,请勿重复送审");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(t.getStatus().equals("5")){
|
|
|
+ addMessage(redirectAttributes, "项目报告已登记完成,无法再次送审");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
try {
|
|
|
MyBeanUtils.copyBeanNotNull2Bean(projectReportData, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
if(StringUtils.isNotBlank(t.getProcessInstanceId())){
|
|
@@ -448,7 +469,10 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
String id = requestMap.get("id");
|
|
|
/*try {*/
|
|
|
RuralProjectRecords projectRecords = ruralProjectMessageService.get(id);
|
|
|
- if(5==projectRecords.getProjectReportStatus()){
|
|
|
+ if(3==projectRecords.getProjectReportStatus()){
|
|
|
+ addMessage(redirectAttributes, "项目报告已撤回,请勿重复撤回");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }else if(5==projectRecords.getProjectReportStatus()){
|
|
|
addMessage(redirectAttributes, "项目报告已审批通过,无法撤回");
|
|
|
return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
}
|
|
@@ -648,7 +672,7 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
* 保存报告归档
|
|
|
*/
|
|
|
@RequestMapping(value = "saveRecord")
|
|
|
- public String save(ProjectReportRecord projectReportRecord, Model model, RedirectAttributes redirectAttributes) throws Exception{
|
|
|
+ public String save(ProjectReportRecord projectReportRecord, Model model, RedirectAttributes redirectAttributes,Integer saveAuditFlag) throws Exception{
|
|
|
if (!beanValidator(model, projectReportRecord)){
|
|
|
return form(projectReportRecord, model);
|
|
|
}
|
|
@@ -669,12 +693,26 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
Map<String, Object> variables = new HashMap<>();
|
|
|
if(!projectReportRecord.getIsNewRecord()){//编辑表单保存
|
|
|
ProjectReportRecord t = projectReportRecordService.get(projectReportRecord.getId());//从数据库取出记录的值
|
|
|
+ if(null != saveAuditFlag){
|
|
|
+ if(1 == saveAuditFlag && !t.getStatus().equals("4") && !t.getStatus().equals("5")){
|
|
|
+ addMessage(redirectAttributes, "报告归档已送审,请勿重复送审");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
+ if(t.getStatus().equals("5")){
|
|
|
+ addMessage(redirectAttributes, "报告归档已登记完成,无法再次送审");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
MyBeanUtils.copyBeanNotNull2Bean(projectReportRecord,t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
if (StringUtils.isNotBlank(projectReportRecord.getView()) && projectReportRecord.getView().equals("modify")){
|
|
|
projectReportRecord.setStatus("2");
|
|
|
}
|
|
|
ruralProjectMessageService.saveProjectReportRecord(t,variables,processInstanceId);//保存
|
|
|
}else {//新增表单保存
|
|
|
+ ProjectReportRecord reportRecord = projectReportRecordService.getprojectReportRecord(projectReportRecord.getReport().getId());//从数据库取出记录的值
|
|
|
+ if(null !=reportRecord){
|
|
|
+ projectReportRecord.setId(reportRecord.getId());
|
|
|
+ }
|
|
|
ruralProjectMessageService.saveProjectReportRecord(projectReportRecord,variables,processInstanceId);//保存
|
|
|
}
|
|
|
addMessage(redirectAttributes, "保存报告归档成功");
|
|
@@ -723,6 +761,11 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
}
|
|
|
ruralProjectMessageService.saveProjectReportRecord(t,variables,processInstanceId);//保存
|
|
|
}else {//新增表单保存
|
|
|
+ ProjectReportRecord reportRecord = projectReportRecordService.getprojectReportRecord(projectReportRecord.getReport().getId());//从数据库取出记录的值
|
|
|
+ if(null != reportRecord){
|
|
|
+ addMessage(redirectAttributes, "报告归档已存在,请勿重复提交");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
ruralProjectMessageService.saveProjectReportRecord(projectReportRecord,variables,processInstanceId);//保存
|
|
|
}
|
|
|
addMessage(redirectAttributes, "保存报告归档暂存成功");
|
|
@@ -797,8 +840,13 @@ public class RuralCostProjectMessageController extends BaseController {
|
|
|
if(projectReportRecord.getStatus().equals("5")){
|
|
|
addMessage(redirectAttributes, "报告归档已审批通过,无法撤回");
|
|
|
}else{
|
|
|
- ruralProjectMessageService.cancelInvalidate(projectReportRecord);
|
|
|
- addMessage(redirectAttributes, "强制撤回报告归档成功");
|
|
|
+ if(projectReportRecord.getStatus().equals("2")){
|
|
|
+ ruralProjectMessageService.cancelInvalidate(projectReportRecord);
|
|
|
+ addMessage(redirectAttributes, "强制撤回报告归档成功");
|
|
|
+ }else{
|
|
|
+ addMessage(redirectAttributes, "报告归档不是送审状态,无法撤回");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectMessage/?repage";
|
|
|
+ }
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
addMessage(redirectAttributes, "强制撤回报告归档失败");
|