100 lines
3.3 KiB
Java
100 lines
3.3 KiB
Java
|
|
package com.klp.controller;
|
||
|
|
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Arrays;
|
||
|
|
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import javax.validation.constraints.*;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import com.klp.common.annotation.RepeatSubmit;
|
||
|
|
import com.klp.common.annotation.Log;
|
||
|
|
import com.klp.common.core.controller.BaseController;
|
||
|
|
import com.klp.common.core.domain.PageQuery;
|
||
|
|
import com.klp.common.core.domain.R;
|
||
|
|
import com.klp.common.core.validate.AddGroup;
|
||
|
|
import com.klp.common.core.validate.EditGroup;
|
||
|
|
import com.klp.common.enums.BusinessType;
|
||
|
|
import com.klp.common.utils.poi.ExcelUtil;
|
||
|
|
import com.klp.domain.vo.WmsInspectionDetailVo;
|
||
|
|
import com.klp.domain.bo.WmsInspectionDetailBo;
|
||
|
|
import com.klp.service.IWmsInspectionDetailService;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 检验项目明细
|
||
|
|
*
|
||
|
|
* @author klp
|
||
|
|
* @date 2026-06-13
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/wms/inspectionDetail")
|
||
|
|
public class WmsInspectionDetailController extends BaseController {
|
||
|
|
|
||
|
|
private final IWmsInspectionDetailService iWmsInspectionDetailService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询检验项目明细列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<WmsInspectionDetailVo> list(WmsInspectionDetailBo bo, PageQuery pageQuery) {
|
||
|
|
return iWmsInspectionDetailService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出检验项目明细列表
|
||
|
|
*/
|
||
|
|
@Log(title = "检验项目明细", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(WmsInspectionDetailBo bo, HttpServletResponse response) {
|
||
|
|
List<WmsInspectionDetailVo> list = iWmsInspectionDetailService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "检验项目明细", WmsInspectionDetailVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取检验项目明细详细信息
|
||
|
|
*
|
||
|
|
* @param detailId 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{detailId}")
|
||
|
|
public R<WmsInspectionDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Long detailId) {
|
||
|
|
return R.ok(iWmsInspectionDetailService.queryById(detailId));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增检验项目明细
|
||
|
|
*/
|
||
|
|
@Log(title = "检验项目明细", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsInspectionDetailBo bo) {
|
||
|
|
return toAjax(iWmsInspectionDetailService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改检验项目明细
|
||
|
|
*/
|
||
|
|
@Log(title = "检验项目明细", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInspectionDetailBo bo) {
|
||
|
|
return toAjax(iWmsInspectionDetailService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除检验项目明细
|
||
|
|
*
|
||
|
|
* @param detailIds 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "检验项目明细", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{detailIds}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Long[] detailIds) {
|
||
|
|
return toAjax(iWmsInspectionDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
|
||
|
|
}
|
||
|
|
}
|