Browse Source

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

dev_shibei_match
yinzuomei 4 years ago
parent
commit
8709ecfbe2
  1. 13
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java
  2. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java
  3. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java
  4. 10
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java
  5. 11
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml
  6. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java
  7. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java
  8. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.java
  9. 43
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  10. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  11. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
  12. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java
  13. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  14. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  15. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.10__add_matter_img.sql
  16. 21
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  17. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java
  18. 20
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java
  19. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  20. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java
  21. 45
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  22. 61
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  23. 42
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  24. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml

13
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java

@ -18,7 +18,9 @@
package com.epmet.controller;
import com.baomidou.mybatisplus.extension.api.R;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -162,4 +164,15 @@ public class UserMessageController {
List<StaffMessageResultDTO> list = userMessageService.queryStaffMessage(formDTO);
return new Result<List<StaffMessageResultDTO>>().ok(list);
}
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
@PostMapping("delreadmsg")
public Result delReadMsg(@LoginUser TokenDto tokenDto) {
userMessageService.delReadMsg(tokenDto.getUserId());
return new Result();
}
}

6
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java

@ -62,4 +62,10 @@ public interface UserMessageDao extends BaseDao<UserMessageEntity> {
* @Date 2020/5/17 16:47
**/
List<StaffMessageResultDTO> queryStaffMessage(StaffMessageFormDTO formDTO);
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
int delReadMsg(@Param("userId") String userId);
}

6
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java

@ -142,4 +142,10 @@ public interface UserMessageService extends BaseService<UserMessageEntity> {
StaffUnReadMsgResultDTO queryUnReadMsg(StaffMessageCommonFormDTO formDTO);
List<StaffMessageResultDTO> queryStaffMessage(StaffMessageFormDTO formDTO);
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
void delReadMsg(String userId);
}

10
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java

@ -209,4 +209,14 @@ public class UserMessageServiceImpl extends BaseServiceImpl<UserMessageDao, User
List<StaffMessageResultDTO> list = baseDao.queryStaffMessage(formDTO);
return list;
}
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
@Override
public void delReadMsg(String userId) {
baseDao.delReadMsg(userId);
}
}

11
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml

@ -81,4 +81,15 @@
ORDER BY CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<delete id="delReadMsg">
UPDATE user_message
SET del_flag = '0',
updated_by = #{userId},
updated_time = NOW()
WHERE
read_flag = 'read'
AND user_id = #{userId}
</delete>
</mapper>

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java

@ -98,4 +98,9 @@ public class IcPartyServiceCenterMatterDTO implements Serializable {
*/
private String customerId;
/**
* 封面图
*/
private String matterImg;
}

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

@ -38,10 +38,13 @@ public class MatterListDTO implements Serializable {
private String appointmentType;
private String matterImg;
public MatterListDTO() {
this.sort = NumConstant.ZERO;
this.matterName = "";
this.matterId = "";
this.allowTime = "";
this.matterImg = "";
}
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.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/20 1:50 下午
* @DESC
*/
@Data
public class AllMattersFormDTO implements Serializable {
private static final long serialVersionUID = 5292223887794821327L;
public interface AllMattersForm{}
@NotBlank(message = "gridId不能为空",groups = AllMattersForm.class)
private String gridId;
}

43
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/20 1:51 下午
* @DESC
*/
@Data
public class AllMattersResultDTO implements Serializable {
private static final long serialVersionUID = -2859875516671396422L;
/**
* 可预约事项名字
*/
private String matterName;
/**
* 可预约时间
*/
private String allowTime;
/**
* 可预约事项ID
*/
private String matterId;
/**
* 事项封面图
*/
private String matterImg;
public AllMattersResultDTO() {
this.matterName = "";
this.allowTime = "";
this.matterId = "";
this.matterImg = "";
}
}

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

@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -204,4 +205,17 @@ public class IcPartyServiceCenterController {
return new Result();
}
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@PostMapping("getallmatters")
public Result<List<AllMattersResultDTO>> getAllMatters(@RequestBody AllMattersFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AllMattersFormDTO.AllMattersForm.class);
return new Result<List<AllMattersResultDTO>>().ok(icPartyServiceCenterService.getAllMatters(formDTO));
}
}

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

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
import org.apache.ibatis.annotations.Mapper;
@ -42,4 +43,12 @@ public interface IcPartyServiceCenterDao extends BaseDao<IcPartyServiceCenterEnt
*/
List<PartyServiceCenterListResultDTO> partyServiceCenterList(@Param("orgId")String orgId);
/**
* @Description 获取网格所属组织下所有的可预约事项
* @param orgId
* @author zxc
* @date 2021/12/21 1:59 下午
*/
List<AllMattersResultDTO> getAllMatters(@Param("orgId")String orgId);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java

@ -68,4 +68,9 @@ public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 封面图
*/
private String matterImg;
}

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

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -166,4 +167,12 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/
void cancelAppointment(CancelAppointmentFormDTO formDTO);
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO);
}

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

@ -31,6 +31,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -40,10 +41,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import com.epmet.entity.IcPartyServiceCenterEntity;
import com.epmet.entity.IcPartyServiceCenterMatterEntity;
@ -326,6 +324,13 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
}
formDTO.setOrgId(staffInfo.getAgencyId());
}
if (StringUtils.isNotBlank(formDTO.getOrgType()) && formDTO.getOrgType().equals("grid")){
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getOrgId()));
}
formDTO.setOrgId(gridInfo.getPid());
}
List<PartyServiceCenterListResultDTO> result = baseDao.partyServiceCenterList(formDTO.getOrgId());
if (CollectionUtils.isNotEmpty(result)){
result.forEach(r -> {
@ -435,6 +440,25 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId());
}
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@Override
public List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getGridId()));
}
List<AllMattersResultDTO> allMatters = baseDao.getAllMatters(gridInfo.getPid());
if (CollectionUtils.isNotEmpty(allMatters)){
return allMatters;
}
return new ArrayList<>();
}
public List<TimeDTO> getTimeList(String start,String end,Integer interval){
List<TimeDTO> result = new ArrayList<>();
List<String> intervalTimeList = getIntervalTimeList(start, end, interval);

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.10__add_matter_img.sql

@ -0,0 +1 @@
alter table ic_party_service_center_matter add COLUMN MATTER_IMG VARCHAR(256) NOT NULL comment '封面图' AFTER END_TIME;

21
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -22,6 +22,7 @@
<result property="endTime" column="endTime"/>
<result property="appointmentType" column="appointmentType"/>
<result property="sort" column="sort"/>
<result property="matterImg" column="matterImg"/>
</collection>
</resultMap>
<select id="partyServiceCenterList" resultMap="partyServiceCenterListMap">
@ -44,11 +45,29 @@
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
FROM ic_party_service_center sc
LEFT JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = sc.ID AND cm.DEL_FLAG = 0)
WHERE sc.DEL_FLAG = 0
AND ORG_ID = #{orgId}
ORDER BY sc.CREATED_TIME DESC
</select>
<!-- 获取网格所属组织下所有的可预约事项 -->
<select id="getAllMatters" resultType="com.epmet.dto.result.AllMattersResultDTO">
SELECT
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0
AND c.ORG_ID = #{orgId}
</select>
</mapper>

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java

@ -31,4 +31,6 @@ public class ReplyFormDTO implements Serializable {
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
private String customerId;
}

20
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/UserMessageConstant.java

@ -57,4 +57,24 @@ public interface UserMessageConstant {
*/
String STAY_REMINDER_MSG_3 = "滞留项目:%n%s";
/**
* 事件消息标题
*/
String EVENT_TITILE = "您有一条事件消息!";
/**
* 事件被@的人或上报给网格或组织的回复
*/
String REPLY_EVENT = "%s对您上报的事件进行了回复,请查看。";
/**
* 事件被立项
*/
String PROJECT_EVENT = "%s将您上报的事件转为项目,请查看。";
/**
* 事件被办结
*/
String RCLOSE_PROJECT_EVENT = "%s将您上报的事件状态调整为已办结,请查看。";
}

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java

@ -72,6 +72,7 @@ public class ResiEventReplyController {
@PostMapping("govReply")
public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){
replyFormDTO.setUserId(tokenDto.getUserId());
replyFormDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(replyFormDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class);
resiEventReplyService.govReply(replyFormDTO);
return new Result();

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java

@ -64,4 +64,6 @@ public interface ResiEventReportOrgDao extends BaseDao<ResiEventReportOrgEntity>
Integer selectUnReadCount(String agencyId);
Integer selectRedCount(String agencyId);
ResiEventReportOrgEntity getByEventId(@Param("resiEventId") String resiEventId);
}

45
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -41,6 +41,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -879,6 +880,10 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
log.error("【项目流转】上链失败,错误信息:{}", errorMsg);
}
//2021.12.21 给报事人推送站内信 sun start
sendMsg(resiEventEntity);
//2021.12.21 给报事人推送站内信 sun end
return resultDTO;
}
@ -1011,4 +1016,44 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
logger.info("事件立项,推送微信订阅消息");
return epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
}
/**
* @author sun
* 事件立项-给报事人推送站内信
*/
private void sendMsg(ResiEventEntity resiEventEntity){
//查询事件上报给网格还是组织信息
ResiEventReportOrgEntity reportOrg = resiEventReportOrgDao.getByEventId(resiEventEntity.getId());
String name = "";
if ("grid".equals(reportOrg.getOrgType())) {
Result<GridInfoResultDTO> gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrg.getOrgId());
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new RenException("网格信息查询异常");
}
name = gridInfoRes.getData().getGridName();
} else {
AgencyInfoFormDTO dto = new AgencyInfoFormDTO();
dto.setOrgId(reportOrg.getOrgId());
dto.setOrgType(reportOrg.getOrgType());
Result<AgencyInfoResultDTO> agencyResult = govOrgOpenFeignClient.agencyInfo(dto);
if (!agencyResult.success() || null == agencyResult.getData()) {
throw new RenException("组织信息查询异常");
}
name = agencyResult.getData().getAgencyName();
}
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(resiEventEntity.getCustomerId());
userMessage.setGridId(resiEventEntity.getGridId());
String messageContent = String.format(UserMessageConstant.PROJECT_EVENT, name);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.EVENT_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.EVENT);
userMessage.setTargetId(resiEventEntity.getId());
//通知事件上报人
userMessage.setUserId(resiEventEntity.getReportUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
}
}

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

@ -18,24 +18,28 @@
package com.epmet.service.impl;
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
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.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.ReplyFormDTO;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.result.GridInfoResultDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.ResiEventEntity;
import com.epmet.entity.ResiEventOperationLogEntity;
import com.epmet.entity.ResiEventReplyEntity;
import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ResiEventReplyService;
@ -71,6 +75,8 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@ -140,6 +146,32 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId todo
//2021.12.21 给报事人推送站内信 sun start
//查询事件上报给网格还是组织信息
ResiEventReportOrgEntity reportOrgEntity = resiEventReportOrgDao.getByEventId(eventEntity.getId());
String name = staffResult.getData().getOrganizationName();
if ("grid".equals(reportOrgEntity.getOrgType())) {
Result<GridInfoResultDTO> gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrgEntity.getOrgId());
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new RenException("网格信息查询异常");
}
name = gridInfoRes.getData().getGridName();
}
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(replyFormDTO.getCustomerId());
userMessage.setGridId(eventEntity.getGridId());
String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.EVENT_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.EVENT);
userMessage.setTargetId(eventEntity.getId());
//通知事件上报人
userMessage.setUserId(eventEntity.getReportUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
//2021.12.21 给报事人推送站内信 sun end
}
private ResiEventEntity queryResiEntity(String resiEventId) {
@ -254,6 +286,25 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
resiEventDao.updateById(eventEntity);
// 3、组织改为显示
resiEventReportOrgDao.updateRedDotShow(replyFormDTO.getResiEventId());
//2021.12.21 给报事人推送站内信 sun start
//查询被@的人大代表信息
ResiEventMentionEntity eventMentionEntity = resiEventMentionDao.selectUser(replyFormDTO.getResiEventId(), replyFormDTO.getUserId());
String name = "人大代表" + eventMentionEntity.getUserShowName();
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(replyFormDTO.getCustomerId());
userMessage.setGridId(eventEntity.getGridId());
String messageContent = String.format(UserMessageConstant.REPLY_EVENT, name);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.EVENT_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.EVENT);
userMessage.setTargetId(eventEntity.getId());
//通知事件上报人
userMessage.setUserId(eventEntity.getReportUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
//2021.12.21 给报事人推送站内信 sun end
}
private void scanReplyContent(String content) {

42
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
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.form.FileCommonDTO;
@ -35,8 +36,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
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.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.IssueProjectCategoryDictDTO;
@ -44,6 +44,7 @@ import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
@ -96,6 +97,8 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
private ProjectCategoryService projectCategoryService;
@Autowired
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
@ -605,6 +608,41 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
// 3.2、人大代表在未读/已读列表中展示红点
resiEventMentionDao.updateRedDotShow(formDTO.getEventId(),null);
// 3.3、目前Db设计支持报给多个层级(组织或网格),按理说应该更新非当前组织外,其他的组织,显示红点,先不做了吧 todo
//2021.12.21 给报事人推送站内信 sun start
//查询事件上报给网格还是组织信息
ResiEventReportOrgEntity reportOrgEntity = resiEventReportOrgDao.getByEventId(resiEventEntity.getId());
String name = "";
if ("grid".equals(reportOrgEntity.getOrgType())) {
Result<GridInfoResultDTO> gridInfoRes = govOrgOpenFeignClient.queryGridInfo(reportOrgEntity.getOrgId());
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new RenException("网格信息查询异常");
}
name = gridInfoRes.getData().getGridName();
} else {
AgencyInfoFormDTO dto = new AgencyInfoFormDTO();
dto.setOrgId(reportOrgEntity.getOrgId());
dto.setOrgType(reportOrgEntity.getOrgType());
Result<AgencyInfoResultDTO> agencyResult = govOrgOpenFeignClient.agencyInfo(dto);
if (!agencyResult.success() || null == agencyResult.getData()) {
throw new RenException("组织信息查询异常");
}
name = agencyResult.getData().getAgencyName();
}
UserMessageFormDTO userMessage = new UserMessageFormDTO();
userMessage.setApp(AppClientConstant.APP_RESI);
userMessage.setCustomerId(resiEventEntity.getCustomerId());
userMessage.setGridId(resiEventEntity.getGridId());
String messageContent = String.format(UserMessageConstant.RCLOSE_PROJECT_EVENT, name);
userMessage.setMessageContent(messageContent);
userMessage.setReadFlag(ReadFlagConstant.UN_READ);
userMessage.setTitle(UserMessageConstant.EVENT_TITILE);
userMessage.setMessageType(UserMessageTypeConstant.EVENT);
userMessage.setTargetId(resiEventEntity.getId());
//通知事件上报人
userMessage.setUserId(resiEventEntity.getReportUserId());
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
//2021.12.21 给报事人推送站内信 sun end
}
/**

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml

@ -56,4 +56,12 @@
AND M.ORG_READ='read'
and m.RED_DOT='1'
</select>
<select id="getByEventId" resultType="com.epmet.entity.ResiEventReportOrgEntity">
SELECT
*
FROM resi_event_report_org
WHERE del_flag='0'
AND resi_event_id = #{resiEventId}
LIMIT 1
</select>
</mapper>
Loading…
Cancel
Save