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

修改bug

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