| | |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.framework.tenant.core.context.TenantContextHolder; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO; |
| | | import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
| | | import com.iailab.module.data.ind.collection.IndItemCollector; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.security.PermitAll; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | |
| | | @GetMapping("/query-ind/default-value") |
| | | @Operation(summary = "查询指标默认值") |
| | | public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(@RequestParam String itemNo) { |
| | | TenantContextHolder.setTenantId(161L); |
| | | List<IndItemValueVO> list = indItemCollector.queryValue(itemNo); |
| | | return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class)); |
| | | List<ApiIndItemValueDTO> dtoList = new ArrayList<>(); |
| | | list.forEach(item -> { |
| | | ApiIndItemValueDTO dto = new ApiIndItemValueDTO(); |
| | | dto.setDataTime(item.getDataTime()); |
| | | dto.setDataValue(item.getDataValue().doubleValue()); |
| | | dtoList.add(dto); |
| | | }); |
| | | return success(dtoList); |
| | | |
| | | } |
| | | |