即时销售报表完善,修复访客
This commit is contained in:
1 parent
90a9de87d8
commit
b4d134674f
4 files changed
+19
-2
No files matched your search
+3
@@ -21,6 +21,9 @@ import java.util.List;
|
||||
public class VisitorsAppYYDetailVo {
|
||||
|
||||
|
||||
@Schema(description="id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
|
||||
@@ -224,3 +224,4 @@ WHERE status = 'INCONSISTENT';
|
||||
```
|
||||
|
||||
如果发现新的不一致数据,可以重新执行修复脚本。
|
||||
|
||||
@@ -159,3 +159,4 @@ GROUP BY r.id, r.inventory_code, r.inventory_date, r.total_amount;
|
||||
WHERE i.inventory_id = r.id
|
||||
);
|
||||
*/
|
||||
|
||||
+14
-2
@@ -474,7 +474,19 @@ public class RealtimeSalesReportServiceImpl implements RealtimeSalesReportServic
|
||||
productWrapper.eq(SmErpSpuEntity::getCategoryId, queryDTO.getCategoryId());
|
||||
}
|
||||
|
||||
List<SmErpSpuEntity> products = smErpSpuMapper.selectList(productWrapper);
|
||||
List<SmErpSpuEntity> allProducts = smErpSpuMapper.selectList(productWrapper);
|
||||
|
||||
// 过滤掉补差价商品(纯数字的商品名称)
|
||||
List<SmErpSpuEntity> products = allProducts.stream()
|
||||
.filter(product -> {
|
||||
String productName = product.getProductName();
|
||||
if (StrUtil.isBlank(productName)) {
|
||||
return true; // 保留商品名称为空的记录
|
||||
}
|
||||
// 过滤掉只包含数字(可能包含小数点)的商品名称,如:0.5, 1.0, 10, 100等
|
||||
return !productName.matches("^[0-9]+\\.?[0-9]*$");
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(products)) {
|
||||
return rankingList;
|
||||
@@ -1226,7 +1238,7 @@ public class RealtimeSalesReportServiceImpl implements RealtimeSalesReportServic
|
||||
.sum();
|
||||
|
||||
int salesCount = productItems.size();
|
||||
BigDecimal unitPrice = salesCount > 0 ?
|
||||
BigDecimal unitPrice = (salesCount > 0 && totalQuantity > 0) ?
|
||||
totalAmount.divide(new BigDecimal(totalQuantity), 2, RoundingMode.HALF_UP) :
|
||||
BigDecimal.ZERO;
|
||||
|
||||
|
||||
Reference in new issue
Block a user