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;
 }
Ejemplo n.º 2
0
 /**
  * 签到处理
  *
  * @return
  * @throws UnsupportedEncodingException
  */
 @RequestMapping(
     value = "doRemark",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody Object doRemark() {
   ResponseResult responseResult = new ResponseResult();
   // 获取请假申请信息
   try {
     JSONObject jsonRemarkObj =
         JSON.parseObject(
             URLDecoder.decode(HttpRequestUtil.getInstance().getString("remarkInfo"), "UTF-8"));
     signService.doRemark(jsonRemarkObj);
   } catch (Exception e) {
     e.printStackTrace();
     responseResult.setStatus(-1);
   }
   return responseResult;
 }
Ejemplo n.º 3
0
 /**
  * 发起签到
  *
  * @param model
  * @return
  */
 @RequestMapping(
     value = "launchSign",
     method = {RequestMethod.GET, RequestMethod.POST})
 public @ResponseBody Object launchSign(HttpServletRequest request) {
   ResponseResult responseResult = new ResponseResult();
   try {
     // 获取签到发布信息
     JSONObject jsonLaunchSignInfo =
         JSON.parseObject(
             URLDecoder.decode(
                 HttpRequestUtil.getInstance().getString("launchSignInfo"), "UTF-8"));
     String id = CommonUtil.GeneGUID();
     jsonLaunchSignInfo.put("id", id);
     responseResult.setValue(id);
     signService.launchSign(jsonLaunchSignInfo);
   } catch (Exception e) {
     e.printStackTrace();
     responseResult.setStatus(-1);
   }
   return responseResult;
 }