|
|
@@ -34,6 +34,7 @@ import com.zhongshu.card.server.core.service.orgManager.OrganizationManagerServi
|
|
|
import com.zhongshu.card.server.core.service.school.DictInfoServiceImpl;
|
|
|
import com.zhongshu.card.server.core.util.BeanUtils;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
+import com.zhongshu.card.server.core.util.ValidateResult;
|
|
|
import com.zhongshu.card.server.core.util.ValidateUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
@@ -154,7 +155,7 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
userCountDao.save(userAccount);
|
|
|
} else {
|
|
|
// 编辑
|
|
|
- BeanUtils.copyProperties(param, userAccount);
|
|
|
+ BeanUtils.copyPropertiesWithoutNull(param, userAccount);
|
|
|
String realName = param.getRealName();
|
|
|
if (StringUtils.isEmpty(realName)) {
|
|
|
realName = param.getName();
|
|
|
@@ -258,6 +259,37 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
*/
|
|
|
@Override
|
|
|
public ResultContent updateOrgUserState(UpdateUserStateParam param) {
|
|
|
+ if (StringUtils.isEmpty(param.getUserId())) {
|
|
|
+ // 新增加
|
|
|
+ if (StringUtils.isEmpty(param.getName())) {
|
|
|
+ return ResultContent.buildFail("name不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(param.getPhone())) {
|
|
|
+ return ResultContent.buildFail("phone不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(param.getPassword())) {
|
|
|
+ return ResultContent.buildFail("password不能为空");
|
|
|
+ }
|
|
|
+ ValidateResult validateResult = ValidateUtils.validatePassWord(param.getPassword());
|
|
|
+ if (!validateResult.isSuccess()) {
|
|
|
+ return ResultContent.buildFail(validateResult.getMsg());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 初始基本用户信息
|
|
|
+ RegisterUserAccountParam userAccountParam = new RegisterUserAccountParam();
|
|
|
+ userAccountParam.setLoginName(param.getPhone());
|
|
|
+ userAccountParam.setPassword(param.getPassword());
|
|
|
+ userAccountParam.setPhone(param.getPhone());
|
|
|
+ userAccountParam.setName(param.getName());
|
|
|
+ ResultContent<String> userAccountContent = registerUserAccount(userAccountParam);
|
|
|
+ if (userAccountContent.isFailed()) {
|
|
|
+ return ResultContent.buildFail(userAccountContent.getMsg());
|
|
|
+ }
|
|
|
+ String userId = userAccountContent.getContent();
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
String userId = param.getUserId();
|
|
|
String oid = param.getOid();
|
|
|
if (StringUtils.isEmpty(oid)) {
|
|
|
@@ -277,7 +309,7 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
|
|
|
OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(organization, temp);
|
|
|
if (ObjectUtils.isNotEmpty(organizationUser)) {
|
|
|
- organizationUser.setState(param.getUserState());
|
|
|
+ organizationUser.setState(param.getState());
|
|
|
organizationUserDao.save(organizationUser);
|
|
|
}
|
|
|
return ResultContent.buildSuccess();
|