Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
c89e9f34cd
|
|
@ -0,0 +1,2 @@
|
|||
target
|
||||
.idea
|
||||
|
|
@ -75,9 +75,9 @@ public class BomReportApi extends BaseApi {
|
|||
if (Objects.isNull(query.getQueryType())) {
|
||||
return ResultVO.error(STATE.ParamErr, "请选择查询方式");
|
||||
} else {
|
||||
if (!(query.getBomType().compareTo(ReportConstant.QueryTypeEnum.SINGLE.getValue()) == 0
|
||||
|| query.getBomType().compareTo(ReportConstant.QueryTypeEnum.MULTI.getValue()) == 0
|
||||
|| query.getBomType().compareTo(ReportConstant.QueryTypeEnum.SUM.getValue()) == 0)) {
|
||||
if (!(query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.SINGLE.getValue()) == 0
|
||||
|| query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.MULTI.getValue()) == 0
|
||||
|| query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.SUM.getValue()) == 0)) {
|
||||
return ResultVO.error(STATE.ParamErr, "错误的查询方式");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
|
|||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.MaterialMateVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.RolePostVo;
|
||||
import com.nflg.product.bomnew.pojo.vo.UserInfoVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -58,4 +59,5 @@ public interface MaterialMainMapper extends BaseMapper<MaterialMainEntity> {
|
|||
*/
|
||||
List<RolePostVo> getRolePostByUserId(@Param("userRowId") Long userRowId);
|
||||
|
||||
UserInfoVO getUserInfoByUserCode(@Param("userCode")String userCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024-03-15 10:48:27
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-material-pojo-vo-UserInfoVO")
|
||||
public class UserInfoVO {
|
||||
|
||||
private String userCode;
|
||||
private String realName;
|
||||
|
||||
}
|
||||
|
|
@ -614,7 +614,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
if (data.getChartNo().equals("无")) {
|
||||
data.setChartNo("");
|
||||
}
|
||||
if (data.getMaterialNo().equals("无")) {
|
||||
if (data.getMaterialNo()!=null && "无".contentEquals(StrUtil.trim(data.getMaterialNo()))) {
|
||||
data.setMaterialNo("");
|
||||
}
|
||||
rowNum.set(rowNum.get() + 1);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
import com.nflg.product.bomnew.pojo.vo.UserInfoVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024-03-15 10:55:09
|
||||
*/
|
||||
@Service
|
||||
public class UserInfoService {
|
||||
|
||||
@Resource
|
||||
MaterialMainService materialMainService;
|
||||
|
||||
public UserInfoVO getUserInfoByUserCode(String userCode){
|
||||
return materialMainService.getBaseMapper().getUserInfoByUserCode(userCode);
|
||||
}
|
||||
}
|
||||
|
|
@ -165,6 +165,7 @@ public class EBomForwardReport extends BaseForwardReport {
|
|||
list) {
|
||||
ReportBomVersionVO.QueryBomVersionVO versionVO = new ReportBomVersionVO.QueryBomVersionVO();
|
||||
versionVO.setVersion(entity.getCurrentVersion());
|
||||
versionVO.setVersionDesc(entity.getCurrentVersion());
|
||||
reportBomVersionVO.getVList().add(versionVO);
|
||||
}
|
||||
return reportBomVersionVO;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ package com.nflg.product.bomnew.service.domain.OriginalBom;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.constant.OriginalStatusEnum;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewOriginalParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
|
||||
|
|
@ -63,10 +61,10 @@ public class OriginalBomDetailTask extends RecursiveTask<List<BomOriginalListVO>
|
|||
detailVO.setBomRowId(bomNewOriginalParentEntity.getRowId());
|
||||
detailVO.setBatchNo(bomNewOriginalParentEntity.getBatchNo());
|
||||
if(OriginalStatusEnum.OVER_CONVERT.equalsValue(bomNewOriginalParentEntity.getStatus())){
|
||||
//已转换的为借用件
|
||||
detailVO.setStatus(OriginalStatusEnum.BORROWED_PARTS.getValue());
|
||||
}
|
||||
//非本人则为借用件
|
||||
if (!bomNewOriginalParentEntity.getCreatedBy().equals(detailVO.getCreatedBy()) && OriginalStatusEnum.UN_CONVERT.equalsValue(bomNewOriginalParentEntity.getStatus())) {
|
||||
}else if (!bomNewOriginalParentEntity.getCreatedBy().equals(detailVO.getCreatedBy()) && OriginalStatusEnum.UN_CONVERT.equalsValue(bomNewOriginalParentEntity.getStatus())) {
|
||||
//非本人创建且未转换的为引用件
|
||||
detailVO.setStatus(OriginalStatusEnum.REFERENCE.getValue());
|
||||
}
|
||||
|
||||
|
|
@ -95,7 +93,10 @@ public class OriginalBomDetailTask extends RecursiveTask<List<BomOriginalListVO>
|
|||
if (CollUtil.isNotEmpty(bomDetail)) {
|
||||
List<BomOriginalListVO> collect = bomDetail.stream().filter(u -> Objects.isNull(u.getStatus())|| u.getStatus().equals(1)).collect(Collectors.toList());
|
||||
levelNumAdd(collect.size());
|
||||
List<Long> childBowIds = bomDetail.stream().filter(u-> u.getChildBomRowId()!=null && u.getChildBomRowId() > 0).map(u->u.getChildBomRowId()).collect(Collectors.toList());
|
||||
List<Long> childBowIds = bomDetail.stream()
|
||||
.filter(u-> Objects.equals(u.getStatus(), OriginalStatusEnum.UN_CONVERT.getValue()) && u.getChildBomRowId()!=null && u.getChildBomRowId() > 0)
|
||||
.map(BomOriginalListVO::getChildBomRowId)
|
||||
.collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(childBowIds)) {
|
||||
List<BomOriginalListVO> bom = SpringUtil.getBean(BomNewOriginalParentService.class).getBaseMapper().getParentChildBatch(childBowIds);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,12 +11,10 @@ import com.nflg.product.bomnew.constant.OriginalSourceEnum;
|
|||
import com.nflg.product.bomnew.constant.OriginalStatusEnum;
|
||||
import com.nflg.product.bomnew.mapper.master.MaterialMainMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.*;
|
||||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomOriginalPlmBomVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ImportOriginalBomVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.MaterialMateVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.BomOriginalCadChildService;
|
||||
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||
import com.nflg.product.bomnew.service.UserInfoService;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import lombok.Getter;
|
||||
|
||||
|
|
@ -117,12 +115,11 @@ public class PlmBomToOriginalConvert extends BaseConvert {
|
|||
delBomChild(originalBom.getRowId());
|
||||
handlerChild(originalBom,originalSourceEnum);
|
||||
} else { //用户不一致
|
||||
UserInfoVO userInfo =SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(originalBom.getCreatedBy());
|
||||
if (isSame(getBomChild(originalBom.getRowId()), Convert.toList(BomNewOriginalChildEntity.class, childs))) {
|
||||
importErrorResult.add(new ImportOriginalBomVO(parent.getChartNo(),"BOM数据和" + originalBom.getCreatedBy() + "导入的数据不一致,请沟通处理"));
|
||||
// VUtils.isTure(true).throwMessage("图号:"+parent.getChartNo()+"的BOM数据和" + originalBom.getCreatedBy() + "导入的数据不一致,请沟通处理");
|
||||
importErrorResult.add(new ImportOriginalBomVO(parent.getChartNo(),"BOM数据和" + userInfo.getRealName() + "("+userInfo.getUserCode()+")导入的数据不一致,请沟通处理"));
|
||||
} else {
|
||||
importErrorResult.add(new ImportOriginalBomVO( parent.getChartNo(),originalBom.getCreatedBy() + "已导入了相同的BOM,直接引用"));
|
||||
// VUtils.isTure(true).throwMessage("图号:"+parent.getChartNo()+" "+originalBom.getCreatedBy() + "已导入了相同的BOM,直接引用");
|
||||
importErrorResult.add(new ImportOriginalBomVO( parent.getChartNo(),userInfo.getRealName() + "("+userInfo.getUserCode()+")已导入了相同的BOM,直接引用"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -136,7 +133,8 @@ public class PlmBomToOriginalConvert extends BaseConvert {
|
|||
// VUtils.isTure(true).throwMessage("图号:"+parent.getChartNo()+"此数据已创建BOM,请删除BOM重新导入");
|
||||
|
||||
} else {
|
||||
importErrorResult.add(new ImportOriginalBomVO( parent.getChartNo(),"此数据已被其他用户创建,请联系其他人处理"));
|
||||
UserInfoVO userInfo =SpringUtil.getBean(UserInfoService.class).getUserInfoByUserCode(ebom.getCreatedBy());
|
||||
importErrorResult.add(new ImportOriginalBomVO( parent.getChartNo(),"此数据已被"+userInfo.getRealName()+"("+userInfo.getUserCode()+")创建,请联系TA处理"));
|
||||
// VUtils.isTure(true).throwMessage("图号:"+parent.getChartNo()+"此数据已被其他用户创建,请联系其他人处理");
|
||||
}
|
||||
} else { //ebom为正式状态
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ public class PBomForwardReport extends BaseForwardReport {
|
|||
list) {
|
||||
ReportBomVersionVO.QueryBomVersionVO versionVO = new ReportBomVersionVO.QueryBomVersionVO();
|
||||
versionVO.setVersion(entity.getCurrentVersion());
|
||||
versionVO.setVersionDesc(entity.getCurrentVersion());
|
||||
reportBomVersionVO.getVList().add(versionVO);
|
||||
}
|
||||
return reportBomVersionVO;
|
||||
|
|
|
|||
|
|
@ -188,4 +188,13 @@
|
|||
AND rp.role_row_id=ru.role_row_id
|
||||
AND ru.user_row_id= #{userRowId}
|
||||
</select>
|
||||
|
||||
<select id="getUserInfoByUserCode" resultType="com.nflg.product.bomnew.pojo.vo.UserInfoVO">
|
||||
SELECT
|
||||
u.user_code as userCode, u.real_name as realName
|
||||
FROM
|
||||
t_authority_user u
|
||||
WHERE
|
||||
u.user_code= #{userCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue