提交 0debee51 编写于 作者: terrfly's avatar terrfly

解决删除应用, 支付参数不存在数据时报错的问题

上级 cf67837f
......@@ -36,23 +36,16 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
if (payCount > 0) throw new BizException("该应用已存在交易数据,不可删除");
// 2.删除应用关联的支付通道
boolean result = mchPayPassageService.remove(MchPayPassage.gw().eq(MchPayPassage::getAppId, appId));
if (!result) {
throw new BizException(ApiCodeEnum.SYS_OPERATION_FAIL_DELETE);
}
mchPayPassageService.remove(MchPayPassage.gw().eq(MchPayPassage::getAppId, appId));
// 3.删除应用配置的支付参数
result = payInterfaceConfigService.remove(PayInterfaceConfig.gw()
payInterfaceConfigService.remove(PayInterfaceConfig.gw()
.eq(PayInterfaceConfig::getInfoId, appId)
.eq(PayInterfaceConfig::getInfoType, CS.INFO_TYPE_MCH_APP)
);
if (!result) {
throw new BizException(ApiCodeEnum.SYS_OPERATION_FAIL_DELETE);
}
// 4.删除当前应用
result = removeById(appId);
if (!result) {
if (!removeById(appId)) {
throw new BizException(ApiCodeEnum.SYS_OPERATION_FAIL_DELETE);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册