完成出库计划新增接口,并自动执行出库计划,在数量等条件满足的情况下生成相应的出库任务

This commit is contained in:
刘名喜 2024-12-16 10:04:30 +08:00
parent 8fad8ba16c
commit 655f0ab225
3 changed files with 27 additions and 0 deletions

View File

@ -45,6 +45,15 @@ public class WmsOutPlanController extends BaseController {
return getDataTable(list);
}
@PostMapping("/open/add")
public AjaxResult openAdd(@RequestBody WmsOutPlan wmsOutPlan) {
// 出库计划编码自动生成
if (wmsOutPlan.getPlanCode() == null || wmsOutPlan.getPlanCode().isEmpty()) {
wmsOutPlan.setPlanCode(MultiModuleCodeGenerator.generateTaskCode("CKP"));
}
return toAjax(wmsOutPlanService.insertWmsOutPlanAndRun(wmsOutPlan));
}
/**
* 查询出库计划管理列表
*/

View File

@ -30,6 +30,14 @@ public interface IWmsOutPlanService {
*/
List<WmsOutPlan> selectWmsOutPlanList(WmsOutPlan wmsOutPlan);
/**
* 新增出库计划管理并执行
*
* @param wmsOutPlan 出库计划管理
* @return 结果
*/
int insertWmsOutPlanAndRun(WmsOutPlan wmsOutPlan);
/**
* 新增出库计划管理
*

View File

@ -90,6 +90,16 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService {
return wmsOutPlanList;
}
@Transactional
@Override
public int insertWmsOutPlanAndRun(WmsOutPlan wmsOutPlan) {
wmsOutPlan.setCreateTime(DateUtils.getNowDate());
int rows = wmsOutPlanMapper.insertWmsOutPlan(wmsOutPlan);
insertWmsOutPlanDetail(wmsOutPlan);
this.runWmsOutPlan(new Long[]{wmsOutPlan.getWmsOutPlanId()});
return rows;
}
/**
* 新增出库计划管理
*