# SvaAbnormalThresholdController.java

    package cloud.wconnect.workperformance.controller.sva;

    import cloud.wconnect.commonlib.annotation.ApiId;
    import cloud.wconnect.commonlib.component.SessionContext;
    import cloud.wconnect.workperformance.pojo.dto.sva.abnormalthreshold.SvaAbnormalThresholdDTO;
    import cloud.wconnect.workperformance.service.sva.scheduleactual.ISvaAbnormalThresholdService;
    import jakarta.validation.Valid;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.*;

    import java.util.Collections;
    import java.util.Map;

    /**
     * <p>
     * SVA功能异常阈值表 前端控制器
     * </p>
     *
     * @author lichen
     * @since 2025-10-24
     */
    @RestController
    @RequestMapping("/sva/abnormal-threshold")
    public class SvaAbnormalThresholdController {

        @Autowired
        private SessionContext sessionContext;
        @Autowired
        private ISvaAbnormalThresholdService svaAbnormalThresholdService;

        /**
         * 获取SVA功能异常阈值
         *
         * @param property 资产
         * @return cloud.wconnect.workperformance.pojo.dto.sva.abnormalthreshold.SvaAbnormalThresholdDTO
         * @author lichen
         * @date 2025/10/24
         */
        @ApiId(1621)
        @GetMapping
        public SvaAbnormalThresholdDTO get(String property) {
            int propertyId = sessionContext.getPropertyId(property);
            return svaAbnormalThresholdService.getByPropertyId(propertyId);
        }

        /**
         * 保存SVA功能异常阈值
         *
         * @param property                资产
         * @param svaAbnormalThresholdDTO SVA功能异常阈值DTO
         * @return java.util.Map
         * @author lichen
         * @date 2025/10/24
         */
        @ApiId(1622)
        @PostMapping
        public Map save(String property, @RequestBody @Valid SvaAbnormalThresholdDTO svaAbnormalThresholdDTO) {
            Integer tenantId = sessionContext.getTenantSymbolBO().getId();
            int propertyId = sessionContext.getPropertyId(property);

            //保存
            svaAbnormalThresholdService.save(tenantId, propertyId, svaAbnormalThresholdDTO);
            return Collections.emptyMap();
        }

    }