//package com.bonus.material.purchase.controller;
//
//import java.util.List;
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletResponse;
//import javax.validation.Valid;
//import javax.validation.constraints.NotNull;
//
//import com.bonus.common.log.enums.OperaType;
//import com.bonus.material.common.annotation.PreventRepeatSubmit;
//import com.bonus.material.purchase.domain.dto.PurchaseCheckFileDto;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//import com.bonus.common.log.annotation.SysLog;
//import com.bonus.common.security.annotation.RequiresPermissions;
//import com.bonus.material.purchase.domain.PurchaseCheckDetails;
//import com.bonus.material.purchase.service.IPurchaseCheckDetailsService;
//import com.bonus.common.core.web.controller.BaseController;
//import com.bonus.common.core.web.domain.AjaxResult;
//import com.bonus.common.core.utils.poi.ExcelUtil;
//import com.bonus.common.core.web.page.TableDataInfo;
//
///**
// * 新购验收任务详细Controller
// * @author syruan
// */
//@Api(tags = "新购验收任务详细接口")
//@RestController
//@RequestMapping("/purchase_check_details")
//public class PurchaseCheckDetailsController extends BaseController {
//
//    @Resource
//    private IPurchaseCheckDetailsService purchaseCheckDetailsService;
//
//    /**
//     * 查询新购验收任务详细列表
//     */
//    @ApiOperation(value = "查询新购验收任务详细列表")
//    @RequiresPermissions("purchase:details:list")
//    @GetMapping("/list")
//    public TableDataInfo list(PurchaseCheckDetails purchaseCheckDetails) {
//        startPage();
//        List<PurchaseCheckDetails> list = purchaseCheckDetailsService.selectPurchaseCheckDetailsList(purchaseCheckDetails);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出新购验收任务详细列表
//     */
//    @ApiOperation(value = "导出新购验收任务详细列表")
//    @PreventRepeatSubmit
//    @RequiresPermissions("purchase:details:export")
//    @SysLog(title = "新购验收任务详细", businessType = OperaType.EXPORT, logType = 1,module = "物资新购->导出新购验收任务详细")
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, PurchaseCheckDetails purchaseCheckDetails) {
//        List<PurchaseCheckDetails> list = purchaseCheckDetailsService.selectPurchaseCheckDetailsList(purchaseCheckDetails);
//        ExcelUtil<PurchaseCheckDetails> util = new ExcelUtil<PurchaseCheckDetails>(PurchaseCheckDetails.class);
//        util.exportExcel(response, list, "新购验收任务详细数据");
//    }
//
//    /**
//     * 获取新购验收任务详细详细信息
//     */
//    @ApiOperation(value = "获取新购验收任务详细详细信息")
//    @RequiresPermissions("purchase:details:query")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id) {
//        return success(purchaseCheckDetailsService.selectPurchaseCheckDetailsById(id));
//    }
//
//    /**
//     * 新增新购验收任务详细
//     */
//    @ApiOperation(value = "新增新购验收任务详细")
//    @PreventRepeatSubmit
//    @RequiresPermissions("purchase:details:add")
//    @SysLog(title = "新购验收任务详细", businessType = OperaType.INSERT, logType = 1,module = "物资新购->新增新购验收任务详细")
//    @PostMapping
//    public AjaxResult add(@RequestBody PurchaseCheckDetails purchaseCheckDetails) {
//        try {
//            return toAjax(purchaseCheckDetailsService.insertPurchaseCheckDetails(purchaseCheckDetails));
//        } catch (Exception e) {
//            return error("系统错误, " + e.getMessage());
//        }
//    }
//
//    /**
//     * 修改新购验收任务详细
//     */
//    @ApiOperation(value = "修改新购验收任务详细")
//    @PreventRepeatSubmit
//    @RequiresPermissions("purchase:details:edit")
//    @SysLog(title = "新购验收任务详细", businessType = OperaType.UPDATE, module = "物资新购->修改新购验收任务详细")
//    @PutMapping
//    public AjaxResult edit(@RequestBody PurchaseCheckDetails purchaseCheckDetails) {
//        try {
//            return toAjax(purchaseCheckDetailsService.updatePurchaseCheckDetails(purchaseCheckDetails));
//        } catch (Exception e) {
//            return error("系统错误, " + e.getMessage());
//        }
//    }
//
//    /**
//     * 删除新购验收任务详细
//     */
//    @ApiOperation(value = "删除新购验收任务详细")
//    @PreventRepeatSubmit
//    @RequiresPermissions("purchase:details:remove")
//    @SysLog(title = "新购验收任务详细", businessType = OperaType.DELETE, logType = 1,module = "物资新购->删除新购验收任务详细")
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable Long[] ids) {
//        return toAjax(purchaseCheckDetailsService.deletePurchaseCheckDetailsByIds(ids));
//    }
//
//    /**
//     * 根据任务id查询报告附件
//     */
//    @ApiOperation(value = "根据任务id查询报告附件")
//    @RequiresPermissions("purchase:details:query")
//    @GetMapping("/fileList")
//    @SysLog(title = "新购验收任务明细报告查询", businessType = OperaType.QUERY, module = "物资新购->根据任务id查询物资报告附件")
//    public AjaxResult getFileList(PurchaseCheckFileDto purchaseCheckFileDto) {
//        return success(purchaseCheckDetailsService.selectPurchaseCheckFileListByTaskType(purchaseCheckFileDto.getTaskType(), purchaseCheckFileDto.getTypeId()));
//    }
//
//
//    @ApiOperation(value = "上传报告附件")
//    @PreventRepeatSubmit
//    @RequiresPermissions("purchase:details:add")
//    @SysLog(title = "上传报告附件", businessType = OperaType.INSERT, logType = 1,module = "物资新购->上传物资报告附件")
//    @PostMapping("/uploadFile")
//    public AjaxResult uploadFile(@RequestBody @NotNull @Valid PurchaseCheckFileDto purchaseCheckFileDto) {
//        return purchaseCheckDetailsService.insertPurchaseCheckFile(purchaseCheckFileDto);
//    }
//
//
//}
