package com.zg.project.Inventory.Task.controller;

import com.zg.framework.aspectj.lang.annotation.Log;
import com.zg.framework.aspectj.lang.enums.BusinessType;
import com.zg.framework.web.controller.BaseController;
import com.zg.framework.web.domain.AjaxResult;
import com.zg.project.Inventory.Task.service.IInventoryTaskService;
import com.zg.project.wisdom.service.IRkInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/statistics")
public class StatisticsController extends BaseController {

    @Autowired
    private IInventoryTaskService taskService;

    @Autowired
    private IRkInfoService rkInfoService;

    /**
     * 统计盘点任务对应仓库的待盘点数量
     * @param taskId
     * @return
     */
    @GetMapping("/count")
    public AjaxResult conuntGetByTaskId(@RequestParam("taskId")  String taskId)
    {

        String warehouse = taskService.getWhByTaskId(taskId);

        int count = rkInfoService.countGetByWh(warehouse);

        return AjaxResult.success(count);
    }
}
