商品修改不能改库存,首页商品排行

This commit is contained in:
liuyingfang
2024-03-15 14:26:09 +08:00
parent b65bc317bd
commit 0ad9234279
6 changed files with 14 additions and 14 deletions

View File

@@ -17,7 +17,7 @@ public interface SummaryService {
Map<String,Object> selectSummaryToday(Integer shopId);
Map<String,Object> selectSummaryAmount(Integer shopId, Integer day);
Map<String,Object> selectSummaryProduct(Integer shopId, Integer day,Integer page);
Map<String,Object> selectSummaryProduct(Integer shopId, Integer day,Integer page,Integer size);
Map<String,Object> selectSummaryPayType(Integer shopId, Integer day);
}

View File

@@ -170,9 +170,9 @@ public class SummaryServiceImpl implements SummaryService {
}
@Override
public Map<String,Object> selectSummaryProduct(Integer shopId, Integer day,Integer currentPage){
public Map<String,Object> selectSummaryProduct(Integer shopId, Integer day,Integer currentPage, Integer currentSize){
//根据时间商品排行
currentPage = (currentPage - 1) * 5;
currentPage = (currentPage - 1) * currentSize;
HashMap<String, Object> map = new HashMap<>();
Date startTime ;
Date endTime ;
@@ -188,7 +188,7 @@ public class SummaryServiceImpl implements SummaryService {
}else {
throw new BadRequestException("日期有误");
}
List<Object[]> objects = shopUserDutyDetailRepository.searchByDutyId(shopId,startTime,endTime,currentPage);
List<Object[]> objects = shopUserDutyDetailRepository.searchByDutyId(shopId,startTime,endTime,currentPage,currentSize);
List<ProductVO> list = new ArrayList<>();
for (Object[] o :objects) {
ProductVO productVO = new ProductVO();
@@ -202,10 +202,10 @@ public class SummaryServiceImpl implements SummaryService {
Tuple tuple = shopUserDutyDetailRepository.searchByDutyIdSum(shopId, startTime, endTime);
//分页数据
Tuple tuple1 = shopUserDutyDetailRepository.searchCount(shopId, startTime, endTime);
map.put("productCount",tuple.get(0, BigDecimal.class));
map.put("productSum",tuple.get(1, BigDecimal.class));
map.put("productCount",tuple == null? 0:tuple.get(0, BigDecimal.class));
map.put("productSum",tuple == null? 0:tuple.get(1, BigDecimal.class));
map.put("totalProduct",list);
map.put("total",tuple1.get(0, BigInteger.class));
map.put("total",tuple1 == null?0:tuple1.get(0, BigInteger.class));
return map;
}
@Override

View File

@@ -324,7 +324,7 @@ public class TbProductServiceImpl implements TbProductService {
TbProductSku tbProductSku = tbProductSkuRepository.searchBarCode(sku.getBarCode());
if (tbProductSku != null){
tbProductSkuRepository.updateByBarCode(sku.getBarCode(),sku.getCostPrice(),sku.getCoverImg(),sku.getFirstShared(),sku.getMemberPrice(),
sku.getOriginPrice(),sku.getSalePrice(),sku.getSpecSnap(),sku.getStockNumber(),tbProductSku.getId());
sku.getOriginPrice(),sku.getSalePrice(),sku.getSpecSnap(),tbProductSku.getId());
}else {
if ("sku".equals(save.getTypeEnum())) {
tbProductSkuRepository.deleteByProductId(String.valueOf(save.getId()));