Merge remote-tracking branch 'origin/master-hlq20241114batch'

This commit is contained in:
10001392 2024-11-18 17:14:54 +08:00
commit 812935d5ff
9 changed files with 121 additions and 96 deletions

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.mzt.logapi.starter.annotation.LogRecord;
import com.nflg.product.base.core.api.BaseApi;
import com.nflg.product.base.core.conmon.util.SessionUtil;
import com.nflg.product.bomnew.constant.EBomConstant;
@ -65,6 +66,7 @@ public class BatchBomApi extends BaseApi {
@PostMapping("updateEBom")
@ApiOperation("更新EBOM并导入SAP")
@LogRecord(success = "更新EBOM并导入SAP操作结果:{{#_ret}}", bizNo = "",type = "更新EBOM并导入SAP")
public ResultVO<List<OperationErrorMsgVO>> updateEBom(@RequestBody List<BaseBomVO> baseBomVOList) {
List<Long> addRowIds = batchBomService.updateEBom(baseBomVOList);
List<OperationErrorMsgVO> errorMsgVOS = new ArrayList<>();
@ -80,6 +82,7 @@ public class BatchBomApi extends BaseApi {
@PostMapping("updatePBom")
@ApiOperation("更新PBOM并导入SAP")
@LogRecord(success = "更新PBOM并导入SAP操作结果:{{#_ret}}", bizNo = "",type = "更新PBOM并导入SAP")
public ResultVO<List<OperationErrorMsgVO>> updatePBom(@RequestBody List<BaseBomVO> baseBomVOList) {
List<Long> addRowIds = batchBomService.updatePBom(baseBomVOList);
List<OperationErrorMsgVO> errorMsgVOS = new ArrayList<>();

View File

@ -23,4 +23,5 @@ public class BomConstant {
public static final String ADD="新增";
public static final String UP="修改";
public static final String DEL="删除";
public static final String BATCH="批量替代";
}

View File

@ -14,7 +14,8 @@ public enum EBomSourceEnum implements ValueEnum<Integer> {
FROM_MDM(3, "MDM创建"),
FROM_SAP(4, "从SAP导入"),
FROM_CHANGE(5, "变更"),
FROM_DELETE(6, "BOM删除");
FROM_DELETE(6, "BOM删除"),
FROM_BATCH(7, "批量变更");
private final Integer value;
private final String description;

View File

@ -16,7 +16,8 @@ public enum PbomSourceEnum implements ValueEnum<Integer> {
FROM_SAP(3, "从SAP导入"),
FROM_COPY(4, "复制"),
FROM_CHANGE(5, "变更"),
FROM_DELETE(6, "BOM删除");
FROM_DELETE(6, "BOM删除"),
FROM_BATCH(7, "批量变更");
private final Integer value;
private final String description;

View File

@ -49,5 +49,6 @@ public class UpdateLogVO {
@ApiModelProperty("旧版或新版 0-旧版 1-新版")
private Integer oldOrNewVersion=0;
@ApiModelProperty(value = "来源")
private Integer source;
}

View File

@ -186,7 +186,7 @@ public class BatchBomService {
baseBomVO.setNewMaterialNo(batchBomQuery.getNewMaterialNo());
baseBomVO.setNewNum(newReplaceTimes.divide(replaceTimes, decimalScale, RoundingMode.HALF_UP).multiply(baseBomVO.getNum()));
baseBomVO.setNewUnit(batchBomQuery.getNewMaterialUnit());
baseBomVO.setNewVersion(VersionUtil.getNextVersion(baseBomVO.getParentVersion()));
baseBomVO.setNewVersion(VersionUtil.getPBomUpgradNextVersion(baseBomVO.getParentVersion()));
resultList.add(baseBomVO);
}
}
@ -319,6 +319,53 @@ public class BatchBomService {
List<Long> delRowIds = new ArrayList<>(baseBomVOList.size()); // 需要从正式表删除的父级BOM ID
LocalDateTime now = LocalDateTime.now();
int createdJob = userRoleService.technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue();
// TODO 如果有草稿中数据草稿大版本+1先改草稿中的版本否则会报错Duplicate entry 'xxx-A00.0a-1010' for key 'uniq_material_no_version'
for (BaseBomVO baseBomVO: baseBomVOList) {
BomNewEbomParentEntity draftParent = bomNewEbomParentService.lambdaQuery()
.eq(BomNewEbomParentEntity::getMaterialNo, baseBomVO.getParentMaterialNo())
.lt(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
.one();
if (ObjectUtil.isNotEmpty(draftParent)) {
// 草稿版本 A01 -> A02A01.1 -> A02.1
String[] currentVersionArr = draftParent.getCurrentVersion().split("\\.");
String newVersion = VersionUtil.getNextVersion(currentVersionArr[0]);
if (currentVersionArr.length > 1) {
newVersion += "." + currentVersionArr[1];
}
draftParent.setCurrentVersion(newVersion);
draftParent.setModifyTime(LocalDateTime.now());
bomNewEbomParentService.updateById(draftParent);
// 子级有原物料号也要替代成新物料号
List<BomNewEbomChildEntity> draftChildren = bomNewEbomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, draftParent.getRowId()).list();
if (CollectionUtil.isNotEmpty(draftChildren)) {
List<BomNewEbomChildEntity> replaceChildren = draftChildren.stream().filter(child -> baseBomVO.getMaterialNo().equals(child.getMaterialNo())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(replaceChildren)) {
for (BomNewEbomChildEntity newReplaceChild: replaceChildren) {
newReplaceChild.setRowId(IdWorker.getId());
newReplaceChild.setIdentityNo(draftParent.getRowId() + "_" + newReplaceChild.getRowId());
newReplaceChild.setMaterialNo(baseBomVO.getNewMaterialNo()); // 新物料编码
newReplaceChild.setDrawingNo(newMaterialInfo.getDrawingNo());
newReplaceChild.setMaterialName(newMaterialInfo.getMaterialName());
newReplaceChild.setMaterialDesc(newMaterialInfo.getMaterialDesc()); // 新物料描述
newReplaceChild.setMaterialTexture(newMaterialInfo.getMaterialTexture());
newReplaceChild.setMaterialUnit(baseBomVO.getNewUnit()); // 新单位
newReplaceChild.setNum(baseBomVO.getNewNum()); // 新数量
newReplaceChild.setMaterialCategoryCode(newMaterialInfo.getMaterialCategoryCode());
// TODO 新单重新总重要不要更新
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newReplaceChild.setCreatedTime(now);
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
newReplaceChild.setSource(EBomSourceEnum.FROM_BATCH.getValue());
}
bomNewEbomChildService.updateBatchById(replaceChildren);
}
}
}
}
for (BaseBomVO baseBomVO: baseBomVOList) {
// 找到父级
BomNewEbomParentEntity ebomParentEntity = bomNewEbomParentService.lambdaQuery().eq(BomNewEbomParentEntity::getRowId, baseBomVO.getParentRowId()).one();
@ -338,6 +385,7 @@ public class BatchBomService {
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newParent.setCreatedTime(now);
newParent.setModifyTime(now);
newParent.setSource(EBomSourceEnum.FROM_BATCH.getValue());
newParent.setSapState(SapStatusEnum.UNPUB_SAP.getValue());
newParent.setSapTime(null);
newParent.setDeptRowId(SessionUtil.getDepartRowId());
@ -358,6 +406,7 @@ public class BatchBomService {
newChild.setCreatedTime(now);
newChild.setModifyTime(now);
newChild.setCreatedBy(SessionUtil.getUserCode());
newChild.setSource(EBomSourceEnum.FROM_BATCH.getValue());
newChildList.add(newChild);
});
BomNewEbomChildEntity newReplaceChild = new BomNewEbomChildEntity();
@ -379,6 +428,7 @@ public class BatchBomService {
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
newReplaceChild.setSource(EBomSourceEnum.FROM_BATCH.getValue());
newChildList.add(newReplaceChild);
bomNewEbomParentService.save(newParent);
bomNewEbomChildService.saveBatch(newChildList);
@ -395,50 +445,6 @@ public class BatchBomService {
// 转移后删除
bomNewEbomParentService.delEBomHistory(delRowIds);
}
// TODO 如果有草稿中数据草稿版本+1
for (BaseBomVO baseBomVO: baseBomVOList) {
BomNewEbomParentEntity draftParent = bomNewEbomParentService.lambdaQuery()
.eq(BomNewEbomParentEntity::getMaterialNo, baseBomVO.getParentMaterialNo())
.lt(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
.one();
if (ObjectUtil.isNotEmpty(draftParent)) {
// 草稿版本 A01 -> A02A01.1 -> A02.1
String[] currentVersionArr = draftParent.getCurrentVersion().split("\\.");
String newVersion = VersionUtil.getNextVersion(currentVersionArr[0]);
if (currentVersionArr.length > 1) {
newVersion += "." + currentVersionArr[1];
}
draftParent.setCurrentVersion(newVersion);
draftParent.setModifyTime(LocalDateTime.now());
bomNewEbomParentService.updateById(draftParent);
// 子级有原物料号也要替代成新物料号
List<BomNewEbomChildEntity> draftChildren = bomNewEbomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, baseBomVO.getParentRowId()).list();
if (CollectionUtil.isNotEmpty(draftChildren)) {
List<BomNewEbomChildEntity> replaceChildren = draftChildren.stream().filter(child -> baseBomVO.getMaterialNo().equals(child.getMaterialNo())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(replaceChildren)) {
for (BomNewEbomChildEntity newReplaceChild: replaceChildren) {
newReplaceChild.setRowId(IdWorker.getId());
newReplaceChild.setIdentityNo(draftParent.getRowId() + "_" + newReplaceChild.getRowId());
newReplaceChild.setMaterialNo(baseBomVO.getNewMaterialNo()); // 新物料编码
newReplaceChild.setDrawingNo(newMaterialInfo.getDrawingNo());
newReplaceChild.setMaterialName(newMaterialInfo.getMaterialName());
newReplaceChild.setMaterialDesc(newMaterialInfo.getMaterialDesc()); // 新物料描述
newReplaceChild.setMaterialTexture(newMaterialInfo.getMaterialTexture());
newReplaceChild.setMaterialUnit(baseBomVO.getNewUnit()); // 新单位
newReplaceChild.setNum(baseBomVO.getNewNum()); // 新数量
newReplaceChild.setMaterialCategoryCode(newMaterialInfo.getMaterialCategoryCode());
// TODO 新单重新总重要不要更新
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newReplaceChild.setCreatedTime(now);
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
}
bomNewEbomChildService.updateBatchById(replaceChildren);
}
}
}
}
return addRowIds;
}
@ -460,6 +466,49 @@ public class BatchBomService {
List<Long> delRowIds = new ArrayList<>(baseBomVOList.size()); // 需要从正式表删除的父级BOM ID
LocalDateTime now = LocalDateTime.now();
int createdJob = userRoleService.technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue();
// TODO 如果有草稿中数据草稿小小版本+1先改草稿中的版本否则会报错Duplicate entry 'xxx-A00.0a-1010' for key 'uniq_material_no_version'
for (BaseBomVO baseBomVO: baseBomVOList) {
BomNewPbomParentEntity draftParent = bomNewPbomParentService.lambdaQuery()
.eq(BomNewPbomParentEntity::getMaterialNo, baseBomVO.getParentMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, baseBomVO.getFactory())
.lt(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.one();
if (ObjectUtil.isNotEmpty(draftParent)) {
// 草稿数据小小版本+1因为草稿的小小版本号已经被批量替代这个版本占用
draftParent.setCurrentVersion(VersionUtil.getPBomUpgradNextVersion(draftParent.getCurrentVersion()));
draftParent.setModifyTime(LocalDateTime.now());
bomNewPbomParentService.updateById(draftParent);
// 子级有原物料号也要替代成新物料号
List<BomNewPbomChildEntity> draftChildren = bomNewPbomChildService.lambdaQuery().eq(BomNewPbomChildEntity::getParentRowId, draftParent.getRowId()).list();
if (CollectionUtil.isNotEmpty(draftChildren)) {
List<BomNewPbomChildEntity> replaceChildren = draftChildren.stream().filter(child -> baseBomVO.getMaterialNo().equals(child.getMaterialNo())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(replaceChildren)) {
for (BomNewPbomChildEntity newReplaceChild: replaceChildren) {
newReplaceChild.setRowId(IdWorker.getId());
newReplaceChild.setIdentityNo(draftParent.getRowId() + "_" + newReplaceChild.getRowId());
newReplaceChild.setMaterialNo(baseBomVO.getNewMaterialNo()); // 新物料编码
newReplaceChild.setDrawingNo(newMaterialInfo.getDrawingNo());
newReplaceChild.setMaterialName(newMaterialInfo.getMaterialName());
newReplaceChild.setMaterialDesc(newMaterialInfo.getMaterialDesc()); // 新物料描述
newReplaceChild.setMaterialTexture(newMaterialInfo.getMaterialTexture());
newReplaceChild.setMaterialUnit(baseBomVO.getNewUnit()); // 新单位
newReplaceChild.setNum(baseBomVO.getNewNum()); // 新数量
newReplaceChild.setMaterialCategoryCode(newMaterialInfo.getMaterialCategoryCode());
// TODO 新单重新总重要不要更新
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newReplaceChild.setCreatedTime(now);
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
newReplaceChild.setSource(PbomSourceEnum.FROM_BATCH.getValue());
}
bomNewPbomChildService.updateBatchById(replaceChildren);
}
}
}
}
for (BaseBomVO baseBomVO: baseBomVOList) {
// 找到父级
BomNewPbomParentEntity pbomParentEntity = bomNewPbomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getRowId, baseBomVO.getParentRowId()).one();
@ -471,7 +520,7 @@ public class BatchBomService {
BomNewPbomChildEntity replaceChild = collect.get(0);
// 其他子级
List<BomNewPbomChildEntity> otherChildren = pbomChildEntities.stream().filter(item -> !item.getRowId().equals(baseBomVO.getChildRowId())).collect(Collectors.toList());
// 构建新版的父级规则版本号+1如果该BOM还有编辑中的草稿版本则草稿版本号也+1
// 构建新版的父级规则小小版本号+1如果该BOM还有编辑中的草稿版本则草稿小小版本号也+1
BomNewPbomParentEntity newParent = new BomNewPbomParentEntity();
BeanUtil.copyProperties(pbomParentEntity, newParent);
newParent.setRowId(IdWorker.getId());
@ -479,6 +528,7 @@ public class BatchBomService {
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newParent.setCreatedTime(now);
newParent.setModifyTime(now);
newParent.setSource(PbomSourceEnum.FROM_BATCH.getValue());
newParent.setSapState(SapStatusEnum.UNPUB_SAP.getValue());
newParent.setSapTime(null);
newParent.setDeptRowId(SessionUtil.getDepartRowId());
@ -499,6 +549,7 @@ public class BatchBomService {
newChild.setCreatedTime(now);
newChild.setModifyTime(now);
newChild.setCreatedBy(SessionUtil.getUserCode());
newChild.setSource(PbomSourceEnum.FROM_BATCH.getValue());
newChildList.add(newChild);
});
BomNewPbomChildEntity newReplaceChild = new BomNewPbomChildEntity();
@ -520,6 +571,7 @@ public class BatchBomService {
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
newReplaceChild.setSource(PbomSourceEnum.FROM_BATCH.getValue());
newChildList.add(newReplaceChild);
bomNewPbomParentService.save(newParent);
bomNewPbomChildService.saveBatch(newChildList);
@ -536,51 +588,6 @@ public class BatchBomService {
// 转移后删除
bomNewPbomParentService.delPBom(delRowIds);
}
// TODO 如果有草稿中数据草稿版本+1
for (BaseBomVO baseBomVO: baseBomVOList) {
BomNewPbomParentEntity draftParent = bomNewPbomParentService.lambdaQuery()
.eq(BomNewPbomParentEntity::getMaterialNo, baseBomVO.getParentMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, baseBomVO.getFactory())
.lt(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue())
.one();
if (ObjectUtil.isNotEmpty(draftParent)) {
// 草稿版本 A01 -> A02A01.1 -> A02.1
String[] currentVersionArr = draftParent.getCurrentVersion().split("\\.");
String newVersion = VersionUtil.getNextVersion(currentVersionArr[0]);
if (currentVersionArr.length > 1) {
newVersion += "." + currentVersionArr[1];
}
draftParent.setCurrentVersion(newVersion);
draftParent.setModifyTime(LocalDateTime.now());
bomNewPbomParentService.updateById(draftParent);
// 子级有原物料号也要替代成新物料号
List<BomNewPbomChildEntity> draftChildren = bomNewPbomChildService.lambdaQuery().eq(BomNewPbomChildEntity::getParentRowId, baseBomVO.getParentRowId()).list();
if (CollectionUtil.isNotEmpty(draftChildren)) {
List<BomNewPbomChildEntity> replaceChildren = draftChildren.stream().filter(child -> baseBomVO.getMaterialNo().equals(child.getMaterialNo())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(replaceChildren)) {
for (BomNewPbomChildEntity newReplaceChild: replaceChildren) {
newReplaceChild.setRowId(IdWorker.getId());
newReplaceChild.setIdentityNo(draftParent.getRowId() + "_" + newReplaceChild.getRowId());
newReplaceChild.setMaterialNo(baseBomVO.getNewMaterialNo()); // 新物料编码
newReplaceChild.setDrawingNo(newMaterialInfo.getDrawingNo());
newReplaceChild.setMaterialName(newMaterialInfo.getMaterialName());
newReplaceChild.setMaterialDesc(newMaterialInfo.getMaterialDesc()); // 新物料描述
newReplaceChild.setMaterialTexture(newMaterialInfo.getMaterialTexture());
newReplaceChild.setMaterialUnit(baseBomVO.getNewUnit()); // 新单位
newReplaceChild.setNum(baseBomVO.getNewNum()); // 新数量
newReplaceChild.setMaterialCategoryCode(newMaterialInfo.getMaterialCategoryCode());
// TODO 新单重新总重要不要更新
// 新版本创建时间要更新创建人要不要更新待定根据权限管理考虑
newReplaceChild.setCreatedTime(now);
newReplaceChild.setModifyTime(now);
newReplaceChild.setCreatedBy(SessionUtil.getUserCode());
newReplaceChild.setRemark("【批量替代BOM】由" + baseBomVO.getMaterialNo() + "替代为" + baseBomVO.getNewMaterialNo());
}
bomNewPbomChildService.updateBatchById(replaceChildren);
}
}
}
}
return addRowIds;
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.google.common.collect.Sets;
@ -532,6 +533,10 @@ public class ForwardReportService {
if(!oldEnt.getMaterialNo().equals(newEnt.getMaterialNo()) || !oldEnt.getNum().equals(newEnt.getNum()) || !oldEnt.getProjectType().equals(newEnt.getProjectType())){
result.add(oldEnt);
newEnt.setOpType(BomConstant.UP);
// 操作类型批量替代
if (ObjectUtil.isNotEmpty(newEnt.getSource()) && newEnt.getSource().equals(EBomSourceEnum.FROM_BATCH.getValue())) {
newEnt.setOpType(BomConstant.BATCH);
}
result.add(newEnt);
}
}

View File

@ -54,6 +54,12 @@ public class SapErrorMsgUtil {
errMsg.msg = materialNo + "物料状态可能为冻结,实际为:" + materialNoStateMap.get(materialNo);
}
});
// SAP报错信息这个提示语'Z0'转义为状态为冻结
liErrMsg.forEach(errMsg -> {
if (ObjectUtil.isNotEmpty(errMsg.msg) && errMsg.msg.contains("'Z0'")) {
errMsg.msg = errMsg.msg.replaceAll("'Z0'", "状态为冻结");
}
});
}
}

View File

@ -353,9 +353,9 @@
</insert>
<insert id="insertPBomChildToFormal">
INSERT INTO `t_bom_new_pbom_child_formal` (`row_id`, `parent_row_id`, `identity_no`, `fac_code`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `production_factory_code`, `production_factory_code_input_type`, `set_production_factory_time`, `super_material_status`, `virtual_part_is`, `created_by`, `created_time`, `modify_time`, `source_row_id`, `remark`, `source_parent_material_no`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id`, `sap_state`, `sap_time`)
INSERT INTO `t_bom_new_pbom_child_formal` (`row_id`, `parent_row_id`, `identity_no`, `fac_code`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `production_factory_code`, `production_factory_code_input_type`, `set_production_factory_time`, `super_material_status`, `virtual_part_is`, `created_by`, `created_time`, `modify_time`, `source_row_id`, `remark`, `source_parent_material_no`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id`, `sap_state`, `sap_time`,`source`)
select `row_id`, `parent_row_id`, `identity_no`, `fac_code`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `production_factory_code`, `production_factory_code_input_type`, `set_production_factory_time`, `super_material_status`, `virtual_part_is`, `created_by`, `created_time`, `modify_time`, `source_row_id`, `remark`, `source_parent_material_no`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id`, `sap_state`, `sap_time`
select `row_id`, `parent_row_id`, `identity_no`, `fac_code`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `production_factory_code`, `production_factory_code_input_type`, `set_production_factory_time`, `super_material_status`, `virtual_part_is`, `created_by`, `created_time`, `modify_time`, `source_row_id`, `remark`, `source_parent_material_no`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id`, `sap_state`, `sap_time`,`source`
from t_bom_new_pbom_child
where parent_row_id in
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">