|
@@ -30,8 +30,10 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springblade.common.cache.FlowCache;
|
|
import org.springblade.common.cache.FlowCache;
|
|
|
|
|
+import org.springblade.common.constant.CallbackServeUrl;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
|
|
+import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.flow.shop.task.WechatApplyTask;
|
|
import org.springblade.flow.shop.task.WechatApplyTask;
|
|
@@ -59,6 +61,9 @@ import java.util.List;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
+import static org.springblade.common.enums.AppConstant.InvitationType.SHOP_INVITATION;
|
|
|
|
|
+import static org.springblade.yeePay.common.YeepayApiConstant.businessRole.SETTLED_MERCHANT;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 服务实现类
|
|
* 服务实现类
|
|
|
*
|
|
*
|
|
@@ -210,7 +215,7 @@ public class ShopServiceImpl extends BaseServiceImpl<ShopMapper, Shop> implement
|
|
|
@Override
|
|
@Override
|
|
|
public R wechatConfigAdd(WechatConfigAddDto wechatConfigAddDto) {
|
|
public R wechatConfigAdd(WechatConfigAddDto wechatConfigAddDto) {
|
|
|
Shop shop = shopMapper.selectById(wechatConfigAddDto.getMerchantNo());
|
|
Shop shop = shopMapper.selectById(wechatConfigAddDto.getMerchantNo());
|
|
|
- Assert.notNull(shop,"未找到该商户记录");
|
|
|
|
|
|
|
+ Assert.notNull(shop, "未找到该商户记录");
|
|
|
wechatConfigAddDto.setMerchantNo(shop.getMerchantNo());
|
|
wechatConfigAddDto.setMerchantNo(shop.getMerchantNo());
|
|
|
wechatConfigAddDto.setParentMerchantNo(yeePayConst.getPlatformServiceNo());
|
|
wechatConfigAddDto.setParentMerchantNo(yeePayConst.getPlatformServiceNo());
|
|
|
YopResponse yopResponse = yeepaySaasService.wechatConfigAdd(wechatConfigAddDto);
|
|
YopResponse yopResponse = yeepaySaasService.wechatConfigAdd(wechatConfigAddDto);
|
|
@@ -221,6 +226,23 @@ public class ShopServiceImpl extends BaseServiceImpl<ShopMapper, Shop> implement
|
|
|
return R.success("配置成功!");
|
|
return R.success("配置成功!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private BladeRedis bladeRedis;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public R inviteMicro(MicroInvitationDto microInvitationDto) {
|
|
|
|
|
+ microInvitationDto.setParentMerchantNo(yeePayConst.getPlatformServiceNo());
|
|
|
|
|
+ microInvitationDto.setBusinessRole(SETTLED_MERCHANT.name());
|
|
|
|
|
+ microInvitationDto.setRequestNo("ldt" + microInvitationDto.getMerchantCorporationInfo().getMobile() + "micro");
|
|
|
|
|
+ microInvitationDto.setNotifyUrl(CallbackServeUrl.CALL_BACK_SERVE_URL + "/invitation/callback/" + SHOP_INVITATION);
|
|
|
|
|
+ YopResponse yopResponse = yeepaySaasService.inviteMicro(microInvitationDto);
|
|
|
|
|
+ JSONObject res = JSON.parseObject(yopResponse.getStringResult());
|
|
|
|
|
+ if (!Objects.equals(res.getString("returnCode"), "NIG00000")) {
|
|
|
|
|
+ throw new ServiceException(res.getString("returnMsg"));
|
|
|
|
|
+ }
|
|
|
|
|
+ bladeRedis.set("manual-micro-invitation", res);
|
|
|
|
|
+ return R.data(res);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//@Scheduled(cron = "0 */1 * * * ?")
|
|
//@Scheduled(cron = "0 */1 * * * ?")
|
|
|
private void queryStatus() {
|
|
private void queryStatus() {
|
|
|
//查询当前微信认证队列各个状态
|
|
//查询当前微信认证队列各个状态
|