Browse Source

增加城管上报功能;

dev
luyan 2 years ago
parent
commit
04c937c295
  1. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java
  2. 104
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  3. 21
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java
  4. 18
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java
  5. 19
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  6. 380
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  7. 102
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/utils/IcEventReportUtils.java
  8. 191
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/utils/ReportCityManageData.java

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

@ -202,6 +202,11 @@ public class IcEventListResultDTO implements Serializable {
*/ */
private String difficultPointName; private String difficultPointName;
/**
* 日照:上报城管返回案卷唯一标识
*/
private String taskNum;
/** /**
* 事件附件 * 事件附件
*/ */

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

@ -34,10 +34,12 @@ import com.epmet.service.IcEventReplyService;
import com.epmet.service.IcEventService; import com.epmet.service.IcEventService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Date; import java.util.Date;
@ -62,6 +64,7 @@ public class IcEventController {
/** /**
* 事件管理-列表 * 事件管理-列表
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -72,6 +75,7 @@ public class IcEventController {
formDTO.setStaffId(tokenDto.getUserId()); formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO)); return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
} }
/** /**
* @Author sun * @Author sun
* @Description 工作端小程序-事件管理-列表 * @Description 工作端小程序-事件管理-列表
@ -84,28 +88,29 @@ public class IcEventController {
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO)); return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
} }
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcEventDTO> get(@PathVariable("id") String id){ public Result<IcEventDTO> get(@PathVariable("id") String id) {
IcEventDTO data = icEventService.get(id); IcEventDTO data = icEventService.get(id);
return new Result<IcEventDTO>().ok(data); return new Result<IcEventDTO>().ok(data);
} }
/** /**
* 事件管理-新增 * 事件管理-新增
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
*/ */
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("add") @PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp()); formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient()); formDTO.setClient(tokenDto.getClient());
if("3".equals(formDTO.getOperationType())){ if ("3".equals(formDTO.getOperationType())) {
ValidatorUtils.validateEntity(formDTO.getIssueInfo(),IcEventToIssueFormDTO.AddEventAndShiftIssue.class); ValidatorUtils.validateEntity(formDTO.getIssueInfo(), IcEventToIssueFormDTO.AddEventAndShiftIssue.class);
} }
icEventService.save(formDTO); icEventService.save(formDTO);
return new Result(); return new Result();
@ -113,7 +118,7 @@ public class IcEventController {
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("update") @PostMapping("update")
public Result update(@RequestBody IcEventDTO dto){ public Result update(@RequestBody IcEventDTO dto) {
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icEventService.update(dto); icEventService.update(dto);
@ -121,7 +126,7 @@ public class IcEventController {
} }
@PostMapping("delete") @PostMapping("delete")
public Result delete(@RequestBody String[] ids){ public Result delete(@RequestBody String[] ids) {
//效验数据 //效验数据
AssertUtils.isArrayEmpty(ids, "id"); AssertUtils.isArrayEmpty(ids, "id");
icEventService.delete(ids); icEventService.delete(ids);
@ -130,6 +135,7 @@ public class IcEventController {
/** /**
* 事件处理分析-处理状态比例查询 * 事件处理分析-处理状态比例查询
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
@ -148,6 +154,7 @@ public class IcEventController {
/** /**
* 事件处理分析-事件列表 * 事件处理分析-事件列表
*
* @param input * @param input
* @return * @return
*/ */
@ -169,6 +176,7 @@ public class IcEventController {
/** /**
* 时间处理分析-阅读增量查询 * 时间处理分析-阅读增量查询
*
* @param input * @param input
* @return * @return
*/ */
@ -190,6 +198,7 @@ public class IcEventController {
/** /**
* 研判分析查询 * 研判分析查询
*
* @param eventId * @param eventId
* @return * @return
*/ */
@ -201,6 +210,7 @@ public class IcEventController {
/** /**
* 组织下分类下的事件列表 * 组织下分类下的事件列表
*
* @param input * @param input
* @return * @return
*/ */
@ -215,13 +225,14 @@ public class IcEventController {
PageData<IcEventResultDTO> page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize); PageData<IcEventResultDTO> page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize);
return new Result<PageData<IcEventResultDTO>>().ok(page); return new Result<PageData<IcEventResultDTO>>().ok(page);
} }
/** /**
* @Author sun * @Author sun
* @Description 事件管理-回复 * @Description 事件管理-回复
**/ **/
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("reply") @PostMapping("reply")
public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){ public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -235,12 +246,12 @@ public class IcEventController {
**/ **/
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("icEventToProject") @PostMapping("icEventToProject")
public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){ public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp()); formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient()); formDTO.setClient(tokenDto.getClient());
ValidatorUtils.validateEntity(formDTO,IcEventToProjectFormDTO.ApprovalCategory.class,IcEventToProjectFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, IcEventToProjectFormDTO.ApprovalCategory.class, IcEventToProjectFormDTO.AddUserInternalGroup.class);
icEventService.icEventToProject(formDTO); icEventService.icEventToProject(formDTO);
return new Result(); return new Result();
} }
@ -250,7 +261,7 @@ public class IcEventController {
* @Description 事件管理-转需求 * @Description 事件管理-转需求
**/ **/
@PostMapping("icEventToDemand") @PostMapping("icEventToDemand")
public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO){ public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setDemandUserId(tokenDto.getUserId()); formDTO.setDemandUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.AddUserShowGroup.class, IcDemandFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.AddUserShowGroup.class, IcDemandFormDTO.AddUserInternalGroup.class);
@ -260,6 +271,7 @@ public class IcEventController {
/** /**
* 事件转议题 * 事件转议题
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -283,7 +295,7 @@ public class IcEventController {
public Result<List<IcEventCategoryAnalysisResDTO>> categoryAnalysisTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) { public Result<List<IcEventCategoryAnalysisResDTO>> categoryAnalysisTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId()); formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcEventCategoryAnalysisFormDTO.TotalPie.class); ValidatorUtils.validateEntity(formDTO, IcEventCategoryAnalysisFormDTO.TotalPie.class);
List<IcEventCategoryAnalysisResDTO> list = icEventService.categoryAnalysisTotal(formDTO); List<IcEventCategoryAnalysisResDTO> list = icEventService.categoryAnalysisTotal(formDTO);
return new Result<List<IcEventCategoryAnalysisResDTO>>().ok(list); return new Result<List<IcEventCategoryAnalysisResDTO>>().ok(list);
} }
@ -319,7 +331,7 @@ public class IcEventController {
* @Author sun * @Author sun
* @Description 事件管理-详情 * @Description 事件管理-详情
**/ **/
@MaskResponse(fieldNames = { "idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD }) @MaskResponse(fieldNames = {"idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD})
@PostMapping("detail") @PostMapping("detail")
public Result<IcEventListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { public Result<IcEventListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
@ -327,6 +339,45 @@ public class IcEventController {
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class); ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO)); return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
} }
/**
* 日照事件上报城管
*
* @param formDTO
* @return
*/
@MaskResponse(fieldNames = {"idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD})
@PostMapping("reportCityManager")
public Result reportCityManager(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) throws IOException {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
IcEventListResultDTO data = icEventService.detail(formDTO);
if (null != data && StringUtils.isNotEmpty(data.getTaskNum())) {
return new Result().error(-1, "该事件已上报,请勿重复上报!");
}
return icEventService.reportCityManager(data);
}
/**
* 查询上报城管数据处理状态
*
* @param icEventId 事件ID
* @param taskNum 上报城管返回案卷唯一标识
* @return
*/
@GetMapping("checkReportStatus")
public Result checkReportStatus(@PathParam("icEventId") String icEventId, @PathParam("taskNum") String taskNum) throws IOException {
if (StringUtils.isEmpty(icEventId)) {
return new Result().error(-1, "请确认事件是否存在!");
}
if (StringUtils.isEmpty(taskNum)) {
return new Result().error(-1, "请确认事件是否已经上报!");
}
return icEventService.checkReportStatus(icEventId, taskNum);
}
/** /**
* @Author sun * @Author sun
* @Description 工作端小程序-事件管理-详情 * @Description 工作端小程序-事件管理-详情
@ -342,6 +393,7 @@ public class IcEventController {
/** /**
* 事件分类分析- 饼图2直属下级 事件数量 * 事件分类分析- 饼图2直属下级 事件数量
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -367,12 +419,13 @@ public class IcEventController {
/** /**
* Desc: 定时任务自动评价 * Desc: 定时任务自动评价
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/5/18 16:35 * @date 2022/5/18 16:35
*/ */
@PostMapping("auto-evaluation") @PostMapping("auto-evaluation")
public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO){ public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO) {
icEventService.autoEvaluation(formDTO); icEventService.autoEvaluation(formDTO);
return new Result(); return new Result();
} }
@ -390,6 +443,7 @@ public class IcEventController {
/** /**
* Desc: 新增随手拍 * Desc: 新增随手拍
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @author zxc * @author zxc
@ -397,7 +451,7 @@ public class IcEventController {
*/ */
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("add-event-resi") @PostMapping("add-event-resi")
public Result addEventFromResi(@LoginUser TokenDto tokenDto,@RequestBody AddEventFromResiFormDTO formDTO){ public Result addEventFromResi(@LoginUser TokenDto tokenDto, @RequestBody AddEventFromResiFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class); ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
@ -408,6 +462,7 @@ public class IcEventController {
/** /**
* 居民端小程序我上报的事件-列表+详情 * 居民端小程序我上报的事件-列表+详情
* yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781 * yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -422,6 +477,7 @@ public class IcEventController {
/** /**
* 居民端我上报的事件 消息列表跳转详情 * 居民端我上报的事件 消息列表跳转详情
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -437,20 +493,22 @@ public class IcEventController {
/** /**
* 居民端小程序我上报的事件详情页面-回复列表 * 居民端小程序我上报的事件详情页面-回复列表
* http://yapi.elinkservice.cn/project/102/interface/api/7783 * http://yapi.elinkservice.cn/project/102/interface/api/7783
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
@PostMapping("reply-list") @PostMapping("reply-list")
public Result<List<IcEventReplyDTO>> replyList(@LoginUser TokenDto tokenDto,@RequestBody MyReportIcEvFormDTO formDTO) { public Result<List<IcEventReplyDTO>> replyList(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.ReplyListGroup.class); ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.ReplyListGroup.class);
return new Result<List<IcEventReplyDTO>>().ok(icEventReplyService.replyList(formDTO.getIcEventId(),formDTO.getUserId())); return new Result<List<IcEventReplyDTO>>().ok(icEventReplyService.replyList(formDTO.getIcEventId(), formDTO.getUserId()));
} }
/** /**
* 居民端小程序我上报的事件-处理中 * 居民端小程序我上报的事件-处理中
* 点击事件进入详情页时调用此接口消除红点 * 点击事件进入详情页时调用此接口消除红点
* yapihttp://yapi.elinkservice.cn/project/102/interface/api/7790 * yapihttp://yapi.elinkservice.cn/project/102/interface/api/7790
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
@ -466,16 +524,17 @@ public class IcEventController {
/** /**
* 居民端我上报的事件-回复 * 居民端我上报的事件-回复
* http://yapi.elinkservice.cn/project/102/interface/api/7789 * http://yapi.elinkservice.cn/project/102/interface/api/7789
*
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return * @return
*/ */
@NoRepeatSubmit @NoRepeatSubmit
@PostMapping("resi-reply") @PostMapping("resi-reply")
public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){ public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class,ResiReplyIcEventFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class, ResiReplyIcEventFormDTO.AddUserInternalGroup.class);
icEventService.resiReply(formDTO); icEventService.resiReply(formDTO);
return new Result(); return new Result();
} }
@ -501,8 +560,8 @@ public class IcEventController {
List<IcEventExcel> list = null; List<IcEventExcel> list = null;
do { do {
data = icEventService.list(formDTO); data = icEventService.list(formDTO);
data.getList().forEach(d->{ data.getList().forEach(d -> {
if(!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())){ if (!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())) {
d.setImageUrl(d.getImageList().get(NumConstant.ZERO)); d.setImageUrl(d.getImageList().get(NumConstant.ZERO));
} }
}); });
@ -515,7 +574,7 @@ public class IcEventController {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8"); response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter(); PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result)); printWriter.write(JSON.toJSONString(result));
printWriter.close(); printWriter.close();
} catch (Exception e) { } catch (Exception e) {
@ -551,6 +610,7 @@ public class IcEventController {
/** /**
* 数据分析-个人档案-上报事件列表,根据epmetUserIdList查询 * 数据分析-个人档案-上报事件列表,根据epmetUserIdList查询
* 模仿gov/project/resieventreply/pageuserreported接口重新查询新表接口 * 模仿gov/project/resieventreply/pageuserreported接口重新查询新表接口
*
* @author sun * @author sun
*/ */
@PostMapping("icevent-pageuserreported") @PostMapping("icevent-pageuserreported")

21
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java

@ -1,7 +1,6 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -15,7 +14,7 @@ import java.util.Date;
* @since v1.0.0 2022-05-17 * @since v1.0.0 2022-05-17
*/ */
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper = false)
@TableName("ic_event") @TableName("ic_event")
public class IcEventEntity extends BaseEpmetEntity { public class IcEventEntity extends BaseEpmetEntity {
@ -158,11 +157,11 @@ public class IcEventEntity extends BaseEpmetEntity {
/** /**
* 事件审核状态[涉及附件审核需要加的状态]审核中auditing * 事件审核状态[涉及附件审核需要加的状态]审核中auditing
auto_passed: 自动通过 * auto_passed: 自动通过
review结果不确定需要人工审核 * review结果不确定需要人工审核
block: 结果违规 * block: 结果违规
rejected人工审核驳回; * rejected人工审核驳回;
approved人工审核通过 * approved人工审核通过
*/ */
private String auditStatus; private String auditStatus;
@ -176,4 +175,12 @@ public class IcEventEntity extends BaseEpmetEntity {
*/ */
private String difficultPoint; private String difficultPoint;
/**
* 日照上传城管返回的任务ID
*/
private String taskNum;
private String recId;
} }

18
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventReplyEntity.java

@ -1,7 +1,6 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -15,7 +14,7 @@ import java.util.Date;
* @since v1.0.0 2022-05-17 * @since v1.0.0 2022-05-17
*/ */
@Data @Data
@EqualsAndHashCode(callSuper=false) @EqualsAndHashCode(callSuper = false)
@TableName("ic_event_reply") @TableName("ic_event_reply")
public class IcEventReplyEntity extends BaseEpmetEntity { public class IcEventReplyEntity extends BaseEpmetEntity {
@ -36,6 +35,21 @@ public class IcEventReplyEntity extends BaseEpmetEntity {
*/ */
private String fromUserId; private String fromUserId;
/**
* 日照城管处理办理人姓名
*/
private String humanName;
/**
* 日照城管办理部门办理经过
*/
private String actDefName;
/**
* 日照城管上报办理时间
*/
private Date actionTime;
/** /**
* 内容 * 内容
*/ */

19
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -2,11 +2,13 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcEventDTO; import com.epmet.dto.IcEventDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.IcEventEntity; import com.epmet.entity.IcEventEntity;
import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -73,6 +75,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 事件列表 * 事件列表
*
* @param orgId * @param orgId
* @param orgType * @param orgType
* @param categoryCode * @param categoryCode
@ -88,6 +91,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 月度增量查询 * 月度增量查询
*
* @param orgType * @param orgType
* @param orgId * @param orgId
* @param queryStartTime * @param queryStartTime
@ -98,6 +102,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 研判分析查询 * 研判分析查询
*
* @param eventId * @param eventId
* @return * @return
*/ */
@ -105,6 +110,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 同类事件列表 * 同类事件列表
*
* @param categoryPids * @param categoryPids
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
@ -132,6 +138,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 事件分类分析-一级分类下事件数量 * 事件分类分析-一级分类下事件数量
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
@ -145,6 +152,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* Desc: 定时任务自动评价 * Desc: 定时任务自动评价
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/5/18 16:35 * @date 2022/5/18 16:35
@ -162,8 +170,10 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @Description 事件管理-处理进展 * @Description 事件管理-处理进展
**/ **/
LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO); LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO);
/** /**
* 事件分类分析- 饼图2直属下级 事件数量 * 事件分类分析- 饼图2直属下级 事件数量
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
@ -178,6 +188,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* Desc: 新增随手拍 * Desc: 新增随手拍
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/5/19 13:38 * @date 2022/5/19 13:38
@ -206,12 +217,14 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 居民端我上报的事件-回复 * 居民端我上报的事件-回复
*
* @param formDTO * @param formDTO
*/ */
void resiReply(ResiReplyIcEventFormDTO formDTO); void resiReply(ResiReplyIcEventFormDTO formDTO);
/** /**
* 居民端我上报的事件 消息列表跳转详情 * 居民端我上报的事件 消息列表跳转详情
*
* @param formDTO * @param formDTO
* @return * @return
*/ */
@ -228,14 +241,20 @@ public interface IcEventService extends BaseService<IcEventEntity> {
/** /**
* 事件转议题 * 事件转议题
*
* @param formDTO * @param formDTO
*/ */
void icEventToIssue(IcEventToIssueFormDTO formDTO); void icEventToIssue(IcEventToIssueFormDTO formDTO);
/** /**
* 批量查询事件信息 * 批量查询事件信息
*
* @param icEventIds * @param icEventIds
* @return * @return
*/ */
List<IcEventDTO> batchSelectById(List<String> icEventIds); List<IcEventDTO> batchSelectById(List<String> icEventIds);
Result reportCityManager(IcEventListResultDTO data) throws IOException;
Result checkReportStatus(String icEventId, String taskNum) throws IOException;
} }

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

@ -1,6 +1,8 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -36,18 +38,31 @@ import com.epmet.enums.ProjectOriginEnum;
import com.epmet.feign.*; import com.epmet.feign.*;
import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.service.*; import com.epmet.service.*;
import com.epmet.utils.IcEventReportUtils;
import com.epmet.utils.ReportCityManageData;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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.apache.http.HttpEntity;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; 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;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function; import java.util.function.Function;
@ -102,7 +117,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
private LoginUserUtil loginUserUtil; private LoginUserUtil loginUserUtil;
public CustomerStaffInfoCacheResult getStaffInfo(String customerId,String staffId){ public CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == staffInfo) { if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId)); throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", staffId));
@ -112,7 +127,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override @Override
public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) { public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getAgencyId())){ if (StringUtils.isBlank(formDTO.getAgencyId())) {
//获取当前工作人员缓存信息 //获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId()); formDTO.setAgencyId(staffInfo.getAgencyId());
@ -159,10 +174,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
} }
//每个事件对应的图片数据 //每个事件对应的图片数据
if(!CollectionUtils.isEmpty(dto.getAttachmentList())){ if (!CollectionUtils.isEmpty(dto.getAttachmentList())) {
List<String> imageList = new ArrayList<>(); List<String> imageList = new ArrayList<>();
List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>(); List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>();
for(IcEventListResultDTO.Attachment file: dto.getAttachmentList()){ for (IcEventListResultDTO.Attachment file : dto.getAttachmentList()) {
if ("image".equals(file.getType())) { if ("image".equals(file.getType())) {
imageList.add(file.getUrl()); imageList.add(file.getUrl());
} else if ("voice".equals(file.getType())) { } else if ("voice".equals(file.getType())) {
@ -187,6 +202,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* 事件管理-新增 * 事件管理-新增
*
* @param formDTO * @param formDTO
*/ */
@Override @Override
@ -249,7 +265,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//事件Id //事件Id
String icEventId = IdWorker.getIdStr(); String icEventId = IdWorker.getIdStr();
Date nowTime=new Date(); Date nowTime = new Date();
//事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】 //事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】
int redDot = NumConstant.ZERO; int redDot = NumConstant.ZERO;
String operationType = ""; String operationType = "";
@ -284,10 +300,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
formDTO.setOperationId(recIdResult.getData().getDemandRecId()); formDTO.setOperationId(recIdResult.getData().getDemandRecId());
} }
//2-3.转议题 //2-3.转议题
if(StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.THREE_STR.equals(formDTO.getOperationType())){ if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.THREE_STR.equals(formDTO.getOperationType())) {
operationType = NumConstant.THREE_STR; operationType = NumConstant.THREE_STR;
//调用issue服务转议题 //调用issue服务转议题
PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO(); PublishIssueFormDTO issueFormDTO = new PublishIssueFormDTO();
issueFormDTO.setIssueStatus("voting"); issueFormDTO.setIssueStatus("voting");
issueFormDTO.setAddress(formDTO.getAddress()); issueFormDTO.setAddress(formDTO.getAddress());
issueFormDTO.setLatitude(formDTO.getLatitude()); issueFormDTO.setLatitude(formDTO.getLatitude());
@ -306,7 +322,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
issueFormDTO.setUpdatedTime(nowTime); issueFormDTO.setUpdatedTime(nowTime);
issueFormDTO.setDecidedTime(nowTime); issueFormDTO.setDecidedTime(nowTime);
issueFormDTO.setEventReportUserName(formDTO.getName()); issueFormDTO.setEventReportUserName(formDTO.getName());
Result<IssueDTO> issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); Result<IssueDTO> issueRes = govIssueOpenFeignClient.publishIssue(issueFormDTO);
if (!issueRes.success() || null == issueRes.getData()) { if (!issueRes.success() || null == issueRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常");
} }
@ -321,7 +337,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
entity.setGridPids(gridInfo.getPids()); entity.setGridPids(gridInfo.getPids());
entity.setLatestOperatedTime(nowTime); entity.setLatestOperatedTime(nowTime);
entity.setAuditStatus(TopicConstant.AUTO_PASSED); entity.setAuditStatus(TopicConstant.AUTO_PASSED);
if("closed_case".equals(formDTO.getStatus())){ if ("closed_case".equals(formDTO.getStatus())) {
entity.setCloseCaseTime(new Date()); entity.setCloseCaseTime(new Date());
} }
//insert(entity); //insert(entity);
@ -348,7 +364,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) { if (!CollectionUtils.isEmpty(formDTO.getCategoryList())) {
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), formDTO.getCategoryList()); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), formDTO.getCategoryList());
IcEventCategoryEntity categoryEntity = null; IcEventCategoryEntity categoryEntity = null;
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(formDTO.getCategoryList().get(NumConstant.ZERO))) { if (ca.getId().equals(formDTO.getCategoryList().get(NumConstant.ZERO))) {
categoryEntity = new IcEventCategoryEntity(); categoryEntity = new IcEventCategoryEntity();
categoryEntity.setCustomerId(formDTO.getCustomerId()); categoryEntity.setCustomerId(formDTO.getCustomerId());
@ -369,7 +385,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
Date date = new Date(); Date date = new Date();
//3-5.回复数据保存 //3-5.回复数据保存
if (StringUtils.isNotBlank(formDTO.getContent())) { if (StringUtils.isNotBlank(formDTO.getContent())) {
if(StringUtils.isEmpty(operationType)){ if (StringUtils.isEmpty(operationType)) {
operationType = NumConstant.ZERO_STR; operationType = NumConstant.ZERO_STR;
} }
redDot = NumConstant.ONE; redDot = NumConstant.ONE;
@ -452,6 +468,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* 事件管理-批量删除事件 * 事件管理-批量删除事件
*
* @param ids * @param ids
*/ */
@Override @Override
@ -460,37 +477,37 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//已立项、已转服务的事件删除时,同时删除关联的服务和项目 //已立项、已转服务的事件删除时,同时删除关联的服务和项目
for (String id : ids) { for (String id : ids) {
IcEventEntity entity = baseDao.selectById(id); IcEventEntity entity = baseDao.selectById(id);
if (null == entity){ if (null == entity) {
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"数据不存在","数据不存在"); // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"数据不存在","数据不存在");
continue; continue;
} }
//1:已转项目 2:已转需求 //1:已转项目 2:已转需求
if (NumConstant.ONE_STR.equals(entity.getOperationType())){ if (NumConstant.ONE_STR.equals(entity.getOperationType())) {
ProjectService projectService = SpringContextUtils.getBean(ProjectService.class); ProjectService projectService = SpringContextUtils.getBean(ProjectService.class);
Integer effectRow = projectService.deleteByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode()); Integer effectRow = projectService.deleteByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode());
log.info("delete project effectRow:{},eventId:{}", effectRow, id); log.info("delete project effectRow:{},eventId:{}", effectRow, id);
} else if (NumConstant.TWO_STR.equals(entity.getOperationType())){ } else if (NumConstant.TWO_STR.equals(entity.getOperationType())) {
Result<Integer> effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode()); Result<Integer> effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode());
// log.info("delete userDemand result:{},eventId:{}", effectRow, id); // log.info("delete userDemand result:{},eventId:{}", effectRow, id);
} else if(NumConstant.THREE_STR.equals(entity.getOperationType())){ } else if (NumConstant.THREE_STR.equals(entity.getOperationType())) {
DelIssueFormDTO delIssueFormDTO = new DelIssueFormDTO(); DelIssueFormDTO delIssueFormDTO = new DelIssueFormDTO();
delIssueFormDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); delIssueFormDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
delIssueFormDTO.setUserId(loginUserUtil.getLoginUserId()); delIssueFormDTO.setUserId(loginUserUtil.getLoginUserId());
delIssueFormDTO.setIssueIds(Arrays.asList(entity.getOperationId())); delIssueFormDTO.setIssueIds(Arrays.asList(entity.getOperationId()));
// 删除议题, 议题转了项目的,再单独去删除项目 // 删除议题, 议题转了项目的,再单独去删除项目
Result<List<String>> delIssueRes = govIssueOpenFeignClient.deleteIssueInternal(delIssueFormDTO); Result<List<String>> delIssueRes = govIssueOpenFeignClient.deleteIssueInternal(delIssueFormDTO);
if(delIssueRes.success()&&!CollectionUtils.isEmpty(delIssueRes.getData())){ if (delIssueRes.success() && !CollectionUtils.isEmpty(delIssueRes.getData())) {
// 议题被转了项目,需要删除项目 // 议题被转了项目,需要删除项目
SpringContextUtils.getBean(ProjectService.class).deleteByOriginId(delIssueRes.getData().get(0), ProjectOriginEnum.ISSUE.getCode()); SpringContextUtils.getBean(ProjectService.class).deleteByOriginId(delIssueRes.getData().get(0), ProjectOriginEnum.ISSUE.getCode());
} }
} }
LambdaUpdateWrapper<IcEventEntity> wrapper = new LambdaUpdateWrapper(); LambdaUpdateWrapper<IcEventEntity> wrapper = new LambdaUpdateWrapper();
wrapper.eq(IcEventEntity::getId,id).set(IcEventEntity::getUpdatedTime,new Date()) wrapper.eq(IcEventEntity::getId, id).set(IcEventEntity::getUpdatedTime, new Date())
.set(IcEventEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) .set(IcEventEntity::getUpdatedBy, loginUserUtil.getLoginUserId())
.set(IcEventEntity::getDelFlag,NumConstant.ONE_STR); .set(IcEventEntity::getDelFlag, NumConstant.ONE_STR);
baseDao.update(null,wrapper); baseDao.update(null, wrapper);
//把事件分类ic_event_category也删除了吧,以免后面数据分析用到这个表 //把事件分类ic_event_category也删除了吧,以免后面数据分析用到这个表
icEventCategoryService.delInsert(id,null); icEventCategoryService.delInsert(id, null);
} }
} }
@ -727,6 +744,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* 查询家属 * 查询家属
*
* @param idCard * @param idCard
* @return * @return
*/ */
@ -780,7 +798,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复");
} }
//2.修改事件数据 //2.修改事件数据
if (StringUtils.isNotBlank(formDTO.getOperationType()) && StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus())){ if (StringUtils.isNotBlank(formDTO.getOperationType()) && StringUtils.isNotBlank(formDTO.getStatus()) && "closed_case".equals(formDTO.getStatus())) {
entity.setStatus(formDTO.getStatus()); entity.setStatus(formDTO.getStatus());
entity.setCloseCaseTime(new Date()); entity.setCloseCaseTime(new Date());
entity.setDifficultPoint("0"); entity.setDifficultPoint("0");
@ -809,7 +827,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
categoryList.add(formDTO.getCategoryId()); categoryList.add(formDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
IcEventCategoryEntity categoryEntity = null; IcEventCategoryEntity categoryEntity = null;
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(formDTO.getCategoryId())) { if (ca.getId().equals(formDTO.getCategoryId())) {
categoryEntity = new IcEventCategoryEntity(); categoryEntity = new IcEventCategoryEntity();
categoryEntity.setCustomerId(formDTO.getCustomerId()); categoryEntity.setCustomerId(formDTO.getCustomerId());
@ -895,7 +913,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
categoryList.add(categoryId); categoryList.add(categoryId);
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
IcEventCategoryEntity categoryEntity = null; IcEventCategoryEntity categoryEntity = null;
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(categoryId)) { if (ca.getId().equals(categoryId)) {
categoryEntity = new IcEventCategoryEntity(); categoryEntity = new IcEventCategoryEntity();
categoryEntity.setCustomerId(formDTO.getCustomerId()); categoryEntity.setCustomerId(formDTO.getCustomerId());
@ -978,7 +996,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
categoryList.add(formDTO.getCategoryId()); categoryList.add(formDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
IcEventCategoryEntity categoryEntity = null; IcEventCategoryEntity categoryEntity = null;
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(formDTO.getCategoryId())) { if (ca.getId().equals(formDTO.getCategoryId())) {
categoryEntity = new IcEventCategoryEntity(); categoryEntity = new IcEventCategoryEntity();
categoryEntity.setCustomerId(formDTO.getCustomerId()); categoryEntity.setCustomerId(formDTO.getCustomerId());
@ -1107,8 +1125,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
IcEventListResultDTO resultDTO = new IcEventListResultDTO(); IcEventListResultDTO resultDTO = new IcEventListResultDTO();
//1.获取事件基本信息 //1.获取事件基本信息
List<IcEventListResultDTO> list = baseDao.icEventList(formDTO); List<IcEventListResultDTO> list = baseDao.icEventList(formDTO);
if(CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"事件不存在","事件已删除"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在", "事件已删除");
} }
resultDTO = list.get(0); resultDTO = list.get(0);
//查询网格名称(组织-网格) //查询网格名称(组织-网格)
@ -1129,7 +1147,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType()));
} }
//每个事件对应的图片数据 //每个事件对应的图片数据
if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ if (!CollectionUtils.isEmpty(resultDTO.getAttachmentList())) {
List<String> imageList = new ArrayList<>(); List<String> imageList = new ArrayList<>();
List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>(); List<IcEventListResultDTO.Attachment> voiceList = new ArrayList<>();
resultDTO.getAttachmentList().forEach(file -> { resultDTO.getAttachmentList().forEach(file -> {
@ -1144,11 +1162,11 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//分类信息 //分类信息
if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ if (StringUtils.isNotBlank(resultDTO.getCategoryId())) {
List<String> categoryList = new ArrayList<>(); List<String> categoryList = new ArrayList<>();
categoryList.add(resultDTO.getCategoryId()); categoryList.add(resultDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(resultDTO.getCategoryId())) { if (ca.getId().equals(resultDTO.getCategoryId())) {
resultDTO.setParentCategoryId(ca.getPid()); resultDTO.setParentCategoryId(ca.getPid());
resultDTO.setCategoryId(ca.getId()); resultDTO.setCategoryId(ca.getId());
@ -1176,7 +1194,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
if (null == gridInfoCache) { if (null == gridInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常");
} }
IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO,IcEventAnalysisOrgResDTO.class); IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO, IcEventAnalysisOrgResDTO.class);
grid.setOrgName(gridInfoCache.getGridName()); grid.setOrgName(gridInfoCache.getGridName());
grid.setTotal(baseDao.selectOrgTotal(formDTO)); grid.setTotal(baseDao.selectOrgTotal(formDTO));
list.add(grid); list.add(grid);
@ -1190,7 +1208,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class); IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class);
formDTO.setOrgId(org.getOrgId()); formDTO.setOrgId(org.getOrgId());
formDTO.setOrgType(org.getOrgType()); formDTO.setOrgType(org.getOrgType());
if("agency".equals(org.getOrgType())){ if ("agency".equals(org.getOrgType())) {
String purePids = org.getPids(); String purePids = org.getPids();
if ("0".equals(purePids) || StringUtils.isBlank(purePids)) { if ("0".equals(purePids) || StringUtils.isBlank(purePids)) {
formDTO.setGridPids(org.getOrgId()); formDTO.setGridPids(org.getOrgId());
@ -1206,6 +1224,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* Desc: 定时任务自动评价 * Desc: 定时任务自动评价
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/5/18 16:35 * @date 2022/5/18 16:35
@ -1213,14 +1232,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override @Override
public void autoEvaluation(AutoEvaluationFormDTO formDTO) { public void autoEvaluation(AutoEvaluationFormDTO formDTO) {
List<String> customerIds = new ArrayList<>(); List<String> customerIds = new ArrayList<>();
if (StringUtils.isBlank(formDTO.getCustomerId())){ if (StringUtils.isBlank(formDTO.getCustomerId())) {
Result<List<CustomerDTO>> allCustomerList = crmOpenFeignClient.getAllCustomerList(); Result<List<CustomerDTO>> allCustomerList = crmOpenFeignClient.getAllCustomerList();
if (!allCustomerList.success()){ if (!allCustomerList.success()) {
throw new EpmetException("查询所有客户失败"); throw new EpmetException("查询所有客户失败");
} }
List<CustomerDTO> data = allCustomerList.getData(); List<CustomerDTO> data = allCustomerList.getData();
customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList())); customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList()));
}else { } else {
customerIds.add(formDTO.getCustomerId()); customerIds.add(formDTO.getCustomerId());
} }
customerIds.forEach(c -> { customerIds.forEach(c -> {
@ -1230,24 +1249,25 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* Desc: 处理未评价的icEvent * Desc: 处理未评价的icEvent
*
* @param customerId * @param customerId
* @author zxc * @author zxc
* @date 2022/5/18 16:52 * @date 2022/5/18 16:52
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void autoEvaluationDispose(String customerId){ public void autoEvaluationDispose(String customerId) {
Integer no = NumConstant.ONE; Integer no = NumConstant.ONE;
Integer size = NumConstant.ONE_HUNDRED; Integer size = NumConstant.ONE_HUNDRED;
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
do { do {
int start = (no - NumConstant.ONE) * size; int start = (no - NumConstant.ONE) * size;
ids = baseDao.getAutoEvaluationIds(customerId,start,size); ids = baseDao.getAutoEvaluationIds(customerId, start, size);
// 批量更新 // 批量更新
if (!CollectionUtils.isEmpty(ids)){ if (!CollectionUtils.isEmpty(ids)) {
baseDao.updateAutoEvaluation(ids); baseDao.updateAutoEvaluation(ids);
} }
no++; no++;
}while (ids.size() == size); } while (ids.size() == size);
} }
/** /**
@ -1260,7 +1280,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//1.查询事件基础信息 //1.查询事件基础信息
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity) { if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在","事件不存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在", "事件不存在");
} }
// operationType 0:已回复 1:已转项目 2:已转需求3:转议题 // operationType 0:已回复 1:已转项目 2:已转需求3:转议题
//2.判断查询事件项目进展或需求进展信息或者议题进展 //2.判断查询事件项目进展或需求进展信息或者议题进展
@ -1281,15 +1301,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
IssueIdFormDTO issueIdFormDTO = new IssueIdFormDTO(); IssueIdFormDTO issueIdFormDTO = new IssueIdFormDTO();
issueIdFormDTO.setIssueId(entity.getOperationId()); issueIdFormDTO.setIssueId(entity.getOperationId());
Result<IssueAdvanceResDTO> issueProcessRes = govIssueOpenFeignClient.queryIssueProcess(issueIdFormDTO); Result<IssueAdvanceResDTO> issueProcessRes = govIssueOpenFeignClient.queryIssueProcess(issueIdFormDTO);
if(!issueProcessRes.success()||CollectionUtils.isEmpty(issueProcessRes.getData().getProcessList())){ if (!issueProcessRes.success() || CollectionUtils.isEmpty(issueProcessRes.getData().getProcessList())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件已转议题,议题处理进展查询异常", "事件已转议题,议题处理进展查询异常"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件已转议题,议题处理进展查询异常", "事件已转议题,议题处理进展查询异常");
} }
IssueAdvanceResDTO issueAdvanceResDTO=issueProcessRes.getData(); IssueAdvanceResDTO issueAdvanceResDTO = issueProcessRes.getData();
//如果议题已转项目,先放项目的处理进展 //如果议题已转项目,先放项目的处理进展
if("shift_project".equals(issueAdvanceResDTO.getIssueStatus())){ if ("shift_project".equals(issueAdvanceResDTO.getIssueStatus())) {
//根据议题id查询项目 //根据议题id查询项目
List<ProjectEntity> projectEntityList=SpringContextUtils.getBean(ProjectService.class).getByOriginId(issueAdvanceResDTO.getIssueId()); List<ProjectEntity> projectEntityList = SpringContextUtils.getBean(ProjectService.class).getByOriginId(issueAdvanceResDTO.getIssueId());
if(!CollectionUtils.isEmpty(projectEntityList)){ if (!CollectionUtils.isEmpty(projectEntityList)) {
// 项目进展 // 项目进展
ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO();
processListV2FormDTO.setProjectId(projectEntityList.get(0).getId()); processListV2FormDTO.setProjectId(projectEntityList.get(0).getId());
@ -1299,8 +1319,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
resultList.addAll(projectList); resultList.addAll(projectList);
} }
} }
for(ProcessListResultDTOBak issueProcess:issueAdvanceResDTO.getProcessList()){ for (ProcessListResultDTOBak issueProcess : issueAdvanceResDTO.getProcessList()) {
IcEventProcessListResultDTO eventProcess=new IcEventProcessListResultDTO(); IcEventProcessListResultDTO eventProcess = new IcEventProcessListResultDTO();
eventProcess.setDepartmentName(issueProcess.getDepartmentName()); eventProcess.setDepartmentName(issueProcess.getDepartmentName());
eventProcess.setProcessId(issueProcess.getProcessId()); eventProcess.setProcessId(issueProcess.getProcessId());
eventProcess.setProcessName(issueProcess.getProcessName()); eventProcess.setProcessName(issueProcess.getProcessName());
@ -1352,7 +1372,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setServiceParty(formDTO.getServiceParty()); logEntity.setServiceParty(formDTO.getServiceParty());
logEntity.setActualServiceTime(formDTO.getActualServiceTime()); logEntity.setActualServiceTime(formDTO.getActualServiceTime());
icEventOperationLogService.insert(logEntity); icEventOperationLogService.insert(logEntity);
}else if("project".equals(formDTO.getType())){ } else if ("project".equals(formDTO.getType())) {
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setIcEventId(formDTO.getIcEventId()); logEntity.setIcEventId(formDTO.getIcEventId());
logEntity.setCustomerId(formDTO.getCustomerId()); logEntity.setCustomerId(formDTO.getCustomerId());
@ -1364,7 +1384,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setServiceParty(formDTO.getServiceParty()); logEntity.setServiceParty(formDTO.getServiceParty());
logEntity.setActualServiceTime(formDTO.getActualServiceTime()); logEntity.setActualServiceTime(formDTO.getActualServiceTime());
icEventOperationLogService.insert(logEntity); icEventOperationLogService.insert(logEntity);
}else if("issue".equals(formDTO.getType())){ } else if ("issue".equals(formDTO.getType())) {
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setIcEventId(formDTO.getIcEventId()); logEntity.setIcEventId(formDTO.getIcEventId());
logEntity.setCustomerId(formDTO.getCustomerId()); logEntity.setCustomerId(formDTO.getCustomerId());
@ -1379,7 +1399,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//4.判断来源居民端的事件,需求、项目结案时给居民推送站内信 //4.判断来源居民端的事件,需求、项目结案时给居民推送站内信
if("0".equals(entity.getSourceType())){ if ("0".equals(entity.getSourceType())) {
List<UserMessageFormDTO> msgList = new ArrayList<>(); List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId()); messageFormDTO.setCustomerId(formDTO.getCustomerId());
@ -1402,6 +1422,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* Desc: 新增随手拍 * Desc: 新增随手拍
*
* @param formDTO * @param formDTO
* @author zxc * @author zxc
* @date 2022/5/19 13:38 * @date 2022/5/19 13:38
@ -1411,13 +1432,13 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
public void addEventFromResi(AddEventFromResiFormDTO formDTO) { public void addEventFromResi(AddEventFromResiFormDTO formDTO) {
// 判断是否注册居民 // 判断是否注册居民
Result<Boolean> isResiFlag = userOpenFeignClient.getIsResiFlag(formDTO.getUserId()); Result<Boolean> isResiFlag = userOpenFeignClient.getIsResiFlag(formDTO.getUserId());
if (!isResiFlag.success()){ if (!isResiFlag.success()) {
throw new EpmetException("查询是否注册居民失败..."); throw new EpmetException("查询是否注册居民失败...");
} }
if (!isResiFlag.getData()){ if (!isResiFlag.getData()) {
throw new EpmetException(EpmetErrorCode.NOT_REGEIST_RESI.getCode()); throw new EpmetException(EpmetErrorCode.NOT_REGEIST_RESI.getCode());
} }
if(StringUtils.isBlank(formDTO.getContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { if (StringUtils.isBlank(formDTO.getContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) {
//话题内容和语音不能同时为空 //话题内容和语音不能同时为空
log.error("事件内容和语音不能同时为空"); log.error("事件内容和语音不能同时为空");
throw new RenException(EpmetErrorCode.RESI_EVENT_SUBMIT.getCode(), EpmetErrorCode.RESI_EVENT_SUBMIT.getMsg()); throw new RenException(EpmetErrorCode.RESI_EVENT_SUBMIT.getCode(), EpmetErrorCode.RESI_EVENT_SUBMIT.getMsg());
@ -1427,20 +1448,20 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
resiEventService.scanContent(formDTO.getContent(), formDTO.getAttachmentList()); resiEventService.scanContent(formDTO.getContent(), formDTO.getAttachmentList());
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo){ if (null == gridInfo) {
throw new EpmetException("未查询到此网格信息"+formDTO.getGridId()); throw new EpmetException("未查询到此网格信息" + formDTO.getGridId());
} }
IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO,IcEventEntity.class); IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO, IcEventEntity.class);
entity.setAgencyId(gridInfo.getPid()); entity.setAgencyId(gridInfo.getPid());
entity.setGridPids(gridInfo.getPids()); entity.setGridPids(gridInfo.getPids());
Result<List<UserBaseInfoResultDTO>> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); Result<List<UserBaseInfoResultDTO>> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId()));
if (!userResult.success() && CollectionUtils.isEmpty(userResult.getData())){ if (!userResult.success() && CollectionUtils.isEmpty(userResult.getData())) {
throw new EpmetException("查询用户信息失败"+formDTO.getUserId()); throw new EpmetException("查询用户信息失败" + formDTO.getUserId());
} }
entity.setReportUserId(formDTO.getUserId()); entity.setReportUserId(formDTO.getUserId());
AtomicReference<String> userShowName = new AtomicReference<>(""); AtomicReference<String> userShowName = new AtomicReference<>("");
userResult.getData().forEach(u -> { userResult.getData().forEach(u -> {
if (u.getUserId().equals(formDTO.getUserId())){ if (u.getUserId().equals(formDTO.getUserId())) {
entity.setName(u.getRealName()); entity.setName(u.getRealName());
entity.setMobile(u.getMobile()); entity.setMobile(u.getMobile());
entity.setIdCard(u.getIdNum()); entity.setIdCard(u.getIdNum());
@ -1463,12 +1484,12 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//3-2.附件数据保存 //3-2.附件数据保存
List<IcEventAttachmentEntity> attachmentEntityList = new ArrayList<>(); List<IcEventAttachmentEntity> attachmentEntityList = new ArrayList<>();
if (!CollectionUtils.isEmpty(formDTO.getAttachmentList())) { if (!CollectionUtils.isEmpty(formDTO.getAttachmentList())) {
disposeAttachment(formDTO.getAttachmentList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); disposeAttachment(formDTO.getAttachmentList(), attachmentEntityList, entity.getId(), formDTO.getCustomerId(), formDTO.getUserId());
} }
if (!CollectionUtils.isEmpty(formDTO.getVoiceList())) { if (!CollectionUtils.isEmpty(formDTO.getVoiceList())) {
disposeAttachment(formDTO.getVoiceList(), attachmentEntityList,entity.getId(),formDTO.getCustomerId(),formDTO.getUserId()); disposeAttachment(formDTO.getVoiceList(), attachmentEntityList, entity.getId(), formDTO.getCustomerId(), formDTO.getUserId());
} }
if (!CollectionUtils.isEmpty(attachmentEntityList)){ if (!CollectionUtils.isEmpty(attachmentEntityList)) {
icEventAttachmentService.insertBatch(attachmentEntityList); icEventAttachmentService.insertBatch(attachmentEntityList);
} }
// 站内信发送给社区每个工作人员 // 站内信发送给社区每个工作人员
@ -1477,6 +1498,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* Desc: 给工作人员发送站内信 * Desc: 给工作人员发送站内信
*
* @param agencyId * @param agencyId
* @param customerId * @param customerId
* @param showName * @param showName
@ -1484,15 +1506,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
* @author zxc * @author zxc
* @date 2022/5/20 10:22 * @date 2022/5/20 10:22
*/ */
public void disposeMessage(String agencyId,String customerId,String showName,String icEventId){ public void disposeMessage(String agencyId, String customerId, String showName, String icEventId) {
// 查询组织下的所有工作人员 // 查询组织下的所有工作人员
AgencyIdFormDTO formDTO = new AgencyIdFormDTO(); AgencyIdFormDTO formDTO = new AgencyIdFormDTO();
formDTO.setAgencyId(agencyId); formDTO.setAgencyId(agencyId);
Result<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO); Result<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO);
if (!agencyStaffsResult.success()){ if (!agencyStaffsResult.success()) {
throw new EpmetException("查询组织下工作人员失败..."); throw new EpmetException("查询组织下工作人员失败...");
} }
if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){ if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())) {
List<UserMessageFormDTO> msgList = new ArrayList<>(); List<UserMessageFormDTO> msgList = new ArrayList<>();
agencyStaffsResult.getData().forEach(u -> { agencyStaffsResult.getData().forEach(u -> {
UserMessageFormDTO msg = new UserMessageFormDTO(); UserMessageFormDTO msg = new UserMessageFormDTO();
@ -1504,7 +1526,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
msg.setMessageType(UserMessageTypeConstant.IC_EVENT); msg.setMessageType(UserMessageTypeConstant.IC_EVENT);
msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setTitle("您有一条事件消息"); msg.setTitle("您有一条事件消息");
msg.setMessageContent(showName+"上报一条事件,请查看。"); msg.setMessageContent(showName + "上报一条事件,请查看。");
msgList.add(msg); msgList.add(msg);
}); });
messageOpenFeignClient.saveUserMessageList(msgList); messageOpenFeignClient.saveUserMessageList(msgList);
@ -1513,6 +1535,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
/** /**
* Desc: 附件处理 * Desc: 附件处理
*
* @param list * @param list
* @param attachmentEntityList * @param attachmentEntityList
* @param id * @param id
@ -1521,7 +1544,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
* @author zxc * @author zxc
* @date 2022/5/20 09:50 * @date 2022/5/20 09:50
*/ */
public void disposeAttachment(List<FileCommonDTO> list,List<IcEventAttachmentEntity> attachmentEntityList,String id,String customerId,String userId){ public void disposeAttachment(List<FileCommonDTO> list, List<IcEventAttachmentEntity> attachmentEntityList, String id, String customerId, String userId) {
int sort = NumConstant.ZERO; int sort = NumConstant.ZERO;
for (FileCommonDTO a : list) { for (FileCommonDTO a : list) {
IcEventAttachmentEntity attachment = new IcEventAttachmentEntity(); IcEventAttachmentEntity attachment = new IcEventAttachmentEntity();
@ -1571,16 +1594,16 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//分类信息 //分类信息
if(StringUtils.isNotBlank(dto.getCategoryId())){ if (StringUtils.isNotBlank(dto.getCategoryId())) {
List<String> categoryList = new ArrayList<>(); List<String> categoryList = new ArrayList<>();
categoryList.add(dto.getCategoryId()); categoryList.add(dto.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(dto.getCategoryId())) { if (ca.getId().equals(dto.getCategoryId())) {
if(StringUtils.isNotBlank(ca.getParentCategoryName())){ if (StringUtils.isNotBlank(ca.getParentCategoryName())) {
//大类-子类 //大类-子类
dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName()));
}else{ } else {
dto.setCategoryName(ca.getCategoryName()); dto.setCategoryName(ca.getCategoryName());
} }
} }
@ -1602,7 +1625,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
*/ */
@Override @Override
public void removeRed(String userId, String icEventId) { public void removeRed(String userId, String icEventId) {
baseDao.updateRedDot(userId,icEventId); baseDao.updateRedDot(userId, icEventId);
} }
/** /**
@ -1613,7 +1636,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override @Override
public void resiReply(ResiReplyIcEventFormDTO formDTO) { public void resiReply(ResiReplyIcEventFormDTO formDTO) {
//1.查询事件数据 判断是否允许回复 //1.查询事件数据 判断是否允许回复
IcEventEntity entity=checkReply(formDTO.getIcEventId()); IcEventEntity entity = checkReply(formDTO.getIcEventId());
entity.setLatestOperatedTime(new Date()); entity.setLatestOperatedTime(new Date());
//居民端的红点置为不显示 //居民端的红点置为不显示
entity.setRedDot(NumConstant.ZERO); entity.setRedDot(NumConstant.ZERO);
@ -1628,9 +1651,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
replyEntity.setFromUserId(formDTO.getUserId()); replyEntity.setFromUserId(formDTO.getUserId());
replyEntity.setContent(formDTO.getContent()); replyEntity.setContent(formDTO.getContent());
// 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称 // 查询当前用户的显示昵称 应该是xxx街道-姓/女士or先生 如果没有街道和姓,显示的微信昵称
List<String> userIdList =new ArrayList<>(); List<String> userIdList = new ArrayList<>();
userIdList.add(formDTO.getUserId()); userIdList.add(formDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> userResult=userOpenFeignClient.queryUserBaseInfo(userIdList); Result<List<UserBaseInfoResultDTO>> userResult = userOpenFeignClient.queryUserBaseInfo(userIdList);
if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())) { if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())) {
throw new RenException("查询当前用户信息异常"); throw new RenException("查询当前用户信息异常");
} }
@ -1638,25 +1661,25 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventReplyService.insert(replyEntity); icEventReplyService.insert(replyEntity);
//3.新增操作记录数据 //3.新增操作记录数据
IcEventOperationLogEntity logEntity =ConvertUtils.sourceToTarget(formDTO,IcEventOperationLogEntity.class); IcEventOperationLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO, IcEventOperationLogEntity.class);
logEntity.setUserIdentity(EventConstant.RESI_USER); logEntity.setUserIdentity(EventConstant.RESI_USER);
logEntity.setActionCode(ResiEventAction.REPLY.getCode()); logEntity.setActionCode(ResiEventAction.REPLY.getCode());
logEntity.setActionDesc(ResiEventAction.REPLY.getDesc()); logEntity.setActionDesc(ResiEventAction.REPLY.getDesc());
logEntity.setOperateTime(new Date()); logEntity.setOperateTime(new Date());
icEventOperationLogService.insert(logEntity); icEventOperationLogService.insert(logEntity);
// 4.给工作端社区的人发送消息:山东路168号-张先生对事件进行了新的回复,请查看 // 4.给工作端社区的人发送消息:山东路168号-张先生对事件进行了新的回复,请查看
noticeStaffResiReply(entity.getAgencyId(),entity.getCustomerId(),replyEntity.getUserShowName(),entity.getId()); noticeStaffResiReply(entity.getAgencyId(), entity.getCustomerId(), replyEntity.getUserShowName(), entity.getId());
} }
public void noticeStaffResiReply(String agencyId,String customerId,String showName,String icEventId){ public void noticeStaffResiReply(String agencyId, String customerId, String showName, String icEventId) {
// 查询组织下的所有工作人员 // 查询组织下的所有工作人员
AgencyIdFormDTO formDTO = new AgencyIdFormDTO(); AgencyIdFormDTO formDTO = new AgencyIdFormDTO();
formDTO.setAgencyId(agencyId); formDTO.setAgencyId(agencyId);
Result<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO); Result<List<String>> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO);
if (!agencyStaffsResult.success()){ if (!agencyStaffsResult.success()) {
throw new EpmetException("查询组织下工作人员失败..."); throw new EpmetException("查询组织下工作人员失败...");
} }
if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){ if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())) {
List<UserMessageFormDTO> msgList = new ArrayList<>(); List<UserMessageFormDTO> msgList = new ArrayList<>();
agencyStaffsResult.getData().forEach(u -> { agencyStaffsResult.getData().forEach(u -> {
UserMessageFormDTO msg = new UserMessageFormDTO(); UserMessageFormDTO msg = new UserMessageFormDTO();
@ -1668,7 +1691,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
msg.setMessageType(UserMessageTypeConstant.IC_EVENT); msg.setMessageType(UserMessageTypeConstant.IC_EVENT);
msg.setReadFlag(ReadFlagConstant.UN_READ); msg.setReadFlag(ReadFlagConstant.UN_READ);
msg.setTitle("您有一条事件消息"); msg.setTitle("您有一条事件消息");
msg.setMessageContent(showName+"对事件进行了新的回复,请查看。"); msg.setMessageContent(showName + "对事件进行了新的回复,请查看。");
msgList.add(msg); msgList.add(msg);
}); });
messageOpenFeignClient.saveUserMessageList(msgList); messageOpenFeignClient.saveUserMessageList(msgList);
@ -1687,8 +1710,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
// <if test="userId != null and userId != '' "> // <if test="userId != null and userId != '' ">
// AND ie.REPORT_USER_ID = #{userId} // AND ie.REPORT_USER_ID = #{userId}
// </if> // </if>
List<MyReportIcEvResDTO> list=baseDao.selectMyReport(formDTO); List<MyReportIcEvResDTO> list = baseDao.selectMyReport(formDTO);
if(CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)) {
return null; return null;
} }
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
@ -1710,16 +1733,16 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//分类信息 //分类信息
if(StringUtils.isNotBlank(dto.getCategoryId())){ if (StringUtils.isNotBlank(dto.getCategoryId())) {
List<String> categoryList = new ArrayList<>(); List<String> categoryList = new ArrayList<>();
categoryList.add(dto.getCategoryId()); categoryList.add(dto.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
if (ca.getId().equals(dto.getCategoryId())) { if (ca.getId().equals(dto.getCategoryId())) {
if(StringUtils.isNotBlank(ca.getParentCategoryName())){ if (StringUtils.isNotBlank(ca.getParentCategoryName())) {
//大类-子类 //大类-子类
dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName()));
}else{ } else {
dto.setCategoryName(ca.getCategoryName()); dto.setCategoryName(ca.getCategoryName());
} }
} }
@ -1783,9 +1806,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
// if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) { // if (org.apache.commons.collections4.CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) {
// return new PageData<PageUserReportEventResDTO>(new ArrayList<>(), NumConstant.ZERO); // return new PageData<PageUserReportEventResDTO>(new ArrayList<>(), NumConstant.ZERO);
// } // }
List<String> epmetUserIdList=new ArrayList<>(); List<String> epmetUserIdList = new ArrayList<>();
epmetUserIdList.add(formDTO.getUserId()); epmetUserIdList.add(formDTO.getUserId());
if(!CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ if (!CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())) {
epmetUserIdList.addAll(formDTO.getEpmetUserIdList()); epmetUserIdList.addAll(formDTO.getEpmetUserIdList());
} }
formDTO.setEpmetUserIdList(epmetUserIdList); formDTO.setEpmetUserIdList(epmetUserIdList);
@ -1803,9 +1826,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
@Override @Override
public void icEventToIssue(IcEventToIssueFormDTO formDTO) { public void icEventToIssue(IcEventToIssueFormDTO formDTO) {
//校验下数据 //校验下数据
IcEventEntity icEventEntity=baseDao.selectById(formDTO.getIcEventId()); IcEventEntity icEventEntity = baseDao.selectById(formDTO.getIcEventId());
if (null == icEventEntity || !"processing".equals(icEventEntity.getStatus())) { if (null == icEventEntity || !"processing".equals(icEventEntity.getStatus())) {
log.error(String.format("事件不存在icEventId:%s",formDTO.getIcEventId())); log.error(String.format("事件不存在icEventId:%s", formDTO.getIcEventId()));
return; return;
} }
//查询分类信息 //查询分类信息
@ -1813,7 +1836,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList);
Date nowTime = new Date(); Date nowTime = new Date();
//调用issue服务转议题 //调用issue服务转议题
PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO(); PublishIssueFormDTO issueFormDTO = new PublishIssueFormDTO();
issueFormDTO.setIssueStatus("voting"); issueFormDTO.setIssueStatus("voting");
issueFormDTO.setAddress(icEventEntity.getAddress()); issueFormDTO.setAddress(icEventEntity.getAddress());
issueFormDTO.setLatitude(icEventEntity.getLatitude()); issueFormDTO.setLatitude(icEventEntity.getLatitude());
@ -1832,7 +1855,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
issueFormDTO.setUpdatedTime(nowTime); issueFormDTO.setUpdatedTime(nowTime);
issueFormDTO.setDecidedTime(nowTime); issueFormDTO.setDecidedTime(nowTime);
issueFormDTO.setEventReportUserName(icEventEntity.getName()); issueFormDTO.setEventReportUserName(icEventEntity.getName());
Result<IssueDTO> issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); Result<IssueDTO> issueRes = govIssueOpenFeignClient.publishIssue(issueFormDTO);
if (!issueRes.success() || null == issueRes.getData()) { if (!issueRes.success() || null == issueRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常");
} }
@ -1840,7 +1863,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//1、修改事件相关信息 //1、修改事件相关信息
icEventEntity.setOperationType(formDTO.getOperationType()); icEventEntity.setOperationType(formDTO.getOperationType());
icEventEntity.setOperationId(issueRes.getData().getIssueId()); icEventEntity.setOperationId(issueRes.getData().getIssueId());
if("0".equals(icEventEntity.getSourceType())){ if ("0".equals(icEventEntity.getSourceType())) {
//来源于随手拍的,居民端需要显示红点 //来源于随手拍的,居民端需要显示红点
icEventEntity.setRedDot(NumConstant.ONE); icEventEntity.setRedDot(NumConstant.ONE);
} }
@ -1849,9 +1872,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
baseDao.updateById(icEventEntity); baseDao.updateById(icEventEntity);
//2、插入事件分类表 ic_event_category //2、插入事件分类表 ic_event_category
//分类全删全增吧 //分类全删全增吧
List<IcEventCategoryEntity> categoryEntities=new ArrayList<>(); List<IcEventCategoryEntity> categoryEntities = new ArrayList<>();
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ for (IssueProjectCategoryDictDTO ca : category.getCategoryList()) {
IcEventCategoryEntity icEventCategoryEntity=new IcEventCategoryEntity(); IcEventCategoryEntity icEventCategoryEntity = new IcEventCategoryEntity();
icEventCategoryEntity.setCustomerId(formDTO.getCustomerId()); icEventCategoryEntity.setCustomerId(formDTO.getCustomerId());
icEventCategoryEntity.setIcEventId(formDTO.getIcEventId()); icEventCategoryEntity.setIcEventId(formDTO.getIcEventId());
icEventCategoryEntity.setCategoryId(ca.getId()); icEventCategoryEntity.setCategoryId(ca.getId());
@ -1859,7 +1882,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventCategoryEntity.setCategoryCode(ca.getCategoryCode()); icEventCategoryEntity.setCategoryCode(ca.getCategoryCode());
categoryEntities.add(icEventCategoryEntity); categoryEntities.add(icEventCategoryEntity);
} }
icEventCategoryService.delInsert(formDTO.getIcEventId(),categoryEntities); icEventCategoryService.delInsert(formDTO.getIcEventId(), categoryEntities);
//3、插入操作日志表 ic_event_operation_log //3、插入操作日志表 ic_event_operation_log
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId()); logEntity.setCustomerId(formDTO.getCustomerId());
@ -1902,8 +1925,165 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
*/ */
@Override @Override
public List<IcEventDTO> batchSelectById(List<String> icEventIds) { public List<IcEventDTO> batchSelectById(List<String> icEventIds) {
List<IcEventEntity>list=baseDao.selectBatchIds(icEventIds); List<IcEventEntity> list = baseDao.selectBatchIds(icEventIds);
return ConvertUtils.sourceToTarget(list,IcEventDTO.class); return ConvertUtils.sourceToTarget(list, IcEventDTO.class);
} }
@Override
public Result reportCityManager(IcEventListResultDTO data) throws IOException {
ReportCityManageData reportData;
if (null != data) {
reportData = new ReportCityManageData();
//事件问题描述
reportData.setEventDesc(StringUtils.isNotEmpty(data.getEventContent()) ? data.getEventContent() : "");
//事件ID
reportData.setOtherTaskNum(StringUtils.isNotEmpty(data.getIcEventId()) ? data.getIcEventId() : "");
//事件发生地址
reportData.setAddress(StringUtils.isNotEmpty(data.getAddress()) ? data.getAddress() : "");
//X坐标
// reportData.setCoordinateX(Double.valueOf(data.getLongitude())); //先不传
reportData.setLontitude(Double.valueOf(StringUtils.isNotEmpty(data.getLongitude()) ? data.getLongitude() : "0.0"));
//Y坐标
// reportData.setCoordinateY(Double.valueOf(data.getLatitude())); //先不传
reportData.setLatitude(Double.valueOf(StringUtils.isNotEmpty(data.getLatitude()) ? data.getLatitude() : "0.0"));
//上报人
reportData.setHumanName(data.getName());
//上报人电话
reportData.setCellphone(data.getMobile());
//问题来源标示:默认130057
reportData.setEventSrcID(IcEventReportUtils.EVENT_SRC_ID);
//所属社区
if (StringUtils.isNotEmpty(data.getGridName())) {
reportData.setCommunityName(data.getGridName().substring(0, data.getGridName().lastIndexOf("-")));
reportData.setStreetName(data.getGridName().substring(data.getGridName().lastIndexOf("-") + 1));
}
//案卷类型标识 城市管理 1,社会服务类 2
reportData.setRecTypeID(1);
//问题级别标识 按照现场要求默认为1或者2
reportData.setEventLevelID(1);
//问题类型标识 临时采用默认值 1
reportData.setEventTypeCode("1");
List<ReportCityManageData.Media> medias = new ArrayList<>();
if (null != data.getImageList() && data.getImageList().size() > 0) {
data.getImageList().forEach(img -> {
ReportCityManageData.Media media = new ReportCityManageData.Media();
media.setMediaUsage("上报");
media.setMediaType("IMAGE");
media.setMediaURL(img);
media.setMediaName(img.substring(img.lastIndexOf("/") + 1));
// try {
// media.setContent(IcEventReportUtils.getFileByBase64(img));
// } catch (IOException e) {
// throw new EpmetException("下载事件图片文件失败,请联系管理员!");
// }
medias.add(media);
});
reportData.setMedias(medias);
}
if (null != data.getVoiceList() && data.getVoiceList().size() > 0) {
data.getVoiceList().forEach(voice -> {
ReportCityManageData.Media media = new ReportCityManageData.Media();
media.setMediaUsage("上报");
media.setMediaType("VOICE");
media.setMediaURL(voice.getUrl());
media.setMediaName(voice.getUrl().substring(voice.getUrl().lastIndexOf("/") + 1));
// try {
// media.setContent(IcEventReportUtils.getFileByBase64(voice.getUrl()));
// } catch (IOException e) {
// throw new EpmetException("下载事件音频文件失败,请联系管理员!");
// }
medias.add(media);
});
reportData.setMedias(medias);
}
JSONObject result = reportData(reportData);
if (!result.getString("success").equals("false")) {
JSONObject obj = result.getJSONObject("data");
IcEventEntity entity = new IcEventEntity();
entity.setId(data.getIcEventId());
entity.setRecId(obj.getString("recID"));
entity.setTaskNum(obj.getString("taskNum"));
updateById(entity);
return new Result();
} else {
return new Result().error(8000, result.getString("message"));
}
} else {
throw new EpmetException("没有查询到该事件!");
}
}
@Override
public Result checkReportStatus(String icEventId, String taskNum) throws IOException {
CloseableHttpClient client = null;
CloseableHttpResponse response = null;
try {
client = HttpClients.createDefault();
RequestConfig config = RequestConfig.custom().setConnectTimeout(10000).setConnectionRequestTimeout(3000).setSocketTimeout(10000).build();
StringBuilder url = new StringBuilder(IcEventReportUtils.REPORT_STATUS_URL);
url.append("?senderCode=" + IcEventReportUtils.STATUS_CODE).append("&taskNum=").append(taskNum);
HttpGet get = new HttpGet(url.toString());
get.addHeader("Content-Type", "application/json;charset=utf-8");
get.addHeader("Accept", "application/json;charset=utf-8");
get.addHeader("Connection", "keep-alive");
get.setConfig(config);
response = client.execute(get);
JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
if (!json.getString("success").equals("false")) {
JSONArray process = JSONObject.parseObject(json.getString("data")).getJSONArray("recProcess");
if (null != process && process.size() > 0) {
List<IcEventReplyEntity> entityList = new ArrayList<>();
for (int i = 0; i < process.size(); i++) {
JSONObject object = process.getJSONObject(i);
IcEventReplyEntity replyEntity = new IcEventReplyEntity();
replyEntity.setCustomerId(EpmetRequestHolder.getLoginUserCustomerId());
replyEntity.setIcEventId(icEventId);
replyEntity.setHumanName(object.getString("humanName"));
replyEntity.setActDefName(object.getString("actDefName"));
replyEntity.setContent(object.getString("content"));
}
icEventReplyService.saveOrUpdateBatch(entityList);
} else {
return new Result().error(Integer.valueOf(json.getString("code")), json.getString("message"));
}
} else {
return new Result().error(Integer.valueOf(json.getString("code")), json.getString("message"));
}
return new Result();
} catch (Exception e) {
throw new EpmetException(8000, "查询失败,请联系管理员!");
} finally {
if (null != client) {
client.close();
}
response.close();
}
}
private JSONObject reportData(ReportCityManageData reportData) throws IOException {
CloseableHttpClient client = null;
CloseableHttpResponse response = null;
try {
client = HttpClients.createDefault();
HttpPost post = new HttpPost(IcEventReportUtils.REPORT_URL);
RequestConfig config = RequestConfig.custom().setConnectTimeout(10000).setConnectionRequestTimeout(3000).setSocketTimeout(10000).build();
post.setConfig(config);
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setCharset(StandardCharsets.UTF_8);
builder.addTextBody("senderCode", IcEventReportUtils.SENDER_CODE);
builder.addTextBody("actionType", IcEventReportUtils.ACTION_TYPE);
builder.addTextBody("data", JSONObject.toJSON(reportData).toString());
HttpEntity entity = builder.build();
post.setEntity(entity);
response = client.execute(post);
return JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
} catch (Exception e) {
throw new EpmetException("上报失败,请联系管理员!");
} finally {
if (null != client) {
client.close();
}
response.close();
}
}
} }

102
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/utils/IcEventReportUtils.java

@ -0,0 +1,102 @@
package com.epmet.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustAllStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Base64;
/**
* @author yan Lu
* @description 日照事件上报城管工具类
* @create 2023/7/3 16:32
*/
@Slf4j
public class IcEventReportUtils {
/**
* 请求地址前缀
*/
private static final String URL_PREFIX = "https://rzzhsq.shuzirizhao.cn/eUrbanMIS/openapi/v2";
/**
* 上报地址
*/
public static final String REPORT_URL = URL_PREFIX + "/upstream";
/**
* 处理状态地址
*/
public static final String REPORT_STATUS_URL = URL_PREFIX + "/downstream/recprocess";
/**
* 调用方法
*/
public static final String ACTION_TYPE = "UP_REC_REPORT";
/**
* 发送方标识
*/
public static final String SENDER_CODE = "130057";
/**
* 处理状态码
*/
public static final String STATUS_CODE = "371100";
/**
* 问题来源标示
*/
public static final Integer EVENT_SRC_ID = 130057;
/**
* 获取多媒体资源并转换为base64编码
*
* @param url
* @return
* @throws IOException
*/
public static String getFileByBase64(String url) throws IOException {
SSLConnectionSocketFactory ssl;
CloseableHttpClient client = null;
ByteArrayOutputStream outputStream = null;
InputStream stream = null;
try {
//忽略服务端证书校验
ssl = new SSLConnectionSocketFactory(SSLContexts.custom().
loadTrustMaterial(null, new TrustAllStrategy()).build(), NoopHostnameVerifier.INSTANCE);
client = HttpClients.custom().setSSLSocketFactory(ssl).build();
HttpResponse response = client.execute(new HttpGet(url));
HttpEntity entity = response.getEntity();
stream = entity.getContent();
outputStream = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
int length;
while ((length = stream.read(bytes)) != -1) {
outputStream.write(bytes, 0, length);
}
return Base64.getEncoder().encodeToString(outputStream.toByteArray());
} catch (Exception e) {
client.close();
stream.close();
outputStream.close();
return "";
} finally {
client.close();
stream.close();
outputStream.close();
}
}
}

191
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/utils/ReportCityManageData.java

@ -0,0 +1,191 @@
package com.epmet.utils;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author yan Lu
* @description 上报城管数据封装对象
* @create 2023/7/3 16:43
*/
@Data
public class ReportCityManageData implements Serializable {
private static final long serialVersionUID = -5492975503443321965L;
/**
* 问题描述
*/
@NotBlank(message = "问题描述不能为空")
private String eventDesc;
/**
* 第三方案件唯一标识
*/
@NotBlank(message = "第三方案件唯一标识不能为空:上报事件ID")
private String otherTaskNum;
/**
* 地址描述
*/
@NotBlank(message = "事件发生地址不能为空")
private String address;
/**
* x坐标
* 跟主业务系统同坐标系
*/
@NotBlank(message = "x坐标不能为空:跟主业务系统同坐标系")
private Double coordinateX;
/**
* y坐标
* 跟主业务系统同坐标系
*/
@NotBlank(message = "y坐标不能为空:跟主业务系统同坐标系")
private Double coordinateY;
/**
* 经度
* 采用在线地图坐标系默认为0
*/
private Double lontitude;
/**
* 纬度
* 采用在线地图坐标系默认为0
*/
private Double latitude;
/**
* 问题来源标示
* 微信举报 56
*/
@NotBlank(message = "问题来源标示,例:微信举报:56")
private Integer eventSrcID;
/**
* 所属区域代码
*/
private String districtCode;
/**
* 所属区域
*/
private String districtName;
/**
* 所属区域代码
*/
private String streetCode;
/**
* 所属区域
*/
private String streetName;
/**
* 所属社区代码
*/
private String communityCode;
/**
* 所属社区
*/
private String communityName;
/**
* 案卷类型标识
*/
@NotBlank(message = "案卷类型标识:城市管理 1,社会服务类 2")
private Integer recTypeID;
/**
* 问题级别标识
* 按照现场要求默认为1或者2
*/
@NotBlank(message = "问题级别标识:按照现场要求默认为1或者2")
private Integer eventLevelID;
/**
* 问题类型标识
* 临时采用默认值 1
*/
@NotBlank(message = "问题类型标识:临时采用默认值 1")
private String eventTypeCode;
/**
* 问题大类标识
*/
private String mainTypeCode;
/**
* 问题小类标识
*/
private String subTypeCode;
/**
* 上报多媒体数量没有多媒体默认0
*/
private Integer mediaNum;
/**
* 上报人
*/
private String humanName;
/**
* 上报人手机号
*/
private String cellphone;
/**
* 多媒体信息
*/
private List<Media> medias;
@Data
public static class Media {
/**
* 案件任务号
*/
private String taskNum;
/**
* 文件名
*/
@NotBlank(message = "文件名不能为空")
private String mediaName;
/**
* 多媒体的完整访问路径优先推荐
*/
private String mediaURL;
/**
* 多媒体用途
* 上报核查核实处置
*/
@NotBlank(message = "多媒体用途不能为空:上报、核查、核实、处置")
private String mediaUsage;
/**
* 多媒体类型
* IMAGEVIDEOVOICEATTACH
*/
@NotBlank(message = "多媒体类型不能为空:IMAGE、VIDEO、VOICE、ATTACH")
private String mediaType;
/**
* 多媒体内容
* base64编码的表示多媒体的二进制数据流
*/
private String content;
}
}
Loading…
Cancel
Save