Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
ac372935
提交
ac372935
authored
9月 10, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sql 优化
上级
d3ce48a9
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
24 行删除
+26
-24
TbCfStationItemDao.java
...in/src/main/java/com/platform/dao/TbCfStationItemDao.java
+2
-0
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+15
-7
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+8
-16
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+1
-1
没有找到文件。
platform-admin/src/main/java/com/platform/dao/TbCfStationItemDao.java
浏览文件 @
ac372935
...
...
@@ -30,4 +30,6 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
int
queryTopCount
();
TbCfStationItemEntity
queryItemBySort
(
Integer
sort
);
int
updateItemSort
(
TbCfStationItemEntity
item
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
ac372935
...
...
@@ -22,6 +22,8 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
/**
* 站点商品Service实现类
...
...
@@ -52,6 +54,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Autowired
private
TbCfItemParamDao
tbCfItemParamDao
;
@Override
public
ItemInfo
queryItemInfoById
(
String
itemId
)
{
//查询商品主体信息
...
...
@@ -480,7 +483,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Override
public
int
itemTop
(
String
itemId
)
{
TbCfStationItemEntity
item
=
tbCfStationItemDao
.
queryObject
(
itemId
);
if
(
"2"
.
equals
(
item
.
getEnableFlag
().
toString
(
)))
{
if
(
"2"
.
equals
(
String
.
valueOf
(
item
.
getEnableFlag
()
)))
{
return
-
1
;
}
item
.
setItemTop
(
1
);
...
...
@@ -500,19 +503,24 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
@Override
public
int
itemUpward
(
String
itemId
)
{
int
res
=
0
;
TbCfStationItemEntity
item
=
tbCfStationItemDao
.
queryObject
(
itemId
);
Integer
sort
=
item
.
getSort
();
if
(
"1"
.
equals
(
sort
.
toString
(
)))
{
if
(
"1"
.
equals
(
String
.
valueOf
(
sort
)))
{
return
-
1
;
}
TbCfStationItemEntity
upItem
=
tbCfStationItemDao
.
queryItemBySort
(
sort
-
1
);
upItem
.
setSort
(
sort
);
int
res1
=
tbCfStationItemDao
.
update
(
upItem
);
int
res1
=
tbCfStationItemDao
.
update
ItemSort
(
upItem
);
item
.
setSort
(
sort
-
1
);
int
res2
=
tbCfStationItemDao
.
update
(
item
);
int
res2
=
tbCfStationItemDao
.
updateItemSort
(
item
);
if
(
res1
>
0
&&
res2
>
0
)
{
res
=
1
;
}
return
res
;
}
...
...
@@ -522,14 +530,14 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
TbCfStationItemEntity
item
=
tbCfStationItemDao
.
queryObject
(
itemId
);
Integer
sort
=
item
.
getSort
();
int
count
=
tbCfStationItemDao
.
queryTopCount
();
if
(
String
.
valueOf
(
count
).
equals
(
sort
.
toString
(
)))
{
if
(
String
.
valueOf
(
count
).
equals
(
String
.
valueOf
(
sort
)))
{
return
-
1
;
}
TbCfStationItemEntity
downItem
=
tbCfStationItemDao
.
queryItemBySort
(
sort
+
1
);
downItem
.
setSort
(
sort
);
int
res1
=
tbCfStationItemDao
.
update
(
downItem
);
int
res1
=
tbCfStationItemDao
.
update
ItemSort
(
downItem
);
item
.
setSort
(
sort
+
1
);
int
res2
=
tbCfStationItemDao
.
update
(
item
);
int
res2
=
tbCfStationItemDao
.
update
ItemSort
(
item
);
if
(
res1
>
0
&&
res2
>
0
)
{
res
=
1
;
}
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
ac372935
...
...
@@ -119,17 +119,11 @@
i.item_id,
i.item_code,
i.item_name,
i.item_brief,
i.item_category,
i.item_price,
i.discount_price,
i.cost_price,
i.item_url,
i.item_img,
i.item_count,
i.item_num,
i.platform_code,
i.platform_name,
i.enable_flag,
i.create_time,
i.item_categorytwo,
...
...
@@ -137,26 +131,20 @@
i.item_top,
i.sort,
i.supplier,
i.template,
i.sku_imgs,
i.creator,
d.descripition_name dname,
t.goodstwotype_title title,
o.goodstype_title goodtype,
u.user_name uname
o.goodstype_title goodtype
FROM
tb_cf_station_item i
left JOIN tb_cf_goodstype o ON o.goodstype_id = i.item_category
left JOIN tb_cf_goodstwotype t ON i.item_categorytwo=t.goodstwotype_id
left JOIN tb_cf_descripiton d ON i.item_descrition_id=d.descripition_id
left JOIN tb_cf_express_template e ON i.item_descrition_id = e.template_id
left join sys_user u on i.creator=u.user_id
WHERE 1=1 and i.enable_flag!=0
WHERE i.enable_flag!=0
<if
test=
"creator != null and creator.trim() != ''"
>
AND creator=#{creator}
</if>
<if
test=
"name != null and name.trim() != ''"
>
AND item_name LIKE concat('%',#{name},'%') or item_id
LIKE concat('%',#{name},'%')
AND item_name LIKE concat('%',#{name},'%') or item_id
= #{name}
</if>
<if
test=
"code != null and code.trim() != ''"
>
AND item_code=#{code}
...
...
@@ -217,7 +205,7 @@
select count(*) from tb_cf_station_item
WHERE 1=1 and enable_flag!=0
<if
test=
"name != null and name.trim() != ''"
>
AND item_name LIKE concat('%',#{name},'%') or item_id
LIKE concat('%',#{name},'%')
AND item_name LIKE concat('%',#{name},'%') or item_id
=#{name}
</if>
<if
test=
"code != null and code.trim() != ''"
>
AND item_code=#{code}
...
...
@@ -336,6 +324,10 @@
where item_id = #{itemId}
</update>
<update
id=
"updateItemSort"
parameterType=
"com.platform.entity.TbCfStationItemEntity"
>
update tb_cf_station_item set `sort` = #{sort} where item_id=#{itemId}
</update>
<delete
id=
"delete"
>
delete from tb_cf_station_item where item_id = #{value}
</delete>
...
...
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
ac372935
...
...
@@ -11,7 +11,7 @@ $(function () {
{
label
:
'商品原价'
,
name
:
'itemPrice'
,
index
:
'item_price'
,
width
:
45
},
{
label
:
'商品现价'
,
name
:
'discountPrice'
,
index
:
'discount_price'
,
width
:
45
},
{
label
:
'库存'
,
name
:
'itemCount'
,
index
:
'item_count'
,
width
:
45
},
{
label
:
'点击量'
,
name
:
'itemNum'
,
index
:
'item_num'
,
width
:
45
},
//
{label: '点击量', name: 'itemNum', index: 'item_num', width: 45},
/*{label: '所属平台', name: 'platformCode', index: 'platform_code', width: 80},
{label: '平台名', name: 'platformName', index: 'platform_name', width: 80},*/
{
label
:
'供应商'
,
name
:
'supplier'
,
index
:
'supplier'
,
width
:
80
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论