package com.jwipc.order.controller.pc;

import com.jwipc.order.dto.PcnChangeApproveDTO;
import com.jwipc.order.logic.PcnManagerLogic;
import com.jwipc.order.model.query.PcnChangeApproveCondQuery;
import com.jwipc.page.PageView;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.jwipc.order.constant.ModuleConst.MODULE_ROOT;

/**
 * <p>
 * PCN审批日志表 前端控制器
 * </p>
 *
 * @author zx
 * @since 2024-03-19
 */
@RestController
@RequestMapping(MODULE_ROOT + "/pcn/approv/rest")
@RequiredArgsConstructor
@Slf4j
public class PcnChangeApproveRestController {

    @Autowired
    PcnManagerLogic pcnManagerLogic;

    @RequestMapping("/addAgreeRecord")
    @ResponseBody
    public ResponseEntity addAgreeRecord(@RequestBody PcnChangeApproveDTO approveDTO) {
        pcnManagerLogic.addAgreeRecord(approveDTO);
        return  ResponseEntity.ok(true);
    }



    @RequestMapping("/queryPcnApprovalByPage")
    public PageView queryPcnByPage(PcnChangeApproveCondQuery changeApproveCondQuery) {
        return pcnManagerLogic.queryPcnApprovalPage(changeApproveCondQuery);
    }


}
