yshop1.6.2发布:修复用户昵称带有表情导致入库失败问题,修复下单订单金额为0不能支付的问题
This commit is contained in:
@ -109,6 +109,11 @@
|
|||||||
<artifactId>qcloudsms</artifactId>
|
<artifactId>qcloudsms</artifactId>
|
||||||
<version>1.0.5</version>
|
<version>1.0.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vdurmont</groupId>
|
||||||
|
<artifactId>emoji-java</artifactId>
|
||||||
|
<version>4.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1152,7 +1152,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
|
|||||||
|
|
||||||
int useIntegral = param.getUseIntegral().intValue();
|
int useIntegral = param.getUseIntegral().intValue();
|
||||||
|
|
||||||
boolean deduction = false;//todo 拼团等
|
boolean deduction = false;//拼团等
|
||||||
//拼团等不参与抵扣
|
//拼团等不参与抵扣
|
||||||
if(combinationId > 0 || seckillId > 0 || bargainId > 0) deduction = true;
|
if(combinationId > 0 || seckillId > 0 || bargainId > 0) deduction = true;
|
||||||
if(deduction){
|
if(deduction){
|
||||||
|
@ -229,6 +229,12 @@ public class StoreOrderController extends BaseController {
|
|||||||
map.put("result",orderDTO);
|
map.put("result",orderDTO);
|
||||||
//开始处理支付
|
//开始处理支付
|
||||||
if(StrUtil.isNotEmpty(orderId)){
|
if(StrUtil.isNotEmpty(orderId)){
|
||||||
|
//处理金额为0的情况
|
||||||
|
if(order.getPayPrice().doubleValue() <= 0){
|
||||||
|
storeOrderService.yuePay(orderId,uid);
|
||||||
|
return ApiResult.ok(map,"支付成功");
|
||||||
|
}
|
||||||
|
|
||||||
switch (param.getPayType()){
|
switch (param.getPayType()){
|
||||||
case "weixin":
|
case "weixin":
|
||||||
try {
|
try {
|
||||||
|
@ -16,6 +16,7 @@ import co.yixiang.modules.user.service.YxUserService;
|
|||||||
import co.yixiang.utils.EncryptUtils;
|
import co.yixiang.utils.EncryptUtils;
|
||||||
import co.yixiang.utils.OrderUtil;
|
import co.yixiang.utils.OrderUtil;
|
||||||
import co.yixiang.utils.SecurityUtils;
|
import co.yixiang.utils.SecurityUtils;
|
||||||
|
import com.vdurmont.emoji.EmojiParser;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import co.yixiang.aop.log.Log;
|
import co.yixiang.aop.log.Log;
|
||||||
@ -82,6 +83,7 @@ public class AuthenticationController extends BaseController {
|
|||||||
throw new AccountExpiredException("账号已停用,请联系管理员");
|
throw new AccountExpiredException("账号已停用,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//设置推广关系
|
//设置推广关系
|
||||||
if(StrUtil.isNotEmpty(authorizationUser.getSpread()) &&
|
if(StrUtil.isNotEmpty(authorizationUser.getSpread()) &&
|
||||||
!authorizationUser.getSpread().equals("NaN")){
|
!authorizationUser.getSpread().equals("NaN")){
|
||||||
|
@ -23,6 +23,7 @@ import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
|
|||||||
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
|
||||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
|
import com.vdurmont.emoji.EmojiParser;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -137,9 +138,12 @@ public class WechatController extends BaseController {
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
//过滤掉表情
|
||||||
|
String nickname = EmojiParser.removeAllEmojis(wxMpUser.getNickname());
|
||||||
|
log.info("昵称:{}",nickname);
|
||||||
//用户保存
|
//用户保存
|
||||||
YxUser user = new YxUser();
|
YxUser user = new YxUser();
|
||||||
user.setAccount(wxMpUser.getNickname());
|
user.setAccount(nickname);
|
||||||
user.setUsername(wxMpUser.getOpenId());
|
user.setUsername(wxMpUser.getOpenId());
|
||||||
user.setPassword(EncryptUtils.encryptPassword("123456"));
|
user.setPassword(EncryptUtils.encryptPassword("123456"));
|
||||||
user.setPwd(EncryptUtils.encryptPassword("123456"));
|
user.setPwd(EncryptUtils.encryptPassword("123456"));
|
||||||
@ -147,7 +151,7 @@ public class WechatController extends BaseController {
|
|||||||
user.setUserType("wechat");
|
user.setUserType("wechat");
|
||||||
user.setAddTime(OrderUtil.getSecondTimestampTwo());
|
user.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||||
user.setLastTime(OrderUtil.getSecondTimestampTwo());
|
user.setLastTime(OrderUtil.getSecondTimestampTwo());
|
||||||
user.setNickname(wxMpUser.getNickname());
|
user.setNickname(nickname);
|
||||||
user.setAvatar(wxMpUser.getHeadImgUrl());
|
user.setAvatar(wxMpUser.getHeadImgUrl());
|
||||||
user.setNowMoney(BigDecimal.ZERO);
|
user.setNowMoney(BigDecimal.ZERO);
|
||||||
user.setBrokeragePrice(BigDecimal.ZERO);
|
user.setBrokeragePrice(BigDecimal.ZERO);
|
||||||
@ -158,9 +162,8 @@ public class WechatController extends BaseController {
|
|||||||
|
|
||||||
//保存微信用户
|
//保存微信用户
|
||||||
YxWechatUser yxWechatUser = new YxWechatUser();
|
YxWechatUser yxWechatUser = new YxWechatUser();
|
||||||
// System.out.println("wxMpUser:"+wxMpUser);
|
|
||||||
yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo());
|
yxWechatUser.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||||
yxWechatUser.setNickname(wxMpUser.getNickname());
|
yxWechatUser.setNickname(nickname);
|
||||||
yxWechatUser.setOpenid(wxMpUser.getOpenId());
|
yxWechatUser.setOpenid(wxMpUser.getOpenId());
|
||||||
int sub = 0;
|
int sub = 0;
|
||||||
if(ObjectUtil.isNotNull(wxMpUser.getSubscribe()) && wxMpUser.getSubscribe()) sub =1;
|
if(ObjectUtil.isNotNull(wxMpUser.getSubscribe()) && wxMpUser.getSubscribe()) sub =1;
|
||||||
|
@ -36,6 +36,7 @@ spring:
|
|||||||
web-stat-filter:
|
web-stat-filter:
|
||||||
url-pattern: /*
|
url-pattern: /*
|
||||||
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
|
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
|
||||||
|
connection-init-sqls: set names utf8mb4
|
||||||
|
|
||||||
#配置 Jpa
|
#配置 Jpa
|
||||||
jpa:
|
jpa:
|
||||||
|
@ -48,7 +48,7 @@ spring:
|
|||||||
database: 0
|
database: 0
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password:
|
password:
|
||||||
#连接超时时间
|
#连接超时时间
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user