## 邮费计算调整,所有商品都算在邮费里面;
This commit is contained in:
parent
15da9da473
commit
8f9c950d18
|
@ -4,11 +4,7 @@ import com.hzs.common.core.domain.R;
|
||||||
import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 专区免邮服务
|
* 专区免邮服务
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/12/1 11:23
|
|
||||||
* @Classname: AreaFreePostageServiceApi
|
|
||||||
* @PackageName: com.hzs.system.config
|
|
||||||
*/
|
*/
|
||||||
public interface IAreaFreePostageServiceApi {
|
public interface IAreaFreePostageServiceApi {
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 二次发货入参
|
* 二次发货入参
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/5/5 15:34
|
|
||||||
* @Classname: DeliverSecondParam
|
|
||||||
* @PackageName: com.hzs.sale.deliver.param
|
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@ -43,7 +39,7 @@ public class DeliverSecondParam extends BaseAuthorityEntity {
|
||||||
private Integer orderType;
|
private Integer orderType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
private Integer deliveryWay;
|
private Integer deliveryWay;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 发货单业务服务
|
* 发货单业务服务
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@ -249,7 +249,7 @@ public class SaDeliverBusinessServiceImpl implements ISaDeliverBusinessService {
|
||||||
if (iOrderBusinessService.updateSaOrderChargeLog(EApprovalBusiness.SELF_DELIVERY_MANAGE, approvalBusinessResultDTO.getBusinessCode(), pkCountry, userId, EAgentApprovalStatus.APPROVED, approvalBusinessResultDTO.getApproveRemark())) {
|
if (iOrderBusinessService.updateSaOrderChargeLog(EApprovalBusiness.SELF_DELIVERY_MANAGE, approvalBusinessResultDTO.getBusinessCode(), pkCountry, userId, EAgentApprovalStatus.APPROVED, approvalBusinessResultDTO.getApproveRemark())) {
|
||||||
// 更新订单修改记录
|
// 更新订单修改记录
|
||||||
|
|
||||||
// 更新订单为 店铺自提
|
// 更新订单为 公司自提
|
||||||
LambdaUpdateWrapper<SaOrder> updateOrder = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<SaOrder> updateOrder = new LambdaUpdateWrapper<>();
|
||||||
updateOrder.set(SaOrder::getDeliveryWay, EDelivery.COMPANY_PICKED_UP.getValue());
|
updateOrder.set(SaOrder::getDeliveryWay, EDelivery.COMPANY_PICKED_UP.getValue());
|
||||||
// 更新仓库
|
// 更新仓库
|
||||||
|
|
|
@ -59,6 +59,7 @@ public abstract class ParentOrderController extends BaseController {
|
||||||
protected RedisService redisService;
|
protected RedisService redisService;
|
||||||
|
|
||||||
private ISaOrderService iSaOrderService;
|
private ISaOrderService iSaOrderService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setOrderService(ISaOrderService orderService) {
|
public void setOrderService(ISaOrderService orderService) {
|
||||||
this.iSaOrderService = orderService;
|
this.iSaOrderService = orderService;
|
||||||
|
@ -407,8 +408,8 @@ public abstract class ParentOrderController extends BaseController {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected Boolean checkRecMsgBoolean(OrderParam orderParam) {
|
protected Boolean checkRecMsgBoolean(OrderParam orderParam) {
|
||||||
if (orderParam.getDeliveryWay() != null && (EDelivery.COMPANY_PICKED_UP.getValue() == orderParam.getDeliveryWay() ||
|
if (orderParam.getDeliveryWay() != null
|
||||||
EDelivery.SHOP_PICKED_UP.getValue() == orderParam.getDeliveryWay())) {
|
&& EDelivery.COMPANY_PICKED_UP.getValue() == orderParam.getDeliveryWay()) {
|
||||||
orderParam.setTransType(null);
|
orderParam.setTransType(null);
|
||||||
return orderParam.getSpecialArea() != null
|
return orderParam.getSpecialArea() != null
|
||||||
&& orderParam.getOrderItemsParams() != null
|
&& orderParam.getOrderItemsParams() != null
|
||||||
|
|
|
@ -201,7 +201,6 @@ public class ApiRegSaOrderController extends ParentOrderController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/query-order")
|
@PostMapping("/query-order")
|
||||||
public AjaxResult queryOrder(@RequestBody OrderParam orderParam) {
|
public AjaxResult queryOrder(@RequestBody OrderParam orderParam) {
|
||||||
log.info(orderParam.getOrderCode());
|
|
||||||
initPkCountry(orderParam);
|
initPkCountry(orderParam);
|
||||||
// 直接支付,从redis中获取
|
// 直接支付,从redis中获取
|
||||||
AjaxResult result = validateOrderParam(orderParam);
|
AjaxResult result = validateOrderParam(orderParam);
|
||||||
|
@ -340,7 +339,6 @@ public class ApiRegSaOrderController extends ParentOrderController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/query-spend-details")
|
@PostMapping("/query-spend-details")
|
||||||
public AjaxResult queryOrderSpendDetails(@RequestBody OrderParam orderParam) {
|
public AjaxResult queryOrderSpendDetails(@RequestBody OrderParam orderParam) {
|
||||||
log.info(orderParam.getOrderCode());
|
|
||||||
initPkCountry(orderParam);
|
initPkCountry(orderParam);
|
||||||
AjaxResult result = validateOrderParam(orderParam);
|
AjaxResult result = validateOrderParam(orderParam);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|
|
@ -1,28 +1,13 @@
|
||||||
package com.hzs.sale.order.param;/**
|
package com.hzs.sale.order.param;
|
||||||
* @Description:
|
|
||||||
* @Author: yuhui
|
|
||||||
* @Time: 2023/4/12 14:04
|
|
||||||
* @Classname: SaOrderChargeLogParam
|
|
||||||
* @PackageName: com.hzs.sale.order.param
|
|
||||||
*/
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
*@BelongsProject: hzs_cloud
|
|
||||||
*@BelongsPackage: com.hzs.sale.order.param
|
|
||||||
*@Author: yh
|
|
||||||
*@CreateTime: 2023-04-12 14:04
|
|
||||||
*@Description: TODO
|
|
||||||
*@Version: 1.0
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
public class SaOrderChargeLogParam {
|
public class SaOrderChargeLogParam {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 签呈单号
|
* 签呈单号
|
||||||
*/
|
*/
|
||||||
|
@ -96,7 +81,7 @@ public class SaOrderChargeLogParam {
|
||||||
private Integer orderType;
|
private Integer orderType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
private Integer deliveryWay;
|
private Integer deliveryWay;
|
||||||
|
|
||||||
|
@ -195,7 +180,7 @@ public class SaOrderChargeLogParam {
|
||||||
*/
|
*/
|
||||||
private Date endLastInstanceDate;
|
private Date endLastInstanceDate;
|
||||||
/**
|
/**
|
||||||
*体系主键
|
* 体系主键
|
||||||
*/
|
*/
|
||||||
private Integer pkVertex;
|
private Integer pkVertex;
|
||||||
/**
|
/**
|
||||||
|
@ -241,12 +226,12 @@ public class SaOrderChargeLogParam {
|
||||||
private Integer orderChargeLogSource;
|
private Integer orderChargeLogSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始撤单时间
|
* 开始撤单时间
|
||||||
*/
|
*/
|
||||||
private Date startCancelOrderTime;
|
private Date startCancelOrderTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束撤单时间
|
* 结束撤单时间
|
||||||
*/
|
*/
|
||||||
private Date endCancelOrderTime;
|
private Date endCancelOrderTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.hzs.activity.base.service.IActivityService;
|
import com.hzs.activity.base.service.IActivityService;
|
||||||
import com.hzs.common.core.constant.*;
|
import com.hzs.common.core.constant.*;
|
||||||
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
||||||
import com.hzs.common.core.domain.R;
|
|
||||||
import com.hzs.common.core.enums.*;
|
import com.hzs.common.core.enums.*;
|
||||||
import com.hzs.common.core.exception.ServiceException;
|
import com.hzs.common.core.exception.ServiceException;
|
||||||
import com.hzs.common.core.service.RedisService;
|
import com.hzs.common.core.service.RedisService;
|
||||||
|
@ -55,8 +54,6 @@ import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于处理订单的处理逻辑
|
* 用于处理订单的处理逻辑
|
||||||
|
@ -66,56 +63,34 @@ import java.util.stream.Collectors;
|
||||||
public class SaOrderHandle {
|
public class SaOrderHandle {
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IGradeServiceApi gradeServiceApi;
|
IGradeServiceApi iGradeServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
ICurrencyServiceApi currencyServiceApi;
|
ICurrencyServiceApi iCurrencyServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IMemberTeamServiceApi memberTeamServiceApi;
|
IMemberTeamServiceApi iMemberTeamServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
ISystemConfigServiceApi systemConfigServiceApi;
|
ISystemConfigServiceApi iSystemConfigServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IAreaFreePostageServiceApi iAreaFreePostageServiceApi;
|
IAreaFreePostageServiceApi iAreaFreePostageServiceApi;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IActivityService activityGiftService;
|
private IActivityService iActivityService;
|
||||||
|
@Autowired
|
||||||
private IBdWaresDetailService bdWaresDetailService;
|
private IBdPostageService iBdPostageService;
|
||||||
|
@Autowired
|
||||||
private IBdPostageService postageService;
|
private IBdPostageDetailService iBdPostageDetailService;
|
||||||
|
@Autowired
|
||||||
private IBdPostageDetailService postageDetailService;
|
private IBdPostageAreaService iBdPostageAreaService;
|
||||||
|
@Autowired
|
||||||
private IBdPostageAreaService postageAreaService;
|
private IBdPostageFailAreaService iBdPostageFailAreaService;
|
||||||
|
|
||||||
private IBdPostageFailAreaService bdPostageFailAreaService;
|
|
||||||
|
|
||||||
private IBdProductService bdProductService;
|
private IBdProductService bdProductService;
|
||||||
|
private IBdWaresDetailService bdWaresDetailService;
|
||||||
private IBdWaresRangeService bdWaresRangeService;
|
private IBdWaresRangeService bdWaresRangeService;
|
||||||
|
|
||||||
private RedisService redisService;
|
|
||||||
|
|
||||||
private IBdWaresSpecialPostageService bdWaresSpecialPostageService;
|
private IBdWaresSpecialPostageService bdWaresSpecialPostageService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setPostageAreaService(IBdPostageAreaService postageAreaService) {
|
private RedisService redisService;
|
||||||
this.postageAreaService = postageAreaService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setBdPostageFailAreaService(IBdPostageFailAreaService bdPostageFailAreaService) {
|
|
||||||
this.bdPostageFailAreaService = bdPostageFailAreaService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setPostageService(IBdPostageService postageService) {
|
|
||||||
this.postageService = postageService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setRedisService(RedisService redisService) {
|
|
||||||
this.redisService = redisService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setBdWaresRangeService(IBdWaresRangeService bdWaresRangeService) {
|
public void setBdWaresRangeService(IBdWaresRangeService bdWaresRangeService) {
|
||||||
|
@ -127,11 +102,6 @@ public class SaOrderHandle {
|
||||||
this.bdProductService = bdProductService;
|
this.bdProductService = bdProductService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public void setPostageDetailService(IBdPostageDetailService postageDetailService) {
|
|
||||||
this.postageDetailService = postageDetailService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setBdWaresDetailService(IBdWaresDetailService bdWaresDetailService) {
|
public void setBdWaresDetailService(IBdWaresDetailService bdWaresDetailService) {
|
||||||
this.bdWaresDetailService = bdWaresDetailService;
|
this.bdWaresDetailService = bdWaresDetailService;
|
||||||
|
@ -191,7 +161,7 @@ public class SaOrderHandle {
|
||||||
cuMember.setPkCreator(centerMember.getPkId());
|
cuMember.setPkCreator(centerMember.getPkId());
|
||||||
if (centerMember.getPkTeamCode() == null) {
|
if (centerMember.getPkTeamCode() == null) {
|
||||||
// 验证父级是不是团队
|
// 验证父级是不是团队
|
||||||
CuMemberTeamExt memberTeamExt = memberTeamServiceApi.getCuMemberTeamById(centerMember.getPkId()).getData();
|
CuMemberTeamExt memberTeamExt = iMemberTeamServiceApi.getCuMemberTeamById(centerMember.getPkId()).getData();
|
||||||
if (memberTeamExt != null) {
|
if (memberTeamExt != null) {
|
||||||
cuMember.setPkTeamCode(memberTeamExt.getPkId());
|
cuMember.setPkTeamCode(memberTeamExt.getPkId());
|
||||||
}
|
}
|
||||||
|
@ -240,7 +210,7 @@ public class SaOrderHandle {
|
||||||
Integer pkCountry = orderParam.getPkSettleCountry();
|
Integer pkCountry = orderParam.getPkSettleCountry();
|
||||||
|
|
||||||
// 获取汇率
|
// 获取汇率
|
||||||
CurrencyDTO currency = currencyServiceApi.getCurrency(pkCountry).getData();
|
CurrencyDTO currency = iCurrencyServiceApi.getCurrency(pkCountry).getData();
|
||||||
// 商品编号 + sku主键 + 数量
|
// 商品编号 + sku主键 + 数量
|
||||||
List<BdWaresDetailExt> bdWaresDetailExtList = getWaresDetailExtList(orderParam, cuMember);
|
List<BdWaresDetailExt> bdWaresDetailExtList = getWaresDetailExtList(orderParam, cuMember);
|
||||||
if (CollectionUtil.isEmpty(bdWaresDetailExtList)) {
|
if (CollectionUtil.isEmpty(bdWaresDetailExtList)) {
|
||||||
|
@ -257,14 +227,12 @@ public class SaOrderHandle {
|
||||||
// 处理邮费 根据专区获得邮费模板 邮费 先进行分类,把邮费模板一样的放在一起
|
// 处理邮费 根据专区获得邮费模板 邮费 先进行分类,把邮费模板一样的放在一起
|
||||||
Map<Integer, List<SaOrderItems>> postageMap = new HashMap<>(ComputeUtil.mapInitCapacity(bdWaresDetailExtList.size()));
|
Map<Integer, List<SaOrderItems>> postageMap = new HashMap<>(ComputeUtil.mapInitCapacity(bdWaresDetailExtList.size()));
|
||||||
|
|
||||||
// 等级
|
|
||||||
R<List<GradeDTO>> gradeDTO = gradeServiceApi.queryGradeList(pkCountry);
|
|
||||||
List<GradeDTO> gradeList = gradeDTO.getData();
|
|
||||||
Map<Integer, GradeDTO> gradeMap = gradeList.stream().collect(Collectors.toMap(GradeDTO::getGradeValue, Function.identity()));
|
|
||||||
|
|
||||||
for (BdWaresDetailExt waresDetailExt : bdWaresDetailExtList) {
|
for (BdWaresDetailExt waresDetailExt : bdWaresDetailExtList) {
|
||||||
SaOrderItems saOrderItems = getSaOrderItems(cuMember, saOrder, currency, saOrderItemsList, waresDetailExt);
|
SaOrderItems saOrderItems = getSaOrderItems(cuMember, saOrder, currency, saOrderItemsList, waresDetailExt);
|
||||||
|
|
||||||
|
// 累积产品价格(计算包邮使用)
|
||||||
|
resultPostage = resultPostage.add(saOrderItems.getPrice().multiply(new BigDecimal(saOrderItems.getQuantity())));
|
||||||
|
|
||||||
// 免邮的话不需要计算邮费
|
// 免邮的话不需要计算邮费
|
||||||
if (EYesNo.YES.getIntValue() == waresDetailExt.getIsFreeMail()) {
|
if (EYesNo.YES.getIntValue() == waresDetailExt.getIsFreeMail()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -272,13 +240,11 @@ public class SaOrderHandle {
|
||||||
if (EDelivery.FAST_MAIL.getValue() == orderParam.getDeliveryWay()) {
|
if (EDelivery.FAST_MAIL.getValue() == orderParam.getDeliveryWay()) {
|
||||||
setPostageTmpMap(orderParam, postageMap, waresDetailExt, saOrderItems);
|
setPostageTmpMap(orderParam, postageMap, waresDetailExt, saOrderItems);
|
||||||
}
|
}
|
||||||
// 累积产品价格(计算包邮使用)
|
|
||||||
resultPostage = resultPostage.add(saOrderItems.getPrice().multiply(new BigDecimal(saOrderItems.getQuantity())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EDelivery.FAST_MAIL.getValue() == orderParam.getDeliveryWay()) {
|
if (EDelivery.FAST_MAIL.getValue() == orderParam.getDeliveryWay()) {
|
||||||
// 获取邮费配置
|
// 获取邮费配置
|
||||||
String postageConfig = systemConfigServiceApi.getBonusSystemConfig(pkCountry, ESystemConfig.POSTAGE_CONFIG.getKey()).getData();
|
String postageConfig = iSystemConfigServiceApi.getBonusSystemConfig(pkCountry, ESystemConfig.POSTAGE_CONFIG.getKey()).getData();
|
||||||
if (null == postageConfig) {
|
if (null == postageConfig) {
|
||||||
log.error("邮费模板缓存为空,按取最大值处理");
|
log.error("邮费模板缓存为空,按取最大值处理");
|
||||||
// 缓存值为空,按取最大值进行处理
|
// 缓存值为空,按取最大值进行处理
|
||||||
|
@ -332,7 +298,7 @@ public class SaOrderHandle {
|
||||||
List<SaOrderItems> postageOrderItemsList, Integer pkCountry,
|
List<SaOrderItems> postageOrderItemsList, Integer pkCountry,
|
||||||
List<Integer> specialPostageList) {
|
List<Integer> specialPostageList) {
|
||||||
// 获取专区设置的不能发货区域
|
// 获取专区设置的不能发货区域
|
||||||
List<BdPostageFailAreaExt> failAreaList = bdPostageFailAreaService.queryPostageFailAreaList(pkPostage);
|
List<BdPostageFailAreaExt> failAreaList = iBdPostageFailAreaService.queryPostageFailAreaList(pkPostage);
|
||||||
if (CollectionUtil.isNotEmpty(failAreaList)) {
|
if (CollectionUtil.isNotEmpty(failAreaList)) {
|
||||||
for (BdPostageFailAreaExt postageFailArea : failAreaList) {
|
for (BdPostageFailAreaExt postageFailArea : failAreaList) {
|
||||||
if (orderParam.getRecProvince().equals(postageFailArea.getProvince()) && orderParam.getRecCity().equals(postageFailArea.getCity())) {
|
if (orderParam.getRecProvince().equals(postageFailArea.getProvince()) && orderParam.getRecCity().equals(postageFailArea.getCity())) {
|
||||||
|
@ -346,8 +312,8 @@ public class SaOrderHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取邮费模板主表
|
// 获取邮费模板主表
|
||||||
BdPostage postage = postageService.getPostage(pkPostage);
|
BdPostage postage = iBdPostageService.getPostage(pkPostage);
|
||||||
List<BdPostageDetail> postageDetailList = postageDetailService.getPostageDetail(orderParam.getTransType(), pkPostage);
|
List<BdPostageDetail> postageDetailList = iBdPostageDetailService.getPostageDetail(orderParam.getTransType(), pkPostage);
|
||||||
BdPostageDetail postageDetail = null;
|
BdPostageDetail postageDetail = null;
|
||||||
// 验证省、市
|
// 验证省、市
|
||||||
for (BdPostageDetail bdPostageDetail : postageDetailList) {
|
for (BdPostageDetail bdPostageDetail : postageDetailList) {
|
||||||
|
@ -368,7 +334,7 @@ public class SaOrderHandle {
|
||||||
boolean specialFlag = specialPostageList.contains(pkPostage);
|
boolean specialFlag = specialPostageList.contains(pkPostage);
|
||||||
|
|
||||||
// 获取专区设置的免邮金额
|
// 获取专区设置的免邮金额
|
||||||
List<BdPostageArea> postageAreaList = postageAreaService.getPostageArea(orderParam.getTransType(), pkPostage, orderParam.getSpecialArea(), pkCountry);
|
List<BdPostageArea> postageAreaList = iBdPostageAreaService.getPostageArea(orderParam.getTransType(), pkPostage, orderParam.getSpecialArea(), pkCountry);
|
||||||
BigDecimal freeAmount = null;
|
BigDecimal freeAmount = null;
|
||||||
if (CollectionUtil.isNotEmpty(postageAreaList)) {
|
if (CollectionUtil.isNotEmpty(postageAreaList)) {
|
||||||
BdPostageArea allPostageAres = null;
|
BdPostageArea allPostageAres = null;
|
||||||
|
@ -376,11 +342,6 @@ public class SaOrderHandle {
|
||||||
for (BdPostageArea postageArea : postageAreaList) {
|
for (BdPostageArea postageArea : postageAreaList) {
|
||||||
// 验证省
|
// 验证省
|
||||||
if (orderParam.getRecProvince().equals(postageArea.getProvince())) {
|
if (orderParam.getRecProvince().equals(postageArea.getProvince())) {
|
||||||
// 2023.11.29 临时需求,运费模板特殊地区不免邮
|
|
||||||
if (postage.getTempName().startsWith("御玖饮竹盐模板")) {
|
|
||||||
specialFlag = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (orderParam.getRecCity().equals(postageArea.getCity()) ||
|
if (orderParam.getRecCity().equals(postageArea.getCity()) ||
|
||||||
postageArea.getCity() == null) {
|
postageArea.getCity() == null) {
|
||||||
freeAmount = postageArea.getFreeAmount();
|
freeAmount = postageArea.getFreeAmount();
|
||||||
|
@ -470,7 +431,7 @@ public class SaOrderHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 活动赠品 赠送封装
|
// 活动赠品 赠送封装
|
||||||
List<BdWaresDetailExt> newWaresDetailExtList = activityGiftService.generateActivityGiftWaresAchieve(orderParam.getSpecialArea(), orderParam.getPkSettleCountry(), bdWaresDetailExtList,
|
List<BdWaresDetailExt> newWaresDetailExtList = iActivityService.generateActivityGiftWaresAchieve(orderParam.getSpecialArea(), orderParam.getPkSettleCountry(), bdWaresDetailExtList,
|
||||||
orderParam.getParent(), cuMember);
|
orderParam.getParent(), cuMember);
|
||||||
if (newWaresDetailExtList.size() > 0) {
|
if (newWaresDetailExtList.size() > 0) {
|
||||||
bdWaresDetailExtList.addAll(newWaresDetailExtList);
|
bdWaresDetailExtList.addAll(newWaresDetailExtList);
|
||||||
|
@ -735,7 +696,7 @@ public class SaOrderHandle {
|
||||||
if (CountryConstants.CHINA_COUNTRY.equals(cuMember.getPkSettleCountry()) || orderParam.getPkStorehouse() == null) {
|
if (CountryConstants.CHINA_COUNTRY.equals(cuMember.getPkSettleCountry()) || orderParam.getPkStorehouse() == null) {
|
||||||
if (orderParam.getRecProvince() != null) {
|
if (orderParam.getRecProvince() != null) {
|
||||||
// 根据收货省获取仓库
|
// 根据收货省获取仓库
|
||||||
BdStorehouse bdStorehouse = currencyServiceApi.queryBdStorehouseByProvince(orderParam.getRecProvince()).getData();
|
BdStorehouse bdStorehouse = iCurrencyServiceApi.queryBdStorehouseByProvince(orderParam.getRecProvince()).getData();
|
||||||
if (bdStorehouse != null) {
|
if (bdStorehouse != null) {
|
||||||
saOrderExt.setPkStorehouse(bdStorehouse.getPkId());
|
saOrderExt.setPkStorehouse(bdStorehouse.getPkId());
|
||||||
}
|
}
|
||||||
|
@ -777,7 +738,7 @@ public class SaOrderHandle {
|
||||||
* orderType 1 = 注册,注册不用找累计 2 升级需要
|
* orderType 1 = 注册,注册不用找累计 2 升级需要
|
||||||
*/
|
*/
|
||||||
GradeDTO getMemberGradeAndAwardByCountry(BigDecimal settleOrderAmount, BigDecimal settleOrderPv, Integer pkCountry, String upgradeWay) {
|
GradeDTO getMemberGradeAndAwardByCountry(BigDecimal settleOrderAmount, BigDecimal settleOrderPv, Integer pkCountry, String upgradeWay) {
|
||||||
List<GradeDTO> gradeList = gradeServiceApi.queryGradeConfigByCondition(pkCountry).getData();
|
List<GradeDTO> gradeList = iGradeServiceApi.queryGradeConfigByCondition(pkCountry).getData();
|
||||||
|
|
||||||
if (gradeList != null && gradeList.size() > 0) {
|
if (gradeList != null && gradeList.size() > 0) {
|
||||||
// // TODO new V1、V2是购买直接给等级,V3以上不是
|
// // TODO new V1、V2是购买直接给等级,V3以上不是
|
||||||
|
@ -880,7 +841,7 @@ public class SaOrderHandle {
|
||||||
*/
|
*/
|
||||||
void transformSaOrderToVO(SaOrderVO saOrderVO) {
|
void transformSaOrderToVO(SaOrderVO saOrderVO) {
|
||||||
// 处理会员编号,汇率,顶点
|
// 处理会员编号,汇率,顶点
|
||||||
CurrencyDTO currencyDTO = currencyServiceApi.getCurrencyByPkId(saOrderVO.getPkRate()).getData();
|
CurrencyDTO currencyDTO = iCurrencyServiceApi.getCurrencyByPkId(saOrderVO.getPkRate()).getData();
|
||||||
saOrderVO.setRate(currencyDTO.getOutExchangeRate());
|
saOrderVO.setRate(currencyDTO.getOutExchangeRate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,7 +866,7 @@ public class SaOrderHandle {
|
||||||
* @param pkGrade 等级
|
* @param pkGrade 等级
|
||||||
*/
|
*/
|
||||||
GradeDTO queryGradeConfigByCondition(Integer pkCountry, Integer pkGrade) {
|
GradeDTO queryGradeConfigByCondition(Integer pkCountry, Integer pkGrade) {
|
||||||
return gradeServiceApi.queryGradeConfigByCondition(pkCountry, pkGrade).getData();
|
return iGradeServiceApi.queryGradeConfigByCondition(pkCountry, pkGrade).getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
|
||||||
}
|
}
|
||||||
// 封装订单信息
|
// 封装订单信息
|
||||||
SaOrderExt saOrderExt = saOrderHandle.packageSaveSaOrder(orderParam, cuMember, orderCode);
|
SaOrderExt saOrderExt = saOrderHandle.packageSaveSaOrder(orderParam, cuMember, orderCode);
|
||||||
// 封装订单明细(2024.02.02添加处理订单扩展类型)
|
// 封装订单明细 -- 处理邮费
|
||||||
saOrderHandle.packSaOrderItems(cuMember, saOrderExt, orderParam);
|
saOrderHandle.packSaOrderItems(cuMember, saOrderExt, orderParam);
|
||||||
// 第二次封装订单,根据明细表计算订单主表金额、业绩,处理明细仓库
|
// 第二次封装订单,根据明细表计算订单主表金额、业绩,处理明细仓库
|
||||||
// key为产品id
|
// key为产品id
|
||||||
|
|
|
@ -15,11 +15,7 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 我的订单返回VO
|
* 我的订单返回VO
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/1/13 16:13
|
|
||||||
* @Classname: MyOrderVO
|
|
||||||
* @PackageName: com.hzs.sale.order.vo
|
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@ -155,7 +151,7 @@ public class CanApplyOrderVO {
|
||||||
*/
|
*/
|
||||||
private BigDecimal postage;
|
private BigDecimal postage;
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
private Integer deliveryWay;
|
private Integer deliveryWay;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,30 +1,14 @@
|
||||||
package com.hzs.sale.order.vo;/**
|
package com.hzs.sale.order.vo;
|
||||||
* @Description:
|
|
||||||
* @Author: yuhui
|
|
||||||
* @Time: 2023/4/11 10:33
|
|
||||||
* @Classname: OrderChargeLogVo
|
|
||||||
* @PackageName: com.hzs.sale.order.vo
|
|
||||||
*/
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.hzs.common.core.annotation.Excel;
|
import com.hzs.common.core.annotation.Excel;
|
||||||
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
|
import com.hzs.common.domain.sale.ext.SaOrderItemsExt;
|
||||||
import com.hzs.common.domain.sale.order.SaOrderItems;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
*@BelongsProject: hzs_cloud
|
|
||||||
*@BelongsPackage: com.hzs.sale.order.vo
|
|
||||||
*@Author: yh
|
|
||||||
*@CreateTime: 2023-04-11 10:33
|
|
||||||
*@Description: TODO
|
|
||||||
*@Version: 1.0
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
public class OrderChargeLogVo {
|
public class OrderChargeLogVo {
|
||||||
|
|
||||||
|
@ -160,7 +144,6 @@ public class OrderChargeLogVo {
|
||||||
private String pkCenterName;
|
private String pkCenterName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单金额(本地币)
|
* 订单金额(本地币)
|
||||||
*/
|
*/
|
||||||
|
@ -340,7 +323,7 @@ public class OrderChargeLogVo {
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date creationTime;
|
private Date creationTime;
|
||||||
|
|
||||||
|
@ -348,19 +331,17 @@ public class OrderChargeLogVo {
|
||||||
/**
|
/**
|
||||||
* 支付时间
|
* 支付时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "支付时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "支付时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date payTime;
|
private Date payTime;
|
||||||
/**
|
/**
|
||||||
* 发货日期
|
* 发货日期
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Excel(name = "发货日期",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "发货日期", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date deliveryTime;
|
private Date deliveryTime;
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Excel(name = "发货方式")
|
@Excel(name = "发货方式")
|
||||||
private String deliveryWayStr;
|
private String deliveryWayStr;
|
||||||
|
@ -382,7 +363,6 @@ public class OrderChargeLogVo {
|
||||||
private String preSaleStatusStr;
|
private String preSaleStatusStr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付方式
|
* 支付方式
|
||||||
*/
|
*/
|
||||||
|
@ -391,7 +371,7 @@ public class OrderChargeLogVo {
|
||||||
/**
|
/**
|
||||||
* 撤单时间
|
* 撤单时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "撤单时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "撤单时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date cancelOrderTime;
|
private Date cancelOrderTime;
|
||||||
/**
|
/**
|
||||||
|
@ -402,13 +382,13 @@ public class OrderChargeLogVo {
|
||||||
/**
|
/**
|
||||||
* 审核状态(1=未审核,2=审核通过,3=审核驳回)
|
* 审核状态(1=未审核,2=审核通过,3=审核驳回)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "审核状态",readConverterExp = "1=未审核,2=审核通过,3=审核驳回")
|
@Excel(name = "审核状态", readConverterExp = "1=未审核,2=审核通过,3=审核驳回")
|
||||||
private Integer approvalStatus;
|
private Integer approvalStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 终审时间
|
* 终审时间
|
||||||
*/
|
*/
|
||||||
@Excel(name = "终审时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "终审时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date lastInstanceDate;
|
private Date lastInstanceDate;
|
||||||
|
|
||||||
|
@ -433,11 +413,10 @@ public class OrderChargeLogVo {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 来源 1 后台 2 前台
|
* 来源 1 后台 2 前台
|
||||||
*/
|
*/
|
||||||
@Excel(name = "来源")
|
@Excel(name = "来源")
|
||||||
private String orderChargeLogSourceStr;
|
private String orderChargeLogSourceStr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 用于管理端返回到前台的实体vo
|
* 用于管理端返回到前台的实体vo
|
||||||
* @Author: sui q
|
|
||||||
* @Time: 2022/10/19 17:37
|
|
||||||
* @Classname: SaOrderVO
|
|
||||||
* @PackageName: com.hzs.sale.order.vo
|
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@ -164,7 +160,7 @@ public class SaOrderVO extends BaseEntity {
|
||||||
private String tranTypeVal;
|
private String tranTypeVal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Transaction(transactionKey = EnumsPrefixConstants.DELIVERY)
|
@Transaction(transactionKey = EnumsPrefixConstants.DELIVERY)
|
||||||
|
|
|
@ -5,18 +5,15 @@ import com.hzs.common.domain.sale.wares.BdWaresSpecialPostage;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* 商品特殊邮费配置 Mapper 接口
|
* 商品特殊邮费配置 Mapper 接口
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-10-27
|
|
||||||
*/
|
*/
|
||||||
public interface BdWaresSpecialPostageMapper extends BaseMapper<BdWaresSpecialPostage> {
|
public interface BdWaresSpecialPostageMapper extends BaseMapper<BdWaresSpecialPostage> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据邮费主键删除邮费配置信息
|
* 根据邮费主键删除邮费配置信息
|
||||||
|
*
|
||||||
* @param pkPostage
|
* @param pkPostage
|
||||||
*/
|
*/
|
||||||
void deleteByPkPostage(@Param("pkPostage") Integer pkPostage);
|
void deleteByPkPostage(@Param("pkPostage") Integer pkPostage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
package com.hzs.sale.wares.service.impl;
|
package com.hzs.sale.wares.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
|
||||||
import com.hzs.common.core.enums.ERangeType;
|
import com.hzs.common.core.enums.ERangeType;
|
||||||
import com.hzs.common.domain.member.base.CuMember;
|
import com.hzs.common.domain.member.base.CuMember;
|
||||||
import com.hzs.common.domain.sale.wares.BdWaresRange;
|
import com.hzs.common.domain.sale.wares.BdWaresRange;
|
||||||
import com.hzs.sale.wares.mapper.BdWaresRangeMapper;
|
import com.hzs.sale.wares.mapper.BdWaresRangeMapper;
|
||||||
import com.hzs.sale.wares.service.IBdWaresRangeService;
|
import com.hzs.sale.wares.service.IBdWaresRangeService;
|
||||||
import com.hzs.system.config.IAwardsServiceApi;
|
|
||||||
import com.hzs.system.config.IRangeServiceApi;
|
import com.hzs.system.config.IRangeServiceApi;
|
||||||
import com.hzs.system.config.dto.RangeDTO;
|
import com.hzs.system.config.dto.RangeDTO;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
@ -26,18 +24,11 @@ public class BdWaresRangeServiceImpl extends ServiceImpl<BdWaresRangeMapper, BdW
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IRangeServiceApi iRangeServiceApi;
|
IRangeServiceApi iRangeServiceApi;
|
||||||
@DubboReference
|
|
||||||
IAwardsServiceApi iAwardsServiceApi;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BdWaresRange> queryWaresRangeByCondition(CuMember cuMember, List<Integer> pkWareList) {
|
public List<BdWaresRange> queryWaresRangeByCondition(CuMember cuMember, List<Integer> pkWareList) {
|
||||||
int level = cuMember.getPkSettleGrade();
|
int level = cuMember.getPkSettleGrade();
|
||||||
int rangeType = ERangeType.GRADE.getValue();
|
int rangeType = ERangeType.GRADE.getValue();
|
||||||
// BdAwards bdAwards = iAwardsServiceApi.getAwardsOne(cuMember.getPkAwards()).getData();
|
|
||||||
// if (bdAwards.getAwardsValue() > EAwards.MEMBER.getValue()) {
|
|
||||||
// level = cuMember.getPkAwards();
|
|
||||||
// rangeType = ERangeType.AWARDS.getValue();
|
|
||||||
// }
|
|
||||||
RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(cuMember.getPkSettleCountry(), rangeType, level).getData();
|
RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(cuMember.getPkSettleCountry(), rangeType, level).getData();
|
||||||
if (rangeDTO == null) {
|
if (rangeDTO == null) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
|
@ -48,9 +39,9 @@ public class BdWaresRangeServiceImpl extends ServiceImpl<BdWaresRangeMapper, BdW
|
||||||
@Override
|
@Override
|
||||||
public List<BdWaresRange> querySkuWaresRangeByCondition(Integer pkCountry, Integer rangeType, Integer level, List<Integer> specsSkuList) {
|
public List<BdWaresRange> querySkuWaresRangeByCondition(Integer pkCountry, Integer rangeType, Integer level, List<Integer> specsSkuList) {
|
||||||
RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(pkCountry, rangeType, level).getData();
|
RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(pkCountry, rangeType, level).getData();
|
||||||
QueryWrapper<BdWaresRange> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdWaresRange> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SystemFieldConstants.PK_RANGE, rangeDTO.getPkRange());
|
queryWrapper.eq(BdWaresRange::getPkRange, rangeDTO.getPkRange());
|
||||||
queryWrapper.in(SystemFieldConstants.PK_WARES_SPECS_SKU, specsSkuList);
|
queryWrapper.in(BdWaresRange::getPkWaresSpecsSku, specsSkuList);
|
||||||
return baseMapper.selectList(queryWrapper);
|
return baseMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.hzs.sale.wares.service.impl;
|
package com.hzs.sale.wares.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
|
||||||
import com.hzs.common.domain.sale.wares.BdWaresSpecialPostage;
|
import com.hzs.common.domain.sale.wares.BdWaresSpecialPostage;
|
||||||
import com.hzs.sale.wares.mapper.BdWaresSpecialPostageMapper;
|
import com.hzs.sale.wares.mapper.BdWaresSpecialPostageMapper;
|
||||||
import com.hzs.sale.wares.service.IBdWaresSpecialPostageService;
|
import com.hzs.sale.wares.service.IBdWaresSpecialPostageService;
|
||||||
|
@ -12,26 +11,22 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* 商品特殊邮费配置 服务实现类
|
* 商品特殊邮费配置 服务实现类
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-10-27
|
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BdWaresSpecialPostageServiceImpl extends ServiceImpl<BdWaresSpecialPostageMapper, BdWaresSpecialPostage> implements IBdWaresSpecialPostageService {
|
public class BdWaresSpecialPostageServiceImpl extends ServiceImpl<BdWaresSpecialPostageMapper, BdWaresSpecialPostage> implements IBdWaresSpecialPostageService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> querySpecialPostagePkWares(Integer pkCountry) {
|
public List<Integer> querySpecialPostagePkWares(Integer pkCountry) {
|
||||||
QueryWrapper<BdWaresSpecialPostage> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdWaresSpecialPostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, pkCountry);
|
queryWrapper.eq(BdWaresSpecialPostage::getPkCountry, pkCountry);
|
||||||
List<BdWaresSpecialPostage> pkWaresList = this.list(queryWrapper);
|
List<BdWaresSpecialPostage> pkWaresList = this.list(queryWrapper);
|
||||||
return pkWaresList.stream().map(BdWaresSpecialPostage::getPkPostage).collect(Collectors.toList());
|
return pkWaresList.stream().map(BdWaresSpecialPostage::getPkPostage).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据邮费主键删除邮费配置信息
|
* 根据邮费主键删除邮费配置信息
|
||||||
|
*
|
||||||
* @param pkPostage
|
* @param pkPostage
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,20 +2,10 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzs.sale.wares.mapper.BdWaresSpecialPostageMapper">
|
<mapper namespace="com.hzs.sale.wares.mapper.BdWaresSpecialPostageMapper">
|
||||||
|
|
||||||
<!-- 通用查询映射结果 -->
|
|
||||||
<resultMap id="BaseResultMap" type="com.hzs.common.domain.sale.wares.BdWaresSpecialPostage">
|
|
||||||
<id column="PK_ID" property="pkId"/>
|
|
||||||
<result column="PK_COUNTRY" property="pkCountry"/>
|
|
||||||
<result column="DEL_FLAG" property="delFlag"/>
|
|
||||||
<result column="PK_CREATOR" property="pkCreator"/>
|
|
||||||
<result column="PK_MODIFIED" property="pkModified"/>
|
|
||||||
<result column="CREATION_TIME" property="creationTime"/>
|
|
||||||
<result column="MODIFIED_TIME" property="modifiedTime"/>
|
|
||||||
<result column="PK_POSTAGE" property="pkPostage"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<delete id="deleteByPkPostage">
|
<delete id="deleteByPkPostage">
|
||||||
delete from BD_WARES_SPECIAL_POSTAGE where PK_POSTAGE = #{pkPostage}
|
delete
|
||||||
|
from BD_WARES_SPECIAL_POSTAGE
|
||||||
|
where PK_POSTAGE = #{pkPostage}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -5,9 +5,6 @@ import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专区包邮配置 Mapper 接口
|
* 专区包邮配置 Mapper 接口
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-11-30
|
|
||||||
*/
|
*/
|
||||||
public interface BdAreaFreePostageMapper extends BaseMapper<BdAreaFreePostage> {
|
public interface BdAreaFreePostageMapper extends BaseMapper<BdAreaFreePostage> {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.hzs.system.config.provider;
|
package com.hzs.system.config.provider;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
|
||||||
import com.hzs.common.core.domain.R;
|
import com.hzs.common.core.domain.R;
|
||||||
import com.hzs.common.core.enums.EYesNo;
|
import com.hzs.common.core.enums.EYesNo;
|
||||||
import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
||||||
|
@ -14,11 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 专区免邮服务
|
* 专区免邮服务
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/12/1 11:22
|
|
||||||
* @Classname: AreaFreePostageProvider
|
|
||||||
* @PackageName: com.hzs.system.config.provider
|
|
||||||
*/
|
*/
|
||||||
@DubboService
|
@DubboService
|
||||||
public class AreaFreePostageProvider implements IAreaFreePostageServiceApi {
|
public class AreaFreePostageProvider implements IAreaFreePostageServiceApi {
|
||||||
|
@ -30,11 +25,11 @@ public class AreaFreePostageProvider implements IAreaFreePostageServiceApi {
|
||||||
public R<BdAreaFreePostage> queryAreaFreePostage(Integer specialArea, Integer pkCountry) {
|
public R<BdAreaFreePostage> queryAreaFreePostage(Integer specialArea, Integer pkCountry) {
|
||||||
BdAreaFreePostage areaFreePostage = null;
|
BdAreaFreePostage areaFreePostage = null;
|
||||||
|
|
||||||
QueryWrapper<BdAreaFreePostage> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAreaFreePostage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SystemFieldConstants.PK_COUNTRY, pkCountry);
|
queryWrapper.eq(BdAreaFreePostage::getPkCountry, pkCountry);
|
||||||
queryWrapper.eq("SPECIAL_AREA", specialArea);
|
queryWrapper.eq(BdAreaFreePostage::getSpecialArea, specialArea);
|
||||||
queryWrapper.eq("ENABLE_STATE", EYesNo.YES.getIntValue());
|
queryWrapper.eq(BdAreaFreePostage::getEnableState, EYesNo.YES.getIntValue());
|
||||||
queryWrapper.orderByDesc(SystemFieldConstants.CREATION_TIME);
|
queryWrapper.orderByDesc(BdAreaFreePostage::getCreationTime);
|
||||||
List<BdAreaFreePostage> list = iBdAreaFreePostageService.list(queryWrapper);
|
List<BdAreaFreePostage> list = iBdAreaFreePostageService.list(queryWrapper);
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
areaFreePostage = list.get(0);
|
areaFreePostage = list.get(0);
|
||||||
|
|
|
@ -5,12 +5,8 @@ import com.hzs.common.domain.system.config.BdAreaFreePostage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专区包邮配置 服务类
|
* 专区包邮配置 服务类
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-11-30
|
|
||||||
*/
|
*/
|
||||||
public interface IBdAreaFreePostageService extends IService<BdAreaFreePostage> {
|
public interface IBdAreaFreePostageService extends IService<BdAreaFreePostage> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,6 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专区包邮配置 服务实现类
|
* 专区包邮配置 服务实现类
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-11-30
|
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class BdAreaFreePostageServiceImpl extends ServiceImpl<BdAreaFreePostageMapper, BdAreaFreePostage> implements IBdAreaFreePostageService {
|
public class BdAreaFreePostageServiceImpl extends ServiceImpl<BdAreaFreePostageMapper, BdAreaFreePostage> implements IBdAreaFreePostageService {
|
||||||
|
|
|
@ -2,18 +2,4 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzs.system.config.mapper.BdAreaFreePostageMapper">
|
<mapper namespace="com.hzs.system.config.mapper.BdAreaFreePostageMapper">
|
||||||
|
|
||||||
<!-- 通用查询映射结果 -->
|
|
||||||
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.config.BdAreaFreePostage">
|
|
||||||
<id column="PK_ID" property="pkId"/>
|
|
||||||
<result column="DEL_FLAG" property="delFlag"/>
|
|
||||||
<result column="CREATION_TIME" property="creationTime"/>
|
|
||||||
<result column="MODIFIED_TIME" property="modifiedTime"/>
|
|
||||||
<result column="PK_CREATOR" property="pkCreator"/>
|
|
||||||
<result column="PK_MODIFIED" property="pkModified"/>
|
|
||||||
<result column="PK_COUNTRY" property="pkCountry"/>
|
|
||||||
<result column="SPECIAL_AREA" property="specialArea"/>
|
|
||||||
<result column="FREE_AMOUNT" property="freeAmount"/>
|
|
||||||
<result column="ENABLE_STATE" property="enableState"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -52,11 +52,6 @@ public class SystemFieldConstants {
|
||||||
*/
|
*/
|
||||||
public static final String MODIFIED_TIME = "MODIFIED_TIME";
|
public static final String MODIFIED_TIME = "MODIFIED_TIME";
|
||||||
|
|
||||||
/**
|
|
||||||
* 国家
|
|
||||||
*/
|
|
||||||
public static final String PK_COUNTRY_VALUE = "pkCountry";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国家
|
* 国家
|
||||||
*/
|
*/
|
||||||
|
@ -67,48 +62,4 @@ public class SystemFieldConstants {
|
||||||
*/
|
*/
|
||||||
public static final String PK_CORP = "pk_corp";
|
public static final String PK_CORP = "pk_corp";
|
||||||
|
|
||||||
/**
|
|
||||||
* 等级值
|
|
||||||
*/
|
|
||||||
public static final String GRADE_VALUE = "grade_value";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 等级结算值
|
|
||||||
*/
|
|
||||||
public static final String START_VALUE = "start_value";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 极差类型
|
|
||||||
*/
|
|
||||||
public static final String RANGE_TYPE = "range_type";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 级别
|
|
||||||
*/
|
|
||||||
public static final String PK_LEVEL = "pk_level";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 极差
|
|
||||||
*/
|
|
||||||
public static final String PK_RANGE = "pk_range";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格sku主键
|
|
||||||
*/
|
|
||||||
public static final String PK_WARES_SPECS_SKU = "pk_wares_specs_sku";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品明细主键
|
|
||||||
*/
|
|
||||||
public static final String PK_WARES_DETAIL = "PK_WARES_DETAIL";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品主键
|
|
||||||
*/
|
|
||||||
public static final String PK_WARES = "PK_WARES";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 审核状态
|
|
||||||
*/
|
|
||||||
public static final String APPROVE_STATUS = "APPROVE_STATUS";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,16 +21,6 @@ public enum EDelivery {
|
||||||
*/
|
*/
|
||||||
COMPANY_PICKED_UP(2, "公司自提", 0, EnumsPrefixConstants.DELIVERY + "2"),
|
COMPANY_PICKED_UP(2, "公司自提", 0, EnumsPrefixConstants.DELIVERY + "2"),
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺自提
|
|
||||||
*/
|
|
||||||
SHOP_PICKED_UP(3, "店铺自提", 0, EnumsPrefixConstants.DELIVERY + "3"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺配送
|
|
||||||
*/
|
|
||||||
SHOP_DELIVERY(4, "店铺配送", 0, EnumsPrefixConstants.DELIVERY + "4"),
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,13 +7,6 @@ import lombok.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description:
|
|
||||||
* @Author: sui q
|
|
||||||
* @Time: 2022/9/16 16:41
|
|
||||||
* @Classname: BdWaresDetailsExt
|
|
||||||
* @PackageName: com.hzs.common.domain.sale.ext
|
|
||||||
*/
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
|
@ -70,7 +63,7 @@ public class BdWaresDetailExt extends BdWaresDetail {
|
||||||
*/
|
*/
|
||||||
private BigDecimal assAchieve;
|
private BigDecimal assAchieve;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 规格分类
|
// * 规格分类
|
||||||
// */
|
// */
|
||||||
// private Integer pkSpecsType;
|
// private Integer pkSpecsType;
|
||||||
|
@ -102,7 +95,7 @@ public class BdWaresDetailExt extends BdWaresDetail {
|
||||||
private Integer waresQuantity;
|
private Integer waresQuantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消费配置主键
|
* 消费配置主键
|
||||||
*/
|
*/
|
||||||
private Integer pkSpecialCurrency;
|
private Integer pkSpecialCurrency;
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 订单修改记录扩展类
|
* 订单修改记录扩展类
|
||||||
* @Author: jiang chao
|
|
||||||
* @Time: 2023/2/3 10:58
|
|
||||||
* @Classname: SaOrderChargeLogExt
|
|
||||||
* @PackageName: com.hzs.common.domain.sale.ext
|
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@ -30,11 +26,9 @@ public class SaOrderChargeLogExt extends SaOrderChargeLog {
|
||||||
*/
|
*/
|
||||||
private String orderCode;
|
private String orderCode;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改类型(231=修改地址,232=调换货物,233=退单,234=撤销订单,235=撤销产品)
|
* 修改类型(231=修改地址,232=调换货物,233=退单,234=撤销订单,235=撤销产品)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Excel(name = "撤单类型")
|
@Excel(name = "撤单类型")
|
||||||
private String chargeTypeStr;
|
private String chargeTypeStr;
|
||||||
|
|
||||||
|
@ -169,7 +163,7 @@ public class SaOrderChargeLogExt extends SaOrderChargeLog {
|
||||||
private Date payTime;
|
private Date payTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
private Integer deliveryWay;
|
private Integer deliveryWay;
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class SaOrder extends BaseEntity {
|
||||||
private Integer tranType;
|
private Integer tranType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货方式 (1=快递,2=公司自提,3=店铺自提,4=店铺配送)
|
* 发货方式 (1=快递,2=公司自提)
|
||||||
*/
|
*/
|
||||||
@TableField("DELIVERY_WAY")
|
@TableField("DELIVERY_WAY")
|
||||||
private Integer deliveryWay;
|
private Integer deliveryWay;
|
||||||
|
|
|
@ -15,9 +15,6 @@ import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专区包邮配置
|
* 专区包邮配置
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-11-30
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|
Loading…
Reference in New Issue