master
wangning 7 years ago
parent 88021a718c
commit f8b4cac8d2

@ -22,6 +22,10 @@ public class CommonSubMerchantIdServiceImpl implements CommonSubMerchantIdServic
private MpPaymentApi mpPaymentApi;
@Override
public void save(JSONObject record) {
JSONObject sub_merchant_id = commonSubMerchantIdMapper.find(record.getString("sub_merchant_id"));
if(sub_merchant_id!=null){
throw new BadRequestException("当前商户号已经添加,请重新输入");
}
WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(record.getString("sub_merchant_id"));
if(availableMerchant == null){
throw new BadRequestException("未检索到对应的商户号,请验证子商户号是否正确");

@ -23,4 +23,8 @@ public interface CommonSubMerchantIdMapper {
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject record);
@AutoSql(type = SqlType.SELECT)
JSONObject find(@Param("sub_merchant_id")String sub_merchant_id);
}

@ -347,6 +347,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
var params = angular.copy($scope.params);
$http.post('/dev/common_sub_merchant_id',{params: params}).then(function (resp) {
alert("保存成功");
$scope.loadSubMerchantId(1);
},function (resp) {
alert(resp.data.message);
});

Loading…
Cancel
Save