Commit a2bfe95b authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 0324597e 2f1195f3
......@@ -57,23 +57,28 @@ public class UserBiz {
String result = this.doPost(imUrl + "/xxfcim/user/register",str) ;
JSONObject json = JSONObject.parseObject(result);
//如果已经注册过,查询出手机号对应用户信息执行登录返回
// if(0 == json.getInteger("resultCode")){
// String phone = map.get("telephone").toString();
// Query query = new Query(Criteria.where("phone").is(phone));
// User mgt = mongoTemplate.findOne(query, User.class);
// if(mgt == null){
// result = "系统错误";
// }else{
// Map<String,Object>params = new HashMap<String,Object>();
// params.put("userId",mgt.getUserId());
// params.put("telephone",mgt.getPhone());
// params.put("password",mgt.getPassword());
// result = this.login(params);
// }
// }else{
// json.put("password",map.get("password").toString());
// result = json.toJSONString();
// }
if(0 == json.getInteger("resultCode")){
String phone = map.get("telephone").toString();
Query query = new Query(Criteria.where("phone").is(phone));
User mgt = mongoTemplate.findOne(query, User.class);
if(mgt == null){
result = "系统错误";
}else{
json.put("password",mgt.getPassword());
Map<String,Object> params = new HashMap<String,Object>();
params.put("userId",mgt.getId());
json.put("data",params);
result = json.toJSONString();
/*Map<String,Object>params = new HashMap<String,Object>();
params.put("userId",mgt.getUserId());
params.put("telephone",mgt.getPhone());
params.put("password",mgt.getPassword());
result = this.login(params);*/
}
}else{
json.put("password",map.get("password").toString());
result = json.toJSONString();
}
baseResponse.setStatus(200);
baseResponse.setMessage(result);
......
......@@ -566,8 +566,8 @@ public class Msg {
Msg entity = new Msg();
entity.id = ObjectId.get();
entity.userId = user.getUserId();
if(10000==user.getUserId())
entity.userId = Integer.parseInt(user.getId().toString());
if("10000" ==user.getId().toString())
entity.nickname ="客服公众号";
else
entity.nickname = user.getNickname();
......
......@@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import com.xxfc.platform.im.utils.DateUtil;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
......@@ -27,7 +28,7 @@ import lombok.Setter;
public class User {
@Id
private Integer userId;// 用户Id
private ObjectId id;// 用户Id
//@JSONField(serialize = false)
......@@ -188,8 +189,8 @@ public class User {
// ********************引用字段********************
public Integer getUserId() {
return userId;
public ObjectId getId() {
return id;
}
......@@ -209,8 +210,8 @@ public class User {
this.num = num;
}
public void setUserId(Integer userId) {
this.userId = userId;
public void setid(ObjectId id) {
this.id = id;
}
public String getUserKey() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment