Browse Source

添加企业定位细节

master
zy 2 months ago
parent
commit
b494af3443
  1. 22
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  2. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

22
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java

@ -138,8 +138,24 @@ public class EnterpriseController {
}
//获取标签
final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
enterprise.setTagList(tagLibraryDOS.stream().map(item->item.getTagName()).collect(Collectors.toList()));
// final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
// enterprise.setTagList(tagLibraryDOS.stream().map(item->item.getTagName()).collect(Collectors.toList()));
// 获取标签
List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterprise.getId());
if (tagLibraryDOS != null) {
enterprise.setTagList(tagLibraryDOS.stream()
.map(TagLibraryDO::getTagName)
.collect(Collectors.toList()));
} else {
// 处理 tagLibraryDOS 为 null 的情况,这里可以设置一个空列表
enterprise.setTagList(Collections.emptyList());
}
//通过userID获取专管人
enterprise.setInviterName(adminUserService.getUser(Long.valueOf(enterprise.getUserId())).getNickname());
//获取资质
LambdaQueryWrapper<EnterpriseQualificationDO> queryWrapper = new LambdaQueryWrapper<>();
@ -163,7 +179,7 @@ public class EnterpriseController {
enterprise.setQualificationList(enterpriseQualificationList);
}
//获取企业标签
return success(BeanUtils.toBean(enterprise, EnterpriseRespVO.class));
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

@ -59,6 +59,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
private EnterpriseTagMapper enterpriseTagMapper;
@Resource
private UserRoleMapper userRoleMapper;
@Resource
private AdminUserService adminUserService;
@Override
@Transactional
@ -106,8 +108,14 @@ public class EnterpriseServiceImpl implements EnterpriseService {
@Override
@Transactional
public Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO) {
//专管员所属部门
final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
createReqVO.setDeptId(user.getDeptId());
EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class);
enterprise.setDepartmentId(1L);
enterprise.setDepartmentId(createReqVO.getDeptId());
enterpriseMapper.insert(enterprise);
if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) {

Loading…
Cancel
Save