feat:用户部分代码完善获取人、部门、岗位、企业数据
parent
eb909fed2a
commit
91b4b995d9
|
|
@ -10,6 +10,7 @@ import com.zcloud.basic.info.dto.clientobject.UserCO;
|
|||
import com.zcloud.gbscommon.zclouduser.facade.ZcloudUserFacade;
|
||||
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -38,7 +39,10 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
|
|||
|
||||
@Override
|
||||
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
|
||||
return null;
|
||||
UserCO user = userServiceI.getInfoByUserId(aLong);
|
||||
ZcloudUserCo zcloudUserCo = new ZcloudUserCo();
|
||||
BeanUtils.copyProperties(user, zcloudUserCo);
|
||||
return SingleResponse.of(zcloudUserCo);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
|
|||
import com.zcloud.basic.info.api.UserServiceI;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||
import com.zcloud.gbscommon.translateaop.TranslateField;
|
||||
import com.zcloud.gbscommon.zclouddepartment.response.ZcloudDepartmentInfoCo;
|
||||
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -17,6 +20,8 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
|
|
@ -29,6 +34,19 @@ import java.util.ArrayList;
|
|||
@AllArgsConstructor
|
||||
public class UserController {
|
||||
private final UserServiceI userService;
|
||||
private final TranslateField translateField;
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping("/test")
|
||||
public SingleResponse<UserCO> test(@RequestBody UserCO cmd) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
List<UserCO> userCOS = translateField.translateZcloudCommonInformation(Arrays.asList(cmd), UserCO.class);
|
||||
ZcloudDepartmentInfoCo zcloudDpetInfoById = translateField.getZcloudDpetInfoById(1985993429287899137L);
|
||||
ZcloudUserCo zcloudUserInfoById = translateField.getZcloudUserInfoById(1985906883444662274L);
|
||||
|
||||
return SingleResponse.of(cmd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("新增用户")
|
||||
@PostMapping("/save")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
|||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
|
@ -72,5 +73,12 @@ public class UserQueryExe {
|
|||
List<UserDO> list = userRepository.list();
|
||||
return userCoConvertor.converDOsToCOs(list);
|
||||
}
|
||||
|
||||
public UserCO getInfoByUserId(Long aLong) {
|
||||
UserDO byId = userRepository.getById(aLong);
|
||||
UserCO userCO = new UserCO();
|
||||
BeanUtils.copyProperties(byId,userCO);
|
||||
return userCO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,5 +84,10 @@ public class UserServiceImpl implements UserServiceI {
|
|||
public List<UserCO> getUserList() {
|
||||
return userQueryExe.getUserList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCO getInfoByUserId(Long aLong) {
|
||||
return userQueryExe.getInfoByUserId(aLong);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,5 +33,7 @@ public interface UserServiceI {
|
|||
List<UserCO> listByUserIds(Collection<Long> collection);
|
||||
|
||||
List<UserCO> getUserList();
|
||||
|
||||
UserCO getInfoByUserId(Long aLong);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package com.zcloud.basic.info.dto.clientobject;
|
|||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zcloud.gbscommon.translateaop.TranslateEunm;
|
||||
import com.zcloud.gbscommon.translateaop.ZCloudTranslate;
|
||||
import com.zcloud.gbscommon.translateaop.ZCloudTranslates;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -16,6 +19,13 @@ import java.util.Date;
|
|||
* @Date 2025-11-04 14:07:33
|
||||
*/
|
||||
@Data
|
||||
@ZCloudTranslates(
|
||||
{
|
||||
@ZCloudTranslate(primaryKeyType = TranslateEunm.USER, primaryKey = "id", mappedFields = {"mappingName:name", "mappingUserName:username"}),
|
||||
@ZCloudTranslate(primaryKeyType = TranslateEunm.DEPT, primaryKey = "departmentId", mappedFields = {"mappingDeptName:name"}),
|
||||
@ZCloudTranslate(primaryKeyType = TranslateEunm.CORP, primaryKey = "corpinfoId", mappedFields = {"mappingCorpName:corpName"}),
|
||||
@ZCloudTranslate(primaryKeyType = TranslateEunm.POST, primaryKey = "postId", mappedFields = {"mappingPostName:postName"})
|
||||
})
|
||||
public class UserCO extends ClientObject {
|
||||
//GBS用户id
|
||||
@ApiModelProperty(value = "GBS用户id")
|
||||
|
|
@ -147,5 +157,9 @@ public class UserCO extends ClientObject {
|
|||
//政治面貌名称
|
||||
@ApiModelProperty(value = "政治面貌名称")
|
||||
private String politicalAffiliationName;
|
||||
private String mappingName;
|
||||
private String mappingUserName;
|
||||
private String mappingPostName;
|
||||
private String mappingDeptName;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public class UserDO extends BaseDO {
|
|||
private Long corpinfoId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@TableField(exist = false)
|
||||
private String corpinfoName;
|
||||
//是否主账号1是0否
|
||||
@ApiModelProperty(value = "是否主账号1是0否")
|
||||
|
|
@ -45,12 +46,15 @@ public class UserDO extends BaseDO {
|
|||
private Long departmentId;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@TableField(exist = false)
|
||||
|
||||
private String departmentName;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位id")
|
||||
private Long postId;
|
||||
//岗位id
|
||||
@ApiModelProperty(value = "岗位名称")
|
||||
@TableField(exist = false)
|
||||
private String postName;
|
||||
//角色id
|
||||
@ApiModelProperty(value = "角色id")
|
||||
|
|
|
|||
Loading…
Reference in New Issue