|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.activities.app_index.beans;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
@ -17,52 +14,20 @@ public class AppActBean {
|
|
|
|
|
private static final String[] DATE_PATTERNS = {"yyyy-MM-dd"};
|
|
|
|
|
private String act_name;
|
|
|
|
|
private String act_url;
|
|
|
|
|
private String params_json;
|
|
|
|
|
private boolean is_valid = true;
|
|
|
|
|
private String desc;
|
|
|
|
|
private String act_content;
|
|
|
|
|
private String show_type;
|
|
|
|
|
private boolean is_show_window;
|
|
|
|
|
private String act_img;
|
|
|
|
|
private String window_img;
|
|
|
|
|
private String active_date;
|
|
|
|
|
private String expire_date;
|
|
|
|
|
private String banner_img;
|
|
|
|
|
private String msg_start_date;
|
|
|
|
|
private String msg_end_date;
|
|
|
|
|
private String msg_interval;
|
|
|
|
|
private boolean app;
|
|
|
|
|
private boolean banner;
|
|
|
|
|
private boolean list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject toJsonParam(){
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("act_name",act_name);
|
|
|
|
|
params.put("act_url",act_url);
|
|
|
|
|
params.put("params_json",params_json);
|
|
|
|
|
params.put("desc",desc);
|
|
|
|
|
params.put("act_content",act_content);
|
|
|
|
|
params.put("show_type",show_type);
|
|
|
|
|
params.put("act_img",act_img);
|
|
|
|
|
params.put("window_img",window_img);
|
|
|
|
|
params.put("banner_img",banner_img);
|
|
|
|
|
params.put("msg_interval",msg_interval);
|
|
|
|
|
params.put("is_show_window",is_show_window);
|
|
|
|
|
params.put("is_valid",is_valid);
|
|
|
|
|
params.put("msg_start_date", msg_start_date);
|
|
|
|
|
params.put("msg_end_date", msg_end_date);
|
|
|
|
|
int show_place = 0;
|
|
|
|
|
if (app) {
|
|
|
|
|
show_place |= ActAppShowPlaceEnum.App.getPlace();
|
|
|
|
|
}
|
|
|
|
|
if (banner) {
|
|
|
|
|
show_place |= ActAppShowPlaceEnum.Banner.getPlace();
|
|
|
|
|
}
|
|
|
|
|
if (list) {
|
|
|
|
|
show_place |= ActAppShowPlaceEnum.List.getPlace();
|
|
|
|
|
}
|
|
|
|
|
params.put("show_place", show_place);
|
|
|
|
|
if (active_date != null) {
|
|
|
|
|
try {
|
|
|
|
|
Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS);
|
|
|
|
@ -79,22 +44,6 @@ public class AppActBean {
|
|
|
|
|
throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (msg_start_date != null) {
|
|
|
|
|
try {
|
|
|
|
|
Date fromDate = DateUtils.parseDate(msg_start_date, DATE_PATTERNS);
|
|
|
|
|
params.put("msg_start_date", fromDate);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("msg_start_date", "error.payment.valid.invalid_date_format");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (msg_end_date != null) {
|
|
|
|
|
try {
|
|
|
|
|
Date fromDate = DateUtils.parseDate(msg_end_date, DATE_PATTERNS);
|
|
|
|
|
params.put("msg_end_date", fromDate);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new ParamInvalidException("msg_end_date", "error.payment.valid.invalid_date_format");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return params;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -114,30 +63,6 @@ public class AppActBean {
|
|
|
|
|
this.act_url = act_url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getParams_json() {
|
|
|
|
|
return params_json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setParams_json(String params_json) {
|
|
|
|
|
this.params_json = params_json;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDesc() {
|
|
|
|
|
return desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDesc(String desc) {
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getAct_content() {
|
|
|
|
|
return act_content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setAct_content(String act_content) {
|
|
|
|
|
this.act_content = act_content;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getAct_img() {
|
|
|
|
|
return act_img;
|
|
|
|
|
}
|
|
|
|
@ -146,14 +71,6 @@ public class AppActBean {
|
|
|
|
|
this.act_img = act_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getWindow_img() {
|
|
|
|
|
return window_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setWindow_img(String window_img) {
|
|
|
|
|
this.window_img = window_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getShow_type() {
|
|
|
|
|
return show_type;
|
|
|
|
|
}
|
|
|
|
@ -162,14 +79,6 @@ public class AppActBean {
|
|
|
|
|
this.show_type = show_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean getIs_show_window() {
|
|
|
|
|
return is_show_window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setIs_show_window(Boolean is_show_window) {
|
|
|
|
|
this.is_show_window = is_show_window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean getIs_valid() {
|
|
|
|
|
return is_valid;
|
|
|
|
|
}
|
|
|
|
@ -194,59 +103,11 @@ public class AppActBean {
|
|
|
|
|
this.expire_date = expire_date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getBanner_img() {
|
|
|
|
|
return banner_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setBanner_img(String banner_img) {
|
|
|
|
|
this.banner_img = banner_img;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getMsg_start_date() {
|
|
|
|
|
return msg_start_date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setMsg_start_date(String msg_start_date) {
|
|
|
|
|
this.msg_start_date = msg_start_date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getMsg_end_date() {
|
|
|
|
|
return msg_end_date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setMsg_end_date(String msg_end_date) {
|
|
|
|
|
this.msg_end_date = msg_end_date;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getMsg_interval() {
|
|
|
|
|
return msg_interval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setMsg_interval(String msg_interval) {
|
|
|
|
|
this.msg_interval = msg_interval;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isApp() {
|
|
|
|
|
return app;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setApp(boolean app) {
|
|
|
|
|
this.app = app;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isBanner() {
|
|
|
|
|
return banner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setBanner(boolean banner) {
|
|
|
|
|
this.banner = banner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isList() {
|
|
|
|
|
return list;
|
|
|
|
|
public boolean isIs_valid() {
|
|
|
|
|
return is_valid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setList(boolean list) {
|
|
|
|
|
this.list = list;
|
|
|
|
|
public void setIs_valid(boolean is_valid) {
|
|
|
|
|
this.is_valid = is_valid;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|