|
|
|
@ -106,7 +106,6 @@ import org.springframework.ui.Model;
|
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import org.thymeleaf.context.Context;
|
|
|
|
|
import org.thymeleaf.spring5.SpringTemplateEngine;
|
|
|
|
@ -124,11 +123,12 @@ import java.math.RoundingMode;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.net.URLDecoder;
|
|
|
|
|
import java.security.*;
|
|
|
|
|
import java.security.InvalidParameterException;
|
|
|
|
|
import java.security.KeyPair;
|
|
|
|
|
import java.security.interfaces.RSAPrivateKey;
|
|
|
|
|
import java.security.interfaces.RSAPublicKey;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
@ -271,8 +271,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientConfigMapper clientConfigMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private PermissionPartnerModuleMapper permissionPartnerModuleMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private PermissionPartnerManagerImpl permissionPartnerManagerImpl;
|
|
|
|
|
@Resource
|
|
|
|
|
private RiskAttentionMerchantsMapper riskAttentionMerchantsMapper;
|
|
|
|
@ -360,7 +358,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (manager != null) {
|
|
|
|
|
checkClientOrg(manager, client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String same_phone = clientMapper.findSamePhone(client.getString("contact_phone")).getString("a");
|
|
|
|
|
if (same_phone != null && client.getString("contact_phone") != null && same_phone.contains(" ")) {
|
|
|
|
|
same_phone = same_phone.replace(client.getString("client_moniker"), "");
|
|
|
|
@ -1584,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
|
|
|
|
|
private void checkPhoneAndWechatExist(NewAccountBean account) {
|
|
|
|
|
List<JSONObject> accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code());
|
|
|
|
|
if ( accounts != null && accounts.size()>0) {
|
|
|
|
|
if (accounts != null && accounts.size() > 0) {
|
|
|
|
|
throw new BadRequestException("Mobile phone number has been bound to other accounts");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1657,13 +1654,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (account == null) {
|
|
|
|
|
throw new BadRequestException("account not exists");
|
|
|
|
|
}
|
|
|
|
|
if(user.getString("openid")!=null && !"".equals(user.getString("openid"))) {
|
|
|
|
|
if (user.getString("openid") != null && !"".equals(user.getString("openid"))) {
|
|
|
|
|
if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) {
|
|
|
|
|
throw new BadRequestException("The WeChat has been linked to other accounts");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(user.getString("unioinid")!=null && !"".equals(user.getString("unioinid"))){
|
|
|
|
|
if(clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0 ){
|
|
|
|
|
if (user.getString("unioinid") != null && !"".equals(user.getString("unioinid"))) {
|
|
|
|
|
if (clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size() > 0) {
|
|
|
|
|
throw new BadRequestException("The WeChat has been linked to other accounts");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -5903,76 +5900,76 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
return key;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JSONObject partnerIncrementalService(String clientMoniker){
|
|
|
|
|
public JSONObject partnerIncrementalService(String clientMoniker) {
|
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
|
|
|
|
if(client==null){
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
List<JSONObject> service = clientIncrementalMapper.findAllByclientMoniker(client.getInteger("client_id"));
|
|
|
|
|
List<String> incrementalChannels = new ArrayList<>();
|
|
|
|
|
List<String> incrementalChannels = new ArrayList<>();
|
|
|
|
|
for (IncrementalChannel e : IncrementalChannel.values()) {
|
|
|
|
|
boolean exist = false;
|
|
|
|
|
for(JSONObject s : service){
|
|
|
|
|
exist = e.getChannel().equals(s.getString("channel"));
|
|
|
|
|
if(exist){
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!exist){
|
|
|
|
|
incrementalChannels.add(e.getChannel());
|
|
|
|
|
}
|
|
|
|
|
for (JSONObject s : service) {
|
|
|
|
|
exist = e.getChannel().equals(s.getString("channel"));
|
|
|
|
|
if (exist) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!exist) {
|
|
|
|
|
incrementalChannels.add(e.getChannel());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
incrementalChannels.remove("system");
|
|
|
|
|
return new JSONObject(){{
|
|
|
|
|
put("all_service",service);
|
|
|
|
|
put("incremental_channel",incrementalChannels);
|
|
|
|
|
}};
|
|
|
|
|
return new JSONObject() {{
|
|
|
|
|
put("all_service", service);
|
|
|
|
|
put("incremental_channel", incrementalChannels);
|
|
|
|
|
}};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService,JSONObject manager){
|
|
|
|
|
public void changePartnerIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
|
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
|
|
|
|
if(client==null){
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel"));
|
|
|
|
|
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
|
|
|
|
|
JSONObject saveIncrementalService = new JSONObject();
|
|
|
|
|
if(existIncrementalService==null){
|
|
|
|
|
saveIncrementalService.put("incremental_id",UUID.randomUUID().toString());
|
|
|
|
|
saveIncrementalService.put("channel",incrementalService.getString("channel"));
|
|
|
|
|
saveIncrementalService.put("create_time",new Date());
|
|
|
|
|
saveIncrementalService.put("update_time",new Date());
|
|
|
|
|
saveIncrementalService.put("is_valid",1);
|
|
|
|
|
}else{
|
|
|
|
|
saveIncrementalService.put("incremental_id",incrementalService.getString("incremental_id"));
|
|
|
|
|
saveIncrementalService.put("update_time",new Date());
|
|
|
|
|
}
|
|
|
|
|
saveIncrementalService.put("client_id",client.getInteger("client_id"));
|
|
|
|
|
saveIncrementalService.put("operator",manager.getString("display_name"));
|
|
|
|
|
saveIncrementalService.put("incremental_mode",incrementalService.getInteger("incremental_mode"));
|
|
|
|
|
saveIncrementalService.put("incremental_rate_value",incrementalService.getInteger("incremental_mode")==1?incrementalService.getString("incremental_rate_value"):0);
|
|
|
|
|
saveIncrementalService.put("total_incremental_amount",incrementalService.getInteger("incremental_mode")!=1?incrementalService.getString("total_incremental_amount"):0);
|
|
|
|
|
if(existIncrementalService==null){
|
|
|
|
|
if (existIncrementalService == null) {
|
|
|
|
|
saveIncrementalService.put("incremental_id", UUID.randomUUID().toString());
|
|
|
|
|
saveIncrementalService.put("channel", incrementalService.getString("channel"));
|
|
|
|
|
saveIncrementalService.put("create_time", new Date());
|
|
|
|
|
saveIncrementalService.put("update_time", new Date());
|
|
|
|
|
saveIncrementalService.put("is_valid", 1);
|
|
|
|
|
} else {
|
|
|
|
|
saveIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
|
|
|
|
|
saveIncrementalService.put("update_time", new Date());
|
|
|
|
|
}
|
|
|
|
|
saveIncrementalService.put("client_id", client.getInteger("client_id"));
|
|
|
|
|
saveIncrementalService.put("operator", manager.getString("display_name"));
|
|
|
|
|
saveIncrementalService.put("incremental_mode", incrementalService.getInteger("incremental_mode"));
|
|
|
|
|
saveIncrementalService.put("incremental_rate_value", incrementalService.getInteger("incremental_mode") == 1 ? incrementalService.getString("incremental_rate_value") : 0);
|
|
|
|
|
saveIncrementalService.put("total_incremental_amount", incrementalService.getInteger("incremental_mode") != 1 ? incrementalService.getString("total_incremental_amount") : 0);
|
|
|
|
|
if (existIncrementalService == null) {
|
|
|
|
|
clientIncrementalMapper.save(saveIncrementalService);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
clientIncrementalMapper.update(saveIncrementalService);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager){
|
|
|
|
|
public void changeSwitchIncrementalService(String clientMoniker, JSONObject incrementalService, JSONObject manager) {
|
|
|
|
|
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
|
|
|
|
|
if(client==null){
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"),incrementalService.getString("channel"));
|
|
|
|
|
if(existIncrementalService==null){
|
|
|
|
|
JSONObject existIncrementalService = clientIncrementalMapper.findByClinetIdAndChannel(client.getInteger("client_id"), incrementalService.getString("channel"));
|
|
|
|
|
if (existIncrementalService == null) {
|
|
|
|
|
throw new BadRequestException("Incremental service is not exist");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
existIncrementalService.put("update_time",new Date());
|
|
|
|
|
existIncrementalService.put("incremental_id",incrementalService.getString("incremental_id"));
|
|
|
|
|
existIncrementalService.put("is_valid",incrementalService.getInteger("is_valid"));
|
|
|
|
|
existIncrementalService.put("operator",manager.getString("display_name"));
|
|
|
|
|
existIncrementalService.put("update_time", new Date());
|
|
|
|
|
existIncrementalService.put("incremental_id", incrementalService.getString("incremental_id"));
|
|
|
|
|
existIncrementalService.put("is_valid", incrementalService.getInteger("is_valid"));
|
|
|
|
|
existIncrementalService.put("operator", manager.getString("display_name"));
|
|
|
|
|
clientIncrementalMapper.update(existIncrementalService);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|