|
|
@ -85,19 +85,21 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List<FactOriginGroupMainDailyDTO> originGroupData, List<ExtractGroupMemberActionRecordResultDTO> memberList,List<String> missing) { |
|
|
|
if (isFirst) { |
|
|
|
//isFirst
|
|
|
|
baseDao.deleteBatchMemberByCustomerId(customerId,null,null); |
|
|
|
} else { |
|
|
|
if(StringUtils.isNotBlank(dateId)){ |
|
|
|
baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date"); |
|
|
|
if(!CollectionUtils.isEmpty(originGroupData)) { |
|
|
|
if (isFirst) { |
|
|
|
//isFirst
|
|
|
|
baseDao.deleteBatchMemberByCustomerId(customerId, null, null); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(dateId)) { |
|
|
|
baseDao.deleteBatchMemberByCustomerId(customerId, dateId, "date"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//删除要插入的组主表数据
|
|
|
|
baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList())); |
|
|
|
//删除要插入的组主表数据
|
|
|
|
baseDao.deleteBatchByGroupId(customerId, originGroupData.stream().map(FactOriginGroupMainDailyDTO::getId).distinct().collect(Collectors.toList())); |
|
|
|
|
|
|
|
baseDao.insertBatchMain(originGroupData); |
|
|
|
baseDao.insertBatchMembers(memberList); |
|
|
|
baseDao.insertBatchMain(originGroupData); |
|
|
|
baseDao.insertBatchMembers(memberList); |
|
|
|
} |
|
|
|
if(!CollectionUtils.isEmpty(missing)){ |
|
|
|
baseDao.deleteBatchByGroupId(customerId,missing); |
|
|
|
baseDao.deleteMemberByGroupList(customerId,missing); |
|
|
|