| | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | if(!list.isEmpty()){ |
| | | return AjaxResult.error("该时间段日历已存在", list); |
| | | }else{ |
| | | return toAjax(apsWorkCalendarService.insertApsWorkCalendar(apsWorkCalendar)); |
| | | try { |
| | | ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | tempCheck.setType(apsWorkCalendar.getType()); |
| | | List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | if(!list.isEmpty()){ |
| | | return AjaxResult.error("该时间段日历已存在", list); |
| | | }else{ |
| | | apsWorkCalendarService.insertApsWorkCalendar(apsWorkCalendar); |
| | | return success(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改日历管理 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:edit") |
| | | // @RequiresPermissions("aps:calendar:edit") |
| | | @Log(title = "日历管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | if(!list.isEmpty()){ |
| | | return AjaxResult.error("该时间段日历已存在", list); |
| | | }else{ |
| | | return toAjax(apsWorkCalendarService.updateApsWorkCalendar(apsWorkCalendar)); |
| | | try { |
| | | // ApsWorkCalendar tempCheck = new ApsWorkCalendar(); |
| | | // tempCheck.setEffectiveDate(apsWorkCalendar.getEffectiveDate()); |
| | | // tempCheck.setExpiringDate(apsWorkCalendar.getExpiringDate()); |
| | | // tempCheck.setApplicableFactory(apsWorkCalendar.getApplicableFactory()); |
| | | // tempCheck.setType(apsWorkCalendar.getType()); |
| | | // List<ApsWorkCalendar> list = apsWorkCalendarService.selectApsWorkCalendarList(tempCheck); |
| | | // if(!list.isEmpty()){ |
| | | // return AjaxResult.error("该时间段日历已存在", list); |
| | | // }else{ |
| | | apsWorkCalendarService.updateApsWorkCalendar(apsWorkCalendar); |
| | | return success(); |
| | | // } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除日历管理 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:delete") |
| | | @Log(title = "删除日历管理", businessType = BusinessType.DELETE) |
| | | @PostMapping("/deleteApsWorkCalendar") |
| | | public AjaxResult deleteApsWorkCalendar(@RequestBody ApsWorkCalendar apsWorkCalendar) |
| | | { |
| | | return toAjax(apsWorkCalendarService.deleteApsWorkCalendar(apsWorkCalendar)); |
| | | } |
| | | |
| | | /** |
| | | * 查询日历管理列表 |
| | | */ |
| | | @RequiresPermissions("aps:calendar:list") |