diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java index 39f1f771e..ba05e6552 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/AppActService.java @@ -20,4 +20,6 @@ public interface AppActService { void updateAct(JSONObject manager,String act_id,AppActBean appActBean); JSONObject getLatestWindowNotice(); + + void published(JSONObject manager,String act_id,boolean is_valid); } diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java index f100e4d72..741f07747 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java @@ -67,4 +67,13 @@ public class AppActServiceImp implements AppActService { actAppMapper.newAppAct(params); return params; } + + @Override + public void published(JSONObject manager, String act_id, boolean is_valid) { + JSONObject params = new JSONObject(); + params.put("act_id",act_id); + params.put("is_valid",is_valid); + params.put("update_time",new Date()); + actAppMapper.updateAct(params); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java index f9bbbfdb2..1bd08b431 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/web/AppActController.java @@ -45,4 +45,9 @@ public class AppActController { public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){ appActService.updateAct(manager,act_id,appActBean); } + + @ManagerMapping(value = "/published/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) + public void publishedAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody boolean is_valid){ + appActService.published(manager,act_id,is_valid); + } } diff --git a/src/main/ui/static/actapp/app_act_list.js b/src/main/ui/static/actapp/app_act_list.js index 5129eba17..95af59c10 100644 --- a/src/main/ui/static/actapp/app_act_list.js +++ b/src/main/ui/static/actapp/app_act_list.js @@ -36,7 +36,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS $scope.act = {}; $scope.act.act_id = act.act_id; $scope.act.is_valid = !act.is_valid; - $http.put('/manager/app/act/' + $scope.act.act_id, $scope.act).then(function (resp) { + $http.put('/manager/app/act/published/'+$scope.act.act_id, $scope.act.is_valid).then(function (resp) { commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'}); $scope.loadActAppList(1); }, function (resp) {