Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
23db3e75
Commit
23db3e75
authored
Dec 30, 2022
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签管理初版提交
parent
028f8f2c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
380 additions
and
10 deletions
+380
-10
CustomerBusinessContoller.java
...1/yifu/archives/controller/CustomerBusinessContoller.java
+0
-3
TBusDeptController.java
...lus/v1/business/controller/system/TBusDeptController.java
+6
-7
TBusLableController.java
...us/v1/business/controller/system/TBusLableController.java
+165
-0
TBusLableMapper.java
...cloud/plus/v1/business/mapper/system/TBusLableMapper.java
+32
-0
TBusLableService.java
...oud/plus/v1/business/service/system/TBusLableService.java
+45
-0
TBusLableServiceImpl.java
...v1/business/service/system/impl/TBusLableServiceImpl.java
+43
-0
TBusLableMapper.xml
...usiness-biz/src/main/resources/mapper/TBusLableMapper.xml
+89
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/CustomerBusinessContoller.java
View file @
23db3e75
...
...
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser
;
import
com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteUserService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain
;
...
...
@@ -57,8 +56,6 @@ public class CustomerBusinessContoller {
private
final
MSetttleCustomerUserService
mSetttleCustomerUserService
;
private
final
RemoteUserService
remoteUserService
;
private
static
final
String
CREATE_TIME_COLNUM
=
"CREATE_TIME"
;
//客户创建时间
private
final
RedisUtil
redisUtil
;
...
...
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/controller/system/TBusDeptController.java
View file @
23db3e75
...
...
@@ -17,7 +17,6 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
...
...
@@ -170,7 +169,7 @@ public class TBusDeptController {
*/
@Operation
(
summary
=
"新增(yifu-mvp-business:tbusdept_add)"
,
description
=
"新增(yifu-mvp-business:tbusdept_add)"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('yifu-hro
-business:tbusdept_add')"
)
// @PreAuthorize("@pms.hasPermission('yifu-mvp
-business:tbusdept_add')")
public
R
<
Boolean
>
save
(
@RequestBody
TBusDept
tBusDept
)
{
String
error
;
if
(
Common
.
isNotNull
(
tBusDept
.
getName
()))
{
...
...
@@ -212,10 +211,10 @@ public class TBusDeptController {
* @param tBusDept
* @return R
*/
@Operation
(
summary
=
"修改(yifu-
hro-business:tbusdept_edit)"
,
description
=
"修改(yifu-hro
-business:tbusdept_edit)"
)
@Operation
(
summary
=
"修改(yifu-
mvp-business:tbusdept_edit)"
,
description
=
"修改(yifu-mvp
-business:tbusdept_edit)"
)
@SysLog
(
"修改B端部门表"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('yifu-hro
-business:tbusdept_edit')"
)
// @PreAuthorize("@pms.hasPermission('yifu-mvp
-business:tbusdept_edit')")
public
R
<
Boolean
>
update
(
@RequestBody
TBusDept
tBusDept
)
{
if
(
Common
.
isNotNull
(
tBusDept
.
getName
())
&&
Common
.
isNotNull
(
tBusDept
.
getId
()))
{
boolean
flag
=
this
.
getDeptByName
(
tBusDept
.
getId
(),
tBusDept
.
getName
());
...
...
@@ -259,10 +258,10 @@ public class TBusDeptController {
* @param id
* @return R
*/
@Operation
(
summary
=
"假删除(yifu-
hro-business:tbusdept_del)"
,
description
=
"假删除(yifu-hro
-business:tbusdept_del)"
)
@Operation
(
summary
=
"假删除(yifu-
mvp-business:tbusdept_del)"
,
description
=
"假删除(yifu-mvp
-business:tbusdept_del)"
)
@SysLog
(
"假删除B端部门表"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('yifu-hro
-business:tbusdept_del')"
)
// @PreAuthorize("@pms.hasPermission('yifu-mvp
-business:tbusdept_del')")
public
R
<
Boolean
>
removeById
(
@PathVariable
Integer
id
)
{
TBusDept
tBusDept
=
new
TBusDept
();
tBusDept
.
setPid
(
id
);
...
...
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/controller/system/TBusLableController.java
0 → 100644
View file @
23db3e75
package
com
.
yifu
.
cloud
.
plus
.
v1
.
business
.
controller
.
system
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.business.entity.system.TBusLable
;
import
com.yifu.cloud.plus.v1.business.service.system.TBusLableService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.*
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* B端标签表
*
* @author hgw
* @date 2021-08-11 17:00:52
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"/tbuslable"
)
@Tag
(
name
=
"B端标签表"
)
public
class
TBusLableController
{
private
final
TBusLableService
tBusLableService
;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tBusLable B端标签表
* @return
*/
@Operation
(
summary
=
"简单分页查询"
,
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
TBusLable
>>
getTBusLablePage
(
Page
<
TBusLable
>
page
,
TBusLable
tBusLable
)
{
return
new
R
<>(
tBusLableService
.
getTBusLablePage
(
page
,
tBusLable
));
}
/**
* 获取list
*
* @param tBusLable B端标签表
* @return
*/
@Operation
(
description
=
"获取list,status:是否启用,0启用,1禁用"
)
@GetMapping
(
"/getTBusLableList"
)
public
R
<
List
<
TBusLable
>>
getTBusLableList
(
TBusLable
tBusLable
)
{
return
new
R
<>(
tBusLableService
.
getTBusLableList
(
tBusLable
));
}
/**
* 通过id查询单条记录
*
* @param id
* @return R
*/
@Operation
(
summary
=
"id查询"
,
description
=
"id查询"
)
@GetMapping
(
"/{id}"
)
public
R
<
TBusLable
>
getById
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
new
R
<>(
tBusLableService
.
getById
(
id
));
}
/**
* 通过idStr查询单条记录
*
* @param idStr
* @return R
*/
@Operation
(
summary
=
"idStr查询"
,
description
=
"idStr查询"
)
@PostMapping
(
"/getByIdStr"
)
public
R
<
List
<
TBusLable
>>
getByIdStr
(
@RequestParam
String
idStr
)
{
List
<
String
>
list
=
Common
.
getList
(
idStr
);
return
new
R
<>(
tBusLableService
.
list
(
Wrappers
.<
TBusLable
>
query
().
lambda
().
in
(
TBusLable:
:
getId
,
list
)));
}
/**
* 新增记录
*
* @param tBusLable
* @return R
*/
@Operation
(
summary
=
"新增(yifu-mvp-business:tbuslable_add)"
,
description
=
"新增(yifu-mvp-business:tbuslable_add)"
)
@PostMapping
// @PreAuthorize("@pms.hasPermission('yifu-mvp-business:tbuslable_add')")
public
R
<
Boolean
>
save
(
@RequestBody
TBusLable
tBusLable
)
{
if
(
Common
.
isNotNull
(
tBusLable
.
getName
()))
{
boolean
flag
=
this
.
getLableByName
(
null
,
tBusLable
.
getName
());
if
(
flag
)
{
return
R
.
failed
(
"标签名称不可重复"
);
}
}
else
{
return
R
.
failed
(
"标签名称不可为空"
);
}
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
!=
null
&&
user
.
getId
()
!=
null
)
{
tBusLable
.
setCreateTime
(
LocalDateTime
.
now
());
tBusLable
.
setCreateUserId
(
String
.
valueOf
(
user
.
getId
()));
tBusLable
.
setCreateUserName
(
user
.
getNickname
());
return
new
R
<>(
tBusLableService
.
save
(
tBusLable
));
}
else
{
return
R
.
failed
(
"未获取到登录人信息"
);
}
}
/**
* 检查名称是否重复,false:不重复,可以使用的名称
*
* @param name 名称
* @return
*/
private
boolean
getLableByName
(
Integer
id
,
String
name
)
{
List
<
TBusLable
>
list
=
tBusLableService
.
getLableByName
(
id
,
name
);
return
(
list
!=
null
&&
!
list
.
isEmpty
());
}
/**
* 修改记录
*
* @param tBusLable
* @return R
*/
@Operation
(
summary
=
"修改(yifu-mvp-business:tbuslable_edit)"
,
description
=
"修改(yifu-mvp-business:tbuslable_edit)"
)
@SysLog
(
"修改B端标签表"
)
@PutMapping
// @PreAuthorize("@pms.hasPermission('yifu-mvp-business:tbuslable_edit')")
public
R
<
Boolean
>
update
(
@RequestBody
TBusLable
tBusLable
)
{
if
(
Common
.
isNotNull
(
tBusLable
.
getId
())
&&
Common
.
isNotNull
(
tBusLable
.
getName
()))
{
boolean
flag
=
this
.
getLableByName
(
tBusLable
.
getId
(),
tBusLable
.
getName
());
if
(
flag
)
{
return
R
.
failed
(
"标签名称不可重复"
);
}
}
else
{
return
R
.
failed
(
"标签id、名称不可为空"
);
}
return
new
R
<>(
tBusLableService
.
updateById
(
tBusLable
));
}
/**
* 通过id删除一条记录
*
* @param id
* @return R
*/
@Operation
(
summary
=
"假删除(yifu-mvp-business:tbuslable_del)"
,
description
=
"假删除(yifu-mvp-business:tbuslable_del)"
)
@SysLog
(
"假删除B端标签表"
)
@DeleteMapping
(
"/{id}"
)
// @PreAuthorize("@pms.hasPermission('yifu-mvp-business:tbuslable_del')")
public
R
<
Boolean
>
removeById
(
@PathVariable
Integer
id
)
{
TBusLable
tBusLable
=
new
TBusLable
();
tBusLable
.
setId
(
id
);
tBusLable
.
setDeleteFlag
(
1
);
return
new
R
<>(
tBusLableService
.
updateById
(
tBusLable
));
}
}
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/mapper/system/TBusLableMapper.java
0 → 100644
View file @
23db3e75
package
com
.
yifu
.
cloud
.
plus
.
v1
.
business
.
mapper
.
system
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.business.entity.system.TBusLable
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* B端标签表
*
* @author hgw
* @date 2021-08-11 17:00:52
*/
@Mapper
public
interface
TBusLableMapper
extends
BaseMapper
<
TBusLable
>
{
/**
* B端标签表简单分页查询
*
* @param tBusLable B端标签表
* @return
*/
IPage
<
TBusLable
>
getTBusLablePage
(
Page
<
TBusLable
>
page
,
@Param
(
"tBusLable"
)
TBusLable
tBusLable
);
List
<
TBusLable
>
getTBusLableList
(
@Param
(
"tBusLable"
)
TBusLable
tBusLable
);
List
<
TBusLable
>
getLableByName
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"name"
)
String
name
);
}
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/service/system/TBusLableService.java
0 → 100644
View file @
23db3e75
package
com
.
yifu
.
cloud
.
plus
.
v1
.
business
.
service
.
system
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.business.entity.system.TBusLable
;
import
java.util.List
;
/**
* B端标签表
*
* @author hgw
* @date 2021-08-11 17:00:52
*/
public
interface
TBusLableService
extends
IService
<
TBusLable
>
{
/**
* B端标签表简单分页查询
*
* @param tBusLable B端标签表
* @return
*/
IPage
<
TBusLable
>
getTBusLablePage
(
Page
<
TBusLable
>
page
,
TBusLable
tBusLable
);
/**
* @param tBusLable
* @Description: 获取list
* @Author: hgw
* @Date: 2021/8/11 17:31
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusLable>
**/
List
<
TBusLable
>
getTBusLableList
(
TBusLable
tBusLable
);
/**
* @param id
* @param name
* @Description: 获取标签list,判重
* @Author: hgw
* @Date: 2021/8/11 16:06
* @return: java.util.List<com.yifu.cloud.v1.hrobusiness.api.entity.system.TBusDept>
**/
List
<
TBusLable
>
getLableByName
(
Integer
id
,
String
name
);
}
yifu-business/yifu-business-biz/src/main/java/com/yifu/cloud/plus/v1/business/service/system/impl/TBusLableServiceImpl.java
0 → 100644
View file @
23db3e75
package
com
.
yifu
.
cloud
.
plus
.
v1
.
business
.
service
.
system
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.business.entity.system.TBusLable
;
import
com.yifu.cloud.plus.v1.business.mapper.system.TBusLableMapper
;
import
com.yifu.cloud.plus.v1.business.service.system.TBusLableService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* B端标签表
*
* @author hgw
* @date 2021-08-11 17:00:52
*/
@Service
(
"tBusLableService"
)
public
class
TBusLableServiceImpl
extends
ServiceImpl
<
TBusLableMapper
,
TBusLable
>
implements
TBusLableService
{
/**
* B端标签表简单分页查询
*
* @param tBusLable B端标签表
* @return
*/
@Override
public
IPage
<
TBusLable
>
getTBusLablePage
(
Page
<
TBusLable
>
page
,
TBusLable
tBusLable
)
{
return
baseMapper
.
getTBusLablePage
(
page
,
tBusLable
);
}
@Override
public
List
<
TBusLable
>
getTBusLableList
(
TBusLable
tBusLable
)
{
return
baseMapper
.
getTBusLableList
(
tBusLable
);
}
@Override
public
List
<
TBusLable
>
getLableByName
(
Integer
id
,
String
name
)
{
return
baseMapper
.
getLableByName
(
id
,
name
);
}
}
yifu-business/yifu-business-biz/src/main/resources/mapper/TBusLableMapper.xml
0 → 100644
View file @
23db3e75
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yifu.cloud.plus.v1.business.mapper.system.TBusLableMapper"
>
<resultMap
id=
"tBusLableMap"
type=
"com.yifu.cloud.plus.v1.business.entity.system.TBusLable"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createUserId"
column=
"create_user_id"
/>
<result
property=
"createUserName"
column=
"create_user_name"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
a.id,
a.name,
a.remark,
a.status,
a.create_user_id,
a.create_user_name,
a.create_time,
a.delete_flag
</sql>
<sql
id=
"tBusLable_where"
>
<if
test=
"tBusLable != null"
>
<if
test=
"tBusLable.id != null"
>
AND a.id = #{tBusLable.id}
</if>
<if
test=
"tBusLable.name != null and tBusLable.name.trim() != ''"
>
AND a.name like concat('%', #{tBusLable.name},'%')
</if>
<if
test=
"tBusLable.remark != null and tBusLable.remark.trim() != ''"
>
AND a.remark = #{tBusLable.remark}
</if>
<if
test=
"tBusLable.status != null"
>
AND a.status = #{tBusLable.status}
</if>
<if
test=
"tBusLable.createUserId != null and tBusLable.createUserId.trim() != ''"
>
AND a.create_user_id = #{tBusLable.createUserId}
</if>
<if
test=
"tBusLable.createUserName != null and tBusLable.createUserName.trim() != ''"
>
AND a.create_user_name = #{tBusLable.createUserName}
</if>
<if
test=
"tBusLable.createTime != null"
>
AND a.create_time = #{tBusLable.createTime}
</if>
<if
test=
"tBusLable.deleteFlag != null"
>
AND a.delete_flag = #{tBusLable.deleteFlag}
</if>
</if>
</sql>
<!--tBusLable简单分页查询-->
<select
id=
"getTBusLablePage"
resultMap=
"tBusLableMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_bus_lable a
<where>
a.delete_flag = 0
<include
refid=
"tBusLable_where"
/>
</where>
ORDER BY a.create_time desc
</select>
<!--list-->
<select
id=
"getTBusLableList"
resultMap=
"tBusLableMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_bus_lable a
<where>
a.delete_flag = 0
<include
refid=
"tBusLable_where"
/>
</where>
ORDER BY a.create_time desc
</select>
<!--判重-->
<select
id=
"getLableByName"
resultMap=
"tBusLableMap"
>
SELECT
a.id
FROM t_bus_lable a
where
a.delete_flag = 0
<if
test=
"id != null"
>
and a.id != #{id}
</if>
AND a.name = #{name}
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment