package com.storlead.sales.controller.systemrule;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.storlead.framework.common.result.Result;
import com.storlead.sales.pojo.entity.systemrule.ApproveLogEntity;
import com.storlead.sales.service.systemrule.ApproveLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author YPZ
 * @since 2024-07-26
 */
@RestController
@RequestMapping("/approve-log")
@Api(tags = "销售: 审核相关接口")
public class ApproveLogController {
    @Resource
    private ApproveLogService approveLogService;

    @ApiOperation("根据审核记录id查询审核日志列表")
    @GetMapping("/list")
    public Result listPaySlipApprove(Long approveId) {
        LambdaQueryWrapper<ApproveLogEntity> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ApproveLogEntity::getApproveId,approveId);
        wrapper.orderByAsc(ApproveLogEntity::getId);
        List<ApproveLogEntity> list = approveLogService.list(wrapper);
        return Result.result(list);
    }
}
