|
@ -1,6 +1,7 @@ |
|
|
package com.epmet.service.impl; |
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
@ -210,10 +211,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String icEventId = UUID.randomUUID().toString().replace("-", ""); |
|
|
//事件Id
|
|
|
|
|
|
String icEventId = IdWorker.getIdStr(); |
|
|
|
|
|
//事件表红点,回复、立项、转服务、办结展示红点【0不展示 1展示】
|
|
|
|
|
|
int redDot = 0; |
|
|
//2.判断是否立项或转需求
|
|
|
//2.判断是否立项或转需求
|
|
|
//2-1.项目立项
|
|
|
//2-1.项目立项
|
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "1".equals(formDTO.getOperationType())) { |
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "1".equals(formDTO.getOperationType())) { |
|
|
|
|
|
redDot = 1; |
|
|
IcEventToProjectFormDTO toProject = formDTO.getProject(); |
|
|
IcEventToProjectFormDTO toProject = formDTO.getProject(); |
|
|
toProject.setCustomerId(formDTO.getCustomerId()); |
|
|
toProject.setCustomerId(formDTO.getCustomerId()); |
|
|
toProject.setUserId(formDTO.getUserId()); |
|
|
toProject.setUserId(formDTO.getUserId()); |
|
@ -225,6 +230,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
} |
|
|
} |
|
|
//2-2.转需求
|
|
|
//2-2.转需求
|
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "2".equals(formDTO.getOperationType())) { |
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "2".equals(formDTO.getOperationType())) { |
|
|
|
|
|
redDot = 1; |
|
|
IcDemandFormDTO dto = formDTO.getDemand(); |
|
|
IcDemandFormDTO dto = formDTO.getDemand(); |
|
|
//需求人默认是当前用户id
|
|
|
//需求人默认是当前用户id
|
|
|
dto.setDemandUserId(formDTO.getUserId()); |
|
|
dto.setDemandUserId(formDTO.getUserId()); |
|
@ -249,7 +255,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
if("closed_case".equals(formDTO.getStatus())){ |
|
|
if("closed_case".equals(formDTO.getStatus())){ |
|
|
entity.setCloseCaseTime(new Date()); |
|
|
entity.setCloseCaseTime(new Date()); |
|
|
} |
|
|
} |
|
|
insert(entity); |
|
|
//insert(entity);
|
|
|
//3-2.附件数据保存
|
|
|
//3-2.附件数据保存
|
|
|
List<IcEventAttachmentEntity> imageEntityList = new ArrayList<>(); |
|
|
List<IcEventAttachmentEntity> imageEntityList = new ArrayList<>(); |
|
|
if (!CollectionUtils.isEmpty(formDTO.getImageList())) { |
|
|
if (!CollectionUtils.isEmpty(formDTO.getImageList())) { |
|
@ -294,6 +300,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())) { |
|
|
|
|
|
redDot = 1; |
|
|
IcEventReplyEntity replyEntity = new IcEventReplyEntity(); |
|
|
IcEventReplyEntity replyEntity = new IcEventReplyEntity(); |
|
|
replyEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
replyEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
replyEntity.setIcEventId(entity.getId()); |
|
|
replyEntity.setIcEventId(entity.getId()); |
|
@ -316,10 +323,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit |
|
|
} |
|
|
} |
|
|
//选择了已完成
|
|
|
//选择了已完成
|
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { |
|
|
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) { |
|
|
|
|
|
redDot = 1; |
|
|
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); |
|
|
|
|
|
insert(entity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|