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


import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseAllocationInfo;
import com.yh.saas.plugin.yiliangyiyun.entity.ExpenseInfo;
import com.yh.saas.plugin.yiliangyiyun.service.IExpenseAllocationInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 记录费用分配表信息 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2022-06-02
 */
@RestController
@RequestMapping("/expenseAllocationInfo")
public class ExpenseAllocationInfoController {
    @Autowired
    private IExpenseAllocationInfoService expenseAllocationInfoService;
    /**
     * 删除
     *
     * @param example
     * @return
     */
    @PostMapping("/deleteInfo")
    public void deleteInfo(@RequestBody ExpenseInfo example) {
        expenseAllocationInfoService.deleteInfo(example.getId());
    }
    /**
     * 查看可分配金额
     */
    @GetMapping("/getExpenseAllocationInfo")
    public ExpenseAllocationInfo getExpenseAllocationInfo(String contractNo, String costType){
        return expenseAllocationInfoService.getExpenseAllocationInfo(contractNo,costType);
    }

}

