From 1d59e425e93cf867c671ff3901a921287a89f854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 17 Jun 2024 15:05:27 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix(ebom):=20=E5=A6=82=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8E=86=E5=8F=B2=E7=89=88=E6=9C=AC=E5=88=99=E5=B0=86?= =?UTF-8?q?=E6=9C=AC=E6=AC=A1=E8=BD=AC=E6=AD=A3=E5=BC=8F=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=8D=E5=88=B6=E5=88=B0formal=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 3 +++ 1 file changed, 3 insertions(+) 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 7ed66be7..d996bcee 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 @@ -2511,6 +2511,9 @@ public class BomNewEbomParentService extends ServiceImpl Date: Mon, 17 Jun 2024 15:50:33 +0800 Subject: [PATCH 2/8] =?UTF-8?q?optimize:=20=E4=BC=98=E5=8C=96=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/core/exception/BaseGlobalExceptionHandle.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java index 6e43b547..838f590e 100644 --- a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java +++ b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/exception/BaseGlobalExceptionHandle.java @@ -1,5 +1,6 @@ package com.nflg.product.base.core.exception; +import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import nflg.product.common.constant.STATE; import nflg.product.common.vo.ResultVO; @@ -51,7 +52,7 @@ public class BaseGlobalExceptionHandle { public ResultVO handleDuplicateKeyException(DuplicateKeyException e) { log.error(e.getMessage(), e); //return ResultVO.error("已存在该记录,请勿重复操作"); - return ResultVO.error("已存在该记录,请勿重复操作"); + return ResultVO.error("数据库存在重复数据"); } @@ -59,8 +60,11 @@ public class BaseGlobalExceptionHandle { @ResponseBody public ResultVO handleException(Exception e) { log.error(e.getMessage(), e); - //return ResultVO.error("操作失败,请联系系统管理员"); - return ResultVO.error("操作失败,请联系系统管理员"); + if (StrUtil.isNotBlank(e.getMessage()) && e.getMessage().contains("Deadlock")) { + return ResultVO.error("操作失败,请重试"); + } else { + return ResultVO.error("操作失败,请联系系统管理员"); + } } /** From 925b8839160c25078a0333780749f2cf2c8e62a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 17 Jun 2024 16:54:25 +0800 Subject: [PATCH 3/8] =?UTF-8?q?optimize(ebom):=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=A7=BB=E9=99=A4=E5=BA=9F=E5=BC=83=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/EBom/CheckEBomException.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java index 723c277f..a30cded1 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java @@ -84,41 +84,34 @@ public class CheckEBomException { */ public void initException() { //初始化物料信息 - List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); - - checkException(materialBaseInfo); + // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + checkException(); } public void initException(List unCheckException) { //初始化物料信息 - List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); this.unCheckExcept=unCheckException; - checkException(materialBaseInfo); + checkException(); } public void initException(String... ignorePropertyList) { - List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); - checkException(materialBaseInfo); + // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); + checkException(); } - public void checkException(List materialBaseInfo) { + public void checkException() { for (BomNewEbomParentVO vo : allBomDetail) { - // if(Objects.isNull(vo.getExceptionStatus())) { //忽略不检查的如14 if (CollectionUtil.isNotEmpty(unCheckExcept) && vo.getExceptionStatus() != null && unCheckExcept.contains(vo.getExceptionStatus())) { continue; } - // BaseMaterialVO mainVO = materialBaseInfo.stream() - // .filter(u -> StrUtil.equals(u.getMaterialNo(), vo.getMaterialNo())) - // .findFirst() - // .orElse(null); vo.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); - // } if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, vo.getProjectType(), true)) { if (StrUtil.isBlank(vo.getMaterialDesc())) { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); @@ -137,7 +130,6 @@ public class CheckEBomException { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); } else if ((!StrUtil.equals("KG", StringUtil.toUpperCase(vo.getMaterialUnit())) && !StrUtil.equals(StringUtil.toUpperCase(vo.getMaterialUnit()), "PC")) - //|| (!Objects.isNull(mainVO) && !StrUtil.equals(vo.getMaterialUnit(), mainVO.getMaterialUnit()))) { && (StrUtil.isBlank(vo.getExceptionTag()) || (!vo.getExceptionTag().contains("16")) && !vo.getExceptionTag().contains("12")) && Objects.equals(vo.getSource(), EBomSourceEnum.FROM_BOM.getValue())) { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_12.getValue()); From 39a8f28b206679a6a2c388bda9b938e95e1829a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 18 Jun 2024 09:53:13 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix(ebom):=20=E5=B7=A5=E4=BD=9C=E8=A1=A8?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E6=9A=82=E5=AD=98=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=B2=A1=E6=9C=89=E4=B8=8B=E7=BA=A7=E4=B9=9F=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=8F=AF=E4=BB=A5=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomParentService.java | 8 ++++---- .../bomnew/service/domain/EBom/EBomEdit.java | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) 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 d996bcee..594fa8ad 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 @@ -1932,10 +1932,10 @@ public class BomNewEbomParentService extends ServiceImpl { k.setParentRowId(parentEntity.getRowId()); @@ -274,9 +282,9 @@ public class EBomEdit { throw new NflgBusinessException(STATE.Error, "parent 数据不能为空"); } - if (CollUtil.isEmpty(dto.getDatas())) { - throw new NflgBusinessException(STATE.Error, "datas 数据不能为空"); - } + // if (CollUtil.isEmpty(dto.getDatas())) { + // throw new NflgBusinessException(STATE.Error, "datas 数据不能为空"); + // } List materialNos = dto.getDatas().stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); if(materialNos.contains(dto.getParent().getMaterialNo())){ @@ -356,6 +364,7 @@ public class EBomEdit { parentEntity.setModifyTime(LocalDateTime.now()); } parentEntity.setEditStatus(dto.getOpType()); + parentEntity.setBomExist(CollUtil.isEmpty(dto.getDatas()) ? 0 : 1); //提交 if (Objects.equals(dto.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) { //工艺人员 From 17e3523b837ecb225db1a757687170403614fc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 18 Jun 2024 09:54:30 +0800 Subject: [PATCH 5/8] =?UTF-8?q?optimize:=20=E6=B7=BB=E5=8A=A0http=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将请求内容和响应内容记录到日志文件,可根据配置开启或关闭该功能 --- .../advice/LoggingRequestBodyAdvice.java | 63 +++++++++++++++++++ .../advice/LoggingResponseBodyAdvice.java | 41 ++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingRequestBodyAdvice.java create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingResponseBodyAdvice.java diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingRequestBodyAdvice.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingRequestBodyAdvice.java new file mode 100644 index 00000000..a414ef07 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingRequestBodyAdvice.java @@ -0,0 +1,63 @@ +package com.nflg.product.bomnew.advice; + +import cn.hutool.core.util.StrUtil; +import com.nflg.product.bomnew.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import nflg.product.common.constant.STATE; +import nflg.product.common.util.JwtUtil; +import nflg.product.common.vo.ResultVO; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.core.MethodParameter; +import org.springframework.http.HttpInputMessage; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice; + +import java.lang.reflect.Type; + +/** + * @author 曹鹏飞 + * @date 2024/6/18 09:41:31 + */ +@Slf4j +@ControllerAdvice +@RefreshScope +public class LoggingRequestBodyAdvice implements RequestBodyAdvice { + + @Value("${logging.http.detailed:false}") + private Boolean enableHttpDetailed; + + @Override + public boolean supports(MethodParameter methodParameter, Type type, Class> aClass) { + return enableHttpDetailed; + } + + @Override + public HttpInputMessage beforeBodyRead(HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class> aClass) { + return httpInputMessage; + } + + @Override + public Object afterBodyRead(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class> aClass) { + try { + log.info("请求参数: {}", JsonUtil.toJson(o)); + log.info("请求头: {}", JsonUtil.toJson(httpInputMessage.getHeaders())); + String token = httpInputMessage.getHeaders().getFirst("Authorization"); + if (StrUtil.isNotBlank(token)) { + ResultVO result = JwtUtil.parse(token); + if (result.getState().equals(STATE.Success.getState())) { + log.info("请求用户: {}", JsonUtil.toJson(result.getData())); + } + } + } catch (Exception ex) { + log.error("读取请求体出错", ex); + } + return o; + } + + @Override + public Object handleEmptyBody(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class> aClass) { + return o; + } +} \ No newline at end of file diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingResponseBodyAdvice.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingResponseBodyAdvice.java new file mode 100644 index 00000000..1fc4e76f --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/advice/LoggingResponseBodyAdvice.java @@ -0,0 +1,41 @@ +package com.nflg.product.bomnew.advice; + +import com.nflg.product.bomnew.util.JsonUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; +import org.springframework.core.MethodParameter; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; + +/** + * @author 曹鹏飞 + * @date 2024/6/18 09:42:06 + */ +@Slf4j +@ControllerAdvice +@RefreshScope +public class LoggingResponseBodyAdvice implements ResponseBodyAdvice { + + @Value("${logging.http.detailed:false}") + private Boolean enableHttpDetailed; + + @Override + public boolean supports(MethodParameter methodParameter, Class> aClass) { + return enableHttpDetailed; + } + + @Override + public Object beforeBodyWrite(Object o, MethodParameter methodParameter, MediaType mediaType, Class> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) { + try { + log.info("响应数据: {}", JsonUtil.toJson(o)); + } catch (Exception ex) { + log.error("读取响应数据出错", ex); + } + return o; + } +} From 7c4da752c0d5ab8483b5789a89944a3fca8555c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 18 Jun 2024 10:37:28 +0800 Subject: [PATCH 6/8] =?UTF-8?q?1=E3=80=81=E6=98=A8=E5=A4=A9=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomParentService.java | 6 +++--- .../mapper/master/BomNewEbomParentMapper.xml | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) 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 7ed66be7..334a220e 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 @@ -910,7 +910,7 @@ public class BomNewEbomParentService extends ServiceImpl delParentBom = delEBomParents.stream().filter(u -> u.getBomRowId() > 0).map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()); if(CollUtil.isNotEmpty(delParentBom)){ this.getBaseMapper().delBatch(delParentBom); - ebomChildService.getBaseMapper().delBomChild(delParentBom); +// ebomChildService.getBaseMapper().delBomChild(delParentBom); } } //需修改正式版BOM的版本 @@ -933,11 +933,11 @@ public class BomNewEbomParentService extends ServiceImpl bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); + List bomRowIds = bomTree.stream().filter(u ->!EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); if (CollUtil.isNotEmpty(bomRowIds)) { this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), bomRowIds); //将历史已发布版-转移到正式历史表 - eBomToFormal(bomRowIds, bomTree.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList()) ); + eBomToFormal(bomRowIds, bomTree.stream().filter(u ->!EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).collect(Collectors.toList()) ); } //子级记录-bom版本 List bomChildren = new ArrayList<>(); 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 18b0d035..e33fb42e 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 @@ -512,26 +512,24 @@ INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`) - select `row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time` from t_bom_new_ebom_parent - where row_id in - - #{item} - and row_id not in ( - select row_id from t_bom_new_ebom_parent_formal where row_id in + select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`, a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`, a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`, a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`, a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`, a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`, a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`, a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_name`, a.`level_num`, a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time` + from t_bom_new_ebom_parent a + left join t_bom_new_ebom_parent_formal b on a.row_id = b.row_id + where a.row_id in #{item} - ) + and b.row_id is null INSERT INTO `t_bom_new_ebom_child_formal` (`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`, `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`, `virtual_part_root_material_no`, `bom_version_row_id`) select `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`, `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`, `virtual_part_root_material_no`, `bom_version_row_id` - from t_bom_new_ebom_child + from t_bom_new_ebom_child a where parent_row_id in #{parentRowId} - and row_id not in ( + and parent_row_id not in( select row_id from t_bom_new_ebom_parent_formal where row_id in #{item} From 76a4a90ea721cb2bce8bad8b9e42ca35264efbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 18 Jun 2024 11:07:22 +0800 Subject: [PATCH 7/8] =?UTF-8?q?fix(ebom):=20=E6=81=A2=E5=A4=8D=E8=A2=AB?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A7=BB=E9=99=A4=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/domain/EBom/CheckEBomException.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java index a30cded1..3c150253 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java @@ -84,21 +84,21 @@ public class CheckEBomException { */ public void initException() { //初始化物料信息 - // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); checkException(); } public void initException(List unCheckException) { //初始化物料信息 - // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); this.unCheckExcept=unCheckException; checkException(); } public void initException(String... ignorePropertyList) { - // List materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); + SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); checkException(); } From 34bfde31c858e46c2f2eb8c715a7393093e20800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 18 Jun 2024 11:10:20 +0800 Subject: [PATCH 8/8] =?UTF-8?q?fix(ebom):=20=E6=B7=BB=E5=8A=A0dept=5Frow?= =?UTF-8?q?=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/master/BomNewEbomParentMapper.xml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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 e33fb42e..6bab6f5a 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 @@ -511,8 +511,23 @@ - INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`) - select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`, a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`, a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`, a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`, a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`, a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`, a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`, a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_name`, a.`level_num`, a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time` + INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, + `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, + `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, + `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, + `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, + `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, + `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, + `dept_name`,`dept_row_id`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`) + select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`, + a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`, + a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`, + a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`, + a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`, + a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`, + a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`, + a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_name`,`dept_row_id`, a.`level_num`, + a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time` from t_bom_new_ebom_parent a left join t_bom_new_ebom_parent_formal b on a.row_id = b.row_id where a.row_id in