| @@ -87,6 +87,21 @@ public class WxCouponOrderController extends BaseController { | |||||
| return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, null, null, true); | return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, null, null, true); | ||||
| } | } | ||||
| @ApiOperation(value = "卡券详情接口") | |||||
| @GetMapping("detail") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||||
| }) | |||||
| public ResultData detail(String couponOrderId) { | |||||
| if(couponOrderId == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| return new ResultData(wxCouponOrderService.detailBUserVo(getUser().getId(), couponOrderId)); | |||||
| } | |||||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | ||||
| @PostMapping("verify") | @PostMapping("verify") | ||||
| public ResultData verify(@RequestBody Map<String, String> paramMap) { | public ResultData verify(@RequestBody Map<String, String> paramMap) { | ||||
| @@ -88,4 +88,11 @@ public interface WxCouponOrderService { | |||||
| * @param bUserId C端用户 | * @param bUserId C端用户 | ||||
| */ | */ | ||||
| ResultData detailCUserVo(Long cUserId, String couponOrderId); | ResultData detailCUserVo(Long cUserId, String couponOrderId); | ||||
| /** | |||||
| * B用户查券详情 | |||||
| * | |||||
| * @param bUserId B端用户 | |||||
| */ | |||||
| ResultData detailBUserVo(Long bUserId, String couponOrderId); | |||||
| } | } | ||||
| @@ -182,6 +182,28 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return new ResultData(wxCouponOrderMapper.selectDetailOfCUser(paramMap)); | return new ResultData(wxCouponOrderMapper.selectDetailOfCUser(paramMap)); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData detailBUserVo(Long bUserId, String couponOrderId) { | |||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(bUserId); | |||||
| if(wxMerchantBUser == null){ | |||||
| logger.error("用户不存在:"+ bUserId); | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchantBUser.getMerchantId()); | |||||
| if (wxMerchant == null) { | |||||
| logger.error("商户不存在:" + bUserId); | |||||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||||
| } | |||||
| Map paramMap = new HashMap(); | |||||
| paramMap.put("merchantId", wxMerchant.getId()); | |||||
| paramMap.put("tenantId", wxMerchant.getTenantId()); | |||||
| paramMap.put("couponOrderId", couponOrderId); | |||||
| return new ResultData(wxCouponOrderMapper.selectDetailOfCUser(paramMap)); | |||||
| } | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @@ -257,8 +257,16 @@ | |||||
| <select id="findListOfCUser" parameterType="map" resultMap="CVoResultMap"> | <select id="findListOfCUser" parameterType="map" resultMap="CVoResultMap"> | ||||
| select <include refid="allCUserCouponOrderListColumns" /> | select <include refid="allCUserCouponOrderListColumns" /> | ||||
| from wx_coupon_order c,wx_coupon co,wx_merchant m | from wx_coupon_order c,wx_coupon co,wx_merchant m | ||||
| where c.c_user_id = #{cUserId} | |||||
| and c.tenant_id = #{tenantId} | |||||
| where 1=1 | |||||
| <if test="cUserId != null"> | |||||
| and c.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test="merchantId != null"> | |||||
| and co.merchant_id = #{merchantId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and c.tenant_id = #{tenantId} | |||||
| </if> | |||||
| and c.coupon_id = co.id | and c.coupon_id = co.id | ||||
| and co.merchant_id = m.id | and co.merchant_id = m.id | ||||
| <if test="status != null"> | <if test="status != null"> | ||||
| @@ -272,10 +280,20 @@ | |||||
| wx_shop s,wx_merchant_shop ms, | wx_shop s,wx_merchant_shop ms, | ||||
| wx_mall_building mb, | wx_mall_building mb, | ||||
| wx_mall_floor mf | wx_mall_floor mf | ||||
| where c.c_user_id = #{cUserId} | |||||
| and c.tenant_id = #{tenantId} | |||||
| where 1=1 | |||||
| <if test="cUserId != null"> | |||||
| and c.c_user_id = #{cUserId} | |||||
| </if> | |||||
| <if test="merchantId != null"> | |||||
| and co.merchant_id = #{merchantId} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and c.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test="couponOrderId != null"> | |||||
| and c.id = #{couponOrderId} | |||||
| </if> | |||||
| and c.coupon_id = co.id | and c.coupon_id = co.id | ||||
| and c.id = #{couponOrderId} | |||||
| and co.merchant_id = m.id | and co.merchant_id = m.id | ||||
| and ms.merchant_id = m.id | and ms.merchant_id = m.id | ||||
| and ms.shop_id = s.id | and ms.shop_id = s.id | ||||