|
@@ -39,6 +39,7 @@ import org.dromara.product.domain.ProductClassification;
|
|
|
import org.dromara.product.domain.ProductCustomization;
|
|
import org.dromara.product.domain.ProductCustomization;
|
|
|
import org.dromara.product.service.IProductBaseService;
|
|
import org.dromara.product.service.IProductBaseService;
|
|
|
|
|
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@@ -265,6 +266,7 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
vo.setProductNature(extend.getPurchaseManagerNo());
|
|
vo.setProductNature(extend.getPurchaseManagerNo());
|
|
|
vo.setPurchasingPersonnel(extend.getPurchaseNo());
|
|
vo.setPurchasingPersonnel(extend.getPurchaseNo());
|
|
|
vo.setSupplierNo(extend.getSupplierNo());
|
|
vo.setSupplierNo(extend.getSupplierNo());
|
|
|
|
|
+ vo.setProductDescription(extend.getProductDescription());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 3. 查询并填充价格库存信息(product_price_inventory表)
|
|
// 3. 查询并填充价格库存信息(product_price_inventory表)
|
|
@@ -511,16 +513,16 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
//价格区间 1:1-100 2:100-500 3:500-1000 4:1000以上
|
|
//价格区间 1:1-100 2:100-500 3:500-1000 4:1000以上
|
|
|
switch (bo.getPriceRange()) {
|
|
switch (bo.getPriceRange()) {
|
|
|
case "1":
|
|
case "1":
|
|
|
- wrapper.between(ProductBaseVo::getMemberPrice, 1, 100);
|
|
|
|
|
|
|
+ wrapper.between(ProductBaseVo::getMemberPrice, "1", "100");
|
|
|
break;
|
|
break;
|
|
|
case "2":
|
|
case "2":
|
|
|
- wrapper.between(ProductBaseVo::getMemberPrice, 100, 500);
|
|
|
|
|
|
|
+ wrapper.between(ProductBaseVo::getMemberPrice, "100", "500");
|
|
|
break;
|
|
break;
|
|
|
case "3":
|
|
case "3":
|
|
|
- wrapper.between(ProductBaseVo::getMemberPrice, 500, 1000);
|
|
|
|
|
|
|
+ wrapper.between(ProductBaseVo::getMemberPrice, "500", "1000");
|
|
|
break;
|
|
break;
|
|
|
case "4":
|
|
case "4":
|
|
|
- wrapper.ge(ProductBaseVo::getMemberPrice, 1000);
|
|
|
|
|
|
|
+ wrapper.ge(ProductBaseVo::getMemberPrice, "1000");
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -647,7 +649,7 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
private void saveProductDetail(ProductBaseBo bo, Long productId) {
|
|
private void saveProductDetail(ProductBaseBo bo, Long productId) {
|
|
|
ProductPhotos productPhotos= new ProductPhotos();
|
|
ProductPhotos productPhotos= new ProductPhotos();
|
|
|
productPhotos.setProductId(productId);
|
|
productPhotos.setProductId(productId);
|
|
|
- productPhotos.setImageUrl(bo.getProductImage());
|
|
|
|
|
|
|
+ productPhotos.setImageUrl(bo.getImageUrl());
|
|
|
productPhotos.setProductDetailsPc(bo.getPcDetail());
|
|
productPhotos.setProductDetailsPc(bo.getPcDetail());
|
|
|
productPhotos.setProductDetailsApp(bo.getMobileDetail());
|
|
productPhotos.setProductDetailsApp(bo.getMobileDetail());
|
|
|
photosMapper.insert(productPhotos);
|
|
photosMapper.insert(productPhotos);
|
|
@@ -788,6 +790,7 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
extend.setShelfComments(bo.getShelfComments());
|
|
extend.setShelfComments(bo.getShelfComments());
|
|
|
extend.setPurchaseManagerNo(bo.getProductNature());
|
|
extend.setPurchaseManagerNo(bo.getProductNature());
|
|
|
extend.setPurchaseNo(bo.getPurchasingPersonnel());
|
|
extend.setPurchaseNo(bo.getPurchasingPersonnel());
|
|
|
|
|
+ extend.setProductDescription(bo.getProductDescription());
|
|
|
extendMapper.insert(extend);
|
|
extendMapper.insert(extend);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -871,6 +874,7 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
if (bo.getProductNature() != null) existing.setPurchaseManagerNo(bo.getProductNature());
|
|
if (bo.getProductNature() != null) existing.setPurchaseManagerNo(bo.getProductNature());
|
|
|
if (bo.getPurchasingPersonnel() != null) existing.setPurchaseNo(bo.getPurchasingPersonnel());
|
|
if (bo.getPurchasingPersonnel() != null) existing.setPurchaseNo(bo.getPurchasingPersonnel());
|
|
|
if (bo.getSupplierNo() != null) existing.setSupplierNo(bo.getSupplierNo());
|
|
if (bo.getSupplierNo() != null) existing.setSupplierNo(bo.getSupplierNo());
|
|
|
|
|
+ if (bo.getProductDescription() != null) existing.setProductDescription(bo.getProductDescription());
|
|
|
extendMapper.updateById(existing);
|
|
extendMapper.updateById(existing);
|
|
|
} else {
|
|
} else {
|
|
|
// 不存在则新增
|
|
// 不存在则新增
|
|
@@ -1519,13 +1523,13 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
//价格区间 1:1-100 2:100-500 3:500-1000 4:1000以上
|
|
//价格区间 1:1-100 2:100-500 3:500-1000 4:1000以上
|
|
|
switch (bo.getPriceRange()) {
|
|
switch (bo.getPriceRange()) {
|
|
|
case "1":
|
|
case "1":
|
|
|
- lqw.between("b.market_price", 1, 100);
|
|
|
|
|
|
|
+ lqw.between("p.market_price", 1, 100);
|
|
|
case "2":
|
|
case "2":
|
|
|
- lqw.between("b.market_price", 100, 500);
|
|
|
|
|
|
|
+ lqw.between("p.market_price", 100, 500);
|
|
|
case "3":
|
|
case "3":
|
|
|
- lqw.between("b.market_price", 500, 1000);
|
|
|
|
|
|
|
+ lqw.between("p.market_price", 500, 1000);
|
|
|
case "4":
|
|
case "4":
|
|
|
- lqw.ge("b.market_price", 1000);
|
|
|
|
|
|
|
+ lqw.ge("p.market_price", 1000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(bo.getSortField() != null && bo.getSortOrder() != null){
|
|
if(bo.getSortField() != null && bo.getSortOrder() != null){
|
|
@@ -1542,7 +1546,6 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- lqw.select("b.id","b.product_image","p.market_price","p.member_price","p.min_selling_price","p.min_order_quantity","b.item_name","u.unit_name");
|
|
|
|
|
|
|
|
|
|
// 使用ES分页查询
|
|
// 使用ES分页查询
|
|
|
try {
|
|
try {
|
|
@@ -1571,6 +1574,15 @@ public class ProductBaseServiceImpl extends ServiceImpl<ProductBaseMapper, Produ
|
|
|
return TableDataInfo.build();
|
|
return TableDataInfo.build();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+ Date oldPlanStartAt = DateUtil.parse("2026-03-18 00:00:00");
|
|
|
|
|
+ Date oldPlanEndAt = DateUtil.parse("2026-04-18 00:00:00");
|
|
|
|
|
+ BigDecimal time = BigDecimal.valueOf(DateUtil.betweenDay(oldPlanStartAt, oldPlanEndAt, true) + 1);
|
|
|
|
|
+ BigDecimal priceAvgLease = BigDecimal.valueOf(549.90).divide(time, 2, RoundingMode.HALF_UP);
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println(priceAvgLease);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* PC端商品浏览记录
|
|
* PC端商品浏览记录
|
|
|
*
|
|
*
|