From 4cc08344c8c71453612b87069c6f2f0e251eff23 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 19 Oct 2022 22:19:25 +0800 Subject: [PATCH] //poi --- .../com/iformall/domain/po/TtMerchantPoi.java | 2 +- .../service/impl/WxCouponServiceImpl.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java b/mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java index 23d4898e8..809377ba9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java @@ -19,7 +19,7 @@ public class TtMerchantPoi extends TenantEntity { protected Long id;//merchant_id - @io.swagger.annotations.ApiModelProperty(value=" merchant_id",name="supplierExtId") + @io.swagger.annotations.ApiModelProperty(value=" 暂定merchant_id",name="supplierExtId") private String supplierExtId; @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 9399ddf86..1bd98f61c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -136,6 +136,8 @@ public class WxCouponServiceImpl implements WxCouponService { @Autowired private TtGoodsCategoryService ttGoodsCategoryService; + @Autowired + private TtMerchantPoiService ttMerchantPoiService; @Autowired WxAppinfoService wxAppinfoService; @@ -578,6 +580,20 @@ public class WxCouponServiceImpl implements WxCouponService { return new ResultData(ErrorCode.APP_ID_NOT_FOUND); } + //判断商户是否匹配poi + if (EnumAppPlat.TOUTIAO.equals(plat)) { + List badPoiNames = new ArrayList(); + for (WxMerchant merchant:merchantList) { + TtMerchantPoi byId = ttMerchantPoiService.getById(merchant.getId()); + if(byId == null || !EnumSupplierMathStatus.match_success.getCode().equals(byId.getMatchStatus())){ + badPoiNames.add(merchant.getName()); + } + } + if(!badPoiNames.isEmpty()){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), JSONArray.toJSONString(badPoiNames)+"未匹配poi"); + } + } + EnumPayMchType payMchType = EnumPayMchType.getEnum(payAccount.getMchType()); EnumPayShare isShare = EnumPayShare.getEnum(payAccount.getShare());