Browse Source

04、事件数据 - 图片,修改为批量删除、新增。

02、党建能力-网格相关指标上报,接口入参格式修改
dev_shibei_match
zhangyongzhangyong 5 years ago
parent
commit
2d01a8faaf
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java
  2. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java
  3. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java
  4. 37
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml

4
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;
/** /**
* 建群党员数累计值 * 建群党员数累计值

8
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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 中央区-事件数据图片数据 * 中央区-事件数据图片数据
* *
@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao<ScreenEventImgDataEntity>
/** /**
* 根据原始事件Id进行物理删除 * 根据原始事件Id进行物理删除
* *
* @param eventId * @param eventIds
* @return void * @return void
* @Author zhangyong * @Author zhangyong
* @Date 16:47 2020-08-18 * @Date 16:47 2020-08-18
**/ **/
void delEventImgDataByEventId(@Param("eventId") String eventId); void delEventImgDataByEvent(@Param("eventIds") String[] eventIds);
void batchInsertEventImgData(@Param("list") List<ScreenEventImgDataEntity> list);
} }

35
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())) { if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId);
}
// 处理图片 // 处理图片
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { String[] events = new String[formDTO.getDataList().size()];
if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { List<ScreenEventImgDataEntity> eventImgDataList = new ArrayList<>();
// 根据原始事件ID,物理删除 - 事件数据图片数据 Boolean isImgUrl = false;
screenEventImgDataDao.delEventImgDataByEventId(formDTO.getDataList().get(i).getEventId()); for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) {
for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) {
// 新增 中央区-事件数据图片数据 表 // 根据原始事件ID,物理删除 - 事件数据图片数据
ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); events[i] = formDTO.getDataList().get(i).getEventId();
imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){
imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); // 新增 中央区-事件数据图片数据 表
imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity();
screenEventImgDataDao.insert(imgDataEntity); 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);
}
} }
} }

37
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml

@ -3,9 +3,42 @@
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenEventImgDataDao"> <mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenEventImgDataDao">
<delete id="delEventImgDataByEventId"> <delete id="delEventImgDataByEvent">
delete from screen_event_img_data delete from screen_event_img_data
where DEL_FLAG = '0' AND EVENT_ID = #{eventId} where DEL_FLAG = '0'
AND EVENT_ID IN
<foreach item="item" collection="eventIds" open="(" separator="," close=")">
#{item}
</foreach>
</delete> </delete>
<insert id="batchInsertEventImgData" parameterType="map">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.eventId},
#{item.eventImgUrl},
#{item.sort},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper> </mapper>

Loading…
Cancel
Save