diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index 284d9df58..b97328977 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -105,4 +105,6 @@ public interface RetailAppService { JSONObject getCouponById(JSONObject device, String coupon_log_id); void useCoupon(JSONObject device, String coupon_log_id); + + JSONObject getAd(JSONObject device); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 73585a729..95bc0f3ae 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -43,6 +43,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.notnoop.apns.APNS; import com.notnoop.apns.ApnsService; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; @@ -1168,6 +1169,16 @@ public class RetailAppServiceImp implements RetailAppService { couponVerificationService.useCoupon(coupon_log_id); } + @Override + public JSONObject getAd(JSONObject device) { + String clientType = device.getString("client_type"); + deviceSupport.findRegister(clientType); + JSONObject res = royalPayCMSSupport.listArticles("app_ad", false, true, 1, 10); + JSONArray acts = res.getJSONArray("data"); + int selectNo = RandomUtils.nextInt(0,acts.size()); + return acts.getJSONObject(selectNo); + } + private static boolean mathchLetterorNum(String str) { String regex = "[A-Za-z0-9]{8}"; return str.matches(regex); diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index bb333ca68..c7a8932b1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -264,4 +264,12 @@ public class RetailAppController { } /*优惠券End*/ + + /** + * 广告位 + */ + @RequestMapping(value = "/ads", method = RequestMethod.GET) + public JSONObject getActivities(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { + return retailAppService.getAd(device); + } } diff --git a/src/main/resources/jasper/austrac_report.jasper b/src/main/resources/jasper/austrac_report.jasper index bc48e6dab..a0b55d6c7 100644 Binary files a/src/main/resources/jasper/austrac_report.jasper and b/src/main/resources/jasper/austrac_report.jasper differ diff --git a/src/main/resources/jasper/austrac_report20171228.jasper b/src/main/resources/jasper/austrac_report20171228.jasper new file mode 100644 index 000000000..bc48e6dab Binary files /dev/null and b/src/main/resources/jasper/austrac_report20171228.jasper differ diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 38669dc6b..bfb47f39c 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -20,20 +20,24 @@
(0:不允许跳转 1:允许跳转)
(需要展示在首页时填写,反之请输0)
+(图片尽量要小,控制在500k以内,否则会影响APP页面加载速度)
(若有外链,则填,否则留空。在Content为空的时,若有外链则点击图片进行跳转)