|
@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author : lingfeng
|
|
@@ -82,21 +83,17 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
resultMap.put("callBackTypeEnum", param.getCallBackTypeEnum().getValue());
|
|
|
resultMap.put("userId", userData.getUserId());
|
|
|
resultMap.put("gameId", userData.getGameId());
|
|
|
-
|
|
|
-
|
|
|
- List<Integer> amountList = new ArrayList<>();
|
|
|
- amountList.add(10);
|
|
|
- amountList.add(20);
|
|
|
- amountList.add(30);
|
|
|
- resultMap.put("amount", amountList);
|
|
|
-
|
|
|
-
|
|
|
//事件类型枚举
|
|
|
CallBackTypeEnum callBackTypeEnum = param.getCallBackTypeEnum();
|
|
|
Game game = gameService.getById(userData.getGameId());
|
|
|
//判断游戏状态, 对接上包过程中, 全量回传
|
|
|
if (Objects.equals(game.getStatus(), 2)) {
|
|
|
resultMap.put("callBack", Boolean.TRUE);
|
|
|
+ List<Integer> amountList = new ArrayList<>();
|
|
|
+ amountList.add(10);
|
|
|
+ amountList.add(20);
|
|
|
+ amountList.add(30);
|
|
|
+ resultMap.put("amount", amountList);
|
|
|
if (Objects.equals(callBackTypeEnum, CallBackTypeEnum.CALL_BACK_PAY_ORDER)) {
|
|
|
PlatformOrderDTO platformOrderDTO = orderService.getByOrderId(param.getOrderId());
|
|
|
resultMap.put("amount", Collections.singletonList(platformOrderDTO.getAmount()));
|
|
@@ -173,8 +170,11 @@ public class CallBackServiceImpl implements ICallBackService {
|
|
|
resultMap.put("callBack", orderBackQueryRpcVO.getDoBack());
|
|
|
resultMap.put("backMsg", orderBackQueryRpcVO.getBackMsg());
|
|
|
if (Objects.equals(orderBackQueryRpcVO.getDoBack(), Boolean.TRUE)) {
|
|
|
-
|
|
|
- resultMap.put("amount", orderBackQueryRpcVO.getBackMoney());
|
|
|
+ //传过来的金额是分, 换算成元, 存在小数直接舍弃
|
|
|
+ List<Long> backMoney = orderBackQueryRpcVO.getBackMoney()
|
|
|
+ .stream().map(money -> money / 100)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ resultMap.put("amount", backMoney);
|
|
|
}
|
|
|
break;
|
|
|
default:
|