|
|
@ -1,12 +1,11 @@
|
|
|
|
package au.com.royalpay.payment.manage.activities.app_index.beans;
|
|
|
|
package au.com.royalpay.payment.manage.activities.app_index.beans;
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.xml.crypto.Data;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
|
@ -18,47 +17,37 @@ public class AppActBean {
|
|
|
|
private String act_name;
|
|
|
|
private String act_name;
|
|
|
|
private String act_url;
|
|
|
|
private String act_url;
|
|
|
|
private String params_json;
|
|
|
|
private String params_json;
|
|
|
|
private Boolean is_valid = true;
|
|
|
|
private boolean is_valid = true;
|
|
|
|
private String desc;
|
|
|
|
private String desc;
|
|
|
|
private String act_content;
|
|
|
|
private String act_content;
|
|
|
|
private String show_type;
|
|
|
|
private String show_type;
|
|
|
|
private Boolean is_show_window;
|
|
|
|
private boolean is_show_window;
|
|
|
|
private String act_img;
|
|
|
|
private String act_img;
|
|
|
|
private String window_img;
|
|
|
|
private String window_img;
|
|
|
|
private String active_date;
|
|
|
|
private String active_date;
|
|
|
|
private String expire_date;
|
|
|
|
private String expire_date;
|
|
|
|
private String banner_img;
|
|
|
|
private String banner_img;
|
|
|
|
|
|
|
|
private String msg_start_date;
|
|
|
|
|
|
|
|
private String msg_end_date;
|
|
|
|
|
|
|
|
private String msg_interval;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject toJsonParam(){
|
|
|
|
public JSONObject toJsonParam(){
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
if(StringUtils.isNotEmpty(act_name)){
|
|
|
|
|
|
|
|
params.put("act_name",act_name);
|
|
|
|
params.put("act_name",act_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(act_url)){
|
|
|
|
|
|
|
|
params.put("act_url",act_url);
|
|
|
|
params.put("act_url",act_url);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(params_json)){
|
|
|
|
|
|
|
|
params.put("params_json",params_json);
|
|
|
|
params.put("params_json",params_json);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(desc)){
|
|
|
|
|
|
|
|
params.put("desc",desc);
|
|
|
|
params.put("desc",desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(act_content)){
|
|
|
|
|
|
|
|
params.put("act_content",act_content);
|
|
|
|
params.put("act_content",act_content);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(show_type)){
|
|
|
|
|
|
|
|
params.put("show_type",show_type);
|
|
|
|
params.put("show_type",show_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(act_img)){
|
|
|
|
|
|
|
|
params.put("act_img",act_img);
|
|
|
|
params.put("act_img",act_img);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(window_img)){
|
|
|
|
|
|
|
|
params.put("window_img",window_img);
|
|
|
|
params.put("window_img",window_img);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(banner_img)){
|
|
|
|
|
|
|
|
params.put("banner_img",banner_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);
|
|
|
|
if (active_date != null) {
|
|
|
|
if (active_date != null) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS);
|
|
|
|
Date fromDate = DateUtils.parseDate(active_date, DATE_PATTERNS);
|
|
|
@ -75,8 +64,22 @@ public class AppActBean {
|
|
|
|
throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format");
|
|
|
|
throw new ParamInvalidException("expire_date", "error.payment.valid.invalid_date_format");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
params.put("is_show_window",is_show_window);
|
|
|
|
if (msg_start_date != null) {
|
|
|
|
params.put("is_valid",is_valid);
|
|
|
|
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;
|
|
|
|
return params;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -183,4 +186,28 @@ public class AppActBean {
|
|
|
|
public void setBanner_img(String banner_img) {
|
|
|
|
public void setBanner_img(String banner_img) {
|
|
|
|
this.banner_img = 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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|