puzhibing
2023-04-04 7ed828fc55a62f2a052caaf6332e23f12e299aeb
UserZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -1,6 +1,7 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@@ -46,12 +47,6 @@
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private ALiSendSms aLiSendSms;
    @Autowired
    private SMSUtil smsUtil;
    @Autowired
    private WeChatUtil weChatUtil;
@@ -122,7 +117,6 @@
                sb.append((int) (random.nextDouble() * 10));
            }
            String authCode = sb.toString();
            authCode="1234";
            String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!";
            //发送验证码短信
@@ -142,9 +136,17 @@
                    templateCode = "SMS_207770039";//修改密码
                    break;
            }
            Map<String, Object> map = new HashMap<>();
            map.put("code", authCode);
            smsUtil.sendSmsTp(phone, 96596L, Arrays.asList(map));
            //发送记录集合
            JSONArray records = new JSONArray();
            JSONObject record = new JSONObject();
            //手机号
            record.put("mobile", phone);
            //替换变量
            JSONObject param = new JSONObject();
            param.put("code", authCode);
            record.put("tpContent", param);
            records.add(record);
            SMSUtil.sendSmsTp(96596L, records);
            System.out.println(sms);
        }
@@ -719,7 +721,6 @@
        }
        if(payType == 1){//微信支付
            Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 1, money, "", 1);//添加预支付数据
            //Map<String, String> map = icbcPayUtil.placeAnOrder(integer.toString(), 9, 5, uid.toString(), "余额充值", money, callbackPath + "/base/wxCancelUserBalance", uid.toString(), type, userInfo.getAppletsOpenId());
            ResultUtil resultUtil = payMoneyUtil.weixinpay("余额充值",integer.toString(),integer.toString(),money+"","/base/wxCancelUserBalance","JSAPI",userInfo.getAppletsOpenId());
            if(resultUtil.getCode()==200){
                PaymentRecord paymentRecord = paymentRecordService.selectById(integer);
@@ -731,7 +732,7 @@
        }
        if(payType == 2){//支付宝支付
            Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 2, money, "", 1);//添加预支付数据
            ResultUtil resultUtil = payMoneyUtil.alipay("余额充值","余额充值",integer.toString(),money+"","/base/aliCancelUserBalance");
            ResultUtil resultUtil = payMoneyUtil.alipay("余额充值","余额充值", "",integer.toString(),money+"","/base/aliCancelUserBalance");
            if(resultUtil.getCode()==200){
                PaymentRecord paymentRecord = paymentRecordService.selectById(integer);
                paymentRecordService.updateById(paymentRecord);
@@ -1008,7 +1009,7 @@
     */
    public String getDefaultName(){
        int num = this.selectCount(new EntityWrapper<UserInfo>().ne("flag", 3)) + 1000001;
        return "XW" + String.valueOf(num).substring(1);
        return "ZY" + String.valueOf(num).substring(1);
    }