|
|
|
@ -96,6 +96,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
|
import io.jsonwebtoken.lang.Assert;
|
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
|
@ -786,7 +787,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
partner.put("ali_sub_merchant_id", registery.getClientMoniker());
|
|
|
|
|
partner.put("credential_code", RandomStringUtils.random(32, true, true));
|
|
|
|
|
partner.put("creator", manager.getString("manager_id"));
|
|
|
|
|
partner.put("org_id", manager.getIntValue("org_id"));
|
|
|
|
|
int orgId = manager.getIntValue("org_id");
|
|
|
|
|
partner.put("org_id", orgId);
|
|
|
|
|
JSONObject org = orgMapper.findOne(orgId);
|
|
|
|
|
Assert.notNull(orgId, "Merchant Org shall not be null");
|
|
|
|
|
JSONObject orgDefaultClientProfile = org.getJSONObject("default_client_profile");
|
|
|
|
|
if (StringUtils.isNotEmpty(registery.getLogoId())) {
|
|
|
|
|
partner.put("logo_url", attachmentClient.getFileUrl(registery.getLogoId()));
|
|
|
|
|
partner.put("logo_thumbnail", attachmentClient.getThumbnail(registery.getLogoId(), 600).getString("url"));
|
|
|
|
@ -803,6 +808,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (clientMapper.findClientByMoniker(registery.getClientMoniker()) != null) {
|
|
|
|
|
throw new BadRequestException("error.partner.valid.dumplicate_client_moniker");
|
|
|
|
|
}
|
|
|
|
|
if (orgDefaultClientProfile != null) {
|
|
|
|
|
orgDefaultClientProfile.forEach(partner::putIfAbsent);
|
|
|
|
|
}
|
|
|
|
|
clientMapper.save(partner);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
@ -813,6 +821,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
clientConfig.put("client_pay_desc", partner.get("client_pay_desc"));
|
|
|
|
|
clientConfig.put("enable_cross_payment", partner.get("enable_cross_payment"));
|
|
|
|
|
clientConfig.put("enable_card_payment", partner.get("enable_card_payment"));
|
|
|
|
|
if (orgDefaultClientProfile != null) {
|
|
|
|
|
orgDefaultClientProfile.forEach(clientConfig::putIfAbsent);
|
|
|
|
|
}
|
|
|
|
|
clientConfigService.save(clientConfig);
|
|
|
|
|
permissionPartnerManagerImpl.permissionClientModuleSave(partner.getIntValue("client_id"), partner.getString("client_moniker"));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|