diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java index 5b92ba4af..dc67aed73 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/AnalysisBean.java @@ -36,6 +36,7 @@ public class AnalysisBean { private String amount_from; private String amount_to; private String bd_name; + private String timezone; public JSONObject toParams(String timezone) { JSONObject params = new JSONObject(); if (timezone != null) { @@ -229,4 +230,12 @@ public class AnalysisBean { public void setBd_name(String bd_name) { this.bd_name = bd_name; } + + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java index 0daf33a47..439a252e3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/DashboardController.java @@ -31,7 +31,7 @@ public class DashboardController { @ManagerMapping("/common_analysis_1") public JSONObject commonAnalysis1(AnalysisBean analysis, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - JSONObject params = analysis.toParams(null); + JSONObject params = analysis.toParams(analysis.getTimezone()); orgManager.checkOrg(manager,params); return dashboardService.getCommonAnalysis1(params); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsAMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java similarity index 55% rename from src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsAMapper.java rename to src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java index 46f817c70..c3a578914 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsAMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/risk/RiskAttentionMerchantsMapper.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.mappers.risk; +import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; @@ -7,12 +8,15 @@ import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * Create by yixian at 2017-12-21 11:45 */ @AutoMapper(tablename = "risk_attention_merchants", pkName = "client_id") -public interface RiskAttentionMerchantsAMapper { +public interface RiskAttentionMerchantsMapper { @AutoSql(type = SqlType.UPDATE) void update(JSONObject client); @@ -23,9 +27,18 @@ public interface RiskAttentionMerchantsAMapper { JSONObject findById(@Param("id") String id); @AutoSql(type = SqlType.SELECT) - JSONObject findByClientMoniker(@Param("client_moniker") String client_moniker); + JSONObject findByClientMoniker(@Param("client_moniker") String clientMoniker); @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1") PageList query(JSONObject params, PageBounds pagination); + @Select("SELECT client_moniker FROM risk_attention_merchants " + + "WHERE (abn LIKE CONCAT('%',#{abn},'%') ) OR (acn LIKE CONCAT('%',#{acn},'%') ) " + + " OR (contact_phone LIKE CONCAT('%',#{contact_phone},'%') ) " + + " OR (contact_person LIKE CONCAT('%',#{contact_person},'%') ) " + + " OR (client_moniker LIKE CONCAT('%',#{client_moniker},'%') ) " + + " OR (bank_account_no LIKE CONCAT('%',#{bank_account_no},'%') ) ") + List listRiskySimilarMerchants(JSONObject params); + } 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 d7d1bf3eb..e5cb2d332 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 @@ -32,6 +32,7 @@ import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.RandomStringUtils; @@ -294,6 +295,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private PermissionClientModuleMapper permissionClientModuleMapper; @Resource private PermissionPartnerManagerImpl permissionPartnerManagerImpl; + @Resource + private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper; + @Resource private SmsSender smsSender; private static final String SOURCE_AGREE_FILE = "source_agree_file"; @@ -589,6 +593,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) { throw new BadRequestException("error.partner.valid.dumplicate_client_moniker"); } + //检查商户是否进入系统黑名单 + isRiskyMerchant(partner, null); + try { clientMapper.save(partner); @@ -814,6 +821,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } + //检查商户是否进入平台黑名单 + int clientId = client.getIntValue("client_id"); + isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0)); + if (client.getString("sub_merchant_id") == null || client.getString("sub_merchant_id").equals("")) { throw new BadRequestException("该商户未设置微信 Sub Merchant ID!"); } @@ -856,6 +867,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } + //检查商户是否进入平台黑名单 + int clientId = client.getIntValue("client_id"); + isRiskyMerchant(client, clientBankAccountMapper.clientBankAccounts(clientId).get(0)); + client.put("approve_result", 2); client.put("approver", manager.getString("manager_id")); client.put("approve_time", new Date()); @@ -3743,10 +3758,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public String getShortLink(String client_moniker) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + client_moniker + "/jump"); + public String getShortLink(String clientMoniker) { + String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + clientMoniker + "/jump"); MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); return api.registerShortUrl(longUrl); } + + private void isRiskyMerchant(JSONObject client, JSONObject bankAccount) { + JSONObject needCheckParams = new JSONObject(); + needCheckParams.put("client_moniker", client.getString("client_moniker")); + needCheckParams.put("abn", client.getString("abn")); + needCheckParams.put("acn", client.getString("acn")); + needCheckParams.put("contact_phone", client.getString("contact_phone")); + needCheckParams.put("contact_person", client.getString("contact_person")); + if (bankAccount != null) { + needCheckParams.put("bank_account_no", bankAccount.getString("account_no")); + } + List listRiskySimilarMerchants = riskAttentionMerchantsMapper.listRiskySimilarMerchants(needCheckParams); + StringBuilder appendStr = new StringBuilder(); + listRiskySimilarMerchants.stream().forEach(json -> appendStr.append(json.getString("client_moniker")).append(",")); + appendStr.deleteCharAt(appendStr.length() - 1); + if (listRiskySimilarMerchants.size() > 0) { + throw new BadRequestException("该商户信息已经进入系统黑名单,关联商户为【" + appendStr + "】"); + } + + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java b/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java index 895c501ec..1dd99cf10 100644 --- a/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java +++ b/src/main/java/au/com/royalpay/payment/manage/risk/core/RiskMerchantService.java @@ -8,29 +8,29 @@ public interface RiskMerchantService { void addDetailLog(AddRiskDetailLog addRiskDetailLog, JSONObject account); - void DropOrderRiskRecord(JSONObject account,String recordId); + void dropOrderRiskRecord(JSONObject account, String recordId); - void noopRiskRecord(JSONObject account,String recordId); + void noopRiskRecord(JSONObject account, String recordId); - void dealRiskRecord(JSONObject account,DealRiskRecord dealRiskRecord); + void dealRiskRecord(JSONObject account, DealRiskRecord dealRiskRecord); - void dealRiskRecordDirectly(JSONObject account,String record_id); + void dealRiskRecordDirectly(JSONObject account, String clientMoniker); JSONObject getRiskOrders(QueryRiskOrder queryRiskOrder); JSONObject getRiskRecords(QueryRiskRecord queryRiskRecord); - void addWhiteList(String client_moinker); + void addWhiteList(String clientMoniker); - void disableWhiteList(String client_moinker); + void disableWhiteList(String clientMoniker); - JSONObject getRecordById(String record_id); + JSONObject getRecordById(String recordId); JSONObject getRiskDetails(QueryRiskDetail queryRiskDetail); - JSONObject listAttentionMerchants(JSONObject account,QueryAttentionMerchants queryAttention); + JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention); - void addAttentionMerchants(JSONObject account,String client_moniker); + void addAttentionMerchant(JSONObject manager, String clientMoniker); - void updateAttentionMerchants(JSONObject account,String client_moniker); + void disableAttentionMerchant(JSONObject manager, String clientMoniker); } diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java index 0d9b3fdec..09188ab9f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/risk/core/impl/RiskMerchantServiceImpl.java @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.risk.core.impl; import au.com.royalpay.payment.manage.mappers.risk.*; +import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.risk.bean.*; import au.com.royalpay.payment.manage.risk.core.RiskMerchantService; @@ -17,6 +18,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; +import java.util.List; import javax.annotation.Resource; @@ -34,7 +36,9 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { @Resource private ClientManager clientManager; @Resource - private RiskAttentionMerchantsAMapper riskAttentionMerchantsAMapper; + private RiskAttentionMerchantsMapper riskAttentionMerchantsAMapper; + @Resource + private ClientBankAccountMapper clientBankAccountMapper; @Override @Transactional @@ -55,7 +59,7 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { @Override @Transactional - public void DropOrderRiskRecord(JSONObject account, String recordId) { + public void dropOrderRiskRecord(JSONObject account, String recordId) { JSONObject riskRecord = riskMerchantRecordMapper.findById(recordId); if (riskRecord == null) { throw new NotFoundException("Risk Record Not Found"); @@ -170,14 +174,14 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { } @Override - public void addWhiteList(String client_moinker) { - JSONObject white = riskWhiteListMapper.findByClientMoniker(client_moinker); + public void addWhiteList(String clientMoniker) { + JSONObject white = riskWhiteListMapper.findByClientMoniker(clientMoniker); if (white != null) { white.put("is_valid", true); riskWhiteListMapper.update(white); return; } - JSONObject client = clientManager.getClientInfoByMoniker(client_moinker); + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); if (client == null) { throw new NotFoundException("Merchant Not Found Please Check"); } @@ -189,8 +193,8 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { } @Override - public void disableWhiteList(String client_moinker) { - JSONObject white = riskWhiteListMapper.findByClientMoniker(client_moinker); + public void disableWhiteList(String clientMoniker) { + JSONObject white = riskWhiteListMapper.findByClientMoniker(clientMoniker); if (white == null) { throw new NotFoundException("White List Not Found Please Check"); } @@ -199,8 +203,8 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { } @Override - public JSONObject getRecordById(String record_id) { - return riskMerchantRecordMapper.findById(record_id); + public JSONObject getRecordById(String recordId) { + return riskMerchantRecordMapper.findById(recordId); } @Override @@ -211,53 +215,64 @@ public class RiskMerchantServiceImpl implements RiskMerchantService { } @Override - public JSONObject listAttentionMerchants(JSONObject account, QueryAttentionMerchants queryAttention) { - if (account == null) { - throw new BadRequestException("account not exists"); + public JSONObject listAttentionMerchants(JSONObject manager, QueryAttentionMerchants queryAttention) { + if (manager == null) { + throw new BadRequestException("登录状态已过期,请清新登录再试"); } return PageListUtils.buildPageListResult( - riskAttentionMerchantsAMapper.query(queryAttention.toParams(), new PageBounds(queryAttention.getPage(), queryAttention.getLimit(), Order.formString("create_time.desc")))); + riskAttentionMerchantsAMapper.query(queryAttention.toParams(), new PageBounds(queryAttention.getPage(), queryAttention.getLimit(), Order.formString("last_update_date.desc")))); } @Override - public void addAttentionMerchants(JSONObject account, String client_moniker) { - if (account == null) { - throw new BadRequestException("account not exists"); + public void addAttentionMerchant(JSONObject manager, String clientMoniker) { + if (manager == null) { + throw new BadRequestException("登录状态已过期,请清新登录再试"); + } + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new BadRequestException("The Merchant does not exist"); } - JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(client_moniker); - if(attentionMerchant != null){ - if(attentionMerchant.getBoolean("is_valid")){ + int clientId = client.getIntValue("client_id"); + List bankAccount = clientBankAccountMapper.clientBankAccounts(clientId); + JSONObject attention = new JSONObject(); + attention.put("client_id", clientId); + attention.put("client_moniker", clientMoniker); + attention.put("abn", client.getString("abn")); + attention.put("acn", client.getString("acn")); + attention.put("contact_person", client.getString("contact_person")); + attention.put("contact_phone", client.getString("contact_phone")); + attention.put("bank_account_no", bankAccount == null || bankAccount.size() <= 0 ? "" : bankAccount.get(0).getString("account_no")); + attention.put("is_valid", 1); + attention.put("creation_date", new Date()); + attention.put("creation_by", manager.getString("manager_id")); + attention.put("last_update_date", new Date()); + attention.put("last_update_by", manager.getString("manager_id")); + + JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(clientMoniker); + if (attentionMerchant != null) { + if (attentionMerchant.getBoolean("is_valid")) { throw new BadRequestException("The client has already existed"); - }else { - attentionMerchant.put("is_valid",1); - attentionMerchant.put("update_time",new Date()); - riskAttentionMerchantsAMapper.update(attentionMerchant); - return; } + attention.remove("creation_date"); + attention.remove("creation_by"); + riskAttentionMerchantsAMapper.update(attention); + return; } - JSONObject client = clientManager.getClientInfoByMoniker(client_moniker); - if(client == null){ - throw new BadRequestException("The client does not exist"); - } - JSONObject attention = new JSONObject(); - attention.put("client_id",client.getIntValue("client_id")); - attention.put("client_moniker",client.getString("client_moniker")); - attention.put("is_valid",1); - attention.put("create_time",new Date()); riskAttentionMerchantsAMapper.save(attention); } @Override - public void updateAttentionMerchants(JSONObject account, String client_moniker) { - if (account == null) { - throw new BadRequestException("account not exists"); + public void disableAttentionMerchant(JSONObject manager, String clientMoniker) { + if (manager == null) { + throw new BadRequestException("登录状态已过期,请清新登录再试"); } - JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(client_moniker); - if(attentionMerchant == null){ + JSONObject attentionMerchant = riskAttentionMerchantsAMapper.findByClientMoniker(clientMoniker); + if (attentionMerchant == null) { throw new BadRequestException("The client does not exist"); } - attentionMerchant.put("is_valid",0); - attentionMerchant.put("update_time",new Date()); + attentionMerchant.put("is_valid", 0); + attentionMerchant.put("last_update_date", new Date()); + attentionMerchant.put("last_update_by", manager.getString("manager_id")); riskAttentionMerchantsAMapper.update(attentionMerchant); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java b/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java index 651345395..ad01d7546 100644 --- a/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java +++ b/src/main/java/au/com/royalpay/payment/manage/risk/web/RiskController.java @@ -39,7 +39,7 @@ public class RiskController { @RequestMapping(value = "/records/{record_id}/dropOrder", method = RequestMethod.PUT) public void dropOrder(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String record_id) { - riskMerchantService.DropOrderRiskRecord(manager, record_id); + riskMerchantService.dropOrderRiskRecord(manager, record_id); } @RequestMapping(value = "/records/{record_id}/noop", method = RequestMethod.PUT) @@ -65,14 +65,14 @@ public class RiskController { } - @RequestMapping(value = "/white/{client_moniker}", method = RequestMethod.POST) - public void addWhiteList(@PathVariable String client_moniker) { - riskMerchantService.addWhiteList(client_moniker); + @RequestMapping(value = "/white/{clientMoniker}", method = RequestMethod.POST) + public void addWhiteList(@PathVariable String clientMoniker) { + riskMerchantService.addWhiteList(clientMoniker); } - @RequestMapping(value = "/white/{client_moniker}/disable", method = RequestMethod.PUT) - public void disableWhiteList(@PathVariable String client_moniker) { - riskMerchantService.disableWhiteList(client_moniker); + @RequestMapping(value = "/white/{clientMoniker}/disable", method = RequestMethod.PUT) + public void disableWhiteList(@PathVariable String clientMoniker) { + riskMerchantService.disableWhiteList(clientMoniker); } @RequestMapping(value = "/records/uploadFiles", method = RequestMethod.POST) @@ -86,22 +86,22 @@ public class RiskController { } @RequestMapping(value = "/details/remark", method = RequestMethod.POST) - public void addDetailRemark(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@RequestBody AddRiskDetailLog addRiskDetailLog ) { - riskMerchantService.addDetailLog(addRiskDetailLog,manager); + public void addDetailRemark(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddRiskDetailLog addRiskDetailLog) { + riskMerchantService.addDetailLog(addRiskDetailLog, manager); } @RequestMapping(value = "/attention", method = RequestMethod.GET) - public JSONObject listMerchants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,QueryAttentionMerchants queryAttention ) { - return riskMerchantService.listAttentionMerchants(manager,queryAttention); + public JSONObject listMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QueryAttentionMerchants queryAttention) { + return riskMerchantService.listAttentionMerchants(manager, queryAttention); } - @RequestMapping(value = "/attention/{client_moniker}", method = RequestMethod.POST) - public void addMerchants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String client_moniker) { - riskMerchantService.addAttentionMerchants(manager,client_moniker); + @RequestMapping(value = "/attention/{clientMoniker}", method = RequestMethod.POST) + public void addMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { + riskMerchantService.addAttentionMerchant(manager, clientMoniker); } - @RequestMapping(value = "/attention/{client_moniker}", method = RequestMethod.PUT) - public void updateMerchants(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String client_moniker) { - riskMerchantService.updateAttentionMerchants(manager,client_moniker); + @RequestMapping(value = "/attention/{clientMoniker}", method = RequestMethod.PUT) + public void disableRiskMerchant(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { + riskMerchantService.disableAttentionMerchant(manager, clientMoniker); } } diff --git a/src/main/ui/static/boot/application-boot.js b/src/main/ui/static/boot/application-boot.js index 0bf1756bb..1824b7f6b 100644 --- a/src/main/ui/static/boot/application-boot.js +++ b/src/main/ui/static/boot/application-boot.js @@ -28,7 +28,8 @@ require.config({ dragdrop: 'static/lib/angular-plugins/angular-drag-and-drop-lists.min', echarts: 'static/lib/echarts/echarts.common.min', angularEcharts: 'static/commons/angular-echarts', - decimal:'static/lib/decimal/decimal.min' + decimal:'static/lib/decimal/decimal.min', + jstz: 'static/lib/timezone/jstz-1.0.4.min' }, shim: { 'angular': {deps: ['jquery'], exports: 'angular'}, diff --git a/src/main/ui/static/boot/index-boot.js b/src/main/ui/static/boot/index-boot.js index ebd3a9b18..3e683268c 100644 --- a/src/main/ui/static/boot/index-boot.js +++ b/src/main/ui/static/boot/index-boot.js @@ -28,7 +28,8 @@ require.config({ dragdrop: 'static/lib/angular-plugins/angular-drag-and-drop-lists.min', echarts: 'static/lib/echarts/echarts.common.min', angularEcharts: 'static/commons/angular-echarts', - decimal:'static/lib/decimal/decimal.min' + decimal:'static/lib/decimal/decimal.min', + jstz: 'static/lib/timezone/jstz-1.0.4.min' }, shim: { 'angular': {deps: ['jquery','decimal'], exports: 'angular'}, diff --git a/src/main/ui/static/boot/manager-boot.js b/src/main/ui/static/boot/manager-boot.js index 287160881..007f0d428 100644 --- a/src/main/ui/static/boot/manager-boot.js +++ b/src/main/ui/static/boot/manager-boot.js @@ -30,7 +30,8 @@ require.config({ ueditor: 'static/lib/ueditor/ueditor.all.min', ueditorConfig: 'static/lib/ueditor/ueditor.config', angularEcharts: 'static/commons/angular-echarts', - decimal: 'static/lib/decimal/decimal.min' + decimal: 'static/lib/decimal/decimal.min', + jstz: 'static/lib/timezone/jstz-1.0.4.min' }, shim: { 'angular': {deps: ['jquery', 'decimal'], exports: 'angular'}, diff --git a/src/main/ui/static/dashboard/dashboard.js b/src/main/ui/static/dashboard/dashboard.js index f25e4239d..e67fa4e6b 100644 --- a/src/main/ui/static/dashboard/dashboard.js +++ b/src/main/ui/static/dashboard/dashboard.js @@ -2,7 +2,7 @@ * Created by davep on 2016-07-27. */ -define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angular) { +define(['angular', 'uiRouter', 'jstz', 'uiBootstrap', 'angularEcharts'], function (angular) { 'use strict'; var colors = ['#00c0ef', '#00a65a', '#ff851b', '#f39c12', '#d81b60', '#605ca8', '#dd4b39', '#008080', '#8B008B', '#D2691E', '#708090']; var app = angular.module('dashboardApp', ['ui.router', 'ui.bootstrap', 'ngEcharts']); @@ -25,7 +25,8 @@ define(['angular', 'uiRouter', 'uiBootstrap', 'angularEcharts'], function (angul params: function () { return { begin: $filter('date')(new Date(), 'yyyyMMdd'), - end: $filter('date')(new Date(), 'yyyyMMdd') + end: $filter('date')(new Date(), 'yyyyMMdd'), + timezone: jstz.determine().name() } } }, diff --git a/src/main/ui/static/lib/timezone/jstz-1.0.4.min.js b/src/main/ui/static/lib/timezone/jstz-1.0.4.min.js new file mode 100644 index 000000000..96e3dd8ae --- /dev/null +++ b/src/main/ui/static/lib/timezone/jstz-1.0.4.min.js @@ -0,0 +1,2 @@ +/*! jstz - v1.0.4 - 2012-12-12 */ +(function(e){var t=function(){"use strict";var e="s",n=function(e){var t=-e.getTimezoneOffset();return t!==null?t:0},r=function(e,t,n){var r=new Date;return e!==undefined&&r.setFullYear(e),r.setDate(n),r.setMonth(t),r},i=function(e){return n(r(e,0,2))},s=function(e){return n(r(e,5,2))},o=function(e){var t=e.getMonth()>7?s(e.getFullYear()):i(e.getFullYear()),r=n(e);return t-r!==0},u=function(){var t=i(),n=s(),r=i()-s();return r<0?t+",1":r>0?n+",1,"+e:t+",0"},a=function(){var e=u();return new t.TimeZone(t.olson.timezones[e])};return{determine:a,date_is_dst:o}}();t.TimeZone=function(e){"use strict";var n=null,r=function(){return n},i=function(){var e=t.olson.ambiguity_list[n],r=e.length,i=0,s=e[0];for(;i - Client Moniker - Create Time + Merchant Code + ABN + ACN + Account No + Contact Person + Contact Phone + Operation Time Operation {{client.client_moniker}} - {{client.create_time}} + {{client.abn}} + {{client.acn}} + {{client.bank_account_no}} + {{client.contact_person}} + {{client.contact_phone}} + {{client.last_update_date}} Disable