Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
ca73dcfd
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ca73dcfd
编写于
9月 18, 2020
作者:
水
水库浪子
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
标签接口重构
上级
9ace5515
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
68 addition
and
40 deletion
+68
-40
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTagGroupController.java
...linkwechat/web/controller/wecom/WeTagGroupController.java
+4
-27
linkwe-common/src/main/java/com/linkwechat/common/core/domain/BaseEntity.java
...in/java/com/linkwechat/common/core/domain/BaseEntity.java
+1
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagMapper.java
...rc/main/java/com/linkwechat/wecom/mapper/WeTagMapper.java
+9
-2
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
.../linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
+10
-1
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
...ecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
+21
-7
linkwe-wecom/src/main/resources/mapper/wecom/WeTagMapper.xml
linkwe-wecom/src/main/resources/mapper/wecom/WeTagMapper.xml
+23
-2
未找到文件。
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeTagGroupController.java
浏览文件 @
ca73dcfd
package
com.linkwechat.web.controller.wecom
;
package
com.linkwechat.web.controller.wecom
;
import
java.util.List
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.annotation.Log
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.controller.BaseController
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.domain.AjaxResult
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.core.page.TableDataInfo
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.enums.BusinessType
;
import
com.linkwechat.common.utils.poi.ExcelUtil
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -39,36 +37,15 @@ public class WeTagGroupController extends BaseController
...
@@ -39,36 +37,15 @@ public class WeTagGroupController extends BaseController
*/
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:group:list')"
)
@PreAuthorize
(
"@ss.hasPermi('wecom:group:list')"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
AjaxResult
list
(
)
public
TableDataInfo
list
(
WeTagGroup
weTagGroup
)
{
{
startPage
();
return
AjaxResult
.
success
(
return
getDataTable
(
weTagGroupService
.
selectWeTagGroupList
(
new
WeTagGroup
()
)
weTagGroupService
.
selectWeTagGroupList
(
weTagGroup
)
);
);
}
}
/**
* 导出标签组列表
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:group:export')"
)
@Log
(
title
=
"标签组"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
WeTagGroup
weTagGroup
)
{
List
<
WeTagGroup
>
list
=
weTagGroupService
.
selectWeTagGroupList
(
weTagGroup
);
ExcelUtil
<
WeTagGroup
>
util
=
new
ExcelUtil
<
WeTagGroup
>(
WeTagGroup
.
class
);
return
util
.
exportExcel
(
list
,
"group"
);
}
/**
* 获取标签组详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('wecom:group:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
return
AjaxResult
.
success
(
weTagGroupService
.
selectWeTagGroupById
(
id
));
}
/**
/**
* 新增标签组
* 新增标签组
...
...
linkwe-common/src/main/java/com/linkwechat/common/core/domain/BaseEntity.java
浏览文件 @
ca73dcfd
...
@@ -26,7 +26,7 @@ public class BaseEntity implements Serializable
...
@@ -26,7 +26,7 @@ public class BaseEntity implements Serializable
/** 创建时间 */
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
private
Date
createTime
=
new
Date
()
;
/** 更新者 */
/** 更新者 */
private
String
updateBy
;
private
String
updateBy
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeTagMapper.java
浏览文件 @
ca73dcfd
...
@@ -2,7 +2,6 @@ package com.linkwechat.wecom.mapper;
...
@@ -2,7 +2,6 @@ package com.linkwechat.wecom.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.linkwechat.wecom.domain.WeTag
;
import
com.linkwechat.wecom.domain.WeTag
;
import
org.apache.ibatis.annotations.Param
;
/**
/**
* 企业微信标签Mapper接口
* 企业微信标签Mapper接口
...
@@ -66,5 +65,13 @@ public interface WeTagMapper
...
@@ -66,5 +65,13 @@ public interface WeTagMapper
* @param weTags
* @param weTags
* @return
* @return
*/
*/
public
int
batchInsetWeTag
(
@Param
(
"weTags"
)
List
<
WeTag
>
weTags
);
public
int
batchInsetWeTag
(
List
<
WeTag
>
weTags
);
/**
* 标签批量更新
* @param weTags
* @return
*/
public
int
batchUpdateWeTag
(
List
<
WeTag
>
weTags
);
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeTagGroupServiceImpl.java
浏览文件 @
ca73dcfd
...
@@ -83,9 +83,18 @@ public class WeTagGroupServiceImpl implements IWeTagGroupService
...
@@ -83,9 +83,18 @@ public class WeTagGroupServiceImpl implements IWeTagGroupService
* @return 结果
* @return 结果
*/
*/
@Override
@Override
@Transactional
public
int
updateWeTagGroup
(
WeTagGroup
weTagGroup
)
public
int
updateWeTagGroup
(
WeTagGroup
weTagGroup
)
{
{
return
weTagGroupMapper
.
updateWeTagGroup
(
weTagGroup
);
int
returnCode
=
weTagGroupMapper
.
updateWeTagGroup
(
weTagGroup
);
if
(
returnCode
>
0
){
List
<
WeTag
>
weTags
=
weTagGroup
.
getWeTags
();
if
(
CollectionUtil
.
isNotEmpty
(
weTags
)){
weTagMapper
.
batchUpdateWeTag
(
weTags
);
}
}
return
returnCode
;
}
}
/**
/**
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeTagGroupMapper.xml
浏览文件 @
ca73dcfd
...
@@ -8,6 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -8,6 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"gourpName"
column=
"gourp_name"
/>
<result
property=
"gourpName"
column=
"gourp_name"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<collection
property=
"weTags"
column=
"weTags.id"
ofType=
"com.linkwechat.wecom.domain.WeTag"
>
<id
property=
"id"
column=
"tagId"
/>
<result
property=
"groupId"
column=
"group_id"
/>
<result
property=
"name"
column=
"name"
/>
</collection>
</resultMap>
</resultMap>
<sql
id=
"selectWeTagGroupVo"
>
<sql
id=
"selectWeTagGroupVo"
>
...
@@ -15,10 +20,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -15,10 +20,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
</sql>
<select
id=
"selectWeTagGroupList"
parameterType=
"WeTagGroup"
resultMap=
"WeTagGroupResult"
>
<select
id=
"selectWeTagGroupList"
parameterType=
"WeTagGroup"
resultMap=
"WeTagGroupResult"
>
<include
refid=
"selectWeTagGroupVo"
/>
SELECT
<where>
wtg.*,
wt.id as tagId,
wt.group_id,
wt.name
FROM
we_tag_group wtg
INNER JOIN we_tag wt ON wtg.id = wt.group_id
where
wtg.status=0 and wt.status=0
<if
test=
"gourpName != null and gourpName != ''"
>
and gourp_name like concat('%', #{gourpName}, '%')
</if>
<if
test=
"gourpName != null and gourpName != ''"
>
and gourp_name like concat('%', #{gourpName}, '%')
</if>
</where>
</select>
</select>
<select
id=
"selectWeTagGroupById"
parameterType=
"Long"
resultMap=
"WeTagGroupResult"
>
<select
id=
"selectWeTagGroupById"
parameterType=
"Long"
resultMap=
"WeTagGroupResult"
>
...
@@ -53,11 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -53,11 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from we_tag_group where id = #{id}
delete from we_tag_group where id = #{id}
</delete>
</delete>
<delete
id=
"deleteWeTagGroupByIds"
parameterType=
"String"
>
<update
id=
"deleteWeTagGroupByIds"
parameterType=
"String"
>
delete from we_tag_group where id in
update we_tag_group set status=1
where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
</delete>
</update>
</mapper>
</mapper>
\ No newline at end of file
linkwe-wecom/src/main/resources/mapper/wecom/WeTagMapper.xml
浏览文件 @
ca73dcfd
...
@@ -67,11 +67,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -67,11 +67,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert
id=
"batchInsetWeTag"
>
<insert
id=
"batchInsetWeTag"
>
insert into
person
(id, group_id, name, create_time)
insert into
we_tag
(id, group_id, name, create_time)
values
values
<foreach
collection=
"
tags
"
item=
"tag"
index=
"index"
separator=
","
>
<foreach
collection=
"
list
"
item=
"tag"
index=
"index"
separator=
","
>
(#{tag.id},#{tag.groupId},#{tag.name},#{tag.createTime})
(#{tag.id},#{tag.groupId},#{tag.name},#{tag.createTime})
</foreach>
</foreach>
</insert>
</insert>
<update
id=
"batchUpdateWeTag"
>
update we_tag set
name=
<foreach
collection=
"list"
item=
"tag"
index=
"index"
separator=
" "
open=
"case id"
close=
"end"
>
when #{tag.id} then #{tag.name}
</foreach>
,status=
<foreach
collection=
"list"
item=
"tag"
index=
"index"
separator=
" "
open=
"case id"
close=
"end"
>
when #{tag.id} then #{tag.status}
</foreach>
where id in
<foreach
collection=
"list"
item=
"tag"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{tag.id}
</foreach>
</update>
</mapper>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录