Browse Source

pc事件管理新增事件时选了转议题

master
yinzuomei 3 years ago
parent
commit
35471adf22
  1. 9
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java
  2. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java
  3. 3
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  4. 48
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

9
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
@ -83,7 +84,7 @@ public class IcEventAddEditFormDTO implements Serializable {
*/ */
private String longitude; private String longitude;
/** /**
* 处理方式[0:已回复 1:已转项目 2:已转需求] * 0:已回复 1:已转项目 2:已转需求3:转议题
*/ */
private String operationType; private String operationType;
/** /**
@ -117,4 +118,10 @@ public class IcEventAddEditFormDTO implements Serializable {
private String app; private String app;
private String client; private String client;
/**
* 新增事件直接转议题
*/
@Valid
private IcEventToIssueFormDTO issueInfo;
} }

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@ -24,13 +25,15 @@ public class IcEventToIssueFormDTO implements Serializable {
public interface AddUserShowGroup extends CustomerClientShowGroup { public interface AddUserShowGroup extends CustomerClientShowGroup {
} }
public interface AddEventAndShiftIssue extends CustomerClientShowGroup {
}
/** /**
* 转议题默认传3即可0:已回复 1:已转项目 2:已转需求3:转议题 * 转议题默认传3即可0:已回复 1:已转项目 2:已转需求3:转议题
*/ */
@NotBlank(message = "处理方式不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "处理方式不能为空", groups = AddUserInternalGroup.class)
private String operationType; private String operationType;
@NotBlank(message = "事件id不能为空", groups = IcEventToIssueFormDTO.AddUserInternalGroup.class) @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class)
private String icEventId; private String icEventId;
// /** // /**
@ -42,17 +45,20 @@ public class IcEventToIssueFormDTO implements Serializable {
* 项目所选分类集合不可为空 * 项目所选分类集合不可为空
*/ */
@Valid @Valid
@NotEmpty(message = "事件分类不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class) @NotEmpty(message = "事件分类不能为空", groups = AddUserShowGroup.class)
private List<CategoryOrTagFormDTO> categoryList; private List<CategoryOrTagFormDTO> categoryList;
@NotBlank(message = "议题标题不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class) @NotBlank(message = "议题标题不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class})
@Length(message = "议题标题最多输入120字",max = 120,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class})
private String issueTitle; private String issueTitle;
@NotBlank(message = "处理建议不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class)
@Length(message = "处理建议最多输入1000字",max = 1000,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class})
@NotBlank(message = "处理建议不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class})
private String suggestion; private String suggestion;
@NotBlank(message = "customerId不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class})
private String customerId; private String customerId;
@NotBlank(message = "currentUserId不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) @NotBlank(message = "currentUserId不能为空", groups = {AddUserInternalGroup.class})
private String currentUserId; private String currentUserId;
} }

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

@ -103,6 +103,9 @@ public class IcEventController {
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())){
ValidatorUtils.validateEntity(formDTO.getIssueInfo(),IcEventToIssueFormDTO.AddEventAndShiftIssue.class);
}
icEventService.save(formDTO); icEventService.save(formDTO);
return new Result(); return new Result();
} }

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

@ -183,6 +183,10 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
return ConvertUtils.sourceToTarget(entity, IcEventDTO.class); return ConvertUtils.sourceToTarget(entity, IcEventDTO.class);
} }
/**
* 事件管理-新增
* @param formDTO
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcEventAddEditFormDTO formDTO) { public void save(IcEventAddEditFormDTO formDTO) {
@ -243,6 +247,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//事件Id //事件Id
String icEventId = IdWorker.getIdStr(); String icEventId = IdWorker.getIdStr();
Date nowTime=new Date();
//事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】 //事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】
int redDot = NumConstant.ZERO; int redDot = NumConstant.ZERO;
String operationType = ""; String operationType = "";
@ -276,6 +281,33 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
formDTO.setOperationId(recIdResult.getData().getDemandRecId()); formDTO.setOperationId(recIdResult.getData().getDemandRecId());
} }
//2-3.转议题
if(StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.THREE_STR.equals(formDTO.getOperationType())){
//调用issue服务转议题
PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO();
issueFormDTO.setIssueStatus("voting");
issueFormDTO.setAddress(formDTO.getAddress());
issueFormDTO.setLatitude(formDTO.getLatitude());
issueFormDTO.setLongitude(formDTO.getLongitude());
issueFormDTO.setIssueTitle(formDTO.getIssueInfo().getIssueTitle());
issueFormDTO.setSuggestion(formDTO.getIssueInfo().getSuggestion());
issueFormDTO.setGridId(formDTO.getGridId());
issueFormDTO.setOrgId(gridInfo.getPid());
issueFormDTO.setOrgIdPath(gridInfo.getPids());
issueFormDTO.setSourceType("ic_event");
issueFormDTO.setSourceId(icEventId);
issueFormDTO.setCreatedBy(formDTO.getUserId());
issueFormDTO.setUpdatedBy(formDTO.getUserId());
issueFormDTO.setCreatedTime(nowTime);
issueFormDTO.setUpdatedTime(nowTime);
issueFormDTO.setDecidedTime(nowTime);
issueFormDTO.setEventReportUserName(formDTO.getName());
Result<IssueDTO> issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO);
if (!issueRes.success() || null == issueRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常");
}
formDTO.setOperationId(issueRes.getData().getIssueId());
}
//3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据 //3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据
//3-1.事件数据保存 //3-1.事件数据保存
@ -283,7 +315,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
entity.setId(icEventId); entity.setId(icEventId);
entity.setAgencyId(gridInfo.getPid()); entity.setAgencyId(gridInfo.getPid());
entity.setGridPids(gridInfo.getPids()); entity.setGridPids(gridInfo.getPids());
entity.setLatestOperatedTime(new Date()); 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());
@ -346,16 +378,20 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventReplyService.insert(replyEntity); icEventReplyService.insert(replyEntity);
//回复对应的操作记录 //回复对应的操作记录
date.setTime(date.getTime() + 6000 * 1); date.setTime(date.getTime() + 6000 * 1);
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "reply")); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "回复"));
} }
//立项对应的操作记录 //立项对应的操作记录
if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) {
date.setTime(date.getTime() + 6000 * 1); date.setTime(date.getTime() + 6000 * 1);
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_project", "shift_project")); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_project", "立项"));
} }
//转需求对应的操作记录 //转需求对应的操作记录
if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) {
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), formDTO.getDemand().getWantServiceTime(), "shift_demand", "shift_demand")); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), formDTO.getDemand().getWantServiceTime(), "shift_demand", "转服务"));
}
//转议题
if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.THREE_STR.equals(formDTO.getOperationType())) {
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_to_issue", "转议题"));
} }
//选择了已完成 //选择了已完成
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) {
@ -391,7 +427,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
* *
* @return * @return
*/ */
private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date date, String actionCode, String actionDesc) { private IcEventOperationLogEntity logEntity(String customerId, String icEventId, String userId, Date operateTime, String actionCode, String actionDesc) {
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setCustomerId(customerId); logEntity.setCustomerId(customerId);
logEntity.setIcEventId(icEventId); logEntity.setIcEventId(icEventId);
@ -399,7 +435,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setUserIdentity("staff"); logEntity.setUserIdentity("staff");
logEntity.setActionCode(actionCode); logEntity.setActionCode(actionCode);
logEntity.setActionDesc(actionDesc); logEntity.setActionDesc(actionDesc);
logEntity.setOperateTime(date); logEntity.setOperateTime(operateTime);
return logEntity; return logEntity;
} }

Loading…
Cancel
Save