Merge remote-tracking branch 'origin/develop' into develop

master
yixian 4 years ago
commit 17d257a30f

@ -5,11 +5,11 @@
<parent> <parent>
<groupId>au.com.royalpay.payment</groupId> <groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId> <artifactId>payment-parent</artifactId>
<version>2.2.20</version> <version>2.2.21</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.3.70</version> <version>2.3.72</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -1,31 +1,22 @@
package au.com.royalpay.payment.manage.riskbusiness.core.impl; package au.com.royalpay.payment.manage.riskbusiness.core.impl;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskEventMapper;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskFileMapper;
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper; import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskMaterialMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService; import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum; import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring5.SpringTemplateEngine;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException;
import java.util.Date; import java.util.Date;
import java.util.List;
@Service @Service
public class RiskUploadServiceIpml implements RiskUploadService { public class RiskUploadServiceIpml implements RiskUploadService {
@ -55,12 +46,12 @@ public class RiskUploadServiceIpml implements RiskUploadService {
material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id")); material.put("material_id",riskMaterialMapper.findAllMaterials(riskId).get(0).getString("material_id"));
for(int i=1;i<=10;i++){ for(int i=1;i<=10;i++){
if(material.containsKey("file"+i+"_url")){ if(material.containsKey("file"+i+"_url")){
List<String> urls = (List<String>)material.get("file"+i+"_url"); JSONArray urls = material.getJSONArray("file" + i + "_url");
if (urls == null || urls.isEmpty()) if (urls == null || urls.isEmpty())
continue; continue;
for(String url:urls){ for(Object url:urls){
JSONObject file = new JSONObject(); JSONObject file = new JSONObject();
file.put("file_url",url); file.put("file_url",url.toString());
file.put("file_type",i); file.put("file_type",i);
file.put("material_id",material.getString("material_id")); file.put("material_id",material.getString("material_id"));
riskFileMapper.save(file); riskFileMapper.save(file);

@ -55,6 +55,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.pagination = resp.data.pagination; $scope.pagination = resp.data.pagination;
}); });
}; };
$scope.linkButton = function (obj) { $scope.linkButton = function (obj) {
var partner = angular.copy(obj); var partner = angular.copy(obj);
partner.link = true; partner.link = true;
@ -153,12 +154,36 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
}); });
}; };
$scope.pass = function (obj) { $scope.pass = function (partner) {
$uibModal.open({
$http.get('/sys/partners/init/merchant_code').then(function (response) {
partner.client_moniker = response.data.partner_code;
console.log('partner.client_moniker',partner.client_moniker)
console.log('partner',partner)
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
controller: 'passApplicationCtrl',
resolve: {
partner: partner
}
}).result.then(function () {
commonDialog.alert({
title: 'Success',
content: 'Pass Successfully ! 您成功建立了新的商户,请及时完善信息。',
type: 'success'
});
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
})
});
/*$uibModal.open({
templateUrl: '/static/payment/partner/templates/partner_application_pass.html', templateUrl: '/static/payment/partner/templates/partner_application_pass.html',
controller: 'passApplicationCtrl', controller: 'passApplicationCtrl',
resolve: { resolve: {
partner: obj partner: obj,
isPass:true
} }
}).result.then(function () { }).result.then(function () {
commonDialog.alert({ commonDialog.alert({
@ -167,7 +192,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
type: 'success' type: 'success'
}); });
// $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true}); // $state.go('partner_application.detail', {client_apply_id: obj.client_apply_id}, {reload: true});
}) })*/
}; };
$scope.updateRemark = function () { $scope.updateRemark = function () {
var obj = angular.copy($scope.partner); var obj = angular.copy($scope.partner);
@ -177,6 +205,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}]); }]);
app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) { app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.partner = angular.copy(partner); $scope.partner = angular.copy(partner);
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
$scope.submit = function (form) { $scope.submit = function (form) {
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {
@ -198,6 +228,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}); });
//$rootScope.partner_application = $scope.client; //$rootScope.partner_application = $scope.client;
}; };
$scope.initMerchantCode=function(){
$http.get('/sys/partners/init/merchant_code').then(function (response) {
$scope.partner.client_moniker = response.data.partner_code;
console.log('refresh',$scope.partner.client_moniker)
$scope.merchantCodeChecked = true;
$scope.merchantIsValid = true;
});
};
$scope.checkMerchantCodeIsValid = function (code) {
if (code.length != 4) {
$scope.merchantCodeChecked = false;
$scope.merchantIsValid = false;
return;
}
$http.get('/sys/partners/init/check_code_isvalid', {params: {clientMoniker: code}}).then(function (response) {
$scope.merchantIsValid = response.data;
$scope.merchantCodeChecked = true;
});
};
$scope.link = function (form) { $scope.link = function (form) {
if (form.$invalid) { if (form.$invalid) {
angular.forEach(form, function (item, key) { angular.forEach(form, function (item, key) {

@ -7,13 +7,20 @@
<form name="partnerForm" novalidate> <form name="partnerForm" novalidate>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':partnerForm.client_moniker.$invalid && partnerForm.client_moniker.$dirty}"> ng-class="{'has-error':partnerForm.client_moniker.$invalid && partnerForm.client_moniker.$dirty}">
<label class="control-label col-sm-6" for="short-id-input">Partner Code(4 Letters or <label class="control-label col-sm-4" for="short-id-input">* Partner Code(4 Letters or
Numbers)</label> Numbers)</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control text-uppercase" ng-model="partner.client_moniker" <input ng-if="!partner.link" class="form-control text-uppercase" ng-model="partner.client_moniker"
type="text" type="text"
name="client_moniker" name="client_moniker"
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/"> id="short-id-pass-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/">
<input ng-if="partner.link" class="form-control text-uppercase"
ng-model="partner.client_moniker"
type="text"
name="client_moniker"
id="short-id-input" required maxlength="4" ng-pattern="/^[a-zA-Z0-9]+$/"
ng-change="checkMerchantCodeIsValid(partner.client_moniker)">
<p class="small text-info">No further changeable!</p> <p class="small text-info">No further changeable!</p>
<div ng-messages="partnerForm.client_moniker.$error" <div ng-messages="partnerForm.client_moniker.$error"
ng-if="partnerForm.client_moniker.$dirty"> ng-if="partnerForm.client_moniker.$dirty">
@ -23,6 +30,11 @@
Numbers are allowed</p> Numbers are allowed</p>
</div> </div>
</div> </div>
<a ng-if="!partner.link" style="display: inline-block" role="button" ng-click="initMerchantCode(partner)"><i class="fa fa-refresh" title="Refreshes the partner code"></i></a>
<span ng-if="!partner.link&&merchantCodeChecked">
<i ng-if="merchantIsValid" class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none;padding-left: 20px"></i>
<i ng-if="!merchantIsValid" class="text-danger fa fa-close" style="float: none;padding-left: 20px"></i>
</span>
</div> </div>
</form> </form>
</div> </div>
@ -35,4 +47,4 @@
<button type="button" class="btn btn-danger" ng-click="$dismiss()">Cancel</button> <button type="button" class="btn btn-danger" ng-click="$dismiss()">Cancel</button>
<button type="button" ng-if="!partner.link" class="btn btn-success" ng-click="submit(partnerForm)">PASS</button> <button type="button" ng-if="!partner.link" class="btn btn-success" ng-click="submit(partnerForm)">PASS</button>
<button type="button" ng-if="partner.link" class="btn btn-success" ng-click="link(partnerForm)">Link</button> <button type="button" ng-if="partner.link" class="btn btn-success" ng-click="link(partnerForm)">Link</button>
</div> </div>

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.valid; package au.com.royalpay.payment.manage.valid;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatter;
@ -17,4 +19,29 @@ public class TestJodaFormat {
String dateStr = formatter.print(new DateTime(new Date())); String dateStr = formatter.print(new DateTime(new Date()));
System.out.println(dateStr); System.out.println(dateStr);
} }
@Test
public void testSubmitMaterial() {
JSONObject material = new JSONObject();
material.put("file1_url",new JSONArray(){{
add("https://open.yeepay.com/docs/v2/products/cbp/apis/options__rest__v1.0__kj__fe__query/index.html");
add("https://www.baidu.com");
}});
for(int i=1;i<=10;i++){
if(material.containsKey("file"+i+"_url")){
JSONArray urls = material.getJSONArray("file" + i + "_url");
if (urls == null || urls.isEmpty())
continue;
for(Object url:urls){
JSONObject file = new JSONObject();
file.put("file_url",url);
file.put("file_type",i);
}
}
}
}
} }

Loading…
Cancel
Save