fhx
2024-09-30 c0c7be5af4cd201290be57ffb02721fa35297212
Merge branch 'master-xlk' into master-xlk-test
2个文件已修改
29 ■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/order/OrderControllerV2.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/order/impl/OrderRefundServiceImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/order/OrderControllerV2.java
@@ -26,6 +26,7 @@
import com.hx.phiappt.model.order.*;
import com.hx.phiappt.model.performance.PerformanceInfo;
import com.hx.phiappt.model.userStatus.UserStatusLog;
import com.hx.phiappt.util.TimerHandleItemTool;
import com.hx.phip.config.CustomParameter;
import com.hx.phip.config.PlatformConfig;
import com.hx.phip.service.ShopService;
@@ -414,10 +415,11 @@
        threadPool.getThreadPool().execute(()->{
            //系统消费赠送积分
            try {
                TimerHandleItem timerHandleItem = new TimerHandleItem(TimerHandleItem.CONSUME_GIVE_INTEGRAL,ordersTotal.getId());
                commonService.insert(TimerHandleItemMapper.class,timerHandleItem);
                //系统消费赠送积分
                TimerHandleItemTool.addTimer(TimerHandleItem.CONSUME_GIVE_INTEGRAL,ordersTotal.getId(),commonService);
                //系统消费赠送积分-老带新
                TimerHandleItemTool.addTimer(TimerHandleItem.CONSUME_OLD_GIVE_INTEGRAL,ordersTotal.getId(),commonService);
            }catch (Exception e){
                logger.info("处理消费送积分出错:{}",e.getMessage(),e);
            }
phi_platform_user/src/main/java/com/hx/phip/service/order/impl/OrderRefundServiceImpl.java
@@ -7,6 +7,7 @@
import com.hx.exception.TipsException;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.*;
import com.hx.phiappt.common.enums.OrderGiveIntegralEnum;
import com.hx.phiappt.constants.tool.PerformanceInfoTool;
import com.hx.phiappt.constants.tool.TimerHandleTool;
import com.hx.phiappt.dao.mapper.*;
@@ -24,6 +25,8 @@
import com.hx.phiappt.model.user.UserCard;
import com.hx.phiappt.model.user.UserProjectItem;
import com.hx.phiappt.model.userMoney.UserMoneyUnclaimed;
import com.hx.phiappt.util.SystemParameterUtil;
import com.hx.phiappt.vo.parameter.IntegralOldGiveRuleVo;
import com.hx.phiappt.vo.refund.RefundCashItemVo;
import com.hx.phiappt.vo.refund.RefundCashVo;
import com.hx.phip.config.BotoxClubConfig;
@@ -155,6 +158,8 @@
    private UserCluebMemberServiceTool userCluebMemberServiceTool;
    @Resource
    private UserMoneyService userMoneyService;
    @Resource
    private OrderGiveIntegralMapper orderGiveIntegralMapper;
    /**
@@ -1266,6 +1271,22 @@
                    orderNodeBuilder.append(",扣减成功");
                    refundUserAssets.setAmountStatus(RefundUserAssets.AMOUNT_STATUS_NORMAL);
                }else {
                    //--特殊处理,老带新赠送的积分需要判断退款规则
                    if(StringUtils.noNull(userMoneyUnclaimed.getCommonId())){
                        if (orderGiveIntegralMapper.selectExist(OrderGiveIntegralEnum.CONVENTION_OLD_GIVE.getType(),userMoneyUnclaimed.getCommonId()) > 0) {
                            //消费老带新赠送积分配置
                            IntegralOldGiveRuleVo integralOldGiveRuleVo = SystemParameterUtil.selectByNameObj(SystemParameter.CONSUME_OLD_GIVE_INTEGRAL_RULE,IntegralOldGiveRuleVo.class,commonService);
                            if(integralOldGiveRuleVo == null){
                                integralOldGiveRuleVo = new IntegralOldGiveRuleVo();
                            }
                            if(integralOldGiveRuleVo.getRefundReturn() == null
                                    || integralOldGiveRuleVo.getRefundReturn() == IntegralOldGiveRuleVo.REFUND_RETURN_MUST){
                                throw new TipsException("退款失败,资产不足回退老带新赠送积分!");
                            }
                        }
                    }
                    orderNodeBuilder.append(",余额不足,扣减失败");
                    //用户资产不够减
                    refundUserAssets.setAmountStatus(RefundUserAssets.AMOUNT_STATUS_NOT);