main
parent
c4c043d41d
commit
26cb95f60a
|
|
@ -8,10 +8,7 @@ import com.alipay.api.response.AlipayTradeCreateResponse;
|
||||||
import com.ruoyi.app.domain.*;
|
import com.ruoyi.app.domain.*;
|
||||||
import com.ruoyi.app.domain.dto.*;
|
import com.ruoyi.app.domain.dto.*;
|
||||||
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
|
import com.ruoyi.app.domain.vo.AppDynamicCommentVo;
|
||||||
import com.ruoyi.app.mapper.AppExchangeCodeMapper;
|
import com.ruoyi.app.mapper.*;
|
||||||
import com.ruoyi.app.mapper.AppOrderMapper;
|
|
||||||
import com.ruoyi.app.mapper.AppOrderPayMapper;
|
|
||||||
import com.ruoyi.app.mapper.AppUserMapper;
|
|
||||||
import com.ruoyi.app.service.AlipayService;
|
import com.ruoyi.app.service.AlipayService;
|
||||||
import com.ruoyi.app.service.IAppDynamicCommentService;
|
import com.ruoyi.app.service.IAppDynamicCommentService;
|
||||||
import com.ruoyi.app.service.IPayService;
|
import com.ruoyi.app.service.IPayService;
|
||||||
|
|
@ -77,6 +74,9 @@ public class PayController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private AlipayService alipayService;
|
private AlipayService alipayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AppVipMapper appVipMapper;
|
||||||
|
|
||||||
@RequestMapping("/generateCode")
|
@RequestMapping("/generateCode")
|
||||||
@ApiOperation(value = "生成兑换码", notes = "生成兑换码", httpMethod = "GET")
|
@ApiOperation(value = "生成兑换码", notes = "生成兑换码", httpMethod = "GET")
|
||||||
public String generateCode(@RequestParam("num") Integer num,
|
public String generateCode(@RequestParam("num") Integer num,
|
||||||
|
|
@ -505,12 +505,13 @@ public class PayController extends BaseController
|
||||||
@PostMapping(value = "/aliPay")
|
@PostMapping(value = "/aliPay")
|
||||||
@ApiOperation(value = "支付宝支付", notes = "支付宝支付", httpMethod = "POST")
|
@ApiOperation(value = "支付宝支付", notes = "支付宝支付", httpMethod = "POST")
|
||||||
public String aliPay(@RequestBody AppOrderArg appOrderArg) throws Exception{
|
public String aliPay(@RequestBody AppOrderArg appOrderArg) throws Exception{
|
||||||
//return alipayService.startPay(appOrderArg);
|
|
||||||
String orderNo = KeyUtil.generateUniqueKey();
|
String orderNo = KeyUtil.generateUniqueKey();
|
||||||
AlipayTradeAppPayResponse result = null;
|
AlipayTradeAppPayResponse result = null;
|
||||||
try {
|
try {
|
||||||
|
AppVip appVip = appVipMapper.selectAppVipByLevel(appOrderArg.getLevel());
|
||||||
|
String price = appVip.getPrice() + ".00";
|
||||||
//result = alipayService.startPay(orderNo,appOrderArg.getPrice(),appOrderArg.getLevel() == 2 ? 30 : (appOrderArg.getLevel() == 3 ? 365 : 0));
|
//result = alipayService.startPay(orderNo,appOrderArg.getPrice(),appOrderArg.getLevel() == 2 ? 30 : (appOrderArg.getLevel() == 3 ? 365 : 0));
|
||||||
result = alipayService.startPay(orderNo,appOrderArg.getPrice(),0);
|
result = alipayService.startPay(orderNo,price,0);
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.app.domain.AppVip;
|
import com.ruoyi.app.domain.AppVip;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员信息Mapper接口
|
* 会员信息Mapper接口
|
||||||
|
|
@ -58,4 +59,8 @@ public interface AppVipMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAppVipByIds(Long[] ids);
|
public int deleteAppVipByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
public AppVip selectAppVipByLevel(@Param("level") int level);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class AlipayService {
|
||||||
request.setNotifyUrl(AlipayConstant.NOTIFY_URL);
|
request.setNotifyUrl(AlipayConstant.NOTIFY_URL);
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("out_trade_no" , orderNo);
|
jsonObject.put("out_trade_no" , orderNo);
|
||||||
jsonObject.put("total_amount","0.01");
|
jsonObject.put("total_amount",price);
|
||||||
jsonObject.put("subject",AlipayConstant.SUBJECT);
|
jsonObject.put("subject",AlipayConstant.SUBJECT);
|
||||||
if (day > 0) {
|
if (day > 0) {
|
||||||
jsonObject.put("product_code", "CYCLE_PAY_AUTH");
|
jsonObject.put("product_code", "CYCLE_PAY_AUTH");
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,9 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
userSkillMapper.deleteUserSkillByUserId(id);
|
userSkillMapper.deleteUserSkillByUserId(id);
|
||||||
AppUser appUser = appUserMapper.selectAppUserById(id);
|
AppUser appUser = appUserMapper.selectAppUserById(id);
|
||||||
AppRegister appRegister = appRegisterMapper.selectAppRegisterByphone(appUser.getPhone());
|
AppRegister appRegister = appRegisterMapper.selectAppRegisterByphone(appUser.getPhone());
|
||||||
appRegisterMapper.deleteAppRegisterById(appRegister.getId());
|
if (appRegister != null) {
|
||||||
|
appRegisterMapper.deleteAppRegisterById(appRegister.getId());
|
||||||
|
}
|
||||||
AppUserDynamic appUserDynamic = new AppUserDynamic();
|
AppUserDynamic appUserDynamic = new AppUserDynamic();
|
||||||
appUserDynamic.setUserId(id);
|
appUserDynamic.setUserId(id);
|
||||||
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(appUserDynamic);
|
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(appUserDynamic);
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ public class SendNoteUtil {
|
||||||
if ("18000000000".equals(PhoneNumber)) {
|
if ("18000000000".equals(PhoneNumber)) {
|
||||||
randomNumber = "1234";
|
randomNumber = "1234";
|
||||||
}
|
}
|
||||||
randomNumber = "1234";
|
|
||||||
log.info("--------------------------------------------- " + PhoneNumber + "验证码:" + randomNumber);
|
log.info("--------------------------------------------- " + PhoneNumber + "验证码:" + randomNumber);
|
||||||
redisService.setCacheObject(PhoneNumber, randomNumber, 300L, TimeUnit.SECONDS);
|
redisService.setCacheObject(PhoneNumber, randomNumber, 300L, TimeUnit.SECONDS);
|
||||||
if (!redisService.hasKey(PhoneNumber)) {
|
if (!redisService.hasKey(PhoneNumber)) {
|
||||||
|
|
@ -158,7 +157,9 @@ public class SendNoteUtil {
|
||||||
String homeTem = "SMS_467520300";
|
String homeTem = "SMS_467520300";
|
||||||
String foreignTem = "SMS_468380559";
|
String foreignTem = "SMS_468380559";
|
||||||
if (!isChineseMobileNumber(PhoneNumber)) {
|
if (!isChineseMobileNumber(PhoneNumber)) {
|
||||||
return sendForeign(PhoneNumber,"1234");
|
Random random = new Random();
|
||||||
|
String randomNumber = String.valueOf(random.nextInt(9000) + 1000);
|
||||||
|
return sendForeign(PhoneNumber,randomNumber);
|
||||||
}
|
}
|
||||||
CommonRequest request = new CommonRequest();
|
CommonRequest request = new CommonRequest();
|
||||||
request.setSysMethod(MethodType.POST);
|
request.setSysMethod(MethodType.POST);
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAppVipById" parameterType="Long" resultMap="AppVipResult">
|
<select id="selectAppVipById" resultMap="AppVipResult">
|
||||||
<include refid="selectAppVipVo"/>
|
<include refid="selectAppVipVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAppVipByLevel" parameterType="Long" resultMap="AppVipResult">
|
||||||
|
<include refid="selectAppVipVo"/>
|
||||||
|
where level = #{level}
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertAppVip" parameterType="AppVip">
|
<insert id="insertAppVip" parameterType="AppVip">
|
||||||
insert into app_vip
|
insert into app_vip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue