|
|
|
@@ -20,6 +20,7 @@ import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.mq.MqBaseProducer; |
|
|
|
import com.iformall.service.*; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import com.iformall.utils.PayUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -571,10 +572,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
logger.error("找不到订单信息"); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); |
|
|
|
} |
|
|
|
String formId = null; |
|
|
|
if(StringUtils.isNotBlank(order.getFormId())) { |
|
|
|
formId = order.getFormId(); |
|
|
|
} |
|
|
|
// 2. get coupon info |
|
|
|
WxCoupon coupon = wxCouponMapper.selectByPrimaryKey(couponOrder.getCouponId()); |
|
|
|
if (coupon == null) { |
|
|
|
@@ -626,6 +623,15 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
doVerifyAppUniformMsg(couponOrder, coupon, merchant, user, dateFormat, gotopage); |
|
|
|
} |
|
|
|
|
|
|
|
// 小程序 消息 |
|
|
|
String formId = null; |
|
|
|
Date curDate = new Date(); |
|
|
|
Date dateAfter7Day = DateUtils.getHourTimeAfter(7, order.getCreateDate()); |
|
|
|
if(StringUtils.isNotBlank(order.getFormId()) && curDate.before(dateAfter7Day) |
|
|
|
&& !order.getFormId().equalsIgnoreCase("undefined")) { |
|
|
|
formId = order.getFormId(); |
|
|
|
} |
|
|
|
|
|
|
|
// 6. get payOrder info |
|
|
|
int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); |
|
|
|
if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) { |
|
|
|
@@ -647,12 +653,15 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { |
|
|
|
logger.error("payOrder信息中,prepay_id为空"); |
|
|
|
throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY); |
|
|
|
} |
|
|
|
formId = payOrder.getPrepayId(); |
|
|
|
formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); |
|
|
|
dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime()); |
|
|
|
if(curDate.before(dateAfter7Day)) { |
|
|
|
formId = payOrder.getPrepayId(); |
|
|
|
formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isBlank(formId)) { |
|
|
|
logger.error("formId为空"); |
|
|
|
logger.error("无可用formId, 不能发小程序模板消息"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|