diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java index e44363a17..ee045b991 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java @@ -93,13 +93,21 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { throw new InvalidShortIdException(); } Key key = AESCrypt.fromKeyString(Base64.decodeBase64(params.getString("nonce_str"))); + String signPrice = "0"; + String signRate = "0"; + if (params.get("signPrice") != null) { + signPrice = decData(params.getString("signPrice"), key, svcInfo.getString("platform_pri_key")); + } + if (params.get("signRate") != null) { + signRate = decData(params.getString("signRate"), key, svcInfo.getString("platform_pri_key")); + } JSONObject serviceApply = new JSONObject(); serviceApply.put("apply_id", UUID.randomUUID().toString()); serviceApply.put("service_code", sourceCode); serviceApply.put("client_id", client.getIntValue("client_id")); serviceApply.put("title", params.getString("signData")); - serviceApply.put("amount", decData(params.getString("signPrice"), key, svcInfo.getString("platform_pri_key"))); - serviceApply.put("surcharge_rate", decData(params.getString("signRate"), key, svcInfo.getString("platform_pri_key"))); + serviceApply.put("amount", signPrice); + serviceApply.put("surcharge_rate", signRate); serviceApply.put("apply_username", params.getString("signName")); serviceApply.put("status", 0); serviceApply.put("is_valid", 1); diff --git a/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java index fdf8eeafb..85e3afa83 100644 --- a/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/rservices/core/impl/RServicesApplyServiceImpl.java @@ -33,6 +33,7 @@ import org.thymeleaf.context.Context; import org.thymeleaf.spring5.SpringTemplateEngine; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.Date; import java.util.UUID; @@ -88,22 +89,26 @@ public class RServicesApplyServiceImpl implements RServicesApplyService { clientServicesApplyMapper.update(applyInfo); JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code")); JSONObject clientServices = clientIncrementalMapper.findByClinetIdAndChannel(applyInfo.getIntValue("client_id"), increment.getString("channel")); + JSONObject serviceInfo = new JSONObject(); + if (applyInfo.getBigDecimal("surcharge_rate").compareTo(BigDecimal.ZERO)>0) { + serviceInfo.put("incremental_mode", 1); + serviceInfo.put("incremental_rate_value", applyInfo.getBigDecimal("surcharge_rate")); + }else { + serviceInfo.put("incremental_mode", 2); + serviceInfo.put("incremental_rate_value", 0); + } if (clientServices == null) { - clientServices = new JSONObject(); - clientServices.put("incremental_id", UUID.randomUUID().toString()); - clientServices.put("client_id", applyInfo.getIntValue("client_id")); - clientServices.put("channel", increment.getString("channel")); - clientServices.put("incremental_mode", 2); - clientServices.put("incremental_rate_value", 0); - clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount")); - clientServices.put("create_time", applyInfo.getDate("create_time")); - clientServices.put("update_time", applyInfo.getDate("operator_time")); - clientServices.put("operator", applyInfo.getString("operator")); - clientServices.put("is_valid", 1); - clientIncrementalMapper.save(clientServices); + serviceInfo.put("incremental_id", UUID.randomUUID().toString()); + serviceInfo.put("client_id", applyInfo.getIntValue("client_id")); + serviceInfo.put("channel", increment.getString("channel")); + serviceInfo.put("total_incremental_amount", applyInfo.getBigDecimal("amount")); + serviceInfo.put("create_time", applyInfo.getDate("create_time")); + serviceInfo.put("update_time", applyInfo.getDate("operator_time")); + serviceInfo.put("operator", applyInfo.getString("operator")); + serviceInfo.put("is_valid", 1); + clientIncrementalMapper.save(serviceInfo); }else { - clientServices.put("incremental_mode", 2); - clientServices.put("incremental_rate_value", 0); + clientServices.putAll(serviceInfo); clientServices.put("total_incremental_amount", applyInfo.getBigDecimal("amount")); clientServices.put("create_time", applyInfo.getDate("create_time")); clientServices.put("update_time", applyInfo.getDate("operator_time")); @@ -111,7 +116,9 @@ public class RServicesApplyServiceImpl implements RServicesApplyService { clientServices.put("is_valid", 1); clientIncrementalMapper.update(clientServices); } - afterPassProcessingApply(applyInfo); + if (applyInfo.getBigDecimal("amount").compareTo(BigDecimal.ZERO) > 0) { + afterPassProcessingApply(applyInfo); + } } finally { locker.unlock(lockKey); } @@ -137,6 +144,7 @@ public class RServicesApplyServiceImpl implements RServicesApplyService { transaction.put("system_transaction_id", orderId); transaction.put("order_id", orderId); transaction.put("client_id", applyInfo.getIntValue("client_id")); + transaction.put("currency", PlatformEnvironment.getEnv().getForeignCurrency()); transaction.put("transaction_currency", PlatformEnvironment.getEnv().getForeignCurrency()); transaction.put("transaction_amount", applyInfo.getBigDecimal("amount")); transaction.put("clearing_currency", PlatformEnvironment.getEnv().getForeignCurrency()); @@ -153,11 +161,11 @@ public class RServicesApplyServiceImpl implements RServicesApplyService { } private void sendNotify(JSONObject applyInfo, JSONObject client) { - try { - retailAppService.sendRServicesApplyMessage(applyInfo, client); - } catch (Exception e) { - logger.error("R-services-{}付费成功app推送发送失败 - {}",client.getIntValue("client_id"), e); - } +// try { +// retailAppService.sendRServicesApplyMessage(applyInfo, client); +// } catch (Exception e) { +// logger.error("R-services-{}付费成功app推送发送失败 - {}",client.getIntValue("client_id"), e); +// } JSONObject increment = commonIncrementalChannelMapper.findIncreamentalChannelBySourceCode(applyInfo.getString("service_code")); JSONObject account = clientAccountMapper.findByUsernameForDuplicate(applyInfo.getString("apply_username")); if (increment == null || account == null) { diff --git a/src/main/ui/static/rservicesapply/r-services-apply.js b/src/main/ui/static/rservicesapply/r-services-apply.js index ecd54e797..9464f0fef 100644 --- a/src/main/ui/static/rservicesapply/r-services-apply.js +++ b/src/main/ui/static/rservicesapply/r-services-apply.js @@ -39,7 +39,8 @@ define(['angular'], function (angular) { '[' + apply.client_moniker + ']即将签约[' + '' + apply.channel + ']服务
服务内容:[' + '' + apply.title + ']
需要扣款[' + - 'AUD ' + apply.amount + ']
申请人[' + + 'AUD ' + apply.amount + ']
手续费附加[' + + ' ' + apply.surcharge_rate + '%]
申请人[' + ' ' + apply.apply_username + ']' + '
请确认扣款信息是否正确' ); @@ -58,9 +59,10 @@ define(['angular'], function (angular) { $scope.refuseApply = function (apply) { var contentHtml = $sce.trustAsHtml( '[' + apply.client_moniker + ']签约[' + - '' + apply.channel + ']服务服务内容:[' + - '' + apply.title + ']需要扣款[' + - 'AUD ' + apply.amount + ']申请人[' + + '' + apply.channel + ']
服务服务内容:[' + + '' + apply.title + ']
需要扣款[' + + 'AUD ' + apply.amount + ']
手续费附加[' + + ' ' + apply.surcharge_rate + '%]
申请人[' + ' ' + apply.apply_username + ']' + '
请确认是否拒绝申请' ); diff --git a/src/main/ui/static/rservicesapply/templates/r-services-apply.html b/src/main/ui/static/rservicesapply/templates/r-services-apply.html index 624689fe4..0e7538f23 100644 --- a/src/main/ui/static/rservicesapply/templates/r-services-apply.html +++ b/src/main/ui/static/rservicesapply/templates/r-services-apply.html @@ -69,6 +69,7 @@ Compliance Status Service Name Amount + 附加手续费(%) Service Title Status Apply Username @@ -100,6 +101,7 @@ + {{apply.surcharge_rate}}% 待审核