漳州中医院客户端--智业接口对接 转换规格型号

dev
郑明梁 2 years ago
parent 6903c9990b
commit e784b09f03

@ -58,6 +58,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* --
@ -155,7 +156,8 @@ public class ZzzyyClient implements BaseHttpClient {
response = parserResult(response);
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
List<ZzzyyProductsResponse> zzzyyProductsResponse = (List<ZzzyyProductsResponse>) baseResponse.getData();
Map map= (Map) baseResponse.getData();
List<ZzzyyProductsResponse> zzzyyProductsResponse= (List<ZzzyyProductsResponse>) map.get("list");
for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) {
//判断要是规格和型号一致就是取规格 不一致就合并
if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) {
@ -167,9 +169,10 @@ public class ZzzyyClient implements BaseHttpClient {
} else if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isBlank(productsResponse.getStandard())) {
productsResponse.setStandard(productsResponse.getModel_number());
}
baseResponse.setData("");
baseResponse.setData(zzzyyProductsResponse);
}
map.put("list",zzzyyProductsResponse);
baseResponse.setData("");
baseResponse.setData(map);
return baseResponse;
} catch (Exception e) {
log.error("解析漳州中医院智业接口返回产品信息字典数据异常,返回结果:{}", response);

Loading…
Cancel
Save