예제 #1
0
 /**
  * 签到处理
  *
  * @return
  * @throws UnsupportedEncodingException
  */
 @RequestMapping(
     value = "doSign",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody Object doSign() {
   ResponseResult responseResult = new ResponseResult();
   try {
     // 获取请假申请信息
     JSONObject jsonSignInfoObj =
         JSON.parseObject(
             URLDecoder.decode(HttpRequestUtil.getInstance().getString("signInfo"), "UTF-8"));
     Map<String, Object> resultData = new HashMap<String, Object>();
     responseResult.setValue(resultData);
     if (null != jsonSignInfoObj) {
       String sSignTime = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm");
       Date signTime = DateUtil.stringToDate(sSignTime + ":00");
       String id = CommonUtil.GeneGUID();
       jsonSignInfoObj.put("signTime", signTime);
       jsonSignInfoObj.put("id", id);
       resultData.put("id", id);
       resultData.put("signTime", DateUtil.dateToString(signTime, "HH:mm"));
     }
     signService.doSign(jsonSignInfoObj);
   } catch (Exception e) {
     e.printStackTrace();
     responseResult.setStatus(-1);
   }
   return responseResult;
 }
예제 #2
0
 /**
  * 查询签到异常信息 根据月份 并统计
  *
  * @return
  */
 @RequestMapping(
     value = "getExceptionKQRecordByMonth",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody Object getExceptionKQRecordByMonth(HttpServletRequest request) {
   // 获取请假申请信息
   DataResult dataResult = new DataResult();
   Map<String, Object> singCountInfo = new HashMap<String, Object>();
   singCountInfo.put("userId", SystemCacheUtil.getInstance().getCurrentUser().getUserid());
   singCountInfo.put(
       "monthDate",
       DateUtil.stringToDate(HttpRequestUtil.getInstance().getString("monthDate"), "yyyy-MM"));
   // 异常考勤记录
   dataResult.setData(signUserService.getExceptionKQSignByMonth(singCountInfo));
   return dataResult;
 }
예제 #3
0
 /**
  * 查询签到统计到信息 根据月份
  *
  * @return
  */
 @RequestMapping(
     value = "getSignStatisticByMonth",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody Object getSignStatisticByMonth(HttpServletRequest request) {
   // 获取请假申请信息
   DataResult dataResult = new DataResult();
   Map<String, Object> resultData = new HashMap<String, Object>();
   Map<String, Object> singCountInfo = new HashMap<String, Object>();
   singCountInfo.put("userId", SystemCacheUtil.getInstance().getCurrentUser().getUserid());
   singCountInfo.put(
       "monthDate",
       DateUtil.stringToDate(HttpRequestUtil.getInstance().getString("monthDate"), "yyyy-MM"));
   // 签到统计
   singCountInfo.put("signType", "1");
   resultData.put("qtSignCountInfo", signUserService.getSignCountByMonth(singCountInfo));
   // 迟到早退
   singCountInfo.put("isSignException", "0");
   resultData.put("qtBeLateLeaveEarlyInfo", signUserService.getSignCountByMonth(singCountInfo));
   // 出勤率
   resultData.put("qtAttendance", signUserService.getAttendanceRateByMonth(singCountInfo));
   dataResult.setData(resultData);
   return dataResult;
 }