|
|
@@ -54,6 +54,42 @@ public class PssSupServiceImpl implements PssSupService { |
|
|
|
return (K) convertResponse(data.getFilename(), jsonResponse, var1, inTime); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public <T extends SubBaseModel, K extends SubBaseModel> K pssSup2(T req, String token, Class<K> var1) |
|
|
|
throws ManagerException { |
|
|
|
long inTime = System.currentTimeMillis(); |
|
|
|
SsoJsonRequest data = convertRequest(req); |
|
|
|
String jsonResponse = OKHttpClientUtil.httpPost(pssSupConfiguration.getPssUrl(), JsonUtils.toJsonStr(data), getHeaderMap(token)); |
|
|
|
return (K) convertResponse2(data.getFilename(), jsonResponse, var1, inTime); |
|
|
|
} |
|
|
|
|
|
|
|
private <T extends SubBaseModel> T convertResponse2(String filename, String jsonResponse, Class<T> clazz, |
|
|
|
long inTime) throws ManagerException { |
|
|
|
log.info("pssresponse:{} filename:{} elapsed:{}", jsonResponse, filename, |
|
|
|
System.currentTimeMillis() - inTime); |
|
|
|
SsoJsonResponse response; |
|
|
|
try { |
|
|
|
response = JsonUtils.json2Object(jsonResponse, SsoJsonResponse.class); |
|
|
|
System.out.println("转换后返回信息" + response); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("pssjsonError", e); |
|
|
|
throw new ManagerException("pss请求异常", "999"); |
|
|
|
} |
|
|
|
if (null == response) { |
|
|
|
throw new ManagerException("pss请求异常", "999"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(response.getBizContent())) { |
|
|
|
String bizContent = ""; |
|
|
|
if (1 == pssSupConfiguration.getIsSign()) { |
|
|
|
bizContent = AESTools.decrypt(response.getBizContent(), pssSupConfiguration.getAesKey()); |
|
|
|
} else { |
|
|
|
bizContent = response.getBizContent(); |
|
|
|
} |
|
|
|
response.setBizContent(bizContent); |
|
|
|
log.info("bizContent:{}", bizContent); |
|
|
|
} |
|
|
|
return (T) json2Model(response.toJson(), clazz); |
|
|
|
} |
|
|
|
public <T extends SubBaseModel, K extends BaseEntity> DwonLoadBaseResponse pssSupETC(T req, String token, |
|
|
|
Class<K> var1) throws Exception { |
|
|
|
DwonLoadBaseResponse res; |