封版
This commit is contained in:
@@ -63,7 +63,6 @@ public class UserController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:auth:user')")
|
@PreAuthorize("hasAuthority('sys:auth:user')")
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("查询全部用户")
|
@ApiOperation("查询全部用户")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<User>> list(UserParam param) {
|
public ApiResult<List<User>> list(UserParam param) {
|
||||||
@@ -71,7 +70,6 @@ public class UserController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:auth:user')")
|
@PreAuthorize("hasAuthority('sys:auth:user')")
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("根据id查询用户")
|
@ApiOperation("根据id查询用户")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<User> get(@PathVariable("id") Integer id) {
|
public ApiResult<User> get(@PathVariable("id") Integer id) {
|
||||||
@@ -79,7 +77,6 @@ public class UserController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:auth:user')")
|
@PreAuthorize("hasAuthority('sys:auth:user')")
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("根据手机号码查询用户")
|
@ApiOperation("根据手机号码查询用户")
|
||||||
@GetMapping("/getByPhone/{phone}")
|
@GetMapping("/getByPhone/{phone}")
|
||||||
public ApiResult<User> getByPhone(@PathVariable("phone") String phone) {
|
public ApiResult<User> getByPhone(@PathVariable("phone") String phone) {
|
||||||
@@ -87,7 +84,6 @@ public class UserController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:user:save')")
|
@PreAuthorize("hasAuthority('sys:user:save')")
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("添加用户")
|
@ApiOperation("添加用户")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> add(@RequestBody User user) {
|
public ApiResult<?> add(@RequestBody User user) {
|
||||||
@@ -251,7 +247,6 @@ public class UserController extends BaseController {
|
|||||||
* excel导入用户
|
* excel导入用户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("hasAuthority('sys:user:save')")
|
@PreAuthorize("hasAuthority('sys:user:save')")
|
||||||
@OperationLog
|
|
||||||
@ApiOperation("导入用户")
|
@ApiOperation("导入用户")
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class User implements UserDetails {
|
|||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
@ApiModelProperty("用户类型, 0普通用户 6开发者 10企业用户")
|
@ApiModelProperty("用户类型, 0普通用户")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("用户编码")
|
@ApiModelProperty("用户编码")
|
||||||
|
|||||||
@@ -26,10 +26,7 @@
|
|||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*,
|
SELECT a.*,
|
||||||
b.organization_name,
|
b.organization_name,
|
||||||
c.dict_data_name sex_name,
|
c.dict_data_name sex_name
|
||||||
e.tenant_name,
|
|
||||||
g.grade_id,g.name as gradeName,
|
|
||||||
h.dealer_id
|
|
||||||
FROM sys_user a
|
FROM sys_user a
|
||||||
LEFT JOIN sys_organization b ON a.organization_id = b.organization_id
|
LEFT JOIN sys_organization b ON a.organization_id = b.organization_id
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
@@ -38,9 +35,6 @@
|
|||||||
LEFT JOIN(
|
LEFT JOIN(
|
||||||
<include refid="selectUserRoleSql"/>
|
<include refid="selectUserRoleSql"/>
|
||||||
) d ON a.user_id = d.user_id
|
) d ON a.user_id = d.user_id
|
||||||
LEFT JOIN sys_tenant e ON a.tenant_id = e.tenant_id
|
|
||||||
LEFT JOIN sys_user_grade g ON a.grade_id = g.grade_id
|
|
||||||
LEFT JOIN sys_user_referee h ON a.user_id = h.user_id and h.deleted = 0
|
|
||||||
<where>
|
<where>
|
||||||
<if test="param.userId != null">
|
<if test="param.userId != null">
|
||||||
AND a.user_id = #{param.userId}
|
AND a.user_id = #{param.userId}
|
||||||
@@ -126,9 +120,6 @@
|
|||||||
<if test="param.city != null">
|
<if test="param.city != null">
|
||||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.cityMate != null">
|
|
||||||
AND i.city_mate LIKE CONCAT('%', #{param.cityMate}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.region != null">
|
<if test="param.region != null">
|
||||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -138,22 +129,15 @@
|
|||||||
<if test="param.sexName != null">
|
<if test="param.sexName != null">
|
||||||
AND c.dict_data_name = #{param.sexName}
|
AND c.dict_data_name = #{param.sexName}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.gradeId != null">
|
|
||||||
AND g.grade_id = #{param.gradeId}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
<if test="param.keywords != null">
|
||||||
AND (
|
AND (
|
||||||
a.username LIKE CONCAT('%', #{param.keywords}, '%')
|
a.username = #{param.keywords}
|
||||||
OR a.user_id = #{param.keywords}
|
OR a.user_id = #{param.keywords}
|
||||||
OR a.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.alias LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.phone = #{param.keywords}
|
||||||
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.email = #{param.keywords}
|
||||||
OR a.email LIKE CONCAT('%', #{param.keywords}, '%')
|
)
|
||||||
OR b.organization_name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR c.dict_data_name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR d.role_name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
</if>
|
||||||
<if test="param.parentId != null">
|
<if test="param.parentId != null">
|
||||||
AND a.organization_id IN (SELECT organization_id FROM sys_organization WHERE parent_id=#{param.parentId})
|
AND a.organization_id IN (SELECT organization_id FROM sys_organization WHERE parent_id=#{param.parentId})
|
||||||
@@ -175,13 +159,12 @@
|
|||||||
<select id="selectByUsername" resultType="com.gxwebsoft.common.system.entity.User">
|
<select id="selectByUsername" resultType="com.gxwebsoft.common.system.entity.User">
|
||||||
SELECT a.* ,
|
SELECT a.* ,
|
||||||
b.organization_name,
|
b.organization_name,
|
||||||
c.dict_data_name sex_name,f.oauth_id as openid,f.unionid
|
c.dict_data_name sex_name
|
||||||
FROM sys_user a
|
FROM sys_user a
|
||||||
LEFT JOIN sys_organization b ON a.organization_id = b.organization_id
|
LEFT JOIN sys_organization b ON a.organization_id = b.organization_id
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
<include refid="selectSexDictSql"/>
|
<include refid="selectSexDictSql"/>
|
||||||
) c ON a.sex = c.dict_data_code
|
) c ON a.sex = c.dict_data_code
|
||||||
LEFT JOIN sys_user_oauth f ON f.user_id = a.user_id and f.oauth_type = 'MP-WEIXIN'
|
|
||||||
<where>
|
<where>
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
AND (a.username = #{username} OR a.phone = #{username} OR a.email = #{username})
|
AND (a.username = #{username} OR a.phone = #{username} OR a.email = #{username})
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public class SysGenerator {
|
|||||||
// "sys_website_field",
|
// "sys_website_field",
|
||||||
// "sys_white_domain"
|
// "sys_white_domain"
|
||||||
// "sys_order",
|
// "sys_order",
|
||||||
"sys_user_collection"
|
// "sys_user_collection",
|
||||||
|
"sys_user"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user