| | |
| | | @Autowired |
| | | private PlanService planService; |
| | | |
| | | @RequestMapping(value = "/plan/{id}/auth") |
| | | @GetMapping(value = "/plan/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(planService.selectById(String.valueOf(id))); |
| | |
| | | @RequestMapping(value = "/plan/add/auth") |
| | | @ManagerAuth |
| | | public R add(Plan plan) { |
| | | Long hostId = getHostId(); |
| | | if (planService.selectByUuid(hostId, plan.getUuid()) != null) { |
| | | throw new CoolException("规划单已存在"); |
| | | } |
| | | plan.setHostId(hostId); |
| | | plan.setUuid(planService.getUuid(hostId)); // 规划单代号 |
| | | plan.setDeptId(getDeptId()); // 所属部门 |
| | | plan.setUserId(getUserId()); // 所属人员 |
| | | |
| | | plan.setCreateBy(getUserId()); |
| | | plan.setCreateTime(new Date()); |