fix 代码优化

master
luoyang 5 years ago
parent 8524367385
commit f70cc938da

@ -1,4 +1,4 @@
package au.com.royalpay.payment.manage.compliance_audit.bean;
package au.com.royalpay.payment.manage.complianceAudit.bean;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.compliance_audit.core;
package au.com.royalpay.payment.manage.complianceAudit.core;
import au.com.royalpay.payment.manage.compliance_audit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import com.alibaba.fastjson.JSONObject;
@ -9,10 +9,11 @@ import com.alibaba.fastjson.JSONObject;
* Created by yishuqian on 18/10/2016.
*/
public interface ClientComplianceApply {
JSONObject listClientComplianceApply(JSONObject manager, ClientComplianceQuery apply);
void passComplianceFiles(JSONObject manager, JSONObject passInfo);
void refuseComplianceFiles(JSONObject manager, JSONObject refuseInfo);
JSONObject complianceAuthFile(JSONObject client);
void passComplianceFile(JSONObject manager,int clientId,JSONObject passInfo);
}

@ -1,18 +1,21 @@
package au.com.royalpay.payment.manage.compliance_audit.core.impl;
package au.com.royalpay.payment.manage.complianceAudit.core.impl;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.compliance_audit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.compliance_audit.core.ClientComplianceApply;
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.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
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.omg.CORBA.SystemException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@ -39,29 +42,6 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
return PageListUtils.buildPageListResult(partners);
}
@Override
public void passComplianceFiles(JSONObject manager, JSONObject passInfo) {
JSONObject pass = new JSONObject();
pass.put("operator_id", manager.getString("manager_id"));
pass.put("client_id",passInfo.getIntValue("client_id"));
clientComplianceCompanyMapper.passComplianceFiles(pass);
clientFilesMapper.passComplianceFiles(passInfo.getIntValue("client_id"));
}
@Override
public void refuseComplianceFiles(JSONObject manager, JSONObject refuseInfo) {
JSONObject refuse = new JSONObject();
refuse.put("operator_id", manager.getString("manager_id"));
refuse.put("client_id",refuseInfo.getIntValue("client_id"));
refuse.put("description",refuseInfo.getIntValue("description"));
clientComplianceCompanyMapper.refuseComplianceFiles(refuse);
clientFilesMapper.refuseComplianceFiles(refuseInfo.getIntValue("client_id"));
}
@Override
public JSONObject complianceAuthFile(JSONObject client)
{
@ -95,10 +75,16 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
@Override
public void passComplianceFile(JSONObject manager, int clientId, JSONObject passInfo) {
JSONObject pass = new JSONObject();
pass.put("operator_id", manager.getString("manager_id"));
pass.put("client_id",clientId);
clientComplianceCompanyMapper.passComplianceFiles(pass);
clientFilesMapper.passComplianceFiles(passInfo.getIntValue("client_id"));
JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId);
if (complianceDetail == null) {
throw new BadRequestException("无此记录");
}
if (complianceDetail.getIntValue("status") == 1) {
throw new BadRequestException("审核已通过,请避免重复操作");
}
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",1);
clientComplianceCompanyMapper.update(complianceDetail);
}
}

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.compliance_audit.web;
package au.com.royalpay.payment.manage.complianceAudit.web;
import au.com.royalpay.payment.manage.compliance_audit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.compliance_audit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager;
@ -31,12 +31,6 @@ public class ComplianceAuditController
return clientComplianceApply.listClientComplianceApply(manager,apply);
}
@RequestMapping(value = "/pass/complianceFiles",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public void passCompliances(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, JSONObject passInfo) {
}
@ManagerMapping(value = "/{clientId}/pass/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void addUploadPaymentLogo(@PathVariable int clientId, @RequestBody JSONObject passInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.passComplianceFile(manager,clientId,passInfo);
@ -45,7 +39,7 @@ public class ComplianceAuditController
@RequestMapping(value = "/refuse/complianceFiles",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public void refuseCompliances(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, JSONObject refuseInfo) {
clientComplianceApply.passComplianceFiles(manager,refuseInfo);
// clientComplianceApply.passComplianceFiles(manager,refuseInfo);
}
@RequestMapping(value = "/compliance/clientViewFiles/{client_id}",method = RequestMethod.GET)

@ -27,7 +27,4 @@ public interface ClientComplianceCompanyMapper {
PageList<JSONObject> listClientCompliances(JSONObject params, PageBounds pageBounds);
void passComplianceFiles(JSONObject pass);
void refuseComplianceFiles(JSONObject pass);
}

@ -42,9 +42,4 @@ public interface ClientFilesMapper {
void confirmAgreeFile(@Param("client_id") int client_id);
void updateBeforeCompliance(@Param("client_id") int client_id);
void passComplianceFiles(@Param("client_id") int client_id);
void refuseComplianceFiles(@Param("client_id") int client_id);
}

@ -22,7 +22,7 @@ import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.compliance_audit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
@ -110,8 +110,6 @@ import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@ -122,7 +120,6 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
@ -3287,16 +3284,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
public void updateSysClientFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue) {
if (fileValue != null) {
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", manager.getString("display_name"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功");
String[] values = fileValue.split(",");
for (String value : values) {
JSONObject fileJson = new JSONObject();
fileJson.put("client_id", clientId);
fileJson.put("last_update_date", new Date());
fileJson.put("last_update_by", manager.getString("display_name"));
fileJson.put("file_name", fileType);
fileJson.put("file_value", fileValue);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功");
}
}
}

@ -6,10 +6,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
url: '/partner/apply',
templateUrl: '/static/payment/partner/templates/partners_apply.html',
controller: 'partnerApplyCtrl'
}).state('partner_compliance_auth', {
url: '/partners/complianceForClient',
templateUrl: 'static/sys/templates/partner_compliance_for_client.html',
controller: 'compliancePartnerForClientCtrl'
}).state('partner_apply.partner_application', {
url: '/application',
templateUrl: '/static/payment/partner/templates/partner_application.html',
@ -23,37 +19,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
return $http.get('/partners/application/' + $stateParams.client_apply_id);
}]
}
}).state('partner_apply.compliance_detail', {
url: '/{client_id}/compliance_detail',
templateUrl: '/static/payment/partner/templates/client_compliance_to_auth.html',
controller: 'partnerComplianceCompanyDetail',
resolve: {
file: ['$http','$stateParams',function ($http, $stateParams) {
return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_id);
}]
}
})
}]);
app.controller('compliancePartnerForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap',
function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) {
$scope.pagination = {};
$scope.industries = industryMap.configs()
$scope.states = stateMap.configs();
$scope.countries = countryMap.configs();
$scope.params = {};
debugger;
$scope.loadClientCompliance = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/compliance/audit/listClientCompliances', {params: params}).then(function (resp) {
debugger;
$scope.compliances = resp.data.data;
$scope.pagination = resp.data.pagination;
});
};
$scope.loadClientCompliance(1);
}]);
app.controller('partnerApplyCtrl', ['$rootScope','$state', function ($rootScope,$state) {
if ($state.is('partner_apply')){
$state.go('.partner_application');
@ -126,7 +93,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}
}]);
app.controller('partnerApplicationDetailCtrl', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'partner', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, partner) {
$scope.partner = partner.data;
@ -196,26 +162,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}
}]);
app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) {
debugger;
$scope.file = file.data || {};
/*未完成*/
$scope.passPartnerComplianceFiles = function () {
$http.put('/compliance/audit/'+ $scope.file.client.client_id +'/pass/complianceFile',{}).then(function (resp) {
$scope.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
/*
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/upload_payment_logo', {logo_url: $scope.partner.logo_url})
*/
}]);
app.controller('passApplicationCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.partner = angular.copy(partner);
$scope.submit = function (form) {

@ -271,7 +271,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
};
//修改邮箱
$scope.updateEmail = function () {
$http.put('/client/partner_info/compliance_audit').then(
$http.put('/client/partner_info/complianceAudit').then(
);
};
@ -305,7 +305,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
}).then(function (choice) {
$scope.submitted = true;
if (choice == 1) {
$http.post('/client/partner_info/compliance_audit').then(function (){
$http.post('/client/partner_info/complianceAudit').then(function (){
commonDialog.alert({title: 'Success', content: '已提交至合规,请耐心等待审核!', type: 'info'});
$state.reload();
}, function () {
@ -748,7 +748,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
$scope.commitPartner = function () {
if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
$http.put('/client/partner_info/compliance_audit').then(function (resp) {
$http.put('/client/partner_info/complianceAudit').then(function (resp) {
});
} else {
@ -999,7 +999,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot
$scope.commitPartner = function () {
if ($scope.file) {
if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) {
$http.put('/client/partner_info/compliance_audit').then(function (resp) {
$http.put('/client/partner_info/complianceAudit').then(function (resp) {
});
} else {

@ -1,6 +1,6 @@
define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) {
'use strict';
var app = angular.module('partnerComplianceApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']);
var app = angular.module('complianceAuthFile', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('partner_compliance_auth', {
url: '/partners/complianceForClient',
@ -12,7 +12,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
controller: 'partnerComplianceCompanyDetail',
resolve: {
file: ['$http','$stateParams',function ($http, $stateParams) {
return $http.get('/partners/application/compliance/clientViewFiles/'+ $stateParams.client_id);
return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_id);
}]
}
})
@ -28,8 +28,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.loadClientCompliance = function (page) {
var params = angular.copy($scope.params);
params.page = page || $scope.pagination.page || 1;
$http.get('/partners/application/listClientCompliances', {params: params}).then(function (resp) {
debugger;
$http.get('/compliance/audit/listClientCompliances', {params: params}).then(function (resp) {
$scope.compliances = resp.data.data;
$scope.pagination = resp.data.pagination;
});
@ -38,20 +37,18 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
}]);
app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) {
debugger;
$scope.file = file.data || {};
/*未完成*/
$scope.passPartnerComplianceFiles = function () {
debugger;
$http.put('/partners/application/pass/complianceFiles' + $scope.account.account_id, $scope.account).then(function (resp) {
$http.put('/compliance/audit/pass/complianceFiles' + $scope.account.account_id, $scope.account).then(function (resp) {
$scope.$close();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/upload_payment_logo', {logo_url: $scope.partner.logo_url})
// $http.put('/sys/partners/' + $scope.partner.client_moniker + '/upload_payment_logo', {logo_url: $scope.partner.logo_url})
}]);

Loading…
Cancel
Save