|
|
|
@ -40,7 +40,6 @@ import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class KycServiceImpl implements KycService {
|
|
|
|
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
@Resource
|
|
|
|
|
private MailService mailService;
|
|
|
|
@ -207,7 +206,7 @@ public class KycServiceImpl implements KycService {
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id"));
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), manager);
|
|
|
|
|
JSONObject kycInfo = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"));
|
|
|
|
|
if (kycInfo == null || kycInfo.getIntValue("status") != 9) {
|
|
|
|
|
throw new BadRequestException("This Partner is not application submitted");
|
|
|
|
@ -222,7 +221,7 @@ public class KycServiceImpl implements KycService {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
if (account.containsKey("manager_id")) {
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), account.getString("manager_id"));
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), account);
|
|
|
|
|
}
|
|
|
|
|
int sourceEnum = 2;
|
|
|
|
|
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
|
|
|
|
@ -284,7 +283,7 @@ public class KycServiceImpl implements KycService {
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id"));
|
|
|
|
|
checkClientBelongBd(client.getIntValue("client_id"), manager);
|
|
|
|
|
clientManager.uploadKycFilesForWaitCompliance(manager, clientMoniker, kycFilesInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -298,41 +297,26 @@ public class KycServiceImpl implements KycService {
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkClientBelongBd(file.getIntValue("client_id"), manager.getString("manager_id"));
|
|
|
|
|
checkClientBelongBd(file.getIntValue("client_id"), manager);
|
|
|
|
|
clientFilesMapper.deleteByClientAndFileId(fileId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) {
|
|
|
|
|
//todo 可支持bdleader查看组内bd商户kyc情况
|
|
|
|
|
// if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
// JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id"));
|
|
|
|
|
// if (bdConfig != null) {
|
|
|
|
|
// params.put("bd_group", bdConfig.getString("bd_group"));
|
|
|
|
|
// List<JSONObject> listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group"));
|
|
|
|
|
// List<String> bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList());
|
|
|
|
|
// if (params.containsKey("bd_user")) {
|
|
|
|
|
// if (!bdUserId.contains(params.getString("bd_user"))) {
|
|
|
|
|
// params.remove("bd_user");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (query.isOnlyMe()) {
|
|
|
|
|
// params.put("bd_user", manager.getString("manager_id"));
|
|
|
|
|
// if (params.containsKey("bd_group")) {
|
|
|
|
|
// params.remove("bd_group");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
params.put("bd_user", manager.getString("manager_id"));
|
|
|
|
|
}
|
|
|
|
|
//todo 如果是合规,增加bd_user为customerService
|
|
|
|
|
if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
params.put("bd_user", "186");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkClientBelongBd(int clientId, String managerId) {
|
|
|
|
|
int permissionInt = clientBDMapper.checkBDPermission(clientId, managerId);
|
|
|
|
|
private void checkClientBelongBd(int clientId, JSONObject manager) {
|
|
|
|
|
if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
manager.put("manager_id","186");
|
|
|
|
|
}
|
|
|
|
|
int permissionInt = clientBDMapper.checkBDPermission(clientId, manager.getString("manager_id"));
|
|
|
|
|
if (permissionInt < 1) {
|
|
|
|
|
// throw new BadRequestException("This Partner is not belongs to you");
|
|
|
|
|
throw new BadRequestException("This Partner is not belongs to you");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|