chenjiahe
2024-03-01 f87850bb6c6109a3bda06ab474575631407bbf09
phi_platform_user/src/main/java/com/hx/phip/tool/refund/PartialRefundUtil.java
@@ -189,7 +189,7 @@
        }
        //爆款活动规则退款,暂时不屏蔽保存提示
        activityPageGiveIncrease(ordersTotal,refundRecord,operationId,0,commonService);
        activityPageGiveIncrease(ordersTotal,refundRecord,0,commonService);
        //初始化初复诊信息
        if(OrderTotalConstants.STATUS_CANCEL == ordersTotal.getStatus()){
@@ -902,11 +902,10 @@
    /**页面活动赠送的增值金退款处理
     * @param ordersTotal 订单
     * @param refundRecord 退款订单
     * @param operationId 操作人标识
     * @param circulateNum 避免死循环,调用的时候传0
     * @param commonService 映射
     */
    public static void activityPageGiveIncrease(OrdersTotal ordersTotal,RefundRecord refundRecord,String operationId,int circulateNum,CommonService commonService){
    public static void activityPageGiveIncrease(OrdersTotal ordersTotal,RefundRecord refundRecord,int circulateNum,CommonService commonService){
        if(circulateNum > 1){
            return;
@@ -932,8 +931,8 @@
        RefundUserAssets refundUserAssets;
        //生成记录
        refundUserAssets = new RefundUserAssets();
        //设置未102是当前的记录类型
        refundUserAssets.setIsDel(102);
        //设置为102是当前的记录类型
        refundUserAssets.setIsDel(RefundUserAssets.DEL_BURST);
        refundUserAssets.setType(userMoneyUnclaimed.getOperationReason());
        refundUserAssets.setStatus(RefundUserAssets.STATUS_NORMAL);
        refundUserAssets.setAmountType(userMoneyUnclaimed.getFundType());
@@ -966,7 +965,7 @@
            sqlSentence.sqlWhere("isValid = #{m.isValid} WHERE id = #{m.id} AND status = #{m.status}",values);
            if(commonService.updateWhere(UserMoneyUnclaimedMapper.class,sqlSentence) != 1){
                circulateNum++;
                activityPageGiveIncrease(ordersTotal,refundRecord,operationId,circulateNum,commonService);
                activityPageGiveIncrease(ordersTotal,refundRecord,circulateNum,commonService);
            }
        }
        //保存记录,正常扣减和未领取才去保存这个记录
@@ -980,12 +979,12 @@
        values.put("activityPageType",ordersTotal.getActivityPageType());
        values.put("activityPageCode",ordersTotal.getActivityPageCode());
        sqlSentence.sqlSentence("SELECT * FROM orders_total WHERE isDel = 0 AND status != #{m.status} AND payStatus = #{m.payStatus}" +
                " AND id != #{m.id} AND activityPageType = #{m.activityPageType} AND activityPageCode = #{m.activityPageCode} ORDER BY createTime ASC LIMIT 1",values);
                " AND id != #{m.id} AND activityPageType = #{m.activityPageType} AND activityPageCode = #{m.activityPageCode} ORDER BY payTime ASC LIMIT 1",values);
        OrdersTotal ordersTotal1 = commonService.selectOne(OrdersTotalMapper.class,sqlSentence);
        if(ordersTotal1 != null){
            Integer opType = BaseEntity.NO;
            Integer opType = BaseEntity.YES;
            if(userMoneyUnclaimed.getStatus() == UserMoneyUnclaimed.STATUS_SUCCEED){
                opType = BaseEntity.YES;
                opType = BaseEntity.NO;
            }
            //增值金到账处理
            UserMoneyUtil.setUserMoneyHandle(userMoneyUnclaimed.getUserId(), UserMoneyUnclaimed.FUND_TYPE_VALUE_ADDED_FUND,userMoneyUnclaimed.getOpNumber(),opType, OperationReasonConstants.OP_REASON_INVITE_ORDER,userMoneyUnclaimed.getOriginSubject(),userMoneyUnclaimed.getRemarks(),userMoneyUnclaimed.getOperatorId()