diff --git a/pom.xml b/pom.xml index 5fef248dc..0c1243618 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.15 + 1.3.16 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java index 2a2e45986..0160843e3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/beans/RetailAppMessage.java @@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.pushMessage.bean.AppManagerMessageBuilder; import au.com.royalpay.payment.manage.pushMessage.bean.AppMessageType; import au.com.royalpay.payment.tools.device.message.AppMessage; import au.com.royalpay.payment.tools.env.RequestEnvironment; +import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.StringUtils; @@ -21,7 +22,7 @@ public class RetailAppMessage { JSONObject msg = new JSONObject(); msg.put("appid", appid); msg.put("client_id", clientId); - msg.put("role", "admin"); + msg.put("role", PartnerRole.ADMIN.getCode()); msg.put("title", title); msg.put("body", body); msg.put("send_time", new Date()); 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 9be9a2a6d..b0be6d024 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 @@ -2507,6 +2507,12 @@ public class RetailAppServiceImp implements RetailAppService { if (PartnerRole.getRole(account.getIntValue("role")) == PartnerRole.CASHIER) { authFileStatus.put("client_less_file", false); } + JSONObject compliance = clientComplianceCompanyMapper.findFileByClientId(account.getIntValue("client_id")); + if (compliance != null) { + if (compliance.getIntValue("status")==0 || compliance.getIntValue("status")==1) { + authFileStatus.put("client_less_file", false); + } + } return authFileStatus; } @@ -2620,6 +2626,9 @@ public class RetailAppServiceImp implements RetailAppService { complianceFilesNotice.put("type", messageSource.getMessage("client.auth.file.compliance.type", null, RequestEnvironment.getLocale())); complianceFilesNotice.put("client_less_file",complianceFileStatus.getBoolean("client_less_file")); if(compliance != null){ + if (compliance.getIntValue("status")==0 || compliance.getIntValue("status")==1) { + complianceFilesNotice.put("client_less_file", false); + } if(complianceFileStatus.getBoolean("client_less_file")){ complianceFilesNotice.put("client_refuse_reason",compliance.getString("description")); } diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 7f6b6806d..7e65da9dd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -838,7 +838,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider int rowNum = 0; Row row = sheet.createRow(rowNum); String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No"}; + "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No","Dev Remark"}; String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"}; for (int i = 0; i < title.length; i++) { row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); @@ -900,9 +900,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail")); String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-"); JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); - if (device != null) + String clientDevRemark = "-"; + if (device != null) { clientDevId = device.getString("client_dev_id"); + clientDevRemark = device.getString("remark"); + } row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); + row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); } row = sheet.createRow(++rowNum); for (int i = 0; i < analysis.length; i++) { diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java index f9aaec11f..1b2b301b5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.java @@ -24,7 +24,7 @@ public interface ClientDeviceTokenMapper { List listTokensByClient_id(@Param("client_id") int client_id); - List listTokensByAccountId(@Param("client_id") String accountId); + List listTokensByAccountId(@Param("account_id") String accountId); List listAllTokens(JSONObject devToken); diff --git a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java b/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java index 781fc0776..fd8e7e733 100644 --- a/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java +++ b/src/main/java/au/com/royalpay/payment/manage/pushMessage/APNSMessageHelper.java @@ -3,14 +3,12 @@ package au.com.royalpay.payment.manage.pushMessage; import com.alibaba.fastjson.JSONObject; import com.notnoop.apns.APNS; import com.notnoop.apns.ApnsService; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.Resource; import org.springframework.stereotype.Service; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -21,28 +19,28 @@ import java.io.InputStream; public class APNSMessageHelper { private Logger logger = LoggerFactory.getLogger(getClass()); - @Value("classpath:apple_message_cert_dev.p12") - private org.springframework.core.io.Resource appleMessageFileDev; - @Value("${apple.message.apns.file}") - private String appleApnsFile; + @Value("${apple.message.apns.file:classpath:apple_message_cert_dev.p12}") + private Resource appleApnsFile; @Value("${apple.message.apns.password}") private String appleMessagePassword; public void sendAppleMessage(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { /**设置参数,发送数据**/ - InputStream keyIns = new FileInputStream(new File(appleApnsFile)); - ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); - String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build(); - service.push(token, payload); - logger.debug("推送信息已发送!"); + try (InputStream keyIns = appleApnsFile.getInputStream()) { + ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); + String payload = APNS.newPayload().alertTitle(title).alertBody(body).badge(1).sound("default").customField("data", data).customField("type", type).build(); + service.push(token, payload); + logger.debug("推送信息已发送!"); + } } public void sendAppleMessageDetail(String title, String body, String token, JSONObject data, JSONObject type) throws IOException { /**设置参数,发送数据**/ - InputStream keyIns = new FileInputStream(new File(appleApnsFile)); - ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); - String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build(); - service.push(token, payload); - logger.debug("推送信息已发送!"); + try (InputStream keyIns = appleApnsFile.getInputStream()) { + ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword).withProductionDestination().build(); + String payload = APNS.newPayload().alertTitle(title).alertBody(body).category("myNotificationCategory").badge(1).sound("default").customField("data", data).customField("type", type).build(); + service.push(token, payload); + logger.debug("推送信息已发送!"); + } } } diff --git a/src/main/resources/apple_message_cert_dev.p12 b/src/main/resources/apple_message_cert_dev.p12 index 905e2cc1f..922b88d93 100644 Binary files a/src/main/resources/apple_message_cert_dev.p12 and b/src/main/resources/apple_message_cert_dev.p12 differ diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml index 7ffa9c3b2..75354ab53 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientDeviceTokenMapper.xml @@ -20,7 +20,6 @@ FROM sys_clients_devices_token t INNER JOIN sys_clients_devices d ON t.dev_id = d.dev_id and d.account_id=#{account_id} and d.is_offline=0 WHERE t.is_valid = 1 - GROUP BY token - +

Please select the file type for uploading the ID.
Uploading your passport file requires you to upload your utility bill file.
- You can upload your driver's license and leave the utility bill file blank.
+ You can upload your driver license and leave the utility bill file blank.
请选择上传ID的文件类型.
上传护照文件需要您上传水电煤账单文件.
上传驾照,水电煤账单文件可以不填. diff --git a/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html b/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html index 14508f1b8..34d84fc6e 100644 --- a/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html +++ b/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html @@ -62,16 +62,16 @@ ng-model="file.id_type" style="width: 250px" ng-change="setSession(file.id_type)"> - +

Passport

-

Driver's license

+

Driver license

Please select the file type for uploading the ID.
Uploading your passport file requires you to upload your utility bill file.
- You can upload your driver's license and leave the utility bill file blank.
+ You can upload your driver license and leave the utility bill file blank.
请选择上传ID的文件类型.
上传护照文件需要您上传水电煤账单文件.
上传驾照,水电煤账单文件可以不填. diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html b/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html index 319bd889b..2b83f323c 100644 --- a/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html +++ b/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html @@ -59,7 +59,7 @@

Passport

-

Driver's license

+

Driver license

diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_files.html b/src/main/ui/static/payment/partner/templates/client_compliance_files.html index e8dd8a539..7dfb73822 100644 --- a/src/main/ui/static/payment/partner/templates/client_compliance_files.html +++ b/src/main/ui/static/payment/partner/templates/client_compliance_files.html @@ -70,7 +70,7 @@ ng-model="file.id_type" style="width: 250px" ng-change="setSession(file.id_type)"> - +

If client have already attached surcharge in their own system, ignore this choice.
diff --git a/src/main/ui/static/payment/partner/templates/client_kyc_files_to_auth.html b/src/main/ui/static/payment/partner/templates/client_kyc_files_to_auth.html index bca089e7c..cc34ada65 100644 --- a/src/main/ui/static/payment/partner/templates/client_kyc_files_to_auth.html +++ b/src/main/ui/static/payment/partner/templates/client_kyc_files_to_auth.html @@ -79,7 +79,7 @@

Passport

-

Driver's license

+

Driver license

diff --git a/src/test/java/au/com/royalpay/payment/manage/valid/APNSTest.java b/src/test/java/au/com/royalpay/payment/manage/valid/APNSTest.java new file mode 100644 index 000000000..df0dea049 --- /dev/null +++ b/src/test/java/au/com/royalpay/payment/manage/valid/APNSTest.java @@ -0,0 +1,46 @@ +package au.com.royalpay.payment.manage.valid; + +import au.com.royalpay.payment.tools.device.message.AppMessage; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.notnoop.apns.APNS; +import com.notnoop.apns.ApnsService; +import org.apache.commons.lang3.StringUtils; +import org.junit.Test; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.UUID; + +/** + * Create by davep at 2020-01-06 16:04 + */ +public class APNSTest { + @Test + public void test() throws IOException { + String appleMessagePassword = "BSNMNkxPq0AT"; + AppMessage msg = new AppMessage("MESSAGE","test","test content"); + JSONObject data = new JSONObject(); + data.put("send_type","rloan_creditFinished"); + msg.setData(data); + JSONObject typeData = new JSONObject(); + typeData.put("send_type","MESSAGE"); + typeData.put("id", UUID.randomUUID().toString()); + msg.setTypeData(typeData); + URL cert = getClass().getClassLoader().getResource("rloan_dev_apns.p12"); + try(InputStream keyIns = cert.openStream()) { + ApnsService service = APNS.newService().withCert(keyIns, appleMessagePassword) + .withSandboxDestination().build(); + String payload = APNS.newPayload().alertTitle("test").alertBody("test") + .badge(1).sound("default").customField("data", msg.getData()).customField("type", msg.getTypeData()).build(); + JSONObject p = JSON.parseObject(payload); + JSONObject aps = p.getJSONObject("aps"); + aps.put("mutable-content", "1"); + service.push("486A623E9A5AC2EB28DFBF3C827979293E9E9F9E1252603E7E1F8C878695FA57", p.toJSONString()); + } + } +} diff --git a/src/test/resources/apple_message_cert_dev.p12 b/src/test/resources/apple_message_cert_dev.p12 new file mode 100644 index 000000000..922b88d93 Binary files /dev/null and b/src/test/resources/apple_message_cert_dev.p12 differ