Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-simple-operation
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guokunkun
spring-simple-operation
Commits
48337d47
Commit
48337d47
authored
Feb 27, 2025
by
kk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
刷数据:根据文件指定sku和站点,刷简易视频和精细视频的上传后台状态为已删除
parent
d314e7f4
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
173 additions
and
12 deletions
+173
-12
VideoProductController.java
...g_simple_operation/controller/VideoProductController.java
+1
-1
VideoProduct.java
...va/cn/kk/spring_simple_operation/entity/VideoProduct.java
+1
-1
PhotoProgressMapper.java
...k/spring_simple_operation/mapper/PhotoProgressMapper.java
+4
-0
VideoProductMapper.java
...kk/spring_simple_operation/mapper/VideoProductMapper.java
+3
-0
SkuSiteDTO.java
...a/cn/kk/spring_simple_operation/model/dto/SkuSiteDTO.java
+20
-0
PhotoProgressService.java
...spring_simple_operation/service/PhotoProgressService.java
+4
-0
VideoProductService.java
.../spring_simple_operation/service/VideoProductService.java
+5
-1
VisualDesignLogService.java
...ring_simple_operation/service/VisualDesignLogService.java
+4
-0
PhotoProgressServiceImpl.java
...mple_operation/service/impl/PhotoProgressServiceImpl.java
+25
-0
VideoProductServiceImpl.java
...imple_operation/service/impl/VideoProductServiceImpl.java
+26
-1
VisualDesignLogServiceImpl.java
...le_operation/service/impl/VisualDesignLogServiceImpl.java
+24
-0
PhotoProgressMapper.xml
src/main/resources/mapper/PhotoProgressMapper.xml
+8
-0
VideoProductMapper.xml
src/main/resources/mapper/VideoProductMapper.xml
+16
-6
ApplicationTest.java
...t/java/cn/kk/spring_simple_operation/ApplicationTest.java
+32
-2
已删除页面直接调整视频状态.xlsx
已删除页面直接调整视频状态.xlsx
+0
-0
No files found.
src/main/java/cn/kk/spring_simple_operation/controller/VideoProductController.java
View file @
48337d47
...
...
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
* </p>
*
* @author guokunkun
* @since 202
4-12-25
* @since 202
5-02-27
*/
@RestController
@RequestMapping
(
"/spring_simple_operation/video-product"
)
...
...
src/main/java/cn/kk/spring_simple_operation/entity/VideoProduct.java
View file @
48337d47
...
...
@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
* </p>
*
* @author guokunkun
* @since 202
4-12-25
* @since 202
5-02-27
*/
@Getter
@Setter
...
...
src/main/java/cn/kk/spring_simple_operation/mapper/PhotoProgressMapper.java
View file @
48337d47
...
...
@@ -3,6 +3,9 @@ package cn.kk.spring_simple_operation.mapper;
import
cn.kk.spring_simple_operation.entity.PhotoProgress
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
...
...
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public
interface
PhotoProgressMapper
extends
BaseMapper
<
PhotoProgress
>
{
List
<
PhotoProgress
>
getListBySku
(
@Param
(
"skuList"
)
List
<
String
>
collect
);
}
src/main/java/cn/kk/spring_simple_operation/mapper/VideoProductMapper.java
View file @
48337d47
package
cn
.
kk
.
spring_simple_operation
.
mapper
;
import
cn.kk.spring_simple_operation.entity.VideoProduct
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -19,4 +20,6 @@ import java.util.List;
public
interface
VideoProductMapper
extends
BaseMapper
<
VideoProduct
>
{
List
<
String
>
selectHaveTask
(
@Param
(
"skus"
)
List
<
String
>
skus
);
List
<
VideoProduct
>
getListBySkuAndSite
(
@Param
(
"list"
)
List
<
SkuSiteDTO
>
list
);
}
src/main/java/cn/kk/spring_simple_operation/model/dto/SkuSiteDTO.java
0 → 100644
View file @
48337d47
package
cn
.
kk
.
spring_simple_operation
.
model
.
dto
;
import
cn.kk.spring_simple_operation.utils.Excel
;
import
lombok.Data
;
/**
* @author kk
* @date 2025/2/27
*/
@Data
public
class
SkuSiteDTO
{
@Excel
(
name
=
"SKU"
)
private
String
sku
;
@Excel
(
name
=
"站点"
)
private
String
site
;
}
src/main/java/cn/kk/spring_simple_operation/service/PhotoProgressService.java
View file @
48337d47
package
cn
.
kk
.
spring_simple_operation
.
service
;
import
cn.kk.spring_simple_operation.entity.PhotoProgress
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 图片协同系统 服务类
...
...
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public
interface
PhotoProgressService
extends
IService
<
PhotoProgress
>
{
void
setUploadStatusIsDeleted
(
List
<
SkuSiteDTO
>
list
);
}
src/main/java/cn/kk/spring_simple_operation/service/VideoProductService.java
View file @
48337d47
package
cn
.
kk
.
spring_simple_operation
.
service
;
import
cn.kk.spring_simple_operation.entity.VideoProduct
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 视频产品 服务类
* </p>
*
* @author guokunkun
* @since 202
4-12-25
* @since 202
5-02-27
*/
public
interface
VideoProductService
extends
IService
<
VideoProduct
>
{
void
setUploadStatusIsDeleted
(
List
<
SkuSiteDTO
>
list
);
}
src/main/java/cn/kk/spring_simple_operation/service/VisualDesignLogService.java
View file @
48337d47
...
...
@@ -3,6 +3,8 @@ package cn.kk.spring_simple_operation.service;
import
cn.kk.spring_simple_operation.entity.VisualDesignLog
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* <p>
* 视觉操作日志 服务类
...
...
@@ -14,4 +16,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
public
interface
VisualDesignLogService
extends
IService
<
VisualDesignLog
>
{
void
addLog
(
String
operationKey
,
String
operationContent
,
Long
relationId
);
void
addBatchLog
(
String
operationKey
,
String
operationContent
,
List
<
Long
>
relationIdList
);
}
src/main/java/cn/kk/spring_simple_operation/service/impl/PhotoProgressServiceImpl.java
View file @
48337d47
...
...
@@ -2,9 +2,17 @@ package cn.kk.spring_simple_operation.service.impl;
import
cn.kk.spring_simple_operation.entity.PhotoProgress
;
import
cn.kk.spring_simple_operation.mapper.PhotoProgressMapper
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
cn.kk.spring_simple_operation.service.PhotoProgressService
;
import
cn.kk.spring_simple_operation.service.VisualDesignLogService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -17,4 +25,21 @@ import org.springframework.stereotype.Service;
@Service
public
class
PhotoProgressServiceImpl
extends
ServiceImpl
<
PhotoProgressMapper
,
PhotoProgress
>
implements
PhotoProgressService
{
@Resource
private
VisualDesignLogService
visualDesignLogService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
setUploadStatusIsDeleted
(
List
<
SkuSiteDTO
>
list
)
{
List
<
PhotoProgress
>
listPhotoProgress
=
baseMapper
.
getListBySku
(
list
.
stream
().
map
(
SkuSiteDTO:
:
getSku
).
collect
(
Collectors
.
toList
()));
List
<
Long
>
ids
=
listPhotoProgress
.
stream
()
.
filter
(
t
->
t
.
getSimpleVideoUploadStatus
()
!=
5
)
.
map
(
PhotoProgress:
:
getId
)
.
collect
(
Collectors
.
toList
());
update
(
Wrappers
.<
PhotoProgress
>
lambdaUpdate
().
in
(
PhotoProgress:
:
getId
,
ids
)
.
set
(
PhotoProgress:
:
getSimpleVideoUploadStatus
,
5
)
);
visualDesignLogService
.
addBatchLog
(
"photo_progress"
,
"根据文件将sku的视频上传后台状态设置为已删除"
,
ids
);
}
}
src/main/java/cn/kk/spring_simple_operation/service/impl/VideoProductServiceImpl.java
View file @
48337d47
...
...
@@ -2,9 +2,17 @@ package cn.kk.spring_simple_operation.service.impl;
import
cn.kk.spring_simple_operation.entity.VideoProduct
;
import
cn.kk.spring_simple_operation.mapper.VideoProductMapper
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
cn.kk.spring_simple_operation.service.VideoProductService
;
import
cn.kk.spring_simple_operation.service.VisualDesignLogService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -12,9 +20,26 @@ import org.springframework.stereotype.Service;
* </p>
*
* @author guokunkun
* @since 202
4-12-25
* @since 202
5-02-27
*/
@Service
public
class
VideoProductServiceImpl
extends
ServiceImpl
<
VideoProductMapper
,
VideoProduct
>
implements
VideoProductService
{
@Resource
private
VisualDesignLogService
visualDesignLogService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
setUploadStatusIsDeleted
(
List
<
SkuSiteDTO
>
list
)
{
List
<
VideoProduct
>
listVideoProduct
=
baseMapper
.
getListBySkuAndSite
(
list
);
List
<
Long
>
ids
=
listVideoProduct
.
stream
()
.
filter
(
videoProduct
->
videoProduct
.
getVideoIsUploadBackstage
()
!=
5
)
.
map
(
VideoProduct:
:
getId
)
.
collect
(
Collectors
.
toList
());
update
(
Wrappers
.<
VideoProduct
>
lambdaUpdate
().
in
(
VideoProduct:
:
getId
,
ids
)
.
set
(
VideoProduct:
:
getVideoIsUploadBackstage
,
5
)
);
visualDesignLogService
.
addBatchLog
(
"video_product"
,
"根据文件将sku和站点的视频上传后台状态设置为已删除"
,
ids
);
}
}
src/main/java/cn/kk/spring_simple_operation/service/impl/VisualDesignLogServiceImpl.java
View file @
48337d47
...
...
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
* 视觉操作日志 服务实现类
...
...
@@ -37,4 +40,25 @@ public class VisualDesignLogServiceImpl extends ServiceImpl<VisualDesignLogMappe
visualDesignLog
.
setOperationType
(
""
);
this
.
save
(
visualDesignLog
);
}
@Override
public
void
addBatchLog
(
String
operationKey
,
String
operationContent
,
List
<
Long
>
relationIdList
)
{
if
(
StringUtils
.
isEmpty
(
operationContent
)){
return
;
}
List
<
VisualDesignLog
>
logs
=
relationIdList
.
stream
().
map
(
relationId
->
{
VisualDesignLog
visualDesignLog
=
new
VisualDesignLog
();
visualDesignLog
.
setId
(
IdWorker
.
getId
());
visualDesignLog
.
setOperationKey
(
operationKey
);
visualDesignLog
.
setCreateId
(
0
);
visualDesignLog
.
setCreateName
(
"系统"
);
visualDesignLog
.
setOperationContent
(
operationContent
);
visualDesignLog
.
setRelationId
(
relationId
);
visualDesignLog
.
setFileUrl
(
""
);
visualDesignLog
.
setCreateTime
(
DateUtils
.
getCurrentTimeSecond
());
visualDesignLog
.
setOperationType
(
""
);
return
visualDesignLog
;
}).
collect
(
Collectors
.
toList
());
this
.
saveBatch
(
logs
);
}
}
src/main/resources/mapper/PhotoProgressMapper.xml
View file @
48337d47
...
...
@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.kk.spring_simple_operation.mapper.PhotoProgressMapper"
>
<select
id=
"getListBySku"
resultType=
"cn.kk.spring_simple_operation.entity.PhotoProgress"
>
select id, simple_video_upload_status
from photo_progress
where sku in
<foreach
collection=
"skuList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
src/main/resources/mapper/VideoProductMapper.xml
View file @
48337d47
...
...
@@ -4,17 +4,27 @@
<select
id=
"selectHaveTask"
resultType=
"java.lang.String"
>
SELECT
vp.sku
vp.sku
FROM
video_product vp
INNER JOIN visual_video_plan vvp ON vvp.id = vp.video_plan_id
video_product vp
INNER JOIN visual_video_plan vvp ON vvp.id = vp.video_plan_id
WHERE
vp.is_delete = 0
AND vvp.is_delete = 0
AND vp.site = 'Amazon.com'
vp.is_delete = 0
AND vvp.is_delete = 0
AND vp.site = 'Amazon.com'
and vp.sku in
<foreach
item=
"sku"
collection=
"skus"
open=
"("
separator=
","
close=
")"
>
#{sku}
</foreach>
</select>
<select
id=
"getListBySkuAndSite"
resultType=
"cn.kk.spring_simple_operation.entity.VideoProduct"
>
select id, video_is_upload_backstage
from video_product
where is_delete = 0
and (sku, site) in
<foreach
collection=
"list"
item=
"item"
open=
"("
separator=
","
close=
")"
>
(#{item.sku}, #{item.site})
</foreach>
</select>
</mapper>
src/test/java/cn/kk/spring_simple_operation/ApplicationTest.java
View file @
48337d47
package
cn
.
kk
.
spring_simple_operation
;
import
cn.kk.spring_simple_operation.mapper.VisualVideoPlanMapper
;
import
cn.kk.spring_simple_operation.model.dto.SkuSiteDTO
;
import
cn.kk.spring_simple_operation.service.PhotoProgressService
;
import
cn.kk.spring_simple_operation.service.VideoProductService
;
import
cn.kk.spring_simple_operation.service.VisualPhotographerAPlusService
;
import
cn.kk.spring_simple_operation.service.VisualVideoPlanService
;
import
cn.kk.spring_simple_operation.utils.ExcelUtil
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
javax.annotation.Resource
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.nio.file.Files
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
* @author kk
...
...
@@ -16,8 +28,26 @@ public class ApplicationTest {
@Resource
private
VisualPhotographerAPlusService
visualPhotographerAPlusService
;
@Resource
private
VideoProductService
videoProductService
;
@Resource
private
PhotoProgressService
photoProgressService
;
@Test
void
contextLoads
()
{
visualPhotographerAPlusService
.
brushDataForExecutor
();
void
contextLoads
()
throws
Exception
{
//visualPhotographerAPlusService.brushDataForExecutor();
setUploadStatusIsDeleted
();
}
private
void
setUploadStatusIsDeleted
()
throws
Exception
{
File
file
=
new
File
(
"已删除页面直接调整视频状态.xlsx"
);
ExcelUtil
<
SkuSiteDTO
>
util
=
new
ExcelUtil
<
SkuSiteDTO
>(
SkuSiteDTO
.
class
);
List
<
SkuSiteDTO
>
list
=
util
.
importExcel
(
"精细视频"
,
Files
.
newInputStream
(
file
.
toPath
()));
videoProductService
.
setUploadStatusIsDeleted
(
list
);
list
=
util
.
importExcel
(
"简易视频"
,
Files
.
newInputStream
(
file
.
toPath
()));
photoProgressService
.
setUploadStatusIsDeleted
(
list
);
}
}
已删除页面直接调整视频状态.xlsx
0 → 100644
View file @
48337d47
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment