Commit d274d9b4 by kk

25517

parent ba2e76fe
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1988182436424454145;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514177, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1988182436424454145, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1977947500790681602;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514178, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1977947500790681602, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1798182962261397505;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514179, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1798182962261397505, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1965976087808708609;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514180, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1965976087808708609, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1993869905966927873;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514181, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1993869905966927873, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2047258500974776322;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514182, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2047258500974776322, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2047261716974145537;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514183, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2047261716974145537, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2047261720551886850;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514184, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2047261720551886850, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2041433364019286017;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514185, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2041433364019286017, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2027269981468626945;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514186, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2027269981468626945, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1915334904820797442;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514187, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1915334904820797442, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1889253053618458625;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514188, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1889253053618458625, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1965950921955348482;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514189, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1965950921955348482, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2031278900885065730;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514190, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2031278900885065730, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1956254543440252929;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514191, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1956254543440252929, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2018985404249673729;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514192, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2018985404249673729, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1947954844278984706;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514193, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1947954844278984706, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1940988951405793281;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514194, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1940988951405793281, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1892876924976369665;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514195, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1892876924976369665, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2016768273466527745;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514196, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2016768273466527745, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1831270982308859906;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514197, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1831270982308859906, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1976107873721126913;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514198, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1976107873721126913, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1979069869286494209;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514199, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1979069869286494209, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2002929590602829826;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514200, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2002929590602829826, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2042535560882425857;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514201, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2042535560882425857, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1960283593011892226;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514202, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1960283593011892226, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1995701975215247362;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514203, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1995701975215247362, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2016438649897357313;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514204, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2016438649897357313, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1840688037541974018;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514205, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1840688037541974018, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 2010647964229308418;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514206, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 2010647964229308418, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1904435585196494850;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514207, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1904435585196494850, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1997976971463626753;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514208, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1997976971463626753, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1997976973359452161;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514209, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1997976973359452161, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1997976975456604161;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514210, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1997976975456604161, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1997976977365012481;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514211, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1997976977365012481, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1998953656765911042;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514212, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1998953656765911042, '', 'job');
UPDATE photo_progress SET simple_video_upload_status = 5 WHERE id = 1999418958444236802;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2104419939822514213, 'photo_progress', 1790567778, 0, '系统', '需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除', 1999418958444236802, '', 'job');
......@@ -31,7 +31,7 @@ public class VideoProductServiceImpl extends ServiceImpl<VideoProductMapper, Vid
@Override
@Transactional(rollbackFor = Exception.class)
public void setUploadStatusIsDeleted(List<SkuSiteDTO> list) {
List<VideoProduct> listVideoProduct = baseMapper.getListBySkuAndSite(list);
List<VideoProduct> listVideoProduct = baseMapper.getListBySkuAndSite(list, null);
List<Long> ids = listVideoProduct.stream()
.filter(videoProduct -> videoProduct.getVideoIsUploadBackstage() != 5)
.map(VideoProduct::getId)
......
......@@ -22,7 +22,9 @@
select id, video_is_upload_backstage
from video_product
where is_delete = 0
and optimize_type = #{optimizeType}
<if test="optimizeType != null">
and optimize_type = #{optimizeType}
</if>
and (sku, site) in
<foreach collection="list" item="item" open="(" separator="," close=")">
(#{item.sku}, #{item.site})
......
package cn.kk.spring_simple_operation;
import cn.kk.spring_simple_operation.entity.PhotoProgress;
import cn.kk.spring_simple_operation.entity.VideoProduct;
import cn.kk.spring_simple_operation.entity.VisualDesignLog;
import cn.kk.spring_simple_operation.mapper.PhotoProgressMapper;
import cn.kk.spring_simple_operation.mapper.VideoProductMapper;
import cn.kk.spring_simple_operation.model.dto.FineVideoUploadedNoVideoDTO;
import cn.kk.spring_simple_operation.model.dto.SimpleVideoUploadedDTO;
......@@ -46,6 +48,9 @@ public class InfringementCheckDataTest {
@Resource
private VideoProductMapper videoProductMapper;
@Resource
private PhotoProgressMapper photoProgressMapper;
@Test
public void readAllSheets() throws Exception {
List<FineVideoUploadedNoVideoDTO> fineVideoList;
......@@ -134,6 +139,80 @@ public class InfringementCheckDataTest {
}
/**
* 简易视频(photo_progress表)已上传但后台无视频,将simple_video_upload_status设为5(已删除),
* 数据库只读,改为生成update+日志insert的sql文件。
*/
@Test
public void generateSimpleVideoUploadStatusDeletedSql() throws Exception {
List<SimpleVideoUploadedDTO> simpleVideoList;
try (InputStream is = Files.newInputStream(INPUT_PATH)) {
simpleVideoList = new ExcelUtil<>(SimpleVideoUploadedDTO.class)
.importExcel("简易视频系统为已上传数据", is);
}
List<String> skuList = simpleVideoList.stream()
.map(SimpleVideoUploadedDTO::getSku)
.filter(sku -> !StringUtils.isEmpty(sku))
.distinct()
.collect(Collectors.toList());
int currentTime = DateUtils.getCurrentTimeSecond();
List<String> sqlList = buildPhotoProgressUpdateSqlList(skuList,
"需求:25517,简易视频系统已上传但后台无视频,设置简易视频上传状态为已删除",
currentTime);
Path outputPath = Paths.get("photo_progress_simple_video_deleted.sql");
try (BufferedWriter writer = Files.newBufferedWriter(outputPath)) {
for (String sql : sqlList) {
writer.write(sql);
writer.write("\n");
}
}
log.info("共生成 {} 条sql, 输出文件: {}", sqlList.size(), outputPath.toAbsolutePath());
}
/**
* 按sku分批查询photo_progress中对应的记录,对simple_video_upload_status != 5 的记录
* 生成update sql,并配套生成一条visual_design_log的insert sql。
*/
private List<String> buildPhotoProgressUpdateSqlList(List<String> skuList, String operationContent, int currentTime) {
List<String> sqlList = new ArrayList<>();
if (CollectionUtils.isEmpty(skuList)) {
return sqlList;
}
Lists.partition(skuList, 500).forEach(partition -> {
List<PhotoProgress> products = photoProgressMapper.getListBySku(partition);
for (PhotoProgress photoProgress : products) {
if (Objects.equals(photoProgress.getSimpleVideoUploadStatus(), 5)) {
continue;
}
PhotoProgress update = new PhotoProgress();
update.setId(photoProgress.getId());
update.setSimpleVideoUploadStatus(5);
VisualDesignLog designLog = new VisualDesignLog();
designLog.setOperationKey("photo_progress")
.setCreateId(0)
.setCreateTime(currentTime)
.setCreateName("系统")
.setOperationContent(operationContent)
.setRelationId(update.getId())
.setFileUrl("")
.setOperationType("job");
sqlList.add(SqlGenerator.generateUpdateSql(update));
sqlList.add(SqlGenerator.generateInsertSql(designLog));
}
});
return sqlList;
}
/**
* 按(sku,site)分批查询video_product中对应的记录((sku,site) in (...)),
* 对video_is_upload_backstage != 5 的记录生成update sql,并配套生成一条visual_design_log的insert sql。
*/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment