feat(wms): 增加版本管理功能和操作按钮
在规程主表的操作列中新增“版本与方案”按钮,点击后可跳转至版本管理页面。更新了操作列的宽度以适应新按钮。同时,在后端服务中添加了对规程版本存在性的校验,确保在删除规程时不会影响相关版本数据。
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
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.WmsProcessPlanBo;
|
||||
import com.klp.domain.vo.WmsProcessPlanVo;
|
||||
import com.klp.service.IWmsProcessPlanService;
|
||||
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/processPlan")
|
||||
public class WmsProcessPlanController extends BaseController {
|
||||
|
||||
private final IWmsProcessPlanService wmsProcessPlanService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsProcessPlanVo> list(WmsProcessPlanBo bo, PageQuery pageQuery) {
|
||||
return wmsProcessPlanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@Log(title = "方案点位", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsProcessPlanBo bo, HttpServletResponse response) {
|
||||
List<WmsProcessPlanVo> list = wmsProcessPlanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "方案点位", WmsProcessPlanVo.class, response);
|
||||
}
|
||||
|
||||
@GetMapping("/{planId}")
|
||||
public R<WmsProcessPlanVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long planId) {
|
||||
return R.ok(wmsProcessPlanService.queryById(planId));
|
||||
}
|
||||
|
||||
@Log(title = "方案点位", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsProcessPlanBo bo) {
|
||||
return toAjax(wmsProcessPlanService.insertByBo(bo));
|
||||
}
|
||||
|
||||
@Log(title = "方案点位", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsProcessPlanBo bo) {
|
||||
return toAjax(wmsProcessPlanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
@Log(title = "方案点位", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] planIds) {
|
||||
return toAjax(wmsProcessPlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user