Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
promotion-service
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
promotion
promotion-service
Commits
18cc318f
提交
18cc318f
authored
5月 13, 2024
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
活动上报图片保存、jsyq
上级
365ceea5
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
76 行增加
和
23 行删除
+76
-23
TemporaryActivityCoreController.java
...r/activity/temporary/TemporaryActivityCoreController.java
+0
-3
TemporaryActivityPhotoDao.java
...motion/domain/activity/dao/TemporaryActivityPhotoDao.java
+1
-0
TemporaryActivityPhotoDaoImpl.java
...main/activity/dao/impl/TemporaryActivityPhotoDaoImpl.java
+39
-0
TemporaryActivityPhotoMapper.java
.../domain/activity/mapper/TemporaryActivityPhotoMapper.java
+1
-3
TemActApproveStatus.java
...gxiaolu/promotion/enums/activity/TemActApproveStatus.java
+2
-1
TemporaryActivityReportedDto.java
.../activity/temporary/dto/TemporaryActivityReportedDto.java
+3
-1
TemporaryActivityDataVo.java
...n/pojo/activity/temporary/vo/TemporaryActivityDataVo.java
+3
-3
TemporaryActivityCoreServiceImpl.java
...vity/temporary/impl/TemporaryActivityCoreServiceImpl.java
+6
-4
TemporaryActivityQueryServiceImpl.java
...ity/temporary/impl/TemporaryActivityQueryServiceImpl.java
+14
-8
TemporaryActivityPhotoMapper.xml
src/main/resources/mapper/TemporaryActivityPhotoMapper.xml
+7
-0
没有找到文件。
src/main/java/com/wangxiaolu/promotion/controller/activity/temporary/TemporaryActivityCoreController.java
浏览文件 @
18cc318f
...
...
@@ -82,9 +82,6 @@ public class TemporaryActivityCoreController {
}
/**
* todo 促销员[今日活动]数据提交审批
*/
...
...
src/main/java/com/wangxiaolu/promotion/domain/activity/dao/TemporaryActivityPhotoDao.java
浏览文件 @
18cc318f
...
...
@@ -14,6 +14,7 @@ public interface TemporaryActivityPhotoDao {
* 保存活动上报照片list
*/
void
saveReportedList
(
Integer
temporaryId
,
Long
reportedId
,
Integer
photoType
,
List
<
String
>
urls
);
void
saveReportedList
(
Integer
temporaryId
,
Long
reportedId
,
Integer
photoType
,
List
<
String
>
urls
,
List
<
String
>
changeUrls
);
/**
* 根据促销员id-活动上报id查询图片
...
...
src/main/java/com/wangxiaolu/promotion/domain/activity/dao/impl/TemporaryActivityPhotoDaoImpl.java
浏览文件 @
18cc318f
...
...
@@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.wangxiaolu.promotion.domain.activity.dao.TemporaryActivityPhotoDao
;
import
com.wangxiaolu.promotion.domain.activity.mapper.TemporaryActivityPhotoMapper
;
import
com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityPhotoDO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -17,6 +20,7 @@ import java.util.stream.Collectors;
* @date : 2024-05-09 11
* @describe :
*/
@Slf4j
@Service
public
class
TemporaryActivityPhotoDaoImpl
implements
TemporaryActivityPhotoDao
{
...
...
@@ -33,6 +37,41 @@ public class TemporaryActivityPhotoDaoImpl implements TemporaryActivityPhotoDao
}
}
@Override
public
void
saveReportedList
(
Integer
temporaryId
,
Long
reportedId
,
Integer
photoType
,
List
<
String
>
urls
,
List
<
String
>
changeUrls
)
{
if
(
CollectionUtils
.
isEmpty
(
changeUrls
))
{
log
.
info
(
"活动id[{}]图片无改变值"
,
reportedId
);
return
;
}
Map
<
String
,
String
>
urlTypeMap
=
new
HashMap
<>();
for
(
String
changeUrl
:
changeUrls
)
{
String
[]
uArr
=
changeUrl
.
split
(
"/"
);
String
type
=
uArr
[
0
];
String
uId
=
uArr
[
uArr
.
length
-
1
];
urlTypeMap
.
put
(
uId
,
type
);
}
log
.
info
(
"活动id[{}]图片修改后的list为:{}"
,
reportedId
,
urlTypeMap
);
for
(
String
photoUrl
:
urls
)
{
String
[]
photoArr
=
photoUrl
.
split
(
"/"
);
String
photoFiledId
=
photoArr
[
photoArr
.
length
-
1
];
String
type
=
urlTypeMap
.
get
(
photoFiledId
);
log
.
info
(
"图片文件id[{}]类型为{}"
,
photoFiledId
,
type
);
// 现存图片列表中不存在,删除
if
(
StringUtils
.
isBlank
(
type
))
{
temporaryActivityPhotoMapper
.
updateIsDelete
(
reportedId
,
photoFiledId
);
}
else
if
(
"cloud:"
.
equals
(
type
))
{
// 新增数据
TemporaryActivityPhotoDO
photoDo
=
new
TemporaryActivityPhotoDO
();
photoDo
.
setTemporaryId
(
temporaryId
).
setReportedId
(
reportedId
).
setType
(
photoType
).
setPhotoUrl
(
photoUrl
).
setPhotoFiledId
(
photoFiledId
);
temporaryActivityPhotoMapper
.
insert
(
photoDo
);
}
}
}
/**
* 活动上报图片查询
*
...
...
src/main/java/com/wangxiaolu/promotion/domain/activity/mapper/TemporaryActivityPhotoMapper.java
浏览文件 @
18cc318f
...
...
@@ -3,11 +3,8 @@ package com.wangxiaolu.promotion.domain.activity.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.wangxiaolu.promotion.domain.activity.mapper.entity.TemporaryActivityPhotoDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* @author a02200059
* @description 针对表【temporary_activity_photo】的数据库操作Mapper
...
...
@@ -17,6 +14,7 @@ import java.util.List;
@Mapper
@Repository
public
interface
TemporaryActivityPhotoMapper
extends
BaseMapper
<
TemporaryActivityPhotoDO
>
{
void
updateIsDelete
(
Long
reportedId
,
String
photoFiledId
);
}
...
...
src/main/java/com/wangxiaolu/promotion/enums/activity/TemActApproveStatus.java
浏览文件 @
18cc318f
...
...
@@ -15,7 +15,8 @@ public enum TemActApproveStatus {
/**
* 审批状态
*/
SUBMITTED
(
"已提交"
),
// 保存但未提交审批
SUBMITTED
(
"已保存"
),
IN_APPROVAL
(
"审批中"
),
APPROVED
(
"审批通过"
),
SEND_BACK
(
"退回"
),
...
...
src/main/java/com/wangxiaolu/promotion/pojo/activity/temporary/dto/TemporaryActivityReportedDto.java
浏览文件 @
18cc318f
...
...
@@ -76,17 +76,19 @@ public class TemporaryActivityReportedDto {
* 推广试吃照片
*/
List
<
String
>
tgscPhotoUrls
;
List
<
String
>
tgscChangePhotoUrls
;
/**
* 推广互动照片
*/
List
<
String
>
tghdPhotoUrls
;
List
<
String
>
tghdChangePhotoUrls
;
/**
* 推广成交照片
*/
List
<
String
>
tgcjPhotoUrls
;
List
<
String
>
tgcjChangePhotoUrls
;
/**
* 创建时间
...
...
src/main/java/com/wangxiaolu/promotion/pojo/activity/temporary/vo/TemporaryActivityDataVo.java
浏览文件 @
18cc318f
...
...
@@ -45,20 +45,20 @@ public class TemporaryActivityDataVo {
/**
* 推广试吃照片
* 只传增量,存量数据前端不再返回,增量数据直接保存到DB中
*/
List
<
String
>
tgscPhotoUrls
;
List
<
String
>
tgscChangePhotoUrls
;
/**
* 推广互动照片
* 只传增量,存量数据前端不再返回,增量数据直接保存到DB中
*/
List
<
String
>
tghdPhotoUrls
;
List
<
String
>
tghdChangePhotoUrls
;
/**
* 推广成交照片
* 只传增量,存量数据前端不再返回,增量数据直接保存到DB中
*/
List
<
String
>
tgcjPhotoUrls
;
List
<
String
>
tgcjChangePhotoUrls
;
}
src/main/java/com/wangxiaolu/promotion/service/activity/temporary/impl/TemporaryActivityCoreServiceImpl.java
浏览文件 @
18cc318f
...
...
@@ -68,7 +68,9 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
// 保存活动数据 temporary_activity_reported
long
reportedId
=
temporaryActivityReportedDao
.
activityDataSave
(
temActDto
);
temActDto
.
setId
(
reportedId
);
// 保存图片
/**
* 保存图片
*/
saveActivityPhoto
(
temActDto
);
return
reportedId
;
}
...
...
@@ -101,17 +103,17 @@ public class TemporaryActivityCoreServiceImpl implements TemporaryActivityCoreSe
Long
reportedId
=
temActDto
.
getId
();
// 推广试吃照片
if
(!
CollectionUtils
.
isEmpty
(
temActDto
.
getTgscPhotoUrls
()))
{
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tgsc
.
getType
(),
temActDto
.
getTgscPhotoUrls
());
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tgsc
.
getType
(),
temActDto
.
getTgscPhotoUrls
()
,
temActDto
.
getTgscChangePhotoUrls
()
);
}
// 推广互动照片
if
(!
CollectionUtils
.
isEmpty
(
temActDto
.
getTghdPhotoUrls
()))
{
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tghd
.
getType
(),
temActDto
.
getTghdPhotoUrls
());
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tghd
.
getType
(),
temActDto
.
getTghdPhotoUrls
()
,
temActDto
.
getTghdChangePhotoUrls
()
);
}
// 推广成交照片
if
(!
CollectionUtils
.
isEmpty
(
temActDto
.
getTgcjPhotoUrls
()))
{
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tgcj
.
getType
(),
temActDto
.
getTgcjPhotoUrls
());
tempActivityPhotoDao
.
saveReportedList
(
temporaryId
,
reportedId
,
ActivityPhotoType
.
tgcj
.
getType
(),
temActDto
.
getTgcjPhotoUrls
()
,
temActDto
.
getTgcjChangePhotoUrls
()
);
}
log
.
info
(
"促销员今日活动上报-图片保存成功,关联活动上报数据id[{}],数据信息:{}"
,
temActDto
.
getId
(),
temActDto
);
...
...
src/main/java/com/wangxiaolu/promotion/service/activity/temporary/impl/TemporaryActivityQueryServiceImpl.java
浏览文件 @
18cc318f
...
...
@@ -45,20 +45,26 @@ public class TemporaryActivityQueryServiceImpl implements TemporaryActivityQuery
@Override
public
TemporaryActivityReportedDto
findtemporaryIdTodayActivityData
(
Integer
temporaryId
)
{
TemporaryActivityReportedDto
dto
=
temporaryActivityReportedDao
.
findOneByCurrentDate
(
temporaryId
);
if
(
Objects
.
nonNull
(
dto
))
{
Map
<
Integer
,
List
<
String
>>
reportedGroup
=
temporaryActivityPhotoDao
.
findReportedGroup
(
dto
.
getTemporaryId
(),
dto
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
reportedGroup
))
{
dto
.
setTgscPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tgsc
.
getType
()));
dto
.
setTghdPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tghd
.
getType
()));
dto
.
setTgcjPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tgcj
.
getType
()));
}
}
findActivityReportedPhoto
(
dto
);
return
dto
;
}
@Override
public
TemporaryActivityReportedDto
findTemporaryActivityById
(
Long
activityId
)
{
TemporaryActivityReportedDto
dto
=
temporaryActivityReportedDao
.
findOneById
(
activityId
);
findActivityReportedPhoto
(
dto
);
return
dto
;
}
private
void
findActivityReportedPhoto
(
TemporaryActivityReportedDto
dto
)
{
if
(
Objects
.
isNull
(
dto
))
{
return
;
}
Map
<
Integer
,
List
<
String
>>
reportedGroup
=
temporaryActivityPhotoDao
.
findReportedGroup
(
dto
.
getTemporaryId
(),
dto
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
reportedGroup
))
{
dto
.
setTgscPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tgsc
.
getType
()));
dto
.
setTghdPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tghd
.
getType
()));
dto
.
setTgcjPhotoUrls
(
reportedGroup
.
get
(
ActivityPhotoType
.
tgcj
.
getType
()));
}
}
}
src/main/resources/mapper/TemporaryActivityPhotoMapper.xml
浏览文件 @
18cc318f
...
...
@@ -19,4 +19,11 @@
photo_url,photo_field_id
</sql>
<update
id=
"updateIsDelete"
>
update temporary_activity_photo
set is_delete = 0
where reported_id = #{reportedId}
and photo_filed_id = #{photoFiledId};
</update>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论