【工艺路线】保存字段
This commit is contained in:
parent
b8e470621d
commit
7b48a69a76
|
|
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||||
import com.nflg.product.base.core.vo.PageVO;
|
import com.nflg.product.base.core.vo.PageVO;
|
||||||
import com.nflg.product.technology.constant.HandleStateEnum;
|
import com.nflg.product.technology.constant.HandleStateEnum;
|
||||||
|
|
@ -28,6 +29,8 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ForkJoinPool;
|
import java.util.concurrent.ForkJoinPool;
|
||||||
import java.util.concurrent.ForkJoinTask;
|
import java.util.concurrent.ForkJoinTask;
|
||||||
|
|
@ -138,11 +141,18 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
||||||
throw new NflgBusinessException(STATE.ParamErr, "工厂" + processRouteTaskVO.getFactory() + "物料号" + processRouteTaskVO.getMaterialNo() + "工艺路线已存在");
|
throw new NflgBusinessException(STATE.ParamErr, "工厂" + processRouteTaskVO.getFactory() + "物料号" + processRouteTaskVO.getMaterialNo() + "工艺路线已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||||
|
LocalDateTime firstDay = LocalDateTime.parse(year + "-01-01 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
LocalDateTime lastDay = LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
ProcessRouteTaskEntity taskEntity = Convert.convert(ProcessRouteTaskEntity.class, processRouteTaskVO);
|
ProcessRouteTaskEntity taskEntity = Convert.convert(ProcessRouteTaskEntity.class, processRouteTaskVO);
|
||||||
|
taskEntity.setUpdatedByName(SessionUtil.getRealName());
|
||||||
// 新增
|
// 新增
|
||||||
if (ObjectUtil.isEmpty(processRouteTaskVO.getRowId())) {
|
if (ObjectUtil.isEmpty(processRouteTaskVO.getRowId())) {
|
||||||
taskEntity.setRowId(IdWorker.getId());
|
taskEntity.setRowId(IdWorker.getId());
|
||||||
taskEntity.setTaskCode(RandomUtil.randomString(8));
|
taskEntity.setTaskCode(RandomUtil.randomString(8));
|
||||||
|
taskEntity.setCreatedByName(SessionUtil.getRealName());
|
||||||
|
taskEntity.setExpireStartTime(firstDay);
|
||||||
|
taskEntity.setExpireEndTime(lastDay);
|
||||||
} else {
|
} else {
|
||||||
// 修改
|
// 修改
|
||||||
|
|
||||||
|
|
@ -162,10 +172,14 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
||||||
if (CollUtil.isNotEmpty(processesVOList)) {
|
if (CollUtil.isNotEmpty(processesVOList)) {
|
||||||
List<ProcessRouteTaskProcessesEntity> taskProcessesEntityList = Convert.toList(ProcessRouteTaskProcessesEntity.class, processesVOList);
|
List<ProcessRouteTaskProcessesEntity> taskProcessesEntityList = Convert.toList(ProcessRouteTaskProcessesEntity.class, processesVOList);
|
||||||
taskProcessesEntityList.forEach(taskProcessesEntity -> {
|
taskProcessesEntityList.forEach(taskProcessesEntity -> {
|
||||||
|
taskProcessesEntity.setUpdatedByName(SessionUtil.getRealName());
|
||||||
// 新增
|
// 新增
|
||||||
if (ObjectUtil.isEmpty(taskProcessesEntity.getRowId())) {
|
if (ObjectUtil.isEmpty(taskProcessesEntity.getRowId())) {
|
||||||
taskProcessesEntity.setRowId(IdWorker.getId());
|
taskProcessesEntity.setRowId(IdWorker.getId());
|
||||||
taskProcessesEntity.setTaskRowId(taskEntity.getRowId());
|
taskProcessesEntity.setTaskRowId(taskEntity.getRowId());
|
||||||
|
taskProcessesEntity.setCreatedByName(SessionUtil.getRealName());
|
||||||
|
taskProcessesEntity.setExpireStartTime(firstDay);
|
||||||
|
taskProcessesEntity.setExpireEndTime(lastDay);
|
||||||
} else {
|
} else {
|
||||||
// 修改
|
// 修改
|
||||||
|
|
||||||
|
|
@ -178,10 +192,14 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
||||||
if (CollUtil.isNotEmpty(assemblyVOList)) {
|
if (CollUtil.isNotEmpty(assemblyVOList)) {
|
||||||
List<ProcessRouteTaskAssemblyEntity> taskAssemblyEntityList = Convert.toList(ProcessRouteTaskAssemblyEntity.class, assemblyVOList);
|
List<ProcessRouteTaskAssemblyEntity> taskAssemblyEntityList = Convert.toList(ProcessRouteTaskAssemblyEntity.class, assemblyVOList);
|
||||||
taskAssemblyEntityList.forEach(taskAssemblyEntity -> {
|
taskAssemblyEntityList.forEach(taskAssemblyEntity -> {
|
||||||
|
taskAssemblyEntity.setUpdatedByName(SessionUtil.getRealName());
|
||||||
// 新增
|
// 新增
|
||||||
if (ObjectUtil.isEmpty(taskAssemblyEntity.getRowId())) {
|
if (ObjectUtil.isEmpty(taskAssemblyEntity.getRowId())) {
|
||||||
taskAssemblyEntity.setRowId(IdWorker.getId());
|
taskAssemblyEntity.setRowId(IdWorker.getId());
|
||||||
taskAssemblyEntity.setTaskRowId(taskEntity.getRowId());
|
taskAssemblyEntity.setTaskRowId(taskEntity.getRowId());
|
||||||
|
taskAssemblyEntity.setCreatedByName(SessionUtil.getRealName());
|
||||||
|
taskAssemblyEntity.setExpireStartTime(firstDay);
|
||||||
|
taskAssemblyEntity.setExpireEndTime(lastDay);
|
||||||
} else {
|
} else {
|
||||||
// 修改
|
// 修改
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<sql id="base_column_list">
|
<sql id="base_column_list">
|
||||||
row_id,task_code, factory, material_no, description, usefulness, status, from_batch,
|
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,
|
to_batch, expire_start_time, expire_end_time, del_flag, created_by, created_by_name, created_time, updated_by, updated_by_name,
|
||||||
updated_time, handle_state, sap_state
|
updated_time, handle_state, sap_state
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue