Ver código fonte

fix couponDetail

release_toaliyun_real
winter 4 anos atrás
pai
commit
3e3eea4322
1 arquivos alterados com 21 adições e 19 exclusões
  1. +21
    -19
      mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java

+ 21
- 19
mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java Ver arquivo

@@ -149,26 +149,28 @@ public class WxCouponController extends BaseController {
} }


WxCouponChannel channelPriceAndStock = wxCouponChannelService.getPriceAndStock(this.getTenantInfo(), couponChannelIdL); WxCouponChannel channelPriceAndStock = wxCouponChannelService.getPriceAndStock(this.getTenantInfo(), couponChannelIdL);
if (null != channelPriceAndStock.getChannelPrice() && null != channelPriceAndStock.getChannelStock()) {
return new ResultData(new StringBuffer("{").append("\"salePrice\":").append(channelPriceAndStock.getChannelPrice())
.append(",\"remainInventory\":").append(channelPriceAndStock.getChannelStock()).append("}"));
}else {
WxCoupon coupon = couponService.getPriceAndStock(channelPriceAndStock.getCouponId(),this.getTenantInfo().getTenantId());
StringBuffer sb = new StringBuffer("{\"salePrice\":");
if (null != channelPriceAndStock.getChannelPrice()) {
sb.append(channelPriceAndStock.getChannelPrice());
}else {
sb.append(coupon.getSalePrice());
}
sb.append(",\"remainInventory\":");
if (null != channelPriceAndStock.getChannelStock()) {
sb.append(channelPriceAndStock.getChannelStock());
}else {
sb.append(coupon.getRemainInventory());
}
sb.append("}");
return new ResultData(sb.toString());
if (null == channelPriceAndStock) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId非法");
} }
WxCoupon coupon = couponService.getPriceAndStock(channelPriceAndStock.getCouponId(),this.getTenantInfo().getTenantId());
if (null == coupon) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId查询不到coupon");
}
StringBuffer sb = new StringBuffer("{\"salePrice\":");
if (null != channelPriceAndStock.getChannelPrice()) {
sb.append(channelPriceAndStock.getChannelPrice());
}else {
sb.append(coupon.getSalePrice());
}
sb.append(",\"remainInventory\":");
if (null != channelPriceAndStock.getChannelStock()) {
sb.append(channelPriceAndStock.getChannelStock());
}else {
sb.append(coupon.getRemainInventory());
}
sb.append(",\"inventory\":").append(coupon.getInventory()).append(",\"price\":").append(coupon.getPrice()).append("}");
return new ResultData(sb.toString());
} }
@ApiOperation("根据id(couponChannel)查询商品商户接口") @ApiOperation("根据id(couponChannel)查询商品商户接口")


Carregando…
Cancelar
Salvar