[R]KCY认证Web端开发

master
liuxinxin 5 years ago
parent 024d2ae611
commit 0b7616f212

@ -0,0 +1,55 @@
package au.com.royalpay.payment.manage.mappers.system;
import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect;
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
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 java.util.List;
/**
* Created by yishuqian on 06/03/2017.
*/
@AutoMapper(tablename = "sys_asic_files", pkName = "file_id")
public interface ClientAsicFilesMapper {
@AutoSql(type = SqlType.INSERT)
void save(JSONObject partner);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject partner);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1")
List<JSONObject> findClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'")
List<JSONObject> findClientPassAggreeFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'")
List<JSONObject> findClientAggreeFileCommit(@Param("client_id") int clientId);
List<JSONObject> findAllClientFile(@Param("client_id") int clientId);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileById(@Param("file_id") String file_id);
List<JSONObject> findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name);
JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId);
void deleteByClientAndFileId(@Param("file_id") String file_id);
void deleteAggreeByClientId(@Param("client_id") int file_id);
void confirmAgreeFile(@Param("client_id") int client_id);
void updateBeforeCompliance(@Param("client_id") int client_id);
void refuseCompliance(@Param("client_id") int client_id);
void passCompliance(@Param("client_id") int client_id);
}

@ -248,6 +248,8 @@ public interface ClientManager {
JSONObject getAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAsicFiles(JSONObject manager, String clientMoniker);
JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker);

@ -230,6 +230,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientFilesMapper clientFilesMapper;
@Resource
private ClientAsicFilesMapper clientAsicFilesMapper;
@Resource
private TransactionMapper transactionMapper;
@ -3384,6 +3387,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileJson;
}
@Override
public JSONObject getAsicFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientAsicFilesMapper.findClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
for (JSONObject file : clientFiles) {
fileJson.put(file.getString("file_name"), file.getString("file_value"));
}
return fileJson;
}
@Override
public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -524,6 +524,12 @@ public class PartnerViewController {
return clientManager.getAuthFiles(null,account.getString("client_moniker"));
}
@PartnerMapping(value = "/asic/files", method = RequestMethod.GET)
@ResponseBody
public JSONObject asicFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getAsicFiles(null,account.getString("client_moniker"));
}
@PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET)
@ResponseBody
public JSONObject complianceInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {

@ -74,6 +74,15 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
url: '/devices',
templateUrl: '/static/payment/partner/templates/client_devices.html',
controller: 'clientDeviceCtrl'
}).state('basic.asic_files', {
url: '/{client_moniker}/asic_files',
templateUrl: '/static/payment/partner/templates/client_asic_files.html',
controller: 'clientASICFilesCtrl',
resolve: {
asicFile: ['$http', function ($http) {
return $http.get('/client/partner_info/asic/files');
}]
}
})
}]);
app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'stateMap', 'partner', 'industryMap', 'businessStructuresMap', 'commonDialog', 'Upload', '$state', function ($scope, $http, stateMap, partner, industryMap, businessStructuresMap, commonDialog, Upload, $state) {
@ -856,6 +865,219 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
}
};
}]);
app.controller('clientASICFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, asicFile) {
$scope.asicFile = asicFile.data || {};
//asic files
debugger;
$scope.id_type = 'passport';
$scope.uploadAsicFile = function (file) {
debugger;
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.AsicFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.AsicFileProgress;
$scope.asicFile.file_bank_info = resp.data.url;
$scope.updateFile();
if ($scope.asicFile.file_bank_info.endsWith('pdf')) {
$scope.AsicIsImage = false;
} else {
$scope.AsicIsImage = true;
}
}, function (resp) {
delete $scope.AsicFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.AsicFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.agreeIsImage = true;
if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) {
$scope.agreeIsImage = false;
}
$scope.bankIsImage = true;
if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
}
$scope.companyIsImage = true;
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
}
$scope.applyIsImage = true;
if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
}
$scope.idIsImage = true;
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) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.companyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.companyFileProgress;
$scope.file.file_company_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_company_info.endsWith('pdf')) {
$scope.companyIsImage = false;
} else {
$scope.companyIsImage = true;
}
}, function (resp) {
delete $scope.companyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传ID信息
$scope.uploadIDFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.idFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.idFileProgress;
$scope.file.file_id_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
} else {
$scope.idIsImage = true;
}
}, function (resp) {
delete $scope.idFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.idFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传协议文件
$scope.uploadAgreementFile = function (file) {
if (file != null) {
if (file.size > 10 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB请压缩后重试', type: 'error'})
} else {
$scope.agreementFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.agreementFileProgress;
$scope.file.file_agreement_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_agreement_info.endsWith('pdf')) {
$scope.agreeIsImage = false;
} else {
$scope.agreeIsImage = true;
}
}, function (resp) {
delete $scope.agreementFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传申请表
$scope.uploadApplyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.applyFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.applyFileProgress;
$scope.file.file_apply_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_apply_info.endsWith('pdf')) {
$scope.applyIsImage = false;
} else {
$scope.applyIsImage = true;
}
}, function (resp) {
delete $scope.applyFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
/* $scope.downloadAsZip = function () {
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
return url;
};
*/
$scope.updateFile = function () {
$http.put('/client/partner_info/update/file', $scope.file).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Upload Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
};
function commitError() {
commonDialog.alert({
title: 'Error',
content: 'Missing file',
type: 'error'
});
};
$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) {
});
} else {
commitError();
}
} else {
commitError();
}
};
}]);
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 || {};

@ -0,0 +1,73 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">* ASIC Files</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadAsicFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
<a ng-if="asicFile.asic_file" role="button" class="btn-group btn btn-warning" type="button" ng-href="{{asicFile.asic_file}}" target="_blank"><i class="fa fa-download"></i></a>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="AsicProgress.value" ng-if="AsicFileProgress"></uib-progressbar>
<a ng-if="AsicIsImage" target="_blank" ng-href="{{asicfile.asic_file}}">
<img ng-src="{{asicfile.asic_file}}" class="col-sm-8"></a>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<p>Example请保证图片信息清晰可见,如下图</p>
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488859920633_5ruVtDa30yY2ytBSDAAqxg0Ob2nreh.jpeg">
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-4 col-sm-2">
<select class="form-control" ng-model="id_type">
<option value="passport">Passport</option>
<option value="driver_license">Driver's license</option>
</select>
</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)" >
<i class="fa fa-upload"></i> Upload
</button>
<a ng-if="asicFile.client_id_file" role="button" class="btn-group btn btn-warning" type="button" ng-href="{{asicFile.client_id_file}}" target="_blank"><i class="fa fa-download"></i></a>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<a ng-if="idIsImage" ng-href="{{asicFile.client_id_file}}" target="_blank">
<img ng-src="{{asicFile.client_id_file}}" class="col-sm-8"></a>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<div class="col-sm-6">
<p>Example请保证图片(护照或驾照)信息清晰可见,如下图</p>
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725651779_OPiqOP1dGnTpaxPsCR3P9lVrp4384b.jpg">
</div>
<div class="col-sm-6">
<br/>
<br/>
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725678615_Bv2tzUtihY5U6YK9ScveXzKkVWOnrF.jpg">
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -53,6 +53,10 @@
<a ui-sref=".compliance_files">Compliance files</a>
</li>
<li ui-sref-active="active">
<a ui-sref=".asic_files">ASIC files</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div ng-show="(partner.source == 4 && (partner.approve_result ==3 || partner.approve_result == 1) ) || partner.source != 4">

Loading…
Cancel
Save