From 43bc61f8448e4fcae88b5a7fef27247895f4f3c8 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 11 Mar 2021 14:55:07 +0800 Subject: [PATCH] screenProjectData --- .../dao/evaluationindex/screen/ScreenProjectDataDao.java | 2 ++ .../evaluationindex/screen/ScreenProjectProcessDao.java | 2 ++ .../toscreen/impl/ScreenProjectSettleServiceImpl.java | 7 +++---- .../screen/impl/ScreenProjectDataServiceImpl.java | 4 ++-- .../screen/impl/ScreenProjectProcessServiceImpl.java | 4 ++-- .../com/epmet/service/topic/impl/TopicServiceImpl.java | 7 +++++-- .../mapper/evaluationindex/screen/ScreenProjectDataDao.xml | 7 +++++++ .../evaluationindex/screen/ScreenProjectProcessDao.xml | 6 ++++++ 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index 48a06725cc..1cdb4a1e8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -37,6 +37,8 @@ public interface ScreenProjectDataDao extends BaseDao { int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + int deleteByProjectTimeAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + int checkIfExisted(@Param("customerId") String customerId); List selectPending(ScreenProjectDataDTO param); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java index fb8a8b0bd1..f9638e9c4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java @@ -36,6 +36,8 @@ public interface ScreenProjectProcessDao extends BaseDao list); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 7f94601066..3760cc7a81 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -137,13 +137,13 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic processService.updateProjectCloseTime(metaData); //更新结案时间和结案状态 processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); - //FIXME release here + targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); if(!CollectionUtils.isEmpty(metaData)){ List imgs = topicService.buildNewScreenProjectImgData(metaData); if(!CollectionUtils.isEmpty(imgs)){ - //FIXME release here + targetImgService.insertBatch(imgs); } } @@ -151,11 +151,10 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic // List processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId())); if(!CollectionUtils.isEmpty(processes)){ - //FIXME release here targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); List attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); if(!CollectionUtils.isEmpty(attachments)){ - //FIXME release here + targetAttachmentService.insertBatch(attachments); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index 5c3d87bec7..9d3433cbba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -266,9 +266,9 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId); } List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); partition.forEach(part -> baseDao.insertBatch(part)); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java index 71c461e0e6..cb56f1cccb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -163,9 +163,9 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl list,String customerId,String dateId) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + int affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); } List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index c9ae226c24..6d9a78381e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.topic.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; @@ -223,8 +224,10 @@ public class TopicServiceImpl implements TopicService { if(CollectionUtils.isEmpty(imgs)) return null; return imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( match -> { - img.setProjectId(match.getProjectId()); - return img; + ScreenProjectImgDataDTO matchedImg + = ConvertUtils.sourceToTarget(img,ScreenProjectImgDataDTO.class); + matchedImg.setProjectId(match.getProjectId()); + return matchedImg; } )).collect(Collectors.toList()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 4e6e01c5cc..51c75a1c17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -40,6 +40,13 @@ limit 1000 + + delete from screen_project_data + where customer_id = #{customerId} + and DATE_FORMAT(PROJECT_CREATE_TIME,'%Y%m%d') = #{dateId} + limit 1000 + + select count(id) from `screen_project_process`