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


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.CollectionManagement;
import com.yh.saas.plugin.yiliangyiyun.service.ICollectionManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 收款管理 前端控制器
 * </p>
 *
 * @author Gongdc
 * @since 2021-08-06
 */
@RestController
@RequestMapping("/collectionManagement")
public class CollectionManagementController {
    @Autowired
    private ICollectionManagementService collectionManagementService;
    /**
     * 收款列表查询
     *
     * @param collectionManagement
     * @return
     */
    @GetMapping("/selectCollectionInfo")
    public Page<CollectionManagement> selectCollectionInfo(CollectionManagement collectionManagement) {
        return collectionManagementService.selectCollectionInfo(collectionManagement);
    }

    /**
     * 派发
     * @param collectionManagement
     */
    @PostMapping("/distribute")
    public String distribute(@RequestBody CollectionManagement collectionManagement){
        return collectionManagementService.distribute(collectionManagement);
    }

    /**
     * 删除
     * @param collectionManagement
     */
    @PostMapping("/deleteCar")
    public void deleteCar(@RequestBody CollectionManagement collectionManagement){
        collectionManagementService.deleteCar(collectionManagement.getId());
    }
    /**
     * 编辑
     */
    @PostMapping("/editInfo")
    public String editInfo(@RequestBody CollectionManagement collectionManagement) {
        return collectionManagementService.editInfo(collectionManagement);
    }
    /**
     * 查看
     */
    @GetMapping("/getInfo")
    public CollectionManagement getInfo(@RequestParam String id) {
        return collectionManagementService.getInfo(id);
    }

}

