fanzherong_v 2 months ago
parent
commit
a9b47ec503

+ 6 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/consumptionrecord/service/impl/ConsumptionRecordServiceImpl.java

@@ -184,10 +184,12 @@ public class ConsumptionRecordServiceImpl extends ServiceImpl<ConsumptionRecordM
             //人工结算需要短信校验,获取手机验证码
             if(StringUtils.equals(consumptionRecordAddParam.getConsumptionOperate(),"3")){
                 Object code = commonCacheOperator.get(consumptionRecordAddParam.getPhoneNumber());
-                if(!StringUtils.equals(code.toString(),consumptionRecordAddParam.getPhoneCode())){
-                    //throw new CommonException("验证码不正确!");
-                }else{
-                    commonCacheOperator.remove(consumptionRecordAddParam.getPhoneNumber());
+                if(ObjectUtil.isNotEmpty(code)){
+                    if(!StringUtils.equals(code.toString(),consumptionRecordAddParam.getPhoneCode())){
+                        //throw new CommonException("验证码不正确!");
+                    }else{
+                        commonCacheOperator.remove(consumptionRecordAddParam.getPhoneNumber());
+                    }
                 }
             }
             //判断当前消费金额是否大于代金券金额,优先扣减代金券金额