|
|
@@ -9,6 +9,7 @@ import com.fs.app.param.FsBindCompanyUserParam;
|
|
|
import com.fs.app.param.HelpPatientAndAddressParam;
|
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.annotation.RepeatSubmit;
|
|
|
+import com.fs.common.constant.HttpStatus;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
@@ -149,7 +150,7 @@ public class CompanyUserController extends AppBaseController {
|
|
|
Long currentUserId = Long.parseLong(getUserId());
|
|
|
FsUser user = fsUserService.selectFsUserByUserId(currentUserId);
|
|
|
if (user == null) {
|
|
|
- return R.error("用户不存在");
|
|
|
+ return R.error(HttpStatus.UNAUTHORIZED,"用户不存在");
|
|
|
}
|
|
|
|
|
|
List<FsUser> usersByPhone = findUsersByPhone(param.getPhone());
|
|
|
@@ -166,7 +167,7 @@ public class CompanyUserController extends AppBaseController {
|
|
|
if (!user.getUserId().equals(userByPhone.getUserId())) {
|
|
|
// 手机号查询出的用户unionId为空合并账号
|
|
|
if (StringUtils.isBlank(userByPhone.getUnionId())) {
|
|
|
- fsUserService.realDeleteFsUserByUserId(userByPhone.getUserId());
|
|
|
+ mergeUserFields(user, userByPhone);
|
|
|
}
|
|
|
|
|
|
// 手机号查询出的用户unionId不为空且于登录用户unionId不一致
|
|
|
@@ -235,6 +236,22 @@ public class CompanyUserController extends AppBaseController {
|
|
|
return encryptedText;
|
|
|
}
|
|
|
|
|
|
+ private void mergeUserFields(FsUser target, FsUser source) {
|
|
|
+ if (StringUtils.isNotEmpty(source.getPassword())) {
|
|
|
+ target.setPassword(source.getPassword());
|
|
|
+ }
|
|
|
+ if (source.getIntegral() != null && source.getIntegral() > 0) {
|
|
|
+ target.setIntegral(source.getIntegral());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(source.getSource())) {
|
|
|
+ target.setSource(source.getSource());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(source.getLoginDevice())) {
|
|
|
+ target.setLoginDevice(source.getLoginDevice());
|
|
|
+ }
|
|
|
+ fsUserService.realDeleteFsUserByUserId(source.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Login
|
|
|
@ApiOperation("上传声纹")
|