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. 15
      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.Param;
import java.util.List;
/**
* 中央区-事件数据图片数据
*
@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao<ScreenEventImgDataEntity>
/**
* 根据原始事件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<ScreenEventImgDataEntity> list);
}

15
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);
}
// 处理图片
String[] events = new String[formDTO.getDataList().size()];
List<ScreenEventImgDataEntity> 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,物理删除 - 事件数据图片数据
screenEventImgDataDao.delEventImgDataByEventId(formDTO.getDataList().get(i).getEventId());
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());
screenEventImgDataDao.insert(imgDataEntity);
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">
<delete id="delEventImgDataByEventId">
<delete id="delEventImgDataByEvent">
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>
<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>

Loading…
Cancel
Save