From 46b2c9cd7de3c4560004d94241249ce9f3f20a86 Mon Sep 17 00:00:00 2001 From: xhxu Date: Mon, 13 Feb 2023 21:46:09 +0800 Subject: [PATCH] //sharing --- .../WxProfitPaymentReceiverServiceImpl.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java index 995d21989..9016c74a9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProfitPaymentReceiverServiceImpl.java @@ -21,6 +21,7 @@ import com.iformall.douyin.pay.preOrder.AppAddSubMerchantResult; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxProfitPaymentReceiverMapper; +import com.iformall.mapper.WxProfitSharingReceiverMapper; import com.iformall.mq.MqBaseProducer; import com.iformall.service.*; import com.iformall.service.pay.PayServiceFactory; @@ -66,6 +67,9 @@ public class WxProfitPaymentReceiverServiceImpl implements WxProfitPaymentReceiv @Autowired PayServiceFactory payServiceFactory; + @Autowired + WxProfitSharingReceiverMapper wxProfitSharingReceiverMapper; + @Autowired @Qualifier("objectCommonRedisTemplate") RedisTemplate paymentReceicerRedisTemplate; @@ -95,6 +99,34 @@ public class WxProfitPaymentReceiverServiceImpl implements WxProfitPaymentReceiv wxProfitPaymentReceiverMapper.updateById(record); this.deleteRedis(record.getId()); } + //抖音的进件商户同步到 分账账户表 + //微信因为需要同步微信所以分开处理 + if(EnumAppPlat.TOUTIAO.getCode().equals(record.getPlat()) + && EnumProfitPaymentReceiverType.tt_merchant_number.getCode().equals(record.getReceiverType())){ + WxProfitSharingReceiver sharingReceiver = wxProfitSharingReceiverMapper.selectById(record); + boolean isCreate = false; + if(sharingReceiver == null){ + sharingReceiver = new WxProfitSharingReceiver(); + isCreate = true; + } + sharingReceiver.setId(record.getId()); + sharingReceiver.updateTenantInfo(record); + sharingReceiver.setReceiverType(record.getReceiverType()); + sharingReceiver.setReceiverAccount(record.getReceiverAccount()); + sharingReceiver.setReceiverComments(record.getReceiverComments()); + sharingReceiver.setCreateTime(record.getCreateTime()); + sharingReceiver.setUpdateTime(record.getUpdateTime()); + sharingReceiver.setStatus(record.getStatus()); + sharingReceiver.setPlat(record.getPlat()); + sharingReceiver.setTtImportStatus(record.getTtImportStatus()); + sharingReceiver.setTtImportUrl(record.getTtImportUrl()); + sharingReceiver.setTtBalanceUrl(record.getTtBalanceUrl()); + if(isCreate){ + wxProfitSharingReceiverMapper.insert(sharingReceiver); + }else{ + wxProfitSharingReceiverMapper.updateById(sharingReceiver); + } + } } // @Override