增加预注册奖励处理

grimm 2025-05-04 03:54:09 +08:00
parent 456f5fd3eb
commit 74b49b1fc5
1 changed files with 40 additions and 11 deletions

View File

@ -1878,22 +1878,22 @@ public class PayController {
* @return * @return
*/ */
@RequestMapping(value = "/pay/f5Notify", method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "/pay/f5Notify", method = {RequestMethod.POST,RequestMethod.GET})
public String f5Notify(@RequestParam("appId") String appId, public String f5Notify(String appId,
@RequestParam("orderId") String orderId, String orderId,
@RequestParam("defaultAmount") double defaultAmount, double defaultAmount,
@RequestParam("defaultCurrency") String defaultCurrency, String defaultCurrency,
@RequestParam("gameAmount") int gameAmount, int gameAmount,
@RequestParam("gameCurrency") String gameCurrency, String gameCurrency,
String productId, String productId,
@RequestParam("payChannel") String payChannel, String payChannel,
@RequestParam("userId") long userId, long userId,
@RequestParam("serverId") String serverId, String serverId,
@RequestParam("orderStatus") int orderStatus, int orderStatus,
String statusMsg, String statusMsg,
Integer ots, Integer ots,
String payDoneTime, String payDoneTime,
String extInfo, String extInfo,
@RequestParam("osign") String osign) { String osign) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("appId", Constant.F5_APPID); json.put("appId", Constant.F5_APPID);
json.put("userId", userId); json.put("userId", userId);
@ -1905,6 +1905,35 @@ public class PayController {
if(productId == null){ if(productId == null){
productId = ""; productId = "";
} }
//为预注册奖励,不走发货逻辑
if("ms_590001".equals(productId)){
String key = RedisUserKey.F5_PRE_REWARD + RedisUserKey.Delimiter_colon + userId;
Map<String, Integer> map = RedisUtil.getInstence().getMapValues(key);
//已经发过直接返回
if(map !=null){
if(map.containsKey(productId)){
json.put("code", 200);
json.put("msg", "SUCCESS");
json.put("deliverStatus", 1);
return json.toString();
}else{
map.put(productId, 0);
RedisUtil.getInstence().putMap(key, "",map,-1);
json.put("code", 200);
json.put("msg", "SUCCESS");
json.put("deliverStatus", 1);
return json.toString();
}
}else{
Map<String, Integer> map1 = new HashMap<>();
map1.put(productId, 0);
RedisUtil.getInstence().putMap(key, "",map1,-1);
json.put("code", 200);
json.put("msg", "SUCCESS");
json.put("deliverStatus", 1);
return json.toString();
}
}
if(payDoneTime == null){ if(payDoneTime == null){
payDoneTime = ""; payDoneTime = "";
} }