diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java index 50d659f799..0e2bc16a97 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java @@ -165,5 +165,10 @@ public class IcDemandFormDTO implements Serializable { * 服务方名称 */ private String serverName; + /** + * 二级分类Id + */ + @NotBlank(message = "分类id不能为空",groups = AddUserInternalGroup.class) + private String categoryId; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index 3fde323af5..f1561debbe 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -21,12 +21,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.*; -import com.epmet.constant.ProjectConstant; -import com.epmet.constant.EventConstant; -import com.epmet.constant.ReadFlagConstant; -import com.epmet.constant.UserMessageConstant; -import com.epmet.constant.ResiEventAction; -import com.epmet.constant.UserMessageTypeConstant; +import com.epmet.constant.*; import com.epmet.dao.IcEventDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -744,12 +739,11 @@ public class IcEventServiceImpl extends BaseServiceImpl logList = new ArrayList<>(); - logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, ResiEventAction.REPLY.getCode(), ResiEventAction.REPLY.getDesc())); + logList.add(logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), date, ResiEventAction.REPLY.getCode(), ResiEventAction.REPLY.getCode())); //回复时选择了已完成 if (StringUtils.isNotBlank(formDTO.getOperationType()) && ResiEventAction.CLOSE_CASE.getCode().equals(formDTO.getStatus())) { 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, "close_case", "close_case")); + logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, ResiEventAction.CLOSE_CASE.getCode(), ResiEventAction.CLOSE_CASE.getCode())); UserMessageFormDTO close = ConvertUtils.sourceToTarget(messageFormDTO, UserMessageFormDTO.class); close.setMessageContent(String.format("您上报的事件已完成,请查看。")); @@ -785,11 +779,39 @@ public class IcEventServiceImpl extends BaseServiceImpl categoryList = new ArrayList<>(); + categoryList.add(categoryId); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(categoryId)) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project"); icEventOperationLogService.insert(logEntity); - //5.判断来源居民端的事件,转了项目给居民推送站内信 + //6.判断来源居民端的事件,转了项目给居民推送站内信 if ("0".equals(entity.getSourceType())) { //通知 List msgList = new ArrayList<>(); @@ -842,11 +864,38 @@ public class IcEventServiceImpl extends BaseServiceImpl categoryList = new ArrayList<>(); + categoryList.add(formDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + IcEventCategoryEntity categoryEntity = null; + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(formDTO.getCategoryId())) { + categoryEntity = new IcEventCategoryEntity(); + categoryEntity.setCustomerId(formDTO.getCustomerId()); + categoryEntity.setIcEventId(entity.getId()); + categoryEntity.setCategoryId(ca.getId()); + categoryEntity.setCategoryPids(ca.getPids()); + categoryEntity.setCategoryCode(ca.getCategoryCode()); + } + } + + IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId()); + if (null == icEventCategory || StringUtils.isEmpty(icEventCategory.getId())) { + icEventCategoryService.insert(categoryEntity); + } else { + categoryEntity.setId(icEventCategory.getId()); + icEventCategoryService.updateById(categoryEntity); + } + } + + //5.新增操作记录 IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand"); icEventOperationLogService.insert(logEntity); - //5.判断来源居民端的事件,转了项目给居民推送站内信 + //6.判断来源居民端的事件,转了项目给居民推送站内信 if ("0".equals(entity.getSourceType())) { //通知 List msgList = new ArrayList<>();