Commit e264acba authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 3dd3e35f 766c14a4
......@@ -117,9 +117,23 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
userQuery.setOpenId(req.getOpenId());
userEntity = userService.selectOne(userQuery);
if (ObjectUtils.isEmpty(userEntity)) {
throw new AppException("不存在当前匹配的关联用户!openId:" + req.getOpenId());
//throw new AppException("不存在当前匹配的关联用户!openId:" + req.getOpenId());
userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setOpenId(req.getOpenId());
userEntity.setRealName(req.getUserName());
userEntity.setLoginName(req.getOpenId());
// userEntity.setPhone(req.getPhone());
// userEntity.setMobile(req.getPhone());
userEntity.setLoginPwd(SecurityUtil.md5DoubleEncoding("123"));
userEntity.setUserType(2);
userEntity = userService.save(userEntity);
}
if(userEntity.getCompanyId()!=null){
CompanyEntity companyEntity= companyService.get(userEntity.getCompanyId());
data.put("parkId",companyEntity.getParkId());
data.put("parkName",companyEntity.getParkName());
}
data.put("id", userEntity.getId());
data.put("staffId", userEntity.getCustomerId());
......@@ -184,6 +198,10 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
CompanyEntity companyEntity = companyService.getCompanyByH5(req);
userEntity.setCompanyId(companyEntity.getId());
userEntity = userService.save(userEntity);
}else {
userEntity.setPhone(req.getPhone());
userEntity.setMobile(req.getPhone());
userService.update(userEntity);
}
if (!ObjectUtils.isEmpty(userEntity)
......@@ -197,9 +215,12 @@ public class H5LoginController extends BaseCRUDJsonBodyMappingController<UserSer
userEntity.setCompanyId(companyEntity.getId());
}
//当前用户绑定公司 用户名可与phone绑定
JSONObject data = new JSONObject();
if(userEntity.getCompanyId()!=null){
CompanyEntity companyEntity= companyService.get(userEntity.getCompanyId());
data.put("parkId",companyEntity.getParkId());
data.put("parkName",companyEntity.getParkName());
}
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis());
......
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