Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
4bad1054
提交
4bad1054
authored
9月 10, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改商品置顶bug
上级
49856c70
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
102 行增加
和
9 行删除
+102
-9
TbCfStationItemDao.java
...in/src/main/java/com/platform/dao/TbCfStationItemDao.java
+8
-0
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+8
-7
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+84
-0
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+2
-2
没有找到文件。
platform-admin/src/main/java/com/platform/dao/TbCfStationItemDao.java
浏览文件 @
4bad1054
...
...
@@ -32,4 +32,12 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
TbCfStationItemEntity
queryItemBySort
(
Integer
sort
);
int
updateItemSort
(
TbCfStationItemEntity
item
);
int
minSort
();
int
maxSort
();
TbCfStationItemEntity
upSortItem
(
Integer
sort
);
TbCfStationItemEntity
downSortItem
(
Integer
sort
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
4bad1054
...
...
@@ -506,14 +506,15 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
TbCfStationItemEntity
item
=
tbCfStationItemDao
.
queryObject
(
itemId
);
Integer
sort
=
item
.
getSort
();
if
(
"1"
.
equals
(
String
.
valueOf
(
sort
)))
{
int
minSort
=
tbCfStationItemDao
.
minSort
();
if
(
String
.
valueOf
(
minSort
).
equals
(
String
.
valueOf
(
sort
)))
{
return
-
1
;
}
TbCfStationItemEntity
upItem
=
tbCfStationItemDao
.
queryItemBySort
(
sort
-
1
);
TbCfStationItemEntity
upItem
=
tbCfStationItemDao
.
upSortItem
(
sort
);
item
.
setSort
(
upItem
.
getSort
());
upItem
.
setSort
(
sort
);
int
res1
=
tbCfStationItemDao
.
updateItemSort
(
upItem
);
item
.
setSort
(
sort
-
1
);
int
res2
=
tbCfStationItemDao
.
updateItemSort
(
item
);
if
(
res1
>
0
&&
res2
>
0
)
{
...
...
@@ -529,14 +530,14 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
int
res
=
0
;
TbCfStationItemEntity
item
=
tbCfStationItemDao
.
queryObject
(
itemId
);
Integer
sort
=
item
.
getSort
();
int
count
=
tbCfStationItemDao
.
queryTopCoun
t
();
if
(
String
.
valueOf
(
coun
t
).
equals
(
String
.
valueOf
(
sort
)))
{
int
maxSort
=
tbCfStationItemDao
.
maxSor
t
();
if
(
String
.
valueOf
(
maxSor
t
).
equals
(
String
.
valueOf
(
sort
)))
{
return
-
1
;
}
TbCfStationItemEntity
downItem
=
tbCfStationItemDao
.
queryItemBySort
(
sort
+
1
);
TbCfStationItemEntity
downItem
=
tbCfStationItemDao
.
downSortItem
(
sort
);
item
.
setSort
(
downItem
.
getSort
());
downItem
.
setSort
(
sort
);
int
res1
=
tbCfStationItemDao
.
updateItemSort
(
downItem
);
item
.
setSort
(
sort
+
1
);
int
res2
=
tbCfStationItemDao
.
updateItemSort
(
item
);
if
(
res1
>
0
&&
res2
>
0
)
{
res
=
1
;
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
4bad1054
...
...
@@ -105,6 +105,90 @@
WHERE item_code = #{code}
</select>
<select
id=
"minSort"
resultType=
"int"
>
select min(sort) FROM tb_cf_station_item where item_top=1
</select>
<select
id=
"maxSort"
resultType=
"int"
>
select max(sort) FROM tb_cf_station_item where item_top=1
</select>
<select
id=
"upSortItem"
resultType=
"com.platform.entity.TbCfStationItemEntity"
>
SELECT
item_id,
`item_code`,
`item_name`,
`item_brief`,
`item_category`,
`item_price`,
`discount_price`,
cost_price,
`item_url`,
`item_img`,
`item_tags`,
`item_label`,
`item_num`,
`item_count`,
`item_sku`,
`item_top`,
sort,
`supplier`,
template,
`sku_imgs`,
`platform_code`,
`platform_name`,
`enable_flag`,
create_time,
`item_categorytwo`,
`item_descrition_id`,
creator
FROM
tb_cf_station_item
WHERE
item_top = 1
AND sort
<
#{sort}
ORDER BY sort desc
limit 1
</select>
<select
id=
"downSortItem"
resultType=
"com.platform.entity.TbCfStationItemEntity"
>
SELECT
item_id,
`item_code`,
`item_name`,
`item_brief`,
`item_category`,
`item_price`,
`discount_price`,
cost_price,
`item_url`,
`item_img`,
`item_tags`,
`item_label`,
`item_num`,
`item_count`,
`item_sku`,
`item_top`,
sort,
`supplier`,
template,
`sku_imgs`,
`platform_code`,
`platform_name`,
`enable_flag`,
create_time,
`item_categorytwo`,
`item_descrition_id`,
creator
FROM
tb_cf_station_item
WHERE
item_top = 1
AND sort
>
#{sort}
ORDER BY sort asc
limit 1
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
SELECT
i.item_id,
...
...
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
4bad1054
...
...
@@ -25,8 +25,8 @@ $(function () {
{
label
:
'操作'
,
index
:
'operate'
,
width
:
120
,
formatter
:
function
(
value
,
grid
,
rows
)
{
if
(
rows
.
itemTop
===
1
)
{
return
'<span class="label label-primary pointer" onclick="vm.itemUpward(
\'
'
+
rows
.
itemId
+
'
\'
)" ">
up
</span> '
+
'<span class="label label-success pointer" onclick="vm.itemDownward(
\'
'
+
rows
.
itemId
+
'
\'
)" ">
down
</span>  '
+
return
'<span class="label label-primary pointer" onclick="vm.itemUpward(
\'
'
+
rows
.
itemId
+
'
\'
)" ">
上移
</span> '
+
'<span class="label label-success pointer" onclick="vm.itemDownward(
\'
'
+
rows
.
itemId
+
'
\'
)" ">
下移
</span>  '
+
'<span class="label label-danger pointer" onclick="vm.cancelTop(
\'
'
+
rows
.
itemId
+
'
\'
)" ">取消置顶</span> '
;
}
return
'<span class="label label-info pointer" onclick="vm.itemTop(
\'
'
+
rows
.
itemId
+
'
\'
)">置顶</span> '
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论