Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
c4c2e15f
提交
c4c2e15f
authored
7月 03, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成帖子管理
上级
3a4487c3
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
263 行增加
和
68 行删除
+263
-68
HashtagController.java
.../main/java/com/platform/controller/HashtagController.java
+6
-0
PostController.java
...src/main/java/com/platform/controller/PostController.java
+2
-1
PostHashtagController.java
...n/java/com/platform/controller/PostHashtagController.java
+2
-2
HashtagDao.java
...form-admin/src/main/java/com/platform/dao/HashtagDao.java
+2
-0
TbCfStationItemDao.java
...in/src/main/java/com/platform/dao/TbCfStationItemDao.java
+2
-0
PostEntity.java
...m-admin/src/main/java/com/platform/entity/PostEntity.java
+52
-1
HashtagService.java
...in/src/main/java/com/platform/service/HashtagService.java
+9
-0
PostHashtagService.java
...rc/main/java/com/platform/service/PostHashtagService.java
+3
-3
PostService.java
...admin/src/main/java/com/platform/service/PostService.java
+3
-2
HashtagServiceImpl.java
...in/java/com/platform/service/impl/HashtagServiceImpl.java
+5
-0
PostHashtagServiceImpl.java
...ava/com/platform/service/impl/PostHashtagServiceImpl.java
+3
-3
PostServiceImpl.java
.../main/java/com/platform/service/impl/PostServiceImpl.java
+44
-27
PostVo.java
platform-admin/src/main/java/com/platform/vo/PostVo.java
+24
-0
HashtagDao.xml
...-admin/src/main/resources/com/platform/dao/HashtagDao.xml
+20
-0
PostDao.xml
...orm-admin/src/main/resources/com/platform/dao/PostDao.xml
+32
-17
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+7
-0
post.js
platform-admin/src/main/webapp/js/sys/post.js
+47
-12
没有找到文件。
platform-admin/src/main/java/com/platform/controller/HashtagController.java
浏览文件 @
c4c2e15f
...
@@ -119,5 +119,11 @@ public class HashtagController {
...
@@ -119,5 +119,11 @@ public class HashtagController {
return
R
.
ok
().
put
(
"list"
,
list
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
@RequestMapping
(
"/getTagsByIds"
)
@ResponseBody
public
R
getTagsByIds
(
@RequestBody
String
[]
ids
)
{
return
R
.
ok
();
}
}
}
platform-admin/src/main/java/com/platform/controller/PostController.java
浏览文件 @
c4c2e15f
...
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.io.UnsupportedEncodingException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -66,7 +67,7 @@ public class PostController {
...
@@ -66,7 +67,7 @@ public class PostController {
@RequestMapping
(
"/save"
)
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"post:save"
)
@RequiresPermissions
(
"post:save"
)
@ResponseBody
@ResponseBody
public
R
save
(
@RequestBody
PostEntity
post
)
{
public
R
save
(
@RequestBody
PostEntity
post
)
throws
UnsupportedEncodingException
{
postService
.
save
(
post
);
postService
.
save
(
post
);
return
R
.
ok
();
return
R
.
ok
();
...
...
platform-admin/src/main/java/com/platform/controller/PostHashtagController.java
浏览文件 @
c4c2e15f
...
@@ -53,7 +53,7 @@ public class PostHashtagController {
...
@@ -53,7 +53,7 @@ public class PostHashtagController {
@RequestMapping
(
"/info/{id}"
)
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"posthashtag:info"
)
@RequiresPermissions
(
"posthashtag:info"
)
@ResponseBody
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
Lo
ng
id
)
{
public
R
info
(
@PathVariable
(
"id"
)
Stri
ng
id
)
{
PostHashtagEntity
postHashtag
=
postHashtagService
.
queryObject
(
id
);
PostHashtagEntity
postHashtag
=
postHashtagService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"postHashtag"
,
postHashtag
);
return
R
.
ok
().
put
(
"postHashtag"
,
postHashtag
);
...
@@ -89,7 +89,7 @@ public class PostHashtagController {
...
@@ -89,7 +89,7 @@ public class PostHashtagController {
@RequestMapping
(
"/delete"
)
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"posthashtag:delete"
)
@RequiresPermissions
(
"posthashtag:delete"
)
@ResponseBody
@ResponseBody
public
R
delete
(
@RequestBody
Lo
ng
[]
ids
)
{
public
R
delete
(
@RequestBody
Stri
ng
[]
ids
)
{
postHashtagService
.
deleteBatch
(
ids
);
postHashtagService
.
deleteBatch
(
ids
);
return
R
.
ok
();
return
R
.
ok
();
...
...
platform-admin/src/main/java/com/platform/dao/HashtagDao.java
浏览文件 @
c4c2e15f
...
@@ -13,4 +13,6 @@ import java.util.List;
...
@@ -13,4 +13,6 @@ import java.util.List;
public
interface
HashtagDao
extends
BaseDao
<
HashtagEntity
>
{
public
interface
HashtagDao
extends
BaseDao
<
HashtagEntity
>
{
List
<
HashtagEntity
>
getTagsByName
(
String
name
);
List
<
HashtagEntity
>
getTagsByName
(
String
name
);
List
<
HashtagEntity
>
getTagsByIds
(
String
[]
ids
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfStationItemDao.java
浏览文件 @
c4c2e15f
...
@@ -24,4 +24,6 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
...
@@ -24,4 +24,6 @@ public interface TbCfStationItemDao extends BaseDao<TbCfStationItemEntity> {
TbCfStationItemEntity
queryByCode
(
String
code
);
TbCfStationItemEntity
queryByCode
(
String
code
);
List
<
TbCfStationItemEntity
>
queryByCodeList
(
String
code
);
List
<
TbCfStationItemEntity
>
queryByCodeList
(
String
code
);
List
<
TbCfStationItemEntity
>
getItemByIds
(
String
[]
ids
);
}
}
platform-admin/src/main/java/com/platform/entity/PostEntity.java
浏览文件 @
c4c2e15f
...
@@ -8,7 +8,7 @@ import java.util.Date;
...
@@ -8,7 +8,7 @@ import java.util.Date;
* 表名 post
* 表名 post
*
*
* @author lipengjun
* @author lipengjun
* @date 2020-0
6-28 15:28:31
* @date 2020-0
7-03 11:16:53
*/
*/
public
class
PostEntity
implements
Serializable
{
public
class
PostEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -73,6 +73,18 @@ public class PostEntity implements Serializable {
...
@@ -73,6 +73,18 @@ public class PostEntity implements Serializable {
* 是否置顶 0: 不置顶 1:置顶
* 是否置顶 0: 不置顶 1:置顶
*/
*/
private
Integer
isTop
;
private
Integer
isTop
;
/**
* 商品ID集合
*/
private
String
itemIds
;
/**
* 标签ID集合
*/
private
String
tagIds
;
/**
*
*/
private
String
title
;
/**
/**
* 设置:帖子ID
* 设置:帖子ID
...
@@ -269,4 +281,43 @@ public class PostEntity implements Serializable {
...
@@ -269,4 +281,43 @@ public class PostEntity implements Serializable {
public
Integer
getIsTop
()
{
public
Integer
getIsTop
()
{
return
isTop
;
return
isTop
;
}
}
/**
* 设置:商品ID集合
*/
public
void
setItemIds
(
String
itemIds
)
{
this
.
itemIds
=
itemIds
;
}
/**
* 获取:商品ID集合
*/
public
String
getItemIds
()
{
return
itemIds
;
}
/**
* 设置:标签ID集合
*/
public
void
setTagIds
(
String
tagIds
)
{
this
.
tagIds
=
tagIds
;
}
/**
* 获取:标签ID集合
*/
public
String
getTagIds
()
{
return
tagIds
;
}
/**
* 设置:
*/
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
/**
* 获取:
*/
public
String
getTitle
()
{
return
title
;
}
}
}
platform-admin/src/main/java/com/platform/service/HashtagService.java
浏览文件 @
c4c2e15f
package
com
.
platform
.
service
;
package
com
.
platform
.
service
;
import
com.platform.entity.HashtagEntity
;
import
com.platform.entity.HashtagEntity
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
import
java.util.List
;
...
@@ -78,4 +79,12 @@ public interface HashtagService {
...
@@ -78,4 +79,12 @@ public interface HashtagService {
*/
*/
List
<
HashtagEntity
>
getTagsByName
(
String
name
);
List
<
HashtagEntity
>
getTagsByName
(
String
name
);
/**
* 根据ID集合查找标签
*
* @param ids
* @return list
*/
List
<
HashtagEntity
>
getTagsByIds
(
String
[]
ids
);
}
}
platform-admin/src/main/java/com/platform/service/PostHashtagService.java
浏览文件 @
c4c2e15f
...
@@ -19,7 +19,7 @@ public interface PostHashtagService {
...
@@ -19,7 +19,7 @@ public interface PostHashtagService {
* @param id 主键
* @param id 主键
* @return 实体
* @return 实体
*/
*/
PostHashtagEntity
queryObject
(
Lo
ng
id
);
PostHashtagEntity
queryObject
(
Stri
ng
id
);
/**
/**
* 分页查询
* 分页查询
...
@@ -59,7 +59,7 @@ public interface PostHashtagService {
...
@@ -59,7 +59,7 @@ public interface PostHashtagService {
* @param id
* @param id
* @return 删除条数
* @return 删除条数
*/
*/
int
delete
(
Lo
ng
id
);
int
delete
(
Stri
ng
id
);
/**
/**
* 根据主键批量删除
* 根据主键批量删除
...
@@ -67,5 +67,5 @@ public interface PostHashtagService {
...
@@ -67,5 +67,5 @@ public interface PostHashtagService {
* @param ids
* @param ids
* @return 删除条数
* @return 删除条数
*/
*/
int
deleteBatch
(
Lo
ng
[]
ids
);
int
deleteBatch
(
Stri
ng
[]
ids
);
}
}
platform-admin/src/main/java/com/platform/service/PostService.java
浏览文件 @
c4c2e15f
...
@@ -4,6 +4,7 @@ import com.platform.entity.PostEntity;
...
@@ -4,6 +4,7 @@ import com.platform.entity.PostEntity;
import
com.platform.vo.PostVo
;
import
com.platform.vo.PostVo
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.io.UnsupportedEncodingException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,7 +22,7 @@ public interface PostService {
...
@@ -21,7 +22,7 @@ public interface PostService {
* @param id 主键
* @param id 主键
* @return 实体
* @return 实体
*/
*/
Post
Entity
queryObject
(
String
id
);
Post
Vo
queryObject
(
String
id
);
/**
/**
* 分页查询
* 分页查询
...
@@ -45,7 +46,7 @@ public interface PostService {
...
@@ -45,7 +46,7 @@ public interface PostService {
* @param post 实体
* @param post 实体
* @return 保存条数
* @return 保存条数
*/
*/
int
save
(
PostEntity
post
);
int
save
(
PostEntity
post
)
throws
UnsupportedEncodingException
;
/**
/**
* 根据主键更新实体
* 根据主键更新实体
...
...
platform-admin/src/main/java/com/platform/service/impl/HashtagServiceImpl.java
浏览文件 @
c4c2e15f
...
@@ -98,4 +98,9 @@ public class HashtagServiceImpl implements HashtagService {
...
@@ -98,4 +98,9 @@ public class HashtagServiceImpl implements HashtagService {
public
List
<
HashtagEntity
>
getTagsByName
(
String
name
)
{
public
List
<
HashtagEntity
>
getTagsByName
(
String
name
)
{
return
hashtagDao
.
getTagsByName
(
name
);
return
hashtagDao
.
getTagsByName
(
name
);
}
}
@Override
public
List
<
HashtagEntity
>
getTagsByIds
(
String
[]
ids
)
{
return
hashtagDao
.
getTagsByIds
(
ids
);
}
}
}
platform-admin/src/main/java/com/platform/service/impl/PostHashtagServiceImpl.java
浏览文件 @
c4c2e15f
...
@@ -22,7 +22,7 @@ public class PostHashtagServiceImpl implements PostHashtagService {
...
@@ -22,7 +22,7 @@ public class PostHashtagServiceImpl implements PostHashtagService {
private
PostHashtagDao
postHashtagDao
;
private
PostHashtagDao
postHashtagDao
;
@Override
@Override
public
PostHashtagEntity
queryObject
(
Lo
ng
id
)
{
public
PostHashtagEntity
queryObject
(
Stri
ng
id
)
{
return
postHashtagDao
.
queryObject
(
id
);
return
postHashtagDao
.
queryObject
(
id
);
}
}
...
@@ -48,12 +48,12 @@ public class PostHashtagServiceImpl implements PostHashtagService {
...
@@ -48,12 +48,12 @@ public class PostHashtagServiceImpl implements PostHashtagService {
}
}
@Override
@Override
public
int
delete
(
Lo
ng
id
)
{
public
int
delete
(
Stri
ng
id
)
{
return
postHashtagDao
.
delete
(
id
);
return
postHashtagDao
.
delete
(
id
);
}
}
@Override
@Override
public
int
deleteBatch
(
Lo
ng
[]
ids
)
{
public
int
deleteBatch
(
Stri
ng
[]
ids
)
{
return
postHashtagDao
.
deleteBatch
(
ids
);
return
postHashtagDao
.
deleteBatch
(
ids
);
}
}
}
}
platform-admin/src/main/java/com/platform/service/impl/PostServiceImpl.java
浏览文件 @
c4c2e15f
package
com
.
platform
.
service
.
impl
;
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.PostDao
;
import
com.platform.dao.*
;
import
com.platform.dao.SysUserDao
;
import
com.platform.entity.*
;
import
com.platform.dao.TbCfUserInfoDao
;
import
com.platform.entity.PostEntity
;
import
com.platform.entity.SysUserEntity
;
import
com.platform.entity.TbCfUserInfoEntity
;
import
com.platform.service.PostService
;
import
com.platform.service.PostService
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.ShiroUtils
;
import
com.platform.utils.ShiroUtils
;
...
@@ -14,6 +10,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -14,6 +10,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -40,9 +37,34 @@ public class PostServiceImpl implements PostService {
...
@@ -40,9 +37,34 @@ public class PostServiceImpl implements PostService {
@Autowired
@Autowired
private
SysUserDao
sysUserDao
;
private
SysUserDao
sysUserDao
;
@Autowired
private
TbCfStationItemDao
tbCfStationItemDao
;
@Autowired
private
HashtagDao
hashtagDao
;
@Override
@Override
public
PostEntity
queryObject
(
String
id
)
{
public
PostVo
queryObject
(
String
id
)
{
return
postDao
.
queryObject
(
id
);
//帖子主题信息
PostEntity
post
=
postDao
.
queryObject
(
id
);
PostVo
postVo
=
new
PostVo
();
BeanUtils
.
copyProperties
(
post
,
postVo
);
if
(
post
.
getItemIds
()
!=
null
&&
post
.
getItemIds
().
length
()
>
0
)
{
//帖子关联的商品
List
<
TbCfStationItemEntity
>
itemList
=
tbCfStationItemDao
.
getItemByIds
(
post
.
getItemIds
().
split
(
","
));
postVo
.
setItemList
(
itemList
);
//设置帖子商品
}
if
(
post
.
getTagIds
()
!=
null
&&
post
.
getTagIds
().
length
()
>
0
)
{
//帖子关联的标签
List
<
HashtagEntity
>
tagList
=
hashtagDao
.
getTagsByIds
(
post
.
getTagIds
().
split
(
","
));
postVo
.
setTagList
(
tagList
);
//设置帖子标签
}
return
postVo
;
}
}
@Override
@Override
...
@@ -75,26 +97,22 @@ public class PostServiceImpl implements PostService {
...
@@ -75,26 +97,22 @@ public class PostServiceImpl implements PostService {
}
}
@Override
@Override
public
int
save
(
PostEntity
post
)
{
public
int
save
(
PostEntity
post
)
throws
UnsupportedEncodingException
{
int
res
=
0
;
int
res
=
0
;
try
{
post
.
setId
(
IdUtil
.
createIdbyUUID
());
post
.
setId
(
IdUtil
.
createIdbyUUID
());
post
.
setCreateDate
(
new
Date
());
post
.
setCreateDate
(
new
Date
());
post
.
setUpdateDate
(
new
Date
());
post
.
setUpdateDate
(
new
Date
());
post
.
setVersion
(
1
);
post
.
setVersion
(
1
);
post
.
setIsTop
(
0
);
post
.
setIsTop
(
0
);
String
type
=
String
.
valueOf
(
post
.
getUserType
());
String
type
=
String
.
valueOf
(
post
.
getUserType
());
if
(
"0"
.
equals
(
type
))
{
if
(
"0"
.
equals
(
type
))
{
post
.
setUserId
(
getUserId
());
post
.
setUserId
(
getUserId
());
}
else
if
(
"1"
.
equals
(
type
))
{
}
else
if
(
"1"
.
equals
(
type
))
{
String
userId
=
tbCfUserInfoDao
.
queryById
(
post
.
getCreatedBy
());
String
userId
=
tbCfUserInfoDao
.
queryById
(
post
.
getCreatedBy
());
post
.
setUserId
(
userId
);
post
.
setUserId
(
userId
);
}
post
.
setCategory
(
URLDecoder
.
decode
(
post
.
getCategory
(),
"utf-8"
));
res
=
postDao
.
save
(
post
);
}
catch
(
Exception
e
)
{
}
}
post
.
setCategory
(
URLDecoder
.
decode
(
post
.
getCategory
(),
"utf-8"
));
res
=
postDao
.
save
(
post
);
return
res
;
return
res
;
}
}
...
@@ -131,7 +149,6 @@ public class PostServiceImpl implements PostService {
...
@@ -131,7 +149,6 @@ public class PostServiceImpl implements PostService {
*/
*/
@Override
@Override
public
int
changeStatus
(
Integer
archived
,
String
[]
ids
)
{
public
int
changeStatus
(
Integer
archived
,
String
[]
ids
)
{
System
.
err
.
println
(
"======>>>>>"
+
archived
);
//下线帖子
//下线帖子
if
(
"2"
.
equals
(
archived
.
toString
()))
{
if
(
"2"
.
equals
(
archived
.
toString
()))
{
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
...
...
platform-admin/src/main/java/com/platform/vo/PostVo.java
浏览文件 @
c4c2e15f
...
@@ -2,6 +2,8 @@ package com.platform.vo;
...
@@ -2,6 +2,8 @@ package com.platform.vo;
import
com.platform.entity.PostEntity
;
import
com.platform.entity.PostEntity
;
import
java.util.List
;
/**
/**
* @Auther: wudepeng
* @Auther: wudepeng
...
@@ -10,8 +12,14 @@ import com.platform.entity.PostEntity;
...
@@ -10,8 +12,14 @@ import com.platform.entity.PostEntity;
*/
*/
public
class
PostVo
extends
PostEntity
{
public
class
PostVo
extends
PostEntity
{
//评论数
private
Integer
count
;
private
Integer
count
;
//点赞数
private
Integer
likes
;
private
Integer
likes
;
//帖子商品
private
List
<?>
itemList
;
//帖子标签
private
List
<?>
tagList
;
public
Integer
getCount
()
{
public
Integer
getCount
()
{
return
count
;
return
count
;
...
@@ -28,4 +36,20 @@ public class PostVo extends PostEntity {
...
@@ -28,4 +36,20 @@ public class PostVo extends PostEntity {
public
void
setLikes
(
Integer
likes
)
{
public
void
setLikes
(
Integer
likes
)
{
this
.
likes
=
likes
;
this
.
likes
=
likes
;
}
}
public
List
<?>
getItemList
()
{
return
itemList
;
}
public
void
setItemList
(
List
<?>
itemList
)
{
this
.
itemList
=
itemList
;
}
public
List
<?>
getTagList
()
{
return
tagList
;
}
public
void
setTagList
(
List
<?>
tagList
)
{
this
.
tagList
=
tagList
;
}
}
}
platform-admin/src/main/resources/com/platform/dao/HashtagDao.xml
浏览文件 @
c4c2e15f
...
@@ -76,6 +76,26 @@
...
@@ -76,6 +76,26 @@
from hashtag
from hashtag
where name LIKE concat('%',#{name},'%')
where name LIKE concat('%',#{name},'%')
</select>
</select>
<select
id=
"getTagsByIds"
resultType=
"com.platform.entity.HashtagEntity"
>
select
`id`,
`archived`,
`archived_by`,
`archived_date`,
`create_date`,
`created_by`,
`update_date`,
`updated_by`,
`version`,
`name`,
`user_id`
from hashtag
where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from hashtag
select count(*) from hashtag
WHERE 1=1
WHERE 1=1
...
...
platform-admin/src/main/resources/com/platform/dao/PostDao.xml
浏览文件 @
c4c2e15f
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
<result
property=
"category"
column=
"category"
/>
<result
property=
"category"
column=
"category"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"isTop"
column=
"is_top"
/>
<result
property=
"isTop"
column=
"is_top"
/>
<result
property=
"itemIds"
column=
"item_ids"
/>
<result
property=
"tagIds"
column=
"tag_ids"
/>
<result
property=
"title"
column=
"title"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.PostEntity"
>
<select
id=
"queryObject"
resultType=
"com.platform.entity.PostEntity"
>
...
@@ -37,7 +40,10 @@
...
@@ -37,7 +40,10 @@
`caption`,
`caption`,
`category`,
`category`,
`user_id`,
`user_id`,
`is_top`
`is_top`,
`item_ids`,
`tag_ids`,
`title`
from post
from post
where id = #{id}
where id = #{id}
</select>
</select>
...
@@ -117,7 +123,10 @@
...
@@ -117,7 +123,10 @@
`caption`,
`caption`,
`category`,
`category`,
`user_id`,
`user_id`,
`is_top`)
`is_top`,
`item_ids`,
`tag_ids`,
`title`)
values(
values(
#{id},
#{id},
#{archived},
#{archived},
...
@@ -133,26 +142,32 @@
...
@@ -133,26 +142,32 @@
#{caption},
#{caption},
#{category},
#{category},
#{userId},
#{userId},
#{isTop})
#{isTop},
#{itemIds},
#{tagIds},
#{title})
</insert>
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.PostEntity"
>
<update
id=
"update"
parameterType=
"com.platform.entity.PostEntity"
>
update post
update post
<set>
<set>
<if
test=
"archived != null"
>
`archived` = #{archived},
</if>
<if
test=
"archived != null"
>
`archived` = #{archived},
</if>
<if
test=
"archivedBy != null"
>
`archived_by` = #{archivedBy},
</if>
<if
test=
"archivedBy != null"
>
`archived_by` = #{archivedBy},
</if>
<if
test=
"archivedDate != null"
>
`archived_date` = #{archivedDate},
</if>
<if
test=
"archivedDate != null"
>
`archived_date` = #{archivedDate},
</if>
<if
test=
"userType != null"
>
`user_type` = #{userType},
</if>
<if
test=
"userType != null"
>
`user_type` = #{userType},
</if>
<if
test=
"createDate != null"
>
`create_date` = #{createDate},
</if>
<if
test=
"createDate != null"
>
`create_date` = #{createDate},
</if>
<if
test=
"createdBy != null"
>
`created_by` = #{createdBy},
</if>
<if
test=
"createdBy != null"
>
`created_by` = #{createdBy},
</if>
<if
test=
"updateDate != null"
>
`update_date` = #{updateDate},
</if>
<if
test=
"updateDate != null"
>
`update_date` = #{updateDate},
</if>
<if
test=
"updatedBy != null"
>
`updated_by` = #{updatedBy},
</if>
<if
test=
"updatedBy != null"
>
`updated_by` = #{updatedBy},
</if>
<if
test=
"version != null"
>
`version` = #{version},
</if>
<if
test=
"version != null"
>
`version` = #{version},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"caption != null"
>
`caption` = #{caption},
</if>
<if
test=
"caption != null"
>
`caption` = #{caption},
</if>
<if
test=
"category != null"
>
`category` = #{category},
</if>
<if
test=
"category != null"
>
`category` = #{category},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"isTop != null"
>
`is_top` = #{isTop}
</if>
<if
test=
"isTop != null"
>
`is_top` = #{isTop},
</if>
<if
test=
"itemIds != null"
>
`item_ids` = #{itemIds},
</if>
<if
test=
"tagIds != null"
>
`tag_ids` = #{tagIds},
</if>
<if
test=
"title != null"
>
`title` = #{title}
</if>
</set>
</set>
where id = #{id}
where id = #{id}
</update>
</update>
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
c4c2e15f
...
@@ -331,4 +331,11 @@
...
@@ -331,4 +331,11 @@
#{itemId}
#{itemId}
</foreach>
</foreach>
</update>
</update>
<select
id=
"getItemByIds"
resultType=
"com.platform.entity.TbCfStationItemEntity"
>
select i.item_Id,i.item_img from tb_cf_station_item i where i.item_id in
<foreach
item=
"itemId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
</select>
</mapper>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/js/sys/post.js
浏览文件 @
c4c2e15f
...
@@ -99,23 +99,23 @@ let vm = new Vue({
...
@@ -99,23 +99,23 @@ let vm = new Vue({
],
],
commoditycategoryListsActive3
:
null
,
commoditycategoryListsActive3
:
null
,
postProductArr
:[],
postProductArr
:
[],
},
},
methods
:
{
methods
:
{
deleteProduct
(
index
){
deleteProduct
(
index
)
{
this
.
$delete
(
this
.
postProductArr
,
index
);
this
.
$delete
(
this
.
postProductArr
,
index
);
},
},
selectProduct
(){
selectProduct
()
{
if
(
this
.
postProductArr
.
length
<
9
)
{
if
(
this
.
postProductArr
.
length
<
9
)
{
let
reg
=
/
\"(
.*
?)\"
/g
;
let
reg
=
/
\"(
.*
?)\"
/g
;
let
id
=
getSelectedRow
(
"#searchjqGrid"
);
let
id
=
getSelectedRow
(
"#searchjqGrid"
);
let
rowData
=
jQuery
(
"#searchjqGrid"
).
jqGrid
(
"getRowData"
,
id
);
let
rowData
=
jQuery
(
"#searchjqGrid"
).
jqGrid
(
"getRowData"
,
id
);
this
.
postProductArr
.
push
({
this
.
postProductArr
.
push
({
itemImg
:
reg
.
exec
(
rowData
.
itemImg
)[
1
],
itemImg
:
reg
.
exec
(
rowData
.
itemImg
)[
1
],
itemId
:
rowData
.
itemId
itemId
:
rowData
.
itemId
})
})
this
.
isShownProductMadal
=
false
;
this
.
isShownProductMadal
=
false
;
}
else
{
}
else
{
alert
(
'超出限制'
);
alert
(
'超出限制'
);
}
}
},
},
...
@@ -167,7 +167,13 @@ let vm = new Vue({
...
@@ -167,7 +167,13 @@ let vm = new Vue({
{
label
:
'商品一级分类'
,
name
:
'goodtype'
,
index
:
'goodtype'
,
width
:
80
},
{
label
:
'商品一级分类'
,
name
:
'goodtype'
,
index
:
'goodtype'
,
width
:
80
},
{
label
:
'商品二级分类'
,
name
:
'title'
,
index
:
'title'
,
width
:
80
},
{
label
:
'商品二级分类'
,
name
:
'title'
,
index
:
'title'
,
width
:
80
},
{
label
:
'商品品名'
,
name
:
'dname'
,
index
:
'itemDescritionId'
,
width
:
120
},
{
label
:
'商品品名'
,
name
:
'dname'
,
index
:
'itemDescritionId'
,
width
:
120
},
{
label
:
'状态'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
120
,
formatter
:
itemStatusFormat
},
{
label
:
'状态'
,
name
:
'enableFlag'
,
index
:
'enable_flag'
,
width
:
120
,
formatter
:
itemStatusFormat
},
{
label
:
'创建日期'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
160
}
{
label
:
'创建日期'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
160
}
],
],
multiselect
:
true
,
multiselect
:
true
,
...
@@ -322,6 +328,9 @@ let vm = new Vue({
...
@@ -322,6 +328,9 @@ let vm = new Vue({
vm
.
reload
();
vm
.
reload
();
},
},
add
:
function
()
{
add
:
function
()
{
vm
.
uploadList
=
[];
vm
.
tagList
=
[];
vm
.
postProductArr
=
[];
vm
.
account
=
true
;
vm
.
account
=
true
;
vm
.
isShow
=
false
;
vm
.
isShow
=
false
;
vm
.
disabled
=
false
;
vm
.
disabled
=
false
;
...
@@ -341,8 +350,18 @@ let vm = new Vue({
...
@@ -341,8 +350,18 @@ let vm = new Vue({
vm
.
getInfo
(
id
);
vm
.
getInfo
(
id
);
},
},
saveOrUpdate
:
function
(
event
)
{
saveOrUpdate
:
function
(
event
)
{
//帖子关联的商品
vm
.
post
.
itemIds
=
vm
.
postProductArr
.
map
(
res
=>
res
.
itemId
).
join
(
','
)
console
.
log
(
'itemIds'
,
vm
.
post
.
itemIds
)
//帖子关联的标签
let
tagIds
=
''
;
vm
.
tagList
.
map
(
res
=>
{
if
(
res
.
isSelected
)
tagIds
+=
res
.
value
+
","
})
vm
.
post
.
tagIds
=
tagIds
.
substr
(
0
,
tagIds
.
length
-
1
).
trim
()
let
flag
=
vm
.
flag
;
let
flag
=
vm
.
flag
;
console
.
log
(
121323
,
vm
.
post
.
userType
)
console
.
log
(
'tagIds'
,
vm
.
post
.
tagIds
)
if
(
vm
.
post
.
userType
===
1
&&
vm
.
post
.
id
==
null
)
{
if
(
vm
.
post
.
userType
===
1
&&
vm
.
post
.
id
==
null
)
{
flag
=
this
.
queryAccount
();
flag
=
this
.
queryAccount
();
}
}
...
@@ -393,6 +412,8 @@ let vm = new Vue({
...
@@ -393,6 +412,8 @@ let vm = new Vue({
}
}
,
,
getInfo
:
function
(
id
)
{
getInfo
:
function
(
id
)
{
vm
.
tagList
=
[];
vm
.
postProductArr
=
[];
console
.
log
(
id
);
console
.
log
(
id
);
Ajax
.
request
({
Ajax
.
request
({
url
:
"../post/info/"
+
id
,
url
:
"../post/info/"
+
id
,
...
@@ -402,6 +423,19 @@ let vm = new Vue({
...
@@ -402,6 +423,19 @@ let vm = new Vue({
vm
.
post
=
r
.
post
;
vm
.
post
=
r
.
post
;
vm
.
isShow
=
false
;
vm
.
isShow
=
false
;
vm
.
uploadList
=
[];
vm
.
uploadList
=
[];
if
(
vm
.
post
.
itemList
!=
null
&&
vm
.
post
.
itemList
.
length
>
0
)
{
vm
.
postProductArr
=
vm
.
post
.
itemList
;
}
if
(
vm
.
post
.
tagList
!=
null
&&
vm
.
post
.
tagList
.
length
>
0
)
{
vm
.
post
.
tagList
.
forEach
(
res
=>
{
vm
.
tagList
.
push
({
value
:
res
.
id
,
label
:
res
.
name
,
isSelected
:
true
})
})
}
console
.
log
(
'tagList'
,
vm
.
tagList
)
let
status
=
vm
.
post
.
archived
;
let
status
=
vm
.
post
.
archived
;
//正常
//正常
if
(
status
===
1
)
{
if
(
status
===
1
)
{
...
@@ -420,6 +454,7 @@ let vm = new Vue({
...
@@ -420,6 +454,7 @@ let vm = new Vue({
}
else
{
}
else
{
UE
.
getEditor
(
'content'
).
setContent
(
''
);
UE
.
getEditor
(
'content'
).
setContent
(
''
);
}
}
}
}
});
});
}
}
...
@@ -481,7 +516,7 @@ let vm = new Vue({
...
@@ -481,7 +516,7 @@ let vm = new Vue({
this
.
tagList
.
push
({
this
.
tagList
.
push
({
label
:
item
.
name
,
label
:
item
.
name
,
value
:
item
.
id
,
value
:
item
.
id
,
isSelected
:
false
,
isSelected
:
false
,
});
});
})
})
})
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论