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:
jing's 2024-03-25 18:27:13 +08:00
commit e61a20e7f9
35 changed files with 134 additions and 145 deletions

View File

@ -1446,7 +1446,7 @@ public class BomEChildServiceImpl extends ServiceImpl<BomEChildDao, BomEChildEnt
}
Map<Integer, List<BomEMiddleEntity>> map = listAllMiddleList.stream().filter(item -> item.getVirtuallyPack() != null).collect(Collectors.groupingBy(BomEMiddleEntity::getVirtuallyPack));
if (map == null || map.size() <= 0) {
if (map.isEmpty()) {
return;
}

View File

@ -1408,8 +1408,8 @@ public class BomEParentServiceImpl extends ServiceImpl<BomEParentDao, BomEParent
* @return
*/
private List<BomEMiddleEntity> getListOldBomEMiddle(List<BomEParentVO> returnList) {
List<Long> listRowId = returnList.stream().filter(item -> item.getORowId() != null).map(BomEParentVO::getORowId).collect(Collectors.toList());
if (listRowId == null || listRowId.size() <= 0) {
List<Long> listRowId = returnList.stream().map(BomEParentVO::getORowId).filter(Objects::nonNull).collect(Collectors.toList());
if (listRowId.isEmpty()) {
return new ArrayList<>();
}
@ -1435,8 +1435,8 @@ public class BomEParentServiceImpl extends ServiceImpl<BomEParentDao, BomEParent
if (listBomEMiddle == null || listBomEMiddle.size() <= 0) {
return new HashMap<>();
}
List<Long> listRowId = listBomEMiddle.stream().filter(item -> item.getORowId() != null).map(BomEMiddleEntity::getORowId).collect(Collectors.toList());
if (listRowId == null || listRowId.size() <= 0) {
List<Long> listRowId = listBomEMiddle.stream().map(BomEMiddleEntity::getORowId).filter(Objects::nonNull).collect(Collectors.toList());
if (listRowId.isEmpty()) {
return new HashMap<>();
}
@ -2038,7 +2038,7 @@ public class BomEParentServiceImpl extends ServiceImpl<BomEParentDao, BomEParent
listNotUser.add(item);
}
if (listNotUser != null && listNotUser.size()>0) {
if (!listNotUser.isEmpty()) {
return ResultVO.error("只能删除本人的数据");
}

View File

@ -258,14 +258,14 @@ public class BomEParentUtil {
}
parent.setEditStatus(EditStatusEnum.EDITED.getValue()); //设置为已处理
List<BomEParentVO> listResult = new ArrayList<>();
//List<BomEParentVO> listResult = new ArrayList<>();
Map<Long, List<BomEParentVO>> mapResultGroupByPRowId = listResultTemp.stream().filter(item -> Objects.nonNull(item.getPRowId())).collect(Collectors.groupingBy(BomEParentVO::getPRowId));
if(mapResultGroupByPRowId == null || mapResultGroupByPRowId.size()==0){
listResult.add(parent);
}
// if(mapResultGroupByPRowId.isEmpty()){
// listResult.add(parent);
// }
List<BomEParentVO> listChild = mapResultGroupByPRowId.get(parent.getRowId());
if(listChild == null || listChild.size()==0){
if(listChild == null || listChild.isEmpty()){
return ;
}
parent.setChildren(listChild);

View File

@ -228,7 +228,7 @@ public class BomOriginalParentServiceImpl extends ServiceImpl<BomOriginalParentD
Long _startTime1 = System.currentTimeMillis();
//获取物料
Map<String, MaterialMainEntity> mapMaterialNo = this.bomOParentUtil.getMapMaterialNo(list, bomOriginalChildList);
if(list != null && list.size()>0){
if(!list.isEmpty()){
list.forEach(item->{
MaterialMainEntity materialMain = mapMaterialNo.get(item.getMaterialNo());
if(materialMain != null){
@ -239,7 +239,7 @@ public class BomOriginalParentServiceImpl extends ServiceImpl<BomOriginalParentD
}
});
}
if (bomOriginalChildList != null && bomOriginalChildList.size() > 0) {
if (bomOriginalChildList != null && !bomOriginalChildList.isEmpty()) {
bomOriginalChildList.forEach(item -> {
MaterialMainEntity materialMain = mapMaterialNo.get(item.getMaterialNo());
if (materialMain != null) {
@ -290,7 +290,7 @@ public class BomOriginalParentServiceImpl extends ServiceImpl<BomOriginalParentD
Long _startTime1 = System.currentTimeMillis();
//获取物料
Map<String, MaterialMainEntity> mapMaterialNo = this.bomOParentUtil.getMapMaterialNo(list, bomOriginalChildList);
if (list != null && list.size() > 0) {
if (!list.isEmpty()) {
list.forEach(item -> {
MaterialMainEntity materialMain = mapMaterialNo.get(item.getMaterialNo());
if (materialMain != null) {
@ -301,7 +301,7 @@ public class BomOriginalParentServiceImpl extends ServiceImpl<BomOriginalParentD
}
});
}
if (bomOriginalChildList != null && bomOriginalChildList.size() > 0) {
if (bomOriginalChildList != null && !bomOriginalChildList.isEmpty()) {
bomOriginalChildList.forEach(item -> {
MaterialMainEntity materialMain = mapMaterialNo.get(item.getMaterialNo());
if (materialMain != null) {
@ -390,15 +390,15 @@ public class BomOriginalParentServiceImpl extends ServiceImpl<BomOriginalParentD
return ResultVO.error(STATE.Error, "请选择要删除的数据");
}
if (parentList.size() > 0) {
if (!parentList.isEmpty()) {
// status为2=已转换不允许删除
List<BomOriginalParentEntity> parentStatusList = parentList.stream().filter(item -> item.getStatus().compareTo(BomOriginalParentStatusEnum.ALREADY.getValue()) == 0).collect(Collectors.toList());
if (parentStatusList.size() > 0) {
if (!parentStatusList.isEmpty()) {
List<String> statusDrawingNoList = parentStatusList.stream().map(BomOriginalParentEntity::getDrawingNo).collect(Collectors.toList());
return ResultVO.error("图号为" + String.join(",", statusDrawingNoList) + "的数据为已转换的,无法删除");
}
List<BomOriginalParentEntity> plmParentList = parentList.stream().filter(item -> item.getSource().compareTo(BomOriginalParentSourceEnum.PLM.getValue()) == 0).collect(Collectors.toList());
if (plmParentList.size() > 0) {
if (!plmParentList.isEmpty()) {
List<String> plmDrawingNoList = plmParentList.stream().map(BomOriginalParentEntity::getDrawingNo).collect(Collectors.toList());
return ResultVO.error("图号为" + String.join(",", plmDrawingNoList) + "的父级BOM为PLM导入的无法删除");
}

View File

@ -272,8 +272,8 @@ public class BomFactorySplitRuleServiceImpl extends ServiceImpl<BomFactorySplitR
List<BomFactorySplitRuleEntity> splitRuleList = new ArrayList<>();
List<BomFactoryRuleGroupEntity> ruleGroupList = new ArrayList<>();
// 如果规则分组有值判断规则分组表是否包含该规则分组值
List<String> ruleGroupNameList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getRuleGroupName())).map(BomFactorySplitRuleVO::getRuleGroupName).distinct().collect(Collectors.toList());
if(ruleGroupNameList != null && ruleGroupNameList.size()>0) {
List<String> ruleGroupNameList = requestList.stream().map(BomFactorySplitRuleVO::getRuleGroupName).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
if(!ruleGroupNameList.isEmpty()) {
List<BomFactoryRuleGroupEntity> ruleGroupEntityList = bomFactoryRuleGroupService.lambdaQuery().in(BomFactoryRuleGroupEntity::getRuleGroupName, ruleGroupNameList).list();
if (CollUtil.isNotEmpty(ruleGroupEntityList)) {
ruleGroupList.addAll(ruleGroupEntityList);
@ -286,8 +286,8 @@ public class BomFactorySplitRuleServiceImpl extends ServiceImpl<BomFactorySplitR
}
List<MaterialCategoryEntity> categoryList = new ArrayList<>();
List<String> categoryCodeList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getMaterialCategoryCode())).map(BomFactorySplitRuleVO::getMaterialCategoryCode).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> nextCategoryCodeList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getNextMaterialCategoryCode())).map(BomFactorySplitRuleVO::getNextMaterialCategoryCode).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> categoryCodeList = requestList.stream().map(BomFactorySplitRuleVO::getMaterialCategoryCode).filter(StringUtils::isNotEmpty).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> nextCategoryCodeList = requestList.stream().map(BomFactorySplitRuleVO::getNextMaterialCategoryCode).filter(StringUtils::isNotEmpty).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> allCategoryCodeList = new ArrayList<>();
if (CollUtil.isNotEmpty(categoryCodeList)) {
allCategoryCodeList.addAll(categoryCodeList);
@ -301,7 +301,7 @@ public class BomFactorySplitRuleServiceImpl extends ServiceImpl<BomFactorySplitR
return ResultVO.error("请输入正确的物料分类代码");
}
}
if(categoryList != null && categoryList.size()>0) {
if(!categoryList.isEmpty()) {
List<String> ccList = categoryList.stream().map(MaterialCategoryEntity::getCategoryCode).collect(Collectors.toList());
List<String> reduceCcList = allCategoryCodeList.stream().filter(item -> !ccList.contains(item)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(reduceCcList)) {

View File

@ -346,7 +346,7 @@ public class BomPSearchServiceImpl implements BomPSearchService {
// bomPParentVO.setId(IdWorker.get32UUID());
// bomPParentVO.setChildren(children);
// }
if(parentList ==null || parentList.size()<=0){
if(parentList.isEmpty()){
MaterialMainEntity materialMain = mapMaterialNo.get(vo.getMaterialNo());
bomPParentUtil.setStatusByParentByA00AndLack(vo, materialMain); //设置缺Bom
}else {

View File

@ -21,7 +21,7 @@ public enum BomTechnologyTaskFactoryEnum {
public static BomTechnologyTaskFactoryEnum getDescriptionByValue(Integer value) {
for (BomTechnologyTaskFactoryEnum valueEnum : BomTechnologyTaskFactoryEnum.values()) {
if (valueEnum.getValue().equals(value)) {
if (valueEnum.getValue().equals(value.toString())) {
return valueEnum;
}
}

View File

@ -111,7 +111,7 @@ public class OConvertUtils {
* 如果转换前的下划线大写方式命名的字符串为空则返回空字符串</br>
* 例如hello_world,test_id->helloWorld,testId
*
* @param name 转换前的下划线大写方式命名的字符串
* @param names 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
public static String camelNames(String names) {

View File

@ -35,18 +35,18 @@ public class DynamicBomEMiddleDeleteUtil {
BomEMiddleEntity bomEMiddle = middleEntityList.get(0);
Long parentRowId = bomEMiddle.getParentRowId();
List<String> listMaterialNo = middleEntityList.stream().filter(item -> StringUtils.isNotEmpty(item.getMaterialNo())).map(BomEMiddleEntity::getMaterialNo).distinct().collect(Collectors.toList());
if(listMaterialNo == null || listMaterialNo.size()<=0){
List<String> listMaterialNo = middleEntityList.stream().map(BomEMiddleEntity::getMaterialNo).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
if(listMaterialNo.size()<=0){
return;
}
List<Long> listRowIds = middleEntityList.stream().filter(item -> item.getRowId()!= null).map(BomEMiddleEntity::getRowId).distinct().collect(Collectors.toList());
List<Long> listRowIds = middleEntityList.stream().map(BomEMiddleEntity::getRowId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
List<BomEMiddleEntity> listDelete = this.getListDelete(listRowIds, listMaterialNo);
if(listDelete == null || listDelete.size()<=0){
return;
}
List<Long> listParentRowId = listDelete.stream().filter(item -> item.getParentRowId() != null).map(BomEMiddleEntity::getParentRowId).distinct().collect(Collectors.toList());
List<Long> listParentRowId = listDelete.stream().map(BomEMiddleEntity::getParentRowId).filter(Objects::nonNull).distinct().collect(Collectors.toList());
Map<Long, List<BomEMiddleEntity>> mapByParentRowId = this.getMapDeleteGroupByParentRowId(listParentRowId);
List<Long> listResultDelete = new ArrayList<>();

View File

@ -207,7 +207,7 @@ public class DynamicBomEMiddleEditUtil {
private List<BomEMiddleEntity> getNotChildList(String title, List<BomEMiddleEntity> middleList, List<BomEMiddleEntity> listChild) {
String titleChild = title + "4.0 [getNotChildList] ";
Map<Long, List<BomEMiddleEntity>> mapByPRowId = listChild.stream().filter(item -> Objects.nonNull(item.getPRowId())).collect(Collectors.groupingBy(BomEMiddleEntity::getPRowId));
if (mapByPRowId == null || mapByPRowId.size() <= 0) {
if (mapByPRowId.isEmpty()) {
// log.info(titleChild + "没有下级信息,所有的节点没有下级,返回全部节点");
return middleList;
}
@ -230,10 +230,10 @@ public class DynamicBomEMiddleEditUtil {
private void getNotChildListTree(String title, BomEMiddleEntity item, Map<Long, List<BomEMiddleEntity>> mapByPRowId, List<BomEMiddleEntity> listYesChild) {
List<BomEMiddleEntity> list = mapByPRowId.get(item.getRowId());
if (list == null || list.size() == 0) {
if (list == null || list.isEmpty()) {
// log.info(title + " 没有对应的下级节点");
// 无下级BOM状态设置
if(listYesChild.size()>0) {
if(!listYesChild.isEmpty()) {
// log.error("___________________无下级BOM状态设置:"+listYesChild.get(listYesChild.size() - 1).getRowId());
listYesChild.get(listYesChild.size() - 1).setChildBomStatus(BomEParentChildBomStatusEnum.NO.getValue());
}
@ -418,17 +418,17 @@ public class DynamicBomEMiddleEditUtil {
private Map<Long, List<BomEMiddleEntity>> getMapAllByParentRowId(String titleChild, List<BomEMiddleEntity> listMaterialNoCurtMiddle, List<BomEParentEntity> listMaterialNoCurtParent) {
long startTime = System.currentTimeMillis();
List<Long> listParentRowId = new ArrayList<>();
if (listMaterialNoCurtMiddle != null && listMaterialNoCurtMiddle.size() > 0) {
if (listMaterialNoCurtMiddle != null && !listMaterialNoCurtMiddle.isEmpty()) {
for (BomEMiddleEntity item : listMaterialNoCurtMiddle) {
listParentRowId.add(item.getParentRowId());
}
}
if (listMaterialNoCurtParent != null && listMaterialNoCurtParent.size() > 0) {
if (listMaterialNoCurtParent != null && !listMaterialNoCurtParent.isEmpty()) {
for (BomEParentEntity item : listMaterialNoCurtParent) {
listParentRowId.add(item.getRowId());
}
}
if (listParentRowId == null || listParentRowId.size() <= 0) {
if (listParentRowId.isEmpty()) {
// log.info(titleChild + "【getMapAllByParentRowId】listParentRowId为空");
return new HashMap<>();
}
@ -485,7 +485,7 @@ public class DynamicBomEMiddleEditUtil {
}
Map<Long, List<BomEMiddleEntity>> map = listBomEMiddle.stream().filter(obj -> Objects.nonNull(obj.getPRowId())).collect(Collectors.groupingBy(BomEMiddleEntity::getPRowId));
if (map == null || map.size() <= 0) {
if (map.isEmpty()) {
// log.info(titleChildChildItem + "子节点数据PRowId都为空");
continue;
}
@ -551,7 +551,7 @@ public class DynamicBomEMiddleEditUtil {
}
Map<Long, List<BomEMiddleEntity>> map = listBomEMiddle.stream().filter(obj -> Objects.nonNull(obj.getPRowId())).collect(Collectors.groupingBy(BomEMiddleEntity::getPRowId));
if (map == null || map.size() <= 0) {
if (map.isEmpty()) {
// log.info(titleChildChildItem + "子节点数据PRowId都为空");
continue;
}
@ -714,14 +714,14 @@ public class DynamicBomEMiddleEditUtil {
}
Map<Long, List<BomEMiddleEntity>> map = list.stream().filter(obj -> Objects.nonNull(obj.getPRowId())).collect(Collectors.groupingBy(BomEMiddleEntity::getPRowId));
if (map == null || map.size() <= 0) {
if (map.isEmpty()) {
// log.info(titleChild + " map所有下级节点为空");
return new HashMap<>();
}
List<BomEMiddleEntity> listResult = new ArrayList<>();
this.getListCurtTree(titleChild, rowId, map, listResult);
if (listResult == null || listResult.size() <= 0) {
if (listResult.isEmpty()) {
// log.info(titleChild + " 组装所有下级节点为空_2");
return new HashMap<>();
}
@ -844,7 +844,7 @@ public class DynamicBomEMiddleEditUtil {
this.saveOtherParentRootTreeChild(titleChild, item.getRowId(), itemNew.getRowId(), root.getRowId(), mapCurt, listResult);
}
if (listResult == null || listResult.size() <= 0) {
if (listResult.isEmpty()) {
// log.info(titleChild + "当前节点[" + rowId + "]没有需要保存的数据");
return new ArrayList<>();
}
@ -936,7 +936,7 @@ public class DynamicBomEMiddleEditUtil {
}
Map<Long, List<BomEMiddleEntity>> mapCur = list.stream().filter(obj -> Objects.nonNull(obj.getPRowId())).collect(Collectors.groupingBy(BomEMiddleEntity::getPRowId));
if (mapCur == null || mapCur.size() <= 0) {
if (mapCur.isEmpty()) {
log.info(titleChild + "按照上级节点转换成map为空");
return listResult;
}
@ -1006,7 +1006,7 @@ public class DynamicBomEMiddleEditUtil {
this.saveOtherMiddleRootTreeChild(titleChild, item.getRowId(), itemNew.getRowId(), root.getParentRowId(), mapCurt, listResult);
}
if (listResult == null || listResult.size() <= 0) {
if (listResult.isEmpty()) {
// log.info(titleChild + "当前节点[" + rowId + "]没有需要保存的数据");
return;
}

View File

@ -766,7 +766,7 @@ public class MesDynamicInspectStandardServiceImpl extends ServiceImpl<MesDynamic
if (requireSpecsMax == null) {
throw new Exception("要求规格(最大值)不能为空");
}
if(query.getScopeDeviation() == null || query.getScopeDeviation().equals("")){
if(Objects.isNull(query.getScopeDeviation())){
if (!RequireSpecsUtil.isMes(requireSpecsMin)) {
throw new Exception("要求规格(最小值)不允许除数字、小数点、负号以外的其他值");
}

View File

@ -199,10 +199,10 @@ public class PlmUtilV2 {
//System.out.println(strContextUserperson==null);
//System.out.println(strContextUserperson=="");
//System.out.println(strContextUserperson.startsWith(""));
if (strContextUserperson == null || strContextUserperson == "" || !strContextUserperson.contains("=")) {
if (!strContextUserperson.contains("=")) {
return false;
}
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2, strContextUserperson.length());
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2);
System.out.println("--" + strContextUserpersonreal + "--");
@ -211,7 +211,7 @@ public class PlmUtilV2 {
String busID = mql.getResult().trim();
System.out.println("busID--wjctest:" + busID);
if (busID == null || busID == "") {
if (busID.equals("")) {
return false;
}
@ -227,7 +227,7 @@ public class PlmUtilV2 {
String busOwner = mql.getResult().trim();
System.out.println("------------------busOwner:" + busOwner);
if (busID == null || busID == "") {
if (busOwner.equals("")) {
return false;
}
@ -315,7 +315,7 @@ public class PlmUtilV2 {
MapList UserDepartmentIds = userobj.getRelatedObjects(context, "Member", "*", busItem, null, true, false, (short) 1, null, null);
System.out.println("-------------UserDepartmentIds:" + UserDepartmentIds);
if (UserDepartmentIds.size() > 0) {
if (!UserDepartmentIds.isEmpty()) {
for (int x = 0, UserDeptSize = UserDepartmentIds.size(); x < UserDeptSize; x++) {
Map tempMap = (Map) UserDepartmentIds.get(x);
String user2deptId = (String) tempMap.get(DomainConstants.SELECT_ID);
@ -331,7 +331,7 @@ public class PlmUtilV2 {
System.out.println("------------------draw2Org:" + draw2Org);
if (draw2Org.size() > 0) {
if (!draw2Org.isEmpty()) {
for (int j = 0; j < draw2Org.size(); j++) {
java.util.Map orgMap = (java.util.Map) draw2Org.get(j);
String orgId = (String) orgMap.get("id");

View File

@ -122,16 +122,16 @@ public class PlmUtils {
mql.executeCommand(context, "print bus Person '" + strContextUser + "' - select id;");
String strContextUserperson = mql.getResult().trim();
if (strContextUserperson == null || strContextUserperson == "" || !strContextUserperson.contains("=")) {
if (!strContextUserperson.contains("=")) {
return false;
}
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2, strContextUserperson.length());
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2);
//图纸对应的部门的部门id值
mql.executeCommand(context, "print bus '" + objectId + "' select to[OrganizationToDrawing].from.id dump;");
String busID = mql.getResult().trim();
if (busID == null || busID == "") {
if (busID.equals("")) {
return false;
}
@ -143,7 +143,7 @@ public class PlmUtils {
mql.executeCommand(context, "print bus '" + objectId + "' select owner dump;");
String busOwner = mql.getResult().trim();
if (busID == null || busID == "") {
if (busOwner.equals("")) {
return false;
}
@ -212,7 +212,7 @@ public class PlmUtils {
DomainObject userobj = new DomainObject(loginUserId);
MapList UserDepartmentIds = userobj.getRelatedObjects(context, "Member", "*", busItem, null, true, false, (short) 1, null, null);
if (UserDepartmentIds.size() > 0) {
if (!UserDepartmentIds.isEmpty()) {
for (int x = 0, UserDeptSize = UserDepartmentIds.size(); x < UserDeptSize; x++) {
Map tempMap = (Map) UserDepartmentIds.get(x);
String user2deptId = (String) tempMap.get(DomainConstants.SELECT_ID);
@ -223,7 +223,7 @@ public class PlmUtils {
DomainObject drawobj = new DomainObject(objectId);
MapList draw2Org = drawobj.getRelatedObjects(context, "OrganizationToDrawing", "*", busItem, null, true, false, (short) 1, null, null);
if (draw2Org.size() > 0) {
if (!draw2Org.isEmpty()) {
for (int j = 0; j < draw2Org.size(); j++) {
java.util.Map orgMap = (java.util.Map) draw2Org.get(j);
String orgId = (String) orgMap.get("id");

View File

@ -92,7 +92,7 @@ public class AuthorityDepartmentService extends ServiceImpl<AuthorityDepartmentM
*/
private List<AuthorityDepartmentVO> builderDepartmentTree(List<AuthorityDepartmentVO> datas){
List<AuthorityDepartmentVO> first = datas.stream().filter(u -> u.getParentRowId()==0).collect(Collectors.toList());
if(!Objects.isNull(first)) {
if(!first.isEmpty()) {
for (AuthorityDepartmentVO depart : first) {
TreeUtil.buildTree(depart, AuthorityDepartmentVO::getParentRowId, AuthorityDepartmentVO::getRowId, datas, AuthorityDepartmentVO::setChildren);
}

View File

@ -285,13 +285,13 @@ public class AuthorityMenuService extends ServiceImpl<AuthorityMenuMapper, Autho
for (AuthorityMenuVO menu : permisionMeNu) {
if(menu.getParentRowId()!=0) {
List<AuthorityMenuVO> subMenuNodes = datas.stream().filter(u -> u.getParentRowId().equals(menu.getParentRowId())).collect(Collectors.toList());
if (!Objects.isNull(subMenuNodes) && subMenuNodes.size() > 0) {
int min = subMenuNodes.stream().mapToInt(u -> u.getSelectedType()).min().getAsInt();
int max = subMenuNodes.stream().mapToInt(u -> u.getSelectedType()).max().getAsInt();
if (!subMenuNodes.isEmpty()) {
int min = subMenuNodes.stream().mapToInt(AuthorityMenuVO::getSelectedType).min().getAsInt();
int max = subMenuNodes.stream().mapToInt(AuthorityMenuVO::getSelectedType).max().getAsInt();
if(min>0){
menuMp.get(menu.getParentRowId()).setSelectedType(max);
}
else if (min<=0 && max<=0){
else if (max<=0){
menuMp.get(menu.getParentRowId()).setSelectedType(0);
}
else {
@ -305,7 +305,7 @@ public class AuthorityMenuService extends ServiceImpl<AuthorityMenuMapper, Autho
}
}
}
if (result.size() > 0) {
if (!result.isEmpty()) {
buildParentMenuPermissionTag(datas, result, menuMp);
}
}

View File

@ -728,7 +728,7 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
List<MaterialMainExtEntity> extList = materialMainExtService.lambdaQuery().in(MaterialMainExtEntity::getMaterialRowId, materialRowIds).list();
Map<Long, MaterialMainExtEntity> extMp = ListCommonUtil.listToMap(extList, MaterialMainExtEntity::getMaterialRowId);
// 有子类别说明不是最小类只保留三个值001002replenish把进描述的写进去
if (childList != null && childList.size() > 0) {
if (childList != null && !childList.isEmpty()) {
list.forEach(k -> {
if (extMp.containsKey(k.get("rowId"))) {
List<MaterialMainAttrDTO> attrs = JSON.parseArray(extMp.get(k.get("rowId")).getMaterialExt(), MaterialMainAttrDTO.class);

View File

@ -664,14 +664,14 @@ public class MaterialUpdateBillService extends ServiceImpl<MaterialUpdateBillMap
* @param materialNos
*/
private void checkMaterialRep(List<String> materialNos) {
List<String> collect = materialNos.stream().filter(i -> i != "") // list 对应的 Stream 并过滤""
List<String> collect = materialNos.stream().filter(i -> !Objects.equals(i, "")) // list 对应的 Stream 并过滤""
.collect(Collectors.toMap(e -> e, e -> 1, Integer::sum)) // 获得元素出现频率的 Map键为元素值为元素出现的次数
.entrySet()
.stream() // 所有 entry 对应的 Stream
.filter(e -> e.getValue() > 1) // 过滤出元素出现次数大于 1 (重复元素 entry
.map(Map.Entry::getKey) // 获得 entry 的键重复元素对应的 Stream
.collect(Collectors.toList());
if (collect.size() > 0) {
if (!collect.isEmpty()) {
throw new NflgBusinessException(STATE.ParamErr, StrUtil.join(",", collect).concat("物料编码重复"));
}
}

View File

@ -67,7 +67,7 @@ public class ClassCompareUtil {
if (oldValue == null && newValue == null) {
continue;
} else if (oldValue == null && newValue != null) {
} else if (oldValue == null) {
Map<String, Object> valueMap = new HashMap<String, Object>(16);
valueMap.put("oldValue", oldValue);
valueMap.put("newValue", newValue);

View File

@ -224,10 +224,10 @@ public class PlmUtilV2 {
//System.out.println(strContextUserperson==null);
//System.out.println(strContextUserperson=="");
//System.out.println(strContextUserperson.startsWith(""));
if (strContextUserperson==null||strContextUserperson==""||!strContextUserperson.contains("=")){
if (!strContextUserperson.contains("=")){
return false;
}
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2, strContextUserperson.length());
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2);
System.out.println("--"+strContextUserpersonreal+"--");
@ -236,7 +236,7 @@ public class PlmUtilV2 {
String busID=mql.getResult().trim();
System.out.println("busID--wjctest:"+busID);
if (busID==null||busID==""){
if (busID.equals("")){
return false;
}
@ -252,7 +252,7 @@ public class PlmUtilV2 {
String busOwner=mql.getResult().trim();
System.out.println("------------------busOwner:" +busOwner);
if (busID==null||busID==""){
if (busOwner.equals("")){
return false;
}
@ -365,7 +365,7 @@ public class PlmUtilV2 {
MapList UserDepartmentIds=userobj.getRelatedObjects(context,"Member","*",busItem,null,true,false,(short)1,null,null);
System.out.println("-------------UserDepartmentIds:"+UserDepartmentIds);
if(UserDepartmentIds.size() > 0 ){
if(!UserDepartmentIds.isEmpty()){
for(int x = 0,UserDeptSize = UserDepartmentIds.size();x < UserDeptSize; x++){
Map tempMap = (Map)UserDepartmentIds.get(x);
String user2deptId = (String)tempMap.get(DomainConstants.SELECT_ID);
@ -381,7 +381,7 @@ public class PlmUtilV2 {
System.out.println("------------------draw2Org:" +draw2Org);
if(draw2Org.size() > 0 ){
if(!draw2Org.isEmpty()){
for (int j = 0; j < draw2Org.size(); j++) {
java.util.Map orgMap = (java.util.Map)draw2Org.get(j);
String orgId = (String)orgMap.get("id");

View File

@ -131,16 +131,16 @@ public class PlmUtils {
mql.executeCommand(context, "print bus Person '" + strContextUser + "' - select id;");
String strContextUserperson = mql.getResult().trim();
if (strContextUserperson == null || strContextUserperson == "" || !strContextUserperson.contains("=")) {
if (!strContextUserperson.contains("=")) {
return false;
}
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2, strContextUserperson.length());
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2);
//图纸对应的部门的部门id值
mql.executeCommand(context, "print bus '" + objectId + "' select to[OrganizationToDrawing].from.id dump;");
String busID = mql.getResult().trim();
if (busID == null || busID == "") {
if (busID.equals("")) {
return false;
}
@ -152,7 +152,7 @@ public class PlmUtils {
mql.executeCommand(context, "print bus '" + objectId + "' select owner dump;");
String busOwner = mql.getResult().trim();
if (busID == null || busID == "") {
if (busOwner.equals("")) {
return false;
}
@ -227,7 +227,7 @@ public class PlmUtils {
DomainObject userobj = new DomainObject(loginUserId);
MapList UserDepartmentIds = userobj.getRelatedObjects(context, "Member", "*", busItem, null, true, false, (short) 1, null, null);
if (UserDepartmentIds.size() > 0) {
if (!UserDepartmentIds.isEmpty()) {
for (int x = 0, UserDeptSize = UserDepartmentIds.size(); x < UserDeptSize; x++) {
Map tempMap = (Map) UserDepartmentIds.get(x);
String user2deptId = (String) tempMap.get(DomainConstants.SELECT_ID);
@ -239,7 +239,7 @@ public class PlmUtils {
MapList draw2Org = drawobj.getRelatedObjects(context, "OrganizationToDrawing", "*",
busItem, null, true, false, (short) 1, null, null);
if (draw2Org.size() > 0) {
if (!draw2Org.isEmpty()) {
for (int j = 0; j < draw2Org.size(); j++) {
java.util.Map orgMap = (java.util.Map) draw2Org.get(j);
String orgId = (String) orgMap.get("id");

View File

@ -306,10 +306,10 @@ public class PlmUtilsV3 {
//System.out.println(strContextUserperson==null);
//System.out.println(strContextUserperson=="");
//System.out.println(strContextUserperson.startsWith(""));
if (strContextUserperson == null || strContextUserperson == "" || !strContextUserperson.contains("=")) {
if (!strContextUserperson.contains("=")) {
return false;
}
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2, strContextUserperson.length());
String strContextUserpersonreal = strContextUserperson.substring(strContextUserperson.indexOf("=") + 2);
System.out.println("--" + strContextUserpersonreal + "--");
@ -318,7 +318,7 @@ public class PlmUtilsV3 {
String busID = mql.getResult().trim();
System.out.println("busID--wjctest:" + busID);
if (busID == null || busID == "") {
if (busID.equals("")) {
return false;
}
@ -334,7 +334,7 @@ public class PlmUtilsV3 {
String busOwner = mql.getResult().trim();
System.out.println("------------------busOwner:" + busOwner);
if (busID == null || busID == "") {
if (busOwner.equals("")) {
return false;
}

View File

@ -111,7 +111,7 @@ public class OConvertUtils {
* 如果转换前的下划线大写方式命名的字符串为空则返回空字符串</br>
* 例如hello_world,test_id->helloWorld,testId
*
* @param name 转换前的下划线大写方式命名的字符串
* @param names 转换前的下划线大写方式命名的字符串
* @return 转换后的驼峰式命名的字符串
*/
public static String camelNames(String names) {

View File

@ -160,11 +160,11 @@ public class BomReportApi extends BaseApi {
ResultVO resultBom2VO = checkQueryParam(query.getRight());
if (resultBom1VO != null) {
new NflgBusinessException(STATE.Error, resultBom1VO.getMsg());
throw new NflgBusinessException(STATE.Error, resultBom1VO.getMsg());
}
if (resultBom2VO != null) {
new NflgBusinessException(STATE.Error, resultBom1VO.getMsg());
throw new NflgBusinessException(STATE.Error, resultBom2VO.getMsg());
}
EecExcelUtil.setResponseExcelHeader(response, "BOM比对");

View File

@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.ImmutableList;
import com.mzt.logapi.context.LogRecordContext;
import com.mzt.logapi.starter.annotation.LogRecord;
import com.nflg.product.base.core.api.BaseApi;
import com.nflg.product.base.core.conmon.util.SessionUtil;
@ -290,9 +289,7 @@ public class EbomApi extends BaseApi {
VUtils.isTure(true ).throwMessage("bomRowId不能为空");
}
ResultVO resultVO = new ResultVO();
resultVO.setData(bomNewEbomParentService.editDetail(rowId,bomRowId,projectType));
return resultVO;
return ResultVO.success(bomNewEbomParentService.editDetail(rowId,bomRowId,projectType));
}
@PostMapping("updateProjectType")
@ -341,9 +338,7 @@ public class EbomApi extends BaseApi {
@ApiOperation("删除物料")
@LogRecord(success = "Ebom-删除物料,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#bomRowId}}",type = "Ebom-删除物料")
public ResultVO<Boolean> deleteBom(@RequestParam("bomRowId") Long bomRowId ) throws ExecutionException, InterruptedException{
bomNewEbomParentService.deleteBom(bomRowId);
return ResultVO.success(true);
return ResultVO.success(bomNewEbomParentService.deleteBom(bomRowId));
}

View File

@ -267,8 +267,8 @@ public class BomFactorySplitRuleService extends ServiceImpl<BomFactorySplitRuleM
List<BomFactorySplitRuleEntity> splitRuleList = new ArrayList<>();
List<BomFactoryRuleGroupEntity> ruleGroupList = new ArrayList<>();
// 如果规则分组有值判断规则分组表是否包含该规则分组值
List<String> ruleGroupNameList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getRuleGroupName())).map(BomFactorySplitRuleVO::getRuleGroupName).distinct().collect(Collectors.toList());
if(ruleGroupNameList != null && ruleGroupNameList.size()>0) {
List<String> ruleGroupNameList = requestList.stream().map(BomFactorySplitRuleVO::getRuleGroupName).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
if(!ruleGroupNameList.isEmpty()) {
List<BomFactoryRuleGroupEntity> ruleGroupEntityList = bomFactoryRuleGroupService.lambdaQuery().in(BomFactoryRuleGroupEntity::getRuleGroupName, ruleGroupNameList).list();
if (CollUtil.isNotEmpty(ruleGroupEntityList)) {
ruleGroupList.addAll(ruleGroupEntityList);
@ -281,8 +281,8 @@ public class BomFactorySplitRuleService extends ServiceImpl<BomFactorySplitRuleM
}
List<MaterialCategoryEntity> categoryList = new ArrayList<>();
List<String> categoryCodeList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getMaterialCategoryCode())).map(BomFactorySplitRuleVO::getMaterialCategoryCode).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> nextCategoryCodeList = requestList.stream().filter(item->StringUtils.isNotEmpty(item.getNextMaterialCategoryCode())).map(BomFactorySplitRuleVO::getNextMaterialCategoryCode).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> categoryCodeList = requestList.stream().map(BomFactorySplitRuleVO::getMaterialCategoryCode).filter(StringUtils::isNotEmpty).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> nextCategoryCodeList = requestList.stream().map(BomFactorySplitRuleVO::getNextMaterialCategoryCode).filter(StringUtils::isNotEmpty).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
List<String> allCategoryCodeList = new ArrayList<>();
if (CollUtil.isNotEmpty(categoryCodeList)) {
allCategoryCodeList.addAll(categoryCodeList);
@ -296,7 +296,7 @@ public class BomFactorySplitRuleService extends ServiceImpl<BomFactorySplitRuleM
return ResultVO.error("请输入正确的物料分类代码");
}
}
if(categoryList != null && categoryList.size()>0) {
if(!categoryList.isEmpty()) {
List<String> ccList = categoryList.stream().map(MaterialCategoryEntity::getCategoryCode).collect(Collectors.toList());
List<String> reduceCcList = allCategoryCodeList.stream().filter(item -> !ccList.contains(item)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(reduceCcList)) {

View File

@ -6,12 +6,12 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.EnumUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@ -25,7 +25,10 @@ import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.*;
import com.nflg.product.bomnew.mapper.master.BomNewEbomParentMapper;
import com.nflg.product.bomnew.pojo.dto.*;
import com.nflg.product.bomnew.pojo.entity.*;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomMaterialUseEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
import com.nflg.product.bomnew.pojo.vo.*;
@ -152,17 +155,17 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
private Page<BomNewEbomParentVO> handSeachToTree(List<BomNewEbomParentVO> parents, List<BomNewEbomParentVO> childs) {
Page<BomNewEbomParentVO> resutlData = new Page<>();
Set<String> parentSet = parents.stream().map(u -> u.getMaterialNo()).collect(Collectors.toSet());
Set<String> childSet = childs.stream().map(u -> u.getMaterialNo()).collect(Collectors.toSet());
Set<String> parentSet = parents.stream().map(BaseMaterialVO::getMaterialNo).collect(Collectors.toSet());
Set<String> childSet = childs.stream().map(BaseMaterialVO::getMaterialNo).collect(Collectors.toSet());
Set<String> difference = Sets.difference(parentSet, childSet);
List<BomNewEbomParentVO> resultParents = parents.stream().filter(u -> difference.contains(u.getMaterialNo())).collect(Collectors.toList());
resutlData.setTotal(difference.size());
resutlData.setSize(difference.size());
resutlData.setPages(1);
resutlData.setCurrent(1L);
List<BomNewEbomParentVO> all = new ArrayList<>();
// List<BomNewEbomParentVO> all = new ArrayList<>();
// all.addAll(resultParents);
all.addAll(childs);
// all.addAll(childs);
List<BomNewEbomParentVO> result = new ArrayList<>();
for (BomNewEbomParentVO vo : resultParents) {
vo.setParentRowId(-1L);
@ -242,8 +245,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}
private Set<String> getSelfMaterialNo(Set<String> relSkuNo) {
Set<String> selfParentMaterialNo = this.getBaseMapper().getSelfParentMaterialNo(SessionUtil.getUserCode(), relSkuNo);
return selfParentMaterialNo;
return this.getBaseMapper().getSelfParentMaterialNo(SessionUtil.getUserCode(), relSkuNo);
}
@ -258,17 +260,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
if (CollUtil.isNotEmpty(result.getRecords())) {
materialMainService.intiMaterialInfo(result.getRecords());
} else {
//查bom是否存在
LambdaQueryWrapper<BomNewEbomChildEntity> wrapper = new LambdaQueryWrapper<>();
if (StrUtil.isNotBlank(query.getDrawingNo())) {
wrapper.eq(BomNewEbomChildEntity::getDrawingNo, query.getDrawingNo());
} else if (StrUtil.isNotBlank(query.getMaterialNo())) {
wrapper.eq(BomNewEbomChildEntity::getMaterialNo, query.getMaterialNo());
}
if (wrapper.nonEmptyOfWhere() && ebomChildService.getBaseMapper().selectCount(wrapper) > 0) {
VUtils.isTure(true).throwMessage("不存在此BOM物料");
}
}
return result;
@ -282,9 +273,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* @return
*/
public Page<BomNewEbomUpgradeChangeVO> getUpgradeChangeList(BomNewEbomParentQuery query) {
Page<BomNewEbomUpgradeChangeVO> result = this.getBaseMapper().getUpgradeChangeList(new Page<>(query.getPage(), query.getPageSize()), query);
return result;
return this.getBaseMapper().getUpgradeChangeList(new Page<>(query.getPage(), query.getPageSize()), query);
}
@ -330,11 +319,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
child.setNoticeNums(parentEntity.getNoticeNums());
child.setSuperMaterialStatus(parentEntity.getSuperMaterialStatus());
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue()) && EBomStatusEnum.PUBLISHED.getValue() > parentEntity.getStatus()) {
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
}
//非本人则为借用件
if (!parentEntity.getCreatedBy().equals(child.getCreatedBy()) && EBomStatusEnum.PUBLISHED.getValue() > parentEntity.getStatus()) {
else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
child.setStatus(EBomStatusEnum.REFERENCE.getValue());
}
@ -465,7 +454,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
childEntity.setProjectType(u.getProjectType());
childEntity.setProjectTypeInputType(u.getProjectTypeInputType());
if (Objects.isNull(u.getExceptionStatus())) {
childEntity.setExceptionStatus(u.getExceptionStatus());
childEntity.setExceptionStatus(null);
}
child.add(childEntity);
});
@ -1491,6 +1480,11 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
// VUtils.isTure(!parentEntity.getCreatedBy().equals(SessionUtil.getUserCode())).throwMessage("该节点不属于你,你无权删除");
// }
//待复核和已退回才能删除
VUtils.isTure(parentEntity.getStatus().equals(EBomStatusEnum.WAIT_CHECK.getValue())
|| parentEntity.getStatus().equals(EBomStatusEnum.RETURNED.getValue()))
.throwMessage(EnumUtil.fromString(EBomStatusEnum.class, parentEntity.getStatus().toString()).getDescription() + "状态不能删除");
EBomDel eBomDel = new EBomDel(bomRowId);
eBomDel.classifyBom();

View File

@ -20,6 +20,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewOriginalMaterialUseEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewOriginalParentEntity;
import com.nflg.product.bomnew.pojo.entity.BomOriginalCadParentEntity;
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
import com.nflg.product.bomnew.pojo.vo.BomOriginalPlmBomVO;
import com.nflg.product.bomnew.pojo.vo.ImportOriginalBomVO;
@ -119,9 +120,9 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
resutlData.setSize(difference.size());
resutlData.setPages(1);
resutlData.setCurrent(1L);
List<BomOriginalListVO> all = new ArrayList<>();
// List<BomOriginalListVO> all = new ArrayList<>();
// all.addAll(resultParents);
all.addAll(childs);
// all.addAll(childs);
List<BomOriginalListVO> result = new ArrayList<>();
for (BomOriginalListVO vo : resultParents) {
vo.setParentRowId(-1L);
@ -237,7 +238,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
List<BomOriginalListVO> parentChild = this.getBaseMapper().getParentChild(rowId);
materialMainService.intiMaterialInfo(parentChild);
if (CollUtil.isNotEmpty(parentChild)) {
List<String> drawingNos = parentChild.stream().map(u -> u.getDrawingNo()).collect(Collectors.toList());
List<String> drawingNos = parentChild.stream().map(BaseMaterialVO::getDrawingNo).collect(Collectors.toList());
if (CollUtil.isNotEmpty(drawingNos)) {
List<BomNewOriginalParentEntity> list = this.lambdaQuery().in(BomNewOriginalParentEntity::getDrawingNo, drawingNos)
.eq(OriginalStatusEnum.UN_CONVERT.equalsValue(parent.getStatus()),BomNewOriginalParentEntity::getLastVersionIs, 1)
@ -258,16 +259,16 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
child.setLevelNum(parentEntity.getLevelNum());
child.setDeptName(parentEntity.getDeptName());
child.setSource(parentEntity.getSource());
if (parentEntity.getStatus().equals(OriginalStatusEnum.OVER_CONVERT)) {
if (parentEntity.getStatus().equals(OriginalStatusEnum.OVER_CONVERT.getValue())) {
child.setStatus(OriginalStatusEnum.BORROWED_PARTS.getValue());
}
//非本人则为借用件
if (!parentEntity.getCreatedBy().equals(child.getCreatedBy()) && OriginalStatusEnum.UN_CONVERT.equalsValue(parentEntity.getStatus())) {
else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
child.setStatus(OriginalStatusEnum.REFERENCE.getValue());
}
} else { //无BOM-版本时 确定版本号
child.setStatus(parent.getStatus());
child.setSource(Objects.nonNull(parent) ? parent.getSource() : OriginalSourceEnum.CAD_IMPORT.getValue());
child.setSource(Objects.nonNull(parent.getSource()) ? parent.getSource() : OriginalSourceEnum.CAD_IMPORT.getValue());
child.setDeviseUserCode(parent.getDeviseUserCode());
child.setDeviseName(parent.getDeviseName());
child.setDeptName(parent.getDeptName());

View File

@ -156,9 +156,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
resutlData.setSize(difference.size());
resutlData.setPages(1);
resutlData.setCurrent(1L);
List<BomNewPbomParentVO> all = new ArrayList<>();
// List<BomNewPbomParentVO> all = new ArrayList<>();
// all.addAll(resultParents);
all.addAll(childs);
// all.addAll(childs);
List<BomNewPbomParentVO> result = new ArrayList<>();
for (BomNewPbomParentVO vo : resultParents) {
vo.setParentRowId(-1L);
@ -952,7 +952,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
ImportSapParamDTO importParm = sap.buildSyncSapParam();
if (CollUtil.isNotEmpty(importParm.getT1())) {
ResultVO<Boolean> booleanResultVO = sapOpUtilService.importToSap(importParm);
VUtils.isTure(!booleanResultVO.getState().equals(STATE.Success)).throwMessage("同步SAP失败" + booleanResultVO.getMsg());
VUtils.isTure(!booleanResultVO.getState().equals(STATE.Success.getState())).throwMessage("同步SAP失败" + booleanResultVO.getMsg());
}
}

View File

@ -77,7 +77,7 @@ public class CrmService {
String orderResult = httpUtils.doPost(NacosConfig.getNacosConfig().getCrmOrderUrl(), JSON.toJSONString(reBody), token);
JSONObject jsonObject = JSONObject.parseObject(orderResult);
String code = jsonObject.getString("code");
if (code == "0") {
if (Objects.equals(code, "0")) {
String orderMap = jsonObject.getString("orderMap");
if (StrUtil.isNotBlank(orderMap)) {
JSONObject order = JSONObject.parseObject(orderMap);

View File

@ -23,6 +23,7 @@ import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
@Service
@ -125,7 +126,7 @@ public class SapOpUtilService {
log.info("PBOM导入到SAP--返回值:" + JSON.toJSONString(exportMap));
String eErrmsg = String.valueOf(exportMap.get("E_ERRMSG"));
if (StrUtil.isNotEmpty(eErrmsg) && eErrmsg!="null") {
if (StrUtil.isNotEmpty(eErrmsg) && !Objects.equals(eErrmsg, "null")) {
return ResultVO.error(STATE.Error, eErrmsg);
}
} catch (Exception e) {

View File

@ -160,15 +160,15 @@ public class CheckEBomException {
}
}
if (ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.equals(parent.getProjectType())) {
List<BomNewEbomParentVO> qList = child.stream().filter(u -> ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.equals(u.getProjectType())).collect(Collectors.toList());
if (ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue().equals(parent.getProjectType())) {
List<BomNewEbomParentVO> qList = child.stream().filter(u -> ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue().equals(u.getProjectType())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(qList)) {
parent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue());
qList.forEach(u -> u.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue()));
}
}
if (ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.equals(parent.getProjectType())) {
List<BomNewEbomParentVO> qList = child.stream().filter(u -> ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.equals(u.getProjectType())).collect(Collectors.toList());
if (ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue().equals(parent.getProjectType())) {
List<BomNewEbomParentVO> qList = child.stream().filter(u -> ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue().equals(u.getProjectType())).collect(Collectors.toList());
if (CollUtil.isNotEmpty(qList)) {
parent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue());
qList.forEach(u -> u.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()));

View File

@ -91,7 +91,7 @@ public class ConvertToMBom1020 extends ConvertToMBomBase{
//非31下的直发包
if (!item.getParentRowId().equals(parent.getRowId())) {
ConvertToMBomDTO parentNode = getParent(item.getParentRowId(), EBomConstant.XIAN_TAO_FACTORY_CODE_1020);
if (VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(parentNode.getVirtualPartType()) && parentNode.getRowId() != directDeliveryPackage.getRowId()) {
if (VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.equalsValue(parentNode.getVirtualPartType()) && !Objects.equals(parentNode.getRowId(), directDeliveryPackage.getRowId())) {
handlerDirectDeliveryPackage(item, EBomConstant.XIAN_TAO_FACTORY_CODE_1020, directDeliveryPackage);
} else {
handlerMaterial(item, EBomConstant.XIAN_TAO_FACTORY_CODE_1020);

View File

@ -68,7 +68,7 @@ public class PBomUpgrade {
*/
private void check() {
List<BomNewPbomParentEntity> waitPublishList = SpringUtil.getBean(BomNewPbomParentService.class).lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, root.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, root.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, root.getFacCode())
.lt(BomNewPbomParentEntity::getStatus, PBomStatusEnum.PUBLISH.getValue()).list();
VUtils.isTure(CollUtil.isNotEmpty(waitPublishList)).throwMessage(root.getMaterialNo() + "存在待发布的版本,无法升级");
}

View File

@ -67,7 +67,7 @@ public class ClassCompareUtil {
if (oldValue == null && newValue == null) {
continue;
} else if (oldValue == null && newValue != null) {
} else if (oldValue == null) {
Map<String, Object> valueMap = new HashMap<String, Object>(16);
valueMap.put("oldValue", oldValue);
valueMap.put("newValue", newValue);

View File

@ -25,16 +25,14 @@ public class BaseApi {
@ModelAttribute
private void initLoginInfo(HttpServletRequest request) {
try {
String token = request.getHeader("authorization").toString();
String language=Objects.nonNull(request.getHeader("language"))? request.getHeader("language").toString():"zh_cn";
String token = request.getHeader("authorization");
String language=Objects.nonNull(request.getHeader("language"))? request.getHeader("language") :"zh_cn";
ResultVO result = JwtUtil.parse(token);
if (result.getState().equals(STATE.Success.getState())) {
LoginUserInfoDTO userInfo = (LoginUserInfoDTO) result.getData();
userInfo.setSessionKey(token);
userInfo.setLanguage(language);
if (!Objects.isNull(userInfo)) {
loginUser.set(userInfo);
}
loginUser.set(userInfo);
}
} catch (Exception ex) {
// throw new NflgBusinessException(STATE.SystemErr,"token 解析出错");