# SvaWidgetController.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.PropertyDTO;
    import cloud.wconnect.commonlib.redis.PropertyI18nRedisService;
    import cloud.wconnect.workperformance.pojo.dto.sva.widget.SvaActualValueDTO;
    import cloud.wconnect.workperformance.pojo.query.sva.widget.SvaWidgetDateQuery;
    import cloud.wconnect.workperformance.service.sva.widget.ISvaWidgetService;
    import jakarta.annotation.Resource;
    import jakarta.validation.Valid;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;

    /**
     * Controller: Widget
     *
     * @author zc
     * @date 2023/12/08
     */
    @RestController
    @RequestMapping("/sva/widget")
    public class SvaWidgetController {
        @Resource
        private ISvaWidgetService widgetService;
        @Resource
        private PropertyI18nRedisService propertyI18nRedisService;
        @Resource
        private SessionContext sessionContext;

        /**
         * 获取实际数据【营收，工资，售房数量】
         *
         * @param property 资产标识
         * @param query    查询条件
         * @return SvaWidgetActualValueDTO
         * @author zc
         * @date 2023/12/8
         */
        @ApiId(979)
        @GetMapping("/actual-value")
        public SvaActualValueDTO getActualValue(@RequestParam String property, @Valid SvaWidgetDateQuery query) {
            int propertyId = sessionContext.getPropertyId(property);
            PropertyDTO propertyDTO = propertyI18nRedisService.get(propertyId);
            return widgetService.getActualValue(propertyDTO, query);
        }
    }