## 产品销售统计详情;

This commit is contained in:
cabbage 2025-08-08 13:57:54 +08:00
parent b943357b84
commit 650e01b48a
11 changed files with 133 additions and 227 deletions

View File

@ -705,8 +705,8 @@ public class MemberReportController extends BaseController {
@GetMapping("/product-shipping") @GetMapping("/product-shipping")
public TableDataInfo productShipping(ProductShippingParam param) { public TableDataInfo productShipping(ProductShippingParam param) {
startPage(); startPage();
List<ProductShippingVO> memberReportList = iMemberReportService.getProductOrderInfo(param); List<ProductShippingVO> productShippingList = iMemberReportService.listProductShipping(param);
return getDataTable(memberReportList); return getDataTable(productShippingList);
} }
/** /**
@ -715,59 +715,42 @@ public class MemberReportController extends BaseController {
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.EXPORT) @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.EXPORT)
@PostMapping("/product-shipping-export") @PostMapping("/product-shipping-export")
public void productShippingExport(HttpServletResponse response, ProductShippingParam param) { public void productShippingExport(HttpServletResponse response, ProductShippingParam param) {
List<ProductShippingVO> memberReportList = iMemberReportService.getProductOrderInfo(param); List<ProductShippingVO> productShippingList = iMemberReportService.listProductShipping(param);
ExcelUtil<ProductShippingVO> util = new ExcelUtil<>(ProductShippingVO.class); ExcelUtil<ProductShippingVO> util = new ExcelUtil<>(ProductShippingVO.class);
util.exportExcel(response, memberReportList, "出货明细汇总导出"); util.exportExcel(response, productShippingList, "出货明细汇总导出");
} }
/** /**
* 出货明细汇总统计详情 * 产品销售统计详情
*
* @param productName
* @param pkProduct
* @return
*/ */
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_INFO_LIST, method = EOperationMethod.SELECT) @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.SELECT)
@GetMapping("/product-shipping-details-info-list") @GetMapping("/product-shipping-details")
public TableDataInfo productShippingDetailsList(String productName, Integer pkProduct, Integer pkClassify, Integer pkAwards, Integer orderType, Date startTime, Date endTime) { public TableDataInfo productShippingDetails(ProductShippingParam param) {
startPage(); startPage();
Integer pkCountry = SecurityUtils.getPkCountry(); List<ProductShippingDetailsVO> productOrderInfoVoList = iMemberReportService.listProductShippingDetail(param);
List<Integer> orderTypeList = new ArrayList<>(); if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
orderTypeList.add(orderType); for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
if (endTime != null) { productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
endTime = DateUtils.getEndTime(endTime); productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getLabelByValue(productShippingDetailsVO.getIsMakerGift()));
} }
List<ProductShippingDetailsInfoVo> productOrderInfoVoList = iMemberReportService.productShippingDetailsList(pkProduct, productName, pkClassify, pkAwards, orderTypeList, startTime, endTime, pkCountry);
for (ProductShippingDetailsInfoVo productShippingDetailsInfoVo : productOrderInfoVoList) {
productShippingDetailsInfoVo.setAwardsPrice(productShippingDetailsInfoVo.getPrice());
productShippingDetailsInfoVo.setPriceTotal(productShippingDetailsInfoVo.getPrice().multiply(BigDecimal.valueOf(productShippingDetailsInfoVo.getQuantity())));
} }
return getDataTable(productOrderInfoVoList); return getDataTable(productOrderInfoVoList);
} }
/** /**
* 出货明细汇总统计详情导出 * 产品销售统计详情导出
*
* @param
* @param
* @return
*/ */
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_INFO_LIST, method = EOperationMethod.EXPORT) @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.EXPORT)
@PostMapping("/product-shipping-details-info-list-export") @PostMapping("/product-shipping-details-export")
public void productShippingDetailsListExport(ProductShippingDetailsParam productShippingDetailsParam, HttpServletResponse response) { public void productShippingDetailsExport(HttpServletResponse response, ProductShippingParam param) {
startPage(); List<ProductShippingDetailsVO> productOrderInfoVoList = iMemberReportService.listProductShippingDetail(param);
Integer pkCountry = SecurityUtils.getPkCountry(); if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
List<Integer> orderTypeList = new ArrayList<>(); for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
orderTypeList.add(productShippingDetailsParam.getOrderType()); productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
if (productShippingDetailsParam.getEndTime() != null) { productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getLabelByValue(productShippingDetailsVO.getIsMakerGift()));
productShippingDetailsParam.setEndTime(productShippingDetailsParam.getEndTime()); }
} }
List<ProductShippingDetailsInfoVo> productOrderInfoVoList = iMemberReportService.productShippingDetailsList(productShippingDetailsParam.getPkProduct(), productShippingDetailsParam.getProductName(), productShippingDetailsParam.getPkClassify(), productShippingDetailsParam.getPkAwards(), orderTypeList, productShippingDetailsParam.getStartTime(), productShippingDetailsParam.getEndTime(), pkCountry); ExcelUtil<ProductShippingDetailsVO> util = new ExcelUtil<>(ProductShippingDetailsVO.class);
for (ProductShippingDetailsInfoVo productShippingDetailsInfoVo : productOrderInfoVoList) {
productShippingDetailsInfoVo.setAwardsPrice(productShippingDetailsInfoVo.getPrice());
productShippingDetailsInfoVo.setPriceTotal(productShippingDetailsInfoVo.getPrice().multiply(BigDecimal.valueOf(productShippingDetailsInfoVo.getQuantity())));
}
ExcelUtil<ProductShippingDetailsInfoVo> util = new ExcelUtil<>(ProductShippingDetailsInfoVo.class);
util.exportExcel(response, productOrderInfoVoList, "出货明细汇总统计详情"); util.exportExcel(response, productOrderInfoVoList, "出货明细汇总统计详情");
} }

View File

@ -133,7 +133,12 @@ public interface MemberReportMapper {
/** /**
* 产品销售统计列表 * 产品销售统计列表
*/ */
List<ProductShippingVO> getProductOrderInfo(@Param("param") ProductShippingParam param); List<ProductShippingVO> listProductShipping(@Param("param") ProductShippingParam param);
/**
* 出货明细汇总统计详情
*/
List<ProductShippingDetailsVO> listProductShippingDetail(@Param("param)") ProductShippingParam param);
/** /**
* 报单汇总 * 报单汇总
@ -142,14 +147,6 @@ public interface MemberReportMapper {
*/ */
List<ReportSummaryVo> reportSummaryList(ReportSummaryVo reportSummaryVo); List<ReportSummaryVo> reportSummaryList(ReportSummaryVo reportSummaryVo);
/**
* 出货明细汇总统计详情
*
* @param pkProduct
* @param productName
* @return
*/
List<ProductShippingDetailsInfoVo> productShippingDetailsList(@Param("pkProduct") Integer pkProduct, @Param("productName") String productName, @Param("pkClassify") Integer pkClassify, @Param("pkAwards") Integer pkAwards, @Param("orderTypeList") List<Integer> orderTypeList, @Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("pkCountry") Integer pkCountry);
/** /**
* 产品明细查询 * 产品明细查询

View File

@ -104,7 +104,12 @@ public interface IMemberReportService {
/** /**
* 产品销售统计列表 * 产品销售统计列表
*/ */
List<ProductShippingVO> getProductOrderInfo(ProductShippingParam param); List<ProductShippingVO> listProductShipping(ProductShippingParam param);
/**
* 产品销售统计详情列表
*/
List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param);
/** /**
* 报单汇总 * 报单汇总
@ -114,11 +119,6 @@ public interface IMemberReportService {
List<ReportSummaryVo> reportSummaryList(ReportSummaryVo reportSummaryVo); List<ReportSummaryVo> reportSummaryList(ReportSummaryVo reportSummaryVo);
/**
* 出货明细汇总统计详情
*/
List<ProductShippingDetailsInfoVo> productShippingDetailsList(Integer pkProduct, String productName, Integer pkClassify, Integer pkAwards, List<Integer> orderTypeList, Date startTime, Date endTime, Integer pkCountry);
/** /**
* 产品明细查询 * 产品明细查询
* *

View File

@ -110,8 +110,13 @@ public class IMemberReportServiceImpl implements IMemberReportService {
} }
@Override @Override
public List<ProductShippingVO> getProductOrderInfo(ProductShippingParam param) { public List<ProductShippingVO> listProductShipping(ProductShippingParam param) {
return memberReportMapper.getProductOrderInfo(param); return memberReportMapper.listProductShipping(param);
}
@Override
public List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param) {
return memberReportMapper.listProductShippingDetail(param);
} }
@Override @Override
@ -119,10 +124,6 @@ public class IMemberReportServiceImpl implements IMemberReportService {
return memberReportMapper.reportSummaryList(reportSummaryVo); return memberReportMapper.reportSummaryList(reportSummaryVo);
} }
@Override
public List<ProductShippingDetailsInfoVo> productShippingDetailsList(Integer pkProduct, String productName, Integer pkClassify, Integer pkAwards, List<Integer> orderTypeList, Date startTime, Date endTime, Integer pkCountry) {
return memberReportMapper.productShippingDetailsList(pkProduct, productName, pkClassify, pkAwards, orderTypeList, startTime, endTime, pkCountry);
}
@Override @Override
public List<ProductDetailQueryVo> productDetailQueryList(ProductDetailQueryParam productDetailQueryParam) { public List<ProductDetailQueryVo> productDetailQueryList(ProductDetailQueryParam productDetailQueryParam) {

View File

@ -1,25 +0,0 @@
package com.hzs.report.member.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/8/31 17:08
* @Classname: ProductShippingDetailVo
* @PackageName: com.hzs.report.member.vo
*/
import lombok.Data;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.report.member.vo
*@Author: yh
*@CreateTime: 2023-08-31 17:08
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductShippingDetailVo {
private String productCode;
}

View File

@ -1,79 +0,0 @@
package com.hzs.report.member.vo;/**
* @Description:
* @Author: yuhui
* @Time: 2023/9/20 14:38
* @Classname: ProductShippingDetailsInfoVo
* @PackageName: com.hzs.report.member.vo
*/
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
/**
*@BelongsProject: hzs_cloud
*@BelongsPackage: com.hzs.report.member.vo
*@Author: yh
*@CreateTime: 2023-09-20 14:38
*@Description: TODO
*@Version: 1.0
*/
@Data
public class ProductShippingDetailsInfoVo {
/**
* 所属产品
*/
private Integer pkProduct;
/**
* 产品编号
*/
@Excel(name = "产品编号")
private String productCode;
/**
* 产品名称
*/
@Excel(name = "产品名称")
private String productName;
/**
* 产品分类
*/
@Excel(name = "产品分类")
private String classifyName;
/**
* 产品价格
*/
@Excel(name = "产品价格")
private BigDecimal price;
/**
* 真实奖衔
*/
private Integer pkAwards;
/**
* 真实奖衔
*/
@Excel(name = "真实奖衔")
private String awardsName;
/**
* 奖衔价格
*/
@Excel(name = "奖衔价格")
private BigDecimal awardsPrice;
/**
* 产品数量
*/
@Excel(name = "数量")
private Integer quantity;
/**
* 合计价格
*/
@Excel(name = "合计价格")
private BigDecimal priceTotal;
}

View File

@ -0,0 +1,37 @@
package com.hzs.report.member.vo;
import com.hzs.common.core.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
@Data
public class ProductShippingDetailsVO implements Serializable {
/**
* 仓储编号
*/
@Excel(name = "仓储编号")
private String wmsCode;
/**
* 所属专区
*/
private Integer specialArea;
@Excel(name = "所属专区")
private String specialAreaVal;
/**
* 商品类型
*/
private Integer isMakerGift;
@Excel(name = "商品类型")
private String isMakerGiftVal;
/**
* 销量
*/
@Excel(name = "销量")
private Integer quantity;
}

View File

@ -388,7 +388,7 @@
</select> </select>
<!-- 产品销售统计列表 --> <!-- 产品销售统计列表 -->
<select id="getProductOrderInfo" resultType="com.hzs.report.member.vo.ProductShippingVO"> <select id="listProductShipping" resultType="com.hzs.report.member.vo.ProductShippingVO">
select bp.wms_code, select bp.wms_code,
nvl(sum(tmp.quantity), 0) quantity, nvl(sum(tmp.quantity), 0) quantity,
to_char(wm_concat(bp.product_name)) product_name, to_char(wm_concat(bp.product_name)) product_name,
@ -419,12 +419,49 @@
and bp.product_code = #{param.productCode} and bp.product_code = #{param.productCode}
</if> </if>
<if test="param.productName != null and param.productName !=''"> <if test="param.productName != null and param.productName !=''">
and bp.productName like '%' || #{param.productName} ||'%' and bp.product_name like '%' || #{param.productName} ||'%'
</if> </if>
group by bp.wms_code group by bp.wms_code
order by quantity desc order by quantity desc
</select> </select>
<!-- 产品销售统计明细列表 -->
<select id="listProductShippingDetail" resultType="com.hzs.report.member.vo.ProductShippingDetailsVO">
select #{param.wmsCode} wmsCode,
soi.pk_product,
so.order_type,
soi.is_maker_gift,
sum(soi.quantity) quantity
from sa_order so
left join sa_order_items soi
on soi.pk_order = so.pk_id
and soi.del_flag = 0
where so.del_flag = 0
and so.order_status = 1
<if test="param.startTime != null">
and so.pay_time >= to_date(#{param.startTime}, 'yyyy-mm-dd')
</if>
<if test="param.endTime != null">
and to_date(#{param.endTime} || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss') >= so.pay_time
</if>
and soi.pk_product in
(select bp.pk_id
from bd_product bp
where bp.del_flag = 0
<if test="param.wmsCode != null and param.wmsCode !=''">
and bp.wms_code = #{param.wmsCode}
</if>
<if test="param.productCode != null and param.productCode !=''">
and bp.product_code = #{param.productCode}
</if>
<if test="param.productName != null and param.productName !=''">
and bp.product_name like '%' || #{param.productName} ||'%'
</if>
)
group by soi.pk_product, so.order_type, soi.IS_MAKER_GIFT
order by so.order_type, soi.IS_MAKER_GIFT
</select>
<select id="reportSummaryList" resultType="com.hzs.report.member.vo.ReportSummaryVo"> <select id="reportSummaryList" resultType="com.hzs.report.member.vo.ReportSummaryVo">
select cm.MEMBER_CODE memberCode,cm.MEMBER_NAME memberName,bv.VERTEX_NAME vertexName,mt.TEAM_NAME teamName, select cm.MEMBER_CODE memberCode,cm.MEMBER_NAME memberName,bv.VERTEX_NAME vertexName,mt.TEAM_NAME teamName,
cm.REGISTER_AUTHORITY,cm.REGISTER_AUTHORITY registerAuthority,a.orderAmount consumeMoney ,a.orderAchieve consumeAchieve cm.REGISTER_AUTHORITY,cm.REGISTER_AUTHORITY registerAuthority,a.orderAmount consumeMoney ,a.orderAchieve consumeAchieve
@ -465,46 +502,6 @@
</if> </if>
</select> </select>
<select id="productShippingDetailsList" resultType="com.hzs.report.member.vo.ProductShippingDetailsInfoVo">
select bp.PRODUCT_CODE productCode,bp.PRODUCT_NAME productName,bc.NAME classifyName,oi.PK_AWARDS pkAwards,oi.QUANTITY quantity,
oi.PRICE price,bw.AWARDS_NAME awardsName
from sa_order_items oi
left join SA_ORDER so on so.PK_ID = oi.PK_ORDER
left join BD_PRODUCT bp on bp.pk_id = oi.PK_PRODUCT
left join bd_classify bc on bc.PK_ID = bp.PK_CLASSIFY
left join bd_awards bw on bw.pk_id = oi.PK_AWARDS
where 1 = 1
and oi.del_flag = 0
and so.del_flag = 0
and so.ORDER_STATUS = 1
<if test="pkCountry != null">
and so.PK_COUNTRY=#{pkCountry}
</if>
<if test="startTime != null">
and to_char(so.PAY_TIME, 'yyyy-mm-dd hh24:mi:ss') &gt;= to_char(#{startTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="endTime != null">
and to_char(so.PAY_TIME, 'yyyy-mm-dd hh24:mi:ss') &lt;= to_char(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="pkProduct != null">
and oi.PK_PRODUCT = #{pkProduct}
</if>
<if test="pkClassify != null">
and bc.pk_id = #{pkClassify}
</if>
<if test="pkAwards != null">
and bw.pk_id = #{pkAwards}
</if>
<if test="orderTypeList != null and orderTypeList.size > 0">
and so.ORDER_TYPE in
<foreach collection="orderTypeList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="productName != null and productName != ''">
and bp.PRODUCT_NAME like #{productName} || '%'
</if>
</select>
<select id="productDetailQueryList" resultType="com.hzs.report.member.vo.ProductDetailQueryVo"> <select id="productDetailQueryList" resultType="com.hzs.report.member.vo.ProductDetailQueryVo">
select select

View File

@ -125,9 +125,7 @@ public class BdWaresController extends BaseController {
} }
List<WaresProductDetailVo> waresDetailList = waresDetailService.selectByList(waresVo.getPkWares()); List<WaresProductDetailVo> waresDetailList = waresDetailService.selectByList(waresVo.getPkWares());
waresVo.setWaresDetailList(waresDetailList); waresVo.setWaresDetailList(waresDetailList);
if (waresVo.getIsMakerGift() != null) { waresVo.setIsMakerGiftVal(EWaresType.getLabelByValue(waresVo.getIsMakerGift()));
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
}
}); });
} }
return getDataTable(resultList); return getDataTable(resultList);
@ -175,9 +173,7 @@ public class BdWaresController extends BaseController {
waresVo.setProductNames(productNames.toString()); waresVo.setProductNames(productNames.toString());
waresVo.setProductCodes(productCodes.toString()); waresVo.setProductCodes(productCodes.toString());
waresVo.setProductQuantitys(productQuantitys.toString()); waresVo.setProductQuantitys(productQuantitys.toString());
if (waresVo.getIsMakerGift() != null) { waresVo.setIsMakerGiftVal(EWaresType.getLabelByValue(waresVo.getIsMakerGift()));
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
}
} }
}); });
} }
@ -1181,6 +1177,7 @@ public class BdWaresController extends BaseController {
String waresCode = CreateNormsCodeUtils.createWaresCode(waresService.getLastWaresCode()); String waresCode = CreateNormsCodeUtils.createWaresCode(waresService.getLastWaresCode());
return AjaxResult.success(waresCode); return AjaxResult.success(waresCode);
} }
@GetMapping("/getMaxSortNum") @GetMapping("/getMaxSortNum")
public AjaxResult getMaxSortNum() { public AjaxResult getMaxSortNum() {
return AjaxResult.success("请求成功!", waresService.getMaxSortNum()); return AjaxResult.success("请求成功!", waresService.getMaxSortNum());

View File

@ -401,7 +401,7 @@ public enum EOperationBusiness {
PRODUCT_SHIPPING("产品销售统计"), PRODUCT_SHIPPING("产品销售统计"),
PRODUCT_SHIPPING_DETAILS_INFO_LIST("出货明细汇总统计详情"), PRODUCT_SHIPPING_DETAILS("产品销售统计详情"),
REPORT_SUMMARY_LIST("报单汇总"), REPORT_SUMMARY_LIST("报单汇总"),
PLACE_PEG("安置反查"), PLACE_PEG("安置反查"),

View File

@ -32,18 +32,16 @@ public enum EWaresType {
*/ */
private final String key; private final String key;
/** public static String getLabelByValue(Integer value) {
* 根据枚举值获取枚举 if (null != value) {
* return "";
* @param value 枚举值 }
* @return for (EWaresType enums : EWaresType.values()) {
*/ if (enums.getValue() == value) {
public static EWaresType getEnumByValue(int value) { return enums.getLabel();
for (EWaresType eApproveStatus : EWaresType.values()) {
if (eApproveStatus.getValue() == value) {
return eApproveStatus;
} }
} }
return null; return "";
} }
} }