Пример #1
0
 /**
  * 逆向退款----查询-无分页
  *
  * @param query
  * @return
  */
 @RequestMapping(value = "query")
 @ResponseBody
 public Wrapper<?> query(RefundQuery query) {
   try {
     List<Refund> list = refundService.queryRefundList(query);
     if (!CollectionUtils.isEmpty(list)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, Wrapper.SUCCESS_MESSAGE, list);
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "查询配置信息失败!");
     }
   } catch (Exception e) {
     LOG.error("refund query has error.", e);
     return WrapMapper.error();
   }
 }
Пример #2
0
 /**
  * 逆向退款----删除
  *
  * @param refund
  * @return
  */
 @RequestMapping(value = "delete")
 @ResponseBody
 public Wrapper<?> delete(Refund refund) {
   try {
     refund.setUpdateUser(getLoginUserCnName());
     if (refundService.delete(refund)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "删除成功!");
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "删除失败!");
     }
   } catch (Exception e) {
     LOG.error("refund delete has error.", e);
     return WrapMapper.error();
   }
 }
Пример #3
0
 /**
  * 商品查询综合表----删除
  *
  * @param productSelect
  * @return
  */
 @RequestMapping(value = "delete")
 @ResponseBody
 public Wrapper<?> delete(ProductSelect productSelect) {
   try {
     productSelect.setUpdateUser(getLoginUserCnName());
     if (productSelectService.delete(productSelect)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "删除成功!");
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "删除失败!");
     }
   } catch (Exception e) {
     LOG.error("productSelect delete has error.", e);
     return WrapMapper.error();
   }
 }
Пример #4
0
 /**
  * 逆向退款----添加
  *
  * @param refund
  * @return
  */
 @RequestMapping(value = "add")
 @ResponseBody
 public Wrapper<?> add(Refund refund) {
   try {
     refund.setCreateUser(getLoginUserCnName());
     if (refundService.insert(refund)) {
       return WrapMapper.wrap(Wrapper.SUCCESS_CODE, "添加成功!");
     } else {
       return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!");
     }
   } catch (ExistedException e) {
     LOG.warn("refund add fail, exist refund.");
     return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败,已经存在");
   } catch (Exception e) {
     LOG.error("refund add has error.", e);
     return WrapMapper.wrap(Wrapper.ERROR_CODE, "添加失败!");
   }
 }
Пример #5
0
 /**
  * 添加个人基本资料
  *
  * @param requestDto
  * @return
  */
 public Wrapper<?> add(UserProfileRequestDto requestDto) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("register request: " + JsonHelper.toJson(requestDto));
   }
   UserProfileRequest request = new UserProfileRequest(super.getKey(), requestDto);
   UserProfileResponse response = null;
   String url = null;
   try {
     url = super.getServiceUrlDomain() + "services/userProfile/add";
     response = super.getRestTemplate().postForObject(url, request, UserProfileResponse.class);
   } catch (Exception e) {
     LOG.error("#UserProfileClient.add# ERROR:" + e);
   }
   if (LOG.isDebugEnabled()) {
     LOG.debug("getUserProfile url: " + url);
     LOG.debug("getUserProfile response: " + JsonHelper.toJson(response));
   }
   if (null != response) {
     return WrapMapper.wrap(response.getCode(), response.getMessage());
   } else {
     return WrapMapper.error();
   }
 }
Пример #6
0
  /**
   * 查询订单日志信息
   *
   * @param request 订单日志请求参数
   * @return 订单日志返回对象
   */
  @POST
  @Path("/orderLog/getOrderLog")
  public Wrapper<?> getOrderLog(OrderLogRequest request) {
    if (null == request || !request.checkSign()) {
      this.logger.error("getOrderLog 拒绝访问");
      return WrapMapper.forbidden();
    }

    OrderLogRequestDto requestDto = request.getContent();
    if (null == requestDto || null == requestDto.getId()) {
      this.logger.error("getOrderLog 传入参数有误");
      return WrapMapper.illegalArgument();
    }

    try {
      OrderLog orderLog = orderLogService.getOrderLogById(requestDto.getId());
      OrderLogResponseDto responseDto = convert(orderLog);
      return WrapMapper.ok().result(responseDto);
    } catch (Exception e) {
      this.logger.error("查询订单日志数据异常", e);
      return WrapMapper.error();
    }
  }
Пример #7
0
  /**
   * 查询逆向退款详情
   *
   * @param query
   * @return
   */
  @RequestMapping(value = "detail", method = RequestMethod.GET)
  @ResponseBody
  public Wrapper<?> detail(RefundQuery query) {
    if (null == query || null == query.getId()) {
      return illegalArgument();
    }

    try {
      Refund refund = refundService.getRefundById(query.getId());
      if (refund != null) {
        return new Wrapper<Refund>().result(refund);
      } else {
        return WrapMapper.wrap(Wrapper.ERROR_CODE, "查询逆向退款详情失败!");
      }
    } catch (Exception e) {
      LOG.warn("detail refund has error.", e);
      return error();
    }
  }
Пример #8
0
  /**
   * 查询商品查询综合表详情
   *
   * @param query
   * @return
   */
  @RequestMapping(value = "detail", method = RequestMethod.GET)
  @ResponseBody
  public Wrapper<?> detail(ProductSelectQuery query) {
    if (null == query || null == query.getId()) {
      return illegalArgument();
    }

    try {
      ProductSelect productSelect = productSelectService.getProductSelectById(query.getId());
      if (productSelect != null) {
        return new Wrapper<ProductSelect>().result(productSelect);
      } else {
        return WrapMapper.wrap(Wrapper.ERROR_CODE, "查询商品查询综合表详情失败!");
      }
    } catch (Exception e) {
      LOG.warn("detail productSelect has error.", e);
      return error();
    }
  }