From 834a5c66ba709981d4cac609383b0f2275bd59e4 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Fri, 30 Aug 2019 18:27:04 +0800 Subject: [PATCH 1/6] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/payment/partner/templates/add_partner.html | 2 +- .../payment/partner/templates/add_sub_partner_dialog.html | 2 +- src/main/ui/static/payment/partner/templates/partner_edit.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/payment/partner/templates/add_partner.html b/src/main/ui/static/payment/partner/templates/add_partner.html index 59013a5ea..6fa16c2c8 100644 --- a/src/main/ui/static/payment/partner/templates/add_partner.html +++ b/src/main/ui/static/payment/partner/templates/add_partner.html @@ -977,7 +977,7 @@
- diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index d9ea72365..bd24ffaf8 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -830,7 +830,7 @@
- +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
@@ -775,8 +794,8 @@ name="legal_representative_job" id="legal_representative_job-id" maxlength="50">
-
+

Required Field

Less Than 50 diff --git a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html index 91b22a995..fc71f4343 100644 --- a/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html +++ b/src/main/ui/static/payment/partner/templates/add_sub_partner_dialog.html @@ -574,6 +574,24 @@ Characters(including symbols and spaces)

+
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 5752a88ec..853c1fb36 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -384,6 +384,55 @@
+
+ + +
+

+ +

+
+
+ + + +

+
Legal Representative
+
+
+
+ + +
+

+
+
+
+ + +
+

+
+
+
+ + +
+

+ +

+
+
+
+ + +
+

+ +

+
+
+
@@ -430,6 +479,44 @@ + +

+
Registered Address Information
+
+
+ +
+ + +
+

+
+
+
+ + +
+

+
+
+
+ + +
+

+
+
+
+ + +
+

+
+
+
+
+
+
diff --git a/src/main/ui/static/payment/partner/templates/client_partner_edit.html b/src/main/ui/static/payment/partner/templates/client_partner_edit.html index 4877d1b7e..ad1b37ce0 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_edit.html @@ -416,6 +416,107 @@ Characters(including symbols and spaces)

+
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
+ +
+ + + +
+
  Legal Representative
+
+
+
+ +
+ +
+

Required + Field

+

Less + Than 50 + Characters(including symbols and spaces)

+
+
+
+ +
+ +
+ +
+
+

Required Field

+

Less Than 20 + Characters(including symbols and spaces)

+
+
+ +
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+ +
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+
@@ -483,6 +584,89 @@ +
+ +
+ + + +
+
  Registered Office Address
+
+
+
+ +
+ +
+

Less + Than 200 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Less + Than 50 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Less + Than 10 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Required + Field

+
+ +
+
@@ -495,4 +679,4 @@ - \ No newline at end of file + diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index f1b9c66d8..61baafe76 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -730,6 +730,16 @@

+ +
+ + +
+

+ +

+
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_edit.html b/src/main/ui/static/payment/partner/templates/partner_edit.html index bd24ffaf8..d22fc8976 100644 --- a/src/main/ui/static/payment/partner/templates/partner_edit.html +++ b/src/main/ui/static/payment/partner/templates/partner_edit.html @@ -579,6 +579,25 @@ Characters(including symbols and spaces)

+ +
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
@@ -587,7 +606,7 @@
  Legal Representative
-
+
@@ -664,6 +683,82 @@
+ +
+
+
+ +
+ +
+

Required + Field

+

Less + Than 50 + Characters(including symbols and spaces)

+
+
+
+ +
+ +
+ +
+
+

Required Field

+

Less Than 20 + Characters(including symbols and spaces)

+
+
+ +
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+ +
+ +
+ +
+
+

Required + Field

+

Less Than 50 + Characters(including symbols and spaces)

+
+
+ +
+
+
@@ -769,7 +864,7 @@

  Registered Office Address
-
+
@@ -846,6 +941,84 @@
+ +
+
+
+ +
+ +
+

Less + Than 200 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Less + Than 50 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Less + Than 10 + Characters(including symbols and spaces)

+

Required + Field

+
+
+
+
+ +
+ +
+

Required + Field

+
+ +
+
+
+

From 311dc316a1f8461d4aaba5d0223148e66f86ca24 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 3 Sep 2019 02:03:17 +0800 Subject: [PATCH 4/6] ato report --- src/main/resources/application-proxy.properties | 15 ++++++++++----- .../manage/process/ato/ExportATOReport.java | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/resources/application-proxy.properties b/src/main/resources/application-proxy.properties index 7de4c2bf1..642c67f86 100644 --- a/src/main/resources/application-proxy.properties +++ b/src/main/resources/application-proxy.properties @@ -1,7 +1,12 @@ - -spring.datasource.driver-class-name=com.mysql.jdbc.Driver +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.schema-name=royalpay_production spring.datasource.host=119.28.3.196:3310 -spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false -spring.datasource.username=readonly -spring.datasource.password=read0nly \ No newline at end of file +spring.datasource.master.jdbc-url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false +spring.datasource.master.username=readonly +spring.datasource.master.password=read0nly + +spring.datasource.slave.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.slave.jdbc-url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false +spring.datasource.slave.username=readonly +spring.datasource.slave.password=read0nly \ No newline at end of file diff --git a/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java b/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java index eb164b1d6..c44733b06 100644 --- a/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java +++ b/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java @@ -19,7 +19,7 @@ import java.nio.charset.StandardCharsets; * Create by yixian at 2018-08-31 14:40 */ @SpringBootTest -@ActiveProfiles({"proxy", "alipay", "wechat", "jd", "bestpay", "rpay","yeepay"}) +@ActiveProfiles({"proxy", "wechat","alipay","bestpay","rpay","jd","yeepay"}) @TestPropertySource(properties = {"spring.datasource.username=root", "spring.datasource.password=ZOIBhellor0yalpay"}) @RunWith(SpringRunner.class) public class ExportATOReport { From 518f36d51ecc5db7278652b8187d89ed24295e32 Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 3 Sep 2019 10:50:58 +0800 Subject: [PATCH 5/6] ato report --- .../beans/ato/ReportingPartyData.java | 8 +- .../manage/mappers/system/ClientMapper.xml | 437 +++++++++--------- 2 files changed, 214 insertions(+), 231 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java index e3644757e..751a88efe 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/ReportingPartyData.java @@ -2,10 +2,8 @@ package au.com.royalpay.payment.manage.analysis.beans.ato; import org.apache.commons.lang3.time.DateUtils; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; /** * Create by yixian at 2018-08-30 21:13 @@ -23,7 +21,7 @@ public class ReportingPartyData implements ATOBulkLine { private ContactInfo contactInfo; private String softwareProductType; - private Map businesses = new HashMap<>(); + private Map businesses = new ConcurrentHashMap<>(); public ReportingPartyData(Date periodStart, Date periodEnd, String abn, String branchNumber, String registerName, String softwareProductType) { this.periodStart = DateUtils.truncate(periodStart, Calendar.DATE); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index fe9d74c1e..7fcb9c768 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -2,19 +2,19 @@ @@ -480,35 +487,41 @@ From eca3daf0d30b9e66bfd22be7cbc50e939ce305ca Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 3 Sep 2019 17:11:46 +0800 Subject: [PATCH 6/6] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=92=8Cweb=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../appclient/core/RetailAppService.java | 2 +- .../core/impls/RetailAppServiceImp.java | 34 ++++-- .../appclient/web/RetailAppController.java | 11 +- .../core/impl/ClientComplianceApplyImpl.java | 25 ++++ .../manage/dev/web/TestController.java | 11 ++ .../mappers/system/ClientFilesMapper.java | 3 +- .../core/impls/ClientManagerImpl.java | 109 +++++++++++++----- .../web/PartnerManageController.java | 8 +- .../merchants/web/PartnerViewController.java | 4 +- .../core/impls/SignInAccountServiceImpl.java | 30 ++++- .../impl/SurchargeAccountServiceImpl.java | 2 +- .../mappers/system/ClientFilesMapper.xml | 5 + .../static/payment/partner/partner-manage.js | 4 +- src/main/ui/static/payment/partner/partner.js | 64 +++++++++- .../templates/client_compliance_to_auth.html | 41 ++++++- .../client_compliance_to_perfect.html | 71 ++++++++++++ .../partner-surcharge-account.js | 13 +-- .../templates/client_surcharge_account.html | 6 +- .../client_surcharge_account_dialog.html | 26 ++++- 20 files changed, 400 insertions(+), 71 deletions(-) diff --git a/pom.xml b/pom.xml index 8714aa590..e8638d386 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 1.1.0 + 1.1.1 4.0.0 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 774d9ddba..0191856da 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 @@ -208,5 +208,5 @@ public interface RetailAppService { void deleteGreenChannelAuthFiles(JSONObject device, String filesInfo); - void commitAuthFilesToCompliance(JSONObject device); + void commitAuthFilesToCompliance(JSONObject device,JSONObject photoInfo); } 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 bcf86d2b5..f7f0d19ff 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 @@ -49,6 +49,7 @@ import au.com.royalpay.payment.tools.device.message.AppMsgSender; import au.com.royalpay.payment.tools.device.support.DeviceRegister; import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.RequestEnvironment; +import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.NotFoundException; @@ -208,6 +209,8 @@ public class RetailAppServiceImp implements RetailAppService { @Resource private ClientBankAccountMapper clientBankAccountMapper; @Resource + private SysConfigManager sysConfigManager; + @Resource private StringRedisTemplate stringRedisTemplate; private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf"; private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/22/1566440384256_R7Jc3cl5JPZsmVznKffzStwVMELwsl.pdf"; @@ -2269,6 +2272,8 @@ public class RetailAppServiceImp implements RetailAppService { client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); client.put("clean", "T+" + weChatRate.getString("clean_days")); client.put("clean_days", weChatRate.getString("clean_days")); + String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); + JSONObject sysConfigRate = JSONObject.parseObject(rateConfig); try { JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); @@ -2276,16 +2281,6 @@ public class RetailAppServiceImp implements RetailAppService { client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); } - JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); - if (bestPayRate != null) { - client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - - JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); - if (jdRate != null) { - client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); if (alipayOnlineRate != null) { client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); @@ -2299,6 +2294,22 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); } + try { + JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); + if (bestPayRate != null) { + client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + + JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); + if (jdRate != null) { + client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + } catch (Exception ignored) { + JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days")); + client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN)); + client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN)); + } + JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); if (bankAccount == null || bankAccount.size() <= 0) { throw new BadRequestException("The Partner's Account is not config!"); @@ -2349,11 +2360,12 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public void commitAuthFilesToCompliance(JSONObject device) { + public void commitAuthFilesToCompliance(JSONObject device, JSONObject photoInfo) { String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); JSONObject account = clientAccountMapper.findById(device.getString("account_id")); + account.put("photo_info", photoInfo); clientManager.commitAuthFilesToCompliance(client.getString("client_moniker"), account,"App"); } 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 d48aa3b5b..d31908340 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 @@ -781,7 +781,16 @@ public class RetailAppController { */ @RequestMapping(value = "/client/auth_file/commit_to_compliance", method = RequestMethod.POST) public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device){ - retailAppService.commitAuthFilesToCompliance(device); + retailAppService.commitAuthFilesToCompliance(device, null); } + /** + * 提交审核 + * @param device + * @params photoInfo 图片或网站 + */ + @RequestMapping(value = "/client/auth_file/commit_to_compliance_new", method = RequestMethod.POST) + public void commitToComplianceAuthFiles(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject photoInfo){ + retailAppService.commitAuthFilesToCompliance(device, photoInfo); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java index 8f7431e19..ca70877fd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java @@ -6,6 +6,8 @@ import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply; import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.utils.PageListUtils; @@ -13,6 +15,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 org.apache.commons.lang3.StringUtils; import org.omg.CORBA.SystemException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -31,6 +34,10 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply private ClientComplianceCompanyMapper clientComplianceCompanyMapper; @Resource private ClientFilesMapper clientFilesMapper; + @Resource + private ClientManager clientManager; + @Resource + private ClientMapper clientMapper; @Override public JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery applyQuery) { @@ -88,6 +95,24 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply complianceDetail.put("description",' '); clientComplianceCompanyMapper.update(complianceDetail); clientFilesMapper.passCompliance(clientId); + + JSONObject client = clientManager.getClientInfo(clientId); + boolean clientChanged = false; + if (StringUtils.isNotBlank(complianceDetail.getString("company_photo"))) { + client.put("company_photo", complianceDetail.getString("company_photo")); + clientChanged = true; + } + if (StringUtils.isNotBlank(complianceDetail.getString("store_photo"))) { + client.put("store_photo", complianceDetail.getString("store_photo")); + clientChanged = true; + } + if (StringUtils.isNotBlank(complianceDetail.getString("company_website"))) { + client.put("company_website", complianceDetail.getString("company_website")); + clientChanged = true; + } + if (clientChanged) { + clientMapper.update(client); + } } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index b70e97a8f..91513995b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -275,6 +275,17 @@ public class TestController implements ApplicationEventPublisherAware { return list.isEmpty() ? new JSONObject() : list.get(0); } + @ManagerMapping(value = "/fix_transaction/{orderId}", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER) + public void fixTransactionsByOrderId(@PathVariable String orderId) { + JSONObject order = orderMapper.find(orderId); + try { + String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel")); + paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true); + } catch (Exception e) { + logger.error("fix transaction error:" + order.getString("order_id")); + } + } + @ManagerMapping(value = "/fix_transaction", method = RequestMethod.PUT, role = ManagerRole.DEVELOPER) public void fixTransactions() { List orders = orderMapper.listOrdersWithNoTransactions(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java index 20008e2d6..78894f1bc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java @@ -6,6 +6,7 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import com.alibaba.fastjson.JSONObject; import org.apache.ibatis.annotations.Param; +import org.springframework.core.annotation.Order; import java.util.List; @@ -32,8 +33,6 @@ public interface ClientFilesMapper { @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'") List findClientAggreeFileCommit(@Param("client_id") int clientId); - @AutoSql(type = SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1") List findAllClientFile(@Param("client_id") int clientId); @AutoSql(type = SqlType.SELECT) 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 b768bf06f..0a850eb3b 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 @@ -2036,7 +2036,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } JSONObject file = signInAccountService.checkAuthFileStatus(client); - file.put("file_company", clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id"))); + JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); + file.put("file_company", compliance); + JSONObject photoInfo = new JSONObject(); + photoInfo.put("company_photo", client.getString("company_photo")); + photoInfo.put("store_photo", client.getString("store_photo")); + photoInfo.put("web_site", client.getString("company_website")); + if (compliance != null) { + if (StringUtils.isNotBlank(compliance.getString("company_photo"))) { + photoInfo.put("company_photo", compliance.getString("company_photo")); + } + if (StringUtils.isNotBlank(compliance.getString("store_photo"))) { + photoInfo.put("store_photo", compliance.getString("store_photo")); + } + if (StringUtils.isNotBlank(compliance.getString("company_website"))) { + photoInfo.put("web_site", compliance.getString("company_website")); + } + } + file.put("photo_info", photoInfo); return file; } @@ -2066,6 +2083,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); client.put("clean", "T+" + weChatRate.getString("clean_days")); client.put("clean_days", weChatRate.getString("clean_days")); + String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); + JSONObject sysConfigRate = JSONObject.parseObject(rateConfig); try { JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); @@ -2073,16 +2092,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); } - JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); - if (bestPayRate != null) { - client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - - JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); - if (jdRate != null) { - client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); if (alipayOnlineRate != null) { client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); @@ -2093,7 +2102,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); } } catch (Exception ignored) { - throw new BadRequestException("Merchant Rate Not Configure"); + throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); + } + + try { + JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); + if (bestPayRate != null) { + client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + + JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); + if (jdRate != null) { + client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + } catch (Exception ignored) { + JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days")); + client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN)); + client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN)); } JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); @@ -2940,7 +2965,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid file.put("file_id", existFile.getString("file_id")); clientFilesMapper.update(file); } - if (!renewal && client.getIntValue("source") != 4) { + if (!renewal) { clientModifySupport.processClientModify(new OpenStatusModify(manager, clientMoniker, 2)); } @@ -3329,6 +3354,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Transactional public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) { JSONObject client = getClientInfoByMoniker(clientMoniker); + String clientPayType = ""; + String companyPhoto = ""; + String storePhoto= ""; + String webSite= ""; int sourceEnum = 2; if (client == null) { throw new InvalidShortIdException(); @@ -3353,13 +3382,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if ("app".equals(source.toLowerCase())) { sourceEnum = 1; } - + JSONObject photoInfo = account.getJSONObject("photo_info"); + if (photoInfo != null) { + companyPhoto = photoInfo.getString("company_photo"); + storePhoto = photoInfo.getString("store_photo"); + webSite = photoInfo.getString("web_site"); + } JSONObject fileComp = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); if (fileComp == null) { fileComp = new JSONObject(); fileComp.put("client_id", client.getIntValue("client_id")); fileComp.put("submit_time", new Date()); fileComp.put("status", 0); + fileComp.put("company_photo", companyPhoto); + fileComp.put("store_photo", storePhoto); + fileComp.put("company_website", webSite); fileComp.put("source", sourceEnum); fileComp.put("commit_by_id", account.getString("account_id")); clientComplianceCompanyMapper.save(fileComp); @@ -3367,6 +3404,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } else if (fileComp.getIntValue("status") == 2) { fileComp.put("status", 0); fileComp.put("submit_time", new Date()); + fileComp.put("company_photo", companyPhoto); + fileComp.put("store_photo", storePhoto); + fileComp.put("company_website", webSite); fileComp.put("source", sourceEnum); fileComp.put("commit_by_id", account.getString("account_id")); clientComplianceCompanyMapper.update(fileComp); @@ -3403,6 +3443,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); client.put("clean", "T+" + weChatRate.getString("clean_days")); client.put("clean_days", weChatRate.getString("clean_days")); + String rateConfig = sysConfigManager.getSysConfig().getString("sys_rates"); + JSONObject sysConfigRate = JSONObject.parseObject(rateConfig); try { JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay"); @@ -3410,16 +3452,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("alipay_rate", alipayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); } - JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); - if (bestPayRate != null) { - client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - - JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); - if (jdRate != null) { - client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); - } - JSONObject alipayOnlineRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "AlipayOnline"); if (alipayOnlineRate != null) { client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); @@ -3430,7 +3462,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("cbbank_rate", cbBankPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); } } catch (Exception ignored) { - throw new BadRequestException("Merchant Rate Not Configure"); + throw new BadRequestException("Merchant Rate Not Configure,Please Contact Customer Service"); + } + + try { + JSONObject bestPayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Bestpay"); + if (bestPayRate != null) { + client.put("bestpay_rate", bestPayRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + + JSONObject jdRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "jd"); + if (jdRate != null) { + client.put("jd_rate", jdRate.getBigDecimal("rate_value").setScale(2, BigDecimal.ROUND_DOWN)); + } + } catch (Exception ignored) { + JSONObject rate = sysConfigRate.getJSONObject("t" + weChatRate.getString("clean_days")); + client.put("bestpay_rate", rate.getBigDecimal("Bestpay").setScale(2, BigDecimal.ROUND_DOWN)); + client.put("jd_rate", rate.getBigDecimal("JDpay").setScale(2, BigDecimal.ROUND_DOWN)); } JSONObject bankAccount = getBankAccountByClientId(client.getIntValue("client_id")); @@ -4129,7 +4177,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid transactions.forEach(e -> { if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) { JSONObject manager = managerMapper.findDetail(e.getString("operation")); - e.put("operator_displayname", manager.getString("display_name")); + e.put("operator", manager.getString("display_name")); } }); return transactions; @@ -4150,7 +4198,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (client == null) { throw new InvalidShortIdException(); } - return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId); + List transactions = clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"), detailId); + transactions.forEach(e -> { + if ("Credit".equals(e.getString("type")) && !"settle revoke".equals(e.getString("remark"))) { + JSONObject manager = managerMapper.findDetail(e.getString("operation")); + e.put("operator", manager.getString("display_name")); + } + }); + return transactions; } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 579209cda..aa7bc54d2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -55,9 +55,11 @@ public class PartnerManageController { } - @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET) - public String initMerchantCode() { - return clientManager.initMerchantCode(); + @RequestMapping(value = "/init/merchant_code", method = RequestMethod.GET,produces = "application/json") + public JSONObject initMerchantCode() { + JSONObject result = new JSONObject(); + result.put("partner_code", clientManager.initMerchantCode()); + return result; } @RequestMapping(value = "/init/check_code_isvalid", method = RequestMethod.GET) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index ee208bf27..188fd1031 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -44,6 +44,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.io.OutputStream; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -583,7 +584,8 @@ public class PartnerViewController { @PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST) @ResponseBody - public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) { + account.put("photo_info", photoInfo); clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web"); } 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 f2d01f0bc..72de8379d 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 @@ -464,7 +464,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati "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", "open_status", "timezone", "has_children", "source", "customer_surcharge_rate", "enable_alipay", "enable_wechat", - "enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode"}; + "enable_bestpay", "manual_settle", "skip_clearing", "mail_confirm", "surcharge_mode", "company_photo", "store_photo", "company_website"}; for (String col : columns) { simpleClient.put(col, client.get(col)); } @@ -707,13 +707,33 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati } result.put("client_less_file", clientFilesIsLess); if (clientFilesIsLess) { - JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); - if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) { - result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description")); - } + whenClientLessFile(client, result); } } } return result; } + + private void whenClientLessFile(JSONObject client,JSONObject result) { + JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); + if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) { + result.put("client_refuse_reason", "Refuse reason/打回原因:" + authFileCompliance.getString("description")); + } + JSONObject photoInfo = new JSONObject(); + photoInfo.put("company_photo", client.getString("company_photo")); + photoInfo.put("store_photo", client.getString("store_photo")); + photoInfo.put("web_site", client.getString("company_website")); + if (authFileCompliance != null) { + if (StringUtils.isNotBlank(authFileCompliance.getString("company_photo"))) { + photoInfo.put("company_photo", authFileCompliance.getString("company_photo")); + } + if (StringUtils.isNotBlank(authFileCompliance.getString("store_photo"))) { + photoInfo.put("store_photo", authFileCompliance.getString("store_photo")); + } + if (StringUtils.isNotBlank(authFileCompliance.getString("company_website"))) { + photoInfo.put("web_site", authFileCompliance.getString("company_website")); + } + } + result.put("photo_info", photoInfo); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java index 960feab9c..c88bb2a40 100644 --- a/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/surchargeAccount/core/impl/SurchargeAccountServiceImpl.java @@ -135,7 +135,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService { surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); clientsSurchargeAccountsMapper.update(surchargeAccount); detail.put("checkout", 1); - detail.put("operator_id", manager.getString("display_name")); + detail.put("operator_id", manager.getString("manager_id")); financialSurchargeAccountDetailMapper.update(detail); } finally { locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill"); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml index 25c6a1df3..c8967b6bf 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.xml @@ -19,6 +19,11 @@ and file_name='client_agree_file' and status != 1 + update sys_files set state = 2 diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 722a54cda..702d03297 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -395,7 +395,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.initMerchantCode = function () { $http.get('/sys/partners/init/merchant_code').then(function (response) { - $scope.partner.client_moniker = response.data; + $scope.partner.client_moniker = response.data.partner_code; $scope.merchantCodeChecked = true; $scope.merchantIsValid = true; }); @@ -2969,7 +2969,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter } $scope.initMerchantCode = function () { $http.get('/sys/partners/init/merchant_code').then(function (response) { - $scope.partner.client_moniker = response.data; + $scope.partner.client_moniker = response.data.partner_code; $scope.merchantCodeChecked = true; $scope.merchantIsValid = true; }); diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index a2dec110d..c6527daa2 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -812,6 +812,50 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { $scope.file = file.data || {}; $scope.partner = partner.data || {}; + + $scope.uploadStorePhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.file.photo_info.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + $scope.uploadShopPhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.file.photo_info.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + //audit files $scope.uploadBankFile = function (file) { if (file != null) { @@ -860,7 +904,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { $scope.idIsImage = false; } - $scope.uploadCompanyFile = function (file) { if (file != null) { if (file.size > 3 * 1024 * 1024) { @@ -1017,12 +1060,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'}); return; } - ; + if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) { + alert('Please upload two photos or fill out the website'); + return; + } + commonDialog.confirm({ title: 'Warning', content: 'Are you sure to submit files?' }).then(function () { - $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file).then(function () { + $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () { commonDialog.alert({ title: 'Success', content: 'Commit Successful', @@ -1855,6 +1902,17 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo $scope.$close(signInfo); }; }]); + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + }; return app; }); diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html b/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html index 78da221e1..9a3672b35 100644 --- a/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html +++ b/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html @@ -35,7 +35,11 @@

- {{partner.client_moniker}} + + + {{partner.client_moniker}} +

@@ -70,6 +74,41 @@
+
+ +
+ +
+
+
+ +
+
1:  +
+ + + + +
+
+
2:  +
+ + + + +
+