优化工作流业务

This commit is contained in:
zxm 2018-02-07 20:14:56 +08:00
parent 7da73b1114
commit eff0362c6e
2 changed files with 4 additions and 8 deletions

View File

@ -431,7 +431,7 @@ public class ActivitiController extends BaseController {
}
JsonUtil j=new JsonUtil();
try {
//repositoryService.deleteModel(id);
repositoryService.deleteModel(id);
j.setMsg("删除成功");
}catch (MyException e){
j.setMsg("删除失败");

View File

@ -44,6 +44,7 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -182,6 +183,7 @@ public class UserLeaveController extends BaseController {
return j;
}
@PostMapping("addLeave")
@ResponseBody
public JsonUtil addLeave(Model model,UserLeave userLeave){
@ -194,9 +196,8 @@ public class UserLeaveController extends BaseController {
userLeave.setUserId(user.getId());
userLeave.setUserName(user.getUsername());
userLeave.setProcessInstanceId("2018");//模拟数据
try {
leaveService.insertSelective(userLeave);
leaveService.insertSelective(userLeave);
Map<String,Object> map=new HashedMap();
map.put("userLeave",userLeave);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process_leave",map);
@ -208,11 +209,6 @@ public class UserLeaveController extends BaseController {
return JsonUtil.error("未识别key");
}
j.setMsg("请假申请成功");
}catch (MyException e){
j.setMsg("保存失败");
j.setFlag(false);
e.printStackTrace();
}
return j;
}