Browse Source

Merge remote-tracking branch 'origin/dev_ic_mp' into dev_ic_mp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
7b1e152bbf
  1. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java
  2. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java
  3. 112
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java
  4. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  5. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  6. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  7. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  8. 276
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  9. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java
  10. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  11. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java
  12. 5
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java

@ -10,6 +10,9 @@ import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* pc录入需求入参
*/
@Data
public class DemandAddFromDTO implements Serializable {

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandDetailFormDTO.java

@ -5,6 +5,10 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求大厅-需求详情入参
* 我的需求-需求详情入参
*/
@Data
public class DemandDetailFormDTO implements Serializable {
private static final long serialVersionUID = 514538389753713095L;

112
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ReportDemandFormDTO.java

@ -0,0 +1,112 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 居民端-上报需求或者修改需求
*/
@Data
public class ReportDemandFormDTO implements Serializable {
private static final long serialVersionUID = -2931148629441558468L;
public interface Add extends CustomerClientShowGroup {
}
public interface AddInternalGroup {
}
public interface Update extends CustomerClientShowGroup {
}
public interface UpdateInternalGroup {
}
@NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class)
private String demandRecId;
@NotBlank(message = "customerId不能为空", groups = {AddInternalGroup.class, UpdateInternalGroup.class})
private String customerId;
/**
* 网格id
*/
@NotBlank(message = "所属网格不能为空",groups = {AddInternalGroup.class})
private String gridId;
/**
* 需求内容1000字
*/
@NotBlank(message = "需求内容不能为空", groups = {Add.class, Update.class})
@Length(max = 1000, message = "需求内容至多输入1000字", groups = {Add.class, Update.class})
private String content;
/**
* 二级需求分类编码
*/
@NotBlank(message = "需求类别不能为空",groups = Add.class)
private String categoryCode;
/**
* 父级需求分类编码
*/
@NotBlank(message = "父级分类不能为空",groups = Add.class)
private String parentCode;
/**
* 希望服务时间
*/
@NotNull(message = "服务时间不能为空",groups = {Add.class, Update.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date wantServiceTime;
/**
* 需求人user.id或者ic_resi_user.id
*/
@NotBlank(message = "需求人不能为空",groups ={AddInternalGroup.class, UpdateInternalGroup.class})
private String demandUserId;
/**
* 需求人联系姓名
*/
@NotBlank(message = "联系人不能为空",groups = {Add.class, Update.class})
private String demandUserName;
/**
* 需求人联系电话
*/
@NotBlank(message = "联系电话不能为空",groups = {Add.class, Update.class})
private String demandUserMobile;
/**
* 服务地点工作端指派默认居民居住房屋地址居民端地图选择
*/
@NotBlank(message = "服务地点不能为空",groups = {Add.class, Update.class})
private String serviceLocation;
/**
* 门牌号详细地址
*/
@Length(max = 200, message = "门牌号至多输入200字", groups = {Add.class, Update.class})
private String locationDetail;
/**
* 经度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String longitude;
/**
* 纬度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String latitude;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java

@ -98,7 +98,8 @@ public class DemandDetailResDTO implements Serializable {
* 服务记录主键
*/
private String serviceId;
@JsonIgnore
private String serverId;
// 以下几个返参在我的需求详情中返回:
private String serviceType;
private String serviceUserName;

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -64,4 +64,13 @@ public interface UserDemandConstant {
* pc完成情况完成+评价
*/
String FINISH_AND_EVALUATE="finish_and_evaluate";
String MESSAGE_TITILE="您有一条需求消息";
String HAVE_SERVICE="您提出的需求将由%s为您解决,请查看";
String FINISH_DEMAND_MESSAGE="您提出的需求已完成,请进行服务评价。";
/**
* 您收到来自张三的评价请查看
*/
String DEMAND_EVALUATED=" 您收到来自%s的评价,请查看。";
String DEMAND_CANCELED=" %s的需求已取消,请查看。";
}

39
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -16,6 +17,7 @@ import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -75,6 +77,7 @@ public class ResiDemandController {
* @param tokenDto
* @return
*/
@NoRepeatSubmit
@PostMapping("takeorder")
public Result<TakeOrderResultDTO> takeOrder(@LoginUser TokenDto tokenDto, @RequestBody TakeOrderFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
@ -89,6 +92,7 @@ public class ResiDemandController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("finish")
public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -108,6 +112,7 @@ public class ResiDemandController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("evaluate")
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
@ -138,6 +143,7 @@ public class ResiDemandController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("cancel")
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -161,5 +167,38 @@ public class ResiDemandController {
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);
return new Result<List<ResiClientMyDemandResDTO>>().ok(icUserDemandRecService.queryMyDemandForResiClient(formDTO));
}
/**
* 我的需求-需求详情待处理处理中已完成已取消
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("my-detail")
public Result<DemandDetailResDTO> queryMyDetail(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, DemandDetailFormDTO.AddUserInternalGroup.class);
return new Result<DemandDetailResDTO>().ok(icUserDemandRecService.queryMyDetail(formDTO));
}
/**
* 居民端-我的需求提交需求修改需求
* @param tokenDto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("submit")
public Result<DemandRecId> saveOrUpdateDemand(@LoginUser TokenDto tokenDto,@RequestBody ReportDemandFormDTO formDTO){
//需求人默认是当前用户id
formDTO.setDemandUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
if(StringUtils.isNotBlank(formDTO.getDemandRecId())){
ValidatorUtils.validateEntity(formDTO,ReportDemandFormDTO.Update.class,ReportDemandFormDTO.UpdateInternalGroup.class);
}else{
ValidatorUtils.validateEntity(formDTO,ReportDemandFormDTO.Add.class,ReportDemandFormDTO.AddInternalGroup.class);
}
return new Result<DemandRecId>().ok(icUserDemandRecService.saveOrUpdateDemand(formDTO));
}
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -190,4 +190,18 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
List<ResiClientMyDemandResDTO> queryMyDemandForResiClient(ResiClientMyDemandFormDTO formDTO);
/**
* 我的需求-需求详情待处理处理中已完成已取消
* @param formDTO
* @return
*/
DemandDetailResDTO queryMyDetail(DemandDetailFormDTO formDTO);
/**
* 居民端-我的需求提交需求修改需求
* @param formDTO
* @return
*/
DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO);
}

276
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -30,20 +31,21 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.*;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.FindIcUserFormDTO;
import com.epmet.dto.form.ResiUserFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
@ -92,6 +94,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private IcSocietyOrgService societyOrgService;
@Autowired
private IcCommunitySelfOrganizationService communitySelfOrganizationService;
@Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Override
public IcUserDemandRecDTO get(String id) {
@ -331,6 +335,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
logEntity.setActionCode(UserDemandConstant.CANCEL);
logEntity.setOperateTime(entity.getCancelTime());
operateLogDao.insert(logEntity);
//3、查看是否已经有志愿者接单,或者pc已经指派给志愿者了,通知它需求需求
sendVolunnterCanceled(entity);
}
/**
@ -375,7 +381,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
serviceEntity.setUpdatedBy(formDTO.getUserId());
demandServiceDao.updateById(serviceEntity);
}
// 4、如果需求是小程序端上报的,提醒需求人,服务已指派
sendDemandUserHaveOrgService(entity,formDTO.getServerId(),formDTO.getServiceType());
}
/**
@ -421,6 +428,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3.4更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
//3.5如果需求是志愿者完成的,发送消息:您收到来自XXX的评价,请查看。
sendVolunnterEvaluated(entity);
}
//4、修改主表状态为已完成
@ -431,6 +441,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
// 5、如果是居民端用户提出的需求,发消息:您提出的需求已完成,请进行服务评价。
sendDemandUserFinished(entity);
return finishResultDTO;
}
@ -995,6 +1007,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
demandServiceDao.updateById(origin);
serviceId=origin.getId();
}
this.sendDemandUserHaveVolunnteerService(entity,formDTO.getUserId());
takeOrderResultDTO.setServiceId(serviceId);
return takeOrderResultDTO;
}
@ -1041,6 +1054,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自山东路-张先生的评价,请查看。
sendVolunnterEvaluated(entity);
return finishResultDTO;
}
@ -1175,4 +1190,257 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return userInfoMap;
}
/**
* 我的需求-需求详情待处理处理中已完成已取消
*
* @param formDTO
* @return
*/
@Override
public DemandDetailResDTO queryMyDetail(DemandDetailFormDTO formDTO) {
DemandRecResultDTO demandRecResultDTO = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId());
if (null != demandRecResultDTO) {
DemandDetailResDTO resDto = ConvertUtils.sourceToTarget(demandRecResultDTO, DemandDetailResDTO.class);
//1、设置分类名称
IcResiDemandDictEntity demandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
if (null != demandDictEntity) {
resDto.setCategoryName(demandDictEntity.getCategoryName());
}
//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;
}
return resDto;
}
return null;
}
/**
* 居民端-我的需求提交需求修改需求
*
* @param formDTO
* @return
*/
@Override
public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) {
Date now = new Date();
DemandRecId resultDto = new DemandRecId();
resultDto.setDemandRecId(formDTO.getDemandRecId());
if (StringUtils.isNotBlank(formDTO.getDemandRecId())) {
//修改需求
IcUserDemandRecEntity origin = baseDao.selectById(formDTO.getDemandRecId());
if (null == origin) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
}
if (!UserDemandConstant.PENDING.equals(origin.getStatus())) {
//待处理的才可以修改需求
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不允许重新编辑", origin.getStatus()), "需求已处理,不允许重新编辑");
}
origin.setContent(formDTO.getContent());
origin.setWantServiceTime(formDTO.getWantServiceTime());
origin.setDemandUserName(formDTO.getDemandUserName());
origin.setDemandUserMobile(formDTO.getDemandUserMobile());
origin.setServiceLocation(formDTO.getServiceLocation());
origin.setLatitude(formDTO.getLatitude());
origin.setLongitude(formDTO.getLongitude());
origin.setLocationDetail(formDTO.getLocationDetail());
baseDao.updateById(origin);
} else {
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败");
}
IcUserDemandRecEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandRecEntity.class);
insertEntity.setAgencyId(gridInfoRes.getData().getPid());
insertEntity.setGridPids(gridInfoRes.getData().getPids());
insertEntity.setDemandUserType(UserDemandConstant.MINI_RESI);
insertEntity.setStatus(UserDemandConstant.PENDING);
insertEntity.setEvaluateFlag(false);
//设置上报人消息
insertEntity.setReportType(UserDemandConstant.SELF_HELP_REPORT);
insertEntity.setReportTime(now);
insertEntity.setReportUserId(formDTO.getDemandUserId());
insertEntity.setReportUserMobile(formDTO.getDemandUserMobile());
insertEntity.setReportUserName(formDTO.getDemandUserName());
//记录发放积分
IcResiDemandDictEntity icResiDemandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), formDTO.getCategoryCode());
if (null != icResiDemandDictEntity) {
insertEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint());
}
baseDao.insert(insertEntity);
resultDto.setDemandRecId(insertEntity.getId());
}
//插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(resultDto.getDemandRecId());
logEntity.setUserType(UserDemandConstant.RESI);
logEntity.setUserId(formDTO.getDemandUserId());
logEntity.setActionCode(StringUtils.isNotBlank(formDTO.getDemandRecId()) ? UserDemandConstant.UPDATE : UserDemandConstant.CREATE);
logEntity.setOperateTime(now);
operateLogDao.insert(logEntity);
return resultDto;
}
/**
* 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决请查看
*/
private void sendDemandUserHaveVolunnteerService(IcUserDemandRecEntity entity, String volunteerUserId) {
// 如果需求人是小程序里的用户,需要通知需求人:
// 您提出的需求将由青岛亿联科技有限公司为您解决,请查看。
// 您提出的需求将由张三为您解决,请查看。
if (UserDemandConstant.MINI_RESI.equals(entity.getDemandUserType())) {
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO();
formDTO.setUserIdList(Arrays.asList(volunteerUserId));
Result<List<UserResiInfoResultDTO>> userRes = epmetUserOpenFeignClient.getUserResiInfoList(formDTO);
if (userRes.success() && CollectionUtils.isNotEmpty(userRes.getData())) {
String volunteerName=userRes.getData().get(NumConstant.ZERO).getRealName();
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(entity.getCustomerId());
userMessage.setGridId(entity.getGridId());
String messageContent = String.format(UserDemandConstant.HAVE_SERVICE, volunteerName);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.DEMAND);
userMessage.setTargetId(entity.getId());
//通知需求提出人
userMessage.setUserId(entity.getDemandUserId());
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
}
/**
* 您提出的需求将由青岛亿联科技有限公司为您解决请查看
*/
private void sendDemandUserHaveOrgService(IcUserDemandRecEntity entity, String serverId, String serviceType) {
// 如果需求人是小程序里的用户,需要通知需求人:
// 您提出的需求将由青岛亿联科技有限公司为您解决,请查看。
String serviceName = "";
if (UserDemandConstant.PARTY_UNIT.equals(serviceType)) {
IcPartyUnitDTO data = partyUnitService.get(serverId);
serviceName = null != data ? data.getUnitName() : StrConstant.EPMETY_STR;
} else if (UserDemandConstant.SOCIAL_ORG.equals(serviceType)) {
Map<String, IcSocietyOrgEntity> map = getSocialOrgMap(Arrays.asList(serverId));
serviceName = MapUtils.isNotEmpty(map) ? map.get(serverId).getSocietyName() : StrConstant.EPMETY_STR;
} 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;
}
if (StringUtils.isNotBlank(serviceName)) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(entity.getCustomerId());
userMessage.setGridId(entity.getGridId());
String messageContent = String.format(UserDemandConstant.HAVE_SERVICE, serviceName);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.DEMAND);
userMessage.setTargetId(entity.getId());
//通知需求提出人
userMessage.setUserId(entity.getDemandUserId());
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
/**
* 我的需求服务完成->您提出的需求已完成请进行服务评价
*/
private void sendDemandUserFinished(IcUserDemandRecEntity entity) {
if (UserDemandConstant.MINI_RESI.equals(entity.getDemandUserType())) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(entity.getCustomerId());
userMessage.setGridId(entity.getGridId());
String messageContent = UserDemandConstant.FINISH_DEMAND_MESSAGE;
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.DEMAND);
userMessage.setTargetId(entity.getId());
//通知需求提出人
userMessage.setUserId(entity.getDemandUserId());
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
/**
* 我的需求-评价如果服务方是志愿者通知TA: 您收到来自张三的评价请查看
*/
private void sendVolunnterEvaluated(IcUserDemandRecEntity entity) {
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(entity.getId());
if (null != serviceEntity && UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(entity.getCustomerId());
userMessage.setGridId(entity.getGridId());
String messageContent = String.format(UserDemandConstant.DEMAND_EVALUATED, entity.getDemandUserName());
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.DEMAND);
userMessage.setTargetId(entity.getId());
//通知志愿者
userMessage.setUserId(serviceEntity.getServerId());
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
/**
* 我的需求-取消需求未完成的都可以取消如果需求已经被小程序里的志愿者接单通知它->XXX的需求已取消请查看
* pc指派给志愿者的如果取消了也要通知
* @param entity
*/
private void sendVolunnterCanceled(IcUserDemandRecEntity entity) {
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectByRecId(entity.getId());
if (null != serviceEntity && UserDemandConstant.VOLUNTEER.equals(serviceEntity.getServiceType())) {
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(entity.getCustomerId());
userMessage.setGridId(entity.getGridId());
String messageContent = String.format(UserDemandConstant.DEMAND_CANCELED, entity.getDemandUserName());
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserDemandConstant.MESSAGE_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.DEMAND);
userMessage.setTargetId(entity.getId());
//通知志愿者
userMessage.setUserId(serviceEntity.getServerId());
messageOpenFeignClient.saveUserMessage(userMessage);
}
}
}

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentFormDTO.java

@ -51,4 +51,14 @@ public class AppointmentFormDTO implements Serializable {
* 备注
*/
private String remark;
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型grid网格agency组织
*/
private String orgType;
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -300,8 +300,13 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
}
IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class);
e.setCustomerId(customerId);
e.setOrgId(staffInfo.getAgencyId());
e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY);
if (StringUtils.isNotBlank(formDTO.getOrgId())){
e.setOrgId(formDTO.getOrgId());
e.setOrgType(formDTO.getOrgType());
}else {
e.setOrgId(staffInfo.getAgencyId());
e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY);
}
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setStatus(PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING);

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserResiInfoResultDTO.java

@ -58,4 +58,5 @@ public class UserResiInfoResultDTO implements Serializable {
private String headPhoto;
private String nickName;
private String realName;
}

5
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -113,7 +113,7 @@
<select id="selectListUserResiInfoDTO" resultType="com.epmet.dto.result.UserResiInfoResultDTO">
SELECT
ubi.USER_ID,
uri.REG_MOBILE,
IFNULL(uri.REG_MOBILE,ubi.MOBILE) as REG_MOBILE,
ubi.SURNAME,
ubi.`NAME`,
ubi.STREET,
@ -125,7 +125,8 @@
ubi.SURNAME,
( CASE WHEN ubi.GENDER = '1' THEN '先生' WHEN ubi.GENDER = '2' THEN '女士' ELSE '先生/女士' END )
) AS show_name,
ubi.HEAD_IMG_URL as head_photo
ubi.HEAD_IMG_URL as head_photo,
ubi.REAL_NAME
FROM user_base_info ubi
left join user_resi_info uri on(ubi.user_id=uri.user_id and uri.del_flag='0')
WHERE ubi.DEL_FLAG = '0'

Loading…
Cancel
Save