feat(flow): 添加排产明细钢卷关系管理功能
- 创建排产明细钢卷关系实体类 SchDetailCoilRel - 定义业务对象 SchDetailCoilRelBo 和视图对象 SchDetailCoilRelVo - 实现排产明细钢卷关系服务接口 ISchDetailCoilRelService - 开发控制器 SchDetailCoilRelController 提供 REST API - 创建数据访问层 SchDetailCoilRelMapper 和 XML 映射文件 - 实现服务层业务逻辑 SchDetailCoilRelServiceImpl - 集成分页查询、新增、修改、删除等基础操作 - 添加 Excel 导出功能和数据验证机制
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
package com.klp.flow.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.flow.domain.vo.SchDetailCoilRelVo;
|
||||
import com.klp.flow.domain.bo.SchDetailCoilRelBo;
|
||||
import com.klp.flow.service.ISchDetailCoilRelService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 排产明细钢卷关系
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/flow/detailCoilRel")
|
||||
public class SchDetailCoilRelController extends BaseController {
|
||||
|
||||
private final ISchDetailCoilRelService iSchDetailCoilRelService;
|
||||
|
||||
/**
|
||||
* 查询排产明细钢卷关系列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SchDetailCoilRelVo> list(SchDetailCoilRelBo bo, PageQuery pageQuery) {
|
||||
return iSchDetailCoilRelService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出排产明细钢卷关系列表
|
||||
*/
|
||||
@Log(title = "排产明细钢卷关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SchDetailCoilRelBo bo, HttpServletResponse response) {
|
||||
List<SchDetailCoilRelVo> list = iSchDetailCoilRelService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "排产明细钢卷关系", SchDetailCoilRelVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排产明细钢卷关系详细信息
|
||||
*
|
||||
* @param relId 主键
|
||||
*/
|
||||
@GetMapping("/{relId}")
|
||||
public R<SchDetailCoilRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long relId) {
|
||||
return R.ok(iSchDetailCoilRelService.queryById(relId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增排产明细钢卷关系
|
||||
*/
|
||||
@Log(title = "排产明细钢卷关系", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchDetailCoilRelBo bo) {
|
||||
return toAjax(iSchDetailCoilRelService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产明细钢卷关系
|
||||
*/
|
||||
@Log(title = "排产明细钢卷关系", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchDetailCoilRelBo bo) {
|
||||
return toAjax(iSchDetailCoilRelService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除排产明细钢卷关系
|
||||
*
|
||||
* @param relIds 主键串
|
||||
*/
|
||||
@Log(title = "排产明细钢卷关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{relIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] relIds) {
|
||||
return toAjax(iSchDetailCoilRelService.deleteWithValidByIds(Arrays.asList(relIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user