|
|
@ -45,6 +45,7 @@ public class OtherServiceImpl implements OtherService { |
|
|
|
private static final Set<String> typesToUpdateTwo = new HashSet<>(); |
|
|
|
private static final Set<String> typesToUpdateThree = new HashSet<>(); |
|
|
|
private static final Set<String> typesToUpdateFour = new HashSet<>(); |
|
|
|
private static final Set<String> typesToUpdateFive = new HashSet<>(); |
|
|
|
private final OtherMapper otherMapper; |
|
|
|
private final DetailYMapper detailYMapper; |
|
|
|
private final UserMapper userMapper; |
|
|
@ -84,8 +85,8 @@ public class OtherServiceImpl implements OtherService { |
|
|
|
typesToUpdateZero.add("53"); |
|
|
|
typesToUpdateZero.add("54"); |
|
|
|
typesToUpdateZero.add("60"); |
|
|
|
typesToUpdateZero.add("64"); |
|
|
|
typesToUpdateZero.add("63"); |
|
|
|
// typesToUpdateZero.add("64"); |
|
|
|
// typesToUpdateZero.add("63"); |
|
|
|
|
|
|
|
typesToUpdateOne.add("9"); |
|
|
|
typesToUpdateOne.add("15"); |
|
|
@ -121,6 +122,9 @@ public class OtherServiceImpl implements OtherService { |
|
|
|
|
|
|
|
typesToUpdateFour.add("65"); |
|
|
|
|
|
|
|
typesToUpdateFive.add("63"); |
|
|
|
typesToUpdateFive.add("64"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -217,10 +221,59 @@ public class OtherServiceImpl implements OtherService { |
|
|
|
|
|
|
|
|
|
|
|
if (typesToUpdateFour.contains(type)) { |
|
|
|
log.info("类型为 65,不写入数据"); |
|
|
|
log.info("类型为 金币系统操作,不写入数据"); |
|
|
|
return 0; // 返回默认值 |
|
|
|
} |
|
|
|
|
|
|
|
if (typesToUpdateFive.contains(type)) { |
|
|
|
System.out.println("金币充值------------------------------------------------------"); |
|
|
|
detailY.setUpdateType(0);// 设置 updateType 为 0 |
|
|
|
detailY.setJwcode(JwCode); |
|
|
|
detailY.setRechargeCoin(rechargeJb); |
|
|
|
detailY.setFreeCoin(freeJb); |
|
|
|
detailY.setTaskCoin(taskJb); |
|
|
|
detailY.setRemark(remark); |
|
|
|
detailY.setName(adminName); |
|
|
|
detailY.setGtype(Integer.valueOf(type)); |
|
|
|
// detailY.setUsername(username); |
|
|
|
// detailY.setArea(area); |
|
|
|
detailY.setProductName(productName); |
|
|
|
detailY.setConsumePlatform(String.valueOf(platform)); |
|
|
|
detailY.setRechargeWay(Way); |
|
|
|
detailY.setArea(country); |
|
|
|
detailY.setCreateTime(erp.getCreateTime()); |
|
|
|
detailY.setGold_last(goldLast); |
|
|
|
detailY.setUid(uid); |
|
|
|
|
|
|
|
detailY.setUsername(name); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal buyJb = userGold.getBuyJb(); |
|
|
|
BigDecimal coreJb = userGold.getCoreJb(); |
|
|
|
buyJb = buyJb.add(rechargeJb); |
|
|
|
coreJb = coreJb.add(taskJb); |
|
|
|
// 设置更新后的Sumgold回到user对象 |
|
|
|
userGold.setBuyJb(buyJb); |
|
|
|
userGold.setCoreJb(coreJb); |
|
|
|
LocalDate now = LocalDate.now(); |
|
|
|
|
|
|
|
// 判断当前日期是在六月之前还是之后 |
|
|
|
Month currentMonth = now.getMonth(); |
|
|
|
boolean isBeforeJune = currentMonth.getValue() < Month.JUNE.getValue(); |
|
|
|
boolean isJune = currentMonth.getValue() == Month.JUNE.getValue(); |
|
|
|
boolean isAfterJune = currentMonth.getValue() > Month.JUNE.getValue(); |
|
|
|
|
|
|
|
// 根据月份更新 free6 或 free12 |
|
|
|
if (isBeforeJune || isJune) { |
|
|
|
// 如果是六月前,更新 free6 |
|
|
|
BigDecimal free6 = userGold.getFree6().add(freeJb); |
|
|
|
userGold.setFree6(free6); |
|
|
|
} else if (isAfterJune) { |
|
|
|
// 如果是六月后,更新 free12 |
|
|
|
BigDecimal free12 = userGold.getFree12().add(freeJb); |
|
|
|
userGold.setFree12(free12); |
|
|
|
} |
|
|
|
} |
|
|
|
if (typesToUpdateZero.contains(type)) { |
|
|
|
System.out.println("充值------------------------------------------------------"); |
|
|
|
detailY.setUpdateType(0);// 设置 updateType 为 0 |
|
|
@ -279,6 +332,7 @@ public class OtherServiceImpl implements OtherService { |
|
|
|
recharge.setRemark(remark); |
|
|
|
recharge.setAdminName(adminName); |
|
|
|
|
|
|
|
|
|
|
|
rechargeMapper.insert(recharge); |
|
|
|
|
|
|
|
} else if (typesToUpdateOne.contains(type)) { |
|
|
|