提交 95d2ad0f authored 作者: 李秋林's avatar 李秋林

活动记录上传飞书-指定ID上传

上级 d69db210
...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -102,4 +103,38 @@ public class ActivityToFeishuSheet { ...@@ -102,4 +103,38 @@ public class ActivityToFeishuSheet {
log.info("============== 活动记录上传飞书 end =============="); log.info("============== 活动记录上传飞书 end ==============");
} }
@GetMapping("/feishu/ids_sheet")
public void idsActivityList(){
log.info("============== 活动记录上传飞书 start ==============");
List<Long> activityIds = Arrays.asList(6166L,6181L,6319L,6359L,6431L,6514L,6542L,6648L,6745L,6797L);
List<TemporaryActivityReportedDO> reportedDos = promotionActivityService.findActivityListByIds(activityIds);
log.info("应上传飞书{}条活动记录",reportedDos.size());
if (CollectionUtils.isEmpty(reportedDos)){
log.info("无活动记录,停止上传");
return;
}
// List<Long> activityIds = reportedDos.stream().map(TemporaryActivityReportedDO::getId).collect(Collectors.toList());
Map<Long, List<TemporaryActivityPhotoDO>> activityPhotos = promotionActivityService.findActivityPhotos(activityIds);
Map<Long, TemporaryActivityClockDO> clockMap = promotionActivityService.findClockInfoByActivityIds(activityIds);
/**
* 2>> 查询打卡图片
*/
List<TemporaryActivityClockDO> clockPhoto = promotionActivityService.findClockPhotoByActivityIds(activityIds);
Map<String, List<TemporaryActivityPhotoDO>> clockPhotoMap = new HashMap<>();
clockPhoto.stream().forEach(cp -> {
clockPhotoMap.put(cp.getTemporaryId() + "-" + cp.getCreateDate(), cp.getPhotoList());
});
activityToFeishuSheetService.activityDataToFeishuSheet(reportedDos,activityPhotos,clockMap,clockPhotoMap);
log.info("============== 活动记录上传飞书 end ==============");
}
} }
...@@ -23,6 +23,8 @@ public interface TemporaryActivityClockMapper extends BaseMapper<TemporaryActivi ...@@ -23,6 +23,8 @@ public interface TemporaryActivityClockMapper extends BaseMapper<TemporaryActivi
List<TemporaryActivityClockDO> findClockPhotoListByCreateDate(String dateStr); List<TemporaryActivityClockDO> findClockPhotoListByCreateDate(String dateStr);
List<TemporaryActivityClockDO> findClockListByActivityIds(@Param("activityIds") List<Long> activityId); List<TemporaryActivityClockDO> findClockListByActivityIds(@Param("activityIds") List<Long> activityId);
List<TemporaryActivityClockDO> findClockPhotoByActivityIds(@Param("activityIds") List<Long> activityIds);
} }
......
...@@ -23,6 +23,8 @@ public interface TemporaryActivityReportedMapper extends BaseMapper<TemporaryAct ...@@ -23,6 +23,8 @@ public interface TemporaryActivityReportedMapper extends BaseMapper<TemporaryAct
List<TemporaryActivityReportedDO> findList(@Param("params") ActivityVo activityVo); List<TemporaryActivityReportedDO> findList(@Param("params") ActivityVo activityVo);
List<TemporaryActivityReportedDO> findListByCreateDate(String dateStr); List<TemporaryActivityReportedDO> findListByCreateDate(String dateStr);
List<TemporaryActivityReportedDO> selectListByIds(@Param("ids") List<Long> ids);
} }
......
...@@ -32,4 +32,8 @@ public interface PromotionActivityService { ...@@ -32,4 +32,8 @@ public interface PromotionActivityService {
Map<Long, TemporaryActivityClockDO> findClockInfoByActivityIds(List<Long> activityId); Map<Long, TemporaryActivityClockDO> findClockInfoByActivityIds(List<Long> activityId);
List<TemporaryActivityClockDO> findClockPhotoByCreateDate(String dateStr); List<TemporaryActivityClockDO> findClockPhotoByCreateDate(String dateStr);
List<TemporaryActivityReportedDO> findActivityListByIds(List<Long> activityIds);
List<TemporaryActivityClockDO> findClockPhotoByActivityIds(List<Long> activityIds);
} }
...@@ -78,4 +78,16 @@ public class PromotionActivityServiceImpl implements PromotionActivityService { ...@@ -78,4 +78,16 @@ public class PromotionActivityServiceImpl implements PromotionActivityService {
return clockPhotoList; return clockPhotoList;
} }
@Override
public List<TemporaryActivityReportedDO> findActivityListByIds(List<Long> activityIds) {
List<TemporaryActivityReportedDO> dos = temporaryActivityReportedMapper.selectListByIds(activityIds);
return dos;
}
@Override
public List<TemporaryActivityClockDO> findClockPhotoByActivityIds(List<Long> activityIds) {
List<TemporaryActivityClockDO> clockPhotoList = temporaryActivityClockMapper.findClockPhotoByActivityIds(activityIds);
return clockPhotoList;
}
} }
...@@ -95,4 +95,21 @@ ...@@ -95,4 +95,21 @@
</select> </select>
<select id="findClockPhotoByActivityIds" resultMap="clockMap">
select
ar.temporary_id temporary_id,
ar.create_date create_date,
ap.type type,
ap.photo_url photo_url
from
temporary_activity_reported ar
inner join temporary_activity_clock ac on ar.temporary_id = ac.temporary_id
and ar.create_date = ac.create_date
inner join temporary_activity_photo ap on ac.id = ap.clock_id
where
ar.id in
<foreach collection="activityIds" item="activityId" open="(" close=")" separator=",">
#{activityId}
</foreach>
</select>
</mapper> </mapper>
...@@ -82,4 +82,25 @@ ...@@ -82,4 +82,25 @@
and (dept_qc_org_name like '%战区' or dept_qc_org_name = '重客运营部') and (dept_qc_org_name like '%战区' or dept_qc_org_name = '重客运营部')
</select> </select>
<select id="selectListByIds" resultMap="BaseResultMap">
select id,
temporary_id,
approver_id,
temporary_name,
approve_name,
city,
create_date,
dealer_name,
store_name,
activity_pattern,
approve_status,
line_name,
dept_qc_org_name as org_name
from temporary_activity_reported
where id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论