Example #1
0
  // 增 必须把获取的map转为bean对数据库进行操作
  @POST
  public String insert() throws IOException {
    Map formMap = this.getParams();
    formMap = SysUtil.removeFilter(formMap);
    WaybillSign waybillSign = new WaybillSign(); // 把map转成bean对象
    ParseFormToBean pftb = new ParseFormToBean();
    waybillSign = (WaybillSign) pftb.parseToBean(formMap, waybillSign); // 将map转为bean对象
    WaybillSignDao waybillSignDao =
        (WaybillSignDao) SofaSpringContext.getBean("waybillSignDao"); // 调用接口(实现类)
    // 获取登录用户信息
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);

    String sureman = sessionBean.getRealname();
    waybillSign.setInputman(sureman); // 输入人
    waybillSign.setInputdate(GetFormatDate.getCurrentDate());
    String msgJson = waybillSignDao.insert(waybillSign); // 调用Dao同名方法
    // 添加日志操作记录
    String currrentDate = GetFormatDate.getCurrentDate();
    formMap.put("status", "已签收");
    formMap.put("trace", "运单已签收");
    formMap.put("inputDate", currrentDate);
    formMap.put("inputMan", sureman);
    WaybillLogDao waybillLogDao =
        (WaybillLogDao) SofaSpringContext.getBean("waybillLogDao"); // 调用接口(实现类)
    waybillLogDao.insert(formMap); // 保存日志操作记录
    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse()
        .responseJson(response, msgJson); // 返回给第1外包 Json格式: msg:ok|错误信息,id:int值
  }
Example #2
0
 /**
  * wei.huang 2013-10-16 修改默认货物
  *
  * @return
  */
 @POST
 public String updateChecked() {
   Map formMap = this.getParams();
   formMap = SysUtil.removeFilter(formMap);
   GoodsTypeDao goodsTypeDao =
       (GoodsTypeDao) SofaSpringContext.getBean("goodsTypeDao"); // 调用接口(实现类)
   String msgJson = goodsTypeDao.updateChecked(formMap); // 删除和查询的参数用map
   HttpServletResponse response = this.getResponseHelper().getResponse();
   return new JsonResponse().responseJson(response, msgJson); // 返回给第1外包 Json格式: 自定义
 }
Example #3
0
 // 删
 @POST
 public String delete() {
   Map formMap = this.getParams();
   formMap = SysUtil.removeFilter(formMap);
   GoodsTypeDao goodsTypeDao = (GoodsTypeDao) SofaSpringContext.getBean("goodsTypeDao");
   String msgJson = goodsTypeDao.delete(formMap); // 删除和查询的参数用map
   HttpServletResponse response = this.getResponseHelper().getResponse();
   return new JsonResponse()
       .responseJson(response, msgJson); // 返回给第1外包 Json格式: msg:ok|错误信息,id:int值
 }
Example #4
0
 /**
  * wei.huang 2013-10-15 获取货物列表
  *
  * @return
  */
 @POST
 public String selectList() {
   Map formMap = this.getParams();
   formMap = SysUtil.removeFilter(formMap);
   GoodsTypeDao goodsTypeDao =
       (GoodsTypeDao) SofaSpringContext.getBean("goodsTypeDao"); // 调用接口(实现类)
   List list = goodsTypeDao.selectList(formMap); // 删除和查询的参数用map
   String count = goodsTypeDao.getCount(formMap);
   String msgJson = JsonGenerateUtil.getPageListJson(list, count);
   HttpServletResponse response = this.getResponseHelper().getResponse();
   return new JsonResponse().responseJson(response, msgJson); // 返回给第1外包 Json格式: 自定义
 }
Example #5
0
  /** hkf 子账号列表 2013.1.9 */
  @POST
  public String list_json() {
    Map paramsMap = this.getParams();
    paramsMap = SysUtil.removeFilter(paramsMap);
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    paramsMap.put("partyid", sessionBean.getPartyid());
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String backlist = operatorService.selectPageByKey(paramsMap);

    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse().responseJson(response, backlist);
  }
Example #6
0
  /** hkf 重置密码 2013.1.15 */
  @POST
  public String updateoldpassword() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    map.put("password", MD5.md5("123456s"));
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.updateoldpassword(map);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, msg);
  }
Example #7
0
 // 改
 @POST
 public String update() {
   Map formMap = this.getParams();
   formMap = SysUtil.removeFilter(formMap);
   GoodsType goodsType = new GoodsType(); // 把map转成bean对象
   ParseFormToBean pftb = new ParseFormToBean();
   goodsType = (GoodsType) pftb.parseToBean(formMap, goodsType); // 将map转为bean对象
   GoodsTypeDao goodsTypeDao =
       (GoodsTypeDao) SofaSpringContext.getBean("goodsTypeDao"); // 调用接口(实现类)
   String msgJson = goodsTypeDao.update(goodsType);
   HttpServletResponse response = this.getResponseHelper().getResponse();
   return new JsonResponse()
       .responseJson(response, msgJson); // 返回给第1外包 Json格式: msg:ok|错误信息,id:int值
 }
Example #8
0
  /** hkf 删除子账号 2013.1.9 */
  @GET
  public String delete() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    map.put("partyid", sessionBean.getPartyid());
    String msg = operatorService.delete(map);
    String jsonmsg = JsonGenerateUtil.getMsgJson(msg);
    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, jsonmsg);
  }
Example #9
0
  /**
   * hkf 更新操作员信息
   *
   * <p>2013.1.15
   */
  @POST
  public String updateoperatormsg() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    // String operator=SysUtil.getDecode(this.getParam("operator").toString());
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    map.put("partyid", sessionBean.getPartyid());
    //	map.put("partyid", "1");
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.updateoperatormsg(map);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, msg);
  }
Example #10
0
  /** hkf 插入操作员 2013.1.10 */
  @POST
  public String save() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    Map mymap = new HashMap();
    mymap.put("operator", map.get("username"));
    mymap.put("realname", map.get("realname"));
    mymap.put("mobilenumber", map.get("mobileInfo"));
    mymap.put("telephonenumber", map.get("tel"));
    mymap.put("password", MD5.md5(map.get("pwd").toString()));
    mymap.put("securitypermission", map.get("securitypermission"));
    //		mymap.put("partyid", "1");
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    mymap.put("partyid", sessionBean.getPartyid());

    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.save(mymap);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse().responseJson(response, msg);
  }