From 349ae5a1c3d6819fa20b06dfe56692628632cf4d Mon Sep 17 00:00:00 2001 From: 10002327 Date: Fri, 26 Jul 2024 18:05:39 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E3=80=8B=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/user/material/MaterialHomeApi.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java 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 new file mode 100644 index 00000000..54748971 --- /dev/null +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/api/user/material/MaterialHomeApi.java @@ -0,0 +1,34 @@ +package com.nflg.product.material.api.user.material; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import nflg.product.common.vo.ResultVO; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * packageName com.nflg.product.material.api.user.material + * + * @author luohj + * @className MaterialHomeApi + * @date 2024/7/26 0026 + * @description 主数据平台首页 + */ +@Api(tags = "主数据平台首页") +@RestController +@RequestMapping("home") +public class MaterialHomeApi { + + /** + * + * @param tet + * @return + */ + @GetMapping("test") + @ApiOperation("auto-批量删除") + public ResultVO test(String tet){ + System.out.println("tet1:"+tet); + return ResultVO.success("返回才能够"); + } +} \ No newline at end of file From 7253022f9db6c6dfed1bcfbc99bfb9ef651f2d72 Mon Sep 17 00:00:00 2001 From: 10002327 Date: Wed, 31 Jul 2024 16:31:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E3=80=8B=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E4=BD=9C=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/user/material/MaterialHomeApi.java | 132 ++++++++++++++++-- .../constant/MaterialUpdateBillStateEnum.java | 9 ++ .../pojo/entity/MaterialMainEntity.java | 2 + .../pojo/entity/MaterialUpdateBillEntity.java | 3 + .../material/pojo/vo/MaterialHomeMainVO.java | 35 +++++ .../pojo/vo/StandardPartPickRuleHomeVO.java | 42 ++++++ .../material/service/MaterialMainService.java | 35 +++++ .../service/MaterialSubmitService.java | 20 +++ .../service/MaterialUpdateBillService.java | 50 +++++++ .../service/MaterialUpdateToOAService.java | 20 +++ .../nflg/product/material/util/HttpUtils.java | 29 ++++ .../mapper/master/MaterialMainMapper.xml | 1 + .../master/MaterialUpdateBillMapper.xml | 2 +- .../nflg/product/bomnew/api/user/EbomApi.java | 41 +++++- .../bomnew/constant/EbomEditStatusEnum.java | 20 ++- .../bomnew/constant/PBomEditStatusEnum.java | 17 +++ .../bomnew/pojo/vo/BomNewHomeBomVO.java | 35 +++++ 17 files changed, 477 insertions(+), 16 deletions(-) create mode 100644 nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java create mode 100644 nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/StandardPartPickRuleHomeVO.java create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewHomeBomVO.java 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 54748971..4fc771a4 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 @@ -1,5 +1,18 @@ package com.nflg.product.material.api.user.material; +import cn.hutool.core.date.DateUtil; +import cn.hutool.db.Session; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.nflg.product.base.core.api.BaseApi; +import com.nflg.product.base.core.conmon.util.SessionUtil; +import com.nflg.product.material.constant.MaterialProcessStateEnum; +import com.nflg.product.material.constant.MaterialUpdateBillStateEnum; +import com.nflg.product.material.pojo.entity.*; +import com.nflg.product.material.pojo.vo.MaterialHomeMainVO; +import com.nflg.product.material.pojo.vo.StandardPartPickRuleHomeVO; +import com.nflg.product.material.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import nflg.product.common.vo.ResultVO; @@ -7,6 +20,13 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + /** * packageName com.nflg.product.material.api.user.material * @@ -18,17 +38,107 @@ import org.springframework.web.bind.annotation.RestController; @Api(tags = "主数据平台首页") @RestController @RequestMapping("home") -public class MaterialHomeApi { +public class MaterialHomeApi extends BaseApi { - /** - * - * @param tet - * @return - */ - @GetMapping("test") - @ApiOperation("auto-批量删除") - public ResultVO test(String tet){ - System.out.println("tet1:"+tet); - return ResultVO.success("返回才能够"); + @Resource + MaterialMainService materialMainService; + + @Resource + private AuthorityDepartmentService authorityDepartmentService; + + @Resource + private StandardDeptService standardDeptService; + + @Resource + private StandardPartPickRuleService standardPartPickRuleService; + + @Resource + private MaterialUpdateBillService materialUpdateBillService; + + @Resource + private StandardPartPickRuleArgumentsService standardPartPickRuleArgumentsService; + + @Resource + private StandardCategoryService standardCategoryService; + + @GetMapping("materialManagement") + @ApiOperation("物料管理") + public ResultVO>> materialManagement(){ + Map> mp = Maps.newHashMap(); + List mainList = materialMainService.listByHome(null,5); + List mainUpdateList = materialUpdateBillService.listByHome(null,5); + mp.put("mainList",mainList); + mp.put("mainUpdateList",mainUpdateList); + return ResultVO.success(mp); } + + @GetMapping("materialMessage") + @ApiOperation("消息提醒") + public ResultVO>> materialMessage(){ + Map> mp = Maps.newHashMap(); + List mainList = materialMainService.listByHome(MaterialProcessStateEnum.REJECT.getValue(),5); + List mainUpdateList = materialUpdateBillService.listByHome(MaterialUpdateBillStateEnum.REJECT.getValue(),5); + mp.put("mainList",mainList); + mp.put("mainUpdateList",mainUpdateList); + return ResultVO.success(mp); + } + + @GetMapping("materialMessage") + @ApiOperation("标准部件") + public ResultVO>> standardPartList(){ + //仅取90天内的数据 + Date date90 = DateUtil.offsetDay(new Date(),-90); + + Map> mp = Maps.newHashMap(); + AuthorityDepartmentEntity auDept = authorityDepartmentService.getById(SessionUtil.getPartRowId()); + //获取当前登录用户的标准件部门id + StandardDeptEntity sDept = standardDeptService.getOne(Wrappers.lambdaQuery() + .eq(StandardDeptEntity::getDeptCode,auDept.getDptCode()),false); + if(sDept == null){ + return ResultVO.success(mp); + } + //规则集合,含共享部门及创建部门 + List ruleList = standardPartPickRuleService.list(Wrappers.lambdaQuery() + .ge(StandardPartPickRuleEntity::getCreatedTime,date90) + .and(wp-> wp.eq(StandardPartPickRuleEntity::getDeptRowId,sDept.getRowId()) + .or(w -> w.like(StandardPartPickRuleEntity::getShareDeptRowId,sDept.getRowId()))) + .orderByDesc(StandardPartPickRuleEntity::getCreatedTime) + .last(String.format("limit %d",5))); + if(ruleList.isEmpty()){ + return ResultVO.success(mp); + } + //分类集合 + List categoryList = standardCategoryService.list(Wrappers.lambdaQuery() + .in(StandardCategoryEntity::getRowId,ruleList.stream().map(StandardPartPickRuleEntity::getCategoryRowId).collect(Collectors.toList()))); + + //参数集合 + List argList = standardPartPickRuleArgumentsService.list(Wrappers.lambdaQuery() + .in(StandardPartPickRuleArgumentsEntity::getPickRuleRowId,ruleList.stream().map(StandardPartPickRuleEntity::getRowId).collect(Collectors.toList())) + .orderByAsc(StandardPartPickRuleArgumentsEntity::getOrderNum)); + //本部门设置的选配规则 + List desginList = Lists.newArrayList(); + //本部门可用的选配规则 + List shareList = Lists.newArrayList(); + + ruleList.forEach(rule -> { + StandardPartPickRuleHomeVO ruleHomeVO = new StandardPartPickRuleHomeVO(); + ruleHomeVO.setRowId(rule.getRowId()); + ruleHomeVO.setCategoryRowId(rule.getCategoryRowId()); + + ruleHomeVO.setCategoryName(categoryList.stream().filter(c -> Objects.equals(c.getRowId(),rule.getCategoryRowId())) + .map(StandardCategoryEntity::getCategoryName).distinct().collect(Collectors.joining())); + + ruleHomeVO.setArguments(argList.stream().filter(a -> Objects.equals(a.getRowId(),rule.getRowId())) + .map(StandardPartPickRuleArgumentsEntity::getName).distinct().collect(Collectors.joining("/"))); + + + }); + + //本部门设置的选配规则 + + + return ResultVO.success(null); + } + + } \ No newline at end of file diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/constant/MaterialUpdateBillStateEnum.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/constant/MaterialUpdateBillStateEnum.java index 813cb24f..b15d1370 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/constant/MaterialUpdateBillStateEnum.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/constant/MaterialUpdateBillStateEnum.java @@ -17,4 +17,13 @@ public enum MaterialUpdateBillStateEnum { private final Integer value; private final String description; + + public static MaterialUpdateBillStateEnum findDescriptionByValue(Integer value) { + for (MaterialUpdateBillStateEnum valueEnum : MaterialUpdateBillStateEnum.values()) { + if (valueEnum.getValue().equals(value)) { + return valueEnum; + } + } + return null; + } } diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialMainEntity.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialMainEntity.java index 85840f83..1ff6c005 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialMainEntity.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialMainEntity.java @@ -221,6 +221,8 @@ public class MaterialMainEntity implements Serializable { @ApiModelProperty("驳回原因") private String rejectResion; + @ApiModelProperty("驳回时间") + private Date rejectTime; /** * 物料分类编码 diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialUpdateBillEntity.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialUpdateBillEntity.java index 44d922d9..87335b3f 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialUpdateBillEntity.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/MaterialUpdateBillEntity.java @@ -177,6 +177,9 @@ public class MaterialUpdateBillEntity implements Serializable { @ApiModelProperty(value = "驳回原因") private String rejectResion; + @ApiModelProperty("驳回时间") + private Date rejectTime; + /** * 驳回人 */ 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 new file mode 100644 index 00000000..02630a3d --- /dev/null +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialHomeMainVO.java @@ -0,0 +1,35 @@ +package com.nflg.product.material.pojo.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * packageName com.nflg.product.material.pojo.vo + * + * @author luohj + * @className MaterialHomeMainVO + * @date 2024/7/29 0029 + * @description 首页 + */ +@Data +public class MaterialHomeMainVO implements Serializable { + + @ApiModelProperty(value = "表行id") + private Long rowId; + + @ApiModelProperty(value = "物料编码") + private String materialNo; + + @ApiModelProperty(value = "物料名称") + private String materialName; + + @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/pojo/vo/StandardPartPickRuleHomeVO.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/StandardPartPickRuleHomeVO.java new file mode 100644 index 00000000..f54cdbe3 --- /dev/null +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/StandardPartPickRuleHomeVO.java @@ -0,0 +1,42 @@ +package com.nflg.product.material.pojo.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @author 曹鹏飞 + * @date 2024/5/9 11:31:31 + */ +@Data +@Accessors(chain = true) +public class StandardPartPickRuleHomeVO implements Serializable { + + /** + * 行ID + */ + @ApiModelProperty(value = "行ID") + private Long rowId; + + /** + * 部件类型的行ID + */ + @ApiModelProperty(value = "部件类型的行ID") + @NotNull + private Long categoryRowId; + + /* + * 部件类型的名称 + */ + @ApiModelProperty(value = "部件类型的名称") + private String categoryName; + + /** + * 参数 + */ + @ApiModelProperty(value = "参数") + private String arguments; +} 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 6f15ed6b..3d55cd58 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 @@ -3,12 +3,14 @@ package com.nflg.product.material.service; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.TypeReference; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -18,6 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.exception.NflgBusinessException; import com.nflg.product.base.core.vo.PageVO; @@ -2874,4 +2877,36 @@ public class MaterialMainService extends ServiceImpl list=lambdaQuery().in(MaterialMainEntity::getMaterialNo, materialNos).list(); return Convert.toList(MaterialMainVO.class, list); } + + /** + * 首页》物料管理》我的物料申请 + * @param processState 流程状态 + * @param limitNums 取数 + * @return + */ + public List listByHome(Integer processState,Integer limitNums){ + List rlist = Lists.newArrayList(); + //仅取90天内的数据 + Date date90 = DateUtil.offsetDay(new Date(),-90); + LambdaQueryWrapper lw = Wrappers.lambdaQuery() + .eq(MaterialMainEntity::getCreatedBy, SessionUtil.getUserCode()); + //消息提醒,仅获取已驳回的记录 + if(Objects.equals(processState,MaterialProcessStateEnum.REJECT.getValue())){ + lw.eq(MaterialMainEntity::getProcessState,processState); + lw.ge(MaterialMainEntity::getRejectTime,date90).orderByDesc(MaterialMainEntity::getRejectTime); + }else{ + lw.ge(MaterialMainEntity::getCreatedTime,date90).orderByDesc(MaterialMainEntity::getCreatedTime); + } + lw.last(String.format("limit %d",limitNums)); + + List mainList = this.list(lw); + + if(!mainList.isEmpty()){ + rlist = Convert.toList(MaterialHomeMainVO.class,mainList); + rlist.forEach(r -> r.setProcessStateName(Optional.ofNullable(MaterialProcessStateEnum.findDescriptionByValue(r.getProcessState())) + .map(MaterialProcessStateEnum::getDescription).orElse("") )); + } + return rlist; + + } } 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 4943bbdf..75a1f4d0 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 @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.ImmutableList; import com.nflg.product.base.core.config.SpringContextUtils; import com.nflg.product.base.core.conmon.util.SessionUtil; @@ -36,6 +37,7 @@ import java.math.RoundingMode; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -66,6 +68,9 @@ public class MaterialSubmitService { @Value("${oa.timeout}") private int timeout; + @Value("${spring.profiles.active}") + private String profiles; + public void submitOne(Long rowId) { MaterialMainVO materialMainVO = materialMainService.selectByRowId(rowId, MaterialMainTypeEnum.ONE.getCode()); @@ -511,6 +516,7 @@ public class MaterialSubmitService { //更新完结流程 log.info("物料申请--OA返回结果--通过:" + JSON.toJSONString(oaRowIds)); if (oaRowIds.size() > 0) { + try { // oaId去重 List oaRowIdList = oaRowIds.stream().distinct().collect(Collectors.toList()); @@ -525,9 +531,23 @@ public class MaterialSubmitService { // oaId去重 List rejects = rejectList.stream().collect(Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new)); + List mList = materialMainService.list(Wrappers.lambdaQuery().in(MaterialMainEntity::getOaRowId, + rejects.stream().map(OaRejectDTO::getInstId).distinct().collect(Collectors.toList()))); + Map mainMap = mList.stream().collect(Collectors.toMap(m -> String.valueOf(m.getOaRowId()), MaterialMainEntity::getCreatedBy,(k1, k2)->k1)); for (OaRejectDTO r : rejects) { try { materialMainService.getBaseMapper().reject("", r.getReturnMessage(), r.getInstId()); + //已驳回,发送RTX消息给用户 by luohj 240730 + String receiver = mainMap.get(r.getInstId()); + if(StrUtil.isNotBlank(receiver)){ + String msg = mList.stream().filter(m -> Objects.equals(String.valueOf(m.getOaRowId()),r.getInstId())) + .map(m -> String.format("%s %s",m.getMaterialNo(),m.getMaterialName())) + .collect(Collectors.joining("\n")); + CompletableFuture.runAsync(() -> { + httpUtils.rtxMessage(profiles,"物料新增申请【被驳回】",msg,Objects.equals(receiver,"admin")?"10002327":receiver); + }).join(); + } + } catch (Exception e) { log.error("OAID为:" + r.getInstId() + "修改申请信息异常", e); } 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 b4b823d8..c7a42657 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 @@ -2,14 +2,19 @@ package com.nflg.product.material.service; import cn.hutool.cache.impl.TimedCache; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +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.Lists; import com.google.common.collect.Sets; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.exception.NflgBusinessException; @@ -23,6 +28,7 @@ import com.nflg.product.material.pojo.dto.MaterialMainAttrDTO; import com.nflg.product.material.pojo.dto.MaterialUpdateBillDTO; import com.nflg.product.material.pojo.entity.*; import com.nflg.product.material.pojo.query.MaterialUpdateBillQuery; +import com.nflg.product.material.pojo.vo.MaterialHomeMainVO; import com.nflg.product.material.pojo.vo.MaterialMainAttrValuesVO; import com.nflg.product.material.pojo.vo.MaterialMainVO; import com.nflg.product.material.pojo.vo.MaterialUpdateBillVO; @@ -961,4 +967,48 @@ public class MaterialUpdateBillService extends ServiceImpl> getCurrentUpdateMaterial(List list) { return materialUpdateBillMapper.getCurrentUpdateMaterial(list); } + + /** + * 首页》物料管理》我的变更申请 + * @return + */ + public List listByHome(Integer billState,Integer limitNums){ + List rlist = Lists.newArrayList(); + //仅取90天内的数据 + Date date90 = DateUtil.offsetDay(new Date(),-90); + + LambdaQueryWrapper lw = Wrappers.lambdaQuery() + .eq(MaterialUpdateBillEntity::getCreatedBy,SessionUtil.getUserCode()); + + //消息提醒,仅取已驳回记录 + if(Objects.equals(billState,MaterialUpdateBillStateEnum.REJECT.getValue())){ + lw.eq(MaterialUpdateBillEntity::getBillState,billState) + .ge(MaterialUpdateBillEntity::getRejectTime,date90) + .orderByDesc(MaterialUpdateBillEntity::getRejectTime); + }else{ + lw.ge(MaterialUpdateBillEntity::getCreatedTime,date90) + .orderByDesc(MaterialUpdateBillEntity::getCreatedTime); + } + lw.last(String.format("limit %d",limitNums)); + + List 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))); + if(!entityList.isEmpty()){ + entityList.forEach(e -> { + MaterialHomeMainVO r = Convert.convert(MaterialHomeMainVO.class,e); + if(StrUtil.isBlank(r.getMaterialName())){ + r.setMaterialName(Optional.ofNullable(e.getOldMaterialDesc()).orElse("")); + } + r.setProcessState(e.getBillState()); + r.setProcessStateName(Optional.ofNullable(MaterialUpdateBillStateEnum.findDescriptionByValue(e.getBillState())) + .map(MaterialUpdateBillStateEnum::getDescription).orElse("")); + rlist.add(r); + }); + } + return rlist; + } } diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateToOAService.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateToOAService.java index 7264dffd..888fe272 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateToOAService.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialUpdateToOAService.java @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.base.core.exception.NflgBusinessException; @@ -31,6 +32,7 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; /** @@ -67,6 +69,9 @@ public class MaterialUpdateToOAService { @Value("${oa.timeout}") private int timeout; + @Value("${spring.profiles.active}") + private String profiles; + public void submit(List rowIds) { List entityList = materialUpdateBillService.lambdaQuery().in(MaterialUpdateBillEntity::getRowId, rowIds).list(); sysnToOa(entityList); @@ -435,9 +440,24 @@ public class MaterialUpdateToOAService { // oaId去重 List rejects = rejectList.stream().collect(Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(OaRejectDTO::getInstId))), ArrayList::new)); + + List mList = materialUpdateBillService.list(Wrappers.lambdaQuery().in(MaterialUpdateBillEntity::getOaRowId, + rejects.stream().map(OaRejectDTO::getInstId).distinct().collect(Collectors.toList()))); + Map mainMap = mList.stream().collect(Collectors.toMap(m -> String.valueOf(m.getOaRowId()), MaterialUpdateBillEntity::getCreatedBy,(k1, k2)->k1)); + for (OaRejectDTO r : rejects) { try { materialUpdateBillService.getBaseMapper().rejectBill(r.getReturnMessage(), r.getInstId(), ""); + //已驳回,发送RTX消息给用户 by luohj 240730 + String receiver = mainMap.get(r.getInstId()); + if(StrUtil.isNotBlank(receiver)){ + String msg = mList.stream().filter(m -> Objects.equals(String.valueOf(m.getOaRowId()),r.getInstId())) + .map(m -> String.format("%s %s",m.getMaterialNo(),Optional.ofNullable(m.getMaterialName()).orElse(m.getOldMaterialDesc()))) + .collect(Collectors.joining("\n")); + CompletableFuture.runAsync(() -> { + httpUtils.rtxMessage(profiles,"物料变更申请【被驳回】",msg,Objects.equals(receiver,"admin")?"10002327":receiver); + }).join(); + } } catch (Exception e) { log.error("OAID为:" + r.getInstId() + "修改变更信息异常", e); } diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/HttpUtils.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/HttpUtils.java index bb6c6d79..bc3769be 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/HttpUtils.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/HttpUtils.java @@ -1,6 +1,10 @@ package com.nflg.product.material.util; +import cn.hutool.core.util.CharsetUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.nflg.product.base.core.exception.NflgBusinessException; import lombok.extern.slf4j.Slf4j; @@ -11,8 +15,10 @@ import org.springframework.http.HttpStatus; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; /** @@ -392,5 +398,28 @@ public class HttpUtils { return getOkHttpClient().newCall(request).execute(); } + /** + * + * @param profiles 环境变量 + * @param title 消息标题 + * @param msg 消息内容 + * @param receiver 接收人,工号,多人以,隔开 + */ + public void rtxMessage(String profiles, String title, String msg, String receiver){ + String url = "http://192.168.0.1:8012/sendnotify.cgi"; + try{ + if(!ObjectUtil.equal(profiles.toLowerCase(),"prod")){ + title += "(测试)"; + } + title = URLEncoder.encode(title, "GBK"); + msg = URLEncoder.encode(msg, "GBK"); + receiver = URLEncoder.encode(receiver, "GBK"); + url += "?title=" + title + "&msg=" + msg + "&delaytime=0&receiver=" + receiver; + String re = this.doGet(url); + }catch (Exception e){ + log.error("RTX消息发送异常:{}" ,e.getMessage()); + } + } + } diff --git a/nflg_project_dev/material/src/main/resources/mapper/master/MaterialMainMapper.xml b/nflg_project_dev/material/src/main/resources/mapper/master/MaterialMainMapper.xml index 246e38b6..622b8aaa 100644 --- a/nflg_project_dev/material/src/main/resources/mapper/master/MaterialMainMapper.xml +++ b/nflg_project_dev/material/src/main/resources/mapper/master/MaterialMainMapper.xml @@ -388,6 +388,7 @@ UPDATE t_material_main set reject_user=#{rejectUser}, reject_resion=#{rejectResion}, + reject_time = now(), process_state=2 where oa_row_id = #{oaRowId} diff --git a/nflg_project_dev/material/src/main/resources/mapper/master/MaterialUpdateBillMapper.xml b/nflg_project_dev/material/src/main/resources/mapper/master/MaterialUpdateBillMapper.xml index b2281113..8290041e 100644 --- a/nflg_project_dev/material/src/main/resources/mapper/master/MaterialUpdateBillMapper.xml +++ b/nflg_project_dev/material/src/main/resources/mapper/master/MaterialUpdateBillMapper.xml @@ -171,7 +171,7 @@ update t_material_update_bill - set bill_state=5, reject_resion=#{rejectResion}, reject_user=#{rejectUser} + set bill_state=5, reject_resion=#{rejectResion},reject_time=now(), reject_user=#{rejectUser} where oa_row_id = #{oaRowId} diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java index d5d3666b..bc929b30 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java @@ -2,17 +2,22 @@ package com.nflg.product.bomnew.api.user; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; import com.mzt.logapi.starter.annotation.LogRecord; import com.nflg.product.base.core.api.BaseApi; import com.nflg.product.base.core.conmon.util.SessionUtil; -import com.nflg.product.bomnew.constant.EBomConstant; -import com.nflg.product.bomnew.constant.EBomSourceEnum; -import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; +import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.pojo.dto.*; +import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity; +import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity; import com.nflg.product.bomnew.pojo.query.BomExceptionQuery; import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery; import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery; @@ -557,4 +562,34 @@ public class EbomApi extends BaseApi { return ResultVO.success(true); } + + @GetMapping("byHome") + public ResultVO>> byHome(){ + Map> mp = Maps.newHashMap(); + //仅取90天内的数据 + Date date90 = DateUtil.offsetDay(new Date(),-90); + int limitNums = 5; + List eList = bomNewEbomParentService.list(Wrappers.lambdaQuery() + .eq(BomNewEbomParentEntity::getCreatedBy,SessionUtil.getUserCode()) + .ge(BomNewEbomParentEntity::getCreatedTime,date90) + .orderByDesc(BomNewEbomParentEntity::getCreatedTime) + .last(String.format("limit %d",limitNums))); + List ebomList = Convert.toList(BomNewHomeBomVO.class,eList); + ebomList.forEach(e->e.setEditStatusName( EbomEditStatusEnum.byValue(e.getEditStatus()))); + mp.put("ebomList",ebomList); + + List pList = bomNewPbomParentService.list(Wrappers.lambdaQuery() + .eq(BomNewPbomParentEntity::getCreatedBy,SessionUtil.getUserCode()) + .ge(BomNewPbomParentEntity::getCreatedTime,date90) + .orderByDesc(BomNewPbomParentEntity::getCreatedTime) + .last(String.format("limit %d",limitNums))); + + List pbomList = Convert.toList(BomNewHomeBomVO.class,pList); + pbomList.forEach(p -> p.setEditStatusName(PBomEditStatusEnum.byValue(p.getEditStatus()))); + mp.put("pbomList",pbomList); + + return ResultVO.success(mp); + } + + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java index 4f029242..13eeec08 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EbomEditStatusEnum.java @@ -1,9 +1,13 @@ package com.nflg.product.bomnew.constant; +import cn.hutool.core.util.EnumUtil; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.Map; +import java.util.Optional; + @AllArgsConstructor @Getter public enum EbomEditStatusEnum implements ValueEnum { @@ -11,7 +15,21 @@ public enum EbomEditStatusEnum implements ValueEnum { HANDLER_CREATED(1, "待处理"),//待处理=暂存 HANDLER_FINISHED(2, "已处理"); //已处理=提交 - private final Integer value; private final String description; + + public static EbomEditStatusEnum findDescriptionByValue(Integer value) { + for (EbomEditStatusEnum valueEnum :EbomEditStatusEnum.values()) { + if (valueEnum.getValue().equals(value)) { + return valueEnum; + } + } + return null; + } + + public static String byValue(Integer value){ + return Optional.ofNullable(findDescriptionByValue(value)) + .map(EbomEditStatusEnum::getDescription).orElse(""); + } + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/PBomEditStatusEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/PBomEditStatusEnum.java index c6841132..90526ce9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/PBomEditStatusEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/PBomEditStatusEnum.java @@ -3,6 +3,8 @@ package com.nflg.product.bomnew.constant; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.Optional; + @Getter @AllArgsConstructor public enum PBomEditStatusEnum implements ValueEnum{ @@ -15,4 +17,19 @@ public enum PBomEditStatusEnum implements ValueEnum{ private final Integer value; private final String description; + + + public static PBomEditStatusEnum findDescriptionByValue(Integer value) { + for (PBomEditStatusEnum valueEnum :PBomEditStatusEnum.values()) { + if (valueEnum.getValue().equals(value)) { + return valueEnum; + } + } + return null; + } + + public static String byValue(Integer value){ + return Optional.ofNullable(findDescriptionByValue(value)) + .map(PBomEditStatusEnum::getDescription).orElse(""); + } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewHomeBomVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewHomeBomVO.java new file mode 100644 index 00000000..ab3de656 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/BomNewHomeBomVO.java @@ -0,0 +1,35 @@ +package com.nflg.product.bomnew.pojo.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * packageName com.nflg.product.bomnew.pojo.vo + * + * @author luohj + * @className BomNewHomeBomVO + * @date 2024/7/30 0030 + * @description TODO + */ +@Data +@Accessors(chain = true) +public class BomNewHomeBomVO implements Serializable { + + @ApiModelProperty(value = "主键-行ID") + private Long rowId; + + @ApiModelProperty(value = "物料编码") + private String materialNo; + + @ApiModelProperty(value = "图号") + private String drawingNo; + + @ApiModelProperty(value = "处理状态") + private Integer editStatus; + + @ApiModelProperty(value = "处理状态名称") + private String editStatusName; +} \ No newline at end of file From 3f2a33a25d8abdb6b2ca76efb52d10638368b774 Mon Sep 17 00:00:00 2001 From: 10002327 Date: Tue, 6 Aug 2024 09:59:37 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E3=80=8B=E6=A0=87?= =?UTF-8?q?=E5=87=86=E9=83=A8=E4=BB=B6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/user/material/MaterialHomeApi.java | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 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 4fc771a4..f030b4d7 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 @@ -25,6 +25,7 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -83,7 +84,7 @@ public class MaterialHomeApi extends BaseApi { return ResultVO.success(mp); } - @GetMapping("materialMessage") + @GetMapping("standardPartList") @ApiOperation("标准部件") public ResultVO>> standardPartList(){ //仅取90天内的数据 @@ -97,13 +98,20 @@ public class MaterialHomeApi extends BaseApi { if(sDept == null){ return ResultVO.success(mp); } - //规则集合,含共享部门及创建部门 - List ruleList = standardPartPickRuleService.list(Wrappers.lambdaQuery() + //规则集合,含共享部门及创建部门各取前5条记录 + List ruleList = Lists.newArrayList(); + List desginRuleList = standardPartPickRuleService.list(Wrappers.lambdaQuery() .ge(StandardPartPickRuleEntity::getCreatedTime,date90) - .and(wp-> wp.eq(StandardPartPickRuleEntity::getDeptRowId,sDept.getRowId()) - .or(w -> w.like(StandardPartPickRuleEntity::getShareDeptRowId,sDept.getRowId()))) + .eq(StandardPartPickRuleEntity::getDeptRowId,sDept.getRowId()) .orderByDesc(StandardPartPickRuleEntity::getCreatedTime) .last(String.format("limit %d",5))); + List shareRuleList = standardPartPickRuleService.list(Wrappers.lambdaQuery() + .ge(StandardPartPickRuleEntity::getCreatedTime,date90) + .like(StandardPartPickRuleEntity::getShareDeptRowId,sDept.getRowId()) + .orderByDesc(StandardPartPickRuleEntity::getCreatedTime) + .last(String.format("limit %d",5))); + ruleList.addAll(desginRuleList.stream().collect(Collectors.toMap(StandardPartPickRuleEntity::getCategoryRowId,Function.identity(),(k1,k2)->k1)).values()); + ruleList.addAll(shareRuleList.stream().collect(Collectors.toMap(StandardPartPickRuleEntity::getCategoryRowId,Function.identity(),(k1,k2)-> k1)).values()); if(ruleList.isEmpty()){ return ResultVO.success(mp); } @@ -120,7 +128,7 @@ public class MaterialHomeApi extends BaseApi { //本部门可用的选配规则 List shareList = Lists.newArrayList(); - ruleList.forEach(rule -> { + ruleList.stream().distinct().forEach(rule -> { StandardPartPickRuleHomeVO ruleHomeVO = new StandardPartPickRuleHomeVO(); ruleHomeVO.setRowId(rule.getRowId()); ruleHomeVO.setCategoryRowId(rule.getCategoryRowId()); @@ -130,15 +138,15 @@ public class MaterialHomeApi extends BaseApi { ruleHomeVO.setArguments(argList.stream().filter(a -> Objects.equals(a.getRowId(),rule.getRowId())) .map(StandardPartPickRuleArgumentsEntity::getName).distinct().collect(Collectors.joining("/"))); - - + shareList.add(ruleHomeVO); + //本部门设置的选配规则 + if(Objects.equals(rule.getDeptRowId(),sDept.getRowId())){ + desginList.add(ruleHomeVO); + } }); - - //本部门设置的选配规则 - - - return ResultVO.success(null); + mp.put("shareList",shareList); + mp.put("desginList",desginList); + return ResultVO.success(mp); } - } \ No newline at end of file From cffe58bfece0aa131beb1934d1cacbaa9c37f9b4 Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 6 Aug 2024 11:11:42 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=AD=A3=E6=9F=A5=E5=AD=90=E7=BA=A7?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/ForwardReportService.java | 27 ++++++++++++++----- .../domain/EBom/EBomFormalTreeTask.java | 8 ++++-- .../domain/EBom/EBomForwardReport.java | 10 ++++--- .../domain/PBom/PBomFormalTreeTask.java | 7 ++++- .../domain/PBom/PBomForwardReport.java | 6 ++++- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/ForwardReportService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/ForwardReportService.java index 3c6e741c..d670d798 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/ForwardReportService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/ForwardReportService.java @@ -218,12 +218,19 @@ public class ForwardReportService { BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getMaterialNo()); vo.setDeviseName(ebomParentEntity.getDeviseName()); vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode()); + // vo.setCreatedBy(ebomParentEntity.getCreatedBy()); vo.setCurrentVersion(ebomParentEntity.getCurrentVersion()); - vo.setExpireEndTime(ebomParentEntity.getConvertToEbomTime()); + vo.setExpireEndTime(ebomParentEntity.getExpireEndTime()); vo.setBomRowId(ebomParentEntity.getRowId()); + }else{ - vo.setDeviseName(parentEntity.getDeviseName()); - vo.setDeviseUserCode(parentEntity.getDeviseUserCode()); + if(Objects.nonNull(parentEntity)) { + vo.setDeviseName(parentEntity.getDeviseName()); + vo.setDeviseUserCode(parentEntity.getDeviseUserCode()); + // vo.setCreatedBy(parentEntity.getCreatedBy()); + vo.setCurrentVersion(parentEntity.getCurrentVersion()); + vo.setExpireEndTime(parentEntity.getExpireEndTime()); + } // if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) { // vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION); // } @@ -299,13 +306,19 @@ public class ForwardReportService { if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getMaterialNo())) { BomNewPbomParentVO pbomParentEntity = parentEntityMap.get(vo.getMaterialNo()); vo.setDeviseName(pbomParentEntity.getDeviseName()); + vo.setDeviseUserCode(pbomParentEntity.getDeviseUserCode()); vo.setCurrentVersion(pbomParentEntity.getCurrentVersion()); - vo.setExpireEndTime(pbomParentEntity.getReleaseTime()); + vo.setExpireEndTime(pbomParentEntity.getExpireEndTime()); + // vo.setCreatedBy(pbomParentEntity.getCreatedBy()); }else{ - vo.setExpireEndTime(parentEntity.getReleaseTime()); - vo.setDeviseName(parentEntity.getDeviseName()); - vo.setDeviseUserCode(parentEntity.getDeviseUserCode()); + if(Objects.nonNull(parentEntity)) { + vo.setDeviseName(parentEntity.getDeviseName()); + vo.setDeviseUserCode(parentEntity.getDeviseUserCode()); + vo.setExpireEndTime(parentEntity.getExpireEndTime()); + vo.setCurrentVersion(parentEntity.getCurrentVersion()); + // vo.setCreatedBy(parentEntity.getCreatedBy()); + } // if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) { // vo.setCurrentVersion(OriginalConstant.NO_BOM_VERSION); // } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomFormalTreeTask.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomFormalTreeTask.java index 20df8c4d..f9e6de23 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomFormalTreeTask.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomFormalTreeTask.java @@ -90,7 +90,8 @@ public class EBomFormalTreeTask extends RecursiveTask> detailVO.setBomExist(ebomParentEntity.getBomExist()); detailVO.setStatus(ebomParentEntity.getStatus()); detailVO.setBatchNo(ebomParentEntity.getBatchNo()); - detailVO.setCreatedBy(ebomParentEntity.getCreatedBy()); + // detailVO.setCreatedBy(ebomParentEntity.getCreatedBy()); + detailVO.setExpireEndTime(ebomParentEntity.getExpireEndTime()); }else { BomNewEbomParentEntity parent = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getRowId, detailVO.getParentRowId()).one(); @@ -102,7 +103,10 @@ public class EBomFormalTreeTask extends RecursiveTask> detailVO.setStatus(parent.getStatus()); detailVO.setEditStatus(parent.getEditStatus()); detailVO.setVirtualPackageIs(parent.getVirtualPackageIs()); - + // detailVO.setCurrentVersion() + // detailVO.setCreatedBy(parent.getCreatedBy()); + detailVO.setCurrentVersion(parent.getCurrentVersion()); + detailVO.setExpireEndTime(parent.getExpireEndTime()); } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomForwardReport.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomForwardReport.java index 0890d399..19158305 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomForwardReport.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomForwardReport.java @@ -209,15 +209,16 @@ public class EBomForwardReport extends BaseForwardReport { if (Objects.nonNull(parentEntityMap) && parentEntityMap.containsKey(vo.getBomRowId())) { // vo.setCreatedTime(forwardReportVO.getCreatedTime()); - // vo.setExpireEndTime(parentFormal.getConvertToEbomTime()); + BomNewEbomParentVO ebomParentEntity = parentEntityMap.get(vo.getBomRowId()); vo.setLevelNum(levelNum); vo.setOrderNumber(orderNum.getAndIncrement() + ""); vo.setDeviseName(ebomParentEntity.getDeviseName()); vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode()); + // vo.setCreatedBy(ebomParentEntity.getCreatedBy()); vo.setCurrentVersion(ebomParentEntity.getCurrentVersion()); - + vo.setExpireEndTime(ebomParentEntity.getExpireEndTime()); } else { vo.setLevelNum(levelNum); vo.setOrderNumber(orderNum.getAndIncrement() + ""); @@ -225,6 +226,9 @@ public class EBomForwardReport extends BaseForwardReport { BomNewEbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId()); vo.setDeviseName(parentVO.getDeviseName()); vo.setDeviseUserCode(parentVO.getDeviseUserCode()); + // vo.setCreatedBy(parentVO.getCreatedBy()); + vo.setCurrentVersion(parentVO.getCurrentVersion()); + vo.setExpireEndTime(parentVO.getExpireEndTime()); } // if (MaterialshouldBomExistUtil.checkShouldBomExist(vo)) { @@ -481,7 +485,7 @@ public class EBomForwardReport extends BaseForwardReport { nodeList) { vo.setBomVersion(parentFormal.getCurrentVersion()); // vo.setDeviseName(parentFormal.getDeviseName()); - vo.setExpireEndTime(parentFormal.getConvertToEbomTime()); + // vo.setExpireEndTime(parentFormal.getConvertToEbomTime()); } nodesList.addAll(nodeList); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomFormalTreeTask.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomFormalTreeTask.java index a58be260..be97c3aa 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomFormalTreeTask.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomFormalTreeTask.java @@ -110,7 +110,9 @@ public class PBomFormalTreeTask extends RecursiveTask> detailVO.setDeviseUserCode(ebomParentEntity.getDeviseUserCode()); detailVO.setCreatedTime(ebomParentEntity.getCreatedTime()); - detailVO.setCreatedBy(ebomParentEntity.getCreatedBy()); + + detailVO.setExpireEndTime(ebomParentEntity.getExpireEndTime()); + // detailVO.setCreatedBy(ebomParentEntity.getCreatedBy()); detailVO.setDeptName(ebomParentEntity.getDeptName()); detailVO.setDeptRowId(ebomParentEntity.getDeptRowId()); @@ -125,11 +127,14 @@ public class PBomFormalTreeTask extends RecursiveTask> if(Objects.nonNull(parent)) { detailVO.setDeviseUserCode(parent.getDeviseUserCode()); detailVO.setDeviseName(parent.getDeviseName()); + // detailVO.setCreatedBy(parent.getCreatedBy()); detailVO.setDeptName(parent.getDeptName()); detailVO.setDeptRowId(parent.getDeptRowId()); detailVO.setStatus(parent.getStatus()); detailVO.setEditStatus(parent.getEditStatus()); detailVO.setVirtualPackageIs(parent.getVirtualPackageIs()); + detailVO.setExpireEndTime(parent.getExpireEndTime()); + detailVO.setCurrentVersion(parent.getCurrentVersion()); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java index 3126e17e..89f8ed0b 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java @@ -412,7 +412,9 @@ public class PBomForwardReport extends BaseForwardReport { vo.setOrderNumber(orderNum.getAndIncrement() + ""); vo.setDeviseName(ebomParentEntity.getDeviseName()); vo.setDeviseUserCode(ebomParentEntity.getDeviseUserCode()); + // vo.setCreatedBy(ebomParentEntity.getCreatedBy()); vo.setCurrentVersion(ebomParentEntity.getCurrentVersion()); + vo.setExpireEndTime(ebomParentEntity.getExpireEndTime()); } else { vo.setLevelNum(levelNum); @@ -422,7 +424,9 @@ public class PBomForwardReport extends BaseForwardReport { BomNewPbomParentVO parentVO = noBomParentEntityMap.get(vo.getParentRowId()); vo.setDeviseName(parentVO.getDeviseName()); vo.setDeviseUserCode(parentVO.getDeviseUserCode()); - + // vo.setCreatedBy(parentVO.getCreatedBy()); + vo.setCurrentVersion(parentVO.getCurrentVersion()); + vo.setExpireEndTime(parentVO.getExpireEndTime()); } From f00e9eb02a7c9182100e6af06c54d82ba5c83462 Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 6 Aug 2024 11:40:19 +0800 Subject: [PATCH 5/5] =?UTF-8?q?pbom=E6=AD=A3=E6=9F=A5=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/domain/PBom/PBomForwardReport.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/PBom/PBomForwardReport.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java index 89f8ed0b..a7a605e0 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomForwardReport.java @@ -515,7 +515,7 @@ public class PBomForwardReport extends BaseForwardReport { vo.setBomVersion(parentFormal.getCurrentVersion()); // vo.setDeviseName(parentFormal.getDeviseName()); // vo.setCreatedTime(parentFormal.getCreatedTime()); - vo.setExpireEndTime(parentFormal.getReleaseTime()); + // vo.setExpireEndTime(parentFormal.getReleaseTime()); } nodesList.addAll(nodeList);