|
@@ -204,8 +204,16 @@ public class RuralCostProjectRecordsController extends BaseController {
|
|
|
// projectRecords.setProjectStatus(ProjectStatusEnum.IN_APRL.getValue());
|
|
|
if (!projectRecords.getIsNewRecord()) {//编辑表单保存
|
|
|
RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
- projectRecordsService.saveProject(t, ProjectStatusEnum.IN_APRL);//保存
|
|
|
+ if(t.getProjectStatus() == 3 || t.getProjectStatus() == 1) {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ projectRecordsService.saveProject(t, ProjectStatusEnum.IN_APRL);//保存
|
|
|
+ }else if(t.getProjectStatus() == 2){
|
|
|
+ addMessage(redirectAttributes, "项目已送审,无法重复送审");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }else if(t.getProjectStatus() == 5){
|
|
|
+ addMessage(redirectAttributes, "项目已登记完成,无法再次送审");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }
|
|
|
} else {//新增表单保存
|
|
|
//添加查询类型(造价审核)
|
|
|
projectRecords.setProjectType("2");
|
|
@@ -231,8 +239,16 @@ public class RuralCostProjectRecordsController extends BaseController {
|
|
|
// projectRecords.setProjectStatus(ProjectStatusEnum.TSTORE.getValue());
|
|
|
if (!projectRecords.getIsNewRecord()) {//编辑表单保存
|
|
|
RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
- projectRecordsService.saveProject(t, ProjectStatusEnum.TSTORE);//保存
|
|
|
+ if(t.getProjectStatus() == 1) {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(projectRecords, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ projectRecordsService.saveProject(t, ProjectStatusEnum.TSTORE);//保存
|
|
|
+ }else if(t.getProjectStatus() == 2){
|
|
|
+ addMessage(redirectAttributes, "项目已送审,无法暂存");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }else if(t.getProjectStatus() == 5){
|
|
|
+ addMessage(redirectAttributes, "项目已登记完成,无法暂存");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }
|
|
|
} else {//新增表单保存
|
|
|
// 添加查询类型(工程咨询)
|
|
|
projectRecords.setProjectType("2");
|
|
@@ -442,12 +458,14 @@ public class RuralCostProjectRecordsController extends BaseController {
|
|
|
HashMap<String, String> requestMap = findRequestMap(request);
|
|
|
String processInstanceId = requestMap.get("processInstanceId");
|
|
|
String id = requestMap.get("id");
|
|
|
+ //获取项目状态
|
|
|
+ Integer projectStatus = Integer.parseInt(requestMap.get("projectStatus"));
|
|
|
try {
|
|
|
- RuralProjectRecords projectRecords = projectRecordsService.get(id);
|
|
|
- if(5==projectRecords.getProjectStatus()){
|
|
|
- addMessage(redirectAttributes, "项目登记已审批通过,无法撤回");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
|
|
|
- }
|
|
|
+ RuralProjectRecords projectRecords = projectRecordsService.get(id);
|
|
|
+ if(projectRecords.getProjectStatus() != projectStatus){
|
|
|
+ addMessage(redirectAttributes, "项目登记不是送审状态,无法撤回");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }
|
|
|
projectRecordsService.cancelProcess(projectRecords);
|
|
|
addMessage(redirectAttributes, "撤回该项目登记成功");
|
|
|
}catch (Exception e){
|
|
@@ -556,7 +574,7 @@ public class RuralCostProjectRecordsController extends BaseController {
|
|
|
@RequestMapping("saveAudit")
|
|
|
public String saveAudit(RuralProjectRecords projectRecords, Model model,
|
|
|
@RequestParam(value = "upload_files", required = false) MultipartFile[] upload_files,
|
|
|
- RedirectAttributes redirectAttributes) {
|
|
|
+ RedirectAttributes redirectAttributes,Integer saveAuditFlag) {
|
|
|
String home = projectRecords.getHome();
|
|
|
try {
|
|
|
String taskDefKey = projectRecords.getAct().getTaskDefKey();
|
|
@@ -569,6 +587,17 @@ public class RuralCostProjectRecordsController extends BaseController {
|
|
|
if ("yes".equals(flag) && (users==null || users.size()==0)){
|
|
|
addMessage(redirectAttributes, "审批失败,审批人为空,请联系管理员!");
|
|
|
}else {
|
|
|
+ RuralProjectRecords t = projectRecordsService.get(projectRecords.getId());//从数据库取出记录的值
|
|
|
+ if(null != saveAuditFlag){
|
|
|
+ if(1 == saveAuditFlag && t.getProjectStatus() != 4 && t.getProjectStatus() != 5){
|
|
|
+ addMessage(redirectAttributes, "项目已送审,请勿重复送审");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(t.getProjectStatus() == 5){
|
|
|
+ addMessage(redirectAttributes, "项目已登记完成,无法再次送审");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ }
|
|
|
String str = projectRecordsService.auditSave(projectRecords,users);
|
|
|
addMessage(redirectAttributes, str);
|
|
|
}
|