Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
34c648fa
提交
34c648fa
authored
10月 15, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改商品oss上传二级目录
上级
1c00243f
全部展开
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
260 行增加
和
220 行删除
+260
-220
OssTestApi.java
...src/main/java/com/platform/controller/api/OssTestApi.java
+218
-213
uploadController.java
...in/java/com/platform/controller/api/uploadController.java
+2
-2
AdvertisementItemDao.java
.../src/main/java/com/platform/dao/AdvertisementItemDao.java
+4
-0
AdvertisementItemServiceImpl.java
...m/platform/service/impl/AdvertisementItemServiceImpl.java
+16
-5
AdvertisementItemDao.xml
.../main/resources/com/platform/dao/AdvertisementItemDao.xml
+20
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/api/OssTestApi.java
浏览文件 @
34c648fa
差异被折叠。
点击展开。
platform-admin/src/main/java/com/platform/controller/api/uploadController.java
浏览文件 @
34c648fa
...
@@ -29,7 +29,7 @@ public class uploadController {
...
@@ -29,7 +29,7 @@ public class uploadController {
@RequestMapping
(
value
=
"/uploadFile"
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/uploadFile"
,
produces
=
"application/json;charset=UTF-8"
)
public
String
upload
(
MultipartFile
file
)
{
public
String
upload
(
MultipartFile
file
)
{
try
{
try
{
String
secondaryFolderName
=
"
A
frishop"
;
String
secondaryFolderName
=
"
a
frishop"
;
// 获取文件名
// 获取文件名
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
// 获取文件后缀
// 获取文件后缀
...
...
platform-admin/src/main/java/com/platform/dao/AdvertisementItemDao.java
浏览文件 @
34c648fa
...
@@ -3,6 +3,7 @@ package com.platform.dao;
...
@@ -3,6 +3,7 @@ package com.platform.dao;
import
com.platform.entity.AdvertisementItemEntity
;
import
com.platform.entity.AdvertisementItemEntity
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -27,5 +28,8 @@ public interface AdvertisementItemDao extends BaseDao<AdvertisementItemEntity> {
...
@@ -27,5 +28,8 @@ public interface AdvertisementItemDao extends BaseDao<AdvertisementItemEntity> {
int
existItemSort
(
@Param
(
"adId"
)
String
adId
,
@Param
(
"sort"
)
Integer
sort
);
int
existItemSort
(
@Param
(
"adId"
)
String
adId
,
@Param
(
"sort"
)
Integer
sort
);
List
<
AdvertisementItemEntity
>
changeSortBack
(
@Param
(
"firstSort"
)
Integer
firstSort
,
@Param
(
"endSort"
)
Integer
endSort
,
@Param
(
"adId"
)
String
adId
);
List
<
AdvertisementItemEntity
>
changeSortFront
(
@Param
(
"firstSort"
)
Integer
firstSort
,
@Param
(
"endSort"
)
Integer
endSort
,
@Param
(
"adId"
)
String
adId
);
}
}
platform-admin/src/main/java/com/platform/service/impl/AdvertisementItemServiceImpl.java
浏览文件 @
34c648fa
...
@@ -146,13 +146,24 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
...
@@ -146,13 +146,24 @@ public class AdvertisementItemServiceImpl implements AdvertisementItemService {
res
=
advertisementItemDao
.
updateAdItem
(
byId
);
res
=
advertisementItemDao
.
updateAdItem
(
byId
);
}
else
{
}
else
{
//要更换的序号被占有
//要更换的序号被占有
//情况3
//情况3 (2-->8)
if
(
byId
.
getSort
()
<
itemSort
)
{
Integer
sort1
=
byId
.
getSort
();
if
(
sort1
<
itemSort
)
{
List
<
AdvertisementItemEntity
>
list
=
advertisementItemDao
.
changeSortBack
(
sort1
+
1
,
itemSort
,
adId
);
for
(
AdvertisementItemEntity
ad
:
list
)
{
ad
.
setSort
(
ad
.
getSort
()
-
1
);
advertisementItemDao
.
updateAdItem
(
ad
);
}
}
else
{
}
else
{
//情况4
//情况4 (8-->2)
List
<
AdvertisementItemEntity
>
list
=
advertisementItemDao
.
changeSortFront
(
itemSort
,
sort1
-
1
,
adId
);
for
(
AdvertisementItemEntity
ad
:
list
)
{
ad
.
setSort
(
ad
.
getSort
()
+
1
);
advertisementItemDao
.
updateAdItem
(
ad
);
}
}
}
byId
.
setSort
(
itemSort
);
res
=
advertisementItemDao
.
updateAdItem
(
byId
);
}
}
...
...
platform-admin/src/main/resources/com/platform/dao/AdvertisementItemDao.xml
浏览文件 @
34c648fa
...
@@ -57,6 +57,26 @@
...
@@ -57,6 +57,26 @@
</if>
</if>
</select>
</select>
<select
id=
"changeSortBack"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
select
`ad_id`,
`item_id`,
`is_top`,
`sort`,
`create_time`
from advertisement_item where sort BETWEEN #{firstSort} AND #{endSort} and ad_id=#{adId}
</select>
<select
id=
"changeSortFront"
resultType=
"com.platform.entity.AdvertisementItemEntity"
>
select
`ad_id`,
`item_id`,
`is_top`,
`sort`,
`create_time`
from advertisement_item where sort BETWEEN #{firstSort} AND #{endSort} and ad_id=#{adId}
</select>
<delete
id=
"deleteByItem"
>
<delete
id=
"deleteByItem"
>
delete from advertisement_item where item_id=#{itemId} and ad_id=#{adId}
delete from advertisement_item where item_id=#{itemId} and ad_id=#{adId}
</delete>
</delete>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论