|
@@ -160,6 +160,9 @@ public class BomSpecServiceImpl extends ServiceImpl<BomSpecMapper, BomSpec> impl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BigDecimal getPriceByParam(BomSpecPriceComputeDto dto) {
|
|
public BigDecimal getPriceByParam(BomSpecPriceComputeDto dto) {
|
|
|
|
+ if (dto.getLength() == null || dto.getWidth() == null || dto.getHeight() == null) {
|
|
|
|
+ return BigDecimal.ZERO;
|
|
|
|
+ }
|
|
Long bomClassifyId = dto.getBomClassifyId();
|
|
Long bomClassifyId = dto.getBomClassifyId();
|
|
if (!Objects.equals(bomClassifyId, BomClassifyConstant.YOGA_MAT) &&
|
|
if (!Objects.equals(bomClassifyId, BomClassifyConstant.YOGA_MAT) &&
|
|
!Objects.equals(bomClassifyId, BomClassifyConstant.SKIP_MAT)) {
|
|
!Objects.equals(bomClassifyId, BomClassifyConstant.SKIP_MAT)) {
|
|
@@ -178,10 +181,10 @@ public class BomSpecServiceImpl extends ServiceImpl<BomSpecMapper, BomSpec> impl
|
|
DictCommonData::getDictKey,
|
|
DictCommonData::getDictKey,
|
|
DictCommonData::getDictValue)
|
|
DictCommonData::getDictValue)
|
|
));
|
|
));
|
|
- String sellingPriceSystem = dictMap.getOrDefault("bom_sellingPriceSystem", Collections.emptyMap()).get(dto.getSellingPriceSystem());
|
|
|
|
|
|
+ String level = dictMap.getOrDefault("bom_level", Collections.emptyMap()).get(dto.getLevel());
|
|
String chromatophore = dictMap.getOrDefault("bom_chromatophore", Collections.emptyMap()).get(dto.getChromatophore());
|
|
String chromatophore = dictMap.getOrDefault("bom_chromatophore", Collections.emptyMap()).get(dto.getChromatophore());
|
|
String embossingProcess = dictMap.getOrDefault("bom_embossingProcess", Collections.emptyMap()).get(dto.getEmbossingProcess());
|
|
String embossingProcess = dictMap.getOrDefault("bom_embossingProcess", Collections.emptyMap()).get(dto.getEmbossingProcess());
|
|
- if (StrUtil.isBlank(sellingPriceSystem) || StrUtil.isBlank(chromatophore) || StrUtil.isBlank(embossingProcess)) {
|
|
|
|
|
|
+ if (StrUtil.isBlank(level) || StrUtil.isBlank(chromatophore) || StrUtil.isBlank(embossingProcess)) {
|
|
return BigDecimal.ZERO;
|
|
return BigDecimal.ZERO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -192,10 +195,17 @@ public class BomSpecServiceImpl extends ServiceImpl<BomSpecMapper, BomSpec> impl
|
|
// 计算bom每平方价格
|
|
// 计算bom每平方价格
|
|
BigDecimal price = BigDecimal.ZERO;
|
|
BigDecimal price = BigDecimal.ZERO;
|
|
// 等级
|
|
// 等级
|
|
|
|
+ // 获取售价体系,10为体系一,20为体系二
|
|
|
|
+ int bomType;
|
|
|
|
+ if (Objects.equals(dto.getSellingPriceSystem(), "10")) {
|
|
|
|
+ bomType = 0;
|
|
|
|
+ } else {
|
|
|
|
+ bomType = 1;
|
|
|
|
+ }
|
|
List<BomSpecPriceConfig> bomSpecMaterialConfigList = configCodeMap
|
|
List<BomSpecPriceConfig> bomSpecMaterialConfigList = configCodeMap
|
|
.getOrDefault(BomSpecPriceConfigCodeEnum.BASE_MATERIAL_PRICE.getKey(), Collections.emptyList());
|
|
.getOrDefault(BomSpecPriceConfigCodeEnum.BASE_MATERIAL_PRICE.getKey(), Collections.emptyList());
|
|
BomSpecPriceConfig levelDetail = bomSpecMaterialConfigList.stream()
|
|
BomSpecPriceConfig levelDetail = bomSpecMaterialConfigList.stream()
|
|
- .filter(item -> item.getName().contains(sellingPriceSystem))
|
|
|
|
|
|
+ .filter(item -> item.getType() == bomType && item.getName().contains(level))
|
|
.findAny().orElse(null);
|
|
.findAny().orElse(null);
|
|
if (levelDetail == null) {
|
|
if (levelDetail == null) {
|
|
return BigDecimal.ZERO;
|
|
return BigDecimal.ZERO;
|
|
@@ -335,6 +345,7 @@ public class BomSpecServiceImpl extends ServiceImpl<BomSpecMapper, BomSpec> impl
|
|
dto.setBomClassifyId(bom.getBomClassifyId());
|
|
dto.setBomClassifyId(bom.getBomClassifyId());
|
|
dto.setChromatophore(bom.getChromatophore());
|
|
dto.setChromatophore(bom.getChromatophore());
|
|
dto.setSellingPriceSystem(bom.getSellingPriceSystem());
|
|
dto.setSellingPriceSystem(bom.getSellingPriceSystem());
|
|
|
|
+ dto.setLevel(bom.getLevel());
|
|
dto.setEmbossingProcess(bom.getEmbossingProcess());
|
|
dto.setEmbossingProcess(bom.getEmbossingProcess());
|
|
dto.setColour(bomSpec.getColour());
|
|
dto.setColour(bomSpec.getColour());
|
|
dto.setLength(bomSpec.getLength());
|
|
dto.setLength(bomSpec.getLength());
|