diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/mapper/master/MaterialMainMapper.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/mapper/master/MaterialMainMapper.java index 50c35673..b4efc05b 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/mapper/master/MaterialMainMapper.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/mapper/master/MaterialMainMapper.java @@ -7,6 +7,7 @@ import com.nflg.product.material.pojo.dto.MaterialPurchseExcelDTO; import com.nflg.product.material.pojo.dto.IniFileDTO; import com.nflg.product.material.pojo.dto.MaterialMainAddAttrParamDTO; import com.nflg.product.material.pojo.dto.UpOaProcessStateMaterialDTO; +import com.nflg.product.material.pojo.entity.LanguageTranslationEntity; import com.nflg.product.material.pojo.entity.MaterialMainEntity; import com.nflg.product.material.pojo.query.MaterialMainQuery; import com.nflg.product.material.pojo.vo.CategoryQueryVO; @@ -75,4 +76,6 @@ public interface MaterialMainMapper extends BaseMapper { MaterialMainEntity selectByMaterialNoAndRelCategoryCode(@Param("materialNo") String materialNo, @Param("list") List list); void updateBatch(@Param("result") List result); + + List getKeyLanguage(@Param("languageCode")String languageCode); } diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/LanguageTranslationEntity.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/LanguageTranslationEntity.java new file mode 100644 index 00000000..619f2d7c --- /dev/null +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/entity/LanguageTranslationEntity.java @@ -0,0 +1,55 @@ +package com.nflg.product.material.pojo.entity; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import lombok.Data; +import lombok.experimental.Accessors; +import java.time.LocalDateTime; +import java.time.LocalDate; + +/** + * t_language_translation + * 多语言 + * + * @author makejava + * @since 2024-03-07 18:16:17 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="com-nflg-product-material-pojo-translation-entity-LanguageTranslationEntity") +@TableName(value = "t_language_translation") +public class LanguageTranslationEntity implements Serializable { + + /** + * 主键行ID + */ + @TableId(value = "row_id", type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键行ID") + private Long rowId; + + /** + * 关键子,字段名等 + */ + @TableField(value = "key_name") + @ApiModelProperty(value = "关键子,字段名等") + private String keyName; + + /** + * 语言编码 + */ + @TableField(value = "language_code") + @ApiModelProperty(value = "语言编码") + private String languageCode; + + /** + * 译文 + */ + @TableField(value = "translation_text") + @ApiModelProperty(value = "译文") + private String translationText; + + private static final long serialVersionUID = 233678426416904026L; + +} 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 22c51f64..5baa1040 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 @@ -394,10 +394,18 @@ public class MaterialMainService extends ServiceImpl getTbHeader(MaterialCategoryEntity categoryEntity, Integer materialClass, List childList) { + private List getTbHeader(MaterialCategoryEntity categoryEntity, Integer + materialClass, List childList) { long Date10 = new Date().getTime(); log.info("[计算耗时][getTbHeader]================================" + Date10 ); + //多语言(没有则获取中午) + List keyLanguage = this.getBaseMapper().getKeyLanguage(SessionUtil.getLanguage()); + if(CollUtil.isNotEmpty(keyLanguage)){ + + } + + LinkedList thHeaderList = new LinkedList(); String categoryCode = null; diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/LanguageUtil.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/LanguageUtil.java new file mode 100644 index 00000000..3eb07584 --- /dev/null +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/util/LanguageUtil.java @@ -0,0 +1,34 @@ +package com.nflg.product.material.util; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.extra.spring.SpringUtil; +import com.nflg.product.base.core.conmon.util.SessionUtil; +import com.nflg.product.material.pojo.entity.LanguageTranslationEntity; +import com.nflg.product.material.service.MaterialMainService; +import nflg.product.common.dto.LoginUserInfoDTO; + +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class LanguageUtil { + + private final String zhLanguage="zh-cn"; + + private Map translationMap; + + public LanguageUtil() { + List keyLanguage = SpringUtil.getBean(MaterialMainService.class).getBaseMapper().getKeyLanguage(SessionUtil.getLanguage()); + + if(CollUtil.isEmpty(keyLanguage)){ + keyLanguage = SpringUtil.getBean(MaterialMainService.class).getBaseMapper().getKeyLanguage(zhLanguage); + } + translationMap=ListCommonUtil.listToMap(keyLanguage,LanguageTranslationEntity::getKeyName); + } + + public String getTranslationTextByKeyName(String keyName){ + + return translationMap.containsKey(keyName)? translationMap.get(keyName).getTranslationText():""; + } +} 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 1f9d473f..33534fd3 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 @@ -520,4 +520,8 @@ WHERE material_no = #{item.materialNo} + + diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/BomnewApplication.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/BomnewApplication.java index ab7f98c6..a4435c1a 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/BomnewApplication.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/BomnewApplication.java @@ -21,7 +21,7 @@ import java.util.TimeZone; @EnableDiscoveryClient @EnableScheduling @EnableFeignClients -@EnableLogRecord(tenant = "com.nflg") +@EnableLogRecord(tenant = "BOM") public class BomnewApplication { public static void main(String[] args) { diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/BomNewLogApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/BomNewLogApi.java new file mode 100644 index 00000000..15908bc1 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/BomNewLogApi.java @@ -0,0 +1,50 @@ +package com.nflg.product.bomnew.api.user; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.nflg.product.base.core.api.BaseApi; +import com.nflg.product.bomnew.pojo.entity.BomNewLogEntity; +import com.nflg.product.bomnew.pojo.query.BomNewLogQuery; +import com.nflg.product.bomnew.service.BomNewLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import nflg.product.common.vo.ResultVO; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * t_bom_new_log 表控制层 + * + * + * @author makejava + * @since 2024-03-06 08:30:00 + */ +@Api(tags = "日志") +@RestController +@RequestMapping("bomNewLogEntity") +public class BomNewLogApi extends BaseApi { + + /** + * 服务对象 + */ + @Resource + private BomNewLogService bomNewLogService; + + /** + * 分页查询所有数据 + * + * @param query Query 查询实体 + * @return 所有数据 + */ + @PostMapping("getListByPage") + @ApiOperation("auto-获取日志") + public ResultVO> selectBomNewLogEntityPageByCondition(@RequestBody BomNewLogQuery query) { + return ResultVO.success(bomNewLogService.getListByPage(query)); + } + + + + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java index 302f2ab9..65e6a989 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java @@ -199,7 +199,7 @@ public class PBomApi extends BaseApi { @PostMapping("getAllocationFactoryBom") @ApiOperation("分工厂-获取BOM树") public ResultVO > getAllocationFactoryBom(@Valid @RequestBody AllocationFactoryBomQuery param ) throws ExecutionException, InterruptedException { - return ResultVO.success(bomNewPbomParentService.getAllocationFactoryBom(param)); + return ResultVO.success(bomNewPbomParentService.getAllocationFactoryBomTree(param)); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/VirtualPackageTypeEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/VirtualPackageTypeEnum.java index b331bc83..c6b63192 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/VirtualPackageTypeEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/VirtualPackageTypeEnum.java @@ -13,7 +13,7 @@ public enum VirtualPackageTypeEnum implements ValueEnum{ DELIVERY_PACKAGE(1,"发货包","发货" ,"201101", ""), MAKING_PACKAGE(2,"制作包","制作","201101",""), DIRECT_DELIVERY_PACKAGE(4,"直发包","直发","201101","F"), - PRE_ASSEMBLY_PACKAGE(8,"发货前装配包","发货前装配","201201","Z"); + PRE_ASSEMBLY_PACKAGE(8,"发货前装配包","发货前装配","200601","Z"); private final Integer value; private final String description; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java index ae6a654d..051e0840 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewEbomParentMapper.java @@ -63,4 +63,8 @@ public interface BomNewEbomParentMapper extends BaseMapper rowIds); void updateStateBatchByRowIds(@Param("status") Integer status, @Param("list") List list ); + + Integer checkIsRoot(@Param("materialNo") String materialNo); + + Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewLogMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewLogMapper.java index 27f5c6b7..4d54a52d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewLogMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewLogMapper.java @@ -1,8 +1,10 @@ package com.nflg.product.bomnew.mapper.master; -import org.apache.ibatis.annotations.Mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.nflg.product.bomnew.pojo.entity.BomNewLogEntity; +import com.nflg.product.bomnew.pojo.query.BomNewLogQuery; +import org.apache.ibatis.annotations.Param; /** * t_bom_new_log 表数据库访问层 @@ -12,4 +14,6 @@ import com.nflg.product.bomnew.pojo.entity.BomNewLogEntity; * @since 2024-03-01 17:10:57 */ public interface BomNewLogMapper extends BaseMapper { + + Page getListByPage(Page page , @Param("query") BomNewLogQuery query); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewMbomParentMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewMbomParentMapper.java index 5715c0c4..38d90fe4 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewMbomParentMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewMbomParentMapper.java @@ -48,6 +48,11 @@ public interface BomNewMbomParentMapper extends BaseMapper getChildForMaterialNoSeach(@Param("userFac") String userFac,@Param("materialNoList") List materialNoList,@Param("materialNo")String materialNo); + + Integer checkIsRoot(@Param("materialNo")String materialNo); + + Integer checkIsUserRoot(@Param("materialNo") String materialNo, @Param("jobNo") String jobNo); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewLogEntity.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewLogEntity.java index 3cd626d4..cda8da83 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewLogEntity.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewLogEntity.java @@ -15,7 +15,7 @@ import java.time.LocalDate; * * * @author makejava - * @since 2024-03-01 17:10:57 + * @since 2024-03-06 08:31:13 */ @Data @Accessors(chain = true) @@ -31,10 +31,17 @@ public class BomNewLogEntity implements Serializable { private Long rowId; /** - * 操作行ID + * 模块名称 + */ + @TableField(value = "model_name") + @ApiModelProperty(value = "模块名称") + private String modelName; + + /** + * 操作行标识-对应bizNo */ @TableField(value = "op_biz_no") - @ApiModelProperty(value = "操作行标识") + @ApiModelProperty(value = "操作行标识-对应bizNo") private String opBizNo; /** @@ -78,14 +85,14 @@ public class BomNewLogEntity implements Serializable { @TableField(value = "op_time") @ApiModelProperty(value = "操作时间") private LocalDateTime opTime; - + /** * 部门名称 */ - @TableField(value = "dpt_name") - @ApiModelProperty(value = "部门名称") - private String dptName; + @TableField(value = "dpt_name") + @ApiModelProperty(value = "部门名称") + private String dptName; - private static final long serialVersionUID = -52831510327211450L; + private static final long serialVersionUID = -56481813751074622L; } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/query/BomNewLogQuery.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/query/BomNewLogQuery.java new file mode 100644 index 00000000..360eca05 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/query/BomNewLogQuery.java @@ -0,0 +1,61 @@ +package com.nflg.product.bomnew.pojo.query; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * t_bom_new_log + * + * + * @author makejava + * @since 2024-03-06 08:30:05 + */ +@Data +@Accessors(chain = true) +@ApiModel(value="com-nflg-product-bomnew-pojo-new-query-BomNewLogEntityQuery") +public class BomNewLogQuery implements Serializable { + + /** + * 模块名称 + */ + @ApiModelProperty(value = "模块名称") + private String modelName; + + @ApiModelProperty(value = "操作动作") + private String opAction; + + + @ApiModelProperty(value = "操作人名称") + private String opUserName; + + + @ApiModelProperty(value = "操作人工号") + private String opUserJobNo; + + @ApiModelProperty(value = "操作时间开始时间") + private String startDate; + + /** + * 结束操作时间 + */ + @ApiModelProperty(value = "操作时间结束时间") + private LocalDateTime endDate; + /** + * 设置每页显示条数 + */ + @ApiModelProperty(value = "设置每页显示条数") + private Long pageSize = 20L; + + /** + * 当前页 + */ + @ApiModelProperty(value = "当前页") + private Long page = 1L; + + private static final long serialVersionUID = 1L; +} 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 78d27848..636f0113 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 @@ -132,7 +132,7 @@ public class BomNewEbomParentService extends ServiceImpl data = getBomTree(bomRowId); BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(bomRowId)); - LogRecordContext.putVariable("bom",parent); + LogRecordContext.putVariable("bom", parent); //初始化物料信息 materialMainService.intiMaterialInfo(data); productTypeInitDo(parent, data); @@ -613,7 +613,7 @@ public class BomNewEbomParentService extends ServiceImpl list = getChild(root.getRowId()); List makeList = list.stream().filter(u -> VirtualPackageTypeEnum.MAKING_PACKAGE.equalsValue(u.getVirtualPartType())).collect(Collectors.toList()); if (CollUtil.isNotEmpty(makeList)) { - Integer virtualPartTypeEnum = VirtualPackageTypeEnum.MAKING_PACKAGE.getValue() | VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue(); + Integer virtualPartTypeEnum = VirtualPackageTypeEnum.MAKING_PACKAGE.getValue() | VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getValue(); List preList = ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, makeList.get(0).getBomRowId()) .eq(BomNewEbomChildEntity::getVirtualPartType, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()).list(); if (CollUtil.isNotEmpty(preList)) { @@ -636,14 +636,14 @@ public class BomNewEbomParentService extends ServiceImpl delSet = eBomToPBom.getVirtualPackageCompositionResult().stream().map(u -> StrUtil.join("-", u.getVirtualPackageMaterialNo(), u.getParentMaterialNo())).collect(Collectors.toSet()); @@ -738,14 +740,14 @@ public class BomNewEbomParentService extends ServiceImpl bomChildren=new ArrayList<>(); - bomTree.forEach(k->{ - BomNewEbomChildEntity entChild=new BomNewEbomChildEntity(); + List bomChildren = new ArrayList<>(); + bomTree.forEach(k -> { + BomNewEbomChildEntity entChild = new BomNewEbomChildEntity(); entChild.setRowId(k.getRowId()); entChild.setBomVersionRowId(k.getBomRowId()); bomChildren.add(entChild); }); - if(CollUtil.isNotEmpty(bomChildren)) { + if (CollUtil.isNotEmpty(bomChildren)) { ebomChildService.updateBatchById(bomChildren); } @@ -754,6 +756,18 @@ public class BomNewEbomParentService extends ServiceImpl0?0:1); + ebomParent.setUserRootIs(userRootIs>0?0:1); + this.updateById(ebomParent); + + + } + /** * 发起变更 * @@ -764,36 +778,42 @@ public class BomNewEbomParentService extends ServiceImpl list = this.lambdaQuery().in(BomNewEbomParentEntity::getRowId, paramDTO.getBomRowIds()).list(); List notConvertToPbom = list.stream().filter(u -> u.getStatus() < EBomStatusEnum.PUBLISHED.getValue()).map(u -> u.getMaterialNo()).collect(Collectors.toList()); VUtils.isTure(CollUtil.isNotEmpty(notConvertToPbom)).throwMessage(StrUtil.join(",", notConvertToPbom) + "未转PBom,不能发起变更"); + //检查是否存在发布前的版本,有则不能发起变更 + List materialNos = list.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); + List existEnt = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos).lt(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list(); + Set existMaterialNos = existEnt.stream().map(u -> u.getMaterialNo()).collect(Collectors.toSet()); + VUtils.isTure(CollUtil.isNotEmpty(existMaterialNos)).throwMessage(StrUtil.join(",", existMaterialNos, "存在发布前版本。")); List parentResult = new ArrayList<>(); List childResult = new ArrayList<>(); for (Long bomRowId : paramDTO.getBomRowIds()) { BomNewEbomParentEntity parent = this.getById(bomRowId); - LogRecordContext.putVariable("bom",parent); - List existEnt = this.lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, parent.getMaterialNo()).lt(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).list(); - //含发布前版本则无需升级 - if (CollUtil.isEmpty(existEnt)) { - List child = ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, bomRowId).list(); - BomNewEbomParentEntity newParent = new BomNewEbomParentEntity(); - BeanUtil.copyProperties(parent, newParent); - newParent.setRowId(IdWorker.getId()); - newParent.setLastVersionIs(1); - newParent.setCurrentVersion(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion())); - newParent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_11.getValue()); - newParent.setChangeDesc(paramDTO.getChangeDesc()); - newParent.setNoticeNums(paramDTO.getNoticeNums()); - newParent.setStatus(EBomStatusEnum.WAIT_CHECK.getValue()); - parent.setLastVersionIs(0); - parentResult.add(newParent); - parentResult.add(parent); - for (BomNewEbomChildEntity childEnt : child) { - BomNewEbomChildEntity newChild = new BomNewEbomChildEntity(); - BeanUtil.copyProperties(childEnt, newChild); - newChild.setRowId(IdWorker.getId()); - newChild.setParentRowId(newParent.getRowId()); - childResult.add(newChild); - } + LogRecordContext.putVariable("bom", parent); + + + List child = ebomChildService.lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, bomRowId).list(); + BomNewEbomParentEntity newParent = new BomNewEbomParentEntity(); + BeanUtil.copyProperties(parent, newParent); + newParent.setRowId(IdWorker.getId()); + newParent.setLastVersionIs(1); + newParent.setCurrentVersion(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion())); + newParent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_11.getValue()); + newParent.setChangeDesc(paramDTO.getChangeDesc()); + newParent.setNoticeNums(paramDTO.getNoticeNums()); + newParent.setStatus(EBomStatusEnum.WAIT_CHECK.getValue()); + newParent.setRootIs(1); + newParent.setUserRootIs(1); + parent.setLastVersionIs(0); + parentResult.add(newParent); + parentResult.add(parent); + for (BomNewEbomChildEntity childEnt : child) { + BomNewEbomChildEntity newChild = new BomNewEbomChildEntity(); + BeanUtil.copyProperties(childEnt, newChild); + newChild.setRowId(IdWorker.getId()); + newChild.setParentRowId(newParent.getRowId()); + childResult.add(newChild); } + } if (CollUtil.isNotEmpty(parentResult)) { @@ -1047,7 +1067,7 @@ public class BomNewEbomParentService extends ServiceImpl materialNoAndVersion = bomNewEbomParentEntityList.stream().map(u -> StrUtil.join("-", u.getMaterialNo(), u.getCurrentVersion())).collect(Collectors.toSet()); - LogRecordContext.putVariable("log",materialNoAndVersion); + LogRecordContext.putVariable("log", materialNoAndVersion); if (rowIds.size() != bomNewEbomParentEntityList.size()) { @@ -1154,7 +1174,7 @@ public class BomNewEbomParentService extends ServiceImpl materialNoAndVersion = bomNewEbomParentEntityList.stream().map(u -> StrUtil.join("-", u.getMaterialNo(), u.getCurrentVersion())).collect(Collectors.toSet()); - LogRecordContext.putVariable("log",materialNoAndVersion); + LogRecordContext.putVariable("log", materialNoAndVersion); if (rowIds.size() != bomNewEbomParentEntityList.size()) { VUtils.isTure(true).throwMessage("数据中包含有下级BOM无法进行复核"); @@ -1274,7 +1294,6 @@ public class BomNewEbomParentService extends ServiceImpl datas){ + private void superMaterialStatus(List datas) { - List superTagList=datas.stream().filter(item-> item.getSuperMaterialStatus()!=null - // && item.getSuperMaterialStatus().equals(EBomSuperMaterialStatusEnum.SUPER_MATERIAL_1.getValue()) - && item.getBomRowId()!=null && item.getBomRowId().longValue()>0 + List superTagList = datas.stream().filter(item -> item.getSuperMaterialStatus() != null + // && item.getSuperMaterialStatus().equals(EBomSuperMaterialStatusEnum.SUPER_MATERIAL_1.getValue()) + && item.getBomRowId() != null && item.getBomRowId().longValue() > 0 ).collect(Collectors.toList()); - List updateList=new ArrayList<>(); - for (BomNewEbomParentVO vo:superTagList){ - BomNewEbomParentEntity entity=new BomNewEbomParentEntity(); + List updateList = new ArrayList<>(); + for (BomNewEbomParentVO vo : superTagList) { + BomNewEbomParentEntity entity = new BomNewEbomParentEntity(); entity.setRowId(vo.getBomRowId()); entity.setSuperMaterialStatus(vo.getSuperMaterialStatus()); updateList.add(entity); } - if(CollectionUtil.isNotEmpty(updateList)){ - this.updateBatchById(updateList); - } + if (CollectionUtil.isNotEmpty(updateList)) { + this.updateBatchById(updateList); + } } @@ -1748,11 +1766,11 @@ public class BomNewEbomParentService extends ServiceImpl { + public IPage getListByPage(BomNewLogQuery query){ + Page page=new Page<>(query.getPage(),query.getPageSize()); + return this.getBaseMapper().getListByPage(page,query); + } + } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java index 964caca9..889830fb 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java @@ -592,12 +592,19 @@ public class BomNewPbomParentService extends ServiceImpl getAllocationFactoryBom(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException { - List allBom = getAllBom(param.getBomRowId(), 1); + public List getAllocationFactoryBomTree(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException { + List allBom = getAllBom(param.getBomRowId(), 0); materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); return CTreePBomUtils.toTree(param.getBomRowId(), allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId); } + public List getAllocationFactoryBom(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException { + List allBom = getAllBom(param.getBomRowId(), 1); + materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); + return allBom; + + } + @Transactional(rollbackFor = Exception.class) public Boolean saveAllocationFactory(List params) { @@ -616,17 +623,21 @@ public class BomNewPbomParentService extends ServiceImpl{ try { - List allBom = this.getAllBomTree(k.getBomRowId()); - List rowIds = allBom.stream().map(u -> u.getRowId()).collect(Collectors.toList()); + AllocationFactoryBomQuery query=new AllocationFactoryBomQuery(); + query.setBomRowId(k.getBomRowId()); + + List allBom = this.getAllocationFactoryBom(query); + List rowIds =new ArrayList<>(); + rowIds.add(k.getRowId()); + rowIds.addAll(allBom.stream().map(u -> u.getRowId()).collect(Collectors.toList())); if(CollUtil.isNotEmpty(rowIds)) { pbomChildService.getBaseMapper().setProductionFactoryCode(k.getProductionFactoryCode(), rowIds); } - } catch (ExecutionException e) { e.printStackTrace(); } catch (InterruptedException e) { @@ -885,6 +896,8 @@ public class BomNewPbomParentService extends ServiceImpl bomRowIds = allBom.stream().filter(u -> PBomStatusEnum.WAIT_PUBLISH.equalsValue(u.getStatus()) && u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); Integer state = (parent.getMaterialNo().startsWith("31") && parent.getFacCode().equals(EBomConstant.MAIN_FACTORY_CODE_1010)) ? PBomStatusEnum.WAIT_FACTORY.getValue() : PBomStatusEnum.PUBLISH.getValue(); @@ -913,6 +926,16 @@ public class BomNewPbomParentService extends ServiceImpl0?0:1); + parent.setUserRootIs(userRootIs>0?0:1); + this.updateById(parent); + + + } + private void importSap(BomNewPbomParentEntity parent, List children) { diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageBase.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageBase.java index ac2c8408..f391116d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageBase.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageBase.java @@ -80,11 +80,11 @@ public abstract class VirtualPackageBase { * @param virtualPackageTypeEnums * @return */ - protected void generateVMNoF21(String materialDesc, List child,VirtualPackageTypeEnum ... virtualPackageTypeEnums){ + protected void generateVMNoF21(String parentDrawingNo, List child,VirtualPackageTypeEnum ... virtualPackageTypeEnums){ List params=new ArrayList<>(); for ( BomNewEbomParentVO ch: child ) { for (VirtualPackageTypeEnum vpy : virtualPackageTypeEnums) { - String vDrawingNo = String.join("","(",materialDesc,")","(",vpy.getConMaterialName(),")" ); + String vDrawingNo = String.join("",parentDrawingNo,".FHQ","(",ch.getMaterialName(),")","(",vpy.getConMaterialName(),")"); params.add(buildAddMaterialParamDo(StrUtil.join("",ch.getRowId().toString(), vpy.getConMaterialName()), vDrawingNo, vDrawingNo, vpy)); } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor21.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor21.java index 0cc1f7e6..6b15d062 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor21.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor21.java @@ -1,16 +1,11 @@ package com.nflg.product.bomnew.service.domain.EBom; import cn.hutool.core.convert.Convert; -import cn.hutool.extra.spring.SpringUtil; import com.google.common.collect.ImmutableList; -import com.nflg.product.base.core.exception.NflgBusinessException; import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; -import com.nflg.product.bomnew.pojo.dto.AddVirtrualMaterialDTO; import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity; import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; -import com.nflg.product.bomnew.service.BomNewEbomParentService; -import nflg.product.common.constant.STATE; import java.io.IOException; import java.util.List; @@ -45,10 +40,10 @@ public class VirtualPackageFor21 extends VirtualPackageBase { BomNewEbomParentVO vo= Convert.convert(BomNewEbomParentVO.class,parent ); if(virtualPackageValue.contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()) && (parent.getVirtrualPackageEnum()| VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue())!=VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getValue()){ - generateVMNoF21(parent.getMaterialDesc(), ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); + generateVMNoF21(parent.getDrawingNo(), ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE,VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE); } else { - generateVMNoF21(parent.getMaterialDesc(),ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); + generateVMNoF21(parent.getDrawingNo(),ImmutableList.of(vo),VirtualPackageTypeEnum.MAKING_PACKAGE, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBomBase.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBomBase.java index 3644e8c4..905a92ea 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBomBase.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/ConvertToMBomBase.java @@ -77,21 +77,26 @@ public class ConvertToMBomBase { protected BomNewMbomParentEntity buildMBomParent(String facCode) { BomNewMbomParentEntity mBomParent = new BomNewMbomParentEntity(); BeanUtil.copyProperties(parent, mBomParent); - BomNewMbomParentEntity oldParent = SpringUtil.getBean(BomNewMbomParentService.class).lambdaQuery().eq(BomNewMbomParentEntity::getMaterialNo, parent.getMaterialNo()) - .eq(BomNewMbomParentEntity::getLastVersionIs, 1).eq(BomNewMbomParentEntity::getFacCode, facCode).one(); + BomNewMbomParentEntity oldParent = SpringUtil.getBean(BomNewMbomParentService.class).lambdaQuery().eq(BomNewMbomParentEntity::getMaterialNo, parent.getMaterialNo()).eq(BomNewMbomParentEntity::getFacCode, facCode) + .last(" order by current_version desc limit 1").one(); if (Objects.nonNull(oldParent)) { if (MBomConstantEnum.MBomStatusEnum.PUB_SAP.equalsValue(oldParent.getStatus())) { + //将数据迁移到历史表 + SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper().insertMBomIntoHistory(oldParent.getRowId()); - mBomParent.setCurrentVersion(VersionUtil.getNextVersion(oldParent.getCurrentVersion())); - oldParent.setLastVersionIs(0); - this.mBomParentResult.add(oldParent); + mBomParent.setCurrentVersion(VersionUtil.getMBomNextVersion(oldParent.getCurrentVersion())); + + SpringUtil.getBean(BomNewMbomDetailService.class).getBaseMapper().deleteByMap(ImmutableMap.of("bom_row_id", oldParent.getRowId())); + SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper().deleteById(oldParent.getRowId()); +// oldParent.setLastVersionIs(0); +// this.mBomParentResult.add(oldParent); } else { SpringUtil.getBean(BomNewMbomDetailService.class).getBaseMapper().deleteByMap(ImmutableMap.of("bom_row_id", oldParent.getRowId())); SpringUtil.getBean(BomNewMbomParentService.class).getBaseMapper().deleteById(oldParent.getRowId()); mBomParent.setCurrentVersion(oldParent.getCurrentVersion()); } } else { - mBomParent.setCurrentVersion(VersionUtil.getNextVersion("")); + mBomParent.setCurrentVersion(VersionUtil.getMBomNextVersion("")); } mBomParent.setRowId(IdWorker.getId()); mBomParent.setFacCode(facCode); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomUpgrade.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomUpgrade.java index bceb172c..61f984d5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomUpgrade.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/PBom/PBomUpgrade.java @@ -1,13 +1,17 @@ package com.nflg.product.bomnew.service.domain.PBom; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; +import cn.hutool.extra.spring.SpringUtil; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.nflg.product.base.core.conmon.util.SessionUtil; import com.nflg.product.bomnew.constant.PBomStatusEnum; import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity; import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO; +import com.nflg.product.bomnew.service.BomNewPbomParentService; +import com.nflg.product.bomnew.util.VUtils; import com.nflg.product.bomnew.util.VersionUtil; import lombok.Getter; @@ -15,12 +19,14 @@ import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; +import com.nflg.product.bomnew.util.ListCommonUtil; + /** * 升级变更 */ public class PBomUpgrade { - private BomNewPbomParentEntity root; + private BomNewPbomParentEntity root; private List allBom; @@ -31,44 +37,66 @@ public class PBomUpgrade { private List childResult; - public PBomUpgrade (BomNewPbomParentEntity root,List allBom) { + public PBomUpgrade(BomNewPbomParentEntity root, List allBom) { this.root = root; this.allBom = allBom; - BomNewPbomParentVO rootVo = Convert.convert(BomNewPbomParentVO.class, root); - rootVo.setBomRowId(rootVo.getRowId()); - allBom.add(rootVo); + + //allBom.add(rootVo); } - public void upgrade(){ + public void upgrade() { // - for (BomNewPbomParentVO parentEnt :allBom) { - if( parentEnt.getStatus()>=PBomStatusEnum.PUBLISH.getValue()) { - buildParent(parentEnt); - } + check(); + //处理根节点 + BomNewPbomParentVO rootVo = Convert.convert(BomNewPbomParentVO.class, root); + rootVo.setBomRowId(rootVo.getRowId()); + + buildParent(rootVo,true); + + List parents = allBom.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList()); + List distinctParents = ListCommonUtil.toDistinct(parents, BomNewPbomParentVO::getBomRowId); + for (BomNewPbomParentVO parentEnt : distinctParents) { + if (parentEnt.getStatus() >= PBomStatusEnum.PUBLISH.getValue()) { + buildParent(parentEnt,false); + } } } - private void buildParent(BomNewPbomParentVO parentVO){ - BomNewPbomParentEntity pbomParent=new BomNewPbomParentEntity(); - BeanUtil.copyProperties(parentVO,pbomParent); + /** + * 父表-不能有待发布的Pbom + */ + private void check() { + List waitPublishList = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, root.getMaterialNo()) + .eq(BomNewPbomParentEntity::getFacCode, root.getMaterialNo()) + .lt(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue()).list(); + VUtils.isTure(CollUtil.isNotEmpty(waitPublishList)).throwMessage(root.getMaterialNo() + "存在待发布的版本,无法升级"); + } + + private void buildParent(BomNewPbomParentVO parentVO, boolean rootIs) { + BomNewPbomParentEntity pbomParent = new BomNewPbomParentEntity(); + BeanUtil.copyProperties(parentVO, pbomParent); pbomParent.setRowId(IdWorker.getId()); pbomParent.setCreatedTime(LocalDateTime.now()); pbomParent.setCreatedBy(SessionUtil.getRealName()); pbomParent.setModifyTime(LocalDateTime.now()); pbomParent.setStatus(PBomStatusEnum.WAIT_PUBLISH.getValue()); pbomParent.setCurrentVersion(VersionUtil.getNextVersion(parentVO.getCurrentVersion())); + if (rootIs) { + pbomParent.setRootIs(1); + pbomParent.setUserRootIs(1); + } this.parentResult.add(pbomParent); - buildChild(parentVO,pbomParent); + buildChild(parentVO, pbomParent); } - private void buildChild(BomNewPbomParentVO oldParent, BomNewPbomParentEntity newParent){ + private void buildChild(BomNewPbomParentVO oldParent, BomNewPbomParentEntity newParent) { List chilren = allBom.stream().filter(u -> u.getParentRowId().equals(oldParent.getBomRowId())).collect(Collectors.toList()); for (BomNewPbomParentVO childVO : chilren) { - BomNewPbomChildEntity child=new BomNewPbomChildEntity(); - BeanUtil.copyProperties(childVO,child); + BomNewPbomChildEntity child = new BomNewPbomChildEntity(); + BeanUtil.copyProperties(childVO, child); child.setRowId(IdWorker.getId()); child.setParentRowId(newParent.getRowId()); child.setCreatedTime(LocalDateTime.now()); @@ -82,5 +110,4 @@ public class PBomUpgrade { } - } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/log/DbLogRecordServiceImpl.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/log/DbLogRecordServiceImpl.java index 0c607ffc..0ebf58a3 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/log/DbLogRecordServiceImpl.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/log/DbLogRecordServiceImpl.java @@ -22,6 +22,7 @@ public class DbLogRecordServiceImpl implements ILogRecordService { BomNewLogEntity logEnt=new BomNewLogEntity(); logEnt.setRowId(IdWorker.getId()); + logEnt.setModelName(logRecord.getTenant()); logEnt.setOpBizNo(logRecord.getBizNo()); logEnt.setOpAction(logRecord.getType()); logEnt.setOpContent(logRecord.getAction()); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/VersionUtil.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/VersionUtil.java index c09d32be..40b9c2fe 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/VersionUtil.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/util/VersionUtil.java @@ -19,6 +19,8 @@ public class VersionUtil { static final String versionPrefix = "A"; + static final String mBomVersionPrefix = "B"; + /** * 获取下一个版本号(大版本) */ @@ -32,6 +34,15 @@ public class VersionUtil { } + public static String getMBomNextVersion(String preVersion) { + if (StrUtil.isBlank(preVersion)) { + return mBomVersionPrefix + "00"; + } + + Integer versionNum = Convert.toInt(StrUtil.replace(preVersion, mBomVersionPrefix, "")) + 1; + return mBomVersionPrefix + StrUtil.padPre(versionNum.toString(), 2, '0'); + } + /** * 获取下一个小版本号(小版本) */ 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 432eeea8..8c3537aa 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 @@ -95,7 +95,7 @@ select if(c.status=4,99,c.status) as status ,c.current_version , c.created_by as bomCreatedBy ,c.devise_name,c.devise_user_code,c.dept_name , - c.source, c.row_id as bomRowId, c.row_id as childBomRowId, b.* + c.source, if(c.row_id is null,0,c.row_id) as bomRowId, c.row_id as childBomRowId, b.* from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id =b.parent_row_id left join t_bom_new_ebom_parent c on b.material_no=c.material_no and c.last_version_is=1 - where a.last_version_is=1 and ( b.material_no in + where a.last_version_is=1 and a.status < 4 and ( b.material_no in #{item} @@ -215,4 +215,17 @@ #{item} + + + + + + + diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewLogMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewLogMapper.xml index 14a69140..43b6749b 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewLogMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewLogMapper.xml @@ -6,18 +6,42 @@ - + + - + - row_id, op_biz_no, op_action, op_content, op_content_ext, op_user_job_no, op_user_name, op_time ,dpt_name - + row_id, model_name, op_biz_no, op_action, op_content, op_content_ext, op_user_job_no, op_user_name, op_time, dpt_name + + + + and model_name like concat('%',#{query.modelName},'%') + + + and op_action like concat('%',#{query.opAction},'%') + + + and op_user_name =#{query.opUserName} + + + and op_user_job_no =#{query.opUserJobNo} + + + and op_time >= #{query.startDate} and op_time <= #{query.endDate} + + + + diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml index 7e141eea..5133a16b 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewMbomParentMapper.xml @@ -187,5 +187,16 @@ + + + INSERT INTO `nflg`.`t_bom_new_mbom_parent_history` (`row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`) + select `row_id`, `batch_no`, `drawing_no`, `fac_code`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `last_version_is`, `status`, `sysn_sap_user_name`, `sysn_sap_time`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time` from t_bom_new_mbom_parent where row_id=#{rowId}; + + + INSERT INTO `nflg`.`t_bom_new_mbom_detail_history` (`row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type`) + + select `row_id`, `bom_row_id`, `parent_row_id`, `drawing_no`, `fac_code`, `material_no`, `current_version`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `unit_weight`, `total_weight`, `num`, `project_type`, `super_material_status`, `virtual_part_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `material_back_status`, `virtual_part_type` from t_bom_new_mbom_detail where bom_row_id=#{rowId}; + + diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml index 8e95ac9d..bc306783 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml @@ -173,7 +173,7 @@ + + + + + + diff --git a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java index 755fd8c5..7b60cd73 100644 --- a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java +++ b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java @@ -85,7 +85,7 @@ public class SessionUtil { } public static String getLanguage() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getLanguage).orElse(null); + return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getLanguage).orElse(""); } public static String getSessionKey() {