Ejemplo n.º 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;
 }