新增规程档案后端(Entity/BO/VO/Mapper/Service/Controller),接口前缀 /wms/processSpec, 含分页查询、导出、详情、增删改;保存时校验规程编号唯一;逻辑删除与全局配置一致(0 未删 / 2 已删)。 新增 Flyway 脚本 V10 建表及唯一索引;前端增加 api/wms/processSpec.js 与 views/wms/processSpec/index.vue, 支持按编号/名称/类型/产线/产品类型/启用状态筛选,产线下拉关联现有产线接口。 说明:需在目标库执行迁移并在菜单中配置组件路径 wms/processSpec/index。
100 lines
3.1 KiB
Java
100 lines
3.1 KiB
Java
package com.klp.controller;
|
|
|
|
import com.klp.common.annotation.Log;
|
|
import com.klp.common.annotation.RepeatSubmit;
|
|
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.page.TableDataInfo;
|
|
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.bo.WmsProcessSpecBo;
|
|
import com.klp.domain.vo.WmsProcessSpecVo;
|
|
import com.klp.service.IWmsProcessSpecService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.constraints.NotEmpty;
|
|
import javax.validation.constraints.NotNull;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 规程主表
|
|
*
|
|
* @author klp
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/wms/processSpec")
|
|
public class WmsProcessSpecController extends BaseController {
|
|
|
|
private final IWmsProcessSpecService wmsProcessSpecService;
|
|
|
|
/**
|
|
* 查询规程主表列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<WmsProcessSpecVo> list(WmsProcessSpecBo bo, PageQuery pageQuery) {
|
|
return wmsProcessSpecService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出规程主表列表
|
|
*/
|
|
@Log(title = "规程主表", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(WmsProcessSpecBo bo, HttpServletResponse response) {
|
|
List<WmsProcessSpecVo> list = wmsProcessSpecService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "规程主表", WmsProcessSpecVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取规程主表详细信息
|
|
*
|
|
* @param specId 主键
|
|
*/
|
|
@GetMapping("/{specId}")
|
|
public R<WmsProcessSpecVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long specId) {
|
|
return R.ok(wmsProcessSpecService.queryById(specId));
|
|
}
|
|
|
|
/**
|
|
* 新增规程主表
|
|
*/
|
|
@Log(title = "规程主表", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessSpecBo bo) {
|
|
return toAjax(wmsProcessSpecService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改规程主表
|
|
*/
|
|
@Log(title = "规程主表", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessSpecBo bo) {
|
|
return toAjax(wmsProcessSpecService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除规程主表
|
|
*
|
|
* @param specIds 主键串
|
|
*/
|
|
@Log(title = "规程主表", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{specIds}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] specIds) {
|
|
return toAjax(wmsProcessSpecService.deleteWithValidByIds(Arrays.asList(specIds), true));
|
|
}
|
|
}
|