Merge remote-tracking branch 'origin/master-toPbom-lhj1113'
This commit is contained in:
commit
888a222c71
|
|
@ -124,6 +124,13 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
|
|
||||||
Integer getSapErrorNum(String userCode);
|
Integer getSapErrorNum(String userCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常数量与ebom统计列表一致
|
||||||
|
* @param userCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getSapErrorNum2(String userCode);
|
||||||
|
|
||||||
List<BomNewEbomParentEntity> getLatestByMaterialNo(Collection<String> materialNos);
|
List<BomNewEbomParentEntity> getLatestByMaterialNo(Collection<String> materialNos);
|
||||||
@Deprecated
|
@Deprecated
|
||||||
void updateLastVersionIs();
|
void updateLastVersionIs();
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,13 @@ public interface BomNewPbomParentMapper extends BaseMapper<BomNewPbomParentEntit
|
||||||
|
|
||||||
Integer getSapErrorNum(String userCode);
|
Integer getSapErrorNum(String userCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计SAP异常数量,统计口径与PBOM正式表一致
|
||||||
|
* @param userCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getSapErrorNum2(String userCode);
|
||||||
|
|
||||||
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
|
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -983,6 +983,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
//31 码 须有虚拟包
|
//31 码 须有虚拟包
|
||||||
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
||||||
|
|
||||||
|
String factory = userRoleService.getUserFactory();
|
||||||
|
|
||||||
parents.forEach(p -> {
|
parents.forEach(p -> {
|
||||||
if (p.getMaterialNo().startsWith("31")) {
|
if (p.getMaterialNo().startsWith("31")) {
|
||||||
List<String> errors = new ArrayList<>();
|
List<String> errors = new ArrayList<>();
|
||||||
|
|
@ -1014,6 +1016,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
eBomToPBom.convert();
|
eBomToPBom.convert();
|
||||||
//【电控系统】 发货包优化 删除 【直发】【制作】、下的物料 by 10002327 240914
|
//【电控系统】 发货包优化 删除 【直发】【制作】、下的物料 by 10002327 240914
|
||||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
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 父级的数据
|
//1、删掉pbom 父级的数据
|
||||||
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
|
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
|
||||||
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
|
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
|
||||||
|
|
@ -1177,6 +1185,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
//31 码 须有虚拟包
|
//31 码 须有虚拟包
|
||||||
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
List<BomNewEbomParentEntity> parents = this.getBaseMapper().selectBatchIds(paramDto.getBomRowIds());
|
||||||
|
|
||||||
|
String factory = userRoleService.getUserFactory();
|
||||||
|
|
||||||
parents.forEach(p -> {
|
parents.forEach(p -> {
|
||||||
if (p.getMaterialNo().startsWith("31")) {
|
if (p.getMaterialNo().startsWith("31")) {
|
||||||
List<String> errors = new ArrayList<>();
|
List<String> errors = new ArrayList<>();
|
||||||
|
|
@ -1222,6 +1232,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
//【电控系统】 发货包优化 删除 【直发】【制作】、下的物料 by 10002327 240914
|
//【电控系统】 发货包优化 删除 【直发】【制作】、下的物料 by 10002327 240914
|
||||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
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 父级的数据
|
//1、删掉pbom 父级的数据
|
||||||
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
|
List<BomNewPbomParentEntity> pbomParent = eBomToPBom.getPBomParentResult().stream().filter(p -> (p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("直发")) ||
|
||||||
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
|
(p.getMaterialDesc().contains("电控系统") && p.getMaterialDesc().contains("制作"))).collect(Collectors.toList());
|
||||||
|
|
@ -3173,7 +3189,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
public Integer getSapErrorNum() {
|
public Integer getSapErrorNum() {
|
||||||
//return bomNewSapErrorMsgService.lambdaQuery().eq(BomNewSapErrorMsgEntity::getType, 0).count();
|
//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) {
|
public List<OperationErrorMsgVO> getSapError(Long rowId) {
|
||||||
|
|
|
||||||
|
|
@ -1968,7 +1968,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getSapErrorNum() {
|
public Integer getSapErrorNum() {
|
||||||
return this.getBaseMapper().getSapErrorNum(SessionUtil.getUserCode());
|
return this.getBaseMapper().getSapErrorNum2(SessionUtil.getUserCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OperationErrorMsgVO> getSapError(Long rowId) {
|
public List<OperationErrorMsgVO> getSapError(Long rowId) {
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,10 @@ public abstract class EBomToPbomBase {
|
||||||
if(StrUtil.isNotBlank(parentVo.getEbomVersion())){
|
if(StrUtil.isNotBlank(parentVo.getEbomVersion())){
|
||||||
oldParent.setCurrentVersion(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);
|
this.pBomParentResult.add(oldParent);
|
||||||
return oldParent;
|
return oldParent;
|
||||||
}
|
}
|
||||||
|
|
@ -354,10 +358,18 @@ public abstract class EBomToPbomBase {
|
||||||
if(StrUtil.isNotBlank(parentVo.getEbomVersion()) ){
|
if(StrUtil.isNotBlank(parentVo.getEbomVersion()) ){
|
||||||
pBomParent.setCurrentVersion(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)) {
|
if (Objects.nonNull(oldParent)) {
|
||||||
oldParent.setExpireEndTime(LocalDateTime.now());
|
oldParent.setExpireEndTime(LocalDateTime.now());
|
||||||
oldParent.setLastVersionIs(0);
|
oldParent.setLastVersionIs(0);
|
||||||
|
|
||||||
|
oldParent.setOrderNumber(null);
|
||||||
|
oldParent.setProjectType(null);
|
||||||
|
oldParent.setNum(new BigDecimal(1));
|
||||||
this.pBomParentResult.add(oldParent);
|
this.pBomParentResult.add(oldParent);
|
||||||
}
|
}
|
||||||
this.pBomParentResult.add(pBomParent);
|
this.pBomParentResult.add(pBomParent);
|
||||||
|
|
|
||||||
|
|
@ -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
|
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}
|
WHERE p.created_by = #{userCode}
|
||||||
</select>
|
</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 id="getLatestByMaterialNo" resultType="com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity">
|
||||||
SELECT p1.*
|
SELECT p1.*
|
||||||
|
|
|
||||||
|
|
@ -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
|
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}
|
WHERE p.created_by = #{userCode}
|
||||||
</select>
|
</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 id="getReverseBoms" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO">
|
||||||
SELECT IFNULL(IFNULL(c.num, p.num), 1) AS num,
|
SELECT IFNULL(IFNULL(c.num, p.num), 1) AS num,
|
||||||
c.project_type projectType,
|
c.project_type projectType,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue