Helius
2022-08-17 94e644443a660b39521f08805b66c27ced736e40
fix:普通商品不再10天结算,改为及时结算并不能退货
6 files modified
30 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/quartz/OrderSettlementJob.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java 6 ●●●● patch | view | raw | blame | history
src/main/resources/application.yml 2 ●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/MallOrderInfoMapper.xml 2 ●●● patch | view | raw | blame | history
src/test/java/cc/mrbird/febs/ProfitTest.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/quartz/OrderSettlementJob.java
@@ -22,6 +22,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
@@ -57,9 +58,10 @@
    private IMallAchieveService mallAchieveService;
    /**
     * 普通商品结算
     * 普通商品结算 -- 10天结算一次
     */
    @Scheduled(cron = "0 0 0 * * ?")
//    @Scheduled(cron = "0 0 0 * * ?")
    @Transactional(rollbackFor = Exception.class)
    public void normalGoodsSettlementJob() {
        log.info("普通商品结算");
        List<MallOrderInfo> orderInfos = mallOrderInfoMapper.selectOrderInfoWithNormalGoods(DateUtil.offsetDay(new Date(), -10));
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -252,6 +252,9 @@
                            score = sku.getPresentPrice().multiply(mallGoods.getStaticMulti()).multiply(new BigDecimal(orderItem.getCnt()));
//                            BigDecimal staticMulti = mallGoods.getStaticMulti() == null ? BigDecimal.ZERO : mallGoods.getStaticMulti();
//                            score = sku.getPresentPrice().multiply(staticMulti);
                            // 普通商品也及时结算,不再10天结算
                        } else {
                            score = sku.getPresentPrice();
                        }
                        if (score.compareTo(BigDecimal.ZERO) > 0) {
src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java
@@ -189,9 +189,9 @@
            }
            // 判断套餐或者普通商品,结算对应商品的动态分红
            if (!Objects.equals(item.getIsNormal(), isNormal)) {
                continue;
            }
//            if (!Objects.equals(item.getIsNormal(), isNormal)) {
//                continue;
//            }
            // =======直推返利== start =====
            // 直接奖励收益
src/main/resources/application.yml
@@ -5,7 +5,7 @@
spring:
  profiles:
    active: test
    active: dev
  servlet:
    multipart:
src/main/resources/mapper/modules/MallOrderInfoMapper.xml
@@ -269,7 +269,7 @@
    <update id="updateOrderConfirmStatus">
        update mall_order_info
        set status=4,
            receiving_time=new Date()
            receiving_time=now()
        where status=3 and date_format(pay_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d')
    </update>
src/test/java/cc/mrbird/febs/ProfitTest.java
@@ -3,6 +3,7 @@
import cc.mrbird.febs.mall.entity.MallOrderItem;
import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper;
import cc.mrbird.febs.mall.mapper.MallOrderItemMapper;
import cc.mrbird.febs.mall.quartz.OrderSettlementJob;
import cc.mrbird.febs.mall.service.IAgentService;
import cc.mrbird.febs.mall.service.IMallAchieveService;
import cc.mrbird.febs.mall.service.IMemberProfitService;
@@ -102,4 +103,14 @@
    public void staticProfit(){
        memberProfitService.staticProfit(null);
    }
    @Autowired
    private OrderSettlementJob orderSettlementJob;
    @Test
    public void orderSettlementJobTest() {
//        orderSettlementJob.normalGoodsSettlementJob();
        mallAchieveService.add(83L);
    }
}