feat: 导入sap添加I_EMPNO字段,表示创建人

This commit is contained in:
曹鹏飞 2024-04-29 11:15:09 +08:00
parent 8010099b94
commit c70ead664b
8 changed files with 37 additions and 4 deletions

View File

@ -38,6 +38,7 @@ public class TestApi {
sapDto.setZID(RandomUtil.randomNumbers(5));
sapDto.setI_WERKS("1");
sapDto.setI_STLAN("1");
sapDto.setI_EMPNO("测试者");
List<T1DTO> t1s = new ArrayList<>();
T1DTO t1 = new T1DTO();
t1.setID(RandomUtil.randomNumbers(5));

View File

@ -4,8 +4,6 @@ package com.nflg.product.bomnew.pojo.dto.sap.impart2;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*/
@ -26,5 +24,7 @@ public class ImportSapParam2DTO {
@ApiModelProperty(" EBOM: 2;PBOM: P;MBOM: 1;移动破: 1")
private String I_STLAN;
//创建者
@ApiModelProperty("创建者")
private String I_EMPNO;
}

View File

@ -26,6 +26,9 @@ public class ImportSapParamDTO {
@ApiModelProperty(" EBOM: 2;PBOM: P;MBOM: 1;移动破: 1")
private String I_STLAN;
//创建者
@ApiModelProperty("创建者")
private String I_EMPNO;
@ApiModelProperty("详情")
private List<T1DTO> T1;

View File

@ -935,6 +935,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
sapDto.setZID(RandomUtil.randomNumbers(5));
sapDto.setI_WERKS("1");
sapDto.setI_STLAN("2");
UserInfoVO userInfoVO = SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(root.getCreatedBy());
if (Objects.isNull(userInfoVO)) {
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("用户[{}]不存在", root.getCreatedBy()));
}
sapDto.setI_EMPNO(userInfoVO.getRealName());
List<T1DTO> t1s = new ArrayList<>();
buildChildrenForSap(root, t1s);
sapDto.setT1(t1s);

View File

@ -10,6 +10,7 @@ import cn.hutool.extra.spring.SpringUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.ImmutableList;
import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.BomConstant;
import com.nflg.product.bomnew.constant.EBomConstant;
import com.nflg.product.bomnew.constant.EBomSuperMaterialStatusEnum;
@ -22,6 +23,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
import com.nflg.product.bomnew.pojo.vo.UserInfoVO;
import com.nflg.product.bomnew.service.domain.MBom.IndexListTree;
import com.nflg.product.bomnew.util.VUtils;
import nflg.product.common.constant.STATE;
@ -271,6 +273,11 @@ public class BomNewMbomParentService extends ServiceImpl<BomNewMbomParentMapper,
}
result.setI_STLAN(BomConstant.SAP_MBOM);
UserInfoVO userInfoVO = SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(parentVO.getCreatedBy());
if (Objects.isNull(userInfoVO)) {
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("用户[{}]不存在", parentVO.getCreatedBy()));
}
result.setI_EMPNO(userInfoVO.getRealName());
String dateYMD= DateUtil.format(new Date(),"yyyyMMdd");
List<BomNewMbomMiddleVO> parentList=list.stream().filter(u -> u.getBomExist().intValue()>0).collect(Collectors.toList());

View File

@ -1108,6 +1108,11 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
sapDto.setZID(RandomUtil.randomNumbers(5));
sapDto.setI_WERKS("1");
sapDto.setI_STLAN("1");
UserInfoVO userInfoVO = SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(root.getCreatedBy());
if (Objects.isNull(userInfoVO)) {
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("用户[{}]不存在", root.getCreatedBy()));
}
sapDto.setI_EMPNO(userInfoVO.getRealName());
List<T1DTO> t1s = new ArrayList<>();
buildChildrenForSap(root, t1s);
sapDto.setT1(t1s);

View File

@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.product.base.core.conmon.util.SessionUtil;
import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.*;
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
@ -403,6 +404,11 @@ public class DQBomService {
sapDto.setZID(RandomUtil.randomNumbers(5));
sapDto.setI_WERKS("1");
sapDto.setI_STLAN("1");
UserInfoVO userInfoVO = SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(root.getCreatedBy());
if (Objects.isNull(userInfoVO)) {
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("用户[{}]不存在", root.getCreatedBy()));
}
sapDto.setI_EMPNO(userInfoVO.getRealName());
List<T1DTO> t1s = new ArrayList<>();
String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
datas.forEach(d -> {

View File

@ -30,6 +30,7 @@ import com.nflg.product.bomnew.pojo.query.OptionalMbomMaterialListQuery;
import com.nflg.product.bomnew.pojo.query.OptionalMbomMaterialQuery;
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
import com.nflg.product.bomnew.pojo.vo.OptionalMbomMaterialListVO;
import com.nflg.product.bomnew.pojo.vo.UserInfoVO;
import lombok.extern.slf4j.Slf4j;
import nflg.product.common.constant.STATE;
import nflg.product.common.vo.ResultVO;
@ -132,7 +133,12 @@ public class OptionalMbomMaterialService extends ServiceImpl<OptionalMbomMateria
//
result.setZID(RandomUtil.randomNumbers(5));
result.setI_WERKS("1");
result.setI_STLAN(BomConstant.SAP_YDBOM);
result.setI_STLAN(BomConstant.SAP_YDBOM);
UserInfoVO userInfoVO = SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(entity.getCreatedBy());
if (Objects.isNull(userInfoVO)) {
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("用户[{}]不存在", entity.getCreatedBy()));
}
result.setI_EMPNO(userInfoVO.getRealName());
String dateYMD=DateUtil.format(new Date(),"yyyyMMdd");
for (OptionalMbomMaterialListVO parent: