From 2d01a8faaf7357005982899c747f11f49a6f9981 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 9 Sep 2020 12:18:44 +0800 Subject: [PATCH] =?UTF-8?q?04=E3=80=81=E4=BA=8B=E4=BB=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=20-=20=E5=9B=BE=E7=89=87=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E3=80=81=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E3=80=82=2002=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=E6=8C=87=E6=A0=87=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=85=A5=E5=8F=82=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/GridPartyAbilityFormDTO.java | 4 +- .../screen/ScreenEventImgDataDao.java | 8 +++- .../screen/impl/ScreenCollServiceImpl.java | 35 +++++++++++------- .../screen/ScreenEventImgDataDao.xml | 37 ++++++++++++++++++- 4 files changed, 65 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 8738c5c3f2..3aa816cafd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -48,7 +48,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格党员人均提出的议题转项目数 */ - private Integer partyAvgShiftProjectCount; + private BigDecimal partyAvgShiftProjectCount; /** * 网格活跃群众用户数 @@ -78,7 +78,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格群众人均提出的议题转项目数 */ - private Integer userAvgShiftProjectCount; + private BigDecimal userAvgShiftProjectCount; /** * 建群党员数(累计值) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 835b1f112d..fed3048bba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-事件数据图片数据 * @@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao /** * 根据原始事件Id,进行物理删除 * - * @param eventId + * @param eventIds * @return void * @Author zhangyong * @Date 16:47 2020-08-18 **/ - void delEventImgDataByEventId(@Param("eventId") String eventId); + void delEventImgDataByEvent(@Param("eventIds") String[] eventIds); + + void batchInsertEventImgData(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java index 7afe8df0b0..bc064d7cd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java @@ -171,22 +171,31 @@ public class ScreenCollServiceImpl implements ScreenCollService { } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); - } - // 处理图片 - for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { - if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { - // 根据原始事件ID,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(formDTO.getDataList().get(i).getEventId()); - for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ - // 新增 中央区-事件数据图片数据 表 - ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); - imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); - imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); - imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); - screenEventImgDataDao.insert(imgDataEntity); + // 处理图片 + String[] events = new String[formDTO.getDataList().size()]; + List eventImgDataList = new ArrayList<>(); + Boolean isImgUrl = false; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + events[i] = formDTO.getDataList().get(i).getEventId(); + for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); + eventImgDataList.add(imgDataEntity); + isImgUrl = true; + } } } + if (isImgUrl){ + screenEventImgDataDao.delEventImgDataByEvent(events); + screenEventImgDataDao.batchInsertEventImgData(eventImgDataList); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml index 9623ede0b9..bc5228b426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml @@ -3,9 +3,42 @@ - + delete from screen_event_img_data - where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + where DEL_FLAG = '0' + AND EVENT_ID IN + + #{item} + + + insert into screen_event_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + +