|
|
|
@ -278,20 +278,23 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
public void changeSurchargeEnable(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
if(PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN){
|
|
|
|
|
if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) {
|
|
|
|
|
throw new ForbiddenException("You have no permission");
|
|
|
|
|
}
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Client not found, please check");
|
|
|
|
|
}
|
|
|
|
|
if (updateSurchargeDTO.getApiSurcharge() != null) {
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"api_surcharge",updateSurchargeDTO.getApiSurcharge()));
|
|
|
|
|
clientModifySupport.processClientConfigModify(
|
|
|
|
|
new SwitchPermissionModify(account, client.getString("client_moniker"), "api_surcharge", updateSurchargeDTO.getApiSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
if (updateSurchargeDTO.getQrcodeSurcharge() != null) {
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"qrcode_surcharge",updateSurchargeDTO.getQrcodeSurcharge()));
|
|
|
|
|
clientModifySupport.processClientConfigModify(
|
|
|
|
|
new SwitchPermissionModify(account, client.getString("client_moniker"), "qrcode_surcharge", updateSurchargeDTO.getQrcodeSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
if (updateSurchargeDTO.getRetailSurcharge() != null) {
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"retail_surcharge",updateSurchargeDTO.getRetailSurcharge()));
|
|
|
|
|
clientModifySupport.processClientConfigModify(
|
|
|
|
|
new SwitchPermissionModify(account, client.getString("client_moniker"), "retail_surcharge", updateSurchargeDTO.getRetailSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -341,7 +344,7 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
public JSONObject getAuthFiles(JSONObject device) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
return clientManager.getAuthFiles(account,client.getString("client_moniker"));
|
|
|
|
|
return clientManager.getAuthFiles(account, client.getString("client_moniker"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -351,24 +354,24 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
clientAuthFilesInfo.setFile_id_info(null);
|
|
|
|
|
clientAuthFilesInfo.setAuthStatus(0);
|
|
|
|
|
clientAuthFilesInfo.setFile_agreement_info(null);
|
|
|
|
|
clientManager.uploadAuthFiles(account,client.getString("client_moniker"),clientAuthFilesInfo);
|
|
|
|
|
clientManager.uploadAuthFiles(account, client.getString("client_moniker"), clientAuthFilesInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateMerchantInfo(JSONObject device, ClientUpdateInfo clientRegisterInfo) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
if(PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN){
|
|
|
|
|
if (PartnerRole.getRole(account.getIntValue("role")) != PartnerRole.ADMIN) {
|
|
|
|
|
throw new ForbiddenException("You have no permission");
|
|
|
|
|
}
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Client not found, please check");
|
|
|
|
|
}
|
|
|
|
|
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
|
|
|
|
|
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4) {
|
|
|
|
|
JSONObject record = clientRegisterInfo.appClientInfo();
|
|
|
|
|
record.put("client_moniker",client.getString("client_moniker"));
|
|
|
|
|
clientManager.updateClientRegisterInfoV2(null,client.getString("client_moniker"),record);
|
|
|
|
|
}else {
|
|
|
|
|
record.put("client_moniker", client.getString("client_moniker"));
|
|
|
|
|
clientManager.updateClientRegisterInfoV2(null, client.getString("client_moniker"), record);
|
|
|
|
|
} else {
|
|
|
|
|
throw new BadRequestException("已通过审核,暂不能提交和修改");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -377,13 +380,13 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
public void applyToCompliance(JSONObject device) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
if(client==null){
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Merchant Not Found");
|
|
|
|
|
}
|
|
|
|
|
if(account==null){
|
|
|
|
|
if (account == null) {
|
|
|
|
|
throw new NotFoundException("Account Not Found");
|
|
|
|
|
}
|
|
|
|
|
clientManager.applyToCompliance(client.getString("client_moniker"),account);
|
|
|
|
|
clientManager.applyToCompliance(client.getString("client_moniker"), account);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -391,15 +394,15 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
public JSONObject sendVerifyEmail(JSONObject device) {
|
|
|
|
|
JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id"));
|
|
|
|
|
JSONObject account = clientAccountMapper.findById(device.getString("account_id"));
|
|
|
|
|
if(client==null){
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Merchant Not Found");
|
|
|
|
|
}
|
|
|
|
|
if(account==null){
|
|
|
|
|
if (account == null) {
|
|
|
|
|
throw new NotFoundException("Account Not Found");
|
|
|
|
|
}
|
|
|
|
|
clientManager.sendVerifyEmail(client,account.getString("account_id"));
|
|
|
|
|
clientManager.sendVerifyEmail(client, account.getString("account_id"));
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
result.put("email",client.getString("contact_email"));
|
|
|
|
|
result.put("email", client.getString("contact_email"));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -440,9 +443,14 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
public JSONObject getClientInfoMe(JSONObject device) {
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(client.getString("store_photo"))|| StringUtils.isEmpty(client.getString("logo_url"))|| StringUtils.isEmpty(client.getString("company_photo"))) {
|
|
|
|
|
if(StringUtils.isEmpty(client.getString("business_structure"))||
|
|
|
|
|
StringUtils.isEmpty(client.getString("logo_url"))||
|
|
|
|
|
StringUtils.isEmpty(client.getString("description")) ||
|
|
|
|
|
("Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("acn")))||
|
|
|
|
|
(!"Company".equals(client.getString("business_structure")) && StringUtils.isEmpty(client.getString("abn")))||
|
|
|
|
|
(StringUtils.isEmpty(client.getString("company_website")) && StringUtils.isEmpty(client.getString("company_photo")) &&StringUtils.isEmpty(client.getString("store_photo")))) {
|
|
|
|
|
result.put("base_info_lack", true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
JSONObject file = clientManager.getAuthFiles(null, client.getString("client_moniker"));
|
|
|
|
|
for (String s : fileName) {
|
|
|
|
@ -670,10 +678,10 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "Wechat":
|
|
|
|
|
JSONObject weUser = new JSONObject();
|
|
|
|
|
if (customer_id.startsWith("olH")){
|
|
|
|
|
JSONObject weUser = new JSONObject();
|
|
|
|
|
if (customer_id.startsWith("olH")) {
|
|
|
|
|
weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
weUser = customerMapper.findCustomerByOpenId(customer_id);
|
|
|
|
|
}
|
|
|
|
|
if (weUser != null && !weUser.isEmpty()) {
|
|
|
|
|