# SvaOperatingStatisticsConfigController.java

    package cloud.wconnect.workperformance.controller.sva;

    import cloud.wconnect.commonlib.annotation.ApiId;
    import cloud.wconnect.commonlib.component.SessionContext;
    import cloud.wconnect.commonlib.pojo.dto.result.ResultDTO;
    import cloud.wconnect.commonlib.util.JsonUtils;
    import cloud.wconnect.workperformance.entity.sva.operatingstatistics.SvaOperatingStatisticsConfig;
    import cloud.wconnect.workperformance.service.sva.operatingstatistics.ISvaOperatingStatisticsConfigService;
    import com.fasterxml.jackson.databind.ObjectMapper;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;

    import java.util.Collections;
    import java.util.List;
    import java.util.Objects;

    /**
     * Operating statistics报告配置控制器
     *
     * @author lichen
     * @date 2026/4/15
     */
    @RestController
    @RequestMapping("/sva/operating-statistics")
    public class SvaOperatingStatisticsConfigController {

        @Autowired
        private ISvaOperatingStatisticsConfigService svaOperatingStatisticsConfigService;
        @Autowired
        private SessionContext sessionContext;
        @Autowired
        private ObjectMapper objectMapper;

        /**
         * 获取扩展字段列表
         *
         * @param property 资产id
         * @return 扩展字段列表
         */
        @ApiId(1729)
        @GetMapping("/extended-field")
        public ResultDTO<List<String>> getExtendedFieldList(String property) {
            int propertyId = sessionContext.getPropertyId(property);
            SvaOperatingStatisticsConfig svaOperatingStatisticsConfig = svaOperatingStatisticsConfigService.getByPropertyId(propertyId);
            if(Objects.isNull(svaOperatingStatisticsConfig)){
                return ResultDTO.success(Collections.emptyList());
            }

            String extendedField = svaOperatingStatisticsConfig.getExtendedField();
            return ResultDTO.success(JsonUtils.convertStringToList(objectMapper, extendedField, String.class));
        }

    }