package com.huimv.produce.produce.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huimv.common.utils.Result;
import com.huimv.common.utils.ResultCode;
import com.huimv.produce.produce.entity.ProdPayable;
import com.huimv.produce.produce.service.IProdPayableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-10-22
 */
@RestController
@RequestMapping("/prodPayable")
public class ProdPayableController {

    @Autowired
    private IProdPayableService prodPayableService;

    @GetMapping("/listReceivable")
    public Result listReceivable(){

        return new Result(ResultCode.SUCCESS,prodPayableService.list(new QueryWrapper<ProdPayable>().orderByAsc("rank").eq("pay_type",1)));
    }

    @GetMapping("/listPayable")
    public Result listPayable(){

        return new Result(ResultCode.SUCCESS,prodPayableService.list(new QueryWrapper<ProdPayable>().orderByAsc("rank").eq("pay_type",2)));
    }

}
