|
|
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
import com.qtzl.alterSales.config.CenterAccountConfiguration; |
|
|
|
import com.qtzl.alterSales.manager.enums.CenterAccountApiEnum; |
|
|
|
import com.qtzl.alterSales.manager.enums.CenterAccountMobileChangeStatusEnum; |
|
|
|
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; |
|
|
|
import com.qtzl.alterSales.manager.model.protocol.account.request.CenterAccountRequest; |
|
|
|
import com.qtzl.alterSales.manager.model.protocol.account.response.CenterAccountPublicResponse; |
|
|
@@ -52,10 +53,10 @@ public abstract class CenterAccountAbstract { |
|
|
|
param.put("authToken", request.getAuthToken()); |
|
|
|
param.put("bizContent", AESTools.encrypt(JSON.toJSONString(request), centerAccountConfiguration.getSecretKey())); |
|
|
|
sign(param); |
|
|
|
log.info(apiEnum.getDescription() +"...入参...:" + (JSON.toJSONString(param).length() > 1000 ? JSON.toJSONString(param).substring(0, 1000) : JSON.toJSONString(param))); |
|
|
|
log.info(apiEnum.getDescription() + "...入参...:" + (JSON.toJSONString(param).length() > 1000 ? JSON.toJSONString(param).substring(0, 1000) : JSON.toJSONString(param))); |
|
|
|
final ResponseEntity<CenterAccountPublicResponse> response = restTemplate.postForEntity(centerAccountConfiguration.getUrl() + apiEnum.getApi(), param, |
|
|
|
CenterAccountPublicResponse.class); |
|
|
|
log.info(apiEnum.getDescription() +"...响应...:" + JSON.toJSONString(response)); |
|
|
|
log.info(apiEnum.getDescription() + "...响应...:" + JSON.toJSONString(response)); |
|
|
|
if (null == response.getBody()) { |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("部中心-用户账户体系接口返回为空"); |
|
|
|
} |
|
|
@@ -68,6 +69,11 @@ public abstract class CenterAccountAbstract { |
|
|
|
} |
|
|
|
final K responseResult = JSONObject.parseObject(AESTools.decrypt(body.getBizContent(), centerAccountConfiguration.getSecretKey()), responseClass); |
|
|
|
if (null == responseResult.getStatus() || !responseResult.getStatus().equals(1)) { |
|
|
|
if (CenterAccountApiEnum.MOBILE_CHANGE.equals(apiEnum)) { |
|
|
|
// 更改手机号特殊处理 |
|
|
|
final CenterAccountMobileChangeStatusEnum statusEnum = CenterAccountMobileChangeStatusEnum.find(responseResult.getStatus()); |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException(null == statusEnum ? "部中心-返回错误信息为空" : statusEnum.getType()); |
|
|
|
} |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException(StringUtils.isEmpty(responseResult.getMsg()) ? "部中心-返回错误信息为空" : responseResult.getMsg()); |
|
|
|
} |
|
|
|
return responseResult; |