master
yuan 7 years ago
parent fbdb61e884
commit d30c1b7312

@ -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;
}

@ -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;
}
}

@ -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<JSONObject> listAppActs();
void newAppAct(JSONObject manager, AppActBean appActBean);
JSONObject newAppAct(JSONObject manager, AppActBean appActBean);
PageList<JSONObject> listAppActs(JSONObject manager, AppActBean appActBean);
PageList<JSONObject> listAppActs(JSONObject manager, AppActQueryBean appActQueryBean);
JSONObject getActDetail(JSONObject manager,String act_id);

@ -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<JSONObject> listAppActs(JSONObject manager, AppActBean appActBean){
// List<JSONObject> 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<JSONObject> 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;
}
}

@ -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<JSONObject> appActList = appActService.listAppActs(manager,appActBean);
public JSONObject getAppActList(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, AppActQueryBean appActQueryBean){
PageList<JSONObject> 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){

@ -15,10 +15,10 @@ public interface ActAppMapper {
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid=1")
List<JSONObject> listActs ();
@AutoSql(type = SqlType.SELECT)
PageList<JSONObject> listActs (PageBounds pagination);
PageList<JSONObject> listAppActs (JSONObject params,PageBounds pagination);
@AutoSql(type = SqlType.SELECT)
JSONObject getActDetail(String act_id);

@ -49,20 +49,20 @@
<input type="checkbox" class="checkbox-inline checkbox" ng-model="actDetail.is_show_window">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_img">Act
<div class="form-group" ng-if="actDetail.is_show_window">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.window_img">Window
Img</label>
<div class="col-xs-8 col-sm-4">
<input type="text" class="form-control" id="actDetail.act_img"
ng-model="actDetail.act_img">
<input type="text" class="form-control" id="actDetail.window_img"
ng-model="actDetail.window_img">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-4 col-sm-2" for="actDetail.window_img">Window
<label class="control-label col-xs-4 col-sm-2" for="actDetail.act_img">Act
Img</label>
<div class="col-xs-8 col-sm-4">
<input type="text" class="form-control" id="actDetail.window_img"
ng-model="actDetail.window_img">
<input type="text" class="form-control" id="actDetail.act_img"
ng-model="actDetail.act_img">
</div>
</div>

@ -20,7 +20,7 @@
<button class="btn btn-success" type="button" ui-sref=".new"><i class="fa fa-plus"></i> New ACT</button>
<div class="checkbox">
<label>
<input type="checkbox">Published
<input type="checkbox" ng-click="loadActAppList()" ng-model="params.is_valid">Published
</label>
</div>
</div>

Loading…
Cancel
Save