| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Autowired |
| | | private SMSUtil smsUtil; |
| | | |
| | | @Autowired |
| | | private WeChatUtil weChatUtil; |
| | |
| | | sb.append((int) (random.nextDouble() * 10)); |
| | | } |
| | | String authCode = sb.toString(); |
| | | authCode="1234"; |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"; |
| | | |
| | | //发送验证码短信 |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | } |
| | | 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); |
| | |
| | | } |
| | | 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); |
| | |
| | | */ |
| | | 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); |
| | | } |
| | | |
| | | |