Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom

This commit is contained in:
jing's 2024-01-10 22:24:26 +08:00
commit 3b15f04be5
15 changed files with 66 additions and 38 deletions

View File

@ -147,9 +147,11 @@ public class PBomApi extends BaseApi {
@GetMapping("copyBomCheck") @GetMapping("copyBomCheck")
@ApiOperation("复制前检查") @ApiOperation("复制前检查")
public ResultVO<List<BomCopyCheckResultVO>> copyBomCheck(@RequestParam("sourceBomRowId") Long sourceBomRowId , @RequestParam("targetFacCode") String targetFacCode ) throws ExecutionException, InterruptedException { public ResultVO<List<BomCopyCheckResultVO>> copyBomCheck(@RequestParam("sourceBomRowId") Long sourceBomRowId ,
@RequestParam("targetFacCode") String targetFacCode ,
@RequestParam("rowId") Long rowId) throws ExecutionException, InterruptedException {
return ResultVO.success(bomNewPbomParentService.copyBomCheck(sourceBomRowId,targetFacCode)); return ResultVO.success(bomNewPbomParentService.copyBomCheck(sourceBomRowId,targetFacCode,rowId));
} }

View File

@ -206,6 +206,10 @@ public class BomNewEbomChildEntity implements Serializable {
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包") @ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType; private Integer virtualPartType;
@TableField(value = "virtual_part_root_material_no")
@ApiModelProperty(value = "生成虚拟包跟物料编码")
private String virtualPartRootMaterialNo;
private static final long serialVersionUID = -14147430944632372L; private static final long serialVersionUID = -14147430944632372L;
} }

View File

@ -223,6 +223,10 @@ public class BomNewPbomChildEntity implements Serializable {
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包") @ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType; private Integer virtualPartType;
@TableField(value = "virtual_part_root_material_no")
@ApiModelProperty(value = "生成虚拟包跟物料编码")
private String virtualPartRootMaterialNo;
private static final long serialVersionUID = -76633783850936076L; private static final long serialVersionUID = -76633783850936076L;
} }

View File

@ -315,6 +315,9 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty("0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包") @ApiModelProperty("0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType; private Integer virtualPartType;
@ApiModelProperty("生成虚拟包的跟节点物料编码")
private String virtualPartRootMaterialNo;
private List<BomNewEbomParentVO> childNodes = Collections.emptyList(); private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -627,9 +627,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())) { if (CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())) {
upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult()); upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
} }
; List<Long> bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList());
if (CollUtil.isNotEmpty(eBomToPBom.getHasConvertEBomRowIds())) { if (CollUtil.isNotEmpty(bomRowIds)) {
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), eBomToPBom.getHasConvertEBomRowIds()); this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), bomRowIds);
} }

View File

@ -108,8 +108,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
if (StrUtil.isNotBlank(materialNo)) { if (StrUtil.isNotBlank(materialNo)) {
List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo).stream().collect(Collectors.toList()); List<String> parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo).stream().collect(Collectors.toList());
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) { if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(userRoleService.getUserFactory(),parentMaterialByMaterialNo ); List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory())?userRoleService.getUserFactory():query.getFacCode(),parentMaterialByMaterialNo );
List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(userRoleService.getUserFactory(),parentMaterialByMaterialNo, materialNo); List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory())?userRoleService.getUserFactory():query.getFacCode(),parentMaterialByMaterialNo, materialNo);
List<BomNewPbomParentVO> data = new ArrayList<>(); List<BomNewPbomParentVO> data = new ArrayList<>();
data.addAll(parents); data.addAll(parents);
data.addAll(childs); data.addAll(childs);
@ -117,7 +117,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return handSeachToTree(parents, childs); return handSeachToTree(parents, childs);
} }
} }
return null; return new Page<BomNewPbomParentVO>() ;
} else { } else {
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserFactory()); Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserFactory());
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
@ -424,7 +424,16 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
* @param targetFacCode * @param targetFacCode
* @return * @return
*/ */
public List<BomCopyCheckResultVO> copyBomCheck(Long sourceBomRowId, String targetFacCode) throws ExecutionException, InterruptedException { public List<BomCopyCheckResultVO> copyBomCheck(Long sourceBomRowId, String targetFacCode,Long rowId) throws ExecutionException, InterruptedException {
BomNewPbomParentEntity root = this.getById(sourceBomRowId);
VUtils.isTure(root.getMaterialNo().startsWith("31")).throwMessage("31码物料不能进行复制");
BomNewPbomChildEntity child = pbomChildService.getById(rowId);
if(child.getVirtualPartRootMaterialNo().startsWith("31") && child.getVirtualPartType()>0){
VUtils.isTure(true).throwMessage("31下的虚拟包不能删除");
}
checkCopyBomParam(sourceBomRowId, targetFacCode); checkCopyBomParam(sourceBomRowId, targetFacCode);
BomCopy bomCopy = new BomCopy(sourceBomRowId, targetFacCode, getAllBom(sourceBomRowId, 0)); BomCopy bomCopy = new BomCopy(sourceBomRowId, targetFacCode, getAllBom(sourceBomRowId, 0));
bomCopy.check(); bomCopy.check();
@ -434,6 +443,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void copyFrom(CopyPBomParam param) throws ExecutionException, InterruptedException { public void copyFrom(CopyPBomParam param) throws ExecutionException, InterruptedException {
checkCopyBomParam(param.getSourceBomRowId(), param.getTargetFacCode()); checkCopyBomParam(param.getSourceBomRowId(), param.getTargetFacCode());
BomCopy bomCopy = new BomCopy(param.getSourceBomRowId(), param.getTargetFacCode(), getAllBom(param.getSourceBomRowId(), 0)); BomCopy bomCopy = new BomCopy(param.getSourceBomRowId(), param.getTargetFacCode(), getAllBom(param.getSourceBomRowId(), 0));
bomCopy.copy(param.getCheckResult()); bomCopy.copy(param.getCheckResult());

View File

@ -60,11 +60,12 @@ public class UserRoleService {
*/ */
public String getUserFactory(){ public String getUserFactory(){
Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId()); Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId());
if(userMultiplantFacRoleCount>0){
return ""; return "";
}else { // if(userMultiplantFacRoleCount>0){
return SessionUtil.getFullDeptName().contains("仙桃公司")?"1020":"1010"; // return "";
} // }else {
// return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010;
// }
} }

View File

@ -26,6 +26,7 @@ import lombok.Setter;
import nflg.product.common.constant.STATE; import nflg.product.common.constant.STATE;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -185,23 +186,22 @@ public class CheckEBomException {
* @param list * @param list
*/ */
public void initExceptionYellowWarn(List<BomNewEbomParentVO> list) { public void initExceptionYellowWarn(List<BomNewEbomParentVO> list) {
List<BomNewEbomParentVO> exceptionList = allBomDetail.stream().filter(u -> u.getExceptionStatus() > 1).collect(Collectors.toList()); List<BomNewEbomParentVO> exceptionList = allBomDetail.stream().filter(u -> u.getExceptionStatus() > EBomExceptionStatusEnum.OK.getValue()).collect(Collectors.toList());
// List<String> exceptionMaterialNos = exceptionList.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); // List<String> exceptionMaterialNos = exceptionList.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
if (CollUtil.isEmpty(exceptionList)) { if (CollUtil.isEmpty(exceptionList)) {
return; return;
} }
for (BomNewEbomParentVO exItem : list) { for (BomNewEbomParentVO exItem : list) {
List<BomNewEbomParentVO> warnList = allBomDetail.stream().filter(u -> u.getBomRowId() > 0 && u.getLevelNumber().compareTo(exItem.getLevelNumber().setScale(0, RoundingMode.FLOOR))>=0 && u.getRowId()!=exItem.getRowId() && u.getLevelNumber().compareTo(exItem.getLevelNumber()) < 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
try {
List<BomNewEbomParentVO> warnList = allBomDetail.stream().filter(u -> exItem.getBomRowId() != null && exItem.getBomRowId() > 0 && u.getLevelNumber().compareTo(exItem.getLevelNumber()) < 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
warnList.forEach(k -> { warnList.forEach(k -> {
k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue()); k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
}); });
}catch ( Exception e){
e.printStackTrace();
}
} }
List<BomNewEbomParentVO> root = allBomDetail.stream().filter(u -> u.getLevelNumber().compareTo(BigDecimal.ZERO) == 0 && EBomExceptionStatusEnum.OK.equalsValue(u.getExceptionStatus())).collect(Collectors.toList());
root.forEach(k->{
k.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
});
// List<String> allErrorParent = SpringUtil.getBean(BomNewEbomParentService.class).getBatchParentMaterialByMaterialNo(exceptionMaterialNos); // List<String> allErrorParent = SpringUtil.getBean(BomNewEbomParentService.class).getBatchParentMaterialByMaterialNo(exceptionMaterialNos);

View File

@ -61,8 +61,8 @@ public class EBomToPBom {
@Getter @Getter
private List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>(); private List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
@Getter // @Getter
private List<Long> hasConvertEBomRowIds=new ArrayList<>(); // private List<Long> hasConvertEBomRowIds=new ArrayList<>();
private Map<String, String> generateDrawingNoMap = new HashMap<>(); private Map<String, String> generateDrawingNoMap = new HashMap<>();
@ -152,7 +152,7 @@ public class EBomToPBom {
.eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo()) .eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, facCode).one(); .eq(BomNewPbomParentEntity::getFacCode, facCode).one();
this.hasConvertEBomRowIds.add(parentVo.getRowId()); // this.hasConvertEBomRowIds.add(parentVo.getRowId());
if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) { if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) {
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId())); SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
oldParent.setCurrentVersion(parentVo.getCurrentVersion()); oldParent.setCurrentVersion(parentVo.getCurrentVersion());

View File

@ -105,7 +105,7 @@ public abstract class VirtualPackageBase {
* 构建子级 * 构建子级
* @return * @return
*/ */
protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo,VirtualPackageTypeEnum virtualPackageTypeEnum){ protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo,VirtualPackageTypeEnum virtualPackageTypeEnum,String rootMaterialNo){
BomNewEbomChildEntity childEntity =new BomNewEbomChildEntity(); BomNewEbomChildEntity childEntity =new BomNewEbomChildEntity();
BeanUtil.copyProperties(parent,childEntity); BeanUtil.copyProperties(parent,childEntity);
childEntity.setRowId(IdWorker.getId()); childEntity.setRowId(IdWorker.getId());
@ -119,6 +119,7 @@ public abstract class VirtualPackageBase {
childEntity.setProjectType("L"); childEntity.setProjectType("L");
childEntity.setMaterialUnit("PC"); childEntity.setMaterialUnit("PC");
childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue()); childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
childEntity.setVirtualPartRootMaterialNo(rootMaterialNo);
this.childResult.add(childEntity); this.childResult.add(childEntity);
return childEntity; return childEntity;
} }

View File

@ -43,8 +43,8 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
//构建构建发货包下直发 //构建构建发货包下直发
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
//构建产品-子级为制作包合直发包 //构建产品-子级为制作包合直发包
buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE); buildChild(makingPackage, bomRowId, "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); buildChild(directDeliveryPackage, bomRowId, "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
} }
if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) { if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) {
@ -53,7 +53,7 @@ public class VirtualPackageFor21 extends VirtualPackageBase {
makingPackage=getParentZhiZuo(); makingPackage=getParentZhiZuo();
} }
BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); BomNewEbomParentEntity preAssemblyPackage = buildParentVirtualPackage(parent.getDrawingNo(), parent.getMaterialName(), VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
} }
List<BomNewEbomParentVO> child = getChild(); List<BomNewEbomParentVO> child = getChild();

View File

@ -50,11 +50,11 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(item.getDrawingNo(), item.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); BomNewEbomParentEntity directDeliveryPackage = buildParentVirtualPackage(item.getDrawingNo(), item.getMaterialName(), VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
//构建-产品下发货包-子级 //构建-产品下发货包-子级
buildChild(deliveryPackage, bomRowId, "001", VirtualPackageTypeEnum.DELIVERY_PACKAGE); buildChild(deliveryPackage, bomRowId, "001", VirtualPackageTypeEnum.DELIVERY_PACKAGE,parent.getMaterialNo());
//构建发货包-子级 //构建发货包-子级
buildChild(makingPackage, deliveryPackage.getRowId(), "001", VirtualPackageTypeEnum.MAKING_PACKAGE); buildChild(makingPackage, deliveryPackage.getRowId(), "001", VirtualPackageTypeEnum.MAKING_PACKAGE,parent.getMaterialNo());
buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); buildChild(directDeliveryPackage, deliveryPackage.getRowId(), "002", VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,parent.getMaterialNo());
BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity(); BomNewEbomChildEntity itemUp = new BomNewEbomChildEntity();
itemUp.setRowId(item.getRowId()); itemUp.setRowId(item.getRowId());
@ -68,7 +68,7 @@ public class VirtualPackageFor31 extends VirtualPackageBase {
if(Objects.isNull(makingPackage)){ if(Objects.isNull(makingPackage)){
makingPackage=getParentZhiZuo(); makingPackage=getParentZhiZuo();
} }
buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); buildChild(preAssemblyPackage, makingPackage.getRowId(), "001", VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE,parent.getMaterialNo());
} }
} }
parent.setVirtrualPackageEnum(getVPackageNum(parent)); parent.setVirtrualPackageEnum(getVPackageNum(parent));

View File

@ -30,6 +30,7 @@
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/> <result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/> <result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -37,7 +38,7 @@
row_id, parent_row_id, identity_no, order_number, drawing_no, material_no, material_name, material_desc, row_id, parent_row_id, identity_no, order_number, drawing_no, material_no, material_name, material_desc,
material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type, material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type,
project_type_input_type, created_by,virtual_part_is, created_time, modify_time, edit_status, exception_status, source, project_type_input_type, created_by,virtual_part_is, created_time, modify_time, edit_status, exception_status, source,
source_row_id, remark,virtual_part_type source_row_id, remark,virtual_part_type,virtual_part_root_material_no
</sql> </sql>

View File

@ -33,11 +33,12 @@
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="source_parent_material_no" property="sourceParentMaterialNo" jdbcType="VARCHAR"/> <result column="source_parent_material_no" property="sourceParentMaterialNo" jdbcType="VARCHAR"/>
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/> <result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
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 </sql> 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 </sql>
<delete id="delByRowId"> <delete id="delByRowId">

View File

@ -154,7 +154,7 @@
c.row_id as bomRowId, c.row_id as childBomRowId, b.* c.row_id as bomRowId, c.row_id as childBomRowId, b.*
from t_bom_new_pbom_parent a from t_bom_new_pbom_parent a
join t_bom_new_pbom_child b on a.row_id =b.parent_row_id join t_bom_new_pbom_child b on a.row_id =b.parent_row_id
left join t_bom_new_pbom_parent c on b.material_no=c.material_no and c.last_version_is=1 left join t_bom_new_pbom_parent c on b.material_no=c.material_no and b.fac_code=c.fac_code and c.last_version_is=1
where a.last_version_is=1 where a.last_version_is=1
<if test="userFac!=null and userFac!=''"> <if test="userFac!=null and userFac!=''">
and a.fac_code=#{userFac} and a.fac_code=#{userFac}