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() + ) + +