【工艺路线】保存校验
This commit is contained in:
parent
587a3d6eda
commit
e8956d78eb
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -107,9 +108,26 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
|||
}
|
||||
if (CollUtil.isEmpty(processRouteTaskVO.getProcessesVOList())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "工序列表不能为空");
|
||||
} else {
|
||||
for (int i = 0; i < processRouteTaskVO.getProcessesVOList().size(); i++) {
|
||||
ProcessRouteTaskProcessesVO item = processRouteTaskVO.getProcessesVOList().get(i);
|
||||
if (ObjectUtil.isEmpty(item.getProcesse())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "工序列表第" + (i + 1) + "行工序号不能为空");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(item.getWorkCenter())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "工序列表第" + (i + 1) + "行工作中心不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isEmpty(processRouteTaskVO.getAssemblyVOList())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "组件分配列表不能为空");
|
||||
} else {
|
||||
for (int i = 0; i < processRouteTaskVO.getAssemblyVOList().size(); i++) {
|
||||
ProcessRouteTaskAssemblyVO item = processRouteTaskVO.getAssemblyVOList().get(i);
|
||||
if (ObjectUtil.isEmpty(item.getProcesse())) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, "组件分配列表第" + (i + 1) + "行操作/活动不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<ProcessRouteTaskEntity> existsTaskList = this.lambdaQuery().eq(ProcessRouteTaskEntity::getFactory, processRouteTaskVO.getFactory())
|
||||
|
|
@ -124,12 +142,20 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
|||
// 新增
|
||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getRowId())) {
|
||||
taskEntity.setRowId(IdWorker.getId());
|
||||
taskEntity.setHandleState(HandleStateEnum.HANDLER_TEMPSAVING.getValue());
|
||||
taskEntity.setSapState(SapStateEnum.STATE_UPDATED.getValue());
|
||||
taskEntity.setTaskCode(RandomUtil.randomString(8));
|
||||
} else {
|
||||
// 修改
|
||||
|
||||
}
|
||||
// 保存
|
||||
if (!"tempSave".equals(processRouteTaskVO.getSaveType())) {
|
||||
taskEntity.setHandleState(HandleStateEnum.HANDLER_UPDATING.getValue());
|
||||
taskEntity.setSapState(SapStateEnum.STATE_UPDATED.getValue());
|
||||
} else {
|
||||
// 暂存
|
||||
taskEntity.setHandleState(HandleStateEnum.HANDLER_TEMPSAVING.getValue());
|
||||
taskEntity.setSapState(SapStateEnum.STATE_UNIMPORT.getValue());
|
||||
}
|
||||
this.saveOrUpdate(taskEntity);
|
||||
// 工序列表
|
||||
List<ProcessRouteTaskProcessesVO> processesVOList = processRouteTaskVO.getProcessesVOList();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<sql id="base_column_list">
|
||||
row_id,task_code, factory, material_no, description, usefulness, status, from_batch,
|
||||
to_batch, expire_start_time, expire_end_time, del_flag, created_by, created_time, updated_by,
|
||||
updated_time, handle_status, sap_state
|
||||
updated_time, handle_state, sap_state
|
||||
</sql>
|
||||
|
||||
<select id="selectPageByCondition" resultType="com.nflg.product.technology.pojo.vo.ProcessRouteTaskVO">
|
||||
|
|
|
|||
Loading…
Reference in New Issue