From 434ed4ce255e62c98c31ed37a67d70ce0dab9c8a Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 20 Sep 2019 15:17:15 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=B3=BB=E7=BB=9F=E5=8F=91=E5=8D=A1][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E6=9B=B4=E6=96=B0=E5=8D=A1=E5=AF=86?= =?UTF-8?q?=E4=BF=A1=E6=81=AF]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iformall/service/impl/WxCouponPresentServiceImpl.java | 4 +++- .../src/main/resources/mapper/WxCouponPasswordMapper.xml | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java index b0cc66757..ced576818 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java @@ -101,7 +101,8 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { } //添加记录 final IdWorker idWorker = IdWorker.get(); - record.setId(idWorker.nextId()); + long id = idWorker.nextId(); + record.setId(id); record.setCouponName(wxCoupon.getTitle()); record.setSendAmount(phoneSet.size()); wxCouponPresentMapper.insertSelective(record); @@ -117,6 +118,7 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { //发送 sendMsg(tenantId, phone, title, name, couponPassword.getPassword(), couponPassword.getId().toString()); //记录发送数据便于更新状态 + couponPassword.setPresentId(id); couponPassword.setSendedPhone(phone); tempList.add(couponPassword); i++; diff --git a/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml index b512f3a55..c1362d458 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml @@ -146,10 +146,9 @@ update wx_coupon_password set - status=1,sended_phone=#{item.sendedPhone},update_date=now(),expire_date=date_add(now(),interval 30 DAY) - where - id - = #{item.id} + status=1,sended_phone=#{item.sendedPhone},update_date=now(),expire_date=date_add(now(),interval 30 DAY), + present_id=#{item.presentId} + where id = #{item.id}