# TaWidgetController.java

    package cloud.wconnect.finance.controller.ta;

    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.finance.pojo.dto.ta.widget.TaExceptionRecordDTO;
    import cloud.wconnect.finance.service.ta.ITaWidgetService;
    import jakarta.annotation.Resource;
    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/11
     */
    @RestController
    @RequestMapping("/ta/widget")
    public class TaWidgetController {
        @Resource
        private ITaWidgetService widgetService;
        @Resource
        private SessionContext sessionContext;
        @Resource
        private PropertyI18nRedisService propertyI18nRedisService;

        /**
         * 统计比对异常数据的数量
         *
         * @param property 资产标识
         * @return TaExceptionRecordDTO
         * @author zc
         * @date 2023/12/11
         */
        @ApiId(985)
        @GetMapping("/exception-record-number")
        public TaExceptionRecordDTO getExceptionRecordNumber(@RequestParam String property) {
            int propertyId = sessionContext.getPropertyId(property);
            PropertyDTO propertyDTO = propertyI18nRedisService.get(propertyId);
            return widgetService.getExceptionRecordNumber(propertyDTO);
        }
    }