Browse Source

Merge remote-tracking branch 'origin/dev_icservice'

feature/teamB_zz_wgh
yinzuomei 3 years ago
parent
commit
ede123590c
  1. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java
  2. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java
  3. 31
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  4. 60
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java

@ -194,7 +194,13 @@ public enum RequirePermissionEnum {
/**
* 基层治理-群众直报 功能入口
*/
RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报");
RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报"),
/**
* 事件管理-工作端小程序列表详情接口权限
*/
IC_EVENT_LIST("ic_event_list","基层治理:事件管理:列表","基层治理-事件管理-列表"),
IC_EVENT_DETAIL("ic_event_detail","基层治理:事件管理:详情","基层治理-事件管理-详情");
private String key;
private String name;

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java

@ -44,7 +44,7 @@ public class IcEventListResultDTO implements Serializable {
/**
* 音频[url集合]
*/
private List<String> voiceList;
private List<Attachment> voiceList;
/**
* 上报渠道
*/

31
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -5,9 +5,11 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
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.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
@ -63,6 +65,17 @@ public class IcEventController {
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
}
/**
* @Author sun
* @Description 工作端小程序-事件管理-列表
**/
@RequestMapping("gov-list")
@RequirePermission(requirePermission = RequirePermissionEnum.IC_EVENT_LIST)
public Result<PageData<IcEventListResultDTO>> govList(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcEventDTO> get(@PathVariable("id") String id){
@ -70,6 +83,7 @@ public class IcEventController {
return new Result<IcEventDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
@ -189,6 +203,7 @@ public class IcEventController {
* @Author sun
* @Description 事件管理-回复
**/
@NoRepeatSubmit
@PostMapping("reply")
public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
@ -202,6 +217,7 @@ public class IcEventController {
* @Author sun
* @Description 事件管理-立项
**/
@NoRepeatSubmit
@PostMapping("icEventToProject")
public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -265,6 +281,18 @@ public class IcEventController {
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
}
/**
* @Author sun
* @Description 工作端小程序-事件管理-详情
**/
@PostMapping("gov-detail")
@RequirePermission(requirePermission = RequirePermissionEnum.IC_EVENT_DETAIL)
public Result<IcEventListResultDTO> govDetail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
}
/**
* 事件分类分析- 饼图2直属下级 事件数量
@ -320,6 +348,7 @@ public class IcEventController {
* @author zxc
* @date 2022/5/19 13:38
*/
@NoRepeatSubmit
@PostMapping("add-event-resi")
public Result addEventFromResi(@LoginUser TokenDto tokenDto,@RequestBody AddEventFromResiFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class);
@ -394,6 +423,7 @@ public class IcEventController {
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("resi-reply")
public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -407,6 +437,7 @@ public class IcEventController {
* @Author sun
* @Description 数字平台-事件导出
**/
@NoRepeatSubmit
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO, HttpServletResponse response) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());

60
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -135,12 +135,12 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//每个事件对应的图片数据
if(!CollectionUtils.isEmpty(dto.getAttachmentList())){
List<String> imageList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>();
for(IcEventListResultDTO.Attachment file: dto.getAttachmentList()){
if ("image".equals(file.getType())) {
imageList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
voiceList.add(file);
}
}
dto.setImageList(imageList);
@ -993,7 +993,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/**
* @Author sun
* @Description 事件管理-评价
* @Description 事件管理-详情
**/
@Override
public IcEventListResultDTO detail(IcEventListFormDTO formDTO) {
@ -1022,12 +1022,12 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//每个事件对应的图片数据
if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){
List<String> imageList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>();
resultDTO.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imageList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
voiceList.add(file);
}
});
resultDTO.setImageList(imageList);
@ -1212,6 +1212,27 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setActualServiceTime(formDTO.getActualServiceTime());
icEventOperationLogService.insert(logEntity);
}
//4.判断来源居民端的事件,需求、项目结案时给居民推送站内信
if("0".equals(entity.getSourceType())){
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId());
messageFormDTO.setApp(ProjectConstant.RESI);
messageFormDTO.setGridId(entity.getGridId());
messageFormDTO.setUserId(entity.getCreatedBy());
messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE);
messageFormDTO.setMessageContent(String.format("您上报的事件已完成,请查看。"));
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT);
messageFormDTO.setTargetId(entity.getId());
msgList.add(messageFormDTO);
Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList);
if (!sendMessageRes.success()) {
log.warn(String.format("事件回复,给居民端用户发送站内信异常,事件Id->%s", entity.getId()));
}
}
}
/**
@ -1458,6 +1479,35 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setActionDesc(ResiEventAction.REPLY.getDesc());
logEntity.setOperateTime(new Date());
icEventOperationLogService.insert(logEntity);
// 4.给工作端社区的人发送消息:山东路168号-张先生对事件进行了新的回复,请查看
noticeStaffResiReply(entity.getAgencyId(),entity.getCustomerId(),replyEntity.getUserShowName(),entity.getId());
}
public void noticeStaffResiReply(String agencyId,String customerId,String showName,String icEventId){
// 查询组织下的所有工作人员
AgencyIdFormDTO formDTO = new AgencyIdFormDTO();
formDTO.setAgencyId(agencyId);
Result<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO);
if (!agencyStaffsResult.success()){
throw new EpmetException("查询组织下工作人员失败...");
}
if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){
List<UserMessageFormDTO> msgList = new ArrayList<>();
agencyStaffsResult.getData().forEach(u -> {
UserMessageFormDTO msg = new UserMessageFormDTO();
msg.setUserId(u);
msg.setCustomerId(customerId);
msg.setTargetId(icEventId);
msg.setGridId("*");
msg.setApp(AppClientConstant.APP_GOV);
msg.setMessageType(UserMessageTypeConstant.IC_EVENT);
msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setTitle("您有一条事件消息");
msg.setMessageContent(showName+"对事件进行了新的回复,请查看。");
msgList.add(msg);
});
messageOpenFeignClient.saveUserMessageList(msgList);
}
}
/**

Loading…
Cancel
Save