提交 ac09393c authored 作者: zgy's avatar zgy

修改bug

上级 2a58bee0
...@@ -150,12 +150,12 @@ public class FlutterWaveServiceImpl implements FlutterWaveService { ...@@ -150,12 +150,12 @@ public class FlutterWaveServiceImpl implements FlutterWaveService {
TbCfFinanceEntity finance = createFinance(paymentid, authurl, tbCfOrderVo); TbCfFinanceEntity finance = createFinance(paymentid, authurl, tbCfOrderVo);
TbCfFinanceVo tbCfFinanceVo = new TbCfFinanceVo(); TbCfFinanceVo tbCfFinanceVo = new TbCfFinanceVo();
BeanUtils.copyProperties(finance, tbCfFinanceVo); BeanUtils.copyProperties(finance, tbCfFinanceVo);
//清空订单
removeRedisCache(tbCfOrderVo);
} }
result.setData(JSON.parseObject(data)); result.setData(JSON.parseObject(data));
result.setCode(ResultCodeEnum.SUCCESS.getCode()).setMessage("payment success!"); result.setCode(ResultCodeEnum.SUCCESS.getCode()).setMessage("payment success!");
logger.info(tbCfOrderVo.getUserName() + ":Pay for success! The order number is:" + tbCfOrderVo.getOrderId()); logger.info(tbCfOrderVo.getUserName() + ":Pay for success! The order number is:" + tbCfOrderVo.getOrderId());
//清空订单
removeRedisCache(tbCfOrderVo);
} else { } else {
result.setData(JSON.parseObject(data)); result.setData(JSON.parseObject(data));
//支付失败 //支付失败
......
...@@ -100,7 +100,7 @@ public class TbCfItemDetailServiceImpl implements TbCfItemDetailService { ...@@ -100,7 +100,7 @@ public class TbCfItemDetailServiceImpl implements TbCfItemDetailService {
String token = jwtTokenProvider.resolveToken(request); String token = jwtTokenProvider.resolveToken(request);
TbCfUserInfoVo tbCfUserInfoVo = tokenManager.validate(token); TbCfUserInfoVo tbCfUserInfoVo = tokenManager.validate(token);
boolean flag = false; boolean flag = false;
if (tbCfItemDetailVo.getItemPrice().toString() != null) { if (tbCfItemDetailVo.getItemPrice() != null) {
int compare = tbCfItemDetailVo.getItemPrice().compareTo(BigDecimal.ZERO); int compare = tbCfItemDetailVo.getItemPrice().compareTo(BigDecimal.ZERO);
if (compare > 0) { if (compare > 0) {
flag = true; flag = true;
......
...@@ -302,6 +302,10 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -302,6 +302,10 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
Result result = new Result(); Result result = new Result();
TbCfUserInfoEntity user = tbCfUserInfoDao.checkUserByPhone(phone); TbCfUserInfoEntity user = tbCfUserInfoDao.checkUserByPhone(phone);
String phoneCode = (String) captchaRedisCache.get(KeyConstant.CAPTCHA_PHONE + phone); String phoneCode = (String) captchaRedisCache.get(KeyConstant.CAPTCHA_PHONE + phone);
if (phoneCode == null) {
result.setCode(ResultCodeEnum.VALIDATE_ERROR.getCode()).setMessage("Verification code failure");
return result;
}
if (user != null && phoneCode.equals(code)) { if (user != null && phoneCode.equals(code)) {
result = loginByPhoneCode(ip, phone); result = loginByPhoneCode(ip, phone);
} else { } else {
...@@ -551,7 +555,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -551,7 +555,7 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
} }
@Override @Override
public List<TbCfUserInfoEntity>selectUserByPhone() { public List<TbCfUserInfoEntity> selectUserByPhone() {
return tbCfUserInfoDao.selectUserByPhone(); return tbCfUserInfoDao.selectUserByPhone();
} }
...@@ -562,8 +566,8 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService { ...@@ -562,8 +566,8 @@ public class TbCfUserInfoServiceImpl implements TbCfUserInfoService {
@Override @Override
public String sendRegister(String email) throws EmailException, TemplateException, IOException { public String sendRegister(String email) throws EmailException, TemplateException, IOException {
emailHelper.sendEmail(email, EmailTemplateConstant.REGISTERS); emailHelper.sendEmail(email, EmailTemplateConstant.REGISTERS);
return "s"; return "s";
} }
......
...@@ -12,6 +12,7 @@ public enum ResultCodeEnum { ...@@ -12,6 +12,7 @@ public enum ResultCodeEnum {
CACHE_ERROR(9003,"cache error"), CACHE_ERROR(9003,"cache error"),
DAO_ERROR(9004,"dao error"), DAO_ERROR(9004,"dao error"),
NEED_LOGIN(10,"need login"), NEED_LOGIN(10,"need login"),
SYSTEM_ERROR(100,"Other system anomalies"),
ILLEGAL_ARGUMENT(2,"illegal argument"); ILLEGAL_ARGUMENT(2,"illegal argument");
......
...@@ -21,7 +21,7 @@ spring: ...@@ -21,7 +21,7 @@ spring:
#Redis数据库分片索引(默认为0) #Redis数据库分片索引(默认为0)
database: 0 database: 0
# host: 192.168.1.211 # host: 192.168.1.211
host: 127.0.0.1 host: 49.235.150.107
port: 6379 port: 6379
password: password:
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
update tb_cf_toicoupon t set enable_flag = 0 where t.user_id=#{userId} and t.coupon_id=#{couponId} update tb_cf_toicoupon t set enable_flag = 0 where t.user_id=#{userId} and t.coupon_id=#{couponId}
</update> </update>
<!--修改优惠券领取发放记录--> <!--修改优惠券领取发放记录-->
<update id="updateEnableFlag"> <update id="updateEnableFlag" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity">
update tb_cf_toicoupon set enable_flag=#{enableFlag} where user_id=#{userId} and coupon_id=#{couponId} update tb_cf_toicoupon set enable_flag=#{enableFlag} where user_id=#{userId} and coupon_id=#{couponId}
</update> </update>
<insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity"> <insert id="save" parameterType="com.diaoyun.zion.chinafrica.entity.TbCfToicouponEntity">
......
...@@ -36,6 +36,7 @@ import springfox.documentation.spring.web.json.Json; ...@@ -36,6 +36,7 @@ import springfox.documentation.spring.web.json.Json;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.net.URLDecoder; import java.net.URLDecoder;
...@@ -235,4 +236,9 @@ public class PayTest { ...@@ -235,4 +236,9 @@ public class PayTest {
System.out.println(false); System.out.println(false);
} }
@Test
public void testBigdecimal(){
BigDecimal b=new BigDecimal("0");
System.out.println(b!=null);
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论