|
@ -40,6 +40,11 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
@Override |
|
|
@Override |
|
|
//新增消费记录 |
|
|
//新增消费记录 |
|
|
public int insert(Detail detail) throws Exception { |
|
|
public int insert(Detail detail) throws Exception { |
|
|
|
|
|
int result =consumeMapper.insert(detail); |
|
|
|
|
|
System.out.println(detail); |
|
|
|
|
|
if (result != 1) { |
|
|
|
|
|
throw new Exception("Failed to insert another entity"); |
|
|
|
|
|
} |
|
|
BigDecimal paidGold1 =detail.getRechargeCoin(); |
|
|
BigDecimal paidGold1 =detail.getRechargeCoin(); |
|
|
BigDecimal freeGold1 =detail.getFreeCoin(); |
|
|
BigDecimal freeGold1 =detail.getFreeCoin(); |
|
|
BigDecimal taskGold1 =detail.getTaskCoin(); |
|
|
BigDecimal taskGold1 =detail.getTaskCoin(); |
|
@ -73,7 +78,7 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
|
|
|
|
|
|
// 设置更新后的Sumgold回到user对象 |
|
|
// 设置更新后的Sumgold回到user对象 |
|
|
System.out.println(user+"----------------------------------------------------------"); |
|
|
System.out.println(user+"----------------------------------------------------------"); |
|
|
int result = userMapper.update(user); |
|
|
|
|
|
|
|
|
result = userMapper.update(user); |
|
|
if (result != 1) { |
|
|
if (result != 1) { |
|
|
throw new Exception("Failed to insert another entity"); |
|
|
throw new Exception("Failed to insert another entity"); |
|
|
} |
|
|
} |
|
@ -81,7 +86,7 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
String uuid = UUID.randomUUID().toString().replace("-", ""); // 去掉UUID中的'-' |
|
|
String uuid = UUID.randomUUID().toString().replace("-", ""); // 去掉UUID中的'-' |
|
|
detail.setOrderCode(uuid); |
|
|
detail.setOrderCode(uuid); |
|
|
//添加表单数据 |
|
|
//添加表单数据 |
|
|
result =consumeMapper.insert(detail); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//消费完成后需要将用户的三币从user表中去掉 |
|
|
//消费完成后需要将用户的三币从user表中去掉 |
|
|