package com.jwipc.contract.controller.pc;

import com.jwipc.contract.constant.ModuleConst;
import com.jwipc.contract.logic.ContractDeliveryDetailLogic;
import com.jwipc.contract.model.query.ChoseSupplierListQuery;
import com.jwipc.contract.model.query.ContractDeliveryDetailQuery;
import com.jwipc.page.PageView;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 合同交货明细表 前端控制器
 * </p>
 *
 * @author qzc
 * @since 2025-12-09
 */
@RestController
@RequestMapping(ModuleConst.MODULE_ROOT + "/contractDeliveryDetail/rest/")
@RequiredArgsConstructor
@Slf4j
public class ContractDeliveryDetailRestController {
    private final ContractDeliveryDetailLogic contractDeliveryDetailLogic;

    /**
     * 查询发货单明细
     * @param id
     * @return
     */
    @GetMapping("listDeliverDetail")
    public PageView listDeliverDetail(Long id) {
        return contractDeliveryDetailLogic.getListDeliverDetail(id);
    }

    /**
     * 删除发货单明细
     * @param ids
     * @return
     */
    @PostMapping("remove")
    public ResponseEntity remove(String ids) {
        contractDeliveryDetailLogic.remove(ids);
        return ResponseEntity.ok().build();
    }

    @RequestMapping("selectreturnOrdertDetailListPage")
    public PageView selectreturnOrdertDetailListPage(ContractDeliveryDetailQuery query) {
        return contractDeliveryDetailLogic.selectreturnOrdertDetailListPage(query);
    }
}
