| | |
| | | return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | } |
| | | String uuid = leaveRequestService.saveLeaveRequest(fse); |
| | | if (uuid.equals("1")){ |
| | | return error("该时间段已经有请假记录无法保存"); |
| | | } |
| | | if (!StringUtils.isEmpty(uuid)) { |
| | | return OK_Add(uuid); |
| | | } |
| | |
| | | }catch (Exception e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(SystemCode.SYSTEM_SAVE_LEAVE_REQUEST_FAIL.getValue(), SystemCode.SYSTEM_SAVE_LEAVE_REQUEST_FAIL.getText()); |
| | | } |
| | | } |
| | | /** |
| | | * 计算请假天数 |
| | | * @return |
| | | * @throws BaseException |
| | | */ |
| | | @RequestMapping(value = "/getDay/{version}", method = RequestMethod.POST) |
| | | public String getDay(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse=null; |
| | | Object bean=request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if(bean != null) { |
| | | RequestParameterEntity reqp=(RequestParameterEntity)bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | //判断参数是否为空 |
| | | if(bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | } |
| | | //判断表名是否正常 |
| | | if (!CmnConst.PRODUCT_SYS_ASK_FOR_LEAVE.equals(fse.getTableName())) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | } |
| | | FieldSetEntity fs = leaveRequestService.getDay(fse); |
| | | return OK_List(fs); |
| | | }catch(BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(SystemCode.SYSTEM_GET_LEAVE_REQUEST_INFO_FAIL.getValue(),SystemCode.SYSTEM_GET_LEAVE_REQUEST_INFO_FAIL.getText()); |
| | | } |
| | | } |
| | | /** |
| | |
| | | return this.error(SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getValue(),SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getText()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Date: 2020-03-30 16:13 |
| | | * @Author: zm |
| | | * @Description: 根据日期获取请假数据 |
| | | */ |
| | | @RequestMapping(value = "/getLeave/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String getLeave(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse=null; |
| | | Object bean=request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if(bean != null) { |
| | | RequestParameterEntity reqp=(RequestParameterEntity)bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | //判断参数是否为空 |
| | | if(bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | } |
| | | //判断表名是否正常 |
| | | if (!CmnConst.PRODUCT_SYS_ASK_FOR_LEAVE.equals(fse.getTableName())) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | } |
| | | FieldSetEntity fs = leaveRequestService.getLeave(fse); |
| | | return OK_List(fs); |
| | | }catch(BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getValue(),SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getText()); |
| | | } |
| | | } |
| | | /** |
| | | * @Date: 2020-03-30 16:13 |
| | | * @Author: zm |
| | | * @Description: 根据日期获取请假列表 |
| | | */ |
| | | @RequestMapping(value = "/leaveList/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String leaveList(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse=null; |
| | | Object bean=request.getAttribute(CoreConst.API_POST_REQUEST_DATA); |
| | | if(bean != null) { |
| | | RequestParameterEntity reqp=(RequestParameterEntity)bean; |
| | | fse = reqp.getFormData(); |
| | | } |
| | | //判断参数是否为空 |
| | | if(bean == null || fse == null) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText()); |
| | | } |
| | | //判断表名是否正常 |
| | | if (!CmnConst.PRODUCT_SYS_ASK_FOR_LEAVE.equals(fse.getTableName())) { |
| | | SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText()); |
| | | } |
| | | DataTableEntity dt = leaveRequestService.leaveList(fse); |
| | | return OK_List(dt); |
| | | }catch(BaseException e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(e); |
| | | }catch (Exception e) { |
| | | SpringMVCContextHolder.getSystemLogger().error(e); |
| | | return this.error(SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getValue(),SystemCode.SYSTEM_DELETE_LEAVE_REQUEST_FAIL.getText()); |
| | | } |
| | | } |
| | | } |