|
|
@ -51,6 +51,7 @@ public class AuditServiceImpl implements AuditService { |
|
|
|
@Override |
|
|
|
public boolean auditOrder(String token, String orderCode, Integer auditId, Integer action,String rejectReason) { |
|
|
|
UserGoldRecord order=auditMapper.selectOrderByOrderCode(orderCode); |
|
|
|
Date date =new Date(); |
|
|
|
if (order == null || order.getAuditStatus() != 0) { |
|
|
|
throw new IllegalArgumentException("订单不存在或已被审核"); |
|
|
|
} |
|
|
@ -84,7 +85,7 @@ public class AuditServiceImpl implements AuditService { |
|
|
|
if (order.getType()==0){ //充值 |
|
|
|
//更新用户余额 |
|
|
|
User update = new User(); |
|
|
|
GoldUser gold = userMapper.selectGold(order.getJwcode().toString()); |
|
|
|
Date oldFirstRecharge = userMapper.getFirstRecharge(order.getJwcode().toString()); |
|
|
|
|
|
|
|
update.setJwcode(order.getJwcode()); //精网号 |
|
|
|
update.setSumPermanentGold(BigDecimal.valueOf(order.getPermanentGold())); //历史永久金币 |
|
|
@ -96,6 +97,15 @@ public class AuditServiceImpl implements AuditService { |
|
|
|
update.setCurrentFreeDecember(BigDecimal.valueOf(order.getFreeDecember())); //当前十二月免费金币 |
|
|
|
update.setCurrentTaskGold(BigDecimal.valueOf(order.getTaskGold())); //当前任务金币 |
|
|
|
update.setRechargeNum(1); //充值次数加一 |
|
|
|
/* |
|
|
|
判断是否更新首充时间 |
|
|
|
1.用户当前首充时间为空 |
|
|
|
2.用户当前首充时间小于当前时间 |
|
|
|
3.用户当前首充时间等于2020-01-01 00:00:00 |
|
|
|
*/ |
|
|
|
if(oldFirstRecharge== null || oldFirstRecharge.after(date) || "2020-01-01 00:00:00".equals(oldFirstRecharge.toString())){ |
|
|
|
update.setFirstRecharge(date);//设置首充时间为当前时间 |
|
|
|
} |
|
|
|
auditMapper.updateUserGold(update); |
|
|
|
//erp增加充值数据 |
|
|
|
// if(update.getJwcode().equals(94226013)){ |
|
|
|