diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index 5663eb20..4c6b3099 100644 --- a/hiver-admin/src/main/resources/application.yml +++ b/hiver-admin/src/main/resources/application.yml @@ -345,6 +345,8 @@ ignored: - /hiver/app/purchaseReturn/getPurchaseReturnById - /hiver/app/purchase/getPurchaseAllData - /hiver/app/dealingRecord/getDealingsRecordList + - /hiver/app/customer/getCustomerData + - /hiver/app/supplier/getSupplierData # 临时增加 - /hiver/app/logisticsOrder/addLogisticsOrder diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index 4c150364..04b00a53 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -5,7 +5,7 @@ -Hiver���Ա��� +HiverԱ @@ -35,7 +35,7 @@ Hiver
  • -ʮ�� 24, 2024 20:09:59 +ʮ 26, 2024 01:12:03
  • @@ -84,7 +84,7 @@

    passTest

    -

    20:10:00 ���� / 0.017 secs

    +

    01:12:03 / 0.015 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -10.24.2024 20:10:00 -10.24.2024 20:10:00 -0.017 secs +10.26.2024 01:12:03 +10.26.2024 01:12:03 +0.015 secs
    @@ -104,7 +104,7 @@ Pass - 20:10:00 + 1:12:03 Test passed @@ -128,13 +128,13 @@

    Started

    -

    ʮ�� 24, 2024 20:09:59

    +

    ʮ 26, 2024 01:12:03

    Ended

    -

    ʮ�� 24, 2024 20:10:00

    +

    ʮ 26, 2024 01:12:03

    diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java index 44da20b2..4fe18e06 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/CustomerController.java @@ -18,6 +18,7 @@ import cc.hiver.mall.pojo.dto.DebtCustomer; import cc.hiver.mall.pojo.query.CustomerPageQuery; import cc.hiver.mall.pojo.vo.CustomerDataVo; import cc.hiver.mall.service.mybatis.CustomerService; +import cc.hiver.mall.utils.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; @@ -289,6 +290,9 @@ public class CustomerController { if (StringUtils.isEmpty(customerPageQuery.getCustomerId())) { return ResultUtil.error("客户id不能为空"); } + if(StringUtils.isNotEmpty(customerPageQuery.getEndDate())){ + customerPageQuery.setEndDate(DateUtil.addDay(customerPageQuery.getEndDate(),1)); + } final CustomerDataVo customerData = customerService.getCustomerData(customerPageQuery); return new ResultUtil().setData(customerData); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SupplierControlller.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SupplierControlller.java index eaa15e87..aee470d3 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SupplierControlller.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SupplierControlller.java @@ -18,6 +18,7 @@ import cc.hiver.mall.pojo.query.PurchasePageQuery; import cc.hiver.mall.pojo.vo.SupplierDataVo; import cc.hiver.mall.service.SupplierService; import cc.hiver.mall.service.mybatis.DealingsRecordService; +import cc.hiver.mall.utils.DateUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -194,6 +195,9 @@ public class SupplierControlller { if (StringUtils.isEmpty(purchasePageQuery.getSupplierId())) { return ResultUtil.error("供应商id不能为空"); } + if(StringUtils.isNotEmpty(purchasePageQuery.getEndDate())){ + purchasePageQuery.setEndDate(DateUtil.addDay(purchasePageQuery.getEndDate(),1)); + } final SupplierDataVo suppliers = supplierService.getSupplierData(purchasePageQuery); return new ResultUtil().setData(suppliers); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/PurchaseMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/PurchaseMapper.java index 7b2af39b..ea3e69ac 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/PurchaseMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/PurchaseMapper.java @@ -6,6 +6,7 @@ import cc.hiver.mall.entity.Purchase; import cc.hiver.mall.entity.PurchaseExample; import cc.hiver.mall.pojo.dto.DebtSupplier; import cc.hiver.mall.pojo.query.PurchasePageQuery; +import cc.hiver.mall.pojo.vo.ProductDataVo; import cc.hiver.mall.pojo.vo.PurchasingCostDetailVo; import cc.hiver.mall.pojo.vo.SupplierDataVo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -79,5 +80,5 @@ public interface PurchaseMapper extends BaseMapper { * @date 2024/10/24 * @param purchasePageQuery */ - SupplierDataVo getPurchaseCount(@Param("purchasePageQuery") PurchasePageQuery purchasePageQuery); + List getPurchaseCount(@Param("purchasePageQuery") PurchasePageQuery purchasePageQuery); } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ReturnSaleMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ReturnSaleMapper.java index 7ec7c50f..9ade33b8 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ReturnSaleMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ReturnSaleMapper.java @@ -6,10 +6,7 @@ import cc.hiver.mall.entity.ReturnSale; import cc.hiver.mall.entity.ReturnSaleExample; import cc.hiver.mall.pojo.query.CustomerPageQuery; import cc.hiver.mall.pojo.query.ReturnSalePageQuery; -import cc.hiver.mall.pojo.vo.CustomerDataVo; -import cc.hiver.mall.pojo.vo.ReturnSaleVo; -import cc.hiver.mall.pojo.vo.ReturnTotalAmountDetailVo; -import cc.hiver.mall.pojo.vo.SaleAllVO; +import cc.hiver.mall.pojo.vo.*; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; @@ -98,5 +95,5 @@ public interface ReturnSaleMapper extends BaseMapper { CustomerDataVo getSaleReturnPrice(@Param("customerPageQuery") CustomerPageQuery customerPageQuery); - CustomerDataVo getSaleReturnCount(@Param("customerPageQuery") CustomerPageQuery customerPageQuery); + List getSaleReturnCount(@Param("customerPageQuery") CustomerPageQuery customerPageQuery); } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java index e42a2d7f..bbf9edfe 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/SaleMapper.java @@ -146,5 +146,5 @@ public interface SaleMapper extends BaseMapper { CustomerDataVo getSalePrice(@Param("customerPageQuery")CustomerPageQuery customerPageQuery); - CustomerDataVo getSaleCount(@Param("customerPageQuery")CustomerPageQuery customerPageQuery); + List getSaleCount(@Param("customerPageQuery")CustomerPageQuery customerPageQuery); } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/CustomerDataVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/CustomerDataVo.java index 1f94d1ab..8f8fc6b8 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/CustomerDataVo.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/CustomerDataVo.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * 供应商(总金额)商品总款数、总件数、采购退货(总金额)商品总款数、总件数Vo * @author 王富康 @@ -16,12 +18,18 @@ public class CustomerDataVo { @ApiModelProperty(value = "供应商(总金额)商品总款数") private String salePrice; - @ApiModelProperty(value = "总件数") + @ApiModelProperty(value = "总款数") private Integer saleCount; + @ApiModelProperty(value = "总件数") + private List productDataVos; + @ApiModelProperty(value = "采购退货(总金额)商品总款数") private String saleReturnPrice; - @ApiModelProperty(value = "采购退货总件数") + @ApiModelProperty(value = "采购退货总款数") private Integer saleReturnCount; + + @ApiModelProperty(value = "退货总件数") + private List returnProductDataVos; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductDataVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductDataVo.java new file mode 100644 index 00000000..c9c90927 --- /dev/null +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/ProductDataVo.java @@ -0,0 +1,21 @@ +package cc.hiver.mall.pojo.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 供应商(总金额)商品总款数、总件数、采购退货(总金额)商品总款数、总件数Vo + * @author 王富康 + * @date 2024/10/24 + */ +@Data +@ApiModel(value = "供应商(总金额)商品总款数、总件数、采购退货(总金额)商品总款数、总件数") +public class ProductDataVo { + + @ApiModelProperty(value = "商品id") + private String productId; + + @ApiModelProperty(value = "件数") + private Integer productCount; +} diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SupplierDataVo.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SupplierDataVo.java index 2cab6b5c..6514116b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SupplierDataVo.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/pojo/vo/SupplierDataVo.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * 供应商(总金额)商品总款数、总件数、采购退货(总金额)商品总款数、总件数Vo * @author 王富康 @@ -19,9 +21,15 @@ public class SupplierDataVo { @ApiModelProperty(value = "总件数") private Integer purchaseCount; + @ApiModelProperty(value = "总件数") + private List productDataVos; + @ApiModelProperty(value = "采购退货(总金额)商品总款数") private String purchaseReturnPrice; @ApiModelProperty(value = "采购退货总件数") private Integer purchaseReturnCount; + + @ApiModelProperty(value = "总件数") + private List returnProductDataVos; } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/mapper/PurchaseReturnMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/mapper/PurchaseReturnMapper.java index ff50e5aa..dfc6d8a6 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/mapper/PurchaseReturnMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/mapper/PurchaseReturnMapper.java @@ -1,6 +1,7 @@ package cc.hiver.mall.purchasereturn.mapper; import cc.hiver.mall.pojo.query.PurchasePageQuery; +import cc.hiver.mall.pojo.vo.ProductDataVo; import cc.hiver.mall.pojo.vo.SupplierDataVo; import cc.hiver.mall.purchasereturn.entity.PurchaseReturn; import cc.hiver.mall.purchasereturn.vo.PurchaseReturnQueryVo; @@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 采购退货Mapper * @@ -45,5 +48,5 @@ public interface PurchaseReturnMapper extends BaseMapper { * @param purchasePageQuery * @return SupplierDataVo */ - SupplierDataVo getPurchaseReturnCount(@Param("purchasePageQuery") PurchasePageQuery purchasePageQuery); + List getPurchaseReturnCount(@Param("purchasePageQuery") PurchasePageQuery purchasePageQuery); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/service/impl/PurchaseReturnServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/service/impl/PurchaseReturnServiceImpl.java index 5fade7fe..0c7e050f 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/service/impl/PurchaseReturnServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/purchasereturn/service/impl/PurchaseReturnServiceImpl.java @@ -9,6 +9,7 @@ import cc.hiver.mall.entity.Stock; import cc.hiver.mall.entity.StockLog; import cc.hiver.mall.entity.Supplier; import cc.hiver.mall.pojo.query.PurchasePageQuery; +import cc.hiver.mall.pojo.vo.ProductDataVo; import cc.hiver.mall.pojo.vo.SupplierDataVo; import cc.hiver.mall.purchasereturn.constant.PurchaseReturnConstant; import cc.hiver.mall.purchasereturn.entity.PurchaseReturn; @@ -245,9 +246,19 @@ public class PurchaseReturnServiceImpl extends ServiceImpl purchaseReturnCount = purchaseReturnMapper.getPurchaseReturnCount(purchasePageQuery); + if(purchaseReturnCount == null){ + purchaseReturnCount = new ArrayList<>(); + } + supplierDataVo.setPurchaseReturnCount(purchaseReturnCount.size()); + supplierDataVo.setReturnProductDataVos(purchaseReturnCount); return supplierDataVo; } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java index d35a0437..fb714302 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesCalculateServiceImpl.java @@ -102,10 +102,7 @@ public class SalesCalculateServiceImpl implements SalesCalculateService { // 查询日期范围内数据 returnSaleExample.createCriteria() .andCreateTimeBetween(startDate, endDate) - .andStatusNotEqualTo(SaleConstant.SALE_STATUS[2]) - .andStatusNotEqualTo(SaleConstant.SALE_STATUS[8]) - .andStatusNotEqualTo(SaleConstant.SALE_STATUS[11]) - .andStatusNotEqualTo(SaleConstant.SALE_STATUS[12]) + .andStatusEqualTo(SaleConstant.SALE_STATUS[4]) .andDelFlagEqualTo(CommonConstant.DEL_FLAG_FALSE) .andShopIdEqualTo(shopId); final SaleAllVO returnAllVO1 = returnSaleMapper.saleSumAndCount(returnSaleExample); @@ -156,7 +153,8 @@ public class SalesCalculateServiceImpl implements SalesCalculateService { }*/ // 利润 BigDecimal totalPurchasePrice = saleDetailService.getTotalProfit(shopId,startTime,endTime); - saleAllVO.setTotalProfit(totalPurchasePrice); + // 销售总成本-进货成本 =利润 + saleAllVO.setTotalProfit(saleAllVO.getTotalAmount().subtract(totalPurchasePrice)); //获取当日门店下单客户数 final QueryWrapper querySaleWrapper = new QueryWrapper<>(); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java index afd91515..441249d2 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SupplierServiceImpl.java @@ -197,10 +197,12 @@ public class SupplierServiceImpl implements SupplierService { final SupplierDataVo supplierPurchaseInfo = purchaseService.getSupplierPurchaseInfo(purchasePageQuery); returnSupplierDataVo.setPurchasePrice(supplierPurchaseInfo.getPurchasePrice()); returnSupplierDataVo.setPurchaseCount(supplierPurchaseInfo.getPurchaseCount()); + returnSupplierDataVo.setProductDataVos(supplierPurchaseInfo.getProductDataVos()); // 查询供应商 采购退货(总金额)商品总款数、总件数 final SupplierDataVo supplierReturnPurchaseInfo = purchaseReturnService.getSupplierReturnPurchaseInfo(purchasePageQuery); returnSupplierDataVo.setPurchaseReturnPrice(supplierReturnPurchaseInfo.getPurchaseReturnPrice()); returnSupplierDataVo.setPurchaseReturnCount(supplierReturnPurchaseInfo.getPurchaseReturnCount()); + returnSupplierDataVo.setReturnProductDataVos(supplierReturnPurchaseInfo.getReturnProductDataVos()); return returnSupplierDataVo; } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java index cf8355c5..bae90c47 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/CustomerServiceImpl.java @@ -253,10 +253,12 @@ public class CustomerServiceImpl extends ServiceImpl i final CustomerDataVo saleDataVo = saleService.getCustomerSaleInfo(customerPageQuery); customerDataVo.setSalePrice(saleDataVo.getSalePrice()); customerDataVo.setSaleCount(saleDataVo.getSaleCount()); + customerDataVo.setProductDataVos(saleDataVo.getProductDataVos()); // 查询客户 退货(总金额)商品总款数、总件数 final CustomerDataVo returnSaleInfo = returnSaleService.getCustomerSaleReturnInfo(customerPageQuery); customerDataVo.setSaleReturnPrice(returnSaleInfo.getSaleReturnPrice()); customerDataVo.setSaleReturnCount(returnSaleInfo.getSaleReturnCount()); + customerDataVo.setReturnProductDataVos(returnSaleInfo.getReturnProductDataVos()); return customerDataVo; } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/PurchaseServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/PurchaseServiceImpl.java index a9a06e59..56fce666 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/PurchaseServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/PurchaseServiceImpl.java @@ -12,10 +12,7 @@ import cc.hiver.mall.debt.service.DebtService; import cc.hiver.mall.entity.*; import cc.hiver.mall.pojo.dto.DebtSupplier; import cc.hiver.mall.pojo.query.PurchasePageQuery; -import cc.hiver.mall.pojo.vo.ProductCategoryVo; -import cc.hiver.mall.pojo.vo.PurchaseVo; -import cc.hiver.mall.pojo.vo.PurchasingCostDetailVo; -import cc.hiver.mall.pojo.vo.SupplierDataVo; +import cc.hiver.mall.pojo.vo.*; import cc.hiver.mall.purchaseocr.entity.PurchaseOcrPicture; import cc.hiver.mall.purchaseocr.service.PurchaseOcrPictureService; import cc.hiver.mall.purchaseocr.vo.PurchaseOcrCountVo; @@ -775,9 +772,19 @@ public class PurchaseServiceImpl extends ServiceImpl i public SupplierDataVo getSupplierPurchaseInfo(PurchasePageQuery purchasePageQuery) { final SupplierDataVo supplierDataVo = new SupplierDataVo(); final SupplierDataVo purchasePrice = purchaseMapper.getPurchasePrice(purchasePageQuery); - final SupplierDataVo purchaseCount = purchaseMapper.getPurchaseCount(purchasePageQuery); - supplierDataVo.setPurchasePrice(purchasePrice.getPurchasePrice()); - supplierDataVo.setPurchaseCount(purchaseCount.getPurchaseCount()); + if(purchasePrice != null){ + supplierDataVo.setPurchasePrice(purchasePrice.getPurchasePrice()); + }else{ + supplierDataVo.setPurchasePrice("0.00"); + } + + + List purchaseCount = purchaseMapper.getPurchaseCount(purchasePageQuery); + if(purchaseCount == null){ + purchaseCount = new ArrayList<>(); + } + supplierDataVo.setPurchaseCount(purchaseCount.size()); + supplierDataVo.setProductDataVos(purchaseCount); return supplierDataVo; } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ReturnSaleServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ReturnSaleServiceImpl.java index 074af894..7f0e28db 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ReturnSaleServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ReturnSaleServiceImpl.java @@ -12,6 +12,7 @@ import cc.hiver.mall.pojo.dto.SaleDetailQueryDTO; import cc.hiver.mall.pojo.query.CustomerPageQuery; import cc.hiver.mall.pojo.query.ReturnSalePageQuery; import cc.hiver.mall.pojo.vo.CustomerDataVo; +import cc.hiver.mall.pojo.vo.ProductDataVo; import cc.hiver.mall.pojo.vo.ReturnSaleVo; import cc.hiver.mall.pojo.vo.ReturnTotalAmountDetailVo; import cc.hiver.mall.service.mybatis.ProductService; @@ -302,11 +303,20 @@ public class ReturnSaleServiceImpl extends ServiceImpl saleCount = returnSaleMapper.getSaleReturnCount(customerPageQuery); + if(saleCount == null ){ + saleCount = new ArrayList<>(); + } + customerDataVo.setSaleReturnCount(saleCount.size()); + customerDataVo.setReturnProductDataVos(saleCount); return customerDataVo; } } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java index 740417f0..23196122 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/SaleServiceImpl.java @@ -1330,11 +1330,20 @@ public class SaleServiceImpl extends ServiceImpl implements Sa final CustomerDataVo customerDataVo = new CustomerDataVo(); // 查询客户 拿货(总金额)商品总款数 final CustomerDataVo salePrice = saleMapper.getSalePrice(customerPageQuery); + if(salePrice != null){ + customerDataVo.setSalePrice(salePrice.getSalePrice()); + }else{ + customerDataVo.setSalePrice("0.00"); + } + // 查询客户 总件数 - final CustomerDataVo saleCount = saleMapper.getSaleCount(customerPageQuery); - customerDataVo.setSalePrice(salePrice.getSalePrice()); - customerDataVo.setSaleCount(saleCount.getSaleCount()); + List saleCount = saleMapper.getSaleCount(customerPageQuery); + if(saleCount == null ){ + saleCount = new ArrayList<>(); + } + customerDataVo.setSaleCount(saleCount.size()); + customerDataVo.setProductDataVos(saleCount); return customerDataVo; } diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml index 50437f63..8c3c5994 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseMapper.xml @@ -583,7 +583,7 @@ - select sum(should_pay) as purchase_price from t_purchase where supplier_id = #{purchasePageQuery.supplierId} @@ -595,9 +595,9 @@ - SELECT - sum( dd.product_count ) as purchase_count, + sum( dd.product_count ) as product_count, dd.product_id FROM t_purchase_detail dd diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseReturnMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseReturnMapper.xml index 75c8d746..61e5ed17 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseReturnMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/PurchaseReturnMapper.xml @@ -83,9 +83,9 @@ - SELECT - sum( dd.product_count ) as purchase_return_count, + sum( dd.product_count ) as product_count, dd.product_id FROM t_purchase_return_detail dd diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnDetailMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnDetailMapper.xml index fc49c9b8..f70bcdc8 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnDetailMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnDetailMapper.xml @@ -561,6 +561,6 @@ and trd.shop_id = #{shopId} and trd.create_time BETWEEN #{startTime} AND #{endTime} and trd.return_sale_id in - (select id from t_return_sale where shop_id = #{shopId} and del_flag='0' and status != '02') + (select id from t_return_sale where shop_id = #{shopId} and del_flag='0' and status = '4') \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnSaleMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnSaleMapper.xml index d0ea9a20..d8e0a9a1 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnSaleMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ReturnSaleMapper.xml @@ -602,8 +602,8 @@ ts.del_flag = '0' and ts.user_id = #{customerBillQueryVo.customerId} and ts.shop_id = #{customerBillQueryVo.shopId} - - and ts.status not in ( '02' ) + + and ts.status = '4' and ts.create_time BETWEEN #{customerBillQueryVo.startDate} AND #{customerBillQueryVo.endDate} @@ -711,7 +711,7 @@ - SELECT - sum( tt.product_count ) as sale_return_count, + sum( tt.product_count ) as product_count, tt.product_id FROM t_return_detail tt diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml index e91a1cf9..08a962e9 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/SaleDetailMapper.xml @@ -556,7 +556,7 @@ - SELECT - sum( dd.product_count ) as sale_count, + sum( dd.product_count ) as product_count, dd.product_id FROM t_sale_detail dd