Merge remote-tracking branch 'origin/feature/DM/nflg-bom-transition' into feature/DM/nflg-bom-transition
This commit is contained in:
commit
f199cc4c84
|
|
@ -356,7 +356,7 @@ public class MaterialSubmitService {
|
||||||
list.add(material);
|
list.add(material);
|
||||||
});
|
});
|
||||||
result.put("List", list);
|
result.put("List", list);
|
||||||
log.error("物料申请-JSON:" + JSONArray.toJSONString(list));
|
log.error("物料申请-JSON:" + JSONArray.toJSONString(result));
|
||||||
HttpUtils httpUtils = new HttpUtils(timeout);
|
HttpUtils httpUtils = new HttpUtils(timeout);
|
||||||
try {
|
try {
|
||||||
String url = NacosConfig.getNacosConfig().getOaUrl();
|
String url = NacosConfig.getNacosConfig().getOaUrl();
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ public class OriginalBomApi extends BaseApi {
|
||||||
//跟新EBom 根节点
|
//跟新EBom 根节点
|
||||||
// ebomParentService.getBaseMapper().updateRootState();
|
// ebomParentService.getBaseMapper().updateRootState();
|
||||||
ebomParentService.updateRootState();
|
ebomParentService.updateRootState();
|
||||||
ebomParentService.getBaseMapper().updateRootForWaitReview();
|
ebomParentService.updateRootForWaitReview();
|
||||||
|
|
||||||
return ResultVO.success(result);
|
return ResultVO.success(result);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ package com.nflg.product.bomnew.api.user;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.mzt.logapi.context.LogRecordContext;
|
import com.mzt.logapi.context.LogRecordContext;
|
||||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||||
import com.nflg.product.base.core.api.BaseApi;
|
import com.nflg.product.base.core.api.BaseApi;
|
||||||
|
|
@ -371,4 +373,16 @@ public class PBomApi extends BaseApi {
|
||||||
bomNewPbomParentService.generateNoticeNum(param);
|
bomNewPbomParentService.generateNoticeNum(param);
|
||||||
return ResultVO.success(true);
|
return ResultVO.success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserAuthFac")
|
||||||
|
@ApiOperation("获取用可查看pbom工厂")
|
||||||
|
public ResultVO<List<String>> getUserAuthFac() {
|
||||||
|
String userFactory = userRoleService.getUserFactory();
|
||||||
|
if(StrUtil.isBlank(userFactory)){
|
||||||
|
return ResultVO.success(ImmutableList.of("1010","1020"));
|
||||||
|
}
|
||||||
|
return ResultVO.success(ImmutableList.of(userFactory));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,13 @@ public enum MateiralStateEnum implements ValueEnum<Integer> {
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
private final String description;
|
private final String description;
|
||||||
|
|
||||||
|
public static MateiralStateEnum getDescriptionByValue(Integer value) {
|
||||||
|
for (MateiralStateEnum valueEnum : MateiralStateEnum.values()) {
|
||||||
|
if (valueEnum.getValue().equals(value)) {
|
||||||
|
return valueEnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ public interface BomNewEbomChildMapper extends BaseMapper<BomNewEbomChildEntity>
|
||||||
|
|
||||||
void deleteAllChildren(Long rowId);
|
void deleteAllChildren(Long rowId);
|
||||||
|
|
||||||
|
void updateBomExist0(Long rowId);
|
||||||
|
|
||||||
void delBomChild(@Param("bomRowIds") List<Long> bomRowIds);
|
void delBomChild(@Param("bomRowIds") List<Long> bomRowIds);
|
||||||
|
|
||||||
List<BomNewPbomParentVO> getBomByMaterialNo(String materialNo);
|
List<BomNewPbomParentVO> getBomByMaterialNo(String materialNo);
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,12 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
List<ReverseReportVO> eBomReverseReportNewst(@Param("materialNo")String materialNo);
|
List<ReverseReportVO> eBomReverseReportNewst(@Param("materialNo")String materialNo);
|
||||||
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
void updateRootForWaitReview();
|
void updateRootForWaitReview();
|
||||||
|
|
||||||
|
void updateRootForWaitReview1();
|
||||||
|
void updateRootForWaitReview2();
|
||||||
|
|
||||||
void resetBomExist(Long rowId);
|
void resetBomExist(Long rowId);
|
||||||
|
|
||||||
Set<String> getMaterialParent(@Param("materialNos") Collection<String> materialNos ,@Param("createdBy") String createdBy);
|
Set<String> getMaterialParent(@Param("materialNos") Collection<String> materialNos ,@Param("createdBy") String createdBy);
|
||||||
|
|
@ -121,7 +125,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
||||||
Integer getSapErrorNum(String userCode);
|
Integer getSapErrorNum(String userCode);
|
||||||
|
|
||||||
List<BomNewEbomParentEntity> getLatestByMaterialNo(Collection<String> materialNos);
|
List<BomNewEbomParentEntity> getLatestByMaterialNo(Collection<String> materialNos);
|
||||||
|
@Deprecated
|
||||||
void updateLastVersionIs();
|
void updateLastVersionIs();
|
||||||
|
|
||||||
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
|
List<BomNewPbomParentVO> getReverseBoms(Long parentRowId);
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,6 @@ public interface MaterialMainMapper extends BaseMapper<MaterialMainEntity> {
|
||||||
List<RolePostVo> getRolePostByUserId(@Param("userRowId") Long userRowId);
|
List<RolePostVo> getRolePostByUserId(@Param("userRowId") Long userRowId);
|
||||||
|
|
||||||
UserInfoVO getUserInfoByUserCode(@Param("userCode")String userCode);
|
UserInfoVO getUserInfoByUserCode(@Param("userCode")String userCode);
|
||||||
|
|
||||||
|
String getUserDepartmentDptCode(@Param("rowId") Long rowId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,4 +43,6 @@ public class T1ExtDTO {
|
||||||
* 是否是直发包
|
* 是否是直发包
|
||||||
*/
|
*/
|
||||||
private boolean isZFB = false;
|
private boolean isZFB = false;
|
||||||
|
|
||||||
|
private Long childRowId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.apache.commons.lang.StringUtils;
|
||||||
import org.ttzero.excel.annotation.ExcelColumn;
|
import org.ttzero.excel.annotation.ExcelColumn;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 曹鹏飞
|
* @author 曹鹏飞
|
||||||
|
|
@ -18,6 +19,14 @@ public class OperationErrorMsgVO extends OperationErrorMsgBaseVO implements Seri
|
||||||
@ExcelColumn("所在行")
|
@ExcelColumn("所在行")
|
||||||
public String primaryKey;
|
public String primaryKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@ExcelColumn("创建时间")
|
||||||
|
private LocalDateTime createdTime;
|
||||||
|
|
||||||
public OperationErrorMsgVO() {
|
public OperationErrorMsgVO() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public class BomNewEbomChildService extends ServiceImpl<BomNewEbomChildMapper, B
|
||||||
|
|
||||||
public void deleteAllChildren(Long parentRowId) {
|
public void deleteAllChildren(Long parentRowId) {
|
||||||
baseMapper.deleteAllChildren(parentRowId);
|
baseMapper.deleteAllChildren(parentRowId);
|
||||||
|
baseMapper.updateBomExist0(parentRowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<Void> updateEBomMaterialUse(Collection<String> materialNos) {
|
public CompletableFuture<Void> updateEBomMaterialUse(Collection<String> materialNos) {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity;
|
||||||
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
||||||
|
import com.nflg.product.bomnew.util.SapErrorMsgUtil;
|
||||||
import com.nflg.product.bomnew.util.VUtils;
|
import com.nflg.product.bomnew.util.VUtils;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -43,6 +44,7 @@ public class BomNewEbomExportToSAP {
|
||||||
private final BomNewEbomParentService bomNewEbomParentService = SpringUtil.getBean(BomNewEbomParentService.class);
|
private final BomNewEbomParentService bomNewEbomParentService = SpringUtil.getBean(BomNewEbomParentService.class);
|
||||||
private final BomNewEbomChildService bomNewEbomChildService = SpringUtil.getBean(BomNewEbomChildService.class);
|
private final BomNewEbomChildService bomNewEbomChildService = SpringUtil.getBean(BomNewEbomChildService.class);
|
||||||
private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class);
|
private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class);
|
||||||
|
private final SapErrorMsgUtil sapErrorMsgUtil = SpringUtil.getBean(SapErrorMsgUtil.class);
|
||||||
|
|
||||||
public List<OperationErrorMsgVO> export(Long rootBomRowId) {
|
public List<OperationErrorMsgVO> export(Long rootBomRowId) {
|
||||||
BomNewEbomParentEntity root = bomNewEbomParentService.getById(rootBomRowId);
|
BomNewEbomParentEntity root = bomNewEbomParentService.getById(rootBomRowId);
|
||||||
|
|
@ -122,6 +124,7 @@ public class BomNewEbomExportToSAP {
|
||||||
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId));
|
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId));
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(liErrMsg)) {
|
if (CollUtil.isNotEmpty(liErrMsg)) {
|
||||||
|
sapErrorMsgUtil.translateErrorMsg(liErrMsg);
|
||||||
BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity();
|
BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity();
|
||||||
sapErrorMsgEntity.setTargetRowId(rootBomRowId);
|
sapErrorMsgEntity.setTargetRowId(rootBomRowId);
|
||||||
sapErrorMsgEntity.setType(0);
|
sapErrorMsgEntity.setType(0);
|
||||||
|
|
@ -134,7 +137,7 @@ public class BomNewEbomExportToSAP {
|
||||||
|
|
||||||
private void addToT1(T1ExtDTO dto) {
|
private void addToT1(T1ExtDTO dto) {
|
||||||
if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY)
|
if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY)
|
||||||
|| children.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), dto.getIDNRK()) && StrUtil.equals(c.getMATNR(), dto.getMATNR()))) {
|
|| children.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), dto.getChildRowId()))) {
|
||||||
children.add(dto);
|
children.add(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -154,6 +157,7 @@ public class BomNewEbomExportToSAP {
|
||||||
t.setIDNRK("");
|
t.setIDNRK("");
|
||||||
t.setPOTX1(child.getMaterialDesc());
|
t.setPOTX1(child.getMaterialDesc());
|
||||||
}
|
}
|
||||||
|
t.setChildRowId(child.getRowId());
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,7 +182,8 @@ public class BomNewEbomExportToSAP {
|
||||||
return bomNewEbomChildService.lambdaQuery()
|
return bomNewEbomChildService.lambdaQuery()
|
||||||
.select(BomNewEbomChildEntity::getMaterialNo, BomNewEbomChildEntity::getNum
|
.select(BomNewEbomChildEntity::getMaterialNo, BomNewEbomChildEntity::getNum
|
||||||
, BomNewEbomChildEntity::getMaterialUnit, BomNewEbomChildEntity::getMaterialDesc
|
, BomNewEbomChildEntity::getMaterialUnit, BomNewEbomChildEntity::getMaterialDesc
|
||||||
, BomNewEbomChildEntity::getVirtualPartType, BomNewEbomChildEntity::getProjectType)
|
, BomNewEbomChildEntity::getVirtualPartType, BomNewEbomChildEntity::getProjectType
|
||||||
|
, BomNewEbomChildEntity::getRowId)
|
||||||
.eq(BomNewEbomChildEntity::getParentRowId, parent.getRowId())
|
.eq(BomNewEbomChildEntity::getParentRowId, parent.getRowId())
|
||||||
.orderByAsc(BomNewEbomChildEntity::getOrderNumber)
|
.orderByAsc(BomNewEbomChildEntity::getOrderNumber)
|
||||||
.list();
|
.list();
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* @param materialNo
|
* @param materialNo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public Set<String> getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) {
|
public Set<String> getParentMaterialByMaterialNo(String materialNo, Boolean selfIs) {
|
||||||
BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
BomNewEbomMaterialUseEntity materialBom = bomNewEbomMaterialUseService.lambdaQuery().eq(BomNewEbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
||||||
Set<String> result = new HashSet<>();
|
Set<String> result = new HashSet<>();
|
||||||
|
|
@ -295,6 +296,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* @param materialNos
|
* @param materialNos
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public List<String> getBatchParentMaterialByMaterialNo(List<String> materialNos) {
|
public List<String> getBatchParentMaterialByMaterialNo(List<String> materialNos) {
|
||||||
List<BomNewEbomMaterialUseEntity> materialBom = bomNewEbomMaterialUseService.lambdaQuery().in(BomNewEbomMaterialUseEntity::getMaterialNo, materialNos).list();
|
List<BomNewEbomMaterialUseEntity> materialBom = bomNewEbomMaterialUseService.lambdaQuery().in(BomNewEbomMaterialUseEntity::getMaterialNo, materialNos).list();
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
|
|
@ -357,6 +359,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取子级
|
* 获取子级
|
||||||
*
|
*
|
||||||
|
|
@ -448,6 +453,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
//动态判断异常
|
//动态判断异常
|
||||||
//CheckEBomExceptoinDynamic.check(parentChild);
|
//CheckEBomExceptoinDynamic.check(parentChild);
|
||||||
|
BomNewSortUtil.orderNumEbomSort(parentChild,0);
|
||||||
return parentChild;
|
return parentChild;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2143,7 +2149,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
// ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
// ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
||||||
|
|
||||||
if (eBomEdit.isRootForWaitReview()) {
|
if (eBomEdit.isRootForWaitReview()) {
|
||||||
this.getBaseMapper().updateRootForWaitReview();
|
updateRootForWaitReview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2153,6 +2159,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
return retParentVO;
|
return retParentVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateRootForWaitReview(){
|
||||||
|
this.getBaseMapper().updateRootForWaitReview1();
|
||||||
|
this.getBaseMapper().updateRootForWaitReview2();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交物料
|
* 提交物料
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -2210,7 +2221,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
// checkAndSaveEBomException(dto.getParent().getBomRowId());
|
||||||
if (eBomEdit.isRootForWaitReview()) {
|
if (eBomEdit.isRootForWaitReview()) {
|
||||||
this.getBaseMapper().updateRootForWaitReview();
|
this.updateRootForWaitReview();
|
||||||
}
|
}
|
||||||
resetBomExist(dto.getParent().getRowId());
|
resetBomExist(dto.getParent().getRowId());
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -2805,7 +2816,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rowId)
|
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rowId)
|
||||||
.one();
|
.one();
|
||||||
if (Objects.isNull(sapErrorMsgEntity)) return Collections.emptyList();
|
if (Objects.isNull(sapErrorMsgEntity)) return Collections.emptyList();
|
||||||
return JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class);
|
List<OperationErrorMsgVO> resultList = JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class);
|
||||||
|
resultList.forEach(result -> result.setCreatedTime(sapErrorMsgEntity.getCreatedTime()));
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3040,6 +3053,12 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
}
|
}
|
||||||
updateParent.setChangeDesc(param.getChangeDesc());
|
updateParent.setChangeDesc(param.getChangeDesc());
|
||||||
this.updateById(updateParent);
|
this.updateById(updateParent);
|
||||||
|
// PBOM工作表回写通知单号,升版说明
|
||||||
|
pBomParentService.lambdaUpdate()
|
||||||
|
.set(BomNewPbomParentEntity::getNoticeNums, param.getNumType() == 2 ? param.getNoticeNums() : autoCode)
|
||||||
|
.set(BomNewPbomParentEntity::getChangeDesc, param.getChangeDesc())
|
||||||
|
.eq(BomNewPbomParentEntity::getSourceRowId, versionList.get(0).getRowId())
|
||||||
|
.update();
|
||||||
|
|
||||||
// 新建通知单
|
// 新建通知单
|
||||||
if (param.getNumType() == 1) {
|
if (param.getNumType() == 1) {
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,10 @@ public class BomNewNoticeNumService extends ServiceImpl<BomNewNoticeNumMapper, B
|
||||||
saveDetail2List.forEach(saveDetail2 -> {
|
saveDetail2List.forEach(saveDetail2 -> {
|
||||||
Map<String, Object> bom = new HashMap<>();
|
Map<String, Object> bom = new HashMap<>();
|
||||||
bom.put("parentMaterialNo", saveDetail2.getParentMaterialNo()); // 父级编码
|
bom.put("parentMaterialNo", saveDetail2.getParentMaterialNo()); // 父级编码
|
||||||
|
bom.put("parentMaterialDesc", saveDetail2.getParentMaterialDesc()); // 父级描述
|
||||||
bom.put("orderNum", saveDetail2.getOrderNum()); // BOM行编号
|
bom.put("orderNum", saveDetail2.getOrderNum()); // BOM行编号
|
||||||
bom.put("materialNo", saveDetail2.getMaterialNo()); // 编码
|
bom.put("materialNo", saveDetail2.getMaterialNo()); // 编码
|
||||||
|
bom.put("materialDesc", saveDetail2.getMaterialDesc()); // 描述
|
||||||
bom.put("changeContent", saveDetail2.getChangeContent()); // 变更内容
|
bom.put("changeContent", saveDetail2.getChangeContent()); // 变更内容
|
||||||
bomList2.add(bom);
|
bomList2.add(bom);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewSapErrorMsgEntity;
|
||||||
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
||||||
import com.nflg.product.bomnew.util.BomUtil;
|
import com.nflg.product.bomnew.util.BomUtil;
|
||||||
|
import com.nflg.product.bomnew.util.SapErrorMsgUtil;
|
||||||
import com.nflg.product.bomnew.util.VUtils;
|
import com.nflg.product.bomnew.util.VUtils;
|
||||||
import nflg.product.common.constant.STATE;
|
import nflg.product.common.constant.STATE;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
@ -51,6 +52,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
private final BomNewPbomParentService bomNewPbomParentService = SpringUtil.getBean(BomNewPbomParentService.class);
|
private final BomNewPbomParentService bomNewPbomParentService = SpringUtil.getBean(BomNewPbomParentService.class);
|
||||||
private final BomNewPbomChildService bomNewPbomChildService = SpringUtil.getBean(BomNewPbomChildService.class);
|
private final BomNewPbomChildService bomNewPbomChildService = SpringUtil.getBean(BomNewPbomChildService.class);
|
||||||
private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class);
|
private final BomNewSapErrorMsgService bomNewSapErrorMsgService = SpringUtil.getBean(BomNewSapErrorMsgService.class);
|
||||||
|
private final SapErrorMsgUtil sapErrorMsgUtil = SpringUtil.getBean(SapErrorMsgUtil.class);
|
||||||
|
|
||||||
public BomNewPbomExportToSAPImpl(boolean isForSale) {
|
public BomNewPbomExportToSAPImpl(boolean isForSale) {
|
||||||
this.isForSale = isForSale;
|
this.isForSale = isForSale;
|
||||||
|
|
@ -155,6 +157,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId));
|
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rootBomRowId));
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(liErrMsg)) {
|
if (CollUtil.isNotEmpty(liErrMsg)) {
|
||||||
|
sapErrorMsgUtil.translateErrorMsg(liErrMsg);
|
||||||
BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity();
|
BomNewSapErrorMsgEntity sapErrorMsgEntity = new BomNewSapErrorMsgEntity();
|
||||||
sapErrorMsgEntity.setTargetRowId(rootBomRowId);
|
sapErrorMsgEntity.setTargetRowId(rootBomRowId);
|
||||||
sapErrorMsgEntity.setType(1);
|
sapErrorMsgEntity.setType(1);
|
||||||
|
|
@ -197,6 +200,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
t.setIDNRK("");
|
t.setIDNRK("");
|
||||||
t.setPOTX1(child.getMaterialDesc());
|
t.setPOTX1(child.getMaterialDesc());
|
||||||
}
|
}
|
||||||
|
t.setChildRowId(child.getRowId());
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -256,7 +260,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
|
|
||||||
private void addToT1(T1ExtDTO dto) {
|
private void addToT1(T1ExtDTO dto) {
|
||||||
if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY)
|
if (StrUtil.equals(dto.getPOSTP(), BomConstant.PROJECT_TYPE_TEMPORARY)
|
||||||
|| children.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), dto.getIDNRK()) && StrUtil.equals(c.getMATNR(), dto.getMATNR()))) {
|
|| children.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), dto.getChildRowId()))) {
|
||||||
children.add(dto);
|
children.add(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -266,7 +270,8 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
|
||||||
.select(BomNewPbomChildEntity::getMaterialNo, BomNewPbomChildEntity::getNum
|
.select(BomNewPbomChildEntity::getMaterialNo, BomNewPbomChildEntity::getNum
|
||||||
, BomNewPbomChildEntity::getMaterialUnit, BomNewPbomChildEntity::getMaterialDesc
|
, BomNewPbomChildEntity::getMaterialUnit, BomNewPbomChildEntity::getMaterialDesc
|
||||||
, BomNewPbomChildEntity::getVirtualPartType, BomNewPbomChildEntity::getProjectType
|
, BomNewPbomChildEntity::getVirtualPartType, BomNewPbomChildEntity::getProjectType
|
||||||
, BomNewPbomChildEntity::getFacCode, BomNewPbomChildEntity::getMaterialCategoryCode)
|
, BomNewPbomChildEntity::getFacCode, BomNewPbomChildEntity::getMaterialCategoryCode
|
||||||
|
, BomNewPbomChildEntity::getRowId)
|
||||||
.eq(BomNewPbomChildEntity::getParentRowId, parent.getRowId())
|
.eq(BomNewPbomChildEntity::getParentRowId, parent.getRowId())
|
||||||
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
|
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
|
||||||
.list();
|
.list();
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.mzt.logapi.context.LogRecordContext;
|
import com.mzt.logapi.context.LogRecordContext;
|
||||||
|
|
@ -139,10 +140,13 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(materialNo)) {
|
if (StrUtil.isNotBlank(materialNo)) {
|
||||||
List<String> parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo));
|
List<String> parentMaterialByMaterialNo = new ArrayList<>(getParentMaterialByMaterialNo(materialNo));
|
||||||
|
|
||||||
parentMaterialByMaterialNo.add(materialNo);
|
parentMaterialByMaterialNo.add(materialNo);
|
||||||
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
||||||
List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory()) ? userRoleService.getUserFactory() : query.getFacCode(), parentMaterialByMaterialNo);
|
String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode();
|
||||||
List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(StrUtil.isBlank(userRoleService.getUserFactory()) ? userRoleService.getUserFactory() : query.getFacCode(), parentMaterialByMaterialNo, materialNo);
|
|
||||||
|
List<BomNewPbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(queryFac , parentMaterialByMaterialNo);
|
||||||
|
List<BomNewPbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(queryFac , parentMaterialByMaterialNo, materialNo);
|
||||||
List<BomNewPbomParentVO> data = new ArrayList<>();
|
List<BomNewPbomParentVO> data = new ArrayList<>();
|
||||||
data.addAll(parents);
|
data.addAll(parents);
|
||||||
data.addAll(childs);
|
data.addAll(childs);
|
||||||
|
|
@ -155,12 +159,15 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
|
|
||||||
materialMainService.intiMaterialInfo(data, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
materialMainService.intiMaterialInfo(data, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||||
return handSeachToTree(parents, childs);
|
return handSeachToTree(parents, childs);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
} else {
|
} else {
|
||||||
|
String queryFac= StrUtil.isBlank(query.getFacCode())? userRoleService.getUserFactory():query.getFacCode();
|
||||||
|
|
||||||
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage()
|
Page<BomNewPbomParentVO> result = this.getBaseMapper().workDetailsListByPage(new Page<>(query.getPage()
|
||||||
, query.getPageSize()), query, userRoleService.getUserFactory(), SessionUtil.getDepartRowId(), SessionUtil.getUserCode());
|
, query.getPageSize()), query, queryFac, SessionUtil.getDepartRowId(), SessionUtil.getUserCode());
|
||||||
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -191,6 +198,35 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
return resutlData;
|
return resutlData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取物料编码所有父节点
|
||||||
|
* @param materialNos
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void getGetParentMaterialByMaterialNoNew(Set<String> parentNoResult, Set<String> materialNos){
|
||||||
|
|
||||||
|
Set<String> relParentNoSet= getParent(parentNoResult,materialNos);
|
||||||
|
|
||||||
|
while (CollUtil.isNotEmpty(relParentNoSet)){
|
||||||
|
|
||||||
|
relParentNoSet= getParent(parentNoResult , relParentNoSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Set<String> getParent(Set<String> parentNoResult, Set<String> materialNos){
|
||||||
|
|
||||||
|
List<BomNewPbomChildEntity> childList = pbomChildService.lambdaQuery().in(BomNewPbomChildEntity::getMaterialNo, materialNos).select(BomNewPbomChildEntity::getParentRowId).list();
|
||||||
|
parentNoResult.addAll(materialNos);
|
||||||
|
if(CollUtil.isEmpty(childList)){
|
||||||
|
return new HashSet<>();
|
||||||
|
}
|
||||||
|
List<Long> parentRowIdList = childList.stream().map(u -> u.getParentRowId()).collect(Collectors.toList());
|
||||||
|
List<BomNewPbomParentEntity> parentList = this.lambdaQuery().in(BomNewPbomParentEntity::getRowId, parentRowIdList).select(BomNewPbomParentEntity::getMaterialNo).list();
|
||||||
|
Set<String> parentNoSet = parentList.stream().map(u -> u.getMaterialNo()).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
return Sets.difference(parentNoSet,parentNoResult);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取物料所有子级
|
* 获取物料所有子级
|
||||||
*
|
*
|
||||||
|
|
@ -199,25 +235,28 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Set<String> getParentMaterialByMaterialNo(String materialNo) {
|
public Set<String> getParentMaterialByMaterialNo(String materialNo) {
|
||||||
BomNewPbomMaterialUseEntity materialBom = pbomMaterialUseService.lambdaQuery().eq(BomNewPbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
Set<String> result=new HashSet<>();
|
||||||
Set<String> result = new HashSet<>();
|
getGetParentMaterialByMaterialNoNew(result, ImmutableSet.of(materialNo));
|
||||||
if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) {
|
|
||||||
Set<String> relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ","));
|
|
||||||
|
|
||||||
while (CollUtil.isNotEmpty(relSkuNo)) {
|
|
||||||
result.addAll(relSkuNo);
|
|
||||||
List<BomNewPbomMaterialUseEntity> relSkuList = pbomMaterialUseService.lambdaQuery().in(BomNewPbomMaterialUseEntity::getMaterialNo, relSkuNo).list();
|
|
||||||
relSkuNo.clear();
|
|
||||||
Set<String> finalRelSkuNo = relSkuNo;
|
|
||||||
relSkuList.forEach(k -> {
|
|
||||||
if (StrUtil.isNotBlank(k.getParentMaterialNo())) {
|
|
||||||
finalRelSkuNo.addAll(Sets.newHashSet(StrUtil.split(k.getParentMaterialNo(), ",")));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
relSkuNo = finalRelSkuNo;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
|
// BomNewPbomMaterialUseEntity materialBom = pbomMaterialUseService.lambdaQuery().eq(BomNewPbomMaterialUseEntity::getMaterialNo, materialNo).one();
|
||||||
|
// Set<String> result = new HashSet<>();
|
||||||
|
// if (Objects.nonNull(materialBom) && StrUtil.isNotBlank(materialBom.getParentMaterialNo())) {
|
||||||
|
// Set<String> relSkuNo = Sets.newHashSet(StrUtil.split(materialBom.getParentMaterialNo(), ","));
|
||||||
|
//
|
||||||
|
// while (CollUtil.isNotEmpty(relSkuNo)) {
|
||||||
|
// result.addAll(relSkuNo);
|
||||||
|
// List<BomNewPbomMaterialUseEntity> relSkuList = pbomMaterialUseService.lambdaQuery().in(BomNewPbomMaterialUseEntity::getMaterialNo, relSkuNo).list();
|
||||||
|
// relSkuNo.clear();
|
||||||
|
// Set<String> finalRelSkuNo = relSkuNo;
|
||||||
|
// relSkuList.forEach(k -> {
|
||||||
|
// if (StrUtil.isNotBlank(k.getParentMaterialNo())) {
|
||||||
|
// finalRelSkuNo.addAll(Sets.newHashSet(StrUtil.split(k.getParentMaterialNo(), ",")));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// relSkuNo = finalRelSkuNo;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -361,6 +400,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BomNewSortUtil.orderNumPbomSort(parentChild,0);
|
||||||
return parentChild;
|
return parentChild;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1160,7 +1201,12 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void upgrade(Long bomRowId) throws ExecutionException, InterruptedException {
|
public void upgrade(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||||
BomNewPbomParentEntity parent = this.getById(bomRowId);
|
BomNewPbomParentEntity parent = this.getById(bomRowId);
|
||||||
|
VUtils.isTure(Objects.isNull(parent)).throwMessage("该BOM版本不存在");
|
||||||
VUtils.isTure(parent.getStatus() < PBomStatusEnum.PUBLISH.getValue()).throwMessage("只有已发布的BOM,才能发起变更");
|
VUtils.isTure(parent.getStatus() < PBomStatusEnum.PUBLISH.getValue()).throwMessage("只有已发布的BOM,才能发起变更");
|
||||||
|
//检查当前用户是否有该工厂权限
|
||||||
|
if(!userRoleService.getUserOfFactory().contains(parent.getFacCode())){
|
||||||
|
VUtils.isTure(true).throwMessage("您没有该工厂的权限,无法升级");
|
||||||
|
}
|
||||||
LogRecordContext.putVariable("bom",parent);
|
LogRecordContext.putVariable("bom",parent);
|
||||||
PBomUpgrade upgrade = new PBomUpgrade(parent, getAllBom(bomRowId, 0));
|
PBomUpgrade upgrade = new PBomUpgrade(parent, getAllBom(bomRowId, 0));
|
||||||
upgrade.upgrade();
|
upgrade.upgrade();
|
||||||
|
|
@ -1524,7 +1570,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
||||||
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rowId)
|
.eq(BomNewSapErrorMsgEntity::getTargetRowId, rowId)
|
||||||
.one();
|
.one();
|
||||||
if (Objects.isNull(sapErrorMsgEntity)) return Collections.emptyList();
|
if (Objects.isNull(sapErrorMsgEntity)) return Collections.emptyList();
|
||||||
return JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class);
|
List<OperationErrorMsgVO> resultList = JSON.parseArray(sapErrorMsgEntity.getData(), OperationErrorMsgVO.class);
|
||||||
|
resultList.forEach(result -> result.setCreatedTime(sapErrorMsgEntity.getCreatedTime()));
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BomNewPbomParentVO> getReverseBoms(Long parentRowId) {
|
public List<BomNewPbomParentVO> getReverseBoms(Long parentRowId) {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import com.nflg.product.bomnew.constant.*;
|
||||||
import com.nflg.product.bomnew.mapper.master.MaterialMainMapper;
|
import com.nflg.product.bomnew.mapper.master.MaterialMainMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
||||||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
|
||||||
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1ExtDTO;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
||||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||||
|
|
@ -403,12 +404,12 @@ public class DQBomService {
|
||||||
sapDto.setI_WERKS("1");
|
sapDto.setI_WERKS("1");
|
||||||
sapDto.setI_STLAN("1");
|
sapDto.setI_STLAN("1");
|
||||||
sapDto.setI_EMPNO(root.getCreatedBy());
|
sapDto.setI_EMPNO(root.getCreatedBy());
|
||||||
List<T1DTO> t1s = new ArrayList<>();
|
List<T1ExtDTO> t1s = new ArrayList<>();
|
||||||
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
|
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
|
||||||
datas.forEach(d -> {
|
datas.forEach(d -> {
|
||||||
if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, d.getProjectType())
|
if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, d.getProjectType())
|
||||||
|| t1s.stream().noneMatch(c -> StrUtil.equals(c.getIDNRK(), d.getMaterialNo()) && StrUtil.equals(c.getMATNR(), d.getParentMaterialNo()))) {
|
|| t1s.stream().noneMatch(c -> Objects.equals(c.getChildRowId(), d.getRowId()))) {
|
||||||
T1DTO t1 = new T1DTO();
|
T1ExtDTO t1 = new T1ExtDTO();
|
||||||
t1.setID(RandomUtil.randomNumbers(5));
|
t1.setID(RandomUtil.randomNumbers(5));
|
||||||
t1.setMATNR(d.getParentMaterialNo());
|
t1.setMATNR(d.getParentMaterialNo());
|
||||||
t1.setMENGE(d.getNum().toString());
|
t1.setMENGE(d.getNum().toString());
|
||||||
|
|
@ -426,11 +427,12 @@ public class DQBomService {
|
||||||
t1.setMEINS(bm.getMaterialUnit());
|
t1.setMEINS(bm.getMaterialUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
t1.setChildRowId(d.getRowId());
|
||||||
|
|
||||||
t1s.add(t1);
|
t1s.add(t1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sapDto.setT1(t1s);
|
sapDto.setT1(Convert.toList(T1DTO.class, t1s));
|
||||||
SapStatusEnum state = SapStatusEnum.PUB_ERROR_ALL;
|
SapStatusEnum state = SapStatusEnum.PUB_ERROR_ALL;
|
||||||
List<OperationErrorMsgVO> liErrMsg = null;
|
List<OperationErrorMsgVO> liErrMsg = null;
|
||||||
try {
|
try {
|
||||||
|
|
@ -515,9 +517,9 @@ public class DQBomService {
|
||||||
savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH);
|
savePbomParents(parents, root.getMaterialNo().startsWith("31") ? PBomStatusEnum.FACTORY_CONFIRM : PBomStatusEnum.PUBLISH);
|
||||||
savePbomChildren(children, parents);
|
savePbomChildren(children, parents);
|
||||||
|
|
||||||
CompletableFuture.runAsync(() -> {
|
// CompletableFuture.runAsync(() -> {
|
||||||
bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse();
|
// bomNewPbomParentService.getBaseMapper().updatePBomMaterialUse();
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void savePbomChildren(List<BomNewDQbomChildEntity> children, List<BomNewDQbomParentEntity> parents) {
|
private void savePbomChildren(List<BomNewDQbomChildEntity> children, List<BomNewDQbomParentEntity> parents) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.product.bomnew.service;
|
package com.nflg.product.bomnew.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
import com.nflg.product.bomnew.constant.EBomConstant;
|
import com.nflg.product.bomnew.constant.EBomConstant;
|
||||||
|
|
@ -56,12 +57,17 @@ public class UserRoleService {
|
||||||
*/
|
*/
|
||||||
public String getUserFactory(){
|
public String getUserFactory(){
|
||||||
Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId());
|
Integer userMultiplantFacRoleCount = materialMainService.getBaseMapper().getUserMultiplantFacRoleCount(SessionUtil.getRowId());
|
||||||
|
// return "";
|
||||||
|
if(userMultiplantFacRoleCount>0){
|
||||||
return "";
|
return "";
|
||||||
// if(userMultiplantFacRoleCount>0){
|
}else {
|
||||||
// return "";
|
String dptCde=materialMainService.getBaseMapper().getUserDepartmentDptCode(SessionUtil.getDepartRowId());
|
||||||
// }else {
|
if(StrUtil.isNotBlank(dptCde) && dptCde.contains("仙桃公司")){
|
||||||
// return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010;
|
return EBomConstant.XIAN_TAO_FACTORY_CODE_1020;
|
||||||
// }
|
}
|
||||||
|
return EBomConstant.MAIN_FACTORY_CODE_1010;
|
||||||
|
// return SessionUtil.getFullDeptName().contains("仙桃公司")?EBomConstant.XIAN_TAO_FACTORY_CODE_1020:EBomConstant.MAIN_FACTORY_CODE_1010;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -75,7 +81,11 @@ public class UserRoleService {
|
||||||
if(userMultiplantFacRoleCount>0){
|
if(userMultiplantFacRoleCount>0){
|
||||||
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010,EBomConstant.XIAN_TAO_FACTORY_CODE_1020);
|
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010,EBomConstant.XIAN_TAO_FACTORY_CODE_1020);
|
||||||
}else {
|
}else {
|
||||||
return SessionUtil.getFullDeptName().contains("仙桃公司")? ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) : ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ;
|
String dptCde=materialMainService.getBaseMapper().getUserDepartmentDptCode(SessionUtil.getDepartRowId());
|
||||||
|
if(StrUtil.isNotBlank(dptCde) && dptCde.contains("仙桃公司")){
|
||||||
|
return ImmutableList.of(EBomConstant.XIAN_TAO_FACTORY_CODE_1020) ;
|
||||||
|
}
|
||||||
|
return ImmutableList.of(EBomConstant.MAIN_FACTORY_CODE_1010) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.nflg.product.bomnew.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class BomNewSortUtil {
|
||||||
|
|
||||||
|
|
||||||
|
static int sortOrderNum(String o1,String o2,int sort){
|
||||||
|
if (Objects.isNull(o1)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (Objects.isNull(o2)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int result = 0;
|
||||||
|
try {
|
||||||
|
if (sort == 0) { //升
|
||||||
|
result = Integer.parseInt(o1 ) - Integer.parseInt(o2);
|
||||||
|
} else if (sort == 1) {//降
|
||||||
|
result = Integer.parseInt(o2 ) - Integer.parseInt(o1 );
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void orderNumPbomSort(List<BomNewPbomParentVO> list, int sort) {
|
||||||
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CollUtil.sort(list, new Comparator<BomNewPbomParentVO>() {
|
||||||
|
@Override
|
||||||
|
public int compare(BomNewPbomParentVO o1, BomNewPbomParentVO o2) {
|
||||||
|
|
||||||
|
|
||||||
|
return sortOrderNum(o1.getOrderNumber(),o2.getOrderNumber(),sort);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list
|
||||||
|
* @param sort
|
||||||
|
*/
|
||||||
|
public static void orderNumEbomSort(List<BomNewEbomParentVO> list, int sort) {
|
||||||
|
|
||||||
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CollUtil.sort(list, new Comparator<BomNewEbomParentVO>() {
|
||||||
|
@Override
|
||||||
|
public int compare(BomNewEbomParentVO o1, BomNewEbomParentVO o2) {
|
||||||
|
|
||||||
|
return sortOrderNum(o1.getOrderNumber(),o2.getOrderNumber(),sort);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.nflg.product.bomnew.util;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.nflg.product.bomnew.constant.MateiralStateEnum;
|
||||||
|
import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
|
||||||
|
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
||||||
|
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SapErrorMsgUtil {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialMainService materialMainService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转义错误信息
|
||||||
|
* @param liErrMsg
|
||||||
|
*/
|
||||||
|
public void translateErrorMsg(List<OperationErrorMsgVO> liErrMsg) {
|
||||||
|
// [{"msg":"未选定 BOM 项目(工厂Z0)的物料状态 Block for all usage 1010","primaryKey":"2100048422的子级F项:2100048422"}]
|
||||||
|
// 转义成 [{"msg":"2100048422物料状态可能为冻结,实际为:XX","primaryKey":"2100048422的子级F项:2100048422"}]
|
||||||
|
List<OperationErrorMsgVO> blockMsgList = liErrMsg.stream().filter(errMsg -> ObjectUtil.isNotEmpty(errMsg.msg) && errMsg.msg.contains("Block for all usage")).collect(Collectors.toList());
|
||||||
|
List<String> filterMaterialNos = new ArrayList<>();
|
||||||
|
Map<String, String> materialNoStateMap = new HashMap<>();
|
||||||
|
if (CollUtil.isNotEmpty(blockMsgList)) {
|
||||||
|
blockMsgList.forEach(item -> {
|
||||||
|
if (ObjectUtil.isNotEmpty(item.primaryKey) && item.primaryKey.length() >= 10) {
|
||||||
|
filterMaterialNos.add(item.primaryKey.substring(item.primaryKey.length() - 10));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(filterMaterialNos)) {
|
||||||
|
List<MaterialMainEntity> materialList = materialMainService.lambdaQuery().in(MaterialMainEntity::getMaterialNo, filterMaterialNos).list();
|
||||||
|
materialList.forEach(item -> {
|
||||||
|
MateiralStateEnum stateEnum = MateiralStateEnum.getDescriptionByValue(item.getMaterialState());
|
||||||
|
materialNoStateMap.put(item.getMaterialNo(), ObjectUtil.isNotEmpty(stateEnum) ? stateEnum.getDescription() : "");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
liErrMsg.forEach(errMsg -> {
|
||||||
|
if (ObjectUtil.isNotEmpty(errMsg.msg) && errMsg.msg.contains("Block for all usage") &&
|
||||||
|
ObjectUtil.isNotEmpty(errMsg.primaryKey) && errMsg.primaryKey.length() >= 10) {
|
||||||
|
String materialNo = errMsg.primaryKey.substring(errMsg.primaryKey.length() - 10);
|
||||||
|
errMsg.msg = materialNo + "物料状态可能为冻结,实际为:" + materialNoStateMap.get(materialNo);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
p.created_by bomCreateBy,
|
p.created_by bomCreateBy,
|
||||||
p.*
|
p.*
|
||||||
FROM t_bom_new_dqbom_parent p
|
FROM t_bom_new_dqbom_parent p
|
||||||
LEFT JOIN t_bom_new_dqbom_child c ON p.material_no = c.material_no
|
LEFT JOIN t_bom_new_dqbom_child c ON c.status=#{query.status} AND p.material_no = c.material_no
|
||||||
WHERE (root_is | user_root_is = 1) AND p.status = #{query.status}
|
WHERE (root_is | user_root_is = 1) AND p.status = #{query.status}
|
||||||
<if test="query.showMySelfOnly == 1">
|
<if test="query.showMySelfOnly == 1">
|
||||||
AND p.created_by = #{userCode}
|
AND p.created_by = #{userCode}
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,11 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
group by b.material_no;
|
group by b.material_no;
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateBomExist0">
|
||||||
|
UPDATE t_bom_new_ebom_parent
|
||||||
|
SET bom_exist=0
|
||||||
|
WHERE row_id = #{rowId};
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="getChildMaxExceptionState" resultType="com.nflg.product.bomnew.pojo.vo.ChildMaxExceptionStateVO">
|
<select id="getChildMaxExceptionState" resultType="com.nflg.product.bomnew.pojo.vo.ChildMaxExceptionStateVO">
|
||||||
select max(exception_status) maxExceptionState, parent_row_id from t_bom_new_ebom_child
|
select max(exception_status) maxExceptionState, parent_row_id from t_bom_new_ebom_child
|
||||||
|
|
@ -112,10 +117,7 @@
|
||||||
<delete id="deleteAllChildren">
|
<delete id="deleteAllChildren">
|
||||||
DELETE
|
DELETE
|
||||||
FROM t_bom_new_ebom_child
|
FROM t_bom_new_ebom_child
|
||||||
WHERE parent_row_id = #{parentRowId};
|
WHERE parent_row_id = #{rowId};
|
||||||
UPDATE t_bom_new_ebom_parent
|
|
||||||
SET bom_exist=0
|
|
||||||
WHERE row_id = #{parentRowId};
|
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="delBomChild">
|
<delete id="delBomChild">
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,18 @@
|
||||||
and a.last_version_is = 1
|
and a.last_version_is = 1
|
||||||
AND a.virtual_package_is = 0;
|
AND a.virtual_package_is = 0;
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateRootForWaitReview1">
|
||||||
|
update t_bom_new_ebom_parent
|
||||||
|
set root_is_for_wait_review=0
|
||||||
|
</update>
|
||||||
|
<update id="updateRootForWaitReview2">
|
||||||
|
update t_bom_new_ebom_parent a left join (
|
||||||
|
select b.row_id, b.material_no,a.`status` from t_bom_new_ebom_parent a join t_bom_new_ebom_child b on a.row_id=b.parent_row_id and a.`status` in (1,3) and last_version_is=1
|
||||||
|
) b
|
||||||
|
on a.material_no=b.material_no
|
||||||
|
set a.root_is_for_wait_review=1
|
||||||
|
where a.`status` in (1, 3) and last_version_is=1 and b.row_id is null
|
||||||
|
</update>
|
||||||
<!--更新-待复核根节点-->
|
<!--更新-待复核根节点-->
|
||||||
<update id="updateRootForWaitReview">
|
<update id="updateRootForWaitReview">
|
||||||
update t_bom_new_ebom_parent
|
update t_bom_new_ebom_parent
|
||||||
|
|
|
||||||
|
|
@ -186,23 +186,23 @@
|
||||||
]]>
|
]]>
|
||||||
</select>
|
</select>
|
||||||
<insert id="insertMBomIntoHistoryParent">
|
<insert id="insertMBomIntoHistoryParent">
|
||||||
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`)
|
INSERT INTO `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}
|
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>
|
</insert>
|
||||||
|
|
||||||
<insert id="insertMBomIntoHistoryChild">
|
<insert id="insertMBomIntoHistoryChild">
|
||||||
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`)
|
INSERT INTO `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}
|
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}
|
||||||
</insert>
|
</insert>
|
||||||
<!--将MBOM迁移到历史表-->
|
<!--将MBOM迁移到历史表-->
|
||||||
<insert id="insertMBomIntoHistory">
|
<insert id="insertMBomIntoHistory">
|
||||||
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`)
|
INSERT INTO `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};
|
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`)
|
INSERT INTO `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};
|
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};
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
);
|
);
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="syncOriginalBomToFormalParent">
|
<insert id="syncOriginalBomToFormalParent">
|
||||||
INSERT INTO `nflg`.`t_bom_new_original_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`)
|
INSERT INTO `t_bom_new_original_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`)
|
||||||
|
|
||||||
select `row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`
|
select `row_id`, `batch_no`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `current_version`, `num`, `root_is`, `user_root_is`, `bom_exist`, `should_bom_exist`, `last_version_is`, `material_texture`, `unit_weight`, `total_weight`, `devise_user_code`, `devise_name`, `status`, `edit_status`, `convert_to_ebom_time`, `dept_row_id`, `dept_name`, `source`, `remark`, `created_by`, `created_time`, `expire_end_time`, `level_num`
|
||||||
from t_bom_new_original_parent where row_id in
|
from t_bom_new_original_parent where row_id in
|
||||||
|
|
|
||||||
|
|
@ -229,11 +229,11 @@
|
||||||
<if test="userFac!=null and userFac!=''">
|
<if test="userFac!=null and userFac!=''">
|
||||||
and a.fac_code=#{userFac}
|
and a.fac_code=#{userFac}
|
||||||
</if>
|
</if>
|
||||||
and ( b.material_no in
|
and b.material_no in
|
||||||
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
<foreach collection="materialNoList" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
or b.material_no=#{materialNo})
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -371,4 +371,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -197,4 +197,8 @@
|
||||||
WHERE
|
WHERE
|
||||||
u.user_code= #{userCode}
|
u.user_code= #{userCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserDepartmentDptCode" resultType="java.lang.String">
|
||||||
|
select dpt_code from t_authority_department where row_id=#{rowId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue