fwq
2023-12-14 26ba363c40c5f355a3e1e8ce422dea0aefedad32
如果空则new对象
1个文件已修改
23 ■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java
@@ -1530,19 +1530,9 @@
        String activityName = "";
        OrderInfo orderInfo = ordersTotal.getOrderInfo();
        logger.info("接收的orderInfo:"+JSON.toJSONString(orderInfo));
        orderInfo.setOrderId(ordersTotal.getId());
        //如果有用活动规则将活动规则保存在orderInfo
        if (ordersTotal.getActivityIds() != null && ordersTotal.getActivityIds().size() > 0) {
            //查询活动规则基础信息
            ActivityRule activityRule = commonService.selectOneByKey(ActivityRuleMapper.class, ordersTotal.getActivityIds().get(0));
            if (activityRule != null) {
                orderInfo.setActivityId(activityRule.getId());
                orderInfo.setActivityName(activityRule.getName());
                activityName = activityRule.getName();
            }
        }
        BigDecimal defaultDiscount = new BigDecimal(100);
        if (ordersTotal.getOrderInfo() == null) {
            orderInfo = new OrderInfo();
            orderInfo.setIsWholeDiscount(0);
            orderInfo.setIsEmployeeDiscount(0);
            orderInfo.setDiscount(defaultDiscount);
@@ -1558,6 +1548,17 @@
                orderInfo.setDiscount(ordersTotal.getOrderInfo().getDiscount()==null?new BigDecimal(100):ordersTotal.getOrderInfo().getDiscount());
            }
        }
        orderInfo.setOrderId(ordersTotal.getId());
        //如果有用活动规则将活动规则保存在orderInfo
        if (ordersTotal.getActivityIds() != null && ordersTotal.getActivityIds().size() > 0) {
            //查询活动规则基础信息
            ActivityRule activityRule = commonService.selectOneByKey(ActivityRuleMapper.class, ordersTotal.getActivityIds().get(0));
            if (activityRule != null) {
                orderInfo.setActivityId(activityRule.getId());
                orderInfo.setActivityName(activityRule.getName());
                activityName = activityRule.getName();
            }
        }
        //用户推荐人处理
        if (StringUtils.noNull(user.getInviteeId())) {
            orderInfo.setInviteeId(user.getInviteeId());