From 92646432d5492a6509b18c5a7534f4e2145a53e3 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Fri, 23 Mar 2018 09:59:04 +0800 Subject: [PATCH 1/9] fix --- src/db/modify.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/db/modify.sql b/src/db/modify.sql index 390efea1f..24121ae31 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -336,4 +336,10 @@ PRIMARY key(`id`) alter table act_app_list MODIFY column is_show_window tinyint(1) DEFAULT 0 COMMENT 'app是否弹框' -alter table sys_clients_contract add column confirm_time datetime DEFAULT null comment '合同确认时间'; \ No newline at end of file +alter table sys_clients_contract add column confirm_time datetime DEFAULT null comment '合同确认时间'; + + +alter table act_app_list + add show_place smallint(3) default '111' not null comment '1:app顶部 10:banner 100:列表' +; + From 7a7f7c23191bf17ee5c8f094dcdb43fb7f5505fd Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Fri, 23 Mar 2018 10:32:34 +0800 Subject: [PATCH 2/9] modify html --- .../app_index/beans/ActAppShowPlaceEnum.java | 23 +++++++++++ .../app_index/beans/AppActBean.java | 39 +++++++++++++++++++ .../core/impls/AppActServiceImp.java | 8 +++- .../actapp/templates/act_app_detail.html | 20 ++++++++++ .../static/actapp/templates/act_app_list.html | 4 +- 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java new file mode 100644 index 000000000..1624e71b3 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/ActAppShowPlaceEnum.java @@ -0,0 +1,23 @@ +package au.com.royalpay.payment.manage.activities.app_index.beans; + +/** + * Created by yuan on 2018/3/23. + */ +public enum ActAppShowPlaceEnum { + App(1), + Banner(10), + List(100); + private int place; + + private ActAppShowPlaceEnum(int placeValue) { + this.place = placeValue; + } + + public int getPlace() { + return this.place; + } + + public boolean hasPlace(int placeValue) { + return (this.place & placeValue) > 0; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java index 6ed065c33..e02e98e0f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/beans/AppActBean.java @@ -2,6 +2,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; @@ -30,6 +31,9 @@ public class AppActBean { 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(){ @@ -48,6 +52,17 @@ public class AppActBean { 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); @@ -210,4 +225,28 @@ public class AppActBean { 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 void setList(boolean list) { + this.list = list; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java index 741f07747..92f7a00cb 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/app_index/core/impls/AppActServiceImp.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.activities.app_index.core.impls; +import au.com.royalpay.payment.manage.activities.app_index.beans.ActAppShowPlaceEnum; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActBean; import au.com.royalpay.payment.manage.activities.app_index.beans.AppActQueryBean; import au.com.royalpay.payment.manage.activities.app_index.core.AppActService; @@ -42,7 +43,12 @@ public class AppActServiceImp implements AppActService { @Override public JSONObject getActDetail(JSONObject manager, String act_id) { - return actAppMapper.getActDetail(act_id); + JSONObject appAct = actAppMapper.getActDetail(act_id); + int show_place = appAct.getIntValue("show_place"); + appAct.put("app", ActAppShowPlaceEnum.App.hasPlace(show_place)); + appAct.put("banner", ActAppShowPlaceEnum.Banner.hasPlace(show_place)); + appAct.put("list", ActAppShowPlaceEnum.List.hasPlace(show_place)); + return appAct; } @Override diff --git a/src/main/ui/static/actapp/templates/act_app_detail.html b/src/main/ui/static/actapp/templates/act_app_detail.html index 9e38d9e32..5c2713757 100644 --- a/src/main/ui/static/actapp/templates/act_app_detail.html +++ b/src/main/ui/static/actapp/templates/act_app_detail.html @@ -138,6 +138,26 @@ +
+ +
+
+

+ + + +

+
+
+
+ +
diff --git a/src/main/ui/static/actapp/templates/act_app_list.html b/src/main/ui/static/actapp/templates/act_app_list.html index a73892d5c..ba75a94fb 100644 --- a/src/main/ui/static/actapp/templates/act_app_list.html +++ b/src/main/ui/static/actapp/templates/act_app_list.html @@ -49,8 +49,8 @@ - - + + From 7cb99fbc0c04c2bb3b8447fe4ab53a7f7a35c314 Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Fri, 23 Mar 2018 10:50:00 +0800 Subject: [PATCH 3/9] fix bug --- src/main/ui/static/templates/activity/mondelay/mondelay.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/templates/activity/mondelay/mondelay.css b/src/main/ui/static/templates/activity/mondelay/mondelay.css index 336638ac2..940f3d648 100644 --- a/src/main/ui/static/templates/activity/mondelay/mondelay.css +++ b/src/main/ui/static/templates/activity/mondelay/mondelay.css @@ -163,7 +163,7 @@ tbody tr:nth-child(odd){ } .shape4_position{ position: absolute; - left: 0px; + left: -10px; top: 460px; } .shape4_position img{ @@ -172,8 +172,8 @@ tbody tr:nth-child(odd){ } .shape5_position{ position: absolute; - right: 0px; - top: 550px; + right: -30px; + top: 620px; } .shape5_position img{ width: 95px; From 1efd1b604aa0c877cd03607d5ae88633d0f2079c Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Fri, 23 Mar 2018 14:26:02 +0800 Subject: [PATCH 4/9] fix --- .../signin/core/impls/SignInAccountServiceImpl.java | 2 +- .../templates/activity/mondelay/mondelay.html | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 15e17db04..0df335678 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -320,7 +320,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati "company_name", "address","business_name","business_structure", "abn","acn","company_phone","suburb","postcode","state","contact_person","contact_phone","contact_email", "short_name", "logo_url", "enable_refund", "enable_refund_auth", "retail_surcharge", "require_custinfo", "require_remark", "logo_thumbnail", "creator", "create_time", "approver", "approve_result", "approve_time", "timezone", - "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", "enable_bestpay","manual_settle"}; + "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", "enable_bestpay","manual_settle","skip_clearing"}; for (String col : columns) { simpleClient.put(col, client.get(col)); } diff --git a/src/main/resources/templates/activity/mondelay/mondelay.html b/src/main/resources/templates/activity/mondelay/mondelay.html index cdb725043..f84151330 100644 --- a/src/main/resources/templates/activity/mondelay/mondelay.html +++ b/src/main/resources/templates/activity/mondelay/mondelay.html @@ -35,15 +35,19 @@
  • 参与商户每周一即可获得营销补贴
  • - 营销补贴金额,以发放时账户余额为基数,折算年化比率不低于15%,最高20% + 营销补贴金额,以发放时账户余额为基数,折算年化比率不低于15%,最高20%,2000$封顶
  • - 每周一15:00~16:00(GMT+10时区)发放营销补贴至商户营销账户。 参与商户周一暂停清算,进行补贴的计算和发放,周二恢复原有规则。 + 每周一15:00~16:00(GMT+10时区)发放营销补贴至商户营销账户。 +
  • +
  • + 参与活动商户系统不再自动清算,商户可以根据自己的需要自行提现,提现完第二天会清算到商户银行账户。
  • 补贴活动周期:2018/3/20-2018/6/30
  • 商户自愿参加,可以随时取消(除周一外,周一为补贴的计算和发放日,在此期间无法进行报名和取消操作,17:00之后恢复报名和取消报名)
  • +
  • 商户一旦取消,则放弃活动补贴,第二天系统会恢复自动清算
  • 本活动最终解释权归RoyalPay所有
@@ -88,7 +92,7 @@
From e9308e0fc57ad64de11e43471815f6dd19e7f56a Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Fri, 23 Mar 2018 14:27:14 +0800 Subject: [PATCH 5/9] modify html --- .../templates/activity/mondelay/mondelay.html | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/src/main/resources/templates/activity/mondelay/mondelay.html b/src/main/resources/templates/activity/mondelay/mondelay.html index cdb725043..05cebe661 100644 --- a/src/main/resources/templates/activity/mondelay/mondelay.html +++ b/src/main/resources/templates/activity/mondelay/mondelay.html @@ -52,45 +52,45 @@ 敬请期待 -
- -
-
-
-
-

补贴金额记录

-
+
+ +
+
+
+
+

补贴金额记录

+
-
-
累计补贴金额
-
$
-
+
+
累计补贴金额
+
$
+
-
- - - - - - - - - - - - - -
时间补贴金额
>04-01 12:00$5.00
-
+
+ + + + + + + + + + + + + +
时间补贴金额
>04-01 12:00$5.00
-
- -
+
+
+ +
@@ -131,7 +131,7 @@ } else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_join_mondelay'}); } else if (/(Android)/i.test(navigator.userAgent)) { - android.appCmd('{\"type\":\"cmd_join_mondelay\",\"cancel_waring\":\"'+cancel_waring+'\"}'); + android.appCmd('{\"type\":\"cmd_join_mondelay\"}'); } else { } @@ -145,7 +145,8 @@ } else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { window.webkit.messageHandlers.appCmd.postMessage({type:'cmd_cancel_mondelay',cancel_waring:cancel_waring}); } else if (/(Android)/i.test(navigator.userAgent)) { - android.appCmd('{\"type\":\"cmd_cancel_mondelay\",\"cancel_waring\":\"'+cancel_waring+'\"}'); } else { + android.appCmd('{\"type\":\"cmd_cancel_mondelay\"}'); + } else { } From 24510cf6e6ca7184ee36739747632a6b37b79ef7 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Fri, 23 Mar 2018 14:27:48 +0800 Subject: [PATCH 6/9] tmp --- .../payment/TaskManualSettleMapper.java | 3 ++ .../mappers/payment/TransactionMapper.java | 2 + .../settlement/core/ManualSettleSupport.java | 2 + .../core/impls/ManualSettleSupportImpl.java | 26 ++++++++++++- .../manage/system/web/contractController.java | 18 +++++++-- .../payment/TaskManualSettleMapper.xml | 12 ++++++ .../mappers/payment/TransactionMapper.xml | 10 +++++ src/main/ui/static/sys/contract.js | 18 ++++++++- .../static/sys/templates/contract_sign.html | 5 ++- .../static/sys/templates/manual_settle.html | 38 +++++++++++++++++++ 10 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml create mode 100644 src/main/ui/static/sys/templates/manual_settle.html diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java index 735c80aea..4d000d3ae 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.java @@ -28,4 +28,7 @@ public interface TaskManualSettleMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject task); + + List getEveryLatestRecord(); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java index f6b91f73c..0f3269fff 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.java @@ -55,6 +55,8 @@ public interface TransactionMapper { double getClientUnClearedAmount(@Param("client_id") int clientId); + List getClientsUnClearedAmount(@Param("client_ids") List client_ids); + JSONObject getClientAmountAnalysis(JSONObject params); PageList listPreRefundClients(PageBounds pagination); diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java b/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java index 5033a4028..a9a94ef07 100644 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java +++ b/src/main/java/au/com/royalpay/payment/manage/settlement/core/ManualSettleSupport.java @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.settlement.core; import com.alibaba.fastjson.JSONObject; import java.util.Date; +import java.util.List; /** * Create by yixian at 2018-03-20 17:42 @@ -13,4 +14,5 @@ public interface ManualSettleSupport { JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData); + List listWithClearInfo(); } diff --git a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java index 3d34494e0..53d08a49b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/settlement/core/impls/ManualSettleSupportImpl.java @@ -11,16 +11,20 @@ import au.com.royalpay.payment.tools.locale.LocaleSupport; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; + import com.alibaba.fastjson.JSONObject; + import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import javax.annotation.Resource; + /** * Create by yixian at 2018-03-20 17:44 */ @@ -96,4 +100,24 @@ public class ManualSettleSupportImpl implements ManualSettleSupport { } return todayTask; } + + @Override + public List listWithClearInfo() { + List manuals = taskManualSettleMapper.getEveryLatestRecord(); + List client_ids = new ArrayList<>(manuals.size()); + manuals.parallelStream().forEach(p->{ + client_ids.add(p.getInteger("client_id")); + }); + List clientUnsettle = transactionMapper.getClientsUnClearedAmount(client_ids); + for (JSONObject manual : manuals) { + for (JSONObject settle : clientUnsettle) { + if (manual.getIntValue("client_id") == settle.getIntValue("client_id")) { + manual.put("unsettle", settle.getBigDecimal("clearing_amount")); + break; + } + } + } + + return manuals; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java b/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java index 2d688dfe8..14a7508e4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/web/contractController.java @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.system.web; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; +import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport; import au.com.royalpay.payment.manage.system.core.ClientContractService; import com.alibaba.fastjson.JSONObject; @@ -14,13 +15,24 @@ import java.util.List; import javax.annotation.Resource; @RestController -@RequestMapping(value = "/manage/contract") +@RequestMapping(value = "/manage/common/analysis") public class contractController { @Resource private ClientContractService clientContractService; + @Resource + private ManualSettleSupport manualSettleSupport; - @ManagerMapping(value = "/list",method = RequestMethod.GET) - public List list(){ + @ManagerMapping(value = "/contract/list", method = RequestMethod.GET) + public List contractList() { return clientContractService.list(); } + + @RequestMapping(value = "/manualSettle/list", method = RequestMethod.GET) + public List manualList() { + List asd = manualSettleSupport.listWithClearInfo(); + System.out.println(asd); + System.out.println(asd); + System.out.println(asd); + return manualSettleSupport.listWithClearInfo(); + } } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml new file mode 100644 index 000000000..e7ce30abf --- /dev/null +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 0ee0981d6..20ea3b938 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -173,6 +173,16 @@ WHERE clearing_status = 0 AND client_id = #{client_id} +