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

dev
郑明梁 2 years ago
parent e784b09f03
commit f42233e14e

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -157,7 +158,7 @@ public class ZzzyyClient implements BaseHttpClient {
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
Map map= (Map) baseResponse.getData();
List<ZzzyyProductsResponse> zzzyyProductsResponse= (List<ZzzyyProductsResponse>) map.get("list");
List<ZzzyyProductsResponse> zzzyyProductsResponse= JSON.parseArray(map.get("list")+ "",ZzzyyProductsResponse.class);
for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) {
//判断要是规格和型号一致就是取规格 不一致就合并
if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) {
@ -170,7 +171,7 @@ public class ZzzyyClient implements BaseHttpClient {
productsResponse.setStandard(productsResponse.getModel_number());
}
}
map.put("list",zzzyyProductsResponse);
map.put("list",JSON.toJSON(zzzyyProductsResponse));
baseResponse.setData("");
baseResponse.setData(map);
return baseResponse;

Loading…
Cancel
Save