package com.fjhx.controller.water;

import com.fjhx.base.Condition;
import com.fjhx.service.water.WaterDetailService;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 流水明细表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-09-16
 */
@RestController
@RequestMapping("/waterDetail")
public class WaterDetailController {

    @Autowired
    private WaterDetailService waterDetailService;

    /**
     * 根据申购单id获取入库明细
     * TODO
     */
    @PostMapping("/getInQuantityByApplyPurchaseId")
    public R getInQuantityByApplyPurchaseDetailsId(@RequestBody Condition condition) {
        List<Map<String, Object>> result = waterDetailService.getInQuantityByApplyPurchaseDetailsId(condition);
        return R.success(result);
    }

    /**
     * 获取今日领料
     */
    @PostMapping("/getPickingToday")
    public R getPickingToday() {
        List<Map<String, Object>> result = waterDetailService.getPickingToday();
        return R.success(result);
    }

}

