|
|
@ -204,30 +204,6 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
userGoldRecord.setPayTime(new Date()); |
|
|
userGoldRecord.setPayTime(new Date()); |
|
|
userGoldRecord.setLinkId(SimpleIdGenerator.generateId()); |
|
|
userGoldRecord.setLinkId(SimpleIdGenerator.generateId()); |
|
|
|
|
|
|
|
|
if (consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)!=0||consumeUser.getFreeGold().compareTo(BigDecimal.ZERO)!=0||consumeUser.getTaskGold().compareTo(BigDecimal.ZERO)!=0){ |
|
|
|
|
|
// if(consumeUser.getJwcode().equals(94226013)){ |
|
|
|
|
|
String result = GoldTistV2.addCoinNew(userGoldRecord.getJwcode().toString(), 65, |
|
|
|
|
|
(double) (userGoldRecord.getPermanentGold() + userGoldRecord.getFreeDecember() + userGoldRecord.getFreeJune() + userGoldRecord.getTaskGold()) / 100, |
|
|
|
|
|
userGoldRecord.getLinkId(), userGoldRecord.getRemark(),0, consumeUser.getAdminName(), userGoldRecord.getGoodsName()); |
|
|
|
|
|
// System.out.println("9"+result+"9"); |
|
|
|
|
|
result = result.replaceAll("[\r\n]", ""); |
|
|
|
|
|
|
|
|
|
|
|
//返回状态1加成功2减成功其他失败 -5 金币不足 -6 类型错误 -7签名错误 |
|
|
|
|
|
if (!result.equals("2")) { |
|
|
|
|
|
result = GoldTistV2.addCoinNew(userGoldRecord.getJwcode().toString(), 65, |
|
|
|
|
|
(double) (userGoldRecord.getPermanentGold() + userGoldRecord.getFreeDecember() + userGoldRecord.getFreeJune() + userGoldRecord.getTaskGold()) / 100, |
|
|
|
|
|
userGoldRecord.getLinkId(), userGoldRecord.getRemark(), 0, consumeUser.getAdminName(), userGoldRecord.getGoodsName()); |
|
|
|
|
|
//返回状态1加成功2减成功其他失败 -5 金币不足 -6 类型错误 -7签名错误 |
|
|
|
|
|
if (!result.equals("2")) { |
|
|
|
|
|
String errorMsg = "减金币失败,数据未进erp,返回状态:" + result; |
|
|
|
|
|
log.error(errorMsg); // 保留日志记录,便于问题排查 |
|
|
|
|
|
throw new SystemException(errorMsg); // 抛出系统异常,中断流程并传递错误信息 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//0金币消耗,往erp传一条金币为空的记录 |
|
|
|
|
|
else if (consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)==0&&consumeUser.getFreeGold().compareTo(BigDecimal.ZERO)==0&&consumeUser.getTaskGold().compareTo(BigDecimal.ZERO)==0){ |
|
|
|
|
|
GoldTistV2.addCoinRecordNew(String.valueOf(consumeUser.getJwcode()), consumeUser.getRemark(),consumeUser.getAdminName(),consumeUser.getGoodsName());} |
|
|
|
|
|
|
|
|
|
|
|
if(consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)!=0) { |
|
|
if(consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)!=0) { |
|
|
// 需要扣除的永久金币总量 |
|
|
// 需要扣除的永久金币总量 |
|
|
@ -282,6 +258,8 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
consumeMapper.add(userGoldRecord); |
|
|
consumeMapper.add(userGoldRecord); |
|
|
consumeMapper.updateUserGold(userGoldRecord); |
|
|
consumeMapper.updateUserGold(userGoldRecord); |
|
|
User user = new User(); |
|
|
User user = new User(); |
|
|
@ -310,7 +288,39 @@ public class ConsumeServiceImpl implements ConsumeService { |
|
|
// } |
|
|
// } |
|
|
//data返回订单号和创建时间 |
|
|
//data返回订单号和创建时间 |
|
|
OrderResultVO resultVO = OrderResultVO.build("XF_" + orderNumber,userGoldRecord.getCreateTime()); |
|
|
OrderResultVO resultVO = OrderResultVO.build("XF_" + orderNumber,userGoldRecord.getCreateTime()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)!=0||consumeUser.getFreeGold().compareTo(BigDecimal.ZERO)!=0||consumeUser.getTaskGold().compareTo(BigDecimal.ZERO)!=0){ |
|
|
|
|
|
// if(consumeUser.getJwcode().equals(94226013)){ |
|
|
|
|
|
String result = GoldTistV2.addCoinNew(userGoldRecord.getJwcode().toString(), 65, |
|
|
|
|
|
(double) (userGoldRecord.getPermanentGold() + userGoldRecord.getFreeDecember() + userGoldRecord.getFreeJune() + userGoldRecord.getTaskGold()) / 100, |
|
|
|
|
|
userGoldRecord.getLinkId(), userGoldRecord.getRemark(),0, consumeUser.getAdminName(), userGoldRecord.getGoodsName()); |
|
|
|
|
|
// System.out.println("9"+result+"9"); |
|
|
|
|
|
result = result.replaceAll("[\r\n]", ""); |
|
|
|
|
|
|
|
|
|
|
|
//返回状态1加成功2减成功其他失败 -5 金币不足 -6 类型错误 -7签名错误 |
|
|
|
|
|
if (!result.equals("2")) { |
|
|
|
|
|
result = GoldTistV2.addCoinNew(userGoldRecord.getJwcode().toString(), 65, |
|
|
|
|
|
(double) (userGoldRecord.getPermanentGold() + userGoldRecord.getFreeDecember() + userGoldRecord.getFreeJune() + userGoldRecord.getTaskGold()) / 100, |
|
|
|
|
|
userGoldRecord.getLinkId(), userGoldRecord.getRemark(), 0, consumeUser.getAdminName(), userGoldRecord.getGoodsName()); |
|
|
|
|
|
//返回状态1加成功2减成功其他失败 -5 金币不足 -6 类型错误 -7签名错误 |
|
|
|
|
|
if (!result.equals("2")) { |
|
|
|
|
|
String errorMsg = "减金币失败,数据未进erp,返回状态:" + result; |
|
|
|
|
|
log.error(errorMsg); // 保留日志记录,便于问题排查 |
|
|
|
|
|
throw new SystemException(errorMsg); // 抛出系统异常,中断流程并传递错误信息 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//0金币消耗,往erp传一条金币为空的记录 |
|
|
|
|
|
else if (consumeUser.getPermanentGold().compareTo(BigDecimal.ZERO)==0&&consumeUser.getFreeGold().compareTo(BigDecimal.ZERO)==0&&consumeUser.getTaskGold().compareTo(BigDecimal.ZERO)==0){ |
|
|
|
|
|
GoldTistV2.addCoinRecordNew(String.valueOf(consumeUser.getJwcode()), consumeUser.getRemark(),consumeUser.getAdminName(),consumeUser.getGoodsName());} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success(resultVO); |
|
|
return Result.success(resultVO); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
|