This commit is contained in:
苏竹红
2024-04-28 19:34:56 +08:00
parent ef1ef9a9f6
commit dbee058061
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
package com.cool.store.dto.decoration;
import lombok.Data;
import java.util.List;
/**
* @Author suzhuhong
* @Date 2024/4/28 19:19
* @Version 1.0
*/
@Data
public class RowsDTO{
private List<DecorationDTO> rows;
}

View File

@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.decoration.DecorationDTO;
import com.cool.store.dto.decoration.ProjectDTO;
import com.cool.store.dto.decoration.RowsDTO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mq.util.HttpRestTemplateService;
@@ -11,6 +12,7 @@ import com.cool.store.utils.poi.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import springfox.documentation.spring.web.json.Json;
import javax.annotation.Resource;
import java.util.HashMap;
@@ -45,7 +47,8 @@ public class YlfServiceImpl implements YlfService {
if (data == null) {
return null;
}
List<DecorationDTO> list = (List<DecorationDTO>) ((JSONObject) JSONObject.parseObject(forObject, JSONObject.class).get("data")).get("rows");
RowsDTO rowsDTOS = JSONObject.parseObject(JSONObject.toJSONString( data), RowsDTO.class);
List<DecorationDTO> list = rowsDTOS.getRows();
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}