From 51a7f0c4a0a0b7878df23dae07fea68b9b57dddf Mon Sep 17 00:00:00 2001 From: jing's Date: Wed, 7 Aug 2024 18:07:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A1=AB=E8=B4=9F=E6=95=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=8A=A5=E9=94=99=EF=BC=8C=E6=A0=A1=E9=AA=8C=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=A6=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomParentService.java | 15 ++++++++------- .../service/domain/EBom/CheckEBomException.java | 2 +- .../bomnew/service/domain/EBom/EBomEdit.java | 10 ++++------ 3 files changed, 13 insertions(+), 14 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 fa807188..4ea43f09 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 @@ -2181,6 +2181,14 @@ public class BomNewEbomParentService extends ServiceImpl allBom = Convert.convert(new TypeReference>() { + }, eBomEdit.childEntities); + + CheckEBomException checkEBomException = new CheckEBomException(allBom); + checkEBomException.checkContainExcept(checkStatus); + } + if (eBomEdit.getParentEntity() != null) { @@ -2191,13 +2199,6 @@ public class BomNewEbomParentService extends ServiceImpl allBom = Convert.convert(new TypeReference>() { - }, eBomEdit.childEntities); - - CheckEBomException checkEBomException = new CheckEBomException(allBom); - checkEBomException.checkContainExcept(checkStatus); - } if (CollectionUtil.isNotEmpty(eBomEdit.childEntities)) { 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 783bc9ca..fd166cfe 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 @@ -130,7 +130,7 @@ public class CheckEBomException { && (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(vo.getMaterialState()) || MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(vo.getMaterialState()))) { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_2.getValue()); - } else if (StrUtil.isBlank(vo.getMaterialNo()) || Objects.isNull(vo.getNum()) || BigDecimal.ZERO.compareTo(vo.getNum()) >= 0) { + } else if (StrUtil.isBlank(vo.getMaterialNo()) || Objects.isNull(vo.getNum())) { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); } else if (StrUtil.isNotBlank(vo.getMaterialNo()) && Objects.isNull(vo.getMaterialState())) { vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_7.getValue()); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java index 65908e87..a1464756 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomEdit.java @@ -203,11 +203,12 @@ public class EBomEdit { if(StrUtil.isEmpty(child.getOrderNumber())){ child.setOrderNumber("001"); } - if (dto.getOpType() == 2) { + if (dto.getOpType() == EbomEditStatusEnum.HANDLER_FINISHED.getValue()) { child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); checkExcept(dto.getParent(), child); } + if (StrUtil.isNotBlank(child.getProjectType())) { child.setProjectType(child.getProjectType().toUpperCase()); } @@ -241,8 +242,7 @@ public class EBomEdit { child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); } } else { - if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum()) - || BigDecimal.ZERO.compareTo(child.getNum()) >= 0) { + if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum())) { child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); } else if (StrUtil.isEmpty(child.getProjectType())) { child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); @@ -251,9 +251,7 @@ public class EBomEdit { if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) { child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue()); } - // if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) { - // child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()); - // } + } } From 2c4fa6538ac933ecbddae5bed340a4b4befa8310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Wed, 7 Aug 2024 21:55:40 +0800 Subject: [PATCH 2/5] =?UTF-8?q?optimize:=20=E6=9F=A5=E8=AF=A2=E5=AD=90?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AESapStatus=E4=B8=BAnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 1 + .../nflg/product/bomnew/service/BomNewPbomParentService.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 fa807188..226ba92b 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 @@ -442,6 +442,7 @@ public class BomNewEbomParentService extends ServiceImpl Date: Thu, 8 Aug 2024 09:38:16 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat(ebom):=20=E5=AF=BC=E5=85=A5=E5=88=B0SA?= =?UTF-8?q?P=E5=8F=96=E6=B6=88=E6=98=AF=E5=90=A6=E6=A0=B9=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nflg/product/bomnew/service/BomNewEbomExportToSAP.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/BomNewEbomExportToSAP.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomExportToSAP.java index 8326bc8d..c17193d9 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 @@ -48,7 +48,7 @@ public class BomNewEbomExportToSAP { BomNewEbomParentEntity root = bomNewEbomParentService.getById(rootBomRowId); // VUtils.isTure(Objects.isNull(root)).throwMessage("数据不存在"); if (Objects.isNull(root)) return Collections.emptyList(); - VUtils.isTure(root.getUserRootIs() != 1).throwMessage("请选择根节点"); + // VUtils.isTure(root.getUserRootIs() != 1).throwMessage("请选择根节点"); VUtils.isTure(Objects.equals(root.getSapState(), SapStatusEnum.PUB_RUNNING.getValue())) .throwMessage("正在导入中,请等待操作完成"); From c09b3ab3688db4f01d5c8c93a5910c085943b03d Mon Sep 17 00:00:00 2001 From: 10002327 Date: Thu, 8 Aug 2024 14:24:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/user/material/MaterialHomeApi.java | 8 +++++- .../material/pojo/vo/MaterialHomeMainVO.java | 8 +++++- .../material/service/MaterialMainService.java | 28 +++++++++++++------ .../service/MaterialUpdateBillService.java | 15 +++++----- .../nflg/product/bomnew/api/user/EbomApi.java | 8 +++++- 5 files changed, 49 insertions(+), 18 deletions(-) diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java index f030b4d7..cf0a5621 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java @@ -16,6 +16,8 @@ import com.nflg.product.material.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import nflg.product.common.vo.ResultVO; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -39,6 +41,7 @@ import java.util.stream.Collectors; @Api(tags = "主数据平台首页") @RestController @RequestMapping("home") +@RefreshScope public class MaterialHomeApi extends BaseApi { @Resource @@ -62,6 +65,9 @@ public class MaterialHomeApi extends BaseApi { @Resource private StandardCategoryService standardCategoryService; + @Value("${material.home.day:30}") + private Integer homeDay; + @GetMapping("materialManagement") @ApiOperation("物料管理") public ResultVO>> materialManagement(){ @@ -88,7 +94,7 @@ public class MaterialHomeApi extends BaseApi { @ApiOperation("标准部件") public ResultVO>> standardPartList(){ //仅取90天内的数据 - Date date90 = DateUtil.offsetDay(new Date(),-90); + Date date90 = DateUtil.offsetDay(new Date(),-homeDay); Map> mp = Maps.newHashMap(); AuthorityDepartmentEntity auDept = authorityDepartmentService.getById(SessionUtil.getPartRowId()); diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java index 02630a3d..83cfaf34 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java @@ -25,11 +25,17 @@ public class MaterialHomeMainVO implements Serializable { @ApiModelProperty(value = "物料名称") private String materialName; + @ApiModelProperty(value = "物料分类编码") + private String materialCategoryCode; + + + @ApiModelProperty(value = "对应的物料大类") + private String relCategoryCode; + @ApiModelProperty(value = "流程状态") private Integer processState; @ApiModelProperty(value = "流程状态名称") private String processStateName; - } \ No newline at end of file diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java index 3d55cd58..8a0c744a 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java @@ -161,6 +161,9 @@ public class MaterialMainService extends ServiceImpl listByHome(Integer processState,Integer limitNums){ List rlist = Lists.newArrayList(); - //仅取90天内的数据 - Date date90 = DateUtil.offsetDay(new Date(),-90); + //仅取30天内的数据 + Date date90 = DateUtil.offsetDay(new Date(),-homeDay); LambdaQueryWrapper lw = Wrappers.lambdaQuery() .eq(MaterialMainEntity::getCreatedBy, SessionUtil.getUserCode()); //消息提醒,仅获取已驳回的记录 @@ -2895,18 +2898,27 @@ public class MaterialMainService extends ServiceImpl mainList = this.list(lw); - if(!mainList.isEmpty()){ + List categoryCodeList = mainList.stream().map(MaterialMainEntity::getMaterialCategoryCode) + .distinct().collect(Collectors.toList()); + + List categoryList = materialCategoryService.list(Wrappers.lambdaQuery() + .in(MaterialCategoryEntity::getCategoryCode,categoryCodeList)); + Map categoryMap = categoryList.stream().collect(Collectors + .toMap(MaterialCategoryEntity::getCategoryCode,MaterialCategoryEntity::getRelCategoryCode,(k1,k2)->k1)); + rlist = Convert.toList(MaterialHomeMainVO.class,mainList); - rlist.forEach(r -> r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState())) - .map(MaterialProcessStateEnum::getDescription).orElse("") )); + rlist.forEach(r -> { + r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState())) + .map(MaterialProcessStateEnum::getDescription).orElse("") ); + r.setRelCategoryCode(categoryMap.getOrDefault(r.getMaterialCategoryCode(),"")); + }); } return rlist; - } } diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateBillService.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateBillService.java index c7a42657..f5790539 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateBillService.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateBillService.java @@ -39,6 +39,7 @@ import nflg.product.common.vo.ResultVO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestBody; @@ -84,6 +85,9 @@ public class MaterialUpdateBillService extends ServiceImpl listByHome(Integer billState,Integer limitNums){ List rlist = Lists.newArrayList(); //仅取90天内的数据 - Date date90 = DateUtil.offsetDay(new Date(),-90); + Date date90 = DateUtil.offsetDay(new Date(),-homeDay); LambdaQueryWrapper lw = Wrappers.lambdaQuery() .eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode()); @@ -987,16 +991,12 @@ public class MaterialUpdateBillService extends ServiceImpl entityList = this.list(Wrappers.lambdaQuery() - .eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode()) - .eq(null != billState,MaterialUpdateBillEntity::getBillState,billState) - .ge(MaterialUpdateBillEntity::getCreatedTime,date90) - .orderByDesc(MaterialUpdateBillEntity::getCreatedTime) - .last(String.format("limit %d",limitNums))); + List entityList = this.list(lw); if(!entityList.isEmpty()){ entityList.forEach(e -> { MaterialHomeMainVO r = Convert.convert(MaterialHomeMainVO.class,e); @@ -1006,6 +1006,7 @@ public class MaterialUpdateBillService extends ServiceImpl>> byHome(){ Map> mp = Maps.newHashMap(); //仅取90天内的数据 - Date date90 = DateUtil.offsetDay(new Date(),-90); + Date date90 = DateUtil.offsetDay(new Date(),-homeDay); int limitNums = 5; List eList = bomNewEbomParentService.list(Wrappers.lambdaQuery() .eq(BomNewEbomParentEntity::getCreatedBy,SessionUtil.getUserCode()) .ge(BomNewEbomParentEntity::getCreatedTime,date90) + .orderByAsc(BomNewEbomParentEntity::getEditStatus) .orderByDesc(BomNewEbomParentEntity::getCreatedTime) .last(String.format("limit %d",limitNums))); List ebomList = Convert.toList(BomNewHomeBomVO.class,eList); @@ -581,6 +586,7 @@ public class EbomApi extends BaseApi { List pList = bomNewPbomParentService.list(Wrappers.lambdaQuery() .eq(BomNewPbomParentEntity::getCreatedBy,SessionUtil.getUserCode()) .ge(BomNewPbomParentEntity::getCreatedTime,date90) + .orderByAsc(BomNewPbomParentEntity::getEditStatus) .orderByDesc(BomNewPbomParentEntity::getCreatedTime) .last(String.format("limit %d",limitNums))); From 7a329674d1fd6b0ee1d710c6e708a67bdcc1a760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 8 Aug 2024 15:18:19 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat(pbom):=20=E4=BB=8ESAP=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E8=BF=87=E6=9D=A5=E7=9A=84=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E6=89=A7=E8=A1=8C=E5=AF=BC=E5=85=A5=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=AF=BC=E5=85=A5=E5=88=B0SAP?= =?UTF-8?q?=E4=B8=AD=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewPbomExportToSAPImpl.java | 1 + 1 file changed, 1 insertion(+) 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 a9d648ae..4cb4f5fe 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 @@ -277,6 +277,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP { .eq(BomNewPbomParentEntity::getMaterialNo, child.getMaterialNo()) .ge(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue()) .eq(BomNewPbomParentEntity::getFacCode, child.getFacCode()) + .ne(BomNewPbomParentEntity::getSource, PbomSourceEnum.FROM_SAP.getValue()) .orderByDesc(BomNewPbomParentEntity::getCurrentVersion) .last(" limit 1") .one();