|
|
@@ -249,20 +249,8 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); |
|
|
} |
|
|
} |
|
|
WxProfitSharingReceiver oldReceiver = new WxProfitSharingReceiver(); |
|
|
|
|
|
oldReceiver.updateTenantInfo(merchant); |
|
|
|
|
|
oldReceiver.setMerchantId(merchant.getId()); |
|
|
|
|
|
oldReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode()); |
|
|
|
|
|
oldReceiver.setPlat(EnumAppPlat.TOUTIAO.getCode()); |
|
|
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = wxProfitSharingReceiverMapper.selectOne(new QueryWrapper(oldReceiver)); |
|
|
|
|
|
if(wxProfitSharingReceiver == null){ |
|
|
|
|
|
wxProfitSharingReceiver = oldReceiver; |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode()); |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverAccount("0"); |
|
|
|
|
|
wxProfitSharingReceiver.setIsUse(EnumProfitSharingUse.APPLY.getCode()); |
|
|
|
|
|
wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); |
|
|
|
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = getTtSharingReceiver(merchant); |
|
|
|
|
|
|
|
|
//进件页面 |
|
|
//进件页面 |
|
|
AppAddSubMerchantResult improt_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.improt_URL); |
|
|
AppAddSubMerchantResult improt_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.improt_URL); |
|
|
if(improt_URLResult.isSuccess()){ |
|
|
if(improt_URLResult.isSuccess()){ |
|
|
@@ -274,15 +262,71 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv |
|
|
//余额页面 |
|
|
//余额页面 |
|
|
AppAddSubMerchantResult balance_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.Balance_URL); |
|
|
AppAddSubMerchantResult balance_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.Balance_URL); |
|
|
if(balance_URLResult.isSuccess()){ |
|
|
if(balance_URLResult.isSuccess()){ |
|
|
wxProfitSharingReceiver.setReceiverAccount(improt_URLResult.getMerchantId()); |
|
|
|
|
|
|
|
|
wxProfitSharingReceiver.setReceiverAccount(balance_URLResult.getMerchantId()); |
|
|
wxProfitSharingReceiver.setTtBalanceUrl(balance_URLResult.getUrl()); |
|
|
wxProfitSharingReceiver.setTtBalanceUrl(balance_URLResult.getUrl()); |
|
|
}else{ |
|
|
}else{ |
|
|
logger.error("获取余额页面 error{}"+improt_URLResult.getMsg()); |
|
|
|
|
|
|
|
|
logger.error("获取余额页面 error{}"+balance_URLResult.getMsg()); |
|
|
} |
|
|
} |
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ResultData getTtReceiverImprotURL(WxMerchant merchant, String appId, String payAccountKey) { |
|
|
|
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); |
|
|
|
|
|
} |
|
|
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = getTtSharingReceiver(merchant); |
|
|
|
|
|
//进件页面 |
|
|
|
|
|
AppAddSubMerchantResult improt_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.improt_URL); |
|
|
|
|
|
if(improt_URLResult.isSuccess()){ |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverAccount(improt_URLResult.getMerchantId()); |
|
|
|
|
|
wxProfitSharingReceiver.setTtImportUrl(improt_URLResult.getUrl()); |
|
|
|
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
|
|
|
return new ResultData(wxProfitSharingReceiver.getTtImportUrl()); |
|
|
|
|
|
}else{ |
|
|
|
|
|
logger.error("获取进件页面 error{}"+improt_URLResult.getMsg()); |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ResultData getTtReceiverBalanceURL(WxMerchant merchant, String appId, String payAccountKey) { |
|
|
|
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"请检查传递参数"); |
|
|
|
|
|
} |
|
|
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = getTtSharingReceiver(merchant); |
|
|
|
|
|
//余额页面 |
|
|
|
|
|
AppAddSubMerchantResult balance_URLResult = appAddSubMerchant(appId,payAccountKey,merchant.getId().toString(),AppAddSubMerchantUrlType.Balance_URL); |
|
|
|
|
|
if(balance_URLResult.isSuccess()){ |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverAccount(balance_URLResult.getMerchantId()); |
|
|
|
|
|
wxProfitSharingReceiver.setTtBalanceUrl(balance_URLResult.getUrl()); |
|
|
|
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
|
|
|
return new ResultData(wxProfitSharingReceiver.getTtBalanceUrl()); |
|
|
|
|
|
}else{ |
|
|
|
|
|
logger.error("获取余额页面 error{}"+balance_URLResult.getMsg()); |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private WxProfitSharingReceiver getTtSharingReceiver(WxMerchant merchant){ |
|
|
|
|
|
WxProfitSharingReceiver oldReceiver = new WxProfitSharingReceiver(); |
|
|
|
|
|
oldReceiver.updateTenantInfo(merchant); |
|
|
|
|
|
oldReceiver.setMerchantId(merchant.getId()); |
|
|
|
|
|
oldReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode()); |
|
|
|
|
|
oldReceiver.setPlat(EnumAppPlat.TOUTIAO.getCode()); |
|
|
|
|
|
WxProfitSharingReceiver wxProfitSharingReceiver = wxProfitSharingReceiverMapper.selectOne(new QueryWrapper(oldReceiver)); |
|
|
|
|
|
if(wxProfitSharingReceiver == null){ |
|
|
|
|
|
wxProfitSharingReceiver = oldReceiver; |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverType(EnumProfitSharingReceiverType.PROFIT_SHARING_RECEIVER_MERCHANT_ID.getCode()); |
|
|
|
|
|
wxProfitSharingReceiver.setReceiverAccount("0"); |
|
|
|
|
|
wxProfitSharingReceiver.setIsUse(EnumProfitSharingUse.APPLY.getCode()); |
|
|
|
|
|
wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); |
|
|
|
|
|
this.saveOrUpdate(wxProfitSharingReceiver); |
|
|
|
|
|
} |
|
|
|
|
|
return wxProfitSharingReceiver; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public ResultData updateTtReceiverIsUse(WxMerchant merchant, String appId, String payAccountKey) { |
|
|
public ResultData updateTtReceiverIsUse(WxMerchant merchant, String appId, String payAccountKey) { |
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
if(merchant == null || StringUtils.isBlank(appId) || StringUtils.isBlank(payAccountKey)) { |
|
|
|