## Opt - 首页统计订单类型
This commit is contained in:
parent
8ad1f1a942
commit
572bb244ea
|
@ -1180,69 +1180,69 @@ public class MemberReportController extends BaseController {
|
|||
|
||||
return getDataTable(orderDistributionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出货明细汇总统计
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/product-shipping-details-list")
|
||||
public TableDataInfo productShippingDetailsList(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType) {
|
||||
startPage();
|
||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
|
||||
if (endTime != null) {
|
||||
endTime = DateUtils.getEndTime(endTime);
|
||||
}
|
||||
List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
|
||||
if (productOrderInfoVo.getProductPrice() != null) {
|
||||
productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
|
||||
} else {
|
||||
productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
if (productOrderInfoVo.getOrderType() != null) {
|
||||
productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
|
||||
}
|
||||
}
|
||||
// 计算总计
|
||||
Integer count = memberReportService.sumQuantity(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
ProductOrderInfoVo productOrderInfoVo = new ProductOrderInfoVo();
|
||||
productOrderInfoVo.setProductCode("总计");
|
||||
productOrderInfoVo.setProductName("-");
|
||||
productOrderInfoVo.setQuantity(count);
|
||||
productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
memberReportList.add(productOrderInfoVo);
|
||||
return getDataTable(memberReportList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出货明细汇总导出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.EXPORT)
|
||||
@PostMapping("/product-shipping-details-export")
|
||||
public void productShippingDetailsExport(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType, HttpServletResponse response) {
|
||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
|
||||
if (endTime != null) {
|
||||
endTime = DateUtils.getEndTime(endTime);
|
||||
}
|
||||
List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
|
||||
if (productOrderInfoVo.getProductPrice() != null) {
|
||||
productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
|
||||
} else {
|
||||
productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
}
|
||||
if (productOrderInfoVo.getOrderType() != null) {
|
||||
productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
|
||||
}
|
||||
}
|
||||
ExcelUtil<ProductOrderInfoVo> util = new ExcelUtil<>(ProductOrderInfoVo.class);
|
||||
util.exportExcel(response, memberReportList, "出货明细汇总导出");
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 出货明细汇总统计
|
||||
// */
|
||||
// @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.SELECT)
|
||||
// @GetMapping("/product-shipping-details-list")
|
||||
// public TableDataInfo productShippingDetailsList(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType) {
|
||||
// startPage();
|
||||
// Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
// List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
|
||||
// if (endTime != null) {
|
||||
// endTime = DateUtils.getEndTime(endTime);
|
||||
// }
|
||||
// List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
// for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
|
||||
// if (productOrderInfoVo.getProductPrice() != null) {
|
||||
// productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
|
||||
// } else {
|
||||
// productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
// }
|
||||
//
|
||||
// if (productOrderInfoVo.getOrderType() != null) {
|
||||
// productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
|
||||
// }
|
||||
// }
|
||||
// // 计算总计
|
||||
// Integer count = memberReportService.sumQuantity(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
// ProductOrderInfoVo productOrderInfoVo = new ProductOrderInfoVo();
|
||||
// productOrderInfoVo.setProductCode("总计");
|
||||
// productOrderInfoVo.setProductName("-");
|
||||
// productOrderInfoVo.setQuantity(count);
|
||||
// productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
// memberReportList.add(productOrderInfoVo);
|
||||
// return getDataTable(memberReportList);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 出货明细汇总导出
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS_LIST, method = EOperationMethod.EXPORT)
|
||||
// @PostMapping("/product-shipping-details-export")
|
||||
// public void productShippingDetailsExport(String productName, Integer pkClassify, Date startTime, Date endTime, Integer orderType, HttpServletResponse response) {
|
||||
// Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
// List<Integer> orderTypeList = EOrderBusiness.getOrderTypeList(orderType);
|
||||
// if (endTime != null) {
|
||||
// endTime = DateUtils.getEndTime(endTime);
|
||||
// }
|
||||
// List<ProductOrderInfoVo> memberReportList = memberReportService.getProductOrderInfo(productName, pkClassify, startTime, endTime, pkCountry, orderTypeList);
|
||||
// for (ProductOrderInfoVo productOrderInfoVo : memberReportList) {
|
||||
// if (productOrderInfoVo.getProductPrice() != null) {
|
||||
// productOrderInfoVo.setProductTotalPrice(productOrderInfoVo.getProductPrice());
|
||||
// } else {
|
||||
// productOrderInfoVo.setProductTotalPrice(BigDecimal.ZERO);
|
||||
// }
|
||||
// if (productOrderInfoVo.getOrderType() != null) {
|
||||
// productOrderInfoVo.setOrderTypeStr(EOrderType.getEnumByValue(productOrderInfoVo.getOrderType()).getLabel());
|
||||
// }
|
||||
// }
|
||||
// ExcelUtil<ProductOrderInfoVo> util = new ExcelUtil<>(ProductOrderInfoVo.class);
|
||||
// util.exportExcel(response, memberReportList, "出货明细汇总导出");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 出货明细汇总统计详情
|
||||
|
@ -1544,4 +1544,60 @@ public class MemberReportController extends BaseController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产品销售统计列表
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/product-shipping")
|
||||
public TableDataInfo productShipping(ProductShippingParam param) {
|
||||
startPage();
|
||||
List<ProductShippingVO> productShippingList = memberReportService.listProductShipping(param);
|
||||
return getDataTable(productShippingList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品销售统计导出
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING, method = EOperationMethod.EXPORT)
|
||||
@PostMapping("/product-shipping-export")
|
||||
public void productShippingExport(HttpServletResponse response, ProductShippingParam param) {
|
||||
List<ProductShippingVO> productShippingList = memberReportService.listProductShipping(param);
|
||||
ExcelUtil<ProductShippingVO> util = new ExcelUtil<>(ProductShippingVO.class);
|
||||
util.exportExcel(response, productShippingList, "出货明细汇总导出");
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品销售统计详情
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.SELECT)
|
||||
@GetMapping("/product-shipping-details")
|
||||
public TableDataInfo productShippingDetails(ProductShippingParam param) {
|
||||
startPage();
|
||||
List<ProductShippingDetailsVO> productOrderInfoVoList = memberReportService.listProductShippingDetail(param);
|
||||
if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
|
||||
for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
|
||||
productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
|
||||
productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getEnumLabelByValue(productShippingDetailsVO.getIsMakerGift()));
|
||||
}
|
||||
}
|
||||
return getDataTable(productOrderInfoVoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品销售统计详情导出
|
||||
*/
|
||||
@Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.PRODUCT_SHIPPING_DETAILS, method = EOperationMethod.EXPORT)
|
||||
@PostMapping("/product-shipping-details-export")
|
||||
public void productShippingDetailsExport(HttpServletResponse response, ProductShippingParam param) {
|
||||
List<ProductShippingDetailsVO> productOrderInfoVoList = memberReportService.listProductShippingDetail(param);
|
||||
if (CollectionUtil.isNotEmpty(productOrderInfoVoList)) {
|
||||
for (ProductShippingDetailsVO productShippingDetailsVO : productOrderInfoVoList) {
|
||||
productShippingDetailsVO.setSpecialAreaVal(ESpecialArea.getLabelByValue(productShippingDetailsVO.getSpecialArea()));
|
||||
productShippingDetailsVO.setIsMakerGiftVal(EWaresType.getEnumLabelByValue(productShippingDetailsVO.getIsMakerGift()));
|
||||
}
|
||||
}
|
||||
ExcelUtil<ProductShippingDetailsVO> util = new ExcelUtil<>(ProductShippingDetailsVO.class);
|
||||
util.exportExcel(response, productOrderInfoVoList, "出货明细汇总统计详情");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzs.report.member.mapper;
|
||||
|
||||
import com.hzs.report.member.param.ProductDetailQueryParam;
|
||||
import com.hzs.report.member.param.ProductShippingParam;
|
||||
import com.hzs.report.member.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
@ -425,4 +426,13 @@ public interface MemberReportMapper {
|
|||
**/
|
||||
List<DirectPushNewVo> querDirectPushDetails(DirectPushNewVo directPushNewVo);
|
||||
|
||||
/**
|
||||
* 产品销售统计列表
|
||||
*/
|
||||
List<ProductShippingVO> listProductShipping(@Param("param") ProductShippingParam param);
|
||||
|
||||
/**
|
||||
* 出货明细汇总统计详情
|
||||
*/
|
||||
List<ProductShippingDetailsVO> listProductShippingDetail(@Param("param") ProductShippingParam param);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.hzs.report.member.param;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 产品销售统计入参
|
||||
*/
|
||||
@Data
|
||||
public class ProductShippingParam {
|
||||
|
||||
/**
|
||||
* 仓储编号
|
||||
*/
|
||||
private String wmsCode;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package com.hzs.report.member.service;
|
||||
|
||||
import com.hzs.report.member.param.ProductDetailQueryParam;
|
||||
import com.hzs.report.member.param.ProductShippingParam;
|
||||
import com.hzs.report.member.vo.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
@ -232,4 +233,14 @@ public interface MemberReportService {
|
|||
* 创建表
|
||||
**/
|
||||
void createCuMemberAmountBoxTable(String tabeName);
|
||||
/**
|
||||
* 产品销售统计列表
|
||||
*/
|
||||
List<ProductShippingVO> listProductShipping(ProductShippingParam param);
|
||||
|
||||
/**
|
||||
* 产品销售统计详情列表
|
||||
*/
|
||||
List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param);
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.hzs.common.domain.system.config.BdAccount;
|
|||
import com.hzs.common.service.ITransactionCommonService;
|
||||
import com.hzs.report.member.mapper.MemberReportMapper;
|
||||
import com.hzs.report.member.param.ProductDetailQueryParam;
|
||||
import com.hzs.report.member.param.ProductShippingParam;
|
||||
import com.hzs.report.member.service.MemberReportService;
|
||||
import com.hzs.report.member.vo.*;
|
||||
import com.hzs.report.report.service.ICuMemberSettlePeriodService;
|
||||
|
@ -602,5 +603,14 @@ public class MemberReportServiceImpl implements MemberReportService {
|
|||
memberReportMapper.createCuMemberAmountBoxTable(tabeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductShippingVO> listProductShipping(ProductShippingParam param) {
|
||||
return memberReportMapper.listProductShipping(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductShippingDetailsVO> listProductShippingDetail(ProductShippingParam param) {
|
||||
return memberReportMapper.listProductShippingDetail(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.hzs.report.member.vo;
|
||||
|
||||
import com.hzs.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ProductShippingVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 仓储编号
|
||||
*/
|
||||
@Excel(name = "仓储编号")
|
||||
private String wmsCode;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
@Excel(name = "产品名称")
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 产品编号
|
||||
*/
|
||||
@Excel(name = "产品编号")
|
||||
private String productCode;
|
||||
|
||||
/**
|
||||
* 销量
|
||||
*/
|
||||
@Excel(name = "销量")
|
||||
private Integer quantity;
|
||||
|
||||
}
|
|
@ -2005,4 +2005,79 @@
|
|||
|
||||
|
||||
|
||||
|
||||
<!-- 产品销售统计列表 -->
|
||||
<select id="listProductShipping" resultType="com.hzs.report.member.vo.ProductShippingVO">
|
||||
select bp.wms_code,
|
||||
nvl(sum(tmp.quantity), 0) quantity,
|
||||
to_char(wm_concat(bp.product_name)) product_name,
|
||||
to_char(wm_concat(bp.product_code)) product_code
|
||||
from bd_product bp
|
||||
left join (
|
||||
select soi.pk_product, 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>
|
||||
group by soi.pk_product
|
||||
) tmp
|
||||
on tmp.pk_product = bp.pk_id
|
||||
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 bp.wms_code
|
||||
order by quantity desc
|
||||
</select>
|
||||
|
||||
<!-- 产品销售统计明细列表 -->
|
||||
<select id="listProductShippingDetail" resultType="com.hzs.report.member.vo.ProductShippingDetailsVO">
|
||||
select #{param.wmsCode} wmsCode,
|
||||
soi.pk_product,
|
||||
so.order_type specialArea,
|
||||
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>
|
||||
</mapper>
|
||||
|
|
|
@ -330,7 +330,19 @@ public class EnumsController extends BaseController {
|
|||
return AjaxResult.success(enumEntityList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 出货相关订单类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/order-shipment")
|
||||
public AjaxResult orderShipment() {
|
||||
List<EnumEntity> enumEntityList = new ArrayList<>();
|
||||
for (EOrderShipment value : EOrderShipment.values()) {
|
||||
enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel(), EnumsPrefixConstants.ORDER_SHIPMENT));
|
||||
}
|
||||
return AjaxResult.success(enumEntityList);
|
||||
}
|
||||
/**
|
||||
* 单个批量枚举
|
||||
*
|
||||
|
|
|
@ -330,6 +330,11 @@ public class EnumsPrefixConstants {
|
|||
*/
|
||||
public static final String ORDER_UP_BUSINESS = "ENU_ORDER_UP_BUSINESS_";
|
||||
|
||||
/**
|
||||
* 出货相关订单类型
|
||||
*/
|
||||
public static final String ORDER_SHIPMENT = "ENU_ORDER_SHIPMENT_";
|
||||
|
||||
/**
|
||||
* 支付业务类型
|
||||
*/
|
||||
|
|
|
@ -405,6 +405,10 @@ public enum EOperationBusiness {
|
|||
PRODUCT_DETAIL_QUERY_LIST("产品明细查询"),
|
||||
MONTHLY_JOB_LEVEL("月度职级名单查询"),
|
||||
MEMBER_RETAIL_STAT("收益区域数据"),
|
||||
|
||||
PRODUCT_SHIPPING("产品销售统计"),
|
||||
|
||||
PRODUCT_SHIPPING_DETAILS("产品销售统计详情"),
|
||||
;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
package com.hzs.common.core.enums;
|
||||
|
||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出货相关订单类型枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum EOrderShipment {
|
||||
|
||||
/**
|
||||
* 全部 注册 + 升级+ 复购
|
||||
*/
|
||||
WHOLE(1, "全部", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 1),
|
||||
|
||||
/**
|
||||
* 首购 注册 + 升级
|
||||
*/
|
||||
FIRST_PURCHASE(2, "首购", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 2),
|
||||
|
||||
/**
|
||||
* 复购
|
||||
*/
|
||||
REPURCHASE(3, "复购", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 3),
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
REGISTER_ORDER(5, "注册专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 5),
|
||||
|
||||
/**
|
||||
* 升级
|
||||
*/
|
||||
UPGRADE_ORDER(6, "升级专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 6),
|
||||
|
||||
/**
|
||||
* 复购专区
|
||||
*/
|
||||
REPURCHASE_ORDER(7, "复购专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 7),
|
||||
|
||||
// /**
|
||||
// * 福利
|
||||
// */
|
||||
// WELFARE_ORDER(9, "福利专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 9),
|
||||
// /**
|
||||
// * 虚拟订单
|
||||
// */
|
||||
// FICTITIOUS_ORDER(12, "虚拟订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 12),
|
||||
/**
|
||||
* 重销订单
|
||||
*/
|
||||
CONSUME_ORDER(17, "重销订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 17),
|
||||
/**
|
||||
* 提货订单
|
||||
*/
|
||||
PICK_ORDER(18, "提货订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 18),
|
||||
// /**
|
||||
// * 积分订单
|
||||
// */
|
||||
// EXCHANGE_ORDER(20, "积分订单", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 20),
|
||||
// /**
|
||||
// * 专供专区
|
||||
// */
|
||||
// WHOLESALE_AREA(21, "专供专区", 0, EnumsPrefixConstants.ORDER_SHIPMENT + 21),
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 实际值
|
||||
*/
|
||||
private final int value;
|
||||
/**
|
||||
* 显示标签
|
||||
*/
|
||||
private final String label;
|
||||
/**
|
||||
* 是否启用(0=是,1=否) -- 来源EYesNo
|
||||
*/
|
||||
private final int enable;
|
||||
/**
|
||||
* 国际化翻译key值
|
||||
*/
|
||||
private final String key;
|
||||
|
||||
/**
|
||||
* 根据值,返回枚举
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static EOrderShipment getEnumByValue(int value) {
|
||||
for (EOrderShipment eOrderType : EOrderShipment.values()) {
|
||||
if (eOrderType.getValue() == value) {
|
||||
return eOrderType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据值,返回订单类型集合
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static List<Integer> getOrderTypeList(Integer value) {
|
||||
List<Integer> orderTypeList = new ArrayList<>();
|
||||
if (null == value || EOrderShipment.WHOLE.getValue() == value) {
|
||||
//首购 1,2,24,25,20
|
||||
orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
|
||||
|
||||
//复购 3,26,22,14,12,18,19,7,28,13,31,10
|
||||
orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.PICK_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
|
||||
} else if (EOrderShipment.FIRST_PURCHASE.getValue() == value) {
|
||||
//首购
|
||||
orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
|
||||
} else if (EOrderShipment.REPURCHASE.getValue() == value) {
|
||||
//复购
|
||||
orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.PICK_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
|
||||
} else if (EOrderShipment.REGISTER_ORDER.getValue() == value) {
|
||||
//注册专区
|
||||
orderTypeList.add(EOrderType.REGISTER_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REGISTER_ORDER.getValue());
|
||||
} else if (EOrderShipment.UPGRADE_ORDER.getValue() == value) {
|
||||
//升级专区
|
||||
orderTypeList.add(EOrderType.UPGRADE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_UPGRADE_ORDER.getValue());
|
||||
} else if (EOrderShipment.REPURCHASE_ORDER.getValue() == value) {
|
||||
//复购专区 3,26,22,14,12,18,19,28,13
|
||||
orderTypeList.add(EOrderType.REPURCHASE_ORDER.getValue());
|
||||
// orderTypeList.add(EOrderType.SPECIAL_REPURCHASE_ORDER.getValue());
|
||||
orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
|
||||
} else if (EOrderShipment.CONSUME_ORDER.getValue() == value) {
|
||||
//重销订单
|
||||
orderTypeList.add(EOrderType.CONSUME_ORDER.getValue());
|
||||
} else if (EOrderShipment.PICK_ORDER.getValue() == value) {
|
||||
//提货订单
|
||||
// orderTypeList.add(EOrderType.PICK_ORDER.getValue());
|
||||
}
|
||||
return orderTypeList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 会员前端列表
|
||||
*/
|
||||
private static List<EOrderShipment> apiList;
|
||||
|
||||
}
|
Loading…
Reference in New Issue