refactor: 出库计划编码自动生成

This commit is contained in:
Kelvin 2024-12-19 10:48:43 +08:00
parent 82929979fb
commit d8357ea130

View File

@ -89,8 +89,12 @@ public class WmsOutPlanController extends BaseController {
@Log(title = "出库计划管理", businessType = BusinessType.INSERT) @Log(title = "出库计划管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WmsOutPlan wmsOutPlan) { public AjaxResult add(@RequestBody WmsOutPlan wmsOutPlan) {
if (UserConstants.NOT_UNIQUE.equals(wmsOutPlanService.checkPlanCodeUnique(wmsOutPlan))) { // if (UserConstants.NOT_UNIQUE.equals(wmsOutPlanService.checkPlanCodeUnique(wmsOutPlan))) {
return AjaxResult.error("新增出库计划失败,出库计划编码“" + wmsOutPlan.getPlanCode() + "”已存在"); // return AjaxResult.error("新增出库计划失败,出库计划编码“" + wmsOutPlan.getPlanCode() + "”已存在");
// }
// 出库计划编码自动生成
if (wmsOutPlan.getPlanCode() == null || wmsOutPlan.getPlanCode().isEmpty()) {
wmsOutPlan.setPlanCode(MultiModuleCodeGenerator.generateTaskCode("CKP"));
} }
wmsOutPlan.setCreateBy(getUsername()); wmsOutPlan.setCreateBy(getUsername());
return toAjax(wmsOutPlanService.insertWmsOutPlan(wmsOutPlan)); return toAjax(wmsOutPlanService.insertWmsOutPlan(wmsOutPlan));