|
@ -24,7 +24,9 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
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.enums.DictTypeEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
@ -42,7 +44,9 @@ import com.epmet.dto.form.demand.*; |
|
|
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|
|
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
import com.epmet.dto.result.demand.DemandRecResultDTO; |
|
|
import com.epmet.dto.result.demand.DemandRecResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.demand.IcResiUserReportDemandRes; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.entity.*; |
|
|
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.service.IcResiDemandDictService; |
|
|
import com.epmet.service.IcResiDemandDictService; |
|
@ -50,6 +54,7 @@ import com.epmet.service.IcUserDemandRecService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -79,7 +84,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
private IcResiDemandDictService demandDictService; |
|
|
private IcResiDemandDictService demandDictService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) { |
|
|
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) { |
|
@ -238,6 +244,17 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
} |
|
|
} |
|
|
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); |
|
|
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//查询字典表
|
|
|
|
|
|
Result<Map<String, String>> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); |
|
|
|
|
|
Map<String,String> reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
Result<Map<String, String>> statusRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
|
|
Map<String,String> statusMap=statusRes.success()&& MapUtils.isNotEmpty(statusRes.getData())?statusRes.getData():new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
Result<Map<String, String>> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); |
|
|
|
|
|
Map<String,String> serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>(); |
|
|
|
|
|
|
|
|
for(DemandRecResultDTO res:list){ |
|
|
for(DemandRecResultDTO res:list){ |
|
|
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { |
|
|
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { |
|
|
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); |
|
|
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); |
|
@ -246,12 +263,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { |
|
|
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) { |
|
|
res.setCategoryName(dictMap.get(res.getCategoryCode())); |
|
|
res.setCategoryName(dictMap.get(res.getCategoryCode())); |
|
|
} |
|
|
} |
|
|
|
|
|
res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode())); |
|
|
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { |
|
|
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) { |
|
|
res.setServiceName(userInfoMap.get(res.getServerId())); |
|
|
res.setServiceName(userInfoMap.get(res.getServerId())); |
|
|
} |
|
|
} |
|
|
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
|
|
|
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
|
|
|
switch(res.getReportType()){ |
|
|
res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR); |
|
|
|
|
|
/*switch(res.getReportType()){ |
|
|
case UserDemandConstant.COMMUNITY_REPORT : |
|
|
case UserDemandConstant.COMMUNITY_REPORT : |
|
|
res.setReportTypeName("社区帮办"); |
|
|
res.setReportTypeName("社区帮办"); |
|
|
break; |
|
|
break; |
|
@ -264,9 +282,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
case UserDemandConstant.SELF_HELP_REPORT : |
|
|
case UserDemandConstant.SELF_HELP_REPORT : |
|
|
res.setReportTypeName("自身上报"); |
|
|
res.setReportTypeName("自身上报"); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
}*/ |
|
|
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
|
|
|
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
|
|
|
switch(res.getStatus()){ |
|
|
res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR); |
|
|
|
|
|
/*switch(res.getStatus()){ |
|
|
case UserDemandConstant.PENDING : |
|
|
case UserDemandConstant.PENDING : |
|
|
res.setStatusName("待处理"); |
|
|
res.setStatusName("待处理"); |
|
|
break; |
|
|
break; |
|
@ -282,9 +301,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
case UserDemandConstant.FINISHED : |
|
|
case UserDemandConstant.FINISHED : |
|
|
res.setStatusName("已完成"); |
|
|
res.setStatusName("已完成"); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
}*/ |
|
|
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
switch(res.getServiceType()){ |
|
|
res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR); |
|
|
|
|
|
/*switch(res.getServiceType()){ |
|
|
case UserDemandConstant.VOLUNTEER : |
|
|
case UserDemandConstant.VOLUNTEER : |
|
|
res.setServiceShowName(res.getServiceName().concat("(志愿者)")); |
|
|
res.setServiceShowName(res.getServiceName().concat("(志愿者)")); |
|
|
break; |
|
|
break; |
|
@ -297,7 +317,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
case UserDemandConstant.PARTY_UNIT : |
|
|
case UserDemandConstant.PARTY_UNIT : |
|
|
res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); |
|
|
res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)")); |
|
|
break; |
|
|
break; |
|
|
} |
|
|
}*/ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
@ -437,4 +457,100 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
demandSatisfactionDao.insert(satisfactionEntity); |
|
|
demandSatisfactionDao.insert(satisfactionEntity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 数据分析-个人档案,居民需求列表table |
|
|
|
|
|
* |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public PageData<IcResiUserReportDemandRes> queryMyDemand(IcResiUserDemandFromDTO formDTO) { |
|
|
|
|
|
/*//1、查询当前居民在小程序里是否有用户id
|
|
|
|
|
|
ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); |
|
|
|
|
|
resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
resiUserFormDTO.setIcResiUserId(formDTO.getUserId()); |
|
|
|
|
|
Result<ResiUserResDTO> userRes=epmetUserOpenFeignClient.findUser(resiUserFormDTO); |
|
|
|
|
|
if(!userRes.success()){ |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"/epmetuser/user/finduser接口异常","查找居民端小程序用户信息异常"); |
|
|
|
|
|
} |
|
|
|
|
|
formDTO.setEpmetUserId(userRes.getData().getEpmetUserId());*/ |
|
|
|
|
|
//icresiuser/persondata接口已经返回去epmetUserId,这里就不需要再查询了。直接让前端传过来
|
|
|
|
|
|
|
|
|
|
|
|
//2、小程序内自己上报+赋能平台待录入的
|
|
|
|
|
|
PageInfo<IcResiUserReportDemandRes> pageInfo = PageHelper.startPage(formDTO.getPageNo(), |
|
|
|
|
|
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO)); |
|
|
|
|
|
List<IcResiUserReportDemandRes> list = pageInfo.getList(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|
|
// 1、状态字典
|
|
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
|
|
//2、查询分类名称
|
|
|
|
|
|
List<String> categoryCodes = list.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); |
|
|
|
|
|
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); |
|
|
|
|
|
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); |
|
|
|
|
|
|
|
|
|
|
|
for (IcResiUserReportDemandRes resDto : list) { |
|
|
|
|
|
resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); |
|
|
|
|
|
if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { |
|
|
|
|
|
resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 数据分析-个人档案、居民需求列表-查看需求详情 |
|
|
|
|
|
* |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO) { |
|
|
|
|
|
DemandRecResultDTO res = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId()); |
|
|
|
|
|
if (null != res) { |
|
|
|
|
|
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); |
|
|
|
|
|
customerGridFormDTO.setGridId(res.getGridId()); |
|
|
|
|
|
Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); |
|
|
|
|
|
res.setGridName(gridInfoRes.success() && null != gridInfoRes.getData() ? gridInfoRes.getData().getGridNamePath() : StrConstant.EPMETY_STR); |
|
|
|
|
|
|
|
|
|
|
|
res.setCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getCategoryCode())); |
|
|
|
|
|
res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),res.getFirstCategoryCode())); |
|
|
|
|
|
if (UserDemandConstant.VOLUNTEER.equals(res.getServiceType())) { |
|
|
|
|
|
// 如果服务方是志愿者,需要查询小程序端的志愿者姓名
|
|
|
|
|
|
List<String> userIdList = Arrays.asList(res.getServerId()); |
|
|
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); |
|
|
|
|
|
if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常"); |
|
|
|
|
|
} |
|
|
|
|
|
res.setServiceName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); |
|
|
|
|
|
} |
|
|
|
|
|
//查询字典表
|
|
|
|
|
|
Result<Map<String, String>> reportTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); |
|
|
|
|
|
Map<String, String> reportTypeMap = reportTypeRes.success() && MapUtils.isNotEmpty(reportTypeRes.getData()) ? reportTypeRes.getData() : new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
Result<Map<String, String>> serviceTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); |
|
|
|
|
|
Map<String, String> serviceTypeMap = serviceTypeRes.success() && MapUtils.isNotEmpty(serviceTypeRes.getData()) ? serviceTypeRes.getData() : new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
|
|
|
|
|
|
res.setReportTypeName(reportTypeMap.containsKey(res.getReportType()) ? reportTypeMap.get(res.getReportType()) : StrConstant.EPMETY_STR); |
|
|
|
|
|
|
|
|
|
|
|
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
|
|
|
|
|
|
res.setStatusName(statusMap.containsKey(res.getStatus()) ? statusMap.get(res.getStatus()) : StrConstant.EPMETY_STR); |
|
|
|
|
|
|
|
|
|
|
|
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
|
|
|
res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType()) ? res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")") : StrConstant.EPMETY_STR); |
|
|
|
|
|
} |
|
|
|
|
|
return res; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |