[R]只能提交一张

master
liuxinxin 5 years ago
parent fe20ca1f1c
commit bbcdf0f0ac

@ -38,6 +38,8 @@ public interface ClientFilesMapper {
List<JSONObject> findAllClientFile(@Param("client_id") int clientId);
List<JSONObject> findRepetitiveFiles(@Param("client_id") int clientId,@Param("file_name") String fileType);
@AutoSql(type = SqlType.SELECT)
JSONObject findFileById(@Param("file_id") String file_id);

@ -3601,8 +3601,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
int clientId = client.getIntValue("client_id");
try {
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info(),fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(),fileResult);
updateFilesForWaitAuditWithoutRepeat(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info(),fileResult);
updateFilesForWaitAuditWithoutRepeat(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(),fileResult);
updateSysClientFilesForWaitCompliance(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info(),fileResult);
} catch (Exception e) {
logger.error("上传KYC文件失败", e);
@ -3989,6 +3989,36 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
public void updateFilesForWaitAuditWithoutRepeat(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) {
String[] values = fileValue.split(",");
List<JSONObject> repetitiveFiles = clientFilesMapper.findRepetitiveFiles(clientId,fileType);
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", value);
fileJson.put("status", 0);
fileJson.put("is_valid", 1);
clientFilesMapper.save(fileJson);
logger.info(clientId + "的fileType文件上传成功" + fileJson.getString("file_id"));
JSONObject file = new JSONObject();
file.put("file_id", fileJson.getString("file_id"));
file.put("file_value", fileJson.getString("file_value"));
fileResult.add(file);
}
if(repetitiveFiles != null){
for(JSONObject repetitiveFile : repetitiveFiles){
clientFilesMapper.deleteByClientAndFileId(repetitiveFile.getString("file_id"));
}
}
}
}
public void updateAggregateFilesForWaitCompliance(JSONObject manager, int clientId, String fileType, String fileValue, List<JSONObject> fileResult) {
if (fileValue != null) {
List<JSONObject> passAggregateFiles = clientFilesMapper.findClientPassAggreeFile(clientId);

@ -758,7 +758,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
String fileKey = KYC_FILE_KEYS[i];
if (clientFiles != null && clientFiles.size() > 0) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2)))
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 2|| fileJson.getIntValue("status") == 3)))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
@ -772,11 +772,10 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
fileJson.put("key", KYC_PUT_KEYS[i]);
fileJson.put("name", KYC_FILE_NAMES[i]);
fileJson.put("file_value", clientFileUrl);
fileJson.put("file_write", false);
result.put(fileKey,fileJson);
} else {
List<JSONObject> clientBackToFileUrl = clientFiles.stream()
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3)))
.filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1)))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
@ -797,7 +796,6 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
fileJson.put("file_value", clientBackToFileUrl);
}
}
fileJson.put("file_write", true);
result.put(fileKey,fileJson);
}
}else {
@ -806,7 +804,6 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
JSONObject fileJson = new JSONObject();
fileJson.put("key", KYC_PUT_KEYS[c]);
fileJson.put("name", KYC_FILE_NAMES[c]);
fileJson.put("file_write", true);
result.put(key,fileJson);
}
}

@ -25,6 +25,19 @@
and file_name='client_agree_file'
and status != 1
</select>
<select id="findRepetitiveFiles" resultType="com.alibaba.fastjson.JSONObject">
SELECT
*
FROM
sys_files
WHERE
client_id = #{client_id}
AND STATUS IN ( 0, 3 )
AND file_name = #{file_name}
AND is_valid = 1
</select>
<select id="findAllClientFile" resultType="com.alibaba.fastjson.JSONObject">
select * from sys_files where is_valid = 1
and client_id = #{client_id}

@ -19,8 +19,11 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
app.controller('clientCommitToKycFilesCtrl', ['$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 || {};
$scope.file.id_type = $scope.file.file_company.id_type||"";
if($scope.file.file_company){
$scope.file.id_type = $scope.file.file_company.id_type||"";
}else{
$scope.file.id_type = "";
}
$scope.file.need_bd = true;
//audit files

Loading…
Cancel
Save