|
|
|
@@ -1051,7 +1051,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
public JSONArray queryMicroPayCouponOrder(WxMerchantBUser user, WxCUser cUser, Integer payPrice) { |
|
|
|
Map<String, Object> coQ = new HashMap<>(); |
|
|
|
coQ.put("tenantId", user.getTenantId()); |
|
|
|
coQ.put("cUserId", user.getId()); |
|
|
|
coQ.put("cUserId", cUser.getId()); |
|
|
|
coQ.put("merchantId", user.getMerchantId()); |
|
|
|
List<WxCouponOrderCVo> avaCoList = wxCouponOrderMapper.findAvailCouponOrder(coQ); |
|
|
|
JSONArray couponList = new JSONArray(); |
|
|
|
@@ -1117,29 +1117,25 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
throw new MallinkException(ErrorCode.COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE); |
|
|
|
} |
|
|
|
|
|
|
|
// 5. 满减券检查使用金额 |
|
|
|
if (couponType.equals(EnumCouponType.COUPON_MANJIAN)) { |
|
|
|
if (payPrice < couponOrderCVo.getUsePrice()) { |
|
|
|
logger.error(ErrorCode.VERIFY_MANJIAN_USER_PRICE_NOT_TOUCH.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.VERIFY_MANJIAN_USER_PRICE_NOT_TOUCH); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 6. 生成优惠券抵扣信息 |
|
|
|
retObj.put(WxPayConstant.COUPON_ID, couponOrderCVo.getId().toString()); |
|
|
|
retObj.put(WxPayConstant.TITLE, couponOrderCVo.getTitle()); |
|
|
|
retObj.put(WxPayConstant.COUPON_TYPE, couponType.getMessage()); |
|
|
|
retObj.put(WxPayConstant.PRICE, couponOrderCVo.getPrice()); |
|
|
|
retObj.put(WxPayConstant.EXPIRE, mydateFormat.format(couponOrderCVo.getExpiredTime())); |
|
|
|
if (couponType.equals(EnumCouponType.COUPON_MANJIAN)) { |
|
|
|
retObj.put(WxPayConstant.USE_PRICE, couponOrderCVo.getUsePrice()); |
|
|
|
String des = String.format("%s-满%s元可用,可抵%s元, 过期时间: %s", |
|
|
|
couponType.getMessage(), couponOrderCVo.getUsePriceStr(), couponOrderCVo.getPriceStr(), |
|
|
|
mydateFormat.format(couponOrderCVo.getExpiredTime())); |
|
|
|
String des = String.format("满%s元可用,可抵%s元", |
|
|
|
couponOrderCVo.getUsePriceStr(), couponOrderCVo.getPriceStr()); |
|
|
|
retObj.put(WxPayConstant.COUPON_DES, des); |
|
|
|
if (payPrice < couponOrderCVo.getUsePrice()) { |
|
|
|
retObj.put(WxPayConstant.ENABLE, EnumPosEnableType.Disable.getCode()); |
|
|
|
} else { |
|
|
|
retObj.put(WxPayConstant.ENABLE, EnumPosEnableType.Enable.getCode()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
String des = String.format("%s-可抵%s元, 过期时间: %s", |
|
|
|
couponType.getMessage(), couponOrderCVo.getPriceStr(), |
|
|
|
mydateFormat.format(couponOrderCVo.getExpiredTime())); |
|
|
|
retObj.put(WxPayConstant.ENABLE, EnumPosEnableType.Enable.getCode()); |
|
|
|
String des = String.format("可抵%s元", couponOrderCVo.getPriceStr()); |
|
|
|
retObj.put(WxPayConstant.COUPON_DES, des); |
|
|
|
} |
|
|
|
return retObj; |
|
|
|
|