云购os移除
This commit is contained in:
parent
41eabc21b5
commit
257bc9e760
7
pom.xml
7
pom.xml
|
|
@ -105,13 +105,6 @@
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--云购os支付-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yungouos.pay</groupId>
|
|
||||||
<artifactId>yungouos-pay-sdk</artifactId>
|
|
||||||
<version>2.0.10</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.validator</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1498,7 +1498,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ThreadUtil.execAsync(()->{
|
ThreadUtil.execAsync(()->{
|
||||||
discSpinningService.withdrawAsync(entity, money.doubleValue(), "[提现]");
|
discSpinningService.withdrawAsync(entity, money.doubleValue(), "[提现]");
|
||||||
},true);
|
});
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("首绑支付宝发放奖励异常,用户信息:{}", JSONUtil.toJsonStr(entity));
|
log.error("首绑支付宝发放奖励异常,用户信息:{}", JSONUtil.toJsonStr(entity));
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,6 @@ import com.sqx.modules.pay.dao.PayDetailsDao;
|
||||||
import com.sqx.modules.pay.entity.PayClassify;
|
import com.sqx.modules.pay.entity.PayClassify;
|
||||||
import com.sqx.modules.pay.entity.PayDetails;
|
import com.sqx.modules.pay.entity.PayDetails;
|
||||||
import com.sqx.modules.pay.service.PayClassifyService;
|
import com.sqx.modules.pay.service.PayClassifyService;
|
||||||
import com.yungouos.pay.alipay.AliPay;
|
|
||||||
import com.yungouos.pay.entity.AliPayH5Biz;
|
|
||||||
import com.yungouos.pay.util.PaySignUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -180,85 +177,8 @@ public class AliPayController {
|
||||||
@RequestMapping("/notifyAppYunOS")
|
@RequestMapping("/notifyAppYunOS")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String notifyAppYunOS(HttpServletRequest request, HttpServletResponse response) {
|
public String notifyAppYunOS(HttpServletRequest request, HttpServletResponse response) {
|
||||||
//获取支付宝POST过来反馈信息
|
|
||||||
Map<String,String> params = new HashMap<String,String>();
|
|
||||||
Map requestParams = request.getParameterMap();
|
|
||||||
for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext();) {
|
|
||||||
String name = (String) iter.next();
|
|
||||||
String[] values = (String[]) requestParams.get(name);
|
|
||||||
String valueStr = "";
|
|
||||||
for (int i = 0; i < values.length; i++) {
|
|
||||||
valueStr = (i == values.length - 1) ? valueStr + values[i]
|
|
||||||
: valueStr + values[i] + ",";
|
|
||||||
}
|
|
||||||
//乱码解决,这段代码在出现乱码时使用。
|
|
||||||
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
|
|
||||||
params.put(name, valueStr);
|
|
||||||
}
|
|
||||||
String outTradeNo = params.get("outTradeNo");
|
|
||||||
String code = params.get("code");
|
|
||||||
String key = commonInfoService.findOne(169).getValue();
|
|
||||||
try {
|
|
||||||
boolean flag = PaySignUtil.checkNotifySign(request, key);
|
|
||||||
if(flag){
|
|
||||||
if("1".equals(code)){
|
|
||||||
PayDetails payDetails=payDetailsDao.selectByOrderId(outTradeNo);
|
|
||||||
if(payDetails.getState()==0) {
|
|
||||||
String format = sdf.format(new Date());
|
|
||||||
payDetailsDao.updateState(payDetails.getId(),1,format,null);
|
|
||||||
if(payDetails.getType()==1){
|
|
||||||
Orders orders = ordersService.selectOrderByOrdersNo(payDetails.getOrderId());
|
|
||||||
orders.setPayWay(4);
|
|
||||||
orders.setStatus(1);
|
|
||||||
orders.setPayTime(DateUtils.format(new Date()));
|
|
||||||
ordersService.updateById(orders);
|
|
||||||
UserEntity user = userService.selectUserById(orders.getUserId());
|
|
||||||
UserEntity byUser = userService.queryByInvitationCode(user.getInviterCode());
|
|
||||||
Map map = inviteService.updateInvite(byUser, format, user.getUserId(), orders.getPayMoney());
|
|
||||||
Object oneUserId = map.get("oneUserId");
|
|
||||||
if(oneUserId!=null){
|
|
||||||
orders.setOneUserId(Long.parseLong(String.valueOf(oneUserId)));
|
|
||||||
orders.setOneMoney(new BigDecimal(String.valueOf(map.get("oneMoney"))));
|
|
||||||
}
|
|
||||||
Object twoUserId = map.get("twoUserId");
|
|
||||||
if(twoUserId!=null){
|
|
||||||
orders.setTwoUserId(Long.parseLong(String.valueOf(twoUserId)));
|
|
||||||
orders.setTwoMoney(new BigDecimal(String.valueOf(map.get("twoMoney"))));
|
|
||||||
}
|
|
||||||
Object sysUserId = map.get("sysUserId");
|
|
||||||
if(sysUserId!=null){
|
|
||||||
orders.setSysUserId(Long.parseLong(String.valueOf(sysUserId)));
|
|
||||||
orders.setQdMoney(new BigDecimal(String.valueOf(map.get("qdMoney"))));
|
|
||||||
}
|
|
||||||
ordersService.insertOrders(orders);
|
|
||||||
}else{
|
|
||||||
String remark = payDetails.getRemark();
|
|
||||||
PayClassify payClassify = payClassifyService.getById(Long.parseLong(remark));
|
|
||||||
BigDecimal add = payClassify.getMoney().add(payClassify.getGiveMoney());
|
|
||||||
userMoneyService.updateMoney(1,payDetails.getUserId(),add.doubleValue());
|
|
||||||
UserMoneyDetails userMoneyDetails=new UserMoneyDetails();
|
|
||||||
// ✅
|
|
||||||
userMoneyDetails.setClassify(2);
|
|
||||||
userMoneyDetails.setMoney(add);
|
|
||||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
|
||||||
userMoneyDetails.setContent("支付宝充值金币");
|
|
||||||
userMoneyDetails.setTitle("支付宝充值金币:"+payClassify.getMoney()+",赠送:"+payClassify.getGiveMoney());
|
|
||||||
userMoneyDetails.setType(1);
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
userMoneyDetails.setCreateTime(simpleDateFormat.format(new Date()));
|
|
||||||
userMoneyDetails.setMoneyType(2);
|
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
log.error("云购os支付报错!"+e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Login
|
@Login
|
||||||
@ApiOperation("支付宝支付订单")
|
@ApiOperation("支付宝支付订单")
|
||||||
|
|
@ -368,7 +288,6 @@ public class AliPayController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Result payApp(String name, String generalOrder, Double money) {
|
public Result payApp(String name, String generalOrder, Double money) {
|
||||||
CommonInfo one = commonInfoService.findOne(19);
|
CommonInfo one = commonInfoService.findOne(19);
|
||||||
String url = one.getValue() + "/sqx_fast/app/aliPay/notifyApp";
|
String url = one.getValue() + "/sqx_fast/app/aliPay/notifyApp";
|
||||||
|
|
@ -439,13 +358,6 @@ public class AliPayController {
|
||||||
return Result.error("获取订单失败!");
|
return Result.error("获取订单失败!");
|
||||||
}
|
}
|
||||||
return Result.success().put("data", result);
|
return Result.success().put("data", result);
|
||||||
}else{
|
|
||||||
url=one.getValue()+"/sqx_fast/app/aliPay/notifyAppYunOS";
|
|
||||||
log.info("回调地址:"+url);
|
|
||||||
String mchId = commonInfoService.findOne(168).getValue();
|
|
||||||
String key = commonInfoService.findOne(169).getValue();
|
|
||||||
result = AliPay.appPay(generalOrder, String.valueOf(money), mchId, name ,null, url, null, null, null, null,key);
|
|
||||||
return Result.success().put("data", result);
|
|
||||||
}
|
}
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -507,13 +419,6 @@ public class AliPayController {
|
||||||
alipayRequest.setReturnUrl(returnUrl);
|
alipayRequest.setReturnUrl(returnUrl);
|
||||||
String form = alipayClient.pageExecute(alipayRequest).getBody();
|
String form = alipayClient.pageExecute(alipayRequest).getBody();
|
||||||
return Result.success().put("data", form);
|
return Result.success().put("data", form);
|
||||||
}else{
|
|
||||||
url=one.getValue()+"/sqx_fast/app/aliPay/notifyAppYunOS";
|
|
||||||
log.info("回调地址:"+url);
|
|
||||||
String mchId = commonInfoService.findOne(168).getValue();
|
|
||||||
String key = commonInfoService.findOne(169).getValue();
|
|
||||||
AliPayH5Biz aliPayH5Biz = AliPay.h5Pay(generalOrder, String.valueOf(money), mchId, name, null, url, returnUrl, null, null, null,null,key);
|
|
||||||
return Result.success().put("data", aliPayH5Biz.getForm());
|
|
||||||
}
|
}
|
||||||
} catch (AlipayApiException e) {
|
} catch (AlipayApiException e) {
|
||||||
log.error("CreatPayOrderForH5", e);
|
log.error("CreatPayOrderForH5", e);
|
||||||
|
|
@ -522,5 +427,4 @@ public class AliPayController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class RedisServiceImpl implements RedisService {
|
||||||
expireTime = jsonObject.getLong("expireTime");
|
expireTime = jsonObject.getLong("expireTime");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((StrUtil.isNotBlank(permanentlyFreeWatch) && redisUtils.isExpiredSet(freeWatchKey)) || (StrUtil.isNotBlank(permanentlyFreeWatch) && DateUtil.current() >= expireTime)) {
|
if ((StrUtil.isNotBlank(permanentlyFreeWatch) && redisUtils.isExpiredSet(freeWatchKey)) || (StrUtil.isNotBlank(permanentlyFreeWatch) && DateUtil.current(false) >= expireTime)) {
|
||||||
if (StrUtil.isBlank(permanentlyFreeWatch)) {
|
if (StrUtil.isBlank(permanentlyFreeWatch)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -108,7 +108,7 @@ public class RedisServiceImpl implements RedisService {
|
||||||
redisUtils.set(watchKey, jsonObject.toJSONString(), expire);
|
redisUtils.set(watchKey, jsonObject.toJSONString(), expire);
|
||||||
return false;
|
return false;
|
||||||
}else {
|
}else {
|
||||||
return DateUtil.current() > expireTime;
|
return DateUtil.current(false) > expireTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -136,6 +136,6 @@ public class RedisServiceImpl implements RedisService {
|
||||||
Integer expireTime = jsonObject.getInteger("expireTime");
|
Integer expireTime = jsonObject.getInteger("expireTime");
|
||||||
Long second = jsonObject.getLong("second");
|
Long second = jsonObject.getLong("second");
|
||||||
|
|
||||||
return expireTime == -1 ? second : expireTime > DateUtil.current() ? expireTime - DateUtil.current() : 0L;
|
return expireTime == -1 ? second : expireTime > DateUtil.current(false) ? expireTime - DateUtil.current(false) : 0L;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue