コード例 #1
0
  @RequestMapping(value = "/adddo")
  public ModelAndView adddo(
      HttpServletRequest request,
      @PathVariable String orgi,
      @ModelAttribute("data") SinoLocation data) {
    String str = UUID.randomUUID().toString();
    String id =
        str.substring(0, 8)
            + str.substring(9, 13)
            + str.substring(14, 18)
            + str.substring(19, 23)
            + str.substring(24);
    // System.out.println("id================="+id);
    data.setId(id);
    data.setOrgi(orgi);
    data.setUpdatedate(new Date());
    data.setStatus("1"); // 新增
    super.getService().saveIObject(data);

    // 发消息给GW,在GW更新百度信息
    APIContext.getRpcServer()
        .sendMessageToServer(
            new Message(
                EapDataContext.HANDLER,
                JSON.toJSONString(
                    new SystemMessage(SINOSIG_LOCATION, data), SerializerFeature.WriteClassName)));

    ResponseData responseData = new ResponseData("/pages/public/success");
    return request(responseData, orgi, null);
  }
コード例 #2
0
 @RequestMapping(value = "/rm/{id}")
 public ModelAndView rm(
     HttpServletRequest request,
     @PathVariable String orgi,
     @PathVariable String id,
     @ModelAttribute("data") SinoLocation data) {
   data.setId(id);
   data.setStatus("3"); // 删除
   super.getService().deleteIObject(data);
   // 发消息给GW,在GW更新百度信息
   APIContext.getRpcServer()
       .sendMessageToServer(
           new Message(
               EapDataContext.HANDLER,
               JSON.toJSONString(
                   new SystemMessage(SINOSIG_LOCATION, data), SerializerFeature.WriteClassName)));
   ResponseData responseData = new ResponseData("/pages/manage/sinosig/location/list");
   responseData.setDataList(
       super.getService()
           .findPageByCriteria(
               DetachedCriteria.forClass(SinoLocation.class)
                   .add(
                       Restrictions.and(
                           Restrictions.eq("orgi", orgi),
                           Restrictions.and(
                               Restrictions.eq("type", data.getType()),
                               Restrictions.eq("province", data.getProvince()))))));
   return request(responseData, orgi, null);
 }