fix bug
This commit is contained in:
@ -1801,6 +1801,7 @@ public class AppStoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, Stor
|
||||
//会员是否包邮
|
||||
if (priceGroupDTO.getVipFreeShipping()) {
|
||||
storeFreePostage = storePostage;
|
||||
cartInfo.forEach(res -> res.setPostagePrice(BigDecimal.ZERO));
|
||||
storePostage = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
|
@ -74,4 +74,6 @@ public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode CAMPAIGN_NUMBER_ERROR = new ErrorCode(1008007011, " 超出活动购买数量!");
|
||||
|
||||
ErrorCode CAMPAIGN_PRICE_NOT_ZERO_ERROR = new ErrorCode(1008007012, " 选择规格[{}]的商品,活动价格不能为0!");
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import co.yixiang.yshop.module.product.dal.dataobject.storeproduct.StoreProductD
|
||||
import co.yixiang.yshop.module.product.dal.dataobject.storeproductattrvalue.StoreProductAttrValueDO;
|
||||
import co.yixiang.yshop.module.product.dal.mysql.campaigndetail.CampaignDetailMapper;
|
||||
import co.yixiang.yshop.module.product.dal.mysql.campaigninfo.CampaignInfoMapper;
|
||||
import co.yixiang.yshop.module.product.enums.campaign.CampaignTypeEnum;
|
||||
import co.yixiang.yshop.module.product.enums.common.PageTypeEnum;
|
||||
import co.yixiang.yshop.module.product.enums.spu.ProductSpuStatusEnum;
|
||||
import co.yixiang.yshop.module.product.mq.producer.PayRefundProducer;
|
||||
@ -35,6 +36,7 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -113,6 +115,13 @@ public class CampaignInfoServiceImpl implements CampaignInfoService {
|
||||
for (CampaignDetailCreateReqVO detail : details) {
|
||||
StoreProductAttrValueDO productAttrValueDO = productAttrValueDOMap.get(detail.getSkuId());
|
||||
if (ObjectUtil.isNull(productAttrValueDO)) throw exception(STORE_PRODUCT_ATTR_VALUE_NOT_EXISTS);
|
||||
// 计算折扣价格
|
||||
if (CampaignTypeEnum.DISCOUNT.getValue().equals(createReqVO.getType()))
|
||||
detail.setPrice(productAttrValueDO.getPrice().multiply(detail.getDiscount())
|
||||
.divide(BigDecimal.TEN).setScale(2, RoundingMode.HALF_UP));
|
||||
// 活动价格不能为0
|
||||
if(productAttrValueDO.getPrice().compareTo(BigDecimal.ZERO) == 0)
|
||||
throw exception(CAMPAIGN_PRICE_NOT_ZERO_ERROR, productAttrValueDO.getSku());
|
||||
// 检测价格
|
||||
if (productAttrValueDO.getPrice().compareTo(detail.getPrice()) < 0)
|
||||
throw exception(CAMPAIGN_PASS_ORIGINAL_PRICE_ERROR, productAttrValueDO.getSku());
|
||||
@ -223,6 +232,13 @@ public class CampaignInfoServiceImpl implements CampaignInfoService {
|
||||
for (CampaignDetailCreateReqVO detail : details) {
|
||||
StoreProductAttrValueDO productAttrValueDO = productAttrValueDOMap.get(detail.getSkuId());
|
||||
if (ObjectUtil.isNull(productAttrValueDO)) throw exception(STORE_PRODUCT_ATTR_VALUE_NOT_EXISTS);
|
||||
// 计算折扣价格
|
||||
if (CampaignTypeEnum.DISCOUNT.getValue().equals(updateReqVO.getType()))
|
||||
detail.setPrice(productAttrValueDO.getPrice().multiply(detail.getDiscount())
|
||||
.divide(BigDecimal.TEN).setScale(2, RoundingMode.HALF_UP));
|
||||
// 活动价格不能为0
|
||||
if(productAttrValueDO.getPrice().compareTo(BigDecimal.ZERO) == 0)
|
||||
throw exception(CAMPAIGN_PRICE_NOT_ZERO_ERROR, productAttrValueDO.getSku());
|
||||
// 检测价格
|
||||
if (productAttrValueDO.getPrice().compareTo(detail.getPrice()) < 0)
|
||||
throw exception(CAMPAIGN_PASS_ORIGINAL_PRICE_ERROR, productAttrValueDO.getSku());
|
||||
|
@ -52,6 +52,7 @@
|
||||
TRUNCATE TABLE yshop_store_order_status;
|
||||
TRUNCATE TABLE yshop_store_cart;
|
||||
TRUNCATE TABLE yshop_store_order_cart_info;
|
||||
TRUNCATE TABLE yshop_store_order_detail;
|
||||
TRUNCATE TABLE yshop_store_after_sales;
|
||||
TRUNCATE TABLE yshop_store_after_sales_item;
|
||||
TRUNCATE TABLE yshop_store_after_sales_status;
|
||||
|
@ -204,9 +204,6 @@ public class SignInRecordServiceImpl implements SignInRecordService {
|
||||
verifyExistSignInToday(userId);
|
||||
//获取当前签到规则
|
||||
IntegralRuleDO currentIntegralRule = getIntegralRule(userId);
|
||||
if(!currentIntegralRule.getEnable()){
|
||||
throw exception(SIGN_IN_CLOSED);
|
||||
}
|
||||
//领取积分
|
||||
IntegralRuleDTO rule = new IntegralRuleDTO();
|
||||
rule.setUserId(userId);
|
||||
@ -234,7 +231,7 @@ public class SignInRecordServiceImpl implements SignInRecordService {
|
||||
//查询签到相关积分规则
|
||||
List<IntegralRuleDO> integralRuleList = integralRuleService.getIntegralRuleByTypes(ListUtil.of(BillDetailEnum.SIGN.getValue()));
|
||||
//每日签到规则
|
||||
IntegralRuleDO everydayIntegralRuleDO = integralRuleList.stream().filter(item -> item.getAttribute1().equals("1")).findFirst().orElse(new IntegralRuleDO(0,Boolean.FALSE));
|
||||
IntegralRuleDO everydayIntegralRuleDO = integralRuleList.stream().filter(item -> item.getAttribute1().equals("1")).findFirst().orElse(new IntegralRuleDO(0,true));
|
||||
//当前签到天数
|
||||
Integer count = countByUserIdThisWeek(userId) + 1;
|
||||
//获取当前签到规则
|
||||
|
Reference in New Issue
Block a user