Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

dev
jianjun 4 years ago
parent
commit
d8131fa4e2
  1. 24
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/BaseMQMsgDTO.java
  2. 8
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
  4. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  5. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  7. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  8. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  9. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  10. 173
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  11. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  12. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  13. 6
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  14. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java
  15. 5
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  16. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java
  17. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java
  18. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  19. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java
  20. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  21. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  22. 18
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml
  23. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  24. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java
  25. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java
  26. 114
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

24
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/BaseMQMsgDTO.java

@ -0,0 +1,24 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import java.io.Serializable;
/**
* 基础消息体
* @author liujianjun
*/
@Data
public class BaseMQMsgDTO implements Serializable {
private static final long serialVersionUID = 1019260278983535301L;
/**
* 客户Id
*/
private String customerId;
/**
* 对象id
*/
private String objectId;
}

8
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java

@ -7,12 +7,8 @@ import lombok.Data;
* @author liujianjun * @author liujianjun
*/ */
@Data @Data
public class StaffPatrolMQMsg { public class StaffPatrolMQMsg extends BaseMQMsgDTO {
/** private static final long serialVersionUID = 3039825049521866599L;
* 客户Id
*/
private String customerId;
/** /**
* 巡查记录id * 巡查记录id
*/ */

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

@ -41,4 +41,7 @@ public class EvaluateDemandFormDTO implements Serializable {
private String userId; private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId; private String customerId;
// 政府端:gov、居民端:resi、运营端:oper
@NotBlank(message = "app不能为空", groups = AddUserInternalGroup.class)
private String app;
} }

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

@ -56,6 +56,17 @@ public class DemandDetailResDTO implements Serializable {
*/ */
private String serviceAddress; private String serviceAddress;
// 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
private String serviceLocation;
// 门牌号详细地址
private String locationDetail;
// 经度,需求人是ic的居民时,取所住楼栋的中心点位
private String longitude;
// 纬度,需求人是ic的居民时,取所住楼栋的中心点位
private String latitude;
/** /**
* 实际服务开始时间 * 实际服务开始时间
*/ */

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -131,4 +131,12 @@ public class DemandRecResultDTO implements Serializable {
* 服务地点 * 服务地点
*/ */
private String serviceAddress; private String serviceAddress;
// 服务地点,工作端指派默认居民居住房屋地址,居民端地图选择
private String serviceLocation;
// 门牌号详细地址
private String locationDetail;
// 经度,需求人是ic的居民时,取所住楼栋的中心点位
private String longitude;
// 纬度,需求人是ic的居民时,取所住楼栋的中心点位
private String latitude;
} }

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

@ -117,6 +117,7 @@ public class ResiDemandController {
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) { public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setApp(tokenDto.getApp());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO); FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。 //如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
@ -161,7 +162,7 @@ public class ResiDemandController {
* @return * @return
*/ */
@PostMapping("mydemand") @PostMapping("mydemand")
public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto, @RequestBody ResiClientMyDemandFormDTO formDTO){ public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody ResiClientMyDemandFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -401,7 +401,10 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Override @Override
public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) { public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) {
return baseDao.selectBatchIds(communityOrgIds); if(CollectionUtils.isNotEmpty(communityOrgIds)){
return baseDao.selectBatchIds(communityOrgIds);
}
return Collections.EMPTY_LIST;
} }
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -454,7 +454,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override @Override
public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) { public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) {
return baseDao.selectBatchIds(partyUnitIds); if(CollectionUtils.isNotEmpty(partyUnitIds)){
return baseDao.selectBatchIds(partyUnitIds);
}
return Collections.EMPTY_LIST;
} }
private String getServiceMatter(Map<String, String> map, String matter) { private String getServiceMatter(Map<String, String> map, String matter) {

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -270,7 +270,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
@Override @Override
public List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds) { public List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds) {
return baseDao.selectBatchIds(socialOrgIds); if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(socialOrgIds)){
return baseDao.selectBatchIds(socialOrgIds);
}
return Collections.EMPTY_LIST;
} }
} }

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

@ -27,10 +27,15 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum; 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.EpmetException;
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;
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.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserDemandConstant; import com.epmet.constant.UserDemandConstant;
import com.epmet.constant.UserMessageTypeConstant; 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.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.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -96,6 +102,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private IcCommunitySelfOrganizationService communitySelfOrganizationService; private IcCommunitySelfOrganizationService communitySelfOrganizationService;
@Autowired @Autowired
private EpmetMessageOpenFeignClient messageOpenFeignClient; private EpmetMessageOpenFeignClient messageOpenFeignClient;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
@Override @Override
public IcUserDemandRecDTO get(String id) { public IcUserDemandRecDTO get(String id) {
@ -266,7 +276,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者 //3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>(); 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)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -734,7 +744,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者 //3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>(); 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)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -1028,19 +1038,27 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); 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、插入评价得分记录 // 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class); IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(new Date()); satisfactionEntity.setEvaluateTime(new Date());
satisfactionEntity.setUserType(UserDemandConstant.RESI); satisfactionEntity.setUserType(userType);
satisfactionEntity.setRemark(formDTO.getFinishDesc());
demandSatisfactionDao.insert(satisfactionEntity); demandSatisfactionDao.insert(satisfactionEntity);
// 2、插入评价操作日志 // 2、插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class); IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE); evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime()); evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime());
evaluateEntity.setUserType(UserDemandConstant.RESI); evaluateEntity.setUserType(userType);
operateLogDao.insert(evaluateEntity); operateLogDao.insert(evaluateEntity);
// 3、更新主表已评价标识,是否解决标识。 // 3、更新主表已评价标识,是否解决标识。
@ -1054,7 +1072,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
finishResultDTO.setServerId(serviceEntity.getServerId()); finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType()); finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint()); finishResultDTO.setAwardPoint(entity.getAwardPoint());
//5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自山东路-张先生的评价,请查看。 //5、我的需求-评价:如果服务方是志愿者,通知它: 您收到来自XXX(需求人姓名)的评价,请查看。
sendVolunnterEvaluated(entity); sendVolunnterEvaluated(entity);
return finishResultDTO; return finishResultDTO;
} }
@ -1073,7 +1091,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
queryWrapper.orderByDesc("WANT_SERVICE_TIME"); queryWrapper.orderByDesc("WANT_SERVICE_TIME");
queryWrapper.last("limit 5"); queryWrapper.last("limit 5");
queryWrapper.select("DISTINCT CATEGORY_CODE"); 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 +1109,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
List<ResiClientMyDemandResDTO> list=result.getList(); List<ResiClientMyDemandResDTO> list=result.getList();
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号 //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); 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); 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); Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds);
//2、志愿者姓名、手机号 //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); Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList);
for (ResiClientMyDemandResDTO resDto : list) { for (ResiClientMyDemandResDTO resDto : list) {
//3、查询分类名称 //3、查询分类名称
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode()); IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR); resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR);
switch (resDto.getServiceType()) if(StringUtils.isNotBlank(resDto.getServiceType())){
{ switch (resDto.getServiceType())
case UserDemandConstant.PARTY_UNIT: {
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
break; resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
case UserDemandConstant.SOCIAL_ORG: break;
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
break; resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
case UserDemandConstant.COMMUNITY_ORG: break;
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
break; resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
case UserDemandConstant.VOLUNTEER: break;
resDto.setServiceUnitName(StrConstant.EPMETY_STR); case UserDemandConstant.VOLUNTEER:
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
break; resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
default: break;
log.warn("serviceType 错误"); default:
break; log.warn("serviceType 错误");
break;
}
} }
} }
} }
@ -1208,34 +1228,36 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
//2、志愿者(姓名、手机号 //2、志愿者(姓名、手机号
//3、区域化党建单位、社会组织、社区自组织 设置负责人和手机 //3、区域化党建单位、社会组织、社区自组织 设置负责人和手机
switch (resDto.getServiceType()) { if(StringUtils.isNotBlank(resDto.getServiceType())){
case UserDemandConstant.PARTY_UNIT: switch (resDto.getServiceType()) {
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
break; resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
case UserDemandConstant.SOCIAL_ORG: break;
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
break; resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
case UserDemandConstant.COMMUNITY_ORG: break;
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
break; resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
case UserDemandConstant.VOLUNTEER: break;
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); case UserDemandConstant.VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR); Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
break; resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
default: break;
log.warn("serviceType 错误"); default:
break; log.warn("serviceType 错误");
break;
}
} }
return resDto; return resDto;
} }
@ -1250,6 +1272,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
*/ */
@Override @Override
public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) { public DemandRecId saveOrUpdateDemand(ReportDemandFormDTO formDTO) {
//需求内容走内容审核
textScan(formDTO.getContent());
Date now = new Date(); Date now = new Date();
DemandRecId resultDto = new DemandRecId(); DemandRecId resultDto = new DemandRecId();
resultDto.setDemandRecId(formDTO.getDemandRecId()); resultDto.setDemandRecId(formDTO.getDemandRecId());
@ -1312,6 +1336,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return resultDto; 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());
}
}
}
/** /**
* 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决请查看 * 我的需求被抢单->您提出的需求将由青岛亿联科技有限公司为您解决请查看

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -259,7 +259,7 @@
<!-- 查询分类信息,限制未被禁用的 --> <!-- 查询分类信息,限制未被禁用的 -->
<select id="selectListByCodes" parameterType="map" resultType="com.epmet.dto.result.demand.DemandCategoryResDTO"> <select id="selectListByCodes" parameterType="map" resultType="com.epmet.dto.result.demand.DemandCategoryResDTO">
select select
ID, ID as categoryId,
CATEGORY_CODE, CATEGORY_CODE,
PARENT_CODE, PARENT_CODE,
CATEGORY_NAME, CATEGORY_NAME,

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -207,7 +207,11 @@
END END
) as epmetUserId, ) as epmetUserId,
r.AWARD_POINT as awardPoint, r.AWARD_POINT as awardPoint,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
r.SERVICE_LOCATION,
r.LOCATION_DETAIL,
r.LONGITUDE,
r.LATITUDE
FROM FROM
ic_user_demand_rec r ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
@ -476,7 +480,7 @@
WHERE WHERE
r.DEL_FLAG = '0' r.DEL_FLAG = '0'
AND r.GRID_ID = #{gridId} AND r.GRID_ID = #{gridId}
AND R.DEMAND_USER_ID !=#{demandUserId} AND R.DEMAND_USER_ID =#{demandUserId}
<if test="null !=type and type =='unprocessed' "> <if test="null !=type and type =='unprocessed' ">
AND r.`STATUS` = 'pending' AND r.`STATUS` = 'pending'
</if> </if>

6
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -75,6 +75,11 @@ public interface SystemMessageType {
*/ */
String USER_PATROL_STOP = "user_patrol_stop"; String USER_PATROL_STOP = "user_patrol_stop";
/**
* 添加例行工作
*/
String PATROL_ROUTINE_WORK_ADD = "patrol_routine_work_add";
/** /**
* 项目变动 * 项目变动
*/ */
@ -104,4 +109,5 @@ public interface SystemMessageType {
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度 * 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/ */
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
} }

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/send/SendMqMsgUtil.java

@ -132,7 +132,7 @@ public class SendMqMsgUtil {
* @author wxz * @author wxz
* @date 2021.06.21 12:46 * @date 2021.06.21 12:46
*/ */
public boolean sendPatrolMqMsg(StaffPatrolMQMsg msg,String messageType) { public boolean sendPatrolMqMsg(BaseMQMsgDTO msg, String messageType) {
try { try {
SystemMsgFormDTO msgForm = new SystemMsgFormDTO(); SystemMsgFormDTO msgForm = new SystemMsgFormDTO();
msgForm.setMessageType(messageType); msgForm.setMessageType(messageType);

5
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java

@ -181,6 +181,7 @@ public class SystemMessageServiceImpl implements SystemMessageService {
break; break;
case SystemMessageType.USER_PATROL_START: case SystemMessageType.USER_PATROL_START:
case SystemMessageType.USER_PATROL_STOP: case SystemMessageType.USER_PATROL_STOP:
case SystemMessageType.PATROL_ROUTINE_WORK_ADD:
topic = TopicConstants.PATROL; topic = TopicConstants.PATROL;
break; break;
case SystemMessageType.PROJECT_ADD: case SystemMessageType.PROJECT_ADD:
@ -195,6 +196,8 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
break; break;
default:
logger.info("getTopicByMsgType default topic:{}", msgType);
} }
return topic; return topic;
} }
@ -244,6 +247,8 @@ public class SystemMessageServiceImpl implements SystemMessageService {
l1LastAlertTime = now; l1LastAlertTime = now;
} }
break; break;
default:
logger.info("blockedMqMsgScan default topic:{}", mcb.getTopic());
} }
} }
} }

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AppointmentRecordMiniFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/24 10:38 上午
* @DESC
*/
@Data
public class AppointmentRecordMiniFormDTO implements Serializable {
private static final long serialVersionUID = -2963684994195809536L;
public interface AppointmentRecordMiniForm{}
@NotBlank(message = "gridId不能为空",groups = AppointmentRecordMiniForm.class)
private String gridId;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentRecordResultDTO.java

@ -47,6 +47,8 @@ public class AppointmentRecordResultDTO implements Serializable {
*/ */
private List<String> appointmentTime; private List<String> appointmentTime;
private String appointmentDate;
@JsonIgnore @JsonIgnore
private String timeId; private String timeId;
@ -58,5 +60,6 @@ public class AppointmentRecordResultDTO implements Serializable {
this.remark = ""; this.remark = "";
this.appointmentTime = new ArrayList<>(); this.appointmentTime = new ArrayList<>();
this.recordId = ""; this.recordId = "";
this.appointmentDate = "";
} }
} }

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -217,5 +217,17 @@ public class IcPartyServiceCenterController {
return new Result<List<AllMattersResultDTO>>().ok(icPartyServiceCenterService.getAllMatters(formDTO)); return new Result<List<AllMattersResultDTO>>().ok(icPartyServiceCenterService.getAllMatters(formDTO));
} }
/**
* @Description 小程序端预约记录
* @param formDTO
* @author zxc
* @date 2021/12/24 10:18 上午
*/
@PostMapping("appointmentrecordmini")
public Result<List<AppointmentRecordResultDTO>> appointmentRecordMini(@RequestBody AppointmentRecordMiniFormDTO formDTO,@LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO,AppointmentRecordMiniFormDTO.AppointmentRecordMiniForm.class);
return new Result<List<AppointmentRecordResultDTO>>().ok(icPartyServiceCenterService.appointmentRecordMini(formDTO,tokenDto));
}
} }

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcMatterAppointmentRecordDao.java

@ -44,6 +44,15 @@ public interface IcMatterAppointmentRecordDao extends BaseDao<IcMatterAppointmen
*/ */
List<AppointmentRecordResultDTO> appointmentRecord(@Param("matterId")String matterId,@Param("date")String date); List<AppointmentRecordResultDTO> appointmentRecord(@Param("matterId")String matterId,@Param("date")String date);
/**
* @Description 小程序端预约列表
* @param orgId
* @param userId
* @author zxc
* @date 2021/12/24 10:25 上午
*/
List<AppointmentRecordResultDTO> appointmentRecordMini(@Param("orgId")String orgId,@Param("userId")String userId);
/** /**
* @Description 查询事项是不是存在预约记录 * @Description 查询事项是不是存在预约记录
* @param matterIds * @param matterIds

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java

@ -175,4 +175,12 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/ */
List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO); List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO);
/**
* @Description 小程序端预约记录
* @param tokenDto
* @author zxc
* @date 2021/12/24 10:18 上午
*/
List<AppointmentRecordResultDTO> appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto);
} }

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

@ -464,6 +464,21 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return new ArrayList<>(); return new ArrayList<>();
} }
/**
* @Description 小程序端预约记录
* @param tokenDto
* @author zxc
* @date 2021/12/24 10:18 上午
*/
@Override
public List<AppointmentRecordResultDTO> appointmentRecordMini(AppointmentRecordMiniFormDTO formDTO,TokenDto tokenDto) {
List<AppointmentRecordResultDTO> result = matterAppointmentRecordDao.appointmentRecordMini(formDTO.getGridId(), tokenDto.getUserId());
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
public List<TimeDTO> getTimeList(String start,String end,Integer interval){ public List<TimeDTO> getTimeList(String start,String end,Integer interval){
List<TimeDTO> result = new ArrayList<>(); List<TimeDTO> result = new ArrayList<>();
List<String> intervalTimeList = getIntervalTimeList(start, end, interval); List<String> intervalTimeList = getIntervalTimeList(start, end, interval);

18
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcMatterAppointmentRecordDao.xml

@ -45,4 +45,22 @@
</foreach> </foreach>
GROUP BY matterId GROUP BY matterId
</select> </select>
<!-- 小程序端预约列表 -->
<select id="appointmentRecordMini" resultType="com.epmet.dto.result.AppointmentRecordResultDTO">
SELECT
ar.APPOINTMENT_NAME,
ar.APPOINTMENT_PHONE,
ar.REMARK,
ar.TIME_ID,
cm.MATTER_NAME,
ar.ID AS recordId,
ar.APPOINTMENT_DATE
FROM ic_matter_appointment_record ar
LEFT JOIN ic_party_service_center_matter cm ON (cm.ID = ar.MATTER_ID AND cm.DEL_FLAG = 0)
WHERE ar.DEL_FLAG = 0
AND ar.ORG_ID = #{orgId}
AND ar.CREATED_BY = #{userId}
AND ar.`STATUS` = 'appointing'
</select>
</mapper> </mapper>

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java

@ -293,7 +293,7 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
String name = "人大代表" + eventMentionEntity.getUserShowName(); String name = "人大代表" + eventMentionEntity.getUserShowName();
UserMessageFormDTO userMessage = new UserMessageFormDTO(); UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI); userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(replyFormDTO.getCustomerId()); userMessage.setCustomerId(eventEntity.getCustomerId());
userMessage.setGridId(eventEntity.getGridId()); userMessage.setGridId(eventEntity.getGridId());
String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name); String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name);
userMessage.setMessageContent(messageContent); userMessage.setMessageContent(messageContent);

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PatrolRoutineWorkFormDTO.java

@ -24,8 +24,6 @@ public class PatrolRoutineWorkFormDTO implements Serializable {
public interface AddOrUpdateForm { public interface AddOrUpdateForm {
} }
private String customerId;
@NotBlank(message = "网格ID不能为空", groups = AddOrUpdateForm.class) @NotBlank(message = "网格ID不能为空", groups = AddOrUpdateForm.class)
private String gridId; private String gridId;
@ -55,7 +53,7 @@ public class PatrolRoutineWorkFormDTO implements Serializable {
@Range(min = 0, max = 1, message = "重点人员是否在当地格式错误", groups = AddOrUpdateForm.class) @Range(min = 0, max = 1, message = "重点人员是否在当地格式错误", groups = AddOrUpdateForm.class)
private Integer isKeyPeopleLocate; private Integer isKeyPeopleLocate;
/** /**
* 重点人员现状 * 当事件类型为特殊人群服务与管理时必填 重点人员现状
*/ */
private String keyPeopleStatus; private String keyPeopleStatus;
/** /**

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/PatrolRoutineWorkEntity.java

@ -85,6 +85,11 @@ public class PatrolRoutineWorkEntity extends BaseEpmetEntity {
*/ */
private String keyPeopleStatus; private String keyPeopleStatus;
/**
* 发生地点
*/
private String address;
/** /**
* 经度 * 经度
*/ */

114
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.BaseMQMsgDTO;
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.DictTreeResultDTO; import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
@ -28,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.dao.PatrolRoutineWorkDao; import com.epmet.dao.PatrolRoutineWorkDao;
import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerGridFormDTO;
@ -35,7 +37,9 @@ import com.epmet.dto.form.PatrolRoutineWorkFormDTO;
import com.epmet.entity.PatrolRoutineWorkEntity; import com.epmet.entity.PatrolRoutineWorkEntity;
import com.epmet.entity.PatrolRoutineWorkTypeEntity; import com.epmet.entity.PatrolRoutineWorkTypeEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.PatrolRoutineWorkService; import com.epmet.service.PatrolRoutineWorkService;
import com.epmet.service.PatrolRoutineWorkTypeService; import com.epmet.service.PatrolRoutineWorkTypeService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -66,7 +70,9 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
@Autowired @Autowired
private LoginUserUtil loginUserUtil; private LoginUserUtil loginUserUtil;
@Autowired @Autowired
PatrolRoutineWorkTypeService patrolRoutineWorkTypeService; private PatrolRoutineWorkTypeService patrolRoutineWorkTypeService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/** /**
* @param formDTO * @param formDTO
@ -77,49 +83,57 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void add(PatrolRoutineWorkFormDTO formDTO) { public void add(PatrolRoutineWorkFormDTO formDTO) {
if (formDTO.getWorkTypeList().toString().contains("02") PatrolRoutineWorkEntity entity = null;
&& (formDTO.getIsKeyPeopleLocate() == null || StringUtils.isBlank(formDTO.getKeyPeopleStatus()))){ try {
log.warn("add patrolRoutineWork fail,param is error,param:{}", JSON.toJSONString(formDTO)); if (formDTO.getWorkTypeList().toString().contains("02")
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode()); && (formDTO.getIsKeyPeopleLocate() == null || StringUtils.isBlank(formDTO.getKeyPeopleStatus()))) {
} log.warn("add patrolRoutineWork fail,param is error,param:{}", JSON.toJSONString(formDTO));
PatrolRoutineWorkEntity entity = ConvertUtils.sourceToTarget(formDTO, PatrolRoutineWorkEntity.class); throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode());
}
entity = ConvertUtils.sourceToTarget(formDTO, PatrolRoutineWorkEntity.class);
CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO(); CustomerGridFormDTO gridFormDTO = new CustomerGridFormDTO();
gridFormDTO.setGridId(formDTO.getGridId()); gridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO); Result<CustomerGridDTO> gridBaseInfoData = govOrgOpenFeignClient.getGridBaseInfoByGridId(gridFormDTO);
if (!gridBaseInfoData.success()) { if (!gridBaseInfoData.success()) {
throw new EpmetException("查询网格基本信息失败......"); throw new EpmetException("查询网格基本信息失败......");
} }
CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData(); CustomerGridDTO gridBaseInfo = gridBaseInfoData.getData();
entity.setPids(gridBaseInfo.getPids()); entity.setPids(gridBaseInfo.getPids());
entity.setUserId(loginUserUtil.getLoginUserId()); entity.setUserId(loginUserUtil.getLoginUserId());
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
//entity.setUserId("loginUserUtil.getLoginUserId()"); //entity.setUserId("loginUserUtil.getLoginUserId()");
//entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()"); //entity.setCustomerId("loginUserUtil.getLoginUserCustomerId()");
baseDao.insert(entity); baseDao.insert(entity);
Result<List<DictTreeResultDTO>> mapResult = adminOpenFeignClient.dictTree(DictTypeEnum.PATROL_WORK_TYPE.getCode()); Result<List<DictTreeResultDTO>> mapResult = adminOpenFeignClient.dictTree(DictTypeEnum.PATROL_WORK_TYPE.getCode());
if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())) { if (mapResult == null || !mapResult.success() || CollectionUtils.isEmpty(mapResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "例行工作类型字典获取失败!"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "例行工作类型字典获取失败!");
}
List<DictTreeResultDTO> dictTree = mapResult.getData();
Map<String, StringBuilder> pidsMap = new HashMap<>();
dictTree.forEach(dto -> buildAllParentIdPath(pidsMap, dto));
//插入分类
List<PatrolRoutineWorkTypeEntity> workTypeList = new ArrayList<>();
for (String code : formDTO.getWorkTypeList()) {
PatrolRoutineWorkTypeEntity typeEntity = new PatrolRoutineWorkTypeEntity();
typeEntity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
typeEntity.setRoutineWorkId(entity.getId());
typeEntity.setWorkTypeCode(code);
StringBuilder pids = pidsMap.get(code);
typeEntity.setAllPCode(pids.length() == NumConstant.ZERO ? NumConstant.ZERO_STR : pids.toString());
workTypeList.add(typeEntity);
}
patrolRoutineWorkTypeService.insertBatch(workTypeList);
} finally {
if (entity != null){
sendPatrolMsg(entity.getCustomerId(),entity.getId(),SystemMessageType.PATROL_ROUTINE_WORK_ADD);
}
} }
List<DictTreeResultDTO> dictTree = mapResult.getData();
Map<String, StringBuilder> pidsMap = new HashMap<>();
dictTree.forEach(dto -> buildAllParentIdPath(pidsMap, dto));
List<PatrolRoutineWorkTypeEntity> workTypeList = new ArrayList<>();
formDTO.getWorkTypeList().forEach(code -> {
PatrolRoutineWorkTypeEntity typeEntity = new PatrolRoutineWorkTypeEntity();
typeEntity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
typeEntity.setRoutineWorkId(entity.getId());
typeEntity.setWorkTypeCode(code);
StringBuilder pids = pidsMap.get(code);
typeEntity.setAllPCode(pids.length() == 0 ? NumConstant.ZERO_STR : pids.toString());
workTypeList.add(typeEntity);
});
patrolRoutineWorkTypeService.insertBatch(workTypeList);
} }
@ -137,8 +151,8 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
StringBuilder pidSb = result.get(pid); StringBuilder pidSb = result.get(pid);
if (pidSb == null) { if (pidSb == null) {
pidSb = new StringBuilder(); pidSb = new StringBuilder();
} else if (pidSb.indexOf(pid) == -1) { } else if (pidSb.indexOf(pid) == NumConstant.ONE_NEG) {
if (pidSb.length() > 0) { if (pidSb.length() > NumConstant.ZERO) {
pidSb.append(StrConstant.COLON); pidSb.append(StrConstant.COLON);
} }
pidSb.append(pid); pidSb.append(pid);
@ -154,6 +168,18 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
} }
} }
private void sendPatrolMsg(String customerId, String id, String messageType) {
//发送巡查消息
BaseMQMsgDTO baseMQMsgDTO = new BaseMQMsgDTO();
baseMQMsgDTO.setCustomerId(customerId);
baseMQMsgDTO.setObjectId(id);
boolean b = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendPatrolMqMsg(baseMQMsgDTO, messageType);
if (!b) {
log.error("发送{}巡查消息到mq失败,patrolId:{}", messageType, id);
}
}
public static void main(String[] args) { public static void main(String[] args) {
String str = "[{\"id\":\"01\",\"pid\":\"0\",\"children\":[{\"id\":\"0101\",\"pid\":\"01\",\"children\":[{\"id\":\"010101\",\"pid\":\"0101\",\"children\":[],\"name\":\"出租房屋巡查\"}],\"name\":\"出租房屋巡查\"},{\"id\":\"0102\",\"pid\":\"01\",\"children\":[],\"name\":\"重点场所巡查\"},{\"id\":\"0103\",\"pid\":\"01\",\"children\":[],\"name\":\"宗教活动\"},{\"id\":\"0199\",\"pid\":\"01\",\"children\":[],\"name\":\"其他\"}],\"name\":\"重点巡查\"},{\"id\":\"02\",\"pid\":\"0\",\"children\":[{\"id\":\"0201\",\"pid\":\"02\",\"children\":[],\"name\":\"刑满释放人员\"},{\"id\":\"0202\",\"pid\":\"02\",\"children\":[],\"name\":\"社区矫正\"},{\"id\":\"0203\",\"pid\":\"02\",\"children\":[],\"name\":\"吸毒人员\"},{\"id\":\"0204\",\"pid\":\"02\",\"children\":[],\"name\":\"信访人员\"},{\"id\":\"0205\",\"pid\":\"02\",\"children\":[],\"name\":\"重点青少年\"},{\"id\":\"0206\",\"pid\":\"02\",\"children\":[],\"name\":\"精神障碍者\"}],\"name\":\"特殊人群\"},{\"id\":\"09\",\"pid\":\"0\",\"children\":[{\"id\":\"0901\",\"pid\":\"09\",\"children\":[],\"name\":\"公共服务\"},{\"id\":\"0902\",\"pid\":\"09\",\"children\":[],\"name\":\"权益保障\"},{\"id\":\"0903\",\"pid\":\"09\",\"children\":[],\"name\":\"政策宣传\"},{\"id\":\"0904\",\"pid\":\"09\",\"children\":[],\"name\":\"便利服务\"},{\"id\":\"0999\",\"pid\":\"09\",\"children\":[],\"name\":\"其他\"}],\"name\":\"为民服务\"}]"; String str = "[{\"id\":\"01\",\"pid\":\"0\",\"children\":[{\"id\":\"0101\",\"pid\":\"01\",\"children\":[{\"id\":\"010101\",\"pid\":\"0101\",\"children\":[],\"name\":\"出租房屋巡查\"}],\"name\":\"出租房屋巡查\"},{\"id\":\"0102\",\"pid\":\"01\",\"children\":[],\"name\":\"重点场所巡查\"},{\"id\":\"0103\",\"pid\":\"01\",\"children\":[],\"name\":\"宗教活动\"},{\"id\":\"0199\",\"pid\":\"01\",\"children\":[],\"name\":\"其他\"}],\"name\":\"重点巡查\"},{\"id\":\"02\",\"pid\":\"0\",\"children\":[{\"id\":\"0201\",\"pid\":\"02\",\"children\":[],\"name\":\"刑满释放人员\"},{\"id\":\"0202\",\"pid\":\"02\",\"children\":[],\"name\":\"社区矫正\"},{\"id\":\"0203\",\"pid\":\"02\",\"children\":[],\"name\":\"吸毒人员\"},{\"id\":\"0204\",\"pid\":\"02\",\"children\":[],\"name\":\"信访人员\"},{\"id\":\"0205\",\"pid\":\"02\",\"children\":[],\"name\":\"重点青少年\"},{\"id\":\"0206\",\"pid\":\"02\",\"children\":[],\"name\":\"精神障碍者\"}],\"name\":\"特殊人群\"},{\"id\":\"09\",\"pid\":\"0\",\"children\":[{\"id\":\"0901\",\"pid\":\"09\",\"children\":[],\"name\":\"公共服务\"},{\"id\":\"0902\",\"pid\":\"09\",\"children\":[],\"name\":\"权益保障\"},{\"id\":\"0903\",\"pid\":\"09\",\"children\":[],\"name\":\"政策宣传\"},{\"id\":\"0904\",\"pid\":\"09\",\"children\":[],\"name\":\"便利服务\"},{\"id\":\"0999\",\"pid\":\"09\",\"children\":[],\"name\":\"其他\"}],\"name\":\"为民服务\"}]";
List<DictTreeResultDTO> dtos = JSON.parseArray(str, DictTreeResultDTO.class); List<DictTreeResultDTO> dtos = JSON.parseArray(str, DictTreeResultDTO.class);

Loading…
Cancel
Save