|
@@ -23,7 +23,6 @@ import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
|
|
|
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
|
import org.activiti.engine.HistoryService;
|
|
|
-import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
|
import org.activiti.engine.task.Task;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
@@ -43,6 +42,7 @@ import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -228,10 +228,10 @@ public class SealApplyForController extends BaseController {
|
|
|
service.save(t, ProjectStatusEnum.TSTORE);//保存
|
|
|
}else if(t.getStatus() == 2){
|
|
|
addMessage(redirectAttributes, "盖章申请已送审,无法暂存");
|
|
|
- return "redirect:"+ Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ return "redirect:"+ Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
}else if(t.getStatus() == 5){
|
|
|
addMessage(redirectAttributes, "盖章申请已登记完成,无法暂存");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
}
|
|
|
} else {//新增表单保存
|
|
|
service.save(sealApplyForInfo, ProjectStatusEnum.TSTORE);//保存
|
|
@@ -254,6 +254,11 @@ public class SealApplyForController extends BaseController {
|
|
|
return form(sealApplyForInfo, model);
|
|
|
}
|
|
|
try {
|
|
|
+
|
|
|
+ if(null != sealApplyForInfo.getProjectRecords() || StringUtils.isNotBlank(sealApplyForInfo.getProjectRecords().getId())){
|
|
|
+ RuralProjectRecords projectRecords = projectRecordsService.get(sealApplyForInfo.getProjectRecords().getId());
|
|
|
+ sealApplyForInfo.setProjectRecords(projectRecords);
|
|
|
+ }
|
|
|
if(null == sealApplyForInfo.getProjectRecords() || StringUtils.isBlank(sealApplyForInfo.getProjectRecords().getReviewerPersonId())){
|
|
|
addMessage(redirectAttributes, "未选择项目或该项目无审核人,无法申请盖章");
|
|
|
return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
@@ -261,20 +266,18 @@ public class SealApplyForController extends BaseController {
|
|
|
if (!sealApplyForInfo.getIsNewRecord()) {//编辑表单保存
|
|
|
SealApplyForInfo t = service.get(sealApplyForInfo.getId());//从数据库取出记录的值
|
|
|
MyBeanUtils.copyBeanNotNull2Bean(sealApplyForInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
- if(t.getStatus() == 1) {
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(sealApplyForInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
- service.save(t, ProjectStatusEnum.IN_APRL);//保存
|
|
|
- }else if(t.getStatus() == 2){
|
|
|
- addMessage(redirectAttributes, "盖章申请已送审,无法暂存");
|
|
|
- return "redirect:"+ Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ if(t.getStatus() == 2){
|
|
|
+ addMessage(redirectAttributes, "盖章申请已送审,无法送审");
|
|
|
+ return "redirect:"+ Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
}else if(t.getStatus() == 5){
|
|
|
- addMessage(redirectAttributes, "盖章申请已登记完成,无法暂存");
|
|
|
- return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectRecords/?repage";
|
|
|
+ addMessage(redirectAttributes, "盖章申请已登记完成,无法送审");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
}
|
|
|
+ service.save(t, ProjectStatusEnum.IN_APRL);//保存
|
|
|
} else {//新增表单保存
|
|
|
service.save(sealApplyForInfo, ProjectStatusEnum.IN_APRL);//保存
|
|
|
}
|
|
|
- addMessage(redirectAttributes, "保存项目成功");
|
|
|
+ addMessage(redirectAttributes, "保存盖章申请成功");
|
|
|
}catch (Exception e){
|
|
|
logger.error("保存盖章申请异常:",e);
|
|
|
addMessage(redirectAttributes, "保存盖章申请异常:"+e.getMessage());
|
|
@@ -283,6 +286,35 @@ public class SealApplyForController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "getProcess")
|
|
|
+ public String getProcess(SealApplyForInfo sealApplyForInfo, Model model, HttpServletRequest request) {
|
|
|
+ model.addAttribute("processInstanceId", sealApplyForInfo.getProcessInstanceId());
|
|
|
+ return "modules/ruralprojectrecords/ruralProjectRecordsTask";
|
|
|
+ }
|
|
|
+
|
|
|
+ @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");
|
|
|
+ //获取项目状态
|
|
|
+ Integer status = Integer.parseInt(requestMap.get("status"));
|
|
|
+ try {
|
|
|
+ SealApplyForInfo sealApplyForInfo = service.get(id);
|
|
|
+ if (sealApplyForInfo.getStatus() != status) {
|
|
|
+ addMessage(redirectAttributes, "盖章申请不是送审状态,无法撤回");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
+ }
|
|
|
+ service.cancelProcess(sealApplyForInfo);
|
|
|
+ addMessage(redirectAttributes, "撤回该盖章申请成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.info(e.getMessage());
|
|
|
+ addMessage(redirectAttributes, "撤回该盖章申请失败");
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 报销list页面查询框
|
|
|
*/
|
|
@@ -319,8 +351,8 @@ public class SealApplyForController extends BaseController {
|
|
|
RedirectAttributes redirectAttributes) {
|
|
|
String home = sealApplyForInfo.getHome();
|
|
|
try {
|
|
|
- SealApplyForInfo t = service.get(sealApplyForInfo.getId());//从数据库取出记录的值
|
|
|
- MyBeanUtils.copyBeanNotNull2Bean(t,sealApplyForInfo);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ /*SealApplyForInfo t = service.get(sealApplyForInfo.getId());//从数据库取出记录的值
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(t,sealApplyForInfo);//将编辑表单中的非NULL值覆盖数据库记录中的值*/
|
|
|
// 对不同环节的业务逻辑进行操作
|
|
|
List<User> users = null;
|
|
|
User auditUser = null;
|
|
@@ -422,7 +454,6 @@ public class SealApplyForController extends BaseController {
|
|
|
|
|
|
public Act getByAct(String processInstanceId){
|
|
|
Act act = new Act();
|
|
|
- HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
|
|
ProcessInstance processInstance = actTaskService.getProcIns(processInstanceId);
|
|
|
if (processInstance!=null) {
|
|
|
List<Task> taskList = actTaskService.getCurrentTaskList(processInstance);
|
|
@@ -449,4 +480,24 @@ public class SealApplyForController extends BaseController {
|
|
|
}
|
|
|
return act;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除盖章申请
|
|
|
+ */
|
|
|
+ @RequiresPermissions("sealApplyFor:sealApplyFor:del")
|
|
|
+ @RequestMapping(value = "delete")
|
|
|
+ public String delete(SealApplyForInfo sealApplyForInfo, RedirectAttributes redirectAttributes) throws Exception {
|
|
|
+ SealApplyForInfo t = service.get(sealApplyForInfo.getId());//从数据库取出记录的值
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(sealApplyForInfo, t);//将编辑表单中的非NULL值覆盖数据库记录中的值
|
|
|
+ if(t.getStatus() == 2){
|
|
|
+ addMessage(redirectAttributes, "盖章申请已送审,无法删除");
|
|
|
+ return "redirect:"+ Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
+ }else if(t.getStatus() == 5){
|
|
|
+ addMessage(redirectAttributes, "盖章申请已登记完成,无法删除");
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
|
|
|
+ }
|
|
|
+ service.delete(sealApplyForInfo);
|
|
|
+ addMessage(redirectAttributes, "删除盖章申请成功");
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/sealApplyFor/sealApplyFor/?repage";
|
|
|
+ }
|
|
|
}
|