diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java index 8d2429740..5e6c3c103 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java @@ -18,8 +18,7 @@ public class AppActBean { private Boolean is_show_window; private String act_img; private String window_img; - private int page = 1; - private int limit = 10; + public JSONObject toJsonParam(){ JSONObject params = new JSONObject(); @@ -116,22 +115,6 @@ public class AppActBean { this.show_type = show_type; } - public int getPage() { - return page; - } - - public void setPage(int page) { - this.page = page; - } - - public int getLimit() { - return limit; - } - - public void setLimit(int limit) { - this.limit = limit; - } - public Boolean getIs_show_window() { return is_show_window; } diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java new file mode 100644 index 000000000..c0447207a --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActQueryBean.java @@ -0,0 +1,45 @@ +package au.com.royalpay.payment.manage.activities.app_index.beans; + +import com.alibaba.fastjson.JSONObject; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; + +/** + * Created by yuan on 2018/3/15. + */ +public class AppActQueryBean { + private boolean is_valid; + private int page = 1; + private int limit = 10; + + public JSONObject toJsonParam(){ + JSONObject params = new JSONObject(); + if(is_valid){ + params.put("is_valid",is_valid); + } + return params; + } + + public boolean isIs_valid() { + return is_valid; + } + + public void setIs_valid(boolean is_valid) { + this.is_valid = is_valid; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } +} 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 9687dea05..11ebc3c2d 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 @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.activities.app_index.core; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; +import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -10,9 +11,9 @@ public interface AppActService { List listAppActs(); - void newAppAct(JSONObject manager, AppActBean appActBean); + JSONObject newAppAct(JSONObject manager, AppActBean appActBean); - PageList listAppActs(JSONObject manager, AppActBean appActBean); + PageList listAppActs(JSONObject manager, AppActQueryBean appActQueryBean); JSONObject getActDetail(JSONObject manager,String act_id); 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 bebaed78e..e3221c19a 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 @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.activities.app_index.core.impls; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; +import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; import au.com.royalpay.payment.manage.mappers.act.ActAppMapper; import com.alibaba.fastjson.JSONObject; @@ -31,13 +32,9 @@ public class AppActServiceImp implements AppActService { } @Override - public PageList listAppActs(JSONObject manager, AppActBean appActBean){ -// List list = actAppMapper.listActs(); -// for (JSONObject act:list){ -// String url = act.getString("act_url"); -// act.put("act_url", PlatformEnvironment.getEnv().concatUrl(url)); -// } - return actAppMapper.listActs(new PageBounds(appActBean.getPage(), appActBean.getLimit(), Order.formString("create_time.desc"))); + public PageList listAppActs(JSONObject manager, AppActQueryBean appActQueryBean){ + JSONObject params = appActQueryBean.toJsonParam(); + return actAppMapper.listAppActs(params,new PageBounds(appActQueryBean.getPage(), appActQueryBean.getLimit(), Order.formString("create_time.desc"))); } @Override @@ -55,9 +52,10 @@ public class AppActServiceImp implements AppActService { } @Override - public void newAppAct(JSONObject manager, AppActBean appActBean) { + public JSONObject newAppAct(JSONObject manager, AppActBean appActBean) { JSONObject params = appActBean.toJsonParam(); params.put("create_time",new Date()); actAppMapper.newAppAct(params); + return 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 2d85d3900..bd9d190b6 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 @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.activities.app_index.web; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; +import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; import au.com.royalpay.payment.manage.activities.monsettledelay.beans.MonDelayBean; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; @@ -20,8 +21,8 @@ public class AppActController { private AppActService appActService; @ManagerMapping(value = "/list",method = RequestMethod.GET,role = ManagerRole.SITE_MANAGER) - public JSONObject getAppActList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, AppActBean appActBean){ - PageList appActList = appActService.listAppActs(manager,appActBean); + public JSONObject getAppActList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, AppActQueryBean appActQueryBean){ + PageList appActList = appActService.listAppActs(manager,appActQueryBean); return PageListUtils.buildPageListResult(appActList); } @@ -31,8 +32,8 @@ public class AppActController { } @ManagerMapping(value = "/new",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) - public void newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){ - appActService.newAppAct(manager,appActBean); + public JSONObject newAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AppActBean appActBean){ + return appActService.newAppAct(manager,appActBean); } @ManagerMapping(value = "/{act_id}",method = RequestMethod.PUT,role = ManagerRole.SITE_MANAGER) public void updateAppAct(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String act_id,@RequestBody AppActBean appActBean){ diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java index 6c6cdbbe3..b3e23c836 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActAppMapper.java @@ -15,10 +15,10 @@ public interface ActAppMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") - List listActs (); + @AutoSql(type = SqlType.SELECT) - PageList listActs (PageBounds pagination); + PageList listAppActs (JSONObject params,PageBounds pagination); @AutoSql(type = SqlType.SELECT) JSONObject getActDetail(String act_id); diff --git a/src/main/ui/static/actapp/templates/act_app_detail.html b/src/main/ui/static/actapp/templates/act_app_detail.html index 5a2f9f7bd..265da8191 100644 --- a/src/main/ui/static/actapp/templates/act_app_detail.html +++ b/src/main/ui/static/actapp/templates/act_app_detail.html @@ -49,20 +49,20 @@ -
-