feat(wms): 添加报表结果存储功能支持JSON和横向对比
- 创建WmsReportResultStorage实体类用于存储报表结果数据 - 实现IWmsReportResultStorageService服务接口及其实现类 - 添加WmsReportResultStorageController控制器提供CRUD操作 - 创建WmsReportResultStorageMapper数据访问层 - 配置WmsReportResultStorageMapper.xml映射文件 - 定义WmsReportResultStorageBo业务对象和WmsReportResultStorageVo视图对象 - 实现报表数据按日期、类型、产线进行查询和去重逻辑 - 添加Excel导出功能支持报表数据导出
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
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.WmsReportResultStorageVo;
|
||||
import com.klp.domain.bo.WmsReportResultStorageBo;
|
||||
import com.klp.service.IWmsReportResultStorageService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报结果存储(JSON+横向对比专用)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-03-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/reportResultStorage")
|
||||
public class WmsReportResultStorageController extends BaseController {
|
||||
|
||||
private final IWmsReportResultStorageService iWmsReportResultStorageService;
|
||||
|
||||
/**
|
||||
* 查询报结果存储(JSON+横向对比专用)列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsReportResultStorageVo> list(WmsReportResultStorageBo bo, PageQuery pageQuery) {
|
||||
return iWmsReportResultStorageService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报结果存储(JSON+横向对比专用)列表
|
||||
*/
|
||||
@Log(title = "报结果存储(JSON+横向对比专用)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsReportResultStorageBo bo, HttpServletResponse response) {
|
||||
List<WmsReportResultStorageVo> list = iWmsReportResultStorageService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "报结果存储(JSON+横向对比专用)", WmsReportResultStorageVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报结果存储(JSON+横向对比专用)详细信息
|
||||
*
|
||||
* @param storageId 主键
|
||||
*/
|
||||
@GetMapping("/{storageId}")
|
||||
public R<WmsReportResultStorageVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long storageId) {
|
||||
return R.ok(iWmsReportResultStorageService.queryById(storageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报结果存储(JSON+横向对比专用)
|
||||
*/
|
||||
@Log(title = "报结果存储(JSON+横向对比专用)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportResultStorageBo bo) {
|
||||
return toAjax(iWmsReportResultStorageService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报结果存储(JSON+横向对比专用)
|
||||
*/
|
||||
@Log(title = "报结果存储(JSON+横向对比专用)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportResultStorageBo bo) {
|
||||
return toAjax(iWmsReportResultStorageService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报结果存储(JSON+横向对比专用)
|
||||
*
|
||||
* @param storageIds 主键串
|
||||
*/
|
||||
@Log(title = "报结果存储(JSON+横向对比专用)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storageIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] storageIds) {
|
||||
return toAjax(iWmsReportResultStorageService.deleteWithValidByIds(Arrays.asList(storageIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user