【工艺路线】保存初步
This commit is contained in:
parent
b223472f4f
commit
ae4547189f
|
|
@ -4,12 +4,14 @@ package com.nflg.product.technology.api;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
import com.nflg.product.technology.pojo.query.ProcessRouteTaskQuery;
|
import com.nflg.product.technology.pojo.query.ProcessRouteTaskQuery;
|
||||||
|
import com.nflg.product.technology.pojo.vo.BomNewPBomVO;
|
||||||
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskVO;
|
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskVO;
|
||||||
import com.nflg.product.technology.service.ProcessRouteTaskService;
|
import com.nflg.product.technology.service.ProcessRouteTaskService;
|
||||||
import nflg.product.common.vo.ResultVO;
|
import nflg.product.common.vo.ResultVO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -33,7 +35,7 @@ public class ProcessRouteTaskApi extends BaseApi {
|
||||||
* @return 所有数据
|
* @return 所有数据
|
||||||
*/
|
*/
|
||||||
@PostMapping("page")
|
@PostMapping("page")
|
||||||
public ResultVO<IPage<ProcessRouteTaskVO>> selectAll(@RequestBody ProcessRouteTaskQuery query) {
|
public ResultVO<IPage<ProcessRouteTaskVO>> page(@RequestBody ProcessRouteTaskQuery query) {
|
||||||
return ResultVO.success(processRouteTaskService.selectPageByCondition(query));
|
return ResultVO.success(processRouteTaskService.selectPageByCondition(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,4 +49,25 @@ public class ProcessRouteTaskApi extends BaseApi {
|
||||||
return ResultVO.success(processRouteTaskService.detail(rowId));
|
return ResultVO.success(processRouteTaskService.detail(rowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
* @param processRouteTaskVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("save")
|
||||||
|
public ResultVO<IPage<ProcessRouteTaskVO>> save(@RequestBody ProcessRouteTaskVO processRouteTaskVO) {
|
||||||
|
processRouteTaskService.save(processRouteTaskVO);
|
||||||
|
return ResultVO.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取PBOM所有层级
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("getPBomAllTree")
|
||||||
|
public ResultVO<List<BomNewPBomVO>> getPBomAllTree(@RequestBody ProcessRouteTaskQuery query) {
|
||||||
|
return ResultVO.success(processRouteTaskService.getPBomAllTree(query));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.nflg.product.technology.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum HandleStateEnum implements ValueEnum<Integer> {
|
||||||
|
|
||||||
|
// 处理状态:1=修改中、2=暂存中、3=已完成',
|
||||||
|
HANDLER_UPDATING(1, "修改中"),
|
||||||
|
HANDLER_TEMPSAVING(2, "暂存中"),
|
||||||
|
HANDLER_FINISHED(3, "已完成");
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
public static HandleStateEnum findDescriptionByValue(Integer value) {
|
||||||
|
for (HandleStateEnum valueEnum : HandleStateEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String byValue(Integer value){
|
||||||
|
return Optional.ofNullable(findDescriptionByValue(value))
|
||||||
|
.map(HandleStateEnum::getDescription).orElse("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.nflg.product.technology.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum SapStateEnum implements ValueEnum<Integer> {
|
||||||
|
|
||||||
|
// SAP导入状态:1=已导入、2=未导入、3=异常、4=已修改(未导入)
|
||||||
|
STATE_IMPORTED(1, "已导入"),
|
||||||
|
STATE_UNIMPORT(2, "未导入"),
|
||||||
|
STATE_EXCEPTION(3, "异常"),
|
||||||
|
STATE_UPDATED(4, "已修改(未导入)");
|
||||||
|
|
||||||
|
private final Integer value;
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
public static SapStateEnum findDescriptionByValue(Integer value) {
|
||||||
|
for (SapStateEnum valueEnum : SapStateEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String byValue(Integer value){
|
||||||
|
return Optional.ofNullable(findDescriptionByValue(value))
|
||||||
|
.map(SapStateEnum::getDescription).orElse("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.nflg.product.technology.pojo.entity;
|
package com.nflg.product.technology.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
@ -94,19 +91,19 @@ public class ProcessRouteTaskAssemblyEntity implements Serializable {
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
// 创建人
|
// 创建人
|
||||||
@TableField(value = "created_by")
|
@TableField(value = "created_by",fill = FieldFill.INSERT)
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
|
|
||||||
// 创建时间
|
// 创建时间
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time",fill = FieldFill.INSERT)
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
// 更新人
|
// 更新人
|
||||||
@TableField(value = "updated_by")
|
@TableField(value = "updated_by",fill = FieldFill.INSERT_UPDATE)
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
|
|
||||||
// 更新时间
|
// 更新时间
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time",fill = FieldFill.INSERT_UPDATE)
|
||||||
private LocalDateTime updatedTime;
|
private LocalDateTime updatedTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.nflg.product.technology.pojo.entity;
|
package com.nflg.product.technology.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
@ -73,19 +70,19 @@ public class ProcessRouteTaskEntity implements Serializable {
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
// 创建人
|
// 创建人
|
||||||
@TableField(value = "created_by")
|
@TableField(value = "created_by",fill = FieldFill.INSERT)
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
|
|
||||||
// 创建时间
|
// 创建时间
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time",fill = FieldFill.INSERT)
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
// 更新人
|
// 更新人
|
||||||
@TableField(value = "updated_by")
|
@TableField(value = "updated_by",fill = FieldFill.INSERT_UPDATE)
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
|
|
||||||
// 更新时间
|
// 更新时间
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time",fill = FieldFill.INSERT_UPDATE)
|
||||||
private LocalDateTime updatedTime;
|
private LocalDateTime updatedTime;
|
||||||
|
|
||||||
// 处理状态:1=修改中、2=暂存中、3=已完成
|
// 处理状态:1=修改中、2=暂存中、3=已完成
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.nflg.product.technology.pojo.entity;
|
package com.nflg.product.technology.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
@ -130,19 +127,19 @@ public class ProcessRouteTaskProcessesEntity implements Serializable {
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
// 创建人
|
// 创建人
|
||||||
@TableField(value = "created_by")
|
@TableField(value = "created_by",fill = FieldFill.INSERT)
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
|
|
||||||
// 创建时间
|
// 创建时间
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time",fill = FieldFill.INSERT)
|
||||||
private LocalDateTime createdTime;
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
// 更新人
|
// 更新人
|
||||||
@TableField(value = "updated_by")
|
@TableField(value = "updated_by",fill = FieldFill.INSERT_UPDATE)
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
|
|
||||||
// 更新时间
|
// 更新时间
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time",fill = FieldFill.INSERT_UPDATE)
|
||||||
private LocalDateTime updatedTime;
|
private LocalDateTime updatedTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
package com.nflg.product.technology.pojo.entity;
|
package com.nflg.product.technology.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
@ -107,16 +104,16 @@ public class ProcessWorkCenterEntity implements Serializable {
|
||||||
@TableField(value = "end_time")
|
@TableField(value = "end_time")
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
@TableField(value = "created_by")
|
@TableField(value = "created_by",fill = FieldFill.INSERT)
|
||||||
private String createdBy;
|
private String createdBy;
|
||||||
|
|
||||||
@TableField(value = "created_time")
|
@TableField(value = "created_time",fill = FieldFill.INSERT)
|
||||||
private Date createdTime;
|
private Date createdTime;
|
||||||
|
|
||||||
@TableField(value = "updated_by")
|
@TableField(value = "updated_by",fill = FieldFill.INSERT_UPDATE)
|
||||||
private String updatedBy;
|
private String updatedBy;
|
||||||
|
|
||||||
@TableField(value = "updated_time")
|
@TableField(value = "updated_time",fill = FieldFill.INSERT_UPDATE)
|
||||||
private Date updatedTime;
|
private Date updatedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,113 @@
|
||||||
|
package com.nflg.product.technology.pojo.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BomNewPBomVO extends BaseMaterialVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("行id")
|
||||||
|
private Long rowId=0L;
|
||||||
|
|
||||||
|
@ApiModelProperty("BOM版本ID")
|
||||||
|
private Long bomRowId=0L;
|
||||||
|
|
||||||
|
@ApiModelProperty("父级行ID")
|
||||||
|
private Long parentRowId=0L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("排序号")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("层级")
|
||||||
|
private Integer levelNum;
|
||||||
|
@ApiModelProperty("查询物料bom版本")
|
||||||
|
private String bomVersion;
|
||||||
|
|
||||||
|
@ApiModelProperty("层级描述")
|
||||||
|
private String levelNumText;
|
||||||
|
|
||||||
|
public String getLevelNumText(){
|
||||||
|
if(Objects.nonNull(levelNum)){
|
||||||
|
levelNumText=StrUtil.repeat(".",levelNum);
|
||||||
|
levelNumText=levelNumText+levelNum;
|
||||||
|
}
|
||||||
|
return levelNumText;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工厂编码")
|
||||||
|
private String facCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本号")
|
||||||
|
private String currentVersion;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private BigDecimal num;
|
||||||
|
|
||||||
|
public BigDecimal getNum(){
|
||||||
|
|
||||||
|
if(Objects.nonNull(num)) {
|
||||||
|
DecimalFormat df2 = new DecimalFormat("#.####");
|
||||||
|
|
||||||
|
return new BigDecimal(df2.format(num));
|
||||||
|
}
|
||||||
|
// else{
|
||||||
|
// return new BigDecimal(1);
|
||||||
|
// }
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单重
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "单重")
|
||||||
|
private BigDecimal unitWeight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总重
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "总重")
|
||||||
|
private BigDecimal totalWeight;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人编码")
|
||||||
|
private String createdBy;
|
||||||
|
@ApiModelProperty(value = "设计人")
|
||||||
|
private String deviseName;
|
||||||
|
@ApiModelProperty(value = "设计人员编码")
|
||||||
|
private String deviseUserCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间-有效开始时间")
|
||||||
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
|
||||||
|
private LocalDateTime expireEndTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标记0-未汇总 1-汇总")
|
||||||
|
private Integer tag=0;
|
||||||
|
|
||||||
|
|
||||||
|
public LocalDateTime getExpireEndTime(){
|
||||||
|
if(Objects.isNull(expireEndTime)) {
|
||||||
|
return Objects.isNull(expireEndTime) ? LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) : expireEndTime;
|
||||||
|
}else {
|
||||||
|
return expireEndTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,10 +4,13 @@ import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
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.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.SapStateEnum;
|
||||||
import com.nflg.product.technology.mapper.master.ProcessRouteTaskAssemblyMapper;
|
import com.nflg.product.technology.mapper.master.ProcessRouteTaskAssemblyMapper;
|
||||||
import com.nflg.product.technology.mapper.master.ProcessRouteTaskMapper;
|
import com.nflg.product.technology.mapper.master.ProcessRouteTaskMapper;
|
||||||
import com.nflg.product.technology.mapper.master.ProcessRouteTaskProcessesMapper;
|
import com.nflg.product.technology.mapper.master.ProcessRouteTaskProcessesMapper;
|
||||||
|
|
@ -15,11 +18,13 @@ import com.nflg.product.technology.pojo.entity.ProcessRouteTaskAssemblyEntity;
|
||||||
import com.nflg.product.technology.pojo.entity.ProcessRouteTaskEntity;
|
import com.nflg.product.technology.pojo.entity.ProcessRouteTaskEntity;
|
||||||
import com.nflg.product.technology.pojo.entity.ProcessRouteTaskProcessesEntity;
|
import com.nflg.product.technology.pojo.entity.ProcessRouteTaskProcessesEntity;
|
||||||
import com.nflg.product.technology.pojo.query.ProcessRouteTaskQuery;
|
import com.nflg.product.technology.pojo.query.ProcessRouteTaskQuery;
|
||||||
|
import com.nflg.product.technology.pojo.vo.BomNewPBomVO;
|
||||||
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskAssemblyVO;
|
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskAssemblyVO;
|
||||||
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskProcessesVO;
|
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskProcessesVO;
|
||||||
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskVO;
|
import com.nflg.product.technology.pojo.vo.ProcessRouteTaskVO;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
@ -81,4 +86,98 @@ public class ProcessRouteTaskService extends ServiceImpl<ProcessRouteTaskMapper,
|
||||||
}
|
}
|
||||||
return processRouteTaskVO;
|
return processRouteTaskVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(ProcessRouteTaskVO processRouteTaskVO) {
|
||||||
|
ProcessRouteTaskEntity taskEntity = Convert.convert(ProcessRouteTaskEntity.class, processRouteTaskVO);
|
||||||
|
// 新增
|
||||||
|
if (ObjectUtil.isEmpty(processRouteTaskVO.getRowId())) {
|
||||||
|
taskEntity.setRowId(IdWorker.getId());
|
||||||
|
taskEntity.setHandleState(HandleStateEnum.HANDLER_TEMPSAVING.getValue());
|
||||||
|
taskEntity.setSapState(SapStateEnum.STATE_UPDATED.getValue());
|
||||||
|
} else {
|
||||||
|
// 修改
|
||||||
|
|
||||||
|
}
|
||||||
|
this.saveOrUpdate(taskEntity);
|
||||||
|
// 工序列表
|
||||||
|
List<ProcessRouteTaskProcessesVO> processesVOList = processRouteTaskVO.getProcessesVOList();
|
||||||
|
if (CollUtil.isNotEmpty(processesVOList)) {
|
||||||
|
List<ProcessRouteTaskProcessesEntity> taskProcessesEntityList = Convert.toList(ProcessRouteTaskProcessesEntity.class, processesVOList);
|
||||||
|
taskProcessesEntityList.forEach(taskProcessesEntity -> {
|
||||||
|
// 新增
|
||||||
|
if (ObjectUtil.isEmpty(taskProcessesEntity.getRowId())) {
|
||||||
|
taskProcessesEntity.setRowId(IdWorker.getId());
|
||||||
|
taskProcessesEntity.setTaskRowId(taskEntity.getRowId());
|
||||||
|
} else {
|
||||||
|
// 修改
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
processRouteTaskProcessesService.saveOrUpdateBatch(taskProcessesEntityList);
|
||||||
|
}
|
||||||
|
// 组件分配列表
|
||||||
|
List<ProcessRouteTaskAssemblyVO> assemblyVOList = processRouteTaskVO.getAssemblyVOList();
|
||||||
|
if (CollUtil.isNotEmpty(assemblyVOList)) {
|
||||||
|
List<ProcessRouteTaskAssemblyEntity> taskAssemblyEntityList = Convert.toList(ProcessRouteTaskAssemblyEntity.class, assemblyVOList);
|
||||||
|
taskAssemblyEntityList.forEach(taskAssemblyEntity -> {
|
||||||
|
// 新增
|
||||||
|
if (ObjectUtil.isEmpty(taskAssemblyEntity.getRowId())) {
|
||||||
|
taskAssemblyEntity.setRowId(IdWorker.getId());
|
||||||
|
taskAssemblyEntity.setTaskRowId(taskEntity.getRowId());
|
||||||
|
} else {
|
||||||
|
// 修改
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
processRouteTaskAssemblyService.saveOrUpdateBatch(taskAssemblyEntityList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BomNewPBomVO> getPBomAllTree(ProcessRouteTaskQuery query) {
|
||||||
|
if (ObjectUtil.isEmpty(query.getMaterialNo())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// BomNewPbomParentVO parentFormal0=listParent.get(0);
|
||||||
|
// ForwardReportVO forwardReportVO = Convert.convert(ForwardReportVO.class, parentFormal0);
|
||||||
|
//
|
||||||
|
// List<ForwardReportVO> nodesList=new ArrayList<>();
|
||||||
|
// for ( BomNewPbomParentVO parentFormal:
|
||||||
|
// listParent ) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// List<BomNewPbomParentVO> bomList = bomDetailAndParent(parentFormal);
|
||||||
|
//
|
||||||
|
// if(CollUtil.isEmpty(bomList)){
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// initMaterialInfo(bomList);
|
||||||
|
// List<ForwardReportVO> convertBomList = Convert.convert(new TypeReference<List<ForwardReportVO>>() {
|
||||||
|
// }, bomList);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// sumLevel(convertBomList);
|
||||||
|
// //转化为树结构
|
||||||
|
// List<ForwardReportVO> nodeList = showDataStyle(convertBomList, parentFormal.getRowId());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// for (ForwardReportVO vo :
|
||||||
|
// nodeList) {
|
||||||
|
// vo.setBomVersion(parentFormal.getCurrentVersion());
|
||||||
|
// // vo.setDeviseName(parentFormal.getDeviseName());
|
||||||
|
// // vo.setCreatedTime(parentFormal.getCreatedTime());
|
||||||
|
// // vo.setExpireEndTime(parentFormal.getReleaseTime());
|
||||||
|
// // 10、40、50、60、70大类以及200201小类这些不需要BOM的物料,版本号显示B00 by 10002327 241101
|
||||||
|
// if(MaterialshouldBomExistUtil.checkNoNeedBom(vo) || Objects.equals("T",vo.getProjectType())){
|
||||||
|
// vo.setCurrentVersion(OriginalConstant.NO_NEED_BOM);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// nodesList.addAll(nodeList);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// ReportBomVO reportBomVO =buildReportBomVo(forwardReportVO,nodesList,query.getDataType());
|
||||||
|
// reportBomVO.setBomNum(listParent.size());
|
||||||
|
// return reportBomVO;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue