100 lines
3.2 KiB
Java
100 lines
3.2 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.WmsReportConfigVo;
|
||
|
|
import com.klp.domain.bo.WmsReportConfigBo;
|
||
|
|
import com.klp.service.IWmsReportConfigService;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* WMS报通用配置
|
||
|
|
*
|
||
|
|
* @author klp
|
||
|
|
* @date 2026-05-25
|
||
|
|
*/
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/wms/reportConfig")
|
||
|
|
public class WmsReportConfigController extends BaseController {
|
||
|
|
|
||
|
|
private final IWmsReportConfigService iWmsReportConfigService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 查询WMS报通用配置列表
|
||
|
|
*/
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<WmsReportConfigVo> list(WmsReportConfigBo bo, PageQuery pageQuery) {
|
||
|
|
return iWmsReportConfigService.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出WMS报通用配置列表
|
||
|
|
*/
|
||
|
|
@Log(title = "WMS报通用配置", businessType = BusinessType.EXPORT)
|
||
|
|
@PostMapping("/export")
|
||
|
|
public void export(WmsReportConfigBo bo, HttpServletResponse response) {
|
||
|
|
List<WmsReportConfigVo> list = iWmsReportConfigService.queryList(bo);
|
||
|
|
ExcelUtil.exportExcel(list, "WMS报通用配置", WmsReportConfigVo.class, response);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取WMS报通用配置详细信息
|
||
|
|
*
|
||
|
|
* @param configId 主键
|
||
|
|
*/
|
||
|
|
@GetMapping("/{configId}")
|
||
|
|
public R<WmsReportConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
||
|
|
@PathVariable Long configId) {
|
||
|
|
return R.ok(iWmsReportConfigService.queryById(configId));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 新增WMS报通用配置
|
||
|
|
*/
|
||
|
|
@Log(title = "WMS报通用配置", businessType = BusinessType.INSERT)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PostMapping()
|
||
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportConfigBo bo) {
|
||
|
|
return toAjax(iWmsReportConfigService.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 修改WMS报通用配置
|
||
|
|
*/
|
||
|
|
@Log(title = "WMS报通用配置", businessType = BusinessType.UPDATE)
|
||
|
|
@RepeatSubmit()
|
||
|
|
@PutMapping()
|
||
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportConfigBo bo) {
|
||
|
|
return toAjax(iWmsReportConfigService.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除WMS报通用配置
|
||
|
|
*
|
||
|
|
* @param configIds 主键串
|
||
|
|
*/
|
||
|
|
@Log(title = "WMS报通用配置", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{configIds}")
|
||
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||
|
|
@PathVariable Long[] configIds) {
|
||
|
|
return toAjax(iWmsReportConfigService.deleteWithValidByIds(Arrays.asList(configIds), true));
|
||
|
|
}
|
||
|
|
}
|