From 04a36e33cb3e3767058fcc116372db627f3caa58 Mon Sep 17 00:00:00 2001 From: luoliming Date: Sat, 10 Aug 2024 17:27:17 +0800 Subject: [PATCH 1/9] =?UTF-8?q?1-pbom-=E5=B7=A5=E4=BD=9C=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=97=AE=E9=A2=98-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewPbomParentService.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) 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 9e1df8ee..6e0c6046 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 @@ -139,7 +139,8 @@ public class BomNewPbomParentService extends ServiceImpl parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo)); + List parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo)); + parentMaterialByMaterialNo.add(materialNo); if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) { String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode(); @@ -202,15 +203,26 @@ 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()); - Set relParentNoSet= Sets.difference(parentNoSet,parentNoResult); - parentNoResult.addAll(materialNos); - while (CollUtil.isNotEmpty(relParentNoSet)){ - getGetParentMaterialByMaterialNoNew(parentNoResult, relParentNoSet); - } + + return Sets.difference(parentNoSet,parentNoResult); } /** From 19bb6ffa3918901f48f44a927d4e2b3a2823c182 Mon Sep 17 00:00:00 2001 From: luoliming Date: Sat, 10 Aug 2024 22:28:48 +0800 Subject: [PATCH 2/9] =?UTF-8?q?1-pbom-=E5=8D=87=E7=BA=A7=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E5=B7=A5=E5=8E=82=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/BomNewPbomParentService.java | 9 ++++++++- .../com/nflg/product/bomnew/service/UserRoleService.java | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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 6e0c6046..c2881a2b 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 @@ -164,8 +164,10 @@ 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; } @@ -1197,7 +1199,12 @@ public class BomNewPbomParentService extends ServiceImpl0){ 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) ; } } From ab3ede73069456cb7dda5339c785538936e901a9 Mon Sep 17 00:00:00 2001 From: jing's Date: Sat, 10 Aug 2024 22:41:15 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=BA=93=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/master/BomNewOriginalChildMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a0fdabd88f11010731b609a0564414f66e7c3f05 Mon Sep 17 00:00:00 2001 From: jing's Date: Sat, 10 Aug 2024 22:47:10 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=BA=93=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/master/BomNewMbomParentMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml index 5b5aad31..02e757d5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml @@ -186,23 +186,23 @@ ]]> - 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}; From 7db0f7555ea84fef412b9a67f52dc4ec547ee5be Mon Sep 17 00:00:00 2001 From: luoliming Date: Sun, 11 Aug 2024 15:17:38 +0800 Subject: [PATCH 5/9] =?UTF-8?q?1-pbom-=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/OriginalBomApi.java | 2 +- .../bomnew/mapper/master/BomNewEbomParentMapper.java | 6 +++++- .../bomnew/service/BomNewEbomParentService.java | 11 +++++++++-- .../nflg/product/bomnew/service/DQBomService.java | 6 +++--- .../mapper/master/BomNewEbomParentMapper.xml | 12 ++++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) 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/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/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 990b492a..060cce06 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<>(); @@ -2143,7 +2145,7 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); if (eBomEdit.isRootForWaitReview()) { - this.getBaseMapper().updateRootForWaitReview(); + updateRootForWaitReview(); } @@ -2153,6 +2155,11 @@ public class BomNewEbomParentService extends ServiceImpl @@ -2210,7 +2217,7 @@ public class BomNewEbomParentService extends ServiceImpl { - 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/resources/mapper/master/BomNewEbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml index 6ccd5ee3..912374db 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml @@ -317,6 +317,18 @@ and a.last_version_is = 1 AND a.virtual_package_is = 0; + + update t_bom_new_ebom_parent + set root_is_for_wait_review=0 + + + update t_bom_new_ebom_parent a left join ( + select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` in (1,3) and last_version_is=1 + ) b + on a.material_no=b.material_no + set a.root_is_for_wait_review=1 + where a.`status` in (1, 3) and last_version_is=1 and b.row_id is null + update t_bom_new_ebom_parent From 74ff1fd5e356ae28187c5eef68918aac32dbb503 Mon Sep 17 00:00:00 2001 From: jing's Date: Mon, 12 Aug 2024 09:53:42 +0800 Subject: [PATCH 6/9] =?UTF-8?q?bom=20=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 4 + .../service/BomNewPbomParentService.java | 2 + .../product/bomnew/util/BomNewSortUtil.java | 74 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/BomNewSortUtil.java 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 060cce06..516b3bf2 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 @@ -359,6 +359,9 @@ public class BomNewEbomParentService extends ServiceImpl 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); + } + }); + + } + + +} From 44f3bf96e118d7a39cda60a5f76424a521a32f97 Mon Sep 17 00:00:00 2001 From: 10001392 <1055202292@qq.com> Date: Mon, 12 Aug 2024 22:15:58 +0800 Subject: [PATCH 7/9] =?UTF-8?q?EBOM=20PBOM=20SAP=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/pojo/vo/OperationErrorMsgVO.java | 9 +++++++++ .../product/bomnew/service/BomNewEbomParentService.java | 4 +++- .../product/bomnew/service/BomNewPbomParentService.java | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) 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/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 060cce06..1400f253 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 @@ -2812,7 +2812,9 @@ public class BomNewEbomParentService extends ServiceImpl resultList = JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class); + resultList.forEach(result -> result.setCreatedTime(sapErrorMsgEntity.getCreatedTime())); + return resultList; } 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 c2881a2b..d9fed474 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 @@ -1568,7 +1568,9 @@ 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) { From 1d2b2e36816e1783a6f6676c862ded36287b4f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 13 Aug 2024 11:32:46 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=BD=ACPBOM-=E8=A7=A3=E5=86=B3=E7=BC=BApa?= =?UTF-8?q?rent=E6=97=B6=E7=89=88=E6=9C=AC=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java index 958a4be5..499f73f1 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java @@ -173,7 +173,7 @@ public abstract class EBomToPbomBase { if (Objects.isNull(oldParent)) { - return buildParentEntity(parentVo, facCode, oldParent, parentVo.getCurrentVersion()); + return buildParentEntity(parentVo, facCode, oldParent, StrUtil.isBlank(parentVo.getCurrentVersion())? VersionUtil.getNextVersion(""):parentVo.getCurrentVersion()); } //pbom 处于工作表 From c15239baff101540389c55794df46a62d2de2afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 13 Aug 2024 19:03:13 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E8=BD=ACPBOM-=E7=9B=B4=E5=8F=91=E5=8C=85pa?= =?UTF-8?q?rent=E4=B8=BAnull=20=E6=97=B6-null=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/domain/EBom/EBomToPbomBase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java index 499f73f1..1515e2ad 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPbomBase.java @@ -197,7 +197,8 @@ public abstract class EBomToPbomBase { return null; } else { //pbom-处于正式表 - String bomVersion = VersionUtil.compare(parentVo.getCurrentVersion(), oldParent.getCurrentVersion()) > 0 ? parentVo.getCurrentVersion() : VersionUtil.getNextVersion(oldParent.getCurrentVersion()); + String version=StrUtil.isBlank(parentVo.getCurrentVersion())?VersionUtil.getNextVersion(""):parentVo.getCurrentVersion(); + String bomVersion = VersionUtil.compare(version, oldParent.getCurrentVersion()) > 0 ? version : VersionUtil.getNextVersion(oldParent.getCurrentVersion()); return buildParentEntity(parentVo, facCode, oldParent, bomVersion); }