fix[project]: 需求详情,兼容脏数据

This commit is contained in:
2026-04-18 11:36:33 +08:00
parent b425762dcb
commit 8c37d191ef
2 changed files with 4 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ public class SimulationDemandController {
*/
@GetMapping("/detail")
@Operation(summary = "根据需求id查询需求详情", description = "根据需求id查询需求详情")
public SdmResponse detail(@RequestParam @Validated String demandId) {
public SdmResponse detail(@RequestParam(required = false) String demandId) {
return demandService.detail(demandId);
}

View File

@@ -1424,6 +1424,9 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
@Override
public SdmResponse detail(String demandId) {
if (StringUtils.isBlank(demandId)){
return SdmResponse.success(new ArrayList<>());
}
List<SpdmDemandVo> demandList = mapper.getDemandListById(Collections.singletonList(demandId));
if (CollectionUtils.isEmpty(demandList)) {
return SdmResponse.success(new ArrayList<>());