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..1779af0b5 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 @@ -94,7 +94,7 @@ public interface RetailAppService { void drawDeposits(JSONObject device, BigDecimal draw_amount, String client_id); - JSONObject getCashbackCleanInfo(JSONObject device); + JSONObject getCashbackCleanInfo(JSONObject device,String client_id); void sendMassageByCode(JSONObject params); @@ -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..a8655bcf2 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; @@ -1049,13 +1050,17 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public JSONObject getCashbackCleanInfo(JSONObject device) { + public JSONObject getCashbackCleanInfo(JSONObject device,String client_id) { String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); - JSONObject res = clientManager.getBankAccountByClientId(device.getIntValue("client_id")); - JSONObject rate = merchantInfoProvider.clientCurrentRate(device.getIntValue("client_id"), new Date(), "Wechat"); + JSONArray clientIds = clientManager.getAllClientIds(device.getIntValue("client_id")); + if (!clientIds.contains(client_id)) { + throw new ForbiddenException("partner has no permission"); + } + JSONObject res = clientManager.getBankAccountByClientId(Integer.parseInt(client_id)); + JSONObject rate = merchantInfoProvider.clientCurrentRate(Integer.parseInt(client_id), new Date(), "Wechat"); if (rate.getInteger("clean_days") == null) { - JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); + JSONObject client = clientManager.getClientInfo(Integer.parseInt(client_id)); rate.put("clean_days", client.getIntValue("clean_days")); } res.put("clean_days", rate.getIntValue("clean_days")); @@ -1168,6 +1173,20 @@ 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"); + if (acts.size()>0){ + int selectNo = RandomUtils.nextInt(0,acts.size()); + return acts.getJSONObject(selectNo); + } + return null; + + } + 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..bb679fd4a 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 @@ -236,8 +236,11 @@ public class RetailAppController { } @RequestMapping(value = "/cash_back/clean_info", method = RequestMethod.GET) - public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - return retailAppService.getCashbackCleanInfo(device); + public JSONObject getCashbackCleanInfo(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam(value = "client_id",required = false) String client_id) { + if (client_id==null){ + client_id=device.getString("client_id"); + } + return retailAppService.getCashbackCleanInfo(device,client_id); } @RequestMapping(value = "/partner_signin_app_qrcode/{codeId}", method = RequestMethod.GET) @@ -264,4 +267,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/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java index fdc9655a2..2412014b7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/CouponValidateService.java @@ -13,4 +13,6 @@ public interface CouponValidateService { //使用后核销券 boolean useCoupon(String couponLogId); + + JSONObject getPaymentManager(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java index 0c771bc18..1e1e5d3e8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.customers.core.impls; import au.com.royalpay.payment.manage.customers.core.CouponValidateService; +import au.com.royalpay.payment.manage.mappers.customers.CustomerMembershipMapper; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import cn.yixblog.platform.http.HttpRequestGenerator; import cn.yixblog.platform.http.HttpRequestResult; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.util.UriComponentsBuilder; +import javax.annotation.Resource; import java.util.Date; @@ -34,6 +36,9 @@ public class CouponValidateServiceImpl implements CouponValidateService { @Value("${customer.app.auth-code}") private String CUSTOMER_AUTH_CODE; + @Resource + private CustomerMembershipMapper customerMembershipMapper; + @Override public JSONObject getCoupon(JSONObject partner,int page,int limit) { String timestamp = System.currentTimeMillis() + ""; @@ -133,4 +138,11 @@ public class CouponValidateServiceImpl implements CouponValidateService { } return false; } + + @Override + public JSONObject getPaymentManager() { + JSONObject object = new JSONObject(); + object.put("managers",customerMembershipMapper.listPaymentManagerByCus()); + return object; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java b/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java new file mode 100644 index 000000000..ed35b736e --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/customers/web/PaymentManagerController.java @@ -0,0 +1,28 @@ +package au.com.royalpay.payment.manage.customers.web; + +import au.com.royalpay.payment.manage.apps.AppController; +import au.com.royalpay.payment.manage.customers.core.CouponValidateService; +import com.alibaba.fastjson.JSONObject; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; + +/** + * Created by yuan on 2017/12/27. + */ +@RequestMapping(value = "/manager") +@AppController +public class PaymentManagerController { + + @Resource + private CouponValidateService couponVerificationService; + + @GetMapping(value = "/get_payment_manage") + public JSONObject getPaymentManager(){ + JSONObject json = couponVerificationService.getPaymentManager(); + return json; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java index 916874d6a..d9324c5db 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.java @@ -35,4 +35,6 @@ public interface CustomerMembershipMapper { List listEncourageBalanceHistory(@Param("fromDate") Date fromDate, @Param("toDate") Date toDate, @Param("memberId") String memberId); BigDecimal sumEncourageBalance(); + + List listPaymentManagerByCus(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml index 6de252776..28127795d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/customers/CustomerMembershipMapper.xml @@ -49,4 +49,11 @@ + + \ No newline at end of file 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为空的时,若有外链则点击图片进行跳转)

diff --git a/src/main/ui/static/cms/templates/cms_root.html b/src/main/ui/static/cms/templates/cms_root.html index 19e28404e..aed11b63e 100644 --- a/src/main/ui/static/cms/templates/cms_root.html +++ b/src/main/ui/static/cms/templates/cms_root.html @@ -23,6 +23,9 @@ + diff --git a/src/main/ui/static/payment/partner/templates/partner_accounts.html b/src/main/ui/static/payment/partner/templates/partner_accounts.html index 9c0d1d294..0e357f12d 100644 --- a/src/main/ui/static/payment/partner/templates/partner_accounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_accounts.html @@ -16,6 +16,7 @@ Username Display Name + OpenId Role Create Time Operation @@ -25,6 +26,10 @@ + + + {{account.wechat_openid}} + diff --git a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js index 45a20112b..7e7290d52 100644 --- a/src/main/ui/static/templates/alipay/v1/retail_jsapi.js +++ b/src/main/ui/static/templates/alipay/v1/retail_jsapi.js @@ -28,9 +28,6 @@ $(document).ready(function () { method: 'GET', dataType: 'json', success: function (pay) { - if (window.client_moniker=='PINE'){ - alert('pay json:'+JSON.stringify(pay)); - } if (pay.direct_paid) { location.href = window.redirect; return; @@ -48,9 +45,6 @@ $(document).ready(function () { tradeNO: pay.trade_no }, function (res) { dataCache.paying = false; - if (window.client_moniker=='PINE'){ - alert('callback:'+JSON.stringify(res)); - } if (res.resultCode == '9000') { AlipayJSBridge.call('startApp', { appId: '20000056',