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:列表' +; + 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/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java index cabb285fe..c1f0d44c1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/activities/monsettledelay/core/impls/ActMonDelaySettleServiceImp.java @@ -74,9 +74,9 @@ public class ActMonDelaySettleServiceImp implements ActMonDelaySettleService { List clientLogs = actMonDelaySettleMapper.clientLog(client_id); JSONObject res = new JSONObject(); res.put("operation_pause",false); - Boolean apply = true; - if (clientLogs.isEmpty()) { - apply = false; + Boolean apply = false; + if (!clientLogs.isEmpty()) { + apply = true; res.put("cancel_waring",messageSource.getMessage("sys.mondelay.cancel.waring", null, RequestEnvironment.getLocale())); } if (new Date().compareTo(act.getDate("active_date")) < 0) { 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 100f1b060..910343d73 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 2c5b2a05e..a254f2fd3 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 9f89c83db..52835e68f 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 @@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; @@ -122,4 +123,24 @@ public class ManualSettleSupportImpl implements ManualSettleSupport { } return end; } + + @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/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/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..5d1362c3e 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,20 @@ 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(); } + + @ManagerMapping(value = "/manualSettle/list", method = RequestMethod.GET) + public List manualList() { + 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 d2215f2a0..a5969ea3a 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} + App + + + +

+ + + + +
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 @@ - - + + diff --git a/src/main/ui/static/sys/contract.js b/src/main/ui/static/sys/contract.js index 76425cae3..f1cbcb5fd 100644 --- a/src/main/ui/static/sys/contract.js +++ b/src/main/ui/static/sys/contract.js @@ -1,5 +1,5 @@ /** - * Created by yishuqian on 01/06/2017. + * Created by kira on 01/06/2017. */ define(['angular'], function (angular) { 'use strict'; @@ -13,17 +13,20 @@ define(['angular'], function (angular) { url: '/rate_warnings', templateUrl: '/static/analysis/templates/settle_warnings.html', controller: 'settleWarningsCtrl' + }).state('manual_settle', { + url: '/manual_settle', + templateUrl: '/static/sys/templates/manual_settle.html', + controller: 'manualSettleCtrl' }) }]); app.controller('contractAnalysisCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) { $scope.getContractAnalysis = function () { - $http.get('/manage/contract/list').then(function (resp) { + $http.get('/manage/common/analysis/contract/list').then(function (resp) { $scope.contract_analysis = resp.data; }); }; $scope.getContractAnalysis(); }]); - app.controller('settleWarningsCtrl', ['$scope', '$http', '$filter', 'commonDialog', function ($scope, $http, $filter, commonDialog) { $scope.loadWarnings = function () { $http.get('/manage/clearing/rate_warnings').then(function (resp) { @@ -50,5 +53,14 @@ define(['angular'], function (angular) { } }]); + app.controller('manualSettleCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) { + $scope.getManualSettleAnalysis = function () { + $http.get('/manage/common/analysis/manualSettle/list').then(function (resp) { + $scope.manual_settle_analysis = resp.data; + }); + }; + $scope.getManualSettleAnalysis(); + }]); + return app; }); \ No newline at end of file diff --git a/src/main/ui/static/sys/templates/contract_sign.html b/src/main/ui/static/sys/templates/contract_sign.html index ea28a6db7..043991313 100644 --- a/src/main/ui/static/sys/templates/contract_sign.html +++ b/src/main/ui/static/sys/templates/contract_sign.html @@ -4,9 +4,12 @@
  • Contract
  • -
  • +
  • Rate Warings
  • +
  • + Manual Settle +