zm
2024-10-15 032ab98c53cd1448f81d1e8be04423d6b46c4fa1
src/main/java/com/product/administration/controller/LeaveRequestController.java
@@ -157,6 +157,41 @@
      }
   }
   /**
    * 计算请假天数
    * @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());
      }
   }
   /**
    * @Date: 2020-03-30 16:13
    * @Author: ZhouJie
    * @Description: 删除请假申请