From e682722d5f7f5c2424736884dcf81a933083112e Mon Sep 17 00:00:00 2001 From: zhangheng <3226558941@qq.com> Date: Fri, 27 Oct 2023 15:59:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PatientCenterServiceImpl.java | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/patientcenter/impl/PatientCenterServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/patientcenter/impl/PatientCenterServiceImpl.java index 0ca33d1..7f72f20 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/patientcenter/impl/PatientCenterServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/patientcenter/impl/PatientCenterServiceImpl.java @@ -444,8 +444,6 @@ public class PatientCenterServiceImpl implements PatientCenterService { return AjaxResult.error("用户不存在,无法领取!"); } PatientCouponReceiveInfoVO patientCouponReceive = patientCouponReceiveMapper.selectPatientCouponReceive(patientId, couponId); - //查询微信小程序订阅消息记录表该会员是否已订阅 - SubscribeMessageRecord subscribeMessageRecord = subscribeMessageRecordMapper.selectSubscribeMessageRecordByPatientId(null, patientInfo.getOpenid(), appletChatConfig.getCouponReceiveTemplateId()); if (Objects.nonNull(patientCouponReceive)) { if (StringUtils.isNotBlank(patientCouponReceive.getUseStatus()) && !CouponUseStatusEnum.WAIT_RECEIVE.getInfo().equals(patientCouponReceive.getUseStatus())) { return AjaxResult.error("该优惠券已领取!"); @@ -457,17 +455,10 @@ public class PatientCenterServiceImpl implements PatientCenterService { patientCouponReceive.setUpdateTime(LocalDateTime.now()); patientCouponReceive.setCouponType(CouponTypeEnum.FULL_REDUCTION_COUPON.getInfo()); patientCouponReceiveMapper.updatePatientCouponReceive(patientCouponReceive); - boolean subscribeMessage = Objects.nonNull(subscribeMessageRecord) - && StringUtils.isNotBlank(subscribeMessageRecord.getSubscribeStatus()) - && SubscribeStatusEnum.ACCEPT.getInfo().equals(subscribeMessageRecord.getSubscribeStatus()); - if (BooleanUtils.isTrue(subscribeMessage)) { - //优惠券领取异步发送信息 - messagePushService.messageCouponReceiveThread(subscribeMessageRecord, patientCouponReceive); - } return AjaxResult.success(); } //组装优惠券信息 并发送订阅消息 - this.setCouponReceive(patientId, couponId, subscribeMessageRecord); + this.setCouponReceive(patientId, couponId); return AjaxResult.success(); } @@ -630,11 +621,10 @@ public class PatientCenterServiceImpl implements PatientCenterService { /** * 组装优惠券信息 并发送订阅消息 * - * @param patientId 会员id - * @param couponId 优惠券id - * @param subscribeMessageRecord 微信小程序订阅消息记录信息 + * @param patientId 会员id + * @param couponId 优惠券id **/ - private void setCouponReceive(Long patientId, Long couponId, SubscribeMessageRecord subscribeMessageRecord) { + private void setCouponReceive(Long patientId, Long couponId) { //组装优惠券信息 Coupon couponInfo = couponMapper.selectCouponById(couponId); PatientCouponReceive couponReceive = new PatientCouponReceive(); @@ -651,16 +641,5 @@ public class PatientCenterServiceImpl implements PatientCenterService { couponReceive.setCouponDescription(com.xinelu.common.utils.StringUtils.isBlank(couponInfo.getCouponDescription()) ? "" : couponInfo.getCouponDescription()); couponReceive.setUseStatus(CouponUseStatusEnum.NOT_USED.getInfo()); patientCouponReceiveMapper.insertPatientCouponReceive(couponReceive); - //新建对象并复制 - PatientCouponReceiveInfoVO couponReceiveInfoVO = new PatientCouponReceiveInfoVO(); - BeanUtils.copyProperties(couponReceive, couponReceiveInfoVO); - couponReceiveInfoVO.setCouponType(CouponTypeEnum.FULL_REDUCTION_COUPON.getInfo()); - boolean subscribeMessage = Objects.nonNull(subscribeMessageRecord) - && StringUtils.isNotBlank(subscribeMessageRecord.getSubscribeStatus()) - && SubscribeStatusEnum.ACCEPT.getInfo().equals(subscribeMessageRecord.getSubscribeStatus()); - if (BooleanUtils.isTrue(subscribeMessage)) { - //异步发送信息 - messagePushService.messageCouponReceiveThread(subscribeMessageRecord, couponReceiveInfoVO); - } } }