package com.fjhx.applet.controller;

import com.fjhx.applet.service.InkStatisticsService;
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.Map;

/**
 * 墨水统计
 */
@RestController
@RequestMapping("/applet")
public class InkStatisticsController {

    @Autowired
    private InkStatisticsService inkStatisticsService;

    /**
     * RFID版本的墨水库存汇总
     *
     * @param
     * @return
     */
    @PostMapping("/selectInkStatistics")
    public R selectInkStatistics() {
        Map<String, Object> map = inkStatisticsService.selectInkStatistics();
        return R.success(map);
    }

    /**
     * RFID版本的墨水出入库汇总
     *
     * @param condition
     * @return
     */
    @PostMapping("/selectInkEW")
    public R selectInkEW(@RequestBody Map<String, Object> condition) {
        Map<String, Object> map = inkStatisticsService.selectInkW(condition);
        return R.success(map);
    }

    /**
     * RFID版本的墨水出库详情
     *
     * @param condition
     * @return
     */
    @PostMapping("/selectInkEWDetails")
    public R selectInkEWDetails(@RequestBody Map<String, Object> condition) {
        Map<String, Object> map = inkStatisticsService.selectInkEWDetails(condition);
        return R.success(map);
    }

}
