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/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index dab9557d1..62364635e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -70,6 +70,7 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; +import com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; @@ -413,7 +414,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) { throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); } - clientMapper.save(partner); + try { + clientMapper.save(partner); + } catch (Exception e) { + throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); + } if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { JSONObject client_bd = new JSONObject(); @@ -2721,7 +2726,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private TemplateMessage initSendToComplianceGreenChannelTemplate(String loginUrl, String wxopenid, String templateId2, String bd_user_name, - JSONObject client) { + JSONObject client) { TemplateMessage msg = new TemplateMessage(wxopenid, templateId2, loginUrl); msg.put("first", bd_user_name + " 提交了新商户绿色通道申请,请审核", "#ff0000"); msg.put("keyword1", client.getString("client_moniker") + "申请绿色通道", "#0000ff"); @@ -2784,8 +2789,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid String wxopenid = compliance.getString("wx_openid"); try { MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), "BD申请制作合同" + client_moniker, bd_user_name, "制作合同申请", - "BD申请制作" + short_name + "的合同"); + TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), "BD申请制作合同" + client_moniker, + bd_user_name, "制作合同申请", "BD申请制作" + short_name + "的合同"); paymentApi.sendTemplateMessage(msg); } catch (WechatException e) { logger.error("Wechat Message Error,open_status=1" + e.getMessage()); @@ -2802,8 +2807,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (wxopenid != null) { try { MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合同制作完成", "Compliance", "合规材料", - "上传完整合规材料,商户:" + short_name); + TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合同制作完成", + "Compliance", "合规材料", "上传完整合规材料,商户:" + short_name); paymentApi.sendTemplateMessage(msg); } catch (WechatException e) { logger.error("Wechat Message Error,open_status=3" + e.getMessage()); @@ -2822,8 +2827,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid String wxopenid = compliance.getString("wx_openid"); try { MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合规材料已提交", bd_user_name, "审核材料", - "BD已提交合规材料,等待审核"); + TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "合规材料已提交", + bd_user_name, "审核材料", "BD已提交合规材料,等待审核"); paymentApi.sendTemplateMessage(msg); } catch (WechatException e) { logger.error("Wechat Message Error,open_status=1" + e.getMessage()); @@ -2858,8 +2863,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid String wxopenid = compliance.getString("wx_openid"); try { MpWechatApi paymentApi = mpWechatApiProvider.getNewPaymentApi(); - TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "申请绿色通道", bd_user_name, "绿色通道申请", - "BD已提交绿色通道申请,商户:" + short_name); + TemplateMessage msg = initSendCommissionTemplate(wxopenid, paymentApi.getTemplateId("commission"), client_moniker + "申请绿色通道", + bd_user_name, "绿色通道申请", "BD已提交绿色通道申请,商户:" + short_name); paymentApi.sendTemplateMessage(msg); } catch (WechatException e) { logger.error("Wechat Message Error,open_status=10"); diff --git a/src/main/java/au/com/royalpay/payment/manage/task/CleanNoticeTaskManager.java b/src/main/java/au/com/royalpay/payment/manage/task/CleanNoticeTaskManager.java new file mode 100644 index 000000000..0395ec505 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/task/CleanNoticeTaskManager.java @@ -0,0 +1,24 @@ +package au.com.royalpay.payment.manage.task; + +import au.com.royalpay.payment.manage.management.clearing.core.CleanService; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * Created by yishuqian on 06/06/2017. + */ +@Component +@ConditionalOnProperty(value = "app.run-tasks",havingValue = "true") +public class CleanNoticeTaskManager { + + @Resource + private CleanService cleanService; + + @Scheduled(cron = "0 0 15 * * ?") + public void sendCleanNotice(){ + cleanService.getTodaySettlementLogs(); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java index b7c2e2fe1..6a77fe285 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/refund/impls/RefundServiceImpl.java @@ -183,7 +183,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish BigDecimal realAmount = original ? fee : CurrencyAmountUtils.toAmount(fee, order.getString("currency")); JSONObject refundConfig = checkRefundAuditFlag(); - if (refundConfig != null && refundConfig.size() > 0 && refundConfig.getBoolean("refundAudit")) { + if (partnerAccount!=null && refundConfig != null && refundConfig.size() > 0 && refundConfig.getBoolean("refundAudit")) { if (realAmount.compareTo(refundConfig.getBigDecimal("refundAuditAmount")) > 0) { //订单需要审核 boolean casherRefund = reviewNewRefundOrder(orderId, realAmount, remark, partnerAccount, manager); 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/resources/templates/activity/one_dollar_day/merchant_detail.html b/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html index 8bd064772..ce1e7710f 100644 --- a/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html +++ b/src/main/resources/templates/activity/one_dollar_day/merchant_detail.html @@ -30,21 +30,21 @@
-
+
-
+
-
+
diff --git a/src/main/resources/templates/mail/register_application.html b/src/main/resources/templates/mail/register_application.html deleted file mode 100644 index f0f14b3a5..000000000 --- a/src/main/resources/templates/mail/register_application.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/mail/reset_password.html b/src/main/resources/templates/mail/reset_password.html index 4a0aa5e7d..cbc7bc56d 100644 --- a/src/main/resources/templates/mail/reset_password.html +++ b/src/main/resources/templates/mail/reset_password.html @@ -34,11 +34,10 @@ - #foreach($item in $accounts)
- , Reset Password + , Reset Password
diff --git a/src/main/resources/templates/reports/week_report.html b/src/main/resources/templates/reports/week_report.html index 41c182525..e3bcd0070 100644 --- a/src/main/resources/templates/reports/week_report.html +++ b/src/main/resources/templates/reports/week_report.html @@ -123,7 +123,7 @@ th:if="${report.transaction_report.melbourne.thisweek.compare.direction<0}" th:text="'↓'+${report.transaction_report.melbourne.thisweek.compare.value}"> $report.transaction_report.melbourne.thisweek.compare.value + th:text="${report.transaction_report.melbourne.thisweek.compare.value}">
@@ -172,7 +172,7 @@ th:if="${report.transaction_report.sydney.thisweek.compare.direction<0}" th:text="'↓'+${$report.transaction_report.sydney.thisweek.compare.value}"> $report.transaction_report.sydney.thisweek.compare.value + th:text="${$report.transaction_report.sydney.thisweek.compare.value}"> @@ -226,89 +226,49 @@ - ##
- ##
新增商户情况(Melbourne)
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ##
新增总数
- ##
- ##
- ##
- ##
- ## - ##
- ##
新增商户情况(Sydney)
- ##
- ##
- ##
- ##
- ##
- ##
- ##
- ## #end - ##
- ##
- ##
- ##
- ##
- ##
新增总数
- ##
- ##
- ##
- ##
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}} +