diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialSubmitService.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialSubmitService.java index 75a1f4d0..7e4c4f21 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialSubmitService.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialSubmitService.java @@ -356,7 +356,7 @@ public class MaterialSubmitService { list.add(material); }); result.put("List", list); - log.error("物料申请-JSON:" + JSONArray.toJSONString(list)); + log.error("物料申请-JSON:" + JSONArray.toJSONString(result)); HttpUtils httpUtils = new HttpUtils(timeout); try { String url = NacosConfig.getNacosConfig().getOaUrl(); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/OriginalBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/OriginalBomApi.java index c398d113..383b02aa 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/OriginalBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/OriginalBomApi.java @@ -173,7 +173,7 @@ public class OriginalBomApi extends BaseApi { //跟新EBom 根节点 // ebomParentService.getBaseMapper().updateRootState(); ebomParentService.updateRootState(); - ebomParentService.getBaseMapper().updateRootForWaitReview(); + ebomParentService.updateRootForWaitReview(); return ResultVO.success(result); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java index d247459f..4143a67a 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java @@ -3,7 +3,9 @@ package com.nflg.product.bomnew.api.user; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.google.common.collect.ImmutableList; import com.mzt.logapi.context.LogRecordContext; import com.mzt.logapi.starter.annotation.LogRecord; import com.nflg.product.base.core.api.BaseApi; @@ -371,4 +373,16 @@ public class PBomApi extends BaseApi { bomNewPbomParentService.generateNoticeNum(param); return ResultVO.success(true); } + + @GetMapping("getUserAuthFac") + @ApiOperation("获取用可查看pbom工厂") + public ResultVO> getUserAuthFac() { + String userFactory = userRoleService.getUserFactory(); + if(StrUtil.isBlank(userFactory)){ + return ResultVO.success(ImmutableList.of("1010","1020")); + } + return ResultVO.success(ImmutableList.of(userFactory)); + } + + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MateiralStateEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MateiralStateEnum.java index ba8eb837..1607f528 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MateiralStateEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MateiralStateEnum.java @@ -20,4 +20,13 @@ public enum MateiralStateEnum implements ValueEnum { private final Integer value; private final String description; + public static MateiralStateEnum getDescriptionByValue(Integer value) { + for (MateiralStateEnum valueEnum : MateiralStateEnum.values()) { + if (valueEnum.getValue().equals(value)) { + return valueEnum; + } + } + return null; + } + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomChildMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomChildMapper.java index 53b6d8da..42cf73a8 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomChildMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomChildMapper.java @@ -34,6 +34,8 @@ public interface BomNewEbomChildMapper extends BaseMapper void deleteAllChildren(Long rowId); + void updateBomExist0(Long rowId); + void delBomChild(@Param("bomRowIds") List bomRowIds); List getBomByMaterialNo(String materialNo); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java index 757cb8d2..663e9441 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java @@ -79,8 +79,12 @@ public interface BomNewEbomParentMapper extends BaseMapper eBomReverseReportNewst(@Param("materialNo")String materialNo); Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo); + @Deprecated void updateRootForWaitReview(); + void updateRootForWaitReview1(); + void updateRootForWaitReview2(); + void resetBomExist(Long rowId); Set getMaterialParent(@Param("materialNos") Collection materialNos ,@Param("createdBy") String createdBy); @@ -121,7 +125,7 @@ public interface BomNewEbomParentMapper extends BaseMapper getLatestByMaterialNo(Collection materialNos); - + @Deprecated void updateLastVersionIs(); List getReverseBoms(Long parentRowId); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/MaterialMainMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/MaterialMainMapper.java index 400951c2..04e059fb 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/MaterialMainMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/MaterialMainMapper.java @@ -60,4 +60,6 @@ public interface MaterialMainMapper extends BaseMapper { List getRolePostByUserId(@Param("userRowId") Long userRowId); UserInfoVO getUserInfoByUserCode(@Param("userCode")String userCode); + + String getUserDepartmentDptCode(@Param("rowId") Long rowId); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/sap/impart2/T1ExtDTO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/sap/impart2/T1ExtDTO.java index 4de92909..429a1912 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/sap/impart2/T1ExtDTO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/sap/impart2/T1ExtDTO.java @@ -43,4 +43,6 @@ public class T1ExtDTO { * 是否是直发包 */ private boolean isZFB = false; + + private Long childRowId; } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/OperationErrorMsgVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/OperationErrorMsgVO.java index 9221b416..d5428047 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/OperationErrorMsgVO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/OperationErrorMsgVO.java @@ -6,6 +6,7 @@ import org.apache.commons.lang.StringUtils; import org.ttzero.excel.annotation.ExcelColumn; import java.io.Serializable; +import java.time.LocalDateTime; /** * @author 曹鹏飞 @@ -18,6 +19,14 @@ public class OperationErrorMsgVO extends OperationErrorMsgBaseVO implements Seri @ExcelColumn("所在行") public String primaryKey; + /** + * 创建时间 + */ + + @ApiModelProperty(value = "创建时间") + @ExcelColumn("创建时间") + private LocalDateTime createdTime; + public OperationErrorMsgVO() { } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomChildService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomChildService.java index 077d9417..121a652a 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomChildService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomChildService.java @@ -28,6 +28,7 @@ public class BomNewEbomChildService extends ServiceImpl updateEBomMaterialUse(Collection materialNos) { diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java index c17193d9..efae505e 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java @@ -18,6 +18,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity; import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity; import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO; +import com.nflg.product.bomnew.util.SapErrorMsgUtil; import com.nflg.product.bomnew.util.VUtils; import nflg.product.common.constant.STATE; import org.slf4j.Logger; @@ -43,6 +44,7 @@ public class BomNewEbomExportToSAP { private final BomNewEbomParentService bomNewEbomParentService = SpringUtil.getBean(BomNewEbomParentService.class); private final BomNewEbomChildService bomNewEbomChildService = SpringUtil.getBean(BomNewEbomChildService.class); private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class); + private final SapErrorMsgUtil sapErrorMsgUtil = SpringUtil.getBean(SapErrorMsgUtil.class); public List export(Long rootBomRowId) { BomNewEbomParentEntity root = bomNewEbomParentService.getById(rootBomRowId); @@ -122,6 +124,7 @@ public class BomNewEbomExportToSAP { .eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId)); if (CollUtil.isNotEmpty(liErrMsg)) { + sapErrorMsgUtil.translateErrorMsg(liErrMsg); BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity(); sapErrorMsgEntity.setTargetRowId(rootBomRowId); sapErrorMsgEntity.setType(0); @@ -134,7 +137,7 @@ public class BomNewEbomExportToSAP { private void addToT1(T1ExtDTO dto) { if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY) - || children.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), dto.getIDNRK()) && StrUtil.equals(c.getMATNR(), dto.getMATNR()))) { + || children.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), dto.getChildRowId()))) { children.add(dto); } } @@ -154,6 +157,7 @@ public class BomNewEbomExportToSAP { t.setIDNRK(""); t.setPOTX1(child.getMaterialDesc()); } + t.setChildRowId(child.getRowId()); return t; } @@ -178,7 +182,8 @@ public class BomNewEbomExportToSAP { return bomNewEbomChildService.lambdaQuery() .select(BomNewEbomChildEntity::getMaterialNo, BomNewEbomChildEntity::getNum , BomNewEbomChildEntity::getMaterialUnit, BomNewEbomChildEntity::getMaterialDesc - , BomNewEbomChildEntity::getVirtualPartType, BomNewEbomChildEntity::getProjectType) + , BomNewEbomChildEntity::getVirtualPartType, BomNewEbomChildEntity::getProjectType + , BomNewEbomChildEntity::getRowId) .eq(BomNewEbomChildEntity::getParentRowId, parent.getRowId()) .orderByAsc(BomNewEbomChildEntity::getOrderNumber) .list(); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 55a04fdd..5024a92f 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -233,6 +233,7 @@ public class BomNewEbomParentService extends ServiceImpl getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) { BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one(); Set result = new HashSet<>(); @@ -295,6 +296,7 @@ public class BomNewEbomParentService extends ServiceImpl getBatchParentMaterialByMaterialNo(List materialNos) { List materialBom = bomNewEbomMaterialUseService.lambdaQuery().in(BomNewEbomMaterialUseEntity::getMaterialNo, materialNos).list(); List result = new ArrayList<>(); @@ -357,6 +359,9 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); if (eBomEdit.isRootForWaitReview()) { - this.getBaseMapper().updateRootForWaitReview(); + updateRootForWaitReview(); } @@ -2153,6 +2159,11 @@ public class BomNewEbomParentService extends ServiceImpl @@ -2210,7 +2221,7 @@ public class BomNewEbomParentService extends ServiceImpl resultList = JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class); + resultList.forEach(result -> result.setCreatedTime(sapErrorMsgEntity.getCreatedTime())); + return resultList; } @@ -3040,6 +3053,12 @@ public class BomNewEbomParentService extends ServiceImpl { Map bom = new HashMap<>(); bom.put("parentMaterialNo", saveDetail2.getParentMaterialNo()); // 父级编码 + bom.put("parentMaterialDesc", saveDetail2.getParentMaterialDesc()); // 父级描述 bom.put("orderNum", saveDetail2.getOrderNum()); // BOM行编号 bom.put("materialNo", saveDetail2.getMaterialNo()); // 编码 + bom.put("materialDesc", saveDetail2.getMaterialDesc()); // 描述 bom.put("changeContent", saveDetail2.getChangeContent()); // 变更内容 bomList2.add(bom); }); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java index 4cb4f5fe..22612ba2 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java @@ -19,6 +19,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity; import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity; import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO; import com.nflg.product.bomnew.util.BomUtil; +import com.nflg.product.bomnew.util.SapErrorMsgUtil; import com.nflg.product.bomnew.util.VUtils; import nflg.product.common.constant.STATE; import org.slf4j.Logger; @@ -51,6 +52,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { private final BomNewPbomParentService bomNewPbomParentService = SpringUtil.getBean(BomNewPbomParentService.class); private final BomNewPbomChildService bomNewPbomChildService = SpringUtil.getBean(BomNewPbomChildService.class); private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class); + private final SapErrorMsgUtil sapErrorMsgUtil = SpringUtil.getBean(SapErrorMsgUtil.class); public BomNewPbomExportToSAPImpl(boolean isForSale) { this.isForSale = isForSale; @@ -155,6 +157,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { .eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId)); if (CollUtil.isNotEmpty(liErrMsg)) { + sapErrorMsgUtil.translateErrorMsg(liErrMsg); BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity(); sapErrorMsgEntity.setTargetRowId(rootBomRowId); sapErrorMsgEntity.setType(1); @@ -197,6 +200,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { t.setIDNRK(""); t.setPOTX1(child.getMaterialDesc()); } + t.setChildRowId(child.getRowId()); return t; } @@ -256,7 +260,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { private void addToT1(T1ExtDTO dto) { if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY) - || children.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), dto.getIDNRK()) && StrUtil.equals(c.getMATNR(), dto.getMATNR()))) { + || children.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), dto.getChildRowId()))) { children.add(dto); } } @@ -266,7 +270,8 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { .select(BomNewPbomChildEntity::getMaterialNo, BomNewPbomChildEntity::getNum , BomNewPbomChildEntity::getMaterialUnit, BomNewPbomChildEntity::getMaterialDesc , BomNewPbomChildEntity::getVirtualPartType, BomNewPbomChildEntity::getProjectType - , BomNewPbomChildEntity::getFacCode, BomNewPbomChildEntity::getMaterialCategoryCode) + , BomNewPbomChildEntity::getFacCode, BomNewPbomChildEntity::getMaterialCategoryCode + , BomNewPbomChildEntity::getRowId) .eq(BomNewPbomChildEntity::getParentRowId, parent.getRowId()) .orderByAsc(BomNewPbomChildEntity::getOrderNumber) .list(); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java index 9622d64c..b1715cb8 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java @@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.mzt.logapi.context.LogRecordContext; @@ -138,11 +139,14 @@ public class BomNewPbomParentService extends ServiceImpl parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo)); + List parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo)); + parentMaterialByMaterialNo.add(materialNo); if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) { - List parents = this.getBaseMapper().getParentForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory()) ? userRoleService.getUserFactory() : query.getFacCode(), parentMaterialByMaterialNo); - List childs = this.getBaseMapper().getChildForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory()) ? userRoleService.getUserFactory() : query.getFacCode(), parentMaterialByMaterialNo, materialNo); + String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode(); + + List parents = this.getBaseMapper().getParentForMaterialNoSeach(queryFac , parentMaterialByMaterialNo); + List childs = this.getBaseMapper().getChildForMaterialNoSeach(queryFac , parentMaterialByMaterialNo, materialNo); List data = new ArrayList<>(); data.addAll(parents); data.addAll(childs); @@ -155,12 +159,15 @@ public class BomNewPbomParentService extends ServiceImpl(); } else { + String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode(); + Page result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage() - , query.getPageSize()), query, userRoleService.getUserFactory(), SessionUtil.getDepartRowId(), SessionUtil.getUserCode()); + , query.getPageSize()), query, queryFac, SessionUtil.getDepartRowId(), SessionUtil.getUserCode()); materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); return result; } @@ -191,6 +198,35 @@ public class BomNewPbomParentService extends ServiceImpl parentNoResult, Set materialNos){ + + Set relParentNoSet= getParent(parentNoResult,materialNos); + + while (CollUtil.isNotEmpty(relParentNoSet)){ + + relParentNoSet= getParent(parentNoResult , relParentNoSet); + } + } + + private Set getParent(Set parentNoResult, Set materialNos){ + + List childList = pbomChildService.lambdaQuery().in(BomNewPbomChildEntity::getMaterialNo, materialNos).select(BomNewPbomChildEntity::getParentRowId).list(); + parentNoResult.addAll(materialNos); + if(CollUtil.isEmpty(childList)){ + return new HashSet<>(); + } + List parentRowIdList = childList.stream().map(u -> u.getParentRowId()).collect(Collectors.toList()); + List parentList = this.lambdaQuery().in(BomNewPbomParentEntity::getRowId, parentRowIdList).select(BomNewPbomParentEntity::getMaterialNo).list(); + Set parentNoSet = parentList.stream().map(u -> u.getMaterialNo()).collect(Collectors.toSet()); + + return Sets.difference(parentNoSet,parentNoResult); + } + /** * 获取物料所有子级 * @@ -199,25 +235,28 @@ public class BomNewPbomParentService extends ServiceImpl getParentMaterialByMaterialNo(String materialNo) { - BomNewPbomMaterialUseEntity materialBom = pbomMaterialUseService.lambdaQuery().eq(BomNewPbomMaterialUseEntity::getMaterialNo, materialNo).one(); - Set result = new HashSet<>(); - if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) { - Set relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ",")); - - while (CollUtil.isNotEmpty(relSkuNo)) { - result.addAll(relSkuNo); - List relSkuList = pbomMaterialUseService.lambdaQuery().in(BomNewPbomMaterialUseEntity::getMaterialNo, relSkuNo).list(); - relSkuNo.clear(); - Set finalRelSkuNo = relSkuNo; - relSkuList.forEach(k -> { - if (StrUtil.isNotBlank(k.getParentMaterialNo())) { - finalRelSkuNo.addAll(Sets.newHashSet(StrUtil.split(k.getParentMaterialNo(), ","))); - } - }); - relSkuNo = finalRelSkuNo; - } - } + Set result=new HashSet<>(); + getGetParentMaterialByMaterialNoNew(result, ImmutableSet.of(materialNo)); return result; +// BomNewPbomMaterialUseEntity materialBom = pbomMaterialUseService.lambdaQuery().eq(BomNewPbomMaterialUseEntity::getMaterialNo, materialNo).one(); +// Set result = new HashSet<>(); +// if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) { +// Set relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ",")); +// +// while (CollUtil.isNotEmpty(relSkuNo)) { +// result.addAll(relSkuNo); +// List relSkuList = pbomMaterialUseService.lambdaQuery().in(BomNewPbomMaterialUseEntity::getMaterialNo, relSkuNo).list(); +// relSkuNo.clear(); +// Set finalRelSkuNo = relSkuNo; +// relSkuList.forEach(k -> { +// if (StrUtil.isNotBlank(k.getParentMaterialNo())) { +// finalRelSkuNo.addAll(Sets.newHashSet(StrUtil.split(k.getParentMaterialNo(), ","))); +// } +// }); +// relSkuNo = finalRelSkuNo; +// } +// } +// return result; } @@ -361,6 +400,8 @@ public class BomNewPbomParentService extends ServiceImpl resultList = JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class); + resultList.forEach(result -> result.setCreatedTime(sapErrorMsgEntity.getCreatedTime())); + return resultList; } public List getReverseBoms(Long parentRowId) { diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java index cdf3d62f..518a13f6 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java @@ -15,6 +15,7 @@ import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.mapper.master.MaterialMainMapper; import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO; import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO; +import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1ExtDTO; import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity; import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity; @@ -403,12 +404,12 @@ public class DQBomService { sapDto.setI_WERKS("1"); sapDto.setI_STLAN("1"); sapDto.setI_EMPNO(root.getCreatedBy()); - List t1s = new ArrayList<>(); + List t1s = new ArrayList<>(); String dateYMD = DateUtil.format(new Date(), "yyyyMMdd"); datas.forEach(d -> { if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, d.getProjectType()) - || t1s.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), d.getMaterialNo()) && StrUtil.equals(c.getMATNR(), d.getParentMaterialNo()))) { - T1DTO t1 = new T1DTO(); + || t1s.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), d.getRowId()))) { + T1ExtDTO t1 = new T1ExtDTO(); t1.setID(RandomUtil.randomNumbers(5)); t1.setMATNR(d.getParentMaterialNo()); t1.setMENGE(d.getNum().toString()); @@ -426,11 +427,12 @@ public class DQBomService { t1.setMEINS(bm.getMaterialUnit()); } } + t1.setChildRowId(d.getRowId()); t1s.add(t1); } }); - sapDto.setT1(t1s); + sapDto.setT1(Convert.toList(T1DTO.class, t1s)); SapStatusEnum state = SapStatusEnum.PUB_ERROR_ALL; List liErrMsg = null; try { @@ -515,9 +517,9 @@ public class DQBomService { savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH); savePbomChildren(children, parents); - CompletableFuture.runAsync(() -> { - bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse(); - }); +// CompletableFuture.runAsync(() -> { +// bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse(); +// }); } private void savePbomChildren(List children, List parents) { diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/UserRoleService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/UserRoleService.java index bacd2e71..9bdaeb5c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/UserRoleService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/UserRoleService.java @@ -1,6 +1,7 @@ package com.nflg.product.bomnew.service; +import cn.hutool.core.util.StrUtil; import com.google.common.collect.ImmutableList; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.bomnew.constant.EBomConstant; @@ -56,12 +57,17 @@ public class UserRoleService { */ public String getUserFactory(){ Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId()); - return ""; -// if(userMultiplantFacRoleCount>0){ -// return ""; -// }else { -// return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010; -// } + // return ""; + if(userMultiplantFacRoleCount>0){ + return ""; + }else { + String dptCde=materialMainService.getBaseMapper().getUserDepartmentDptCode(SessionUtil.getDepartRowId()); + if(StrUtil.isNotBlank(dptCde) && dptCde.contains("仙桃公司")){ + return EBomConstant.XIAN_TAO_FACTORY_CODE_1020; + } + return EBomConstant.MAIN_FACTORY_CODE_1010; + // return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010; + } } @@ -75,7 +81,11 @@ public class UserRoleService { if(userMultiplantFacRoleCount>0){ return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010,EBomConstant.XIAN_TAO_FACTORY_CODE_1020); }else { - return SessionUtil.getFullDeptName().contains("仙桃公司")? ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) : ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ; + String dptCde=materialMainService.getBaseMapper().getUserDepartmentDptCode(SessionUtil.getDepartRowId()); + if(StrUtil.isNotBlank(dptCde) && dptCde.contains("仙桃公司")){ + return ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) ; + } + return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ; } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/BomNewSortUtil.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/BomNewSortUtil.java new file mode 100644 index 00000000..30a20e9d --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/BomNewSortUtil.java @@ -0,0 +1,74 @@ +package com.nflg.product.bomnew.util; + +import cn.hutool.core.collection.CollUtil; +import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; +import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO; + +import java.util.Comparator; +import java.util.List; +import java.util.Objects; + +public class BomNewSortUtil { + + + static int sortOrderNum(String o1,String o2,int sort){ + if (Objects.isNull(o1)) { + return 0; + } + if (Objects.isNull(o2)) { + return 0; + } + int result = 0; + try { + if (sort == 0) { //升 + result = Integer.parseInt(o1 ) - Integer.parseInt(o2); + } else if (sort == 1) {//降 + result = Integer.parseInt(o2 ) - Integer.parseInt(o1 ); + + } + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + + public static void orderNumPbomSort(List list, int sort) { + if (CollUtil.isEmpty(list)) { + return; + } + + CollUtil.sort(list, new Comparator() { + @Override + public int compare(BomNewPbomParentVO o1, BomNewPbomParentVO o2) { + + + return sortOrderNum(o1.getOrderNumber(),o2.getOrderNumber(),sort); + + } + }); + } + + + /** + * @param list + * @param sort + */ + public static void orderNumEbomSort(List list, int sort) { + + if (CollUtil.isEmpty(list)) { + return; + } + + CollUtil.sort(list, new Comparator() { + @Override + public int compare(BomNewEbomParentVO o1, BomNewEbomParentVO o2) { + + return sortOrderNum(o1.getOrderNumber(),o2.getOrderNumber(),sort); + } + }); + + } + + +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/SapErrorMsgUtil.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/SapErrorMsgUtil.java new file mode 100644 index 00000000..a38343cc --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/SapErrorMsgUtil.java @@ -0,0 +1,59 @@ +package com.nflg.product.bomnew.util; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.nflg.product.bomnew.constant.MateiralStateEnum; +import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity; +import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO; +import com.nflg.product.bomnew.service.MaterialMainService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Slf4j +@Component +public class SapErrorMsgUtil { + + @Resource + private MaterialMainService materialMainService; + + /** + * 转义错误信息 + * @param liErrMsg + */ + public void translateErrorMsg(List liErrMsg) { + // [{"msg":"未选定 BOM 项目(工厂Z0)的物料状态 Block for all usage 1010","primaryKey":"2100048422的子级F项:2100048422"}] + // 转义成 [{"msg":"2100048422物料状态可能为冻结,实际为:XX","primaryKey":"2100048422的子级F项:2100048422"}] + List blockMsgList = liErrMsg.stream().filter(errMsg -> ObjectUtil.isNotEmpty(errMsg.msg) && errMsg.msg.contains("Block for all usage")).collect(Collectors.toList()); + List filterMaterialNos = new ArrayList<>(); + Map materialNoStateMap = new HashMap<>(); + if (CollUtil.isNotEmpty(blockMsgList)) { + blockMsgList.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.primaryKey) && item.primaryKey.length() >= 10) { + filterMaterialNos.add(item.primaryKey.substring(item.primaryKey.length() - 10)); + } + }); + } + if (CollUtil.isNotEmpty(filterMaterialNos)) { + List materialList = materialMainService.lambdaQuery().in(MaterialMainEntity::getMaterialNo, filterMaterialNos).list(); + materialList.forEach(item -> { + MateiralStateEnum stateEnum = MateiralStateEnum.getDescriptionByValue(item.getMaterialState()); + materialNoStateMap.put(item.getMaterialNo(), ObjectUtil.isNotEmpty(stateEnum) ? stateEnum.getDescription() : ""); + }); + } + liErrMsg.forEach(errMsg -> { + if (ObjectUtil.isNotEmpty(errMsg.msg) && errMsg.msg.contains("Block for all usage") && + ObjectUtil.isNotEmpty(errMsg.primaryKey) && errMsg.primaryKey.length() >= 10) { + String materialNo = errMsg.primaryKey.substring(errMsg.primaryKey.length() - 10); + errMsg.msg = materialNo + "物料状态可能为冻结,实际为:" + materialNoStateMap.get(materialNo); + } + }); + } + +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml index 4e0192bc..c2ff5d21 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewDQbomParentMapper.xml @@ -35,7 +35,7 @@ p.created_by bomCreateBy, p.* FROM t_bom_new_dqbom_parent p - LEFT JOIN t_bom_new_dqbom_child c ON p.material_no = c.material_no + LEFT JOIN t_bom_new_dqbom_child c ON c.status=#{query.status} AND p.material_no = c.material_no WHERE (root_is | user_root_is = 1) AND p.status = #{query.status} AND p.created_by = #{userCode} diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomChildMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomChildMapper.xml index dfe022d9..fe902751 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomChildMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomChildMapper.xml @@ -73,6 +73,11 @@ group by b.material_no; + + UPDATE t_bom_new_ebom_parent + SET bom_exist=0 + WHERE row_id = #{rowId}; + - INSERT INTO `nflg`.`t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`) + INSERT INTO `t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`) select `row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time` from t_bom_new_mbom_parent where row_id=#{rowId} - INSERT INTO `nflg`.`t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`) + INSERT INTO `t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`) select `row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type` from t_bom_new_mbom_detail where bom_row_id=#{rowId} - INSERT INTO `nflg`.`t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`) + INSERT INTO `t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`) select `row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time` from t_bom_new_mbom_parent where row_id=#{rowId}; - INSERT INTO `nflg`.`t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`) + INSERT INTO `t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`) select `row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type` from t_bom_new_mbom_detail where bom_row_id=#{rowId}; diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewOriginalChildMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewOriginalChildMapper.xml index 13fd15fc..c6fa1518 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewOriginalChildMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewOriginalChildMapper.xml @@ -86,7 +86,7 @@ ); - INSERT INTO `nflg`.`t_bom_new_original_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`) + INSERT INTO `t_bom_new_original_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`) select `row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num` from t_bom_new_original_parent where row_id in diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml index 20de0127..2a33a071 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml @@ -229,11 +229,11 @@ and a.fac_code=#{userFac} - and ( b.material_no in + and b.material_no in #{item} - or b.material_no=#{materialNo}) + @@ -371,4 +371,6 @@ + + diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/MaterialMainMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/MaterialMainMapper.xml index 0ea18db0..96234d55 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/MaterialMainMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/MaterialMainMapper.xml @@ -197,4 +197,8 @@ WHERE u.user_code= #{userCode} + +