|
|
@ -27,10 +27,15 @@ 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.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
|
|
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
|
|
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
import com.epmet.constant.UserDemandConstant; |
|
|
|
import com.epmet.constant.UserMessageTypeConstant; |
|
|
@ -56,6 +61,7 @@ import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
@ -96,6 +102,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
private IcCommunitySelfOrganizationService communitySelfOrganizationService; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|
|
|
@Value("${openapi.scan.server.url}") |
|
|
|
private String scanApiUrl; |
|
|
|
@Value("${openapi.scan.method.textSyncScan}") |
|
|
|
private String textSyncScanMethod; |
|
|
|
@Autowired |
|
|
|
private IcUserDemandSatisfactionService icUserDemandSatisfactionService; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public IcUserDemandRecDTO get(String id) { |
|
|
@ -266,7 +281,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
//3、查询志愿者
|
|
|
|
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
|
Map<String,String> userInfoMap=new HashMap<>(); |
|
|
|
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
if(CollectionUtils.isNotEmpty(userIdList)){ |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); |
|
|
|
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ |
|
|
@ -358,6 +373,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
//待处理+已派单才可以指派
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可指派",entity.getStatus()),"当前状态,不可指派"); |
|
|
|
} |
|
|
|
if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType()) && formDTO.getServerId().equals(entity.getDemandUserId())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("居民端用户上报的需求【%s】,需求人与服务方(志愿者)不能同为一人", entity.getId()), "需求人与服务方不能同为一人"); |
|
|
|
} |
|
|
|
//1、修改主表
|
|
|
|
//置为已派单
|
|
|
|
entity.setStatus(UserDemandConstant.ASSIGNED); |
|
|
@ -394,53 +412,65 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
@Override |
|
|
|
public FinishResultDTO finish(FinishStaffFromDTO formDTO) { |
|
|
|
IcUserDemandRecEntity entity = checkFinishPreCondition(formDTO.getDemandRecId()); |
|
|
|
|
|
|
|
//1、插入完成操作日志
|
|
|
|
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class); |
|
|
|
logEntity.setActionCode(UserDemandConstant.FINISH); |
|
|
|
logEntity.setOperateTime(new Date()); |
|
|
|
operateLogDao.insert(logEntity); |
|
|
|
|
|
|
|
|
|
|
|
//2、更新服务记录,记录实际开始,实际结束时间
|
|
|
|
//查询服务记录
|
|
|
|
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId()); |
|
|
|
if(null==serviceEntity){ |
|
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "服务记录不存在", EpmetErrorCode.SERVER_ERROR.getMsg()); |
|
|
|
} |
|
|
|
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); |
|
|
|
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); |
|
|
|
demandServiceDao.updateById(serviceEntity); |
|
|
|
|
|
|
|
// 3、pc完成情况:完成+评价
|
|
|
|
FinishResultDTO finishResultDTO=new FinishResultDTO(); |
|
|
|
finishResultDTO.setServerId(serviceEntity.getServerId()); |
|
|
|
finishResultDTO.setServiceType(serviceEntity.getServiceType()); |
|
|
|
Date nowDate=new Date(); |
|
|
|
if(!UserDemandConstant.FINISHED.equals(entity.getStatus())){ |
|
|
|
//1、插入完成操作日志
|
|
|
|
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class); |
|
|
|
logEntity.setActionCode(UserDemandConstant.FINISH); |
|
|
|
logEntity.setOperateTime(nowDate); |
|
|
|
operateLogDao.insert(logEntity); |
|
|
|
|
|
|
|
|
|
|
|
//1.2、更新服务记录,记录实际开始,实际结束时间
|
|
|
|
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); |
|
|
|
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); |
|
|
|
demandServiceDao.updateById(serviceEntity); |
|
|
|
//1.3、修改主表状态为已完成
|
|
|
|
entity.setStatus(UserDemandConstant.FINISHED); |
|
|
|
} |
|
|
|
// 2、pc完成情况:完成+评价
|
|
|
|
if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){ |
|
|
|
//3.1、插入评价得分记录
|
|
|
|
//2.1、插入评价得分记录
|
|
|
|
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class); |
|
|
|
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime()); |
|
|
|
satisfactionEntity.setEvaluateTime(nowDate); |
|
|
|
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR); |
|
|
|
demandSatisfactionDao.insert(satisfactionEntity); |
|
|
|
|
|
|
|
// 3.2插入评价操作日志
|
|
|
|
IcUserDemandOperateLogEntity evaluateEntity=ConvertUtils.sourceToTarget(logEntity,IcUserDemandOperateLogEntity.class); |
|
|
|
// 2.2插入评价操作日志
|
|
|
|
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class); |
|
|
|
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); |
|
|
|
evaluateEntity.setOperateTime(nowDate); |
|
|
|
evaluateEntity.setId(null); |
|
|
|
operateLogDao.insert(evaluateEntity); |
|
|
|
|
|
|
|
//3.4更新主表已评价标识,是否解决标识。
|
|
|
|
//2.3更新主表已评价标识,是否解决标识。
|
|
|
|
entity.setEvaluateFlag(true); |
|
|
|
entity.setFinishResult(formDTO.getFinishResult()); |
|
|
|
|
|
|
|
//3.5如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
|
|
|
|
//2.4如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
|
|
|
|
sendVolunnterEvaluated(entity); |
|
|
|
} |
|
|
|
|
|
|
|
//4、修改主表状态为已完成
|
|
|
|
entity.setStatus(UserDemandConstant.FINISHED); |
|
|
|
finishResultDTO.setAwardPoint(entity.getAwardPoint()); |
|
|
|
finishResultDTO.setCategoryCode(entity.getCategoryCode()); |
|
|
|
finishResultDTO.setEvaluateFlag(entity.getEvaluateFlag()); |
|
|
|
if(StringUtils.isBlank(entity.getParentCode())||NumConstant.ZERO_STR.equals(entity.getParentCode())){ |
|
|
|
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getCategoryCode())); |
|
|
|
}else{ |
|
|
|
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode())); |
|
|
|
} |
|
|
|
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent(); |
|
|
|
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content)); |
|
|
|
} |
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
|
|
FinishResultDTO finishResultDTO=new FinishResultDTO(); |
|
|
|
finishResultDTO.setServerId(serviceEntity.getServerId()); |
|
|
|
finishResultDTO.setServiceType(serviceEntity.getServiceType()); |
|
|
|
finishResultDTO.setAwardPoint(entity.getAwardPoint()); |
|
|
|
// 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。
|
|
|
|
sendDemandUserFinished(entity); |
|
|
|
return finishResultDTO; |
|
|
@ -457,14 +487,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
if (null == entity) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); |
|
|
|
} |
|
|
|
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){ |
|
|
|
/*if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){ |
|
|
|
//已经完成
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务已完成,不可重复提交", "服务已完成,不可重复提交"); |
|
|
|
} |
|
|
|
if (!UserDemandConstant.ASSIGNED.equals(entity.getStatus()) && !UserDemandConstant.HAVE_ORDER.equals(entity.getStatus())) { |
|
|
|
//已指派、已抢单的才可以完成
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可点击服务完成",entity.getStatus()), "当前状态,不能确认服务完成"); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
@ -734,7 +764,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
//3、查询志愿者
|
|
|
|
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
|
|
|
|
Map<String,String> userInfoMap=new HashMap<>(); |
|
|
|
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
if(CollectionUtils.isNotEmpty(userIdList)){ |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); |
|
|
|
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ |
|
|
@ -896,15 +926,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
* 计算出服务方,评价总分,服务的需求个数 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param partyUnitId |
|
|
|
* @param serverId |
|
|
|
* @param serviceType |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId) { |
|
|
|
if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ |
|
|
|
public List<ServiceStatDTO> groupByServer(String customerId, String serverId,String serviceType) { |
|
|
|
if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(serverId)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
return baseDao.selectGroupByPartyUnit(customerId,partyUnitId); |
|
|
|
return baseDao.selectGroupByServer(customerId,serverId,serviceType); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1028,19 +1059,27 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); |
|
|
|
} |
|
|
|
// todo 只有需求人才可以评价
|
|
|
|
|
|
|
|
//用户输入的完成情况,走内容审核
|
|
|
|
textScan(formDTO.getFinishDesc()); |
|
|
|
//当前操作用户是工作端用户还是居民端用户
|
|
|
|
String userType = ""; |
|
|
|
if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) { |
|
|
|
userType = UserDemandConstant.STAFF; |
|
|
|
} else if (AppClientConstant.APP_RESI.equals(formDTO.getApp())) { |
|
|
|
userType = UserDemandConstant.RESI; |
|
|
|
} |
|
|
|
// 1、插入评价得分记录
|
|
|
|
IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class); |
|
|
|
satisfactionEntity.setEvaluateTime(new Date()); |
|
|
|
satisfactionEntity.setUserType(UserDemandConstant.RESI); |
|
|
|
satisfactionEntity.setUserType(userType); |
|
|
|
satisfactionEntity.setRemark(formDTO.getFinishDesc()); |
|
|
|
demandSatisfactionDao.insert(satisfactionEntity); |
|
|
|
|
|
|
|
// 2、插入评价操作日志
|
|
|
|
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class); |
|
|
|
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); |
|
|
|
evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime()); |
|
|
|
evaluateEntity.setUserType(UserDemandConstant.RESI); |
|
|
|
evaluateEntity.setUserType(userType); |
|
|
|
operateLogDao.insert(evaluateEntity); |
|
|
|
|
|
|
|
// 3、更新主表已评价标识,是否解决标识。
|
|
|
@ -1054,7 +1093,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
finishResultDTO.setServerId(serviceEntity.getServerId()); |
|
|
|
finishResultDTO.setServiceType(serviceEntity.getServiceType()); |
|
|
|
finishResultDTO.setAwardPoint(entity.getAwardPoint()); |
|
|
|
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自山东路-张先生的评价,请查看。
|
|
|
|
finishResultDTO.setEvaluateFlag(entity.getEvaluateFlag()); |
|
|
|
if(StringUtils.isBlank(entity.getParentCode())||NumConstant.ZERO_STR.equals(entity.getParentCode())){ |
|
|
|
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getCategoryCode())); |
|
|
|
}else{ |
|
|
|
finishResultDTO.setFirstCategoryName(demandDictService.getCategoryName(entity.getCustomerId(),entity.getParentCode())); |
|
|
|
} |
|
|
|
String content = entity.getContent().length() > 100 ? entity.getContent().substring(0, 99) : entity.getContent(); |
|
|
|
finishResultDTO.setRemark(String.format(UserDemandConstant.GRANT_POINT_REMARK,entity.getDemandUserName(),content)); |
|
|
|
finishResultDTO.setCategoryCode(entity.getCategoryCode()); |
|
|
|
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
|
|
|
|
sendVolunnterEvaluated(entity); |
|
|
|
return finishResultDTO; |
|
|
|
} |
|
|
@ -1073,7 +1121,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
queryWrapper.orderByDesc("WANT_SERVICE_TIME"); |
|
|
|
queryWrapper.last("limit 5"); |
|
|
|
queryWrapper.select("DISTINCT CATEGORY_CODE"); |
|
|
|
return baseDao.selectList(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList()); |
|
|
|
return baseDao.selectObjs(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1091,48 +1139,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
List<ResiClientMyDemandResDTO> list=result.getList(); |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号
|
|
|
|
List<String> partyUnitIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
List<String> partyUnitIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
Map<String, IcPartyUnitEntity> partyUnitMap =getPartyUnitMap(partyUnitIds); |
|
|
|
|
|
|
|
List<String> socialOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
List<String> socialOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
Map<String, IcSocietyOrgEntity> socialOrgMap=getSocialOrgMap(socialOrgIds); |
|
|
|
|
|
|
|
List<String> communityOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
List<String> communityOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); |
|
|
|
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds); |
|
|
|
|
|
|
|
//2、志愿者姓名、手机号
|
|
|
|
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); |
|
|
|
Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList); |
|
|
|
|
|
|
|
for (ResiClientMyDemandResDTO resDto : list) { |
|
|
|
//3、查询分类名称
|
|
|
|
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode()); |
|
|
|
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR); |
|
|
|
switch (resDto.getServiceType()) |
|
|
|
{ |
|
|
|
case UserDemandConstant.PARTY_UNIT: |
|
|
|
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); |
|
|
|
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); |
|
|
|
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.SOCIAL_ORG: |
|
|
|
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); |
|
|
|
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); |
|
|
|
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.COMMUNITY_ORG: |
|
|
|
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); |
|
|
|
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); |
|
|
|
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.VOLUNTEER: |
|
|
|
resDto.setServiceUnitName(StrConstant.EPMETY_STR); |
|
|
|
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); |
|
|
|
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
log.warn("serviceType 错误"); |
|
|
|
break; |
|
|
|
if(StringUtils.isNotBlank(resDto.getServiceType())){ |
|
|
|
switch (resDto.getServiceType()) |
|
|
|
{ |
|
|
|
case UserDemandConstant.PARTY_UNIT: |
|
|
|
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); |
|
|
|
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); |
|
|
|
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.SOCIAL_ORG: |
|
|
|
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); |
|
|
|
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); |
|
|
|
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.COMMUNITY_ORG: |
|
|
|
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); |
|
|
|
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); |
|
|
|
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.VOLUNTEER: |
|
|
|
resDto.setServiceUnitName(StrConstant.EPMETY_STR); |
|
|
|
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); |
|
|
|
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
log.warn("serviceType 错误"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1208,34 +1258,36 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
} |
|
|
|
//2、志愿者(姓名、手机号
|
|
|
|
//3、区域化党建单位、社会组织、社区自组织 设置负责人和手机
|
|
|
|
switch (resDto.getServiceType()) { |
|
|
|
case UserDemandConstant.PARTY_UNIT: |
|
|
|
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); |
|
|
|
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); |
|
|
|
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.SOCIAL_ORG: |
|
|
|
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); |
|
|
|
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); |
|
|
|
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.COMMUNITY_ORG: |
|
|
|
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); |
|
|
|
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); |
|
|
|
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.VOLUNTEER: |
|
|
|
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); |
|
|
|
resDto.setServiceUnitName(StrConstant.EPMETY_STR); |
|
|
|
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); |
|
|
|
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
log.warn("serviceType 错误"); |
|
|
|
break; |
|
|
|
if(StringUtils.isNotBlank(resDto.getServiceType())){ |
|
|
|
switch (resDto.getServiceType()) { |
|
|
|
case UserDemandConstant.PARTY_UNIT: |
|
|
|
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); |
|
|
|
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); |
|
|
|
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.SOCIAL_ORG: |
|
|
|
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); |
|
|
|
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); |
|
|
|
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.COMMUNITY_ORG: |
|
|
|
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId())); |
|
|
|
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); |
|
|
|
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); |
|
|
|
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); |
|
|
|
break; |
|
|
|
case UserDemandConstant.VOLUNTEER: |
|
|
|
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); |
|
|
|
resDto.setServiceUnitName(StrConstant.EPMETY_STR); |
|
|
|
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); |
|
|
|
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); |
|
|
|
break; |
|
|
|
default: |
|
|
|
log.warn("serviceType 错误"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return resDto; |
|
|
|
} |
|
|
@ -1250,6 +1302,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) { |
|
|
|
//需求内容走内容审核
|
|
|
|
textScan(formDTO.getContent()); |
|
|
|
Date now = new Date(); |
|
|
|
DemandRecId resultDto = new DemandRecId(); |
|
|
|
resultDto.setDemandRecId(formDTO.getDemandRecId()); |
|
|
@ -1312,6 +1366,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
return resultDto; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 需求内容,服务评价-完成情况走内容审核 |
|
|
|
* @param content |
|
|
|
*/ |
|
|
|
private void textScan(String content) { |
|
|
|
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
|
|
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
|
|
taskDTO.setContent(content); |
|
|
|
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
textScanParamDTO.getTasks().add(taskDTO); |
|
|
|
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); |
|
|
|
if (!textSyncScanResult.success()) { |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} else { |
|
|
|
if (!textSyncScanResult.getData().isAllPass()) { |
|
|
|
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决,请查看。 |
|
|
@ -1359,6 +1432,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
} else if (UserDemandConstant.COMMUNITY_ORG.equals(serviceType)) { |
|
|
|
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(serverId)); |
|
|
|
serviceName = MapUtils.isNotEmpty(communityOrgMap) ? communityOrgMap.get(serverId).getOrganizationName() : StrConstant.EPMETY_STR; |
|
|
|
}else if(UserDemandConstant.VOLUNTEER.equals(serviceType)){ |
|
|
|
//如果指派给了志愿者-》您提出的需求将由XX为您解决,请查看
|
|
|
|
UserResiInfoListFormDTO userResiInfoListFormDTO=new UserResiInfoListFormDTO(); |
|
|
|
userResiInfoListFormDTO.setUserIdList(Arrays.asList(serverId)); |
|
|
|
Result<List<UserResiInfoResultDTO>> userRes = epmetUserOpenFeignClient.getUserResiInfoList(userResiInfoListFormDTO); |
|
|
|
if(userRes.success()){ |
|
|
|
serviceName=userRes.getData().get(NumConstant.ZERO).getRealName(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(serviceName)) { |
|
|
|
UserMessageFormDTO userMessage = new UserMessageFormDTO(); |
|
|
@ -1443,5 +1524,29 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
messageOpenFeignClient.saveUserMessage(userMessage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 当前用户与需求消息的关系 需求发布人:publisher ;服务人:server |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO) { |
|
|
|
UserDemandRelResDTO res = new UserDemandRelResDTO(""); |
|
|
|
IcUserDemandRecEntity origin = baseDao.selectById(formDTO.getDemandRecId()); |
|
|
|
if (null != origin && formDTO.getUserId().equals(origin.getDemandUserId())) { |
|
|
|
res.setIdentity(UserDemandConstant.DEMAND_PUBLISHER); |
|
|
|
return res; |
|
|
|
} |
|
|
|
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(formDTO.getDemandRecId()); |
|
|
|
if (null != serviceEntity && formDTO.getUserId().equals(serviceEntity.getServerId())) { |
|
|
|
res.setIdentity(UserDemandConstant.DEMAND_SERVER); |
|
|
|
} |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|