|
@ -24,10 +24,13 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
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.redis.common.bean.GridInfoCache; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
import com.epmet.commons.tools.utils.*; |
|
|
import com.epmet.commons.tools.utils.*; |
|
@ -38,16 +41,16 @@ import com.epmet.dto.IcPartyActivityDTO; |
|
|
import com.epmet.dto.IcPartyUnitDTO; |
|
|
import com.epmet.dto.IcPartyUnitDTO; |
|
|
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
import com.epmet.dto.form.ImportTaskCommonFormDTO; |
|
|
import com.epmet.dto.form.PartyActivityFormDTO; |
|
|
import com.epmet.dto.form.PartyActivityFormDTO; |
|
|
import com.epmet.dto.result.ActivityStatisticsDTO; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; |
|
|
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
import com.epmet.entity.IcActivityServiceRelationEntity; |
|
|
import com.epmet.entity.IcActivityServiceRelationEntity; |
|
|
import com.epmet.entity.IcActivityUnitRelationEntity; |
|
|
import com.epmet.entity.IcActivityUnitRelationEntity; |
|
|
import com.epmet.entity.IcPartyActivityEntity; |
|
|
import com.epmet.entity.IcPartyActivityEntity; |
|
|
|
|
|
import com.epmet.entity.IcPartyActivitySignUpRecordEntity; |
|
|
import com.epmet.excel.IcPartyActivityImportExcel; |
|
|
import com.epmet.excel.IcPartyActivityImportExcel; |
|
|
import com.epmet.excel.handler.IcPartyActivityImportListener; |
|
|
import com.epmet.excel.handler.IcPartyActivityImportListener; |
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.OssFeignClient; |
|
|
import com.epmet.feign.OssFeignClient; |
|
|
import com.epmet.service.*; |
|
|
import com.epmet.service.*; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
@ -86,8 +89,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
|
|
|
|
|
|
@Resource |
|
|
@Resource |
|
|
private IcPartyUnitService icPartyUnitService; |
|
|
private IcPartyUnitService icPartyUnitService; |
|
|
@Resource |
|
|
// @Resource
|
|
|
private IcServiceItemDictService icServiceItemDictService; |
|
|
// private IcServiceItemDictService icServiceItemDictService;
|
|
|
@Resource |
|
|
@Resource |
|
|
private IcActivityUnitRelationService icActivityUnitRelationService; |
|
|
private IcActivityUnitRelationService icActivityUnitRelationService; |
|
|
@Resource |
|
|
@Resource |
|
@ -98,6 +101,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|
|
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcPartyActivitySignUpRecordDao partyActivitySignUpRecordDao; |
|
|
private IcPartyActivitySignUpRecordDao partyActivitySignUpRecordDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -144,7 +149,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
List<String> serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); |
|
|
List<String> serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); |
|
|
List<String> serviceMatterNameList=new ArrayList<>(); |
|
|
List<String> serviceMatterNameList=new ArrayList<>(); |
|
|
for(String id:serviceMatterid){ |
|
|
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)){ |
|
|
if(StringUtils.isNotBlank(categoryName)){ |
|
|
serviceMatterNameList.add(categoryName); |
|
|
serviceMatterNameList.add(categoryName); |
|
|
} |
|
|
} |
|
@ -206,7 +211,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); |
|
|
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)); |
|
|
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
List<String> services = icActivityServiceRelationService.getServiceList(id); |
|
|
List<String> services = icActivityServiceRelationService.getServiceList(id); |
|
|
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); |
|
|
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); |
|
@ -340,7 +345,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
//获取联建单位
|
|
|
//获取联建单位
|
|
|
Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
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)); |
|
|
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); |
|
|
//数据组装
|
|
|
//数据组装
|
|
|
dtoList.forEach(dto -> { |
|
|
dtoList.forEach(dto -> { |
|
@ -528,4 +533,95 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD |
|
|
PageInfo<PartyActivitySignUpRecordResDTO> pageInfo = new PageInfo<>(list); |
|
|
PageInfo<PartyActivitySignUpRecordResDTO> pageInfo = new PageInfo<>(list); |
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 居民端钉钉,报名联建活动 |
|
|
|
|
|
* |
|
|
|
|
|
* @param activityId |
|
|
|
|
|
* @param userId |
|
|
|
|
|
* @param gridId |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public String signUp(String activityId, String userId, String gridId) { |
|
|
|
|
|
LambdaQueryWrapper<IcPartyActivitySignUpRecordEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId) |
|
|
|
|
|
.eq(IcPartyActivitySignUpRecordEntity::getUserId, userId) |
|
|
|
|
|
.select(IcPartyActivitySignUpRecordEntity::getId); |
|
|
|
|
|
IcPartyActivitySignUpRecordEntity entity = partyActivitySignUpRecordDao.selectOne(queryWrapper); |
|
|
|
|
|
if (null != entity) { |
|
|
|
|
|
return entity.getId(); |
|
|
|
|
|
} |
|
|
|
|
|
// 查询网格名称
|
|
|
|
|
|
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(gridId); |
|
|
|
|
|
if (null == gridInfoCache) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "网格信息查询异常"); |
|
|
|
|
|
} |
|
|
|
|
|
// 查询用户姓名和手机号
|
|
|
|
|
|
List<String> userIdList=new ArrayList<>(); |
|
|
|
|
|
userIdList.add(userId); |
|
|
|
|
|
Result<List<UserBaseInfoResultDTO>> userRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
|
|
if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常gridId:" + gridId, "查询用户信息异常"); |
|
|
|
|
|
} |
|
|
|
|
|
UserBaseInfoResultDTO userBaseInfoResultDTO=userRes.getData().get(NumConstant.ZERO); |
|
|
|
|
|
IcPartyActivitySignUpRecordEntity insert = new IcPartyActivitySignUpRecordEntity(); |
|
|
|
|
|
insert.setActivityId(activityId); |
|
|
|
|
|
insert.setCustomerId(EpmetRequestHolder.getLoginUserCustomerId()); |
|
|
|
|
|
insert.setGridId(gridId); |
|
|
|
|
|
insert.setGridName(gridInfoCache.getGridNamePath()); |
|
|
|
|
|
insert.setUserId(userId); |
|
|
|
|
|
insert.setUserName(userBaseInfoResultDTO.getRealName()); |
|
|
|
|
|
insert.setMobile(userBaseInfoResultDTO.getMobile()); |
|
|
|
|
|
insert.setSignUpTime(new Date()); |
|
|
|
|
|
partyActivitySignUpRecordDao.insert(insert); |
|
|
|
|
|
return insert.getId(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 居民端钉钉,查看联建活动详情 |
|
|
|
|
|
* |
|
|
|
|
|
* @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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|