完成出库计划新增接口,并自动执行出库计划,在数量等条件满足的情况下生成相应的出库任务
This commit is contained in:
parent
26561fd2a7
commit
dab8541b37
@ -7,6 +7,7 @@ import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.generator.util.MultiModuleCodeGenerator;
|
||||
import com.ktg.mes.md.domain.WmsOutPlan;
|
||||
import com.ktg.mes.md.domain.WmsOutPlanDetailEntity;
|
||||
import com.ktg.mes.md.service.IWmsOutPlanService;
|
||||
@ -40,6 +41,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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库计划管理列表
|
||||
*/
|
||||
|
@ -29,6 +29,14 @@ public interface IWmsOutPlanService {
|
||||
*/
|
||||
List<WmsOutPlan> selectWmsOutPlanList(WmsOutPlan wmsOutPlan);
|
||||
|
||||
/**
|
||||
* 新增出库计划管理并执行
|
||||
*
|
||||
* @param wmsOutPlan 出库计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
int insertWmsOutPlanAndRun(WmsOutPlan wmsOutPlan);
|
||||
|
||||
/**
|
||||
* 新增出库计划管理
|
||||
*
|
||||
|
@ -73,6 +73,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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库计划管理
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user