Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers

# Conflicts:
#	servers/boe-server-all/src/main/resources/application-pre.properties
This commit is contained in:
dongruihua
2023-02-21 17:09:26 +08:00
3 changed files with 29 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xboe.account.entity.Account;
import com.xboe.account.service.IAccountService;
import com.xboe.core.JsonResponse;
import com.xboe.core.api.ApiBaseController;
@@ -39,7 +40,7 @@ public class UserDataSyncApi extends ApiBaseController {
IDataUserSyncService service;
@PostMapping("/user")
public JsonResponse<Boolean> syncUser( @RequestBody UserData user) {
public JsonResponse<Boolean> syncUser(@RequestBody UserData user) {
if (StringUtils.isBlank(user.getId())) {
return error("无用户的id");
@@ -54,5 +55,24 @@ public class UserDataSyncApi extends ApiBaseController {
return error("同步处理用户失败", e.getMessage());
}
}
@PostMapping("/deluser")
public JsonResponse<Boolean> deleteUser(String id) {
if (StringUtils.isBlank(id)) {
return error("无用户的id");
}
//清除缓存需要loginName
try {
//先查询是否存在
Account a=new Account();
a.setId(id);
accountService.delete(a);
return success(true);
} catch (Exception e) {
log.error("同步删除用户错误", e);
return error("同步删除用户失败", e.getMessage());
}
}
}

View File

@@ -61,7 +61,11 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
for(JsonNode node :result) {
AudienceUser au=new AudienceUser();
au.setId(node.get("userId").asText());
au.setName(getNodeText(node.get("name")));
if(node.get("realName")!=null) {
au.setName(getNodeText(node.get("realName")));
}else if(node.get("name")!=null){
au.setName(getNodeText(node.get("name")));
}
au.setCode(getNodeText(node.get("userNo")));
list.add(au);
}

View File

@@ -51,12 +51,13 @@ public class DataUserSyncServiceImpl implements IDataUserSyncService{
if(user.getDeleted()!=null) {
a.setDeleted(user.getDeleted());
}
a.setLoginName(user.getCode());
}else {
//新账户
a=new Account();
a.setDeleted(user.getDeleted());
a.setSysId(user.getKid());
a.setLoginName(user.getCode());
a.setAvatar(user.getAvatar());
a.setId(user.getId());