Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom
This commit is contained in:
commit
b5dca83082
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.bomnew.constant.ReportConstant;
|
||||
|
|
@ -52,11 +53,7 @@ public class BomReportApi extends BaseApi {
|
|||
@ApiOperation("bom-反查")
|
||||
public ResultVO<List<ReverseReportVO>> reverseReport(@Valid @RequestBody ReverseReportQuery query) {
|
||||
|
||||
//原始BOM
|
||||
if (query.getBomType().equals(0)) {
|
||||
VUtils.isTure(StrUtil.isBlank(query.getDrawingNo())).throwMessage("图号不能为空");
|
||||
return ResultVO.success(reverseReportService.queryOriginalBom(query));
|
||||
}
|
||||
VUtils.isTure(!ImmutableList.of(1,2).contains(query.getBomType())).throwMessage("只能查询EBom和PBom");
|
||||
VUtils.isTure(StrUtil.isBlank(query.getMaterialNo())).throwMessage("物料编码不能为空");
|
||||
if(query.getBomType().equals(1)){
|
||||
return ResultVO.success(reverseReportService.queryEBom(query));
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
|
||||
Integer checkIsUserRoot(@Param("materialNo")String materialNo, @Param("jobNo")String jobNo);
|
||||
|
||||
List<ReverseReportVO> eBomReverseReport(@Param("bomVersionRowId")Long bomVersionRowId,@Param("startDate") String startDate, @Param("endDate")String endDate, @Param("materialNos")List<String> materialNos);
|
||||
List<ReverseReportVO> eBomReverseReport(@Param("bomVersionRowId")Long bomVersionRowId,@Param("startDate") String startDate, @Param("endDate")String endDate, @Param("materialNo")String materialNo);
|
||||
Integer getCountForWaitReviewByMaterialNo(@Param("materialNo") String materialNo);
|
||||
|
||||
void updateRootForWaitReview();
|
||||
|
|
|
|||
|
|
@ -2517,7 +2517,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
* @param exceptRowIds
|
||||
*/
|
||||
private void eBomToFormal(List<Long> exceptRowIds, List<BomNewEbomParentVO> parents){
|
||||
|
||||
List<String> materialNos = parents.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
|
||||
if(CollUtil.isEmpty(materialNos)){
|
||||
return;
|
||||
}
|
||||
List<BomNewEbomParentEntity> toParents = this.lambdaQuery().eq(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue()).notIn(BomNewEbomParentEntity::getRowId, exceptRowIds)
|
||||
.in(BomNewEbomParentEntity::getMaterialNo, materialNos).select(BomNewEbomParentEntity::getRowId).list();
|
||||
if(CollUtil.isNotEmpty(toParents)) {
|
||||
|
|
|
|||
|
|
@ -1211,10 +1211,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
|
||||
List<Long> oldPBomRowIds = toParents.stream().map(u -> u.getRowId()).collect(Collectors.toList());
|
||||
List<Long> toFormalPBomRowIds = new ArrayList<>();
|
||||
toFormalPBomRowIds.addAll(exceptRowIds);
|
||||
toFormalPBomRowIds.addAll(oldPBomRowIds);
|
||||
this.getBaseMapper().insertPBomParentToFormal(toFormalPBomRowIds);
|
||||
this.getBaseMapper().insertPBomChildToFormal(toFormalPBomRowIds);
|
||||
|
||||
this.getBaseMapper().insertPBomParentToFormal(exceptRowIds);
|
||||
this.getBaseMapper().insertPBomChildToFormal(exceptRowIds);
|
||||
|
||||
//转移后删除
|
||||
this.getBaseMapper().delPBom(oldPBomRowIds);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.nflg.product.bomnew.config.NacosConfig;
|
|||
import com.nflg.product.bomnew.constant.MaterialMainGetTypeEnum;
|
||||
import com.nflg.product.bomnew.constant.MaterialRelCategoryCodeEnum;
|
||||
import com.nflg.product.bomnew.pojo.dto.*;
|
||||
import com.nflg.product.bomnew.pojo.entity.MaterialCategoryEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
|
||||
import com.nflg.product.bomnew.util.FlowUtil;
|
||||
import com.nflg.product.bomnew.util.HttpUtils;
|
||||
|
|
@ -25,6 +26,7 @@ import com.nflg.product.bomnew.util.ListCommonUtil;
|
|||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import nflg.product.common.dto.LoginUserInfoDTO;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
|
@ -36,6 +38,7 @@ import javax.annotation.Resource;
|
|||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
|
|
@ -52,6 +55,9 @@ public class MaterialService {
|
|||
@Qualifier("syncOAThreadPool")
|
||||
ThreadPoolTaskExecutor syncOAThreadPool;
|
||||
|
||||
@Resource
|
||||
MaterialCategoryService materialCategoryService;
|
||||
|
||||
/**
|
||||
* 申请物料
|
||||
*
|
||||
|
|
@ -169,9 +175,12 @@ public class MaterialService {
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
//****************************************本地生成,不调主数据**************************************************
|
||||
public Map<String,AddVirtrualMaterialDTO> batchAddMaterial(List<AddVirtrualMaterialDTO> mds){
|
||||
public Map<String, AddVirtrualMaterialDTO> batchAddMaterial(List<AddVirtrualMaterialDTO> mds, LoginUserInfoDTO userInfo) {
|
||||
List<MaterialMainEntity> resultList=new ArrayList<>();
|
||||
|
||||
Set<String> categoryCodeList = mds.stream().map(AddVirtrualMaterialDTO::getMaterialCategoryCode).collect(Collectors.toSet());
|
||||
List<MaterialCategoryEntity> categoryEntityList = materialCategoryService.lambdaQuery().in(MaterialCategoryEntity::getCategoryCode, categoryCodeList).list();
|
||||
|
||||
List<AddMaterialMainDTO> syncOaEnts=new ArrayList<>();
|
||||
Map<String,AddVirtrualMaterialDTO> result = new HashMap<>();
|
||||
for (AddVirtrualMaterialDTO md :mds) {
|
||||
|
|
@ -183,14 +192,14 @@ public class MaterialService {
|
|||
ma.setMaterialName(md.getMaterialName());
|
||||
ma.setMaterialDesc(md.getMaterialDesc());
|
||||
ma.setMaterialCategoryCode(md.getMaterialCategoryCode());
|
||||
ma.setCreatedBy(SessionUtil.getUserCode());
|
||||
ma.setCreatedBy(userInfo.getUserCode());
|
||||
ma.setCreatedTime(LocalDateTime.now());
|
||||
ma.setUpdatedBy(SessionUtil.getUserCode());
|
||||
ma.setUpdatedBy(userInfo.getUserCode());
|
||||
ma.setUpdatedTime(LocalDateTime.now());
|
||||
ma.setMaterialClass(0);
|
||||
ma.setProcessState(0);
|
||||
ma.setApplyUserCode(SessionUtil.getRealName());
|
||||
ma.setApplyDeptName(SessionUtil.getDepartName());
|
||||
// ma.setProcessState(0);
|
||||
ma.setApplyUserCode(userInfo.getRealName());
|
||||
ma.setApplyDeptName(userInfo.getDepartName());
|
||||
ma.setMaterialUnit("PC");
|
||||
ma.setProcessState(10);
|
||||
if(StrUtil.isNotBlank(md.getProjectType())){
|
||||
|
|
@ -198,10 +207,21 @@ public class MaterialService {
|
|||
}
|
||||
resultList.add(ma);
|
||||
|
||||
AddMaterialMainDTO ent=new AddMaterialMainDTO();
|
||||
BeanUtil.copyProperties(ma,ent);
|
||||
AddMaterialMainDTO ent = new AddMaterialMainDTO();
|
||||
BeanUtil.copyProperties(ma, ent);
|
||||
ent.setRelCategoryCode(relMaterialCategory);
|
||||
ent.setReuseOfOnceState(0);
|
||||
|
||||
Optional<MaterialCategoryEntity> optional = categoryEntityList.stream().filter(item -> item.getCategoryCode().equals(md.getMaterialCategoryCode())).findFirst();
|
||||
optional.ifPresent(item -> {
|
||||
List<String> parentRowIdList = Arrays.stream(item.getParentTree().split(",")).collect(Collectors.toList());
|
||||
List<MaterialCategoryEntity> list = materialCategoryService.lambdaQuery().in(MaterialCategoryEntity::getRowId, parentRowIdList).list();
|
||||
List<String> categoryNameList = list.stream().map(MaterialCategoryEntity::getCategoryName).collect(Collectors.toList());
|
||||
String categoryTreeName = String.join("/", categoryNameList);
|
||||
ent.setCategoryNameTree(categoryTreeName);
|
||||
ent.setRelCategoryCode(item.getRelCategoryCode());
|
||||
});
|
||||
|
||||
syncOaEnts.add(ent);
|
||||
|
||||
md.setMaterialNo(ma.getMaterialNo());
|
||||
|
|
@ -210,11 +230,14 @@ public class MaterialService {
|
|||
materialMainService.saveOrUpdateBatch(resultList);
|
||||
initCategoryInfo(syncOaEnts);
|
||||
//同步OA
|
||||
sysnToOa(syncOaEnts);
|
||||
// CompletableFuture.runAsync(() -> sysnToOa(syncOaEnts),syncOAThreadPool);
|
||||
CompletableFuture.runAsync(() -> sysnToOa(syncOaEnts, userInfo), syncOAThreadPool);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, AddVirtrualMaterialDTO> batchAddMaterial(List<AddVirtrualMaterialDTO> mds) {
|
||||
return batchAddMaterial(mds, SessionUtil.getUser());
|
||||
}
|
||||
|
||||
private void checkMaterial(List<AddVirtrualMaterialDTO> mds){
|
||||
List<AddVirtrualMaterialDTO> noCateGoryCodes = mds.stream().filter(u -> StrUtil.isBlank(u.getMaterialCategoryCode())).collect(Collectors.toList());
|
||||
VUtils.isTure(CollUtil.isNotEmpty(noCateGoryCodes)).throwMessage("最小物料类别不能为空");
|
||||
|
|
@ -283,7 +306,7 @@ public class MaterialService {
|
|||
* @param materialCategoryCode
|
||||
* @return
|
||||
*/
|
||||
public String generateMaterialNo(String materialCategoryCode ,String preCategory) {
|
||||
public synchronized String generateMaterialNo(String materialCategoryCode, String preCategory) {
|
||||
// String preCategory =materialMainService.getBaseMapper().getMaterialCategory(materialCategoryCode);
|
||||
if (StrUtil.isBlank(preCategory)) {
|
||||
throw new NflgBusinessException(STATE.ParamErr, materialCategoryCode.concat("未设置对应分类"));
|
||||
|
|
@ -303,63 +326,63 @@ public class MaterialService {
|
|||
* @param data
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void sysnToOa(List<AddMaterialMainDTO> data) {
|
||||
Map<String, Object> result = getHttpMap();
|
||||
public void sysnToOa(List<AddMaterialMainDTO> data, LoginUserInfoDTO userInfo) {
|
||||
try {
|
||||
Map<String, Object> result = getHttpMap(userInfo.getUserCode());
|
||||
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
data.forEach(u -> {
|
||||
Map<String, String> material = new LinkedHashMap<>();
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
data.forEach(u -> {
|
||||
Map<String, String> material = new LinkedHashMap<>();
|
||||
|
||||
String relCategoryCode = u.getRelCategoryCode();
|
||||
material.put("MATNR", u.getMaterialNo());
|
||||
material.put("MAKTX", StrUtil.isNotBlank(u.getShortMaterialDesc()) ? u.getShortMaterialDesc() : u.getMaterialDesc());
|
||||
material.put("dl", u.getSecondMaterialCategoryCode());
|
||||
material.put("xl", u.getThirdMaterialCategoryCode());
|
||||
material.put("xfl", u.getFourthMaterialCategoryCode());
|
||||
material.put("xl_copy", u.getThirdMaterialCategoryCode());
|
||||
material.put("MATKL", u.getThirdMaterialCategoryCode());
|
||||
material.put("MNAME", u.getMaterialName());
|
||||
material.put("MNUMB", u.getDrawingNo());
|
||||
material.put("MTEXT", u.getMaterialTexture());
|
||||
material.put("MSPEC", u.getMaterialSpecifications());
|
||||
material.put("MREMA", u.getMaterialDesc());
|
||||
material.put("MMANU", u.getMaterialBrand());
|
||||
material.put("ATTYP", relCategoryCode);
|
||||
material.put("ERNAM", SessionUtil.getUserCode());
|
||||
material.put("MEINS", u.getMaterialUnit());
|
||||
material.put("DUPLICATEITEMS", u.getReuseOfOnceState().equals(1) ? "2" : "1");// 是否一次性使用物料 0:否1:是
|
||||
material.put("categoryTreeName", u.getCategoryNameTree());
|
||||
material.put("FWEIGHT", u.getMaterialWeight());
|
||||
if (StringUtils.isNotEmpty(relCategoryCode)) {
|
||||
if (relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_21.getRelCategoryCode()) || relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_22.getRelCategoryCode())) {
|
||||
material.put("materialGetType", String.valueOf(u.getMaterialGetType()));
|
||||
}
|
||||
|
||||
if (relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_71.getRelCategoryCode())) {
|
||||
if ("701301".equals(u.getMaterialCategoryCode())) {
|
||||
String relCategoryCode = u.getRelCategoryCode();
|
||||
material.put("MATNR", u.getMaterialNo());
|
||||
material.put("MAKTX", StrUtil.isNotBlank(u.getShortMaterialDesc()) ? u.getShortMaterialDesc() : u.getMaterialDesc());
|
||||
material.put("dl", u.getSecondMaterialCategoryCode());
|
||||
material.put("xl", u.getThirdMaterialCategoryCode());
|
||||
material.put("xfl", u.getFourthMaterialCategoryCode());
|
||||
material.put("xl_copy", u.getThirdMaterialCategoryCode());
|
||||
material.put("MATKL", u.getThirdMaterialCategoryCode());
|
||||
material.put("MNAME", u.getMaterialName());
|
||||
material.put("MNUMB", u.getDrawingNo());
|
||||
material.put("MTEXT", u.getMaterialTexture());
|
||||
material.put("MSPEC", u.getMaterialSpecifications());
|
||||
material.put("MREMA", u.getMaterialDesc());
|
||||
material.put("MMANU", u.getMaterialBrand());
|
||||
material.put("ATTYP", relCategoryCode);
|
||||
material.put("ERNAM", userInfo.getUserCode());
|
||||
material.put("MEINS", u.getMaterialUnit());
|
||||
material.put("DUPLICATEITEMS", u.getReuseOfOnceState().equals(1) ? "2" : "1");// 是否一次性使用物料 0:否1:是
|
||||
material.put("categoryTreeName", u.getCategoryNameTree());
|
||||
material.put("FWEIGHT", u.getMaterialWeight());
|
||||
if (StringUtils.isNotEmpty(relCategoryCode)) {
|
||||
if (relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_21.getRelCategoryCode()) || relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_22.getRelCategoryCode())) {
|
||||
material.put("materialGetType", String.valueOf(u.getMaterialGetType()));
|
||||
} else if ("701303".equals(u.getMaterialCategoryCode())) {
|
||||
// 701303 虽然按照采购形式申请,但是OA流程类型 强制按照 自制
|
||||
material.put("materialGetType", String.valueOf(MaterialMainGetTypeEnum.ZZ.getCode()));
|
||||
} else {
|
||||
material.put("materialGetType", String.valueOf(MaterialMainGetTypeEnum.CG.getCode()));
|
||||
}
|
||||
|
||||
if (relCategoryCode.equals(MaterialRelCategoryCodeEnum.relCategoryCode_71.getRelCategoryCode())) {
|
||||
if ("701301".equals(u.getMaterialCategoryCode())) {
|
||||
material.put("materialGetType", String.valueOf(u.getMaterialGetType()));
|
||||
} else if ("701303".equals(u.getMaterialCategoryCode())) {
|
||||
// 701303 虽然按照采购形式申请,但是OA流程类型 强制按照 自制
|
||||
material.put("materialGetType", String.valueOf(MaterialMainGetTypeEnum.ZZ.getCode()));
|
||||
} else {
|
||||
material.put("materialGetType", String.valueOf(MaterialMainGetTypeEnum.CG.getCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(String.valueOf(u.getUseOfYear()))) {
|
||||
material.put("USAGEYEAR", String.valueOf(u.getUseOfYear()));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(String.valueOf(u.getUseOfYear()))) {
|
||||
material.put("USAGEYEAR", String.valueOf(u.getUseOfYear()));
|
||||
}
|
||||
|
||||
material.put("picUrl", u.getPicUrl());
|
||||
// 中类、小类、细分类(若有),分类代码和名称都传给OA
|
||||
handleCategoryCodeAndName(material, u);
|
||||
list.add(material);
|
||||
});
|
||||
result.put("List", list);
|
||||
log.info("物料申请-JSON:" + JSONArray.toJSONString(list));
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
try {
|
||||
material.put("picUrl", u.getPicUrl());
|
||||
// 中类、小类、细分类(若有),分类代码和名称都传给OA
|
||||
handleCategoryCodeAndName(material, u);
|
||||
list.add(material);
|
||||
});
|
||||
result.put("List", list);
|
||||
log.info("物料申请-JSON:" + JSONArray.toJSONString(list));
|
||||
HttpUtils httpUtils = new HttpUtils();
|
||||
String url = NacosConfig.getNacosConfig().getOaUrl();
|
||||
String reqResult = httpUtils.doPost(url, JSON.toJSONString(result));
|
||||
JSONObject jsonObject = JSONObject.parseObject(reqResult);
|
||||
|
|
@ -374,16 +397,16 @@ public class MaterialService {
|
|||
message = StrUtil.isNotBlank(message) ? message : "";
|
||||
throw new NflgBusinessException(STATE.BusinessError, "同步OA出错".concat(message));
|
||||
}
|
||||
// return null;
|
||||
// return null;
|
||||
} catch (Exception ex) {
|
||||
log.error("同步OA出错",ex);
|
||||
log.error("同步OA出错", ex);
|
||||
throw new NflgBusinessException(STATE.BusinessError, "同步OA出错" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> getHttpMap() {
|
||||
public Map<String, Object> getHttpMap(String userCode) {
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("userid", SessionUtil.getUserCode());
|
||||
result.put("userid", userCode);
|
||||
result.put("summary", NacosConfig.getNacosConfig().getSummary());
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public class EBomDetailTask extends RecursiveTask<List<BomNewEbomParentVO>> {
|
|||
detailVO.setBomExist(ebomParentEntity.getBomExist());
|
||||
detailVO.setStatus(ebomParentEntity.getStatus());
|
||||
detailVO.setBatchNo(ebomParentEntity.getBatchNo());
|
||||
detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ public class EBomFormalDetailTask extends RecursiveTask<List<BomNewEbomParentVO>
|
|||
detailVO.setBomExist(ebomParentEntity.getBomExist());
|
||||
detailVO.setStatus(ebomParentEntity.getStatus());
|
||||
detailVO.setBatchNo(ebomParentEntity.getBatchNo());
|
||||
detailVO.setCreatedBy(ebomParentEntity.getCreatedBy());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,10 +167,9 @@ public abstract class EBomToPbomBase {
|
|||
}
|
||||
//pbom 处于工作表
|
||||
else if (Objects.nonNull(oldParent) && oldParent.getStatus() < EBomStatusEnum.PUBLISHED.getValue()) {
|
||||
if (oldParent.getCreatedBy() == parentVo.getCreatedBy()) {
|
||||
if (ConvertToPBomModelEnum.OVERRIDE.equals(convertMode.getValue())) {
|
||||
if (oldParent.getCreatedBy().equals( parentVo.getCreatedBy())) {
|
||||
if (ConvertToPBomModelEnum.OVERRIDE.equalsValue(convertMode.getValue())) {
|
||||
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
||||
oldParent.setCurrentVersion(parentVo.getCurrentVersion());
|
||||
oldParent.setSourceRowId(parentVo.getRowId());
|
||||
oldParent.setCreatedTime(LocalDateTime.now());
|
||||
this.pBomParentResult.add(oldParent);
|
||||
|
|
@ -209,6 +208,7 @@ public abstract class EBomToPbomBase {
|
|||
if (Objects.nonNull(oldParent)) {
|
||||
oldParent.setExpireEndTime(LocalDateTime.now());
|
||||
oldParent.setLastVersionIs(0);
|
||||
this.pBomParentResult.add(oldParent);
|
||||
}
|
||||
this.pBomParentResult.add(pBomParent);
|
||||
return pBomParent;
|
||||
|
|
|
|||
|
|
@ -54,13 +54,20 @@ public class EBomQueryService {
|
|||
*/
|
||||
public List<ReverseReportVO> singleLevelReport(ReverseReportQuery queryParam) {
|
||||
Long bomVersionRowId=0L;
|
||||
if(StrUtil.isNotBlank(queryParam.getBomVersion())){
|
||||
//指定版本
|
||||
if(queryParam.getVersionStrategy().equals(2) && StrUtil.isNotBlank(queryParam.getBomVersion())){
|
||||
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery().eq(BomNewEbomParentFormalEntity::getMaterialNo, queryParam.getMaterialNo())
|
||||
.eq(BomNewEbomParentFormalEntity::getCurrentVersion, queryParam.getBomVersion()).one();
|
||||
bomVersionRowId= Objects.nonNull(one)? one.getRowId():0L;
|
||||
}//最新版本
|
||||
else if(queryParam.getVersionStrategy().equals(0)){
|
||||
BomNewEbomParentFormalEntity one = ebomParentFormalService.lambdaQuery().eq(BomNewEbomParentFormalEntity::getMaterialNo, queryParam.getMaterialNo())
|
||||
.last(" order by current_version desc limit 1").one();
|
||||
if(Objects.nonNull(one)){
|
||||
bomVersionRowId=one.getRowId();
|
||||
}
|
||||
}
|
||||
|
||||
return ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId,queryParam.getStartDate(),queryParam.getEndDate(), ImmutableList.of(queryParam.getMaterialNo()));
|
||||
return ebomParentService.getBaseMapper().eBomReverseReport(bomVersionRowId,queryParam.getStartDate(),queryParam.getEndDate(), queryParam.getMaterialNo());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -347,10 +347,7 @@
|
|||
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
||||
and b.convert_to_ebom_time >= #{startDate} and b.expire_end_time <=#{endDate}
|
||||
</if>
|
||||
and a.material_no in
|
||||
<foreach collection="materialNos" item="materialNo" open="(" separator="," close=")">
|
||||
#{materialNo}
|
||||
</foreach>
|
||||
and a.material_no =#{materialNo}
|
||||
</select>
|
||||
|
||||
<select id="getCountForWaitReviewByMaterialNo" resultType="java.lang.Integer">
|
||||
|
|
|
|||
|
|
@ -261,9 +261,9 @@
|
|||
</update>
|
||||
|
||||
<insert id="insertPBomParentToFormal">
|
||||
INSERT INTO `t_bom_new_pbom_parent_formal` (`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`, `project_type`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `technology_user_code`, `technology_user_name`, `created_by`, `created_time`, `created_job`, `release_time`, `release_user_name`, `last_convert_mbom_user_name`, `last_convert_mbom_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`, `sap_state`, `sap_time`)
|
||||
INSERT INTO `t_bom_new_pbom_parent_formal` (`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`, `project_type`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `technology_user_code`, `technology_user_name`, `created_by`, `created_time`, `created_job`, `release_time`, `release_user_name`, `last_convert_mbom_user_name`, `last_convert_mbom_time`, `expire_end_time`, `remark`, `dept_name`, `dept_row_id`,`level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`, `sap_state`, `sap_time`,`source`)
|
||||
|
||||
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`, `project_type`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `technology_user_code`, `technology_user_name`, `created_by`, `created_time`, `created_job`, `release_time`, `release_user_name`, `last_convert_mbom_user_name`, `last_convert_mbom_time`, `expire_end_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`, `sap_state`, `sap_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`, `project_type`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `technology_user_code`, `technology_user_name`, `created_by`, `created_time`, `created_job`, `release_time`, `release_user_name`, `last_convert_mbom_user_name`, `last_convert_mbom_time`, `expire_end_time`, `remark`, `dept_name`, dept_row_id,`level_num`, `change_desc`, `notice_nums`, `order_no`, `modify_time`, `sap_state`, `sap_time`,`source`
|
||||
from t_bom_new_pbom_parent
|
||||
where row_id in
|
||||
<foreach collection="bomRowIds" item="item" open="(" separator="," close=")">
|
||||
|
|
|
|||
Loading…
Reference in New Issue