From f11f134c52a4442222b5890a54444efd2313689b Mon Sep 17 00:00:00 2001 From: xiaohanzi Date: Wed, 4 Nov 2020 17:57:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=9F=AD=E4=BF=A1=E5=8F=91=E9=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../market/WxCouponPresentController.java | 9 ++++++ .../iformall/domain/po/msg/WxMsgRecord.java | 6 ++-- .../service/WxCouponPresentService.java | 3 ++ .../impl/WxCouponPresentServiceImpl.java | 30 +++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java index 0ba38e4a3..5149453f2 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java @@ -132,5 +132,14 @@ public class WxCouponPresentController extends BaseController { wxCouponPresentService.add(wxCouponPresent, list, phoneSet,EnumPayWay.PAY_WAY_WECHAT); return new ResultData(); } + + @ApiOperation("新增接口") + @PostMapping("ttttttt") + @SystemControllerLog(description = "新增") + public ResultData tttttt(@RequestBody WxCouponPresent wxCouponPresent) { + //只需要给一端发就可以了。默认给微信小程序发 + wxCouponPresentService.tttttttttttttt(); + return new ResultData(); + } } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java b/mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java index 5833e9329..64c9bac9e 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/msg/WxMsgRecord.java @@ -58,8 +58,8 @@ public class WxMsgRecord extends BaseMsg { } public TenantEntity getTenantInfo() { - return new TenantEntity() {{ - setTenantId(tenantId); - }}; + TenantEntity tenantEntity = new TenantEntity(); + tenantEntity.setTenantId(tenantId); + return tenantEntity; } } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java index fef5b002f..10726ddcf 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponPresentService.java @@ -20,5 +20,8 @@ public interface WxCouponPresentService { WxCouponPresent findById(Long id); ResultData add(WxCouponPresent wxCouponPresent, List list, Set phoneSet,EnumPayWay payWay); + + + void tttttttttttttt(); } 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 a3a25048e..6efaf7425 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java @@ -15,6 +15,8 @@ import com.iformall.mapper.WxCouponPresentMapper; import com.iformall.mq.MqBaseProducer; import com.iformall.service.WxAppinfoService; import com.iformall.service.WxCouponPresentService; +import com.iformall.service.msg.impl.SendSmsServiceImpl; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -103,4 +105,32 @@ public class WxCouponPresentServiceImpl implements WxCouponPresentService { logger.info("系统发卡发送短信结束"); logger.info("》》》》》》》》》》》"); } + + + @Autowired + private SendSmsServiceImpl sendSmsService; + @Override + public void tttttttttttttt() { + WxCouponPassword couponPassword = wxCouponPasswordMapper.selectById(483888264577998850L); + TenantEntity tenantEntity = new TenantEntity(); + tenantEntity.setTenantId("789"); + + Map msgReplaceMap = new HashMap(); + msgReplaceMap.put("id", couponPassword.getId().toString()); + msgReplaceMap.put("app", "富茂链客"); + msgReplaceMap.put("title", "饼干消费卡"); + msgReplaceMap.put("pw", couponPassword.getPassword()); + WxMsgRecord wxMsgRecord = new WxMsgRecord(); + wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); + wxMsgRecord.setModelType(EnumMsgModel.COUPON_CARD_SEND.getCode()); + wxMsgRecord.setReceiver("18600671341"); + wxMsgRecord.updateTenantInfo(tenantEntity); + wxMsgRecord.setDynamicContentMap(msgReplaceMap); + try { + sendSmsService.send(wxMsgRecord); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } }