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}