|
|
|
@@ -154,12 +154,14 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TenantIgnore |
|
|
|
@ApiOperation(value = "卡券详情接口") |
|
|
|
@GetMapping("detail") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) |
|
|
|
@ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "couponTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false) |
|
|
|
}) |
|
|
|
public ResultData detail(String couponOrderId) { |
|
|
|
public ResultData detail(String couponOrderId,String couponTenantId) { |
|
|
|
|
|
|
|
logger.info("couponOrderController.detail:" + couponOrderId); |
|
|
|
|
|
|
|
@@ -193,8 +195,16 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
} |
|
|
|
WxCouponOrderCVo wxCouponOrderCVo = null; |
|
|
|
TenantEntity parentTenantEntity = null; |
|
|
|
if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { |
|
|
|
parentTenantEntity = getTenantInfo(); |
|
|
|
}else { |
|
|
|
parentTenantEntity = new TenantEntity(); |
|
|
|
parentTenantEntity.setTenantId(couponTenantId); |
|
|
|
parentTenantEntity.setParentTenantId(null); |
|
|
|
} |
|
|
|
try { |
|
|
|
wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,wxMerchant); |
|
|
|
wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,parentTenantEntity); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
} |
|
|
|
@@ -239,18 +249,28 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
return new ResultData(wxCouponOrderCVo); |
|
|
|
} |
|
|
|
|
|
|
|
@TenantIgnore |
|
|
|
@ApiOperation(value = "卡券富文本接口") |
|
|
|
@GetMapping("html") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) |
|
|
|
@ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "couponTenantId", value = "券tenantID", dataType = "string", paramType = "query", required = false) |
|
|
|
}) |
|
|
|
public ResultData getHtml(String couponOrderId) { |
|
|
|
public ResultData getHtml(String couponOrderId,String couponTenantId) { |
|
|
|
if (couponOrderId == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
TenantEntity parentTenantEntity = null; |
|
|
|
if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { |
|
|
|
parentTenantEntity = getTenantInfo(); |
|
|
|
}else { |
|
|
|
parentTenantEntity = new TenantEntity(); |
|
|
|
parentTenantEntity.setTenantId(couponTenantId); |
|
|
|
parentTenantEntity.setParentTenantId(null); |
|
|
|
} |
|
|
|
WxCouponOrderCVo wxCouponOrderCVo = null; |
|
|
|
try { |
|
|
|
wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,getTenantInfo()); |
|
|
|
wxCouponOrderCVo = wxCouponOrderService.simpleDetailCUserVo(couponOrderId,parentTenantEntity); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
} |
|
|
|
@@ -409,8 +429,8 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
return new ResultData(couponOrder); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\"}") |
|
|
|
@TenantIgnore |
|
|
|
@ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\",\"couponTenantId\":\"string\"}") |
|
|
|
@PostMapping("/findById") |
|
|
|
public ResultData findById(@RequestBody Map<String, String> paramMap) { |
|
|
|
logger.info(paramMap.toString()); |
|
|
|
@@ -427,7 +447,18 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
logger.error("couponOrderId参数不正确: " + paramMap.toString()); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId,getTenantInfo().getTenantId())); |
|
|
|
String couponTenantId = paramMap.get("couponTenantId"); |
|
|
|
TenantEntity parentTenantEntity = null; |
|
|
|
if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { |
|
|
|
parentTenantEntity = getTenantInfo(); |
|
|
|
}else { |
|
|
|
//查询父 |
|
|
|
parentTenantEntity = new TenantEntity(); |
|
|
|
parentTenantEntity.setTenantId(couponTenantId); |
|
|
|
parentTenantEntity.setParentTenantId(null); |
|
|
|
} |
|
|
|
|
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId,parentTenantEntity.getTenantId())); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") |
|
|
|
@@ -441,7 +472,7 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "商品发货", notes = "{\"id\":\"string\", \"deliveryInfo\":\"jsonString\"}") |
|
|
|
@ApiOperation(value = "商品发货", notes = "{\"id\":\"string\", \"deliveryInfo\":\"jsonString\",\"couponTenantId\":\"string\"}") |
|
|
|
@PostMapping("/sendGoods") |
|
|
|
public ResultData sendGoods(@RequestBody WxCouponOrder wxCouponOrder) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxCouponPasswordController::postpone"); |
|
|
|
@@ -450,7 +481,19 @@ public class WxCouponOrderController extends BaseController { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
try { |
|
|
|
WxCouponOrder couponOrder = wxCouponOrderService.getById(wxCouponOrder.getId(), getTenantInfo().getTenantId()); |
|
|
|
|
|
|
|
String couponTenantId = wxCouponOrder.getCouponTenantId(); |
|
|
|
TenantEntity parentTenantEntity = null; |
|
|
|
if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { |
|
|
|
parentTenantEntity = getTenantInfo(); |
|
|
|
}else { |
|
|
|
//查询父 |
|
|
|
parentTenantEntity = new TenantEntity(); |
|
|
|
parentTenantEntity.setTenantId(couponTenantId); |
|
|
|
parentTenantEntity.setParentTenantId(null); |
|
|
|
} |
|
|
|
|
|
|
|
WxCouponOrder couponOrder = wxCouponOrderService.getById(wxCouponOrder.getId(), parentTenantEntity.getTenantId()); |
|
|
|
if(couponOrder==null){ |
|
|
|
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); |
|
|
|
} |
|
|
|
|