Merge remote-tracking branch 'origin/main' into main
commit
068cdffaef
|
|
@ -50,8 +50,11 @@ public class CorpInfoGatewayImpl implements CorpInfoGateway {
|
|||
if(!CorpInfoE.isCorp()){
|
||||
d.setAccountContactId(AuthContext.getUserId());
|
||||
d.setAccountContactName(AuthContext.getName());
|
||||
CorpInfoDO corpInfoDO = corpInfoRepository.getById(AuthContext.getTenantId());
|
||||
d.setTenantName(corpInfoDO.getCorpName());
|
||||
}else{
|
||||
d.setTenantName(AuthContext.getCurrentUser().getTenantName());
|
||||
}
|
||||
d.setTenantName(AuthContext.getCurrentUser().getTenantName());
|
||||
corpInfoRepository.saveCorp(d);
|
||||
// corpInfoRepository.save(d);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@ package com.zcloud.basic.info.persistence.repository.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
|
@ -28,6 +30,7 @@ import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
|||
import com.zcloud.basic.info.utils.Query;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -46,6 +49,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, CorpInfoDO> implements CorpInfoRepository {
|
||||
private final CorpInfoMapper corpInfoMapper;
|
||||
|
||||
|
|
@ -64,12 +68,12 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if(CollUtil.isNotEmpty(enterpriseType)){
|
||||
queryWrapper.in("type",enterpriseType );
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
queryWrapper.in("type", enterpriseType);
|
||||
}
|
||||
queryWrapper.orderByAsc("corp_order").orderByDesc("create_time");
|
||||
String menuPerms = "";
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))){
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))) {
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
|
|
@ -82,8 +86,8 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if(CollUtil.isNotEmpty(enterpriseType)){
|
||||
queryWrapper.in("type",enterpriseType );
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
queryWrapper.in("type", enterpriseType);
|
||||
}
|
||||
queryWrapper.orderByAsc("corp_order").orderByDesc("create_time");
|
||||
return corpInfoMapper.selectList(queryWrapper);
|
||||
|
|
@ -118,12 +122,17 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
ouac.setAccount(corpInfoDO.getCorpName());
|
||||
ouac.setTenantId(tenantId);
|
||||
ouac.setPassword(corpInfoDO.getPassword());
|
||||
try {
|
||||
SingleResponse<Long> corpId = unitFacade.add(ouac);
|
||||
corpInfoDO.setId(corpId.getData());
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
// try {
|
||||
log.info("创建企业请求底座请求:{}", JSONUtil.toJsonStr(ouac));
|
||||
SingleResponse<Long> corpId = unitFacade.add(ouac);
|
||||
log.info("创建企业请求底座返回:{}", JSONUtil.toJsonStr(corpId));
|
||||
if (corpId.getData() == null) {
|
||||
throw new BizException("底座添加失败");
|
||||
}
|
||||
corpInfoDO.setId(corpId.getData());
|
||||
// } catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
save(corpInfoDO);
|
||||
|
||||
|
|
@ -176,7 +185,7 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
public Long checkCorpName(Map<String, Object> parmas) {
|
||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("corp_name", parmas.get("corpName"));
|
||||
if(!ObjectUtil.isEmpty(parmas.get("id"))){
|
||||
if (!ObjectUtil.isEmpty(parmas.get("id"))) {
|
||||
queryWrapper.ne("id", parmas.get("id"));
|
||||
}
|
||||
|
||||
|
|
@ -186,21 +195,21 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
|||
@Override
|
||||
public PageResponse<CorpInfoDO> corpUserMiddlePage(Map<String, Object> params) {
|
||||
IPage<CorpInfoDO> iPage = new Query<CorpInfoDO>().getPage(params);
|
||||
if(ObjectUtil.isNotEmpty(params.get("eqType"))){
|
||||
if (ObjectUtil.isNotEmpty(params.get("eqType"))) {
|
||||
params.put("type", Arrays.asList(params.get("eqType")));
|
||||
}else{
|
||||
if(ObjectUtil.isNotEmpty(params.get("enterpriseType"))){
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(params.get("enterpriseType"))) {
|
||||
List<Integer> enterpriseType = CorpTypeEnum.getCodesByEnterpriseType((Integer) params.get("enterpriseType"));
|
||||
if(CollUtil.isNotEmpty(enterpriseType)){
|
||||
if (CollUtil.isNotEmpty(enterpriseType)) {
|
||||
params.put("type", enterpriseType);
|
||||
}
|
||||
}
|
||||
}
|
||||
String menuPerms = "";
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))){
|
||||
if (!ObjectUtils.isEmpty(params.get("menuPath"))) {
|
||||
menuPerms = MenuEnum.getMenuKeyByPath(params.get("menuPath").toString());
|
||||
}
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.corpUserMiddlePage(iPage,params, menuPerms);
|
||||
IPage<CorpInfoDO> result = corpInfoMapper.corpUserMiddlePage(iPage, params, menuPerms);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue