# BudgetDatabaseEditLogController.java

    package cloud.wconnect.rateshop.controller.budgetdatabase;

    import cloud.wconnect.commonlib.annotation.ApiId;
    import cloud.wconnect.commonlib.component.SessionContext;
    import cloud.wconnect.commonlib.pojo.dto.ListPagedDTO;
    import cloud.wconnect.commonlib.pojo.query.PageSizeQuery;
    import cloud.wconnect.rateshop.pojo.dto.budgetdatabase.EditLogDTO;
    import cloud.wconnect.rateshop.service.budgetdatabase.*;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.context.annotation.Lazy;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;

    /**
     * <p>
     *  前端控制器
     * </p>
     *
     * @author yyt
     * @since 2025-09-11
     */
    @RestController
    @RequestMapping("/budget-database")
    public class BudgetDatabaseEditLogController {

        @Autowired
        private SessionContext sessionContext;
        @Autowired
        private IBudgetDatabaseMarketSegmentationLogService budgetDatabaseMarketSegmentationLogService;
        @Lazy
        @Autowired
        private IBudgetDatabaseConfigRoomTabService budgetDatabaseConfigRoomTabService;
        @Autowired
        private IBudgetDatabaseDataLogRoomMonthStatisticsService budgetDatabaseDataLogRoomMonthStatisticsService;
        @Autowired
        private IBudgetDatabaseConfigFbTabService budgetDatabaseConfigFbTabService;
        @Autowired
        private IBudgetDatabaseDataLogFbService budgetDatabaseDataLogFbService;
        @Autowired
        private IBudgetDatabaseDataLogOtherService budgetDatabaseDataLogOtherService;
        @Autowired
        private IBudgetDatabaseConfigOtherTabService budgetDatabaseConfigOtherTabService;

        /**
         * 1593 - 查询 Room 分类不同区域的操作 log
         *
         * @param tabId     tab id
         * @param area      区域 Total 传1，Month Statistics 传2
         * @param property 资产标识
         * @param query    查询条件
         * @return 操作 log
         * @author yyt
         * @date 2025/9/12
         **/
        @ApiId(1593)
        @GetMapping("/{tabId:\\d+}/log/room")
        public ListPagedDTO<EditLogDTO> listMonthStatisticsLog(@PathVariable int tabId, int area, String property, PageSizeQuery query) {
            int propertyId = sessionContext.getPropertyId(property);
            budgetDatabaseConfigRoomTabService.checkTab(tabId, propertyId);
            return budgetDatabaseDataLogRoomMonthStatisticsService.list(propertyId, tabId, area, query);
        }

        /**
         * 1594 - 查询 Market Segmentation 操作 log
         *
         * @param tabId    tab id
         * @param month    月
         * @param property 资产标识
         * @param query    查询条件
         * @return 操作 log
         * @author yyt
         * @date 2025/9/12
         **/
        @ApiId(1594)
        @GetMapping("/{tabId:\\d+}/log/market-segmentation/{month:\\d+}")
        public ListPagedDTO<EditLogDTO> listMarketSegmentationLog(@PathVariable int tabId, @PathVariable int month, String property, PageSizeQuery query) {
            int propertyId = sessionContext.getPropertyId(property);
            budgetDatabaseConfigRoomTabService.checkTab(tabId, propertyId);
            return budgetDatabaseMarketSegmentationLogService.list(propertyId, tabId, month, query);
        }

        /**
         * 1595 - 查询 F&B 操作 log
         *
         * @param tabId    tab id
         * @param area     Revenue 传1，Covers 传2
         * @param property 资产标识
         * @param query    查询条件
         * @return 操作 log
         * @author yyt
         * @date 2025/9/12
         **/
        @ApiId(1595)
        @GetMapping("/{tabId:\\d+}/log/fb")
        public ListPagedDTO<EditLogDTO> listFbLog(@PathVariable int tabId, int area, String property,  PageSizeQuery query) {
            int propertyId = sessionContext.getPropertyId(property);
            budgetDatabaseConfigFbTabService.checkTab(tabId, propertyId);
            return budgetDatabaseDataLogFbService.list(propertyId, tabId, area, query);
        }

        /**
         * 1596 - 查询 Other 操作 log
         *
         * @param tabId    tab id
         * @param area     Revenue 传1
         * @param property 资产标识
         * @param query    查询条件
         * @return 操作 log
         * @author yyt
         * @date 2025/9/12
         **/
        @ApiId(1596)
        @GetMapping("/{tabId:\\d+}/log/other")
        public ListPagedDTO<EditLogDTO> listOtherLog(@PathVariable int tabId, int area, String property, PageSizeQuery query) {
            int propertyId = sessionContext.getPropertyId(property);
            budgetDatabaseConfigOtherTabService.checkTab(tabId, propertyId);
            return budgetDatabaseDataLogOtherService.list(propertyId, tabId, area, query);
        }

    }