Browse Source

代买优化、sql脚本

dev
sunyuchao 3 years ago
parent
commit
494e0451f7
  1. 102
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  2. 153
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql

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

@ -21,8 +21,10 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.*;
import com.epmet.constant.ProjectConstant;
import com.epmet.constant.EventConstant; import com.epmet.constant.EventConstant;
import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageConstant;
import com.epmet.constant.ResiEventAction; import com.epmet.constant.ResiEventAction;
import com.epmet.constant.UserMessageTypeConstant; import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dao.IcEventDao; import com.epmet.dao.IcEventDao;
@ -184,7 +186,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//1-2.判断勾选已完成则处理方式不能选择立项或转需求 //1-2.判断勾选已完成则处理方式不能选择立项或转需求
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus()) if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())
&& StringUtils.isNotBlank(formDTO.getOperationType()) && ("1".equals(formDTO.getOperationType()) || "2".equals(formDTO.getOperationType()))) { && StringUtils.isNotBlank(formDTO.getOperationType()) && (NumConstant.ONE_STR.equals(formDTO.getOperationType()) || NumConstant.TWO_STR.equals(formDTO.getOperationType()))) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件勾选已完成则不允许立项或转需求"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件勾选已完成则不允许立项或转需求");
} }
//1-3.安全校验事件内容、图片内容 //1-3.安全校验事件内容、图片内容
@ -226,11 +228,13 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//事件Id //事件Id
String icEventId = IdWorker.getIdStr(); String icEventId = IdWorker.getIdStr();
//事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】 //事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】
int redDot = 0; int redDot = NumConstant.ZERO;
String operationType = "";
//2.判断是否立项或转需求 //2.判断是否立项或转需求
//2-1.项目立项 //2-1.项目立项
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "1".equals(formDTO.getOperationType())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.ONE_STR.equals(formDTO.getOperationType())) {
redDot = 1; redDot = NumConstant.ONE;
operationType = NumConstant.ONE_STR;
IcEventToProjectFormDTO toProject = formDTO.getProject(); IcEventToProjectFormDTO toProject = formDTO.getProject();
toProject.setCustomerId(formDTO.getCustomerId()); toProject.setCustomerId(formDTO.getCustomerId());
toProject.setUserId(formDTO.getUserId()); toProject.setUserId(formDTO.getUserId());
@ -241,8 +245,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
formDTO.setOperationId(project.getProjectId()); formDTO.setOperationId(project.getProjectId());
} }
//2-2.转需求 //2-2.转需求
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "2".equals(formDTO.getOperationType())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && NumConstant.TWO_STR.equals(formDTO.getOperationType())) {
redDot = 1; redDot = NumConstant.ONE;
operationType = NumConstant.TWO_STR;
IcDemandFormDTO dto = formDTO.getDemand(); IcDemandFormDTO dto = formDTO.getDemand();
//需求人默认是当前用户id //需求人默认是当前用户id
dto.setDemandUserId(formDTO.getUserId()); dto.setDemandUserId(formDTO.getUserId());
@ -264,8 +269,6 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
entity.setGridPids(gridInfo.getPids()); entity.setGridPids(gridInfo.getPids());
entity.setLatestOperatedTime(new Date()); entity.setLatestOperatedTime(new Date());
entity.setAuditStatus(TopicConstant.AUTO_PASSED); entity.setAuditStatus(TopicConstant.AUTO_PASSED);
//新增事件时默认是null; 0:已回复 1:已转项目 2:已转需求
entity.setOperationType(null);
if("closed_case".equals(formDTO.getStatus())){ if("closed_case".equals(formDTO.getStatus())){
entity.setCloseCaseTime(new Date()); entity.setCloseCaseTime(new Date());
} }
@ -294,7 +297,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
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(0))) { if (ca.getId().equals(formDTO.getCategoryList().get(NumConstant.ZERO))) {
categoryEntity = new IcEventCategoryEntity(); categoryEntity = new IcEventCategoryEntity();
categoryEntity.setCustomerId(formDTO.getCustomerId()); categoryEntity.setCustomerId(formDTO.getCustomerId());
categoryEntity.setIcEventId(entity.getId()); categoryEntity.setIcEventId(entity.getId());
@ -314,7 +317,10 @@ 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())) {
redDot = 1; if(StringUtils.isEmpty(operationType)){
operationType = NumConstant.ZERO_STR;
}
redDot = NumConstant.ONE;
IcEventReplyEntity replyEntity = new IcEventReplyEntity(); IcEventReplyEntity replyEntity = new IcEventReplyEntity();
replyEntity.setCustomerId(formDTO.getCustomerId()); replyEntity.setCustomerId(formDTO.getCustomerId());
replyEntity.setIcEventId(entity.getId()); replyEntity.setIcEventId(entity.getId());
@ -327,23 +333,24 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "reply")); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "reply", "reply"));
} }
//立项对应的操作记录 //立项对应的操作记录
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "1".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", "shift_project"));
} }
//转需求对应的操作记录 //转需求对应的操作记录
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "2".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", "shift_demand"));
} }
//选择了已完成 //选择了已完成
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) {
redDot = 1; redDot = NumConstant.ONE;
date.setTime(date.getTime() + 6000 * 1); date.setTime(date.getTime() + 6000 * 1);
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case")); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case"));
} }
icEventOperationLogService.insertBatch(logList); icEventOperationLogService.insertBatch(logList);
entity.setRedDot(redDot); entity.setRedDot(redDot);
entity.setOperationType(operationType);
insert(entity); insert(entity);
} }
@ -716,6 +723,19 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventCategoryService.updateById(categoryEntity); icEventCategoryService.updateById(categoryEntity);
} }
} }
//4.判断来源居民端的事件,回复、办结了给居民推送站内信
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId());
messageFormDTO.setApp(ProjectConstant.RESI);
messageFormDTO.setGridId(entity.getGridId());
messageFormDTO.setUserId(entity.getCreatedBy());
messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE);
messageFormDTO.setMessageContent(String.format("您上报的事件【%s】已经被转成项目,请查看"));
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT);
messageFormDTO.setTargetId(entity.getId());
msgList.add(messageFormDTO);
//5.新增操作记录数据 //5.新增操作记录数据
Date date = new Date(); Date date = new Date();
@ -725,8 +745,18 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) { if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) {
date.setTime(date.getTime() + 6000 * 1); date.setTime(date.getTime() + 6000 * 1);
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getDesc())); logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getDesc()));
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "close_case", "close_case"));
UserMessageFormDTO close = ConvertUtils.sourceToTarget(messageFormDTO, UserMessageFormDTO.class);
close.setMessageContent(String.format("您上报的事件【%s】已经被工作人员办结了,请查看"));
msgList.add(close);
} }
icEventOperationLogService.insertBatch(logList); icEventOperationLogService.insertBatch(logList);
Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList);
if (!sendMessageRes.success()) {
log.warn(String.format("事件回复,给居民端用户发送站内信异常,事件Id->%s", entity.getId()));
}
} }
@ -746,7 +776,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO); EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO);
//3.更新事件数据 //3.更新事件数据
entity.setOperationType("1"); entity.setOperationType(NumConstant.ONE_STR);
entity.setOperationId(project.getProjectId()); entity.setOperationId(project.getProjectId());
entity.setLatestOperatedTime(new Date()); entity.setLatestOperatedTime(new Date());
baseDao.updateById(entity); baseDao.updateById(entity);
@ -754,6 +784,27 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//4.新增操作记录 //4.新增操作记录
IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project"); IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project");
icEventOperationLogService.insert(logEntity); icEventOperationLogService.insert(logEntity);
//5.判断来源居民端的事件,转了项目给居民推送站内信
if ("0".equals(entity.getSourceType())) {
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId());
messageFormDTO.setApp(ProjectConstant.RESI);
messageFormDTO.setGridId(entity.getGridId());
messageFormDTO.setUserId(entity.getCreatedBy());
messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE);
messageFormDTO.setMessageContent(String.format("您上报的事件【%s】已经被转成项目,请查看"));
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT);
messageFormDTO.setTargetId(entity.getId());
msgList.add(messageFormDTO);
Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList);
if (!sendMessageRes.success()) {
log.warn(String.format("事件立项,给居民端用户发送站内信异常,事件Id->%s", entity.getId()));
}
}
} }
/** /**
@ -777,7 +828,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
} }
//3.更新事件数据 //3.更新事件数据
entity.setOperationType("2"); entity.setOperationType(NumConstant.TWO_STR);
entity.setOperationId(recIdResult.getData().getDemandRecId()); entity.setOperationId(recIdResult.getData().getDemandRecId());
entity.setLatestOperatedTime(new Date()); entity.setLatestOperatedTime(new Date());
baseDao.updateById(entity); baseDao.updateById(entity);
@ -786,6 +837,27 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand"); IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand");
icEventOperationLogService.insert(logEntity); icEventOperationLogService.insert(logEntity);
//5.判断来源居民端的事件,转了项目给居民推送站内信
if ("0".equals(entity.getSourceType())) {
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId());
messageFormDTO.setApp(ProjectConstant.RESI);
messageFormDTO.setGridId(entity.getGridId());
messageFormDTO.setUserId(entity.getCreatedBy());
messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE);
messageFormDTO.setMessageContent(String.format("您上报的事件【%s】已经被转成服务,请查看"));
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT);
messageFormDTO.setTargetId(entity.getId());
msgList.add(messageFormDTO);
Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList);
if (!sendMessageRes.success()) {
log.warn(String.format("事件转需求,给居民端用户发送站内信异常,事件Id->%s", entity.getId()));
}
}
} }
/** /**

153
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.23__add_ic_event.sql

@ -0,0 +1,153 @@
CREATE TABLE `ic_event` (
`ID` varchar(64) NOT NULL COMMENT '主键,事件id',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`GRID_ID` varchar(64) NOT NULL COMMENT '事件所属的网格Id。不包含网格的id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '网格的所属组织',
`GRID_PIDS` varchar(255) NOT NULL COMMENT '网格的所有组织Id',
`REPORT_USER_ID` varchar(64) NOT NULL COMMENT '报事的人【居民端/pc端居民Id】可为空',
`NAME` varchar(64) DEFAULT NULL COMMENT '报事人姓名',
`MOBILE` varchar(11) NOT NULL COMMENT '手机号',
`ID_CARD` varchar(18) DEFAULT NULL COMMENT '身份证号',
`SOURCE_TYPE` char(1) DEFAULT NULL COMMENT '反映渠道【字典表】',
`HAPPEN_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '发生时间',
`EVENT_CONTENT` varchar(1024) NOT NULL COMMENT '事件内容',
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '纬度',
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度',
`ADDRESS` varchar(255) NOT NULL COMMENT '地址',
`STATUS` varchar(32) NOT NULL DEFAULT 'processing' COMMENT '处理中:processing;已办结:closed_case',
`CLOSE_CASE_TIME` datetime DEFAULT NULL COMMENT '办结时间',
`OPERATION_TYPE` char(1) DEFAULT NULL COMMENT '0:已回复 1:已转项目 1:已转需求',
`OPERATION_ID` varchar(32) DEFAULT NULL COMMENT '项目、需求ID',
`READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '事件是否被阅读过;1已读;针对报事人待处理列表',
`RED_DOT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '报事人的红点:展示1;不展示:0;【工作人员回复/立项/转需求/办结更新为1】',
`LATEST_OPERATED_TIME` datetime NOT NULL COMMENT '最近一次操作时间(回复、立项、转需求、办结更新此列)',
`RESOLVE_STATUS` varchar(32) DEFAULT 'resolved' COMMENT '是否解决:已解决 resolved,未解决 un_solved',
`CLOSE_REMARK` varchar(255) DEFAULT NULL COMMENT '结案说明',
`COMMENT_USER_ID` varchar(32) DEFAULT NULL COMMENT '评价人',
`SATISFACTION` varchar(300) DEFAULT NULL COMMENT '满意度 - 不满意:bad、基本满意:good、非常满意:perfect',
`COMMENT_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '满意度评价时间',
`AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '事件审核状态[涉及附件审核需要加的状态](审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)',
`AUDIT_REASON` varchar(128) DEFAULT NULL COMMENT '审核理由',
`DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_gid` (`GRID_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件管理表';
-- ----------------------------
-- Table structure for ic_event_attachment
-- ----------------------------
CREATE TABLE `ic_event_attachment` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id',
`ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名',
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)',
`ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址',
`SORT` int(1) NOT NULL COMMENT '排序字段',
`STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态',
`REASON` varchar(255) DEFAULT NULL COMMENT '失败原因',
`DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表';
-- ----------------------------
-- Table structure for ic_event_category
-- ----------------------------
CREATE TABLE `ic_event_category` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id',
`CATEGORY_ID` varchar(64) NOT NULL COMMENT '分类id',
`CATEGORY_PIDS` varchar(512) NOT NULL COMMENT '分类对应的所有上级,英文逗号隔开',
`CATEGORY_CODE` varchar(50) CHARACTER SET utf8 NOT NULL COMMENT '分类编码,分类编码+customer_id唯一',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_pid` (`IC_EVENT_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件所属分类表';
-- ----------------------------
-- Table structure for ic_event_operation_log
-- ----------------------------
CREATE TABLE `ic_event_operation_log` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`USER_ID` varchar(64) NOT NULL COMMENT '操作用户Id',
`USER_IDENTITY` varchar(32) NOT NULL COMMENT ' 操作用户类型【居民端用户:resi_user;工作人员:staff;】',
`ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;\r\n3、立项:shift_project;\r\n4、转需求:shift_demand\r\n5、办结:close_case;\r\n6、需求办结:close_demand\r\n\r\n',
`ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、转需求: shift_demand;\r\n6、办结:close_case;\r\n7、需求办结:close_demand;\r\n8、选择是否已解决:choose_resolve;\r\n9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;',
`OPERATE_TIME` datetime NOT NULL COMMENT '操作时间',
`SERVICE_PARTY` varchar(64) DEFAULT NULL COMMENT '服务方【事件被转需求,需求在办结时的服务方名称】',
`ACTUAL_SERVICE_TIME` varchar(64) DEFAULT NULL COMMENT '实际服务时间【事件被转需求,需求在办结时填写的实际服务时间 xx至xx】',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='事件操作日志表';
-- ----------------------------
-- Table structure for ic_event_reply
-- ----------------------------
CREATE TABLE `ic_event_reply` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id',
`FROM_USER_ID` varchar(64) NOT NULL COMMENT '回复人用户Id[工作人员ID]',
`CONTENT` varchar(255) NOT NULL COMMENT '内容',
`USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '报事人:组织-人名',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
KEY `idx_eid` (`IC_EVENT_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件回复表';
-- ----------------------------
-- Table structure for ic_event_scan_task
-- ----------------------------
CREATE TABLE `ic_event_scan_task` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`IC_EVENT_ID` varchar(64) NOT NULL COMMENT '事件Id',
`IC_EVENT_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '事件附件表主键,对应dataId',
`TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id',
`STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】',
`ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)',
`DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件附件安全校验任务表';
Loading…
Cancel
Save