package com.yh.saas.plugin.yiliangyiyun.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.PurchasePrice;
import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;
import com.yh.saas.plugin.yiliangyiyun.service.IPurchasePriceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 库内自采价格主表 前端控制器
 * </p>
 *
 * @author ccj
 * @since 2021-09-03
 */
@RestController
@RequestMapping("/purchasePrice")
public class PurchasePriceController {
    @Autowired
    IPurchasePriceService iPurchasePriceService;
    /**
     * 收购管理列表
     * @param purchasePrice
     * @return
     */
    @GetMapping("/purchasePriceList")
    public Page<PurchasePrice> purchasePriceList(PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceList(purchasePrice);
    }
    /**
     * 添加收购价格
     * @param purchasePrice
     * @return
     */
    @PostMapping("/purchasePriceAdd")
    public String purchasePriceAdd(@RequestBody PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceAdd(purchasePrice);
    }
    /**
     * 收购管理查看
     * @param purchasePrice
     * @return
     */
    @GetMapping("/purchasePriceLook")
    public PurchasePrice purchasePriceLook(PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceLook(purchasePrice);
    }
    /**
     * 收购管理编辑
     * @param purchasePrice
     * @return
     */
    @PostMapping("/purchasePriceEdit")
    public String purchasePriceEdit(@RequestBody PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceEdit(purchasePrice);
    }
    /**
     * 收购管理删除
     * @param purchasePrice
     * @return
     */
    @PostMapping("/purchasePriceDel")
    public String purchasePriceDel(@RequestBody PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceDel(purchasePrice);
    }
    /**
     * 收购管理允许手动编辑
     * @param purchasePrice
     * @return
     */
    @PostMapping("/purchasePriceAllowEdit")
    public String purchasePriceAllowEdit(@RequestBody PurchasePrice purchasePrice) {
        return iPurchasePriceService.purchasePriceAllowEdit(purchasePrice);
    }
    /**
     * 查潮粮单价
     * @param purchasePrice
     * @return
     */
    @GetMapping("/tidalGrainPrice")
    public Float tidalGrainPrice(PurchasePrice purchasePrice) {
        return iPurchasePriceService.tidalGrainPrice(purchasePrice);
    }

    /**
     * 查干粮单价
     * @param purchasePrice
     * @return
     */
    @GetMapping("/dryGrainPrice")
    public Float dryGrainPrice(PurchasePrice purchasePrice) {
        return iPurchasePriceService.dryGrainPrice(purchasePrice);
    }
}

