|
|
@ -30,6 +30,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
@ -40,10 +41,7 @@ import com.epmet.dto.IcPartyActivityDTO; |
|
|
|
import com.epmet.dto.IcPartyUnitDTO; |
|
|
|
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
|
import com.epmet.dto.form.PartyActivityFormDTO; |
|
|
|
import com.epmet.dto.result.ActivityStatisticsDTO; |
|
|
|
import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; |
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.entity.IcActivityServiceRelationEntity; |
|
|
|
import com.epmet.entity.IcActivityUnitRelationEntity; |
|
|
@ -91,8 +89,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
|
|
|
|
@Resource |
|
|
|
private IcPartyUnitService icPartyUnitService; |
|
|
|
@Resource |
|
|
|
private IcServiceItemDictService icServiceItemDictService; |
|
|
|
// @Resource
|
|
|
|
// private IcServiceItemDictService icServiceItemDictService;
|
|
|
|
@Resource |
|
|
|
private IcActivityUnitRelationService icActivityUnitRelationService; |
|
|
|
@Resource |
|
|
@ -151,7 +149,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
List<String> serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); |
|
|
|
List<String> serviceMatterNameList=new ArrayList<>(); |
|
|
|
for(String id:serviceMatterid){ |
|
|
|
String categoryName=icServiceItemDictService.getCategoryName(dto.getCustomerId(),id); |
|
|
|
String categoryName=SpringContextUtils.getBean(IcServiceItemDictService.class).getCategoryName(dto.getCustomerId(),id); |
|
|
|
if(StringUtils.isNotBlank(categoryName)){ |
|
|
|
serviceMatterNameList.add(categoryName); |
|
|
|
} |
|
|
@ -213,7 +211,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); |
|
|
|
|
|
|
|
//获取服务事项
|
|
|
|
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(entity.getCustomerId()); |
|
|
|
List<OptionDTO> serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(entity.getCustomerId()); |
|
|
|
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
List<String> services = icActivityServiceRelationService.getServiceList(id); |
|
|
|
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); |
|
|
@ -347,7 +345,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
//获取联建单位
|
|
|
|
Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
//获取服务事项字典
|
|
|
|
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); |
|
|
|
List<OptionDTO> serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(tokenDto.getCustomerId()); |
|
|
|
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
|
//数据组装
|
|
|
|
dtoList.forEach(dto -> { |
|
|
@ -580,6 +578,50 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 居民端钉钉,查看联建活动详情 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param userId |
|
|
|
* @param activityId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PartyActivityResDTO queryActDetailForResi(String customerId, String userId, String activityId) { |
|
|
|
IcPartyActivityEntity activityEntity = baseDao.selectById(activityId); |
|
|
|
if (null == activityEntity) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "联建活动不存在,activityId:" + activityId, "联建活动不存在"); |
|
|
|
} |
|
|
|
PartyActivityResDTO resDTO = ConvertUtils.sourceToTarget(activityEntity, PartyActivityResDTO.class); |
|
|
|
resDTO.setSignUpFlag(false); |
|
|
|
resDTO.setActivityId(activityId); |
|
|
|
|
|
|
|
// 当前用户是否报名
|
|
|
|
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId) |
|
|
|
.eq(IcPartyActivitySignUpRecordEntity::getUserId, userId) |
|
|
|
.select(IcPartyActivitySignUpRecordEntity::getId); |
|
|
|
IcPartyActivitySignUpRecordEntity signUpRecordEntity = partyActivitySignUpRecordDao.selectOne(queryWrapper); |
|
|
|
if (null != signUpRecordEntity) { |
|
|
|
resDTO.setSignUpId(signUpRecordEntity.getId()); |
|
|
|
resDTO.setSignUpFlag(true); |
|
|
|
} |
|
|
|
// 主办方:组织名称
|
|
|
|
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId()); |
|
|
|
if (null != agencyInfoCache) { |
|
|
|
resDTO.setAgencyName(agencyInfoCache.getOrganizationName()); |
|
|
|
} |
|
|
|
// 联建单位:
|
|
|
|
resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(activityId)); |
|
|
|
// 服务事项
|
|
|
|
resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(activityId,activityEntity.getCustomerId())); |
|
|
|
// 报名总人数
|
|
|
|
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> countWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId); |
|
|
|
resDTO.setSignUpCount(partyActivitySignUpRecordDao.selectCount(countWrapper)); |
|
|
|
return resDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|