master
wangning 7 years ago
parent d188406122
commit edf02f8c23

@ -393,13 +393,15 @@ public class TestController implements ApplicationEventPublisherAware {
return PageListUtils.buildPageListResult(commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(page,limit))); return PageListUtils.buildPageListResult(commonSubMerchantIdMapper.list(is_valid,sub_merchant_id,new PageBounds(page,limit)));
} }
@RequestMapping(value = "/common_sub_merchant_id", method = RequestMethod.POST) @RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.POST)
public void addCommonSubMerchantId(@RequestBody JSONObject sub_merchant_id) { public void addCommonSubMerchantId(@PathVariable String sub_merchant_id) {
commonSubMerchantIdService.save(sub_merchant_id.getJSONObject("params")); JSONObject record = new JSONObject();
record.put("sub_merchant_id",sub_merchant_id);
commonSubMerchantIdService.save(record);
} }
@RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.PUT) @RequestMapping(value = "/common_sub_merchant_id/{sub_merchant_id}", method = RequestMethod.PUT)
public void addCommonSubMerchantId(@PathVariable String sub_merchant_id) { public void disableCommonSubMerchantId(@PathVariable String sub_merchant_id) {
commonSubMerchantIdService.disable(sub_merchant_id); commonSubMerchantIdService.disable(sub_merchant_id);
} }
} }

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

Loading…
Cancel
Save