@@ -37,6 +37,8 @@ import com.ningdatech.pmapi.meeting.service.*; | |||||
import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; | import com.ningdatech.pmapi.meeting.task.ExpertInviteTask; | ||||
import com.ningdatech.pmapi.meta.helper.DictionaryCache; | import com.ningdatech.pmapi.meta.helper.DictionaryCache; | ||||
import com.ningdatech.pmapi.meta.helper.TagCache; | import com.ningdatech.pmapi.meta.helper.TagCache; | ||||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | |||||
import com.ningdatech.pmapi.organization.service.IGovBusinessStripService; | |||||
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; | ||||
@@ -85,13 +87,15 @@ public class MeetingManage { | |||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private final IMeetingInnerProjectService meetingInnerProjectService; | private final IMeetingInnerProjectService meetingInnerProjectService; | ||||
private final IMeetingOuterProjectService meetingOuterProjectService; | private final IMeetingOuterProjectService meetingOuterProjectService; | ||||
private final IGovBusinessStripService businessStripService; | |||||
private final IDingOrganizationService dingOrganizationService; | |||||
private final ExpertInviteHelper expertInviteHelper; | private final ExpertInviteHelper expertInviteHelper; | ||||
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; | private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; | ||||
private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | ||||
private String getDictName(String dictType){ | |||||
private String getDictName(String dictType) { | |||||
return Optional.ofNullable(dictionaryCache.getByCode(dictType)) | return Optional.ofNullable(dictionaryCache.getByCode(dictType)) | ||||
.flatMap(w -> Optional.of(w.getName())) | .flatMap(w -> Optional.of(w.getName())) | ||||
.orElse(StrPool.EMPTY); | .orElse(StrPool.EMPTY); | ||||
@@ -507,6 +511,12 @@ public class MeetingManage { | |||||
AvoidInfoVO vo = new AvoidInfoVO(); | AvoidInfoVO vo = new AvoidInfoVO(); | ||||
vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList()); | vo.setAvoidOrgIds(avoidInfo.getAvoidOrgIdList()); | ||||
vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); | vo.setAvoidUnitIds(avoidInfo.getAvoidUnitIdList()); | ||||
if (CollUtil.isNotEmpty(vo.getAvoidOrgIds())) { | |||||
vo.setAvoidOrgs(businessStripService.listNameByCodes(avoidInfo.getAvoidOrgIdList())); | |||||
} | |||||
if (CollUtil.isNotEmpty(vo.getAvoidUnits())) { | |||||
vo.setAvoidUnits(dingOrganizationService.listNameByCodes(avoidInfo.getAvoidUnitIdList())); | |||||
} | |||||
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { | if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) { | ||||
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); | vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values())); | ||||
} | } | ||||
@@ -3,6 +3,9 @@ package com.ningdatech.pmapi.organization.service; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | ||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务类 | * 服务类 | ||||
@@ -15,6 +18,7 @@ public interface IDingOrganizationService extends IService<DingOrganization> { | |||||
/** | /** | ||||
* 根据组织code查询组织信息 | * 根据组织code查询组织信息 | ||||
* | |||||
* @param orgCode | * @param orgCode | ||||
* @return | * @return | ||||
*/ | */ | ||||
@@ -22,8 +26,28 @@ public interface IDingOrganizationService extends IService<DingOrganization> { | |||||
/** | /** | ||||
* 根据组织code查询父组织信息 | * 根据组织code查询父组织信息 | ||||
* | |||||
* @param orgCode | * @param orgCode | ||||
* @return | * @return | ||||
*/ | */ | ||||
DingOrganization getParentOrganization(String orgCode); | DingOrganization getParentOrganization(String orgCode); | ||||
/** | |||||
* 批量查询单位信息 | |||||
* | |||||
* @param codes 单位编码 | |||||
* @return 单位信息 | |||||
* @author WendyYang | |||||
**/ | |||||
List<DingOrganization> listByCodes(Collection<String> codes); | |||||
/** | |||||
* 批量查询单位名称 | |||||
* | |||||
* @param codes 单位编码 | |||||
* @return 单位信息 | |||||
* @author WendyYang | |||||
**/ | |||||
List<String> listNameByCodes(Collection<String> codes); | |||||
} | } |
@@ -1,11 +1,20 @@ | |||||
package com.ningdatech.pmapi.organization.service; | package com.ningdatech.pmapi.organization.service; | ||||
import com.ningdatech.pmapi.organization.entity.GovBusinessStrip; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.basic.util.StrPool; | |||||
import com.ningdatech.pmapi.organization.entity.GovBusinessStrip; | |||||
import java.util.Collection; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.Optional; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务类 | |||||
* 服务类 | |||||
* </p> | * </p> | ||||
* | * | ||||
* @author Liuxinxin | * @author Liuxinxin | ||||
@@ -13,4 +22,53 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
*/ | */ | ||||
public interface IGovBusinessStripService extends IService<GovBusinessStrip> { | public interface IGovBusinessStripService extends IService<GovBusinessStrip> { | ||||
/** | |||||
* 根据code查询名称 | |||||
* | |||||
* @param codes 条线编码 | |||||
* @return 条线名称 | |||||
* @author WendyYang | |||||
**/ | |||||
default List<String> listNameByCodes(Collection<String> codes) { | |||||
return CollUtils.fieldList(listByCodes(codes), GovBusinessStrip::getBusinessStripName); | |||||
} | |||||
/** | |||||
* 根据code查询条线 | |||||
* | |||||
* @param codes 条线编码 | |||||
* @return 条线名称 | |||||
* @author WendyYang | |||||
**/ | |||||
default List<GovBusinessStrip> listByCodes(Collection<String> codes) { | |||||
LambdaQueryWrapper<GovBusinessStrip> query = Wrappers.lambdaQuery(GovBusinessStrip.class) | |||||
.in(GovBusinessStrip::getBusinessStripCode, codes); | |||||
return list(query); | |||||
} | |||||
/** | |||||
* 根据code查询名称 | |||||
* | |||||
* @param code 条线编码 | |||||
* @return 条线名称 | |||||
* @author WendyYang | |||||
**/ | |||||
default String getNameByCode(String code) { | |||||
return Optional.ofNullable(getByCode(code)) | |||||
.flatMap(w -> Optional.of(w.getBusinessStripName())) | |||||
.orElse(StrPool.EMPTY); | |||||
} | |||||
/** | |||||
* 根据code查询名称 | |||||
* | |||||
* @param code 条线编码 | |||||
* @return 条线名称 | |||||
* @author WendyYang | |||||
**/ | |||||
default GovBusinessStrip getByCode(String code) { | |||||
List<GovBusinessStrip> strips = listByCodes(Collections.singletonList(code)); | |||||
return strips.isEmpty() ? null : strips.get(0); | |||||
} | |||||
} | } |
@@ -1,13 +1,18 @@ | |||||
package com.ningdatech.pmapi.organization.service.impl; | package com.ningdatech.pmapi.organization.service.impl; | ||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.pmapi.organization.mapper.DingOrganizationMapper; | import com.ningdatech.pmapi.organization.mapper.DingOrganizationMapper; | ||||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | ||||
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | import com.ningdatech.pmapi.organization.service.IDingOrganizationService; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.Collection; | |||||
import java.util.List; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
* 服务实现类 | * 服务实现类 | ||||
@@ -37,4 +42,20 @@ public class DingOrganizationServiceImpl extends ServiceImpl<DingOrganizationMap | |||||
String parentCode = dingOrganization.getParentCode(); | String parentCode = dingOrganization.getParentCode(); | ||||
return getByOrgCode(parentCode); | return getByOrgCode(parentCode); | ||||
} | } | ||||
@Override | |||||
public List<DingOrganization> listByCodes(Collection<String> codes) { | |||||
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class) | |||||
.eq(DingOrganization::getOrganizationCode, codes); | |||||
return list(query); | |||||
} | |||||
@Override | |||||
public List<String> listNameByCodes(Collection<String> codes) { | |||||
LambdaQueryWrapper<DingOrganization> query = Wrappers.lambdaQuery(DingOrganization.class) | |||||
.select(DingOrganization::getOrganizationName) | |||||
.eq(DingOrganization::getOrganizationCode, codes); | |||||
return CollUtils.fieldList(list(query), DingOrganization::getOrganizationName); | |||||
} | |||||
} | } |