Merge remote-tracking branch 'origin/master-toPbom-lhj1113'

This commit is contained in:
10001392 2024-11-14 17:39:10 +08:00
commit 888a222c71
7 changed files with 58 additions and 2 deletions

View File

@ -124,6 +124,13 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
Integer getSapErrorNum(String userCode);
/**
* 异常数量与ebom统计列表一致
* @param userCode
* @return
*/
Integer getSapErrorNum2(String userCode);
List<BomNewEbomParentEntity> getLatestByMaterialNo(Collection<String> materialNos);
@Deprecated
void updateLastVersionIs();

View File

@ -79,6 +79,13 @@ public interface BomNewPbomParentMapper extends BaseMapper<BomNewPbomParentEntit
Integer getSapErrorNum(String userCode);
/**
* 统计SAP异常数量统计口径与PBOM正式表一致
* @param userCode
* @return
*/
Integer getSapErrorNum2(String userCode);
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
/**

View File

@ -983,6 +983,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//31 须有虚拟包
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
String factory = userRoleService.getUserFactory();
parents.forEach(p -> {
if (p.getMaterialNo().startsWith("31")) {
List<String> errors = new ArrayList<>();
@ -1014,6 +1016,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
eBomToPBom.convert();
//电控系统 发货包优化 删除 直发制作下的物料 by 10002327 240914
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
//当前登录人为仙桃用户时不生成1010的bom 10002327 241113
if(Objects.equals("1020",factory)){
eBomToPBom.getPBomParentResult().removeAll(eBomToPBom.getPBomParentResult().stream().filter(bom -> Objects.equals("1010",bom.getFacCode())).collect(Collectors.toList()));
eBomToPBom.getPBomChildResult().removeAll(eBomToPBom.getPBomChildResult().stream().filter(bom -> Objects.equals("1010",bom.getFacCode())).collect(Collectors.toList()));
}
//1删掉pbom 父级的数据
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
@ -1177,6 +1185,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//31 须有虚拟包
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
String factory = userRoleService.getUserFactory();
parents.forEach(p -> {
if (p.getMaterialNo().startsWith("31")) {
List<String> errors = new ArrayList<>();
@ -1222,6 +1232,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}
//电控系统 发货包优化 删除 直发制作下的物料 by 10002327 240914
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
//当前登录人为仙桃用户时不生成1010的bom 10002327 241113
if(Objects.equals("1020",factory)){
eBomToPBom.getPBomParentResult().removeAll(eBomToPBom.getPBomParentResult().stream().filter(bom -> Objects.equals("1010",bom.getFacCode())).collect(Collectors.toList()));
eBomToPBom.getPBomChildResult().removeAll(eBomToPBom.getPBomChildResult().stream().filter(bom -> Objects.equals("1010",bom.getFacCode())).collect(Collectors.toList()));
}
//1删掉pbom 父级的数据
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
@ -3173,7 +3189,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
public Integer getSapErrorNum() {
//return bomNewSapErrorMsgService.lambdaQuery().eq(BomNewSapErrorMsgEntity::getType, 0).count();
return this.getBaseMapper().getSapErrorNum(SessionUtil.getUserCode());
return this.getBaseMapper().getSapErrorNum2(SessionUtil.getUserCode());
}
public List<OperationErrorMsgVO> getSapError(Long rowId) {

View File

@ -1968,7 +1968,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
}
public Integer getSapErrorNum() {
return this.getBaseMapper().getSapErrorNum(SessionUtil.getUserCode());
return this.getBaseMapper().getSapErrorNum2(SessionUtil.getUserCode());
}
public List<OperationErrorMsgVO> getSapError(Long rowId) {

View File

@ -209,6 +209,10 @@ public abstract class EBomToPbomBase {
if(StrUtil.isNotBlank(parentVo.getEbomVersion())){
oldParent.setCurrentVersion(parentVo.getEbomVersion());
}
//父级BOM 不应有该序号和项目类别都是空值数量肯定是1 by 10002327 241113
oldParent.setOrderNumber(null);
oldParent.setProjectType(null);
oldParent.setNum(new BigDecimal(1));
this.pBomParentResult.add(oldParent);
return oldParent;
}
@ -354,10 +358,18 @@ public abstract class EBomToPbomBase {
if(StrUtil.isNotBlank(parentVo.getEbomVersion()) ){
pBomParent.setCurrentVersion(parentVo.getEbomVersion());
}
//父级BOM 不应有该序号和项目类别都是空值数量肯定是1 by 10002327 241113
pBomParent.setOrderNumber(null);
pBomParent.setProjectType(null);
pBomParent.setNum(new BigDecimal(1));
if (Objects.nonNull(oldParent)) {
oldParent.setExpireEndTime(LocalDateTime.now());
oldParent.setLastVersionIs(0);
oldParent.setOrderNumber(null);
oldParent.setProjectType(null);
oldParent.setNum(new BigDecimal(1));
this.pBomParentResult.add(oldParent);
}
this.pBomParentResult.add(pBomParent);

View File

@ -609,6 +609,13 @@
INNER JOIN t_bom_new_sap_error_msg e ON p.row_id = e.target_row_id AND e.type = 0
WHERE p.created_by = #{userCode}
</select>
<select id="getSapErrorNum2" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM t_bom_new_ebom_parent
WHERE status = 4
AND sap_state > 3
AND created_by = #{userCode}
</select>
<select id="getLatestByMaterialNo" resultType="com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity">
SELECT p1.*

View File

@ -303,6 +303,13 @@
INNER JOIN t_bom_new_sap_error_msg e ON p.row_id = e.target_row_id AND e.type = 1
WHERE p.created_by = #{userCode}
</select>
<select id="getSapErrorNum2" resultType="java.lang.Integer">
SELECT COUNT(1)
FROM t_bom_new_pbom_parent
WHERE status >= 4
AND sap_state > 3
AND created_by = #{userCode}
</select>
<select id="getReverseBoms" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO">
SELECT IFNULL(IFNULL(c.num, p.num), 1) AS num,
c.project_type projectType,