Merge remote-tracking branch 'origin/master-hlq20241014ebom'
This commit is contained in:
commit
9bd0a9c664
|
|
@ -4,9 +4,10 @@ import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import com.nflg.product.bomnew.pojo.vo.MaterialMateVO;
|
import com.nflg.product.bomnew.pojo.vo.MaterialMateVO;
|
||||||
import com.nflg.product.bomnew.service.MaterialMainService;
|
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class MaterialMateCache {
|
public class MaterialMateCache {
|
||||||
|
|
@ -23,7 +24,6 @@ public class MaterialMateCache {
|
||||||
public MaterialMateVO findMaterialByNameOrmaterialTexture(String materialName, String materialTexture){
|
public MaterialMateVO findMaterialByNameOrmaterialTexture(String materialName, String materialTexture){
|
||||||
for (MaterialMateVO mate : materialMateList) {
|
for (MaterialMateVO mate : materialMateList) {
|
||||||
StringBuilder namePatternRel= new StringBuilder();
|
StringBuilder namePatternRel= new StringBuilder();
|
||||||
String texturePatternRel= "";
|
|
||||||
String namePattern=mate.getMaterialName();
|
String namePattern=mate.getMaterialName();
|
||||||
|
|
||||||
List<String> namePatternItems = StrUtil.split(namePattern,'/');
|
List<String> namePatternItems = StrUtil.split(namePattern,'/');
|
||||||
|
|
@ -40,14 +40,17 @@ public class MaterialMateCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Set<Boolean> booleanSet = new HashSet<>();
|
||||||
if(StrUtil.isNotBlank(mate.getMaterialTexture())) {
|
if(StrUtil.isNotBlank(mate.getMaterialTexture())) {
|
||||||
texturePatternRel = mate.getMaterialTexture().replace('/', '|');
|
List<String> texturePatternItems = StrUtil.split(mate.getMaterialTexture(), '/');
|
||||||
|
for (String texturePatternItem: texturePatternItems) {
|
||||||
|
// 材质应该是等于其中一个,而不是包含其中一个 modify by 10001392
|
||||||
|
booleanSet.add(texturePatternItem.equals(StrUtil.isBlank(materialTexture)?"":materialTexture));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Pattern p = Pattern.compile(namePatternRel.toString());
|
Pattern p = Pattern.compile(namePatternRel.toString());
|
||||||
Pattern p2 = Pattern.compile(texturePatternRel);
|
if(p.matcher(materialName).find() && booleanSet.contains(Boolean.TRUE)){
|
||||||
if(p.matcher(materialName).find() && p2.matcher(StrUtil.isBlank(materialTexture)?"":materialTexture ).find()){
|
|
||||||
return mate;
|
return mate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,6 +314,11 @@ public class EBomEdit {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 忽略分类代码是原材料的
|
||||||
|
List<BaseMaterialVO> materialBaseInfos = SpringUtil.getBean(MaterialMainService.class).getMaterialBaseInfo(Collections.singletonList(childEntity.getMaterialNo()));
|
||||||
|
if (CollUtil.isNotEmpty(materialBaseInfos) && materialBaseInfos.get(0).getMaterialCategoryCode().startsWith("1001")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//检查物料id是否被修改,根据情况还可加入其他条件
|
//检查物料id是否被修改,根据情况还可加入其他条件
|
||||||
if (!mapList.get(childEntity.getRowId()).getMaterialNo().equals(childEntity.getMaterialNo())) {
|
if (!mapList.get(childEntity.getRowId()).getMaterialNo().equals(childEntity.getMaterialNo())) {
|
||||||
throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以修改 ", childEntity.getMaterialNo()));
|
throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以修改 ", childEntity.getMaterialNo()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue