充值发货区分android还是ios

master
gaojie 2019-03-01 10:27:43 +08:00
parent 6e3552c86e
commit 839abf13b5
3 changed files with 9 additions and 4 deletions

View File

@ -49,8 +49,13 @@ public class RechargeController {
FindPlayerResult findPlayerResult = new FindPlayerResult("1010","sign derify failed",null); FindPlayerResult findPlayerResult = new FindPlayerResult("1010","sign derify failed",null);
return JsonUtil.getInstence().getGson().toJson(findPlayerResult); return JsonUtil.getInstence().getGson().toJson(findPlayerResult);
} }
CUserInfo cUserInfo = cuserDao.getUserInfobyNameAndServerId(userId, Integer.parseInt(serverCode)); String plat = "android";
if (gameCode.equals(YsjConstant.TW_IOS_GameCode)){
plat = "ios";
}
CUserInfo cUserInfo = cuserDao.getUserInfobyNameAndServerId(userId, Integer.parseInt(serverCode),plat);
if (Integer.parseInt(creditId) != cUserInfo.getUserId()){ if (Integer.parseInt(creditId) != cUserInfo.getUserId()){
LOGGER.info("deliveryGoods==>creditId={},uId={}",creditId,cUserInfo.getUserId());
ResultVo resultVo = new ResultVo("1038", "该用户无此角色"); ResultVo resultVo = new ResultVo("1038", "该用户无此角色");
return JsonUtil.getInstence().getGson().toJson(resultVo); return JsonUtil.getInstence().getGson().toJson(resultVo);
} }

View File

@ -6,7 +6,7 @@ public interface CUserDao {
String findUserInfo(int serverId, int userId); String findUserInfo(int serverId, int userId);
CUserInfo getUserInfobyNameAndServerId(String name,int serverId) throws Exception; CUserInfo getUserInfobyNameAndServerId(String name,int serverId,String plat) throws Exception;
CUser getCUser(int userId, int serverid) throws Exception; CUser getCUser(int userId, int serverid) throws Exception;

View File

@ -34,11 +34,11 @@ public class CUserDaoImpl implements CUserDao {
} }
@Override @Override
public CUserInfo getUserInfobyNameAndServerId(String name, int serverId) throws Exception { public CUserInfo getUserInfobyNameAndServerId(String name, int serverId,String plat) throws Exception {
Query query = new Query(); Query query = new Query();
Criteria cr = new Criteria(); Criteria cr = new Criteria();
MongoTemplate mongoTemplate = connect.getMongoTemplete("ysj_core"); MongoTemplate mongoTemplate = connect.getMongoTemplete("ysj_core");
cr.andOperator(Criteria.where("serverid").is(serverId), Criteria.where("openId").is(name)); cr.andOperator(Criteria.where("serverid").is(serverId), Criteria.where("openId").is(name),Criteria.where("platform").is(plat));
query.addCriteria(cr); query.addCriteria(cr);
CUserInfo cUserInfo = mongoTemplate.findOne(query, CUserInfo.class); CUserInfo cUserInfo = mongoTemplate.findOne(query, CUserInfo.class);
return cUserInfo; return cUserInfo;