|
@@ -73,7 +73,7 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
|
|
|
|
//检查许可费率数值是否合法
|
|
//检查许可费率数值是否合法
|
|
Double licenseRate = productCategoryAddNewDTO.getLicenseRate();
|
|
Double licenseRate = productCategoryAddNewDTO.getLicenseRate();
|
|
- if (licenseRate < 0 || licenseRate > 1) {
|
|
|
|
|
|
+ if (licenseRate != null && (licenseRate < 0 || licenseRate > 1)) {
|
|
String message = "新增产品失败,许可费率不合法,请填写正确数值";
|
|
String message = "新增产品失败,许可费率不合法,请填写正确数值";
|
|
log.info("{}", message);
|
|
log.info("{}", message);
|
|
throw new XiaoShiException(message);
|
|
throw new XiaoShiException(message);
|
|
@@ -321,12 +321,12 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<String> getAreaList(Integer id,Integer productId) {
|
|
|
|
|
|
+ public List<String> getAreaList(Integer id, Integer productId) {
|
|
//存储所有产品的营销数据
|
|
//存储所有产品的营销数据
|
|
List<ProductMarketData> marketData = new ArrayList<>();
|
|
List<ProductMarketData> marketData = new ArrayList<>();
|
|
List<String> areaList = new ArrayList<>();
|
|
List<String> areaList = new ArrayList<>();
|
|
List<Integer> productIds = new ArrayList<>();
|
|
List<Integer> productIds = new ArrayList<>();
|
|
- if(productId==null) {
|
|
|
|
|
|
+ if (productId == null) {
|
|
//根据架构id获得产品
|
|
//根据架构id获得产品
|
|
LambdaQueryWrapper<Product> productWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Product> productWrapper = new LambdaQueryWrapper<>();
|
|
productWrapper.eq(Product::getProductCategoryId, id);
|
|
productWrapper.eq(Product::getProductCategoryId, id);
|
|
@@ -335,9 +335,8 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
if (products.size() != 0) {
|
|
if (products.size() != 0) {
|
|
productIds = products.stream().map(Product::getId).collect(Collectors.toList());
|
|
productIds = products.stream().map(Product::getId).collect(Collectors.toList());
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else {
|
|
|
|
- productIds=Arrays.asList(productId);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ productIds = Arrays.asList(productId);
|
|
}
|
|
}
|
|
if (productIds.size() > 0) {
|
|
if (productIds.size() > 0) {
|
|
//根据产品Id获得产品营销数据
|
|
//根据产品Id获得产品营销数据
|
|
@@ -364,8 +363,8 @@ public class ProductCategoryServiceImpl implements IProductCategoryService {
|
|
LambdaQueryWrapper<Product> productWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Product> productWrapper = new LambdaQueryWrapper<>();
|
|
productWrapper.eq(Product::getProductCategoryId, id);
|
|
productWrapper.eq(Product::getProductCategoryId, id);
|
|
List<Product> products = productService.list(productWrapper);
|
|
List<Product> products = productService.list(productWrapper);
|
|
- products.forEach(item->{
|
|
|
|
- if(!areaList.contains(item.getCompanyName())){
|
|
|
|
|
|
+ products.forEach(item -> {
|
|
|
|
+ if (!areaList.contains(item.getCompanyName())) {
|
|
areaList.add(item.getCompanyName());
|
|
areaList.add(item.getCompanyName());
|
|
}
|
|
}
|
|
});
|
|
});
|