图标支持按行排列
This commit is contained in:
@@ -1,132 +0,0 @@
|
|||||||
package com.gxwebsoft.booking.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
|
||||||
import com.gxwebsoft.common.core.security.JwtSubject;
|
|
||||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.booking.service.UsersService;
|
|
||||||
import com.gxwebsoft.booking.entity.Users;
|
|
||||||
import com.gxwebsoft.booking.param.UsersParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.LoginRecord;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.common.system.param.UserParam;
|
|
||||||
import com.gxwebsoft.common.system.result.LoginResult;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.gxwebsoft.common.core.constants.RedisConstants.ACCESS_TOKEN_KEY;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2024-04-25 20:44:46
|
|
||||||
*/
|
|
||||||
@Api(tags = "用户管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/booking/users")
|
|
||||||
public class UsersController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private UsersService usersService;
|
|
||||||
|
|
||||||
@ApiOperation("分页查询用户")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<Users>> page(UsersParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(usersService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("查询全部用户")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<Users>> list(UsersParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(usersService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('booking:users:list')")
|
|
||||||
@ApiOperation("根据id查询用户")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<Users> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(usersService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('booking:users:list')")
|
|
||||||
@ApiOperation("根据手机查询用户")
|
|
||||||
@GetMapping("/getByPhone")
|
|
||||||
public ApiResult<Users> getByPhone(UsersParam param) {
|
|
||||||
final List<Users> users = usersService.listRel(param);
|
|
||||||
return success(param.getOne(users));
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("添加用户")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody Users users) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
// User loginUser = getLoginUser();
|
|
||||||
// if (loginUser != null) {
|
|
||||||
// users.setUserId(loginUser.getUserId());
|
|
||||||
// }
|
|
||||||
if (usersService.save(users)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("修改用户")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody Users users) {
|
|
||||||
if (usersService.updateById(users)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("删除用户")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (usersService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("批量添加用户")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<Users> list) {
|
|
||||||
if (usersService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("批量修改用户")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Users> batchParam) {
|
|
||||||
if (batchParam.update(usersService, "user_id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("批量删除用户")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (usersService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -38,6 +38,9 @@ public class MpMenu implements Serializable {
|
|||||||
@ApiModelProperty(value = "类型 0自定义 1单页内容2外部链接")
|
@ApiModelProperty(value = "类型 0自定义 1单页内容2外部链接")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在行 0第一行 1第二行")
|
||||||
|
private Integer rows;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否微信小程序菜单")
|
@ApiModelProperty(value = "是否微信小程序菜单")
|
||||||
private Boolean isMpWeixin;
|
private Boolean isMpWeixin;
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<if test="param.type != null">
|
<if test="param.type != null">
|
||||||
AND a.type = #{param.type}
|
AND a.type = #{param.type}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.rows != null">
|
||||||
|
AND a.rows = #{param.rows}
|
||||||
|
</if>
|
||||||
<if test="param.isMpWeixin != null">
|
<if test="param.isMpWeixin != null">
|
||||||
AND a.is_mp_weixin = #{param.isMpWeixin}
|
AND a.is_mp_weixin = #{param.isMpWeixin}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public class MpMenuParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在行 0第一行 1第二行")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer rows;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否微信小程序菜单")
|
@ApiModelProperty(value = "是否微信小程序菜单")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Boolean isMpWeixin;
|
private Boolean isMpWeixin;
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class User implements UserDetails {
|
|||||||
@ApiModelProperty(value = "注册时间")
|
@ApiModelProperty(value = "注册时间")
|
||||||
private Integer addTime;
|
private Integer addTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否管理员:1是;2否")
|
@ApiModelProperty(value = "是否管理员:1是;0否")
|
||||||
private Boolean isAdmin;
|
private Boolean isAdmin;
|
||||||
|
|
||||||
@ApiModelProperty(value = "客户端ID")
|
@ApiModelProperty(value = "客户端ID")
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class BrandController extends BaseController {
|
|||||||
return success(brandService.pageRel(param));
|
return success(brandService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:list')")
|
||||||
@ApiOperation("查询全部品牌")
|
@ApiOperation("查询全部品牌")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Brand>> list(BrandParam param) {
|
public ApiResult<List<Brand>> list(BrandParam param) {
|
||||||
@@ -52,6 +53,7 @@ public class BrandController extends BaseController {
|
|||||||
return success(brandService.getByIdRel(id));
|
return success(brandService.getByIdRel(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:save')")
|
||||||
@ApiOperation("添加品牌")
|
@ApiOperation("添加品牌")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Brand brand) {
|
public ApiResult<?> save(@RequestBody Brand brand) {
|
||||||
@@ -66,6 +68,7 @@ public class BrandController extends BaseController {
|
|||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:update')")
|
||||||
@ApiOperation("修改品牌")
|
@ApiOperation("修改品牌")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Brand brand) {
|
public ApiResult<?> update(@RequestBody Brand brand) {
|
||||||
@@ -75,6 +78,7 @@ public class BrandController extends BaseController {
|
|||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:remove')")
|
||||||
@ApiOperation("删除品牌")
|
@ApiOperation("删除品牌")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
@@ -84,6 +88,7 @@ public class BrandController extends BaseController {
|
|||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:save')")
|
||||||
@ApiOperation("批量添加品牌")
|
@ApiOperation("批量添加品牌")
|
||||||
@PostMapping("/batch")
|
@PostMapping("/batch")
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<Brand> list) {
|
public ApiResult<?> saveBatch(@RequestBody List<Brand> list) {
|
||||||
@@ -93,6 +98,7 @@ public class BrandController extends BaseController {
|
|||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:update')")
|
||||||
@ApiOperation("批量修改品牌")
|
@ApiOperation("批量修改品牌")
|
||||||
@PutMapping("/batch")
|
@PutMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Brand> batchParam) {
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Brand> batchParam) {
|
||||||
@@ -102,6 +108,7 @@ public class BrandController extends BaseController {
|
|||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:brand:remove')")
|
||||||
@ApiOperation("批量删除品牌")
|
@ApiOperation("批量删除品牌")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class OrderController extends BaseController {
|
|||||||
return success(orderService.pageRel(param));
|
return success(orderService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:order:list')")
|
||||||
@ApiOperation("查询全部预约订单")
|
@ApiOperation("查询全部预约订单")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Order>> list(OrderParam param) {
|
public ApiResult<List<Order>> list(OrderParam param) {
|
||||||
|
|||||||
@@ -0,0 +1,138 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Users;
|
||||||
|
import com.gxwebsoft.shop.param.UsersParam;
|
||||||
|
import com.gxwebsoft.shop.service.UsersService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-05-07 16:25:11
|
||||||
|
*/
|
||||||
|
@Api(tags = "用户管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/users")
|
||||||
|
public class UsersController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private UsersService usersService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询用户")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Users>> page(UsersParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(usersService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:users:list')")
|
||||||
|
@ApiOperation("查询全部用户")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Users>> list(UsersParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(usersService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:users:list')")
|
||||||
|
@ApiOperation("根据id查询用户")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Users> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(usersService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:users:list')")
|
||||||
|
@ApiOperation("根据手机查询用户")
|
||||||
|
@GetMapping("/getByPhone")
|
||||||
|
public ApiResult<Users> getByPhone(UsersParam param) {
|
||||||
|
Users result;
|
||||||
|
final List<Users> users = usersService.listRel(param);
|
||||||
|
if (users.isEmpty()) {
|
||||||
|
// 同步注册用户
|
||||||
|
final Users addUsers = new Users();
|
||||||
|
addUsers.setPhone(param.getPhone());
|
||||||
|
addUsers.setUsername("微信用户");
|
||||||
|
addUsers.setOpenid("");
|
||||||
|
addUsers.setAvatarUrl("");
|
||||||
|
addUsers.setSex(0);
|
||||||
|
addUsers.setIsAdmin(2);
|
||||||
|
addUsers.setCountry("");
|
||||||
|
addUsers.setProvince("");
|
||||||
|
addUsers.setCity("");
|
||||||
|
addUsers.setRegion("");
|
||||||
|
long longValue = System.currentTimeMillis() / 1000;
|
||||||
|
addUsers.setAddTime((int) longValue);
|
||||||
|
addUsers.setSortNumber(0);
|
||||||
|
usersService.save(addUsers);
|
||||||
|
result = addUsers;
|
||||||
|
}else {
|
||||||
|
result = param.getOne(users);
|
||||||
|
}
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加用户")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Users users) {
|
||||||
|
if (usersService.save(users)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改用户")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Users users) {
|
||||||
|
if (usersService.updateById(users)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除用户")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (usersService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加用户")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Users> list) {
|
||||||
|
if (usersService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改用户")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Users> batchParam) {
|
||||||
|
if (batchParam.update(usersService, "user_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除用户")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (usersService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
package com.gxwebsoft.booking.entity;
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -18,12 +18,12 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 用户
|
* 用户
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-25 20:44:46
|
* @since 2024-05-07 16:25:11
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value = "Users对象", description = "用户")
|
@ApiModel(value = "Users对象", description = "用户")
|
||||||
@TableName("booking_users")
|
@TableName("shop_users")
|
||||||
public class Users implements Serializable {
|
public class Users implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class Users implements Serializable {
|
|||||||
private String avatarUrl;
|
private String avatarUrl;
|
||||||
|
|
||||||
@ApiModelProperty(value = "1男,2女")
|
@ApiModelProperty(value = "1男,2女")
|
||||||
private Boolean sex;
|
private Integer sex;
|
||||||
|
|
||||||
@ApiModelProperty(value = "国家")
|
@ApiModelProperty(value = "国家")
|
||||||
private String country;
|
private String country;
|
||||||
@@ -88,7 +88,7 @@ public class Users implements Serializable {
|
|||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否管理员:1是;2否")
|
@ApiModelProperty(value = "是否管理员:1是;2否")
|
||||||
private Boolean isAdmin;
|
private Integer isAdmin;
|
||||||
|
|
||||||
@ApiModelProperty(value = "客户端ID")
|
@ApiModelProperty(value = "客户端ID")
|
||||||
private String clientId;
|
private String clientId;
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
package com.gxwebsoft.booking.mapper;
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.gxwebsoft.booking.entity.Users;
|
import com.gxwebsoft.shop.entity.Users;
|
||||||
import com.gxwebsoft.booking.param.UsersParam;
|
import com.gxwebsoft.shop.param.UsersParam;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
* 用户Mapper
|
* 用户Mapper
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-25 20:44:46
|
* @since 2024-05-07 16:25:11
|
||||||
*/
|
*/
|
||||||
public interface UsersMapper extends BaseMapper<Users> {
|
public interface UsersMapper extends BaseMapper<Users> {
|
||||||
|
|
||||||
+12
-12
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.gxwebsoft.booking.mapper.UsersMapper">
|
<mapper namespace="com.gxwebsoft.shop.mapper.UsersMapper">
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM booking_users a
|
FROM shop_users a
|
||||||
<where>
|
<where>
|
||||||
<if test="param.userId != null">
|
<if test="param.userId != null">
|
||||||
AND a.user_id = #{param.userId}
|
AND a.user_id = #{param.userId}
|
||||||
@@ -98,24 +98,24 @@
|
|||||||
AND a.create_time <= #{param.createTimeEnd}
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.keywords != null">
|
<if test="param.keywords != null">
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.username LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.username LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.province LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.province LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.city LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.city LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.region LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.region LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.booking.entity.Users">
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Users">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
<!-- 查询全部 -->
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.booking.entity.Users">
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Users">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.gxwebsoft.booking.param;
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 用户查询参数
|
* 用户查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-25 20:44:46
|
* @since 2024-05-07 16:25:11
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -40,7 +40,7 @@ public class UsersParam extends BaseParam {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "1男,2女")
|
@ApiModelProperty(value = "1男,2女")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Boolean sex;
|
private Integer sex;
|
||||||
|
|
||||||
@ApiModelProperty(value = "国家")
|
@ApiModelProperty(value = "国家")
|
||||||
private String country;
|
private String country;
|
||||||
@@ -90,7 +90,7 @@ public class UsersParam extends BaseParam {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "是否管理员:1是;2否")
|
@ApiModelProperty(value = "是否管理员:1是;2否")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Boolean isAdmin;
|
private Integer isAdmin;
|
||||||
|
|
||||||
@ApiModelProperty(value = "客户端ID")
|
@ApiModelProperty(value = "客户端ID")
|
||||||
private String clientId;
|
private String clientId;
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
package com.gxwebsoft.booking.service;
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import com.gxwebsoft.booking.entity.Users;
|
import com.gxwebsoft.shop.entity.Users;
|
||||||
import com.gxwebsoft.booking.param.UsersParam;
|
import com.gxwebsoft.shop.param.UsersParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
* 用户Service
|
* 用户Service
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-25 20:44:46
|
* @since 2024-05-07 16:25:11
|
||||||
*/
|
*/
|
||||||
public interface UsersService extends IService<Users> {
|
public interface UsersService extends IService<Users> {
|
||||||
|
|
||||||
+8
-9
@@ -1,10 +1,10 @@
|
|||||||
package com.gxwebsoft.booking.service.impl;
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gxwebsoft.booking.mapper.UsersMapper;
|
import com.gxwebsoft.shop.mapper.UsersMapper;
|
||||||
import com.gxwebsoft.booking.service.UsersService;
|
import com.gxwebsoft.shop.service.UsersService;
|
||||||
import com.gxwebsoft.booking.entity.Users;
|
import com.gxwebsoft.shop.entity.Users;
|
||||||
import com.gxwebsoft.booking.param.UsersParam;
|
import com.gxwebsoft.shop.param.UsersParam;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -15,15 +15,14 @@ import java.util.List;
|
|||||||
* 用户Service实现
|
* 用户Service实现
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-25 20:44:46
|
* @since 2024-05-07 16:25:11
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {
|
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Users> pageRel(UsersParam param) {
|
public PageResult<Users> pageRel(UsersParam param) {
|
||||||
PageParam<Users, UsersParam> page = new PageParam<>(param);
|
PageParam<Users, UsersParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("sort_number asc, add_time desc, create_time desc");
|
||||||
List<Users> list = baseMapper.selectPageRel(page, param);
|
List<Users> list = baseMapper.selectPageRel(page, param);
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
@@ -33,7 +32,7 @@ public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements
|
|||||||
List<Users> list = baseMapper.selectListRel(param);
|
List<Users> list = baseMapper.selectListRel(param);
|
||||||
// 排序
|
// 排序
|
||||||
PageParam<Users, UsersParam> page = new PageParam<>();
|
PageParam<Users, UsersParam> page = new PageParam<>();
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("sort_number asc, add_time desc, create_time desc");
|
||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,8 @@ public class ShopGenerator {
|
|||||||
// "shop_mp_menu"
|
// "shop_mp_menu"
|
||||||
// "shop_order_info",
|
// "shop_order_info",
|
||||||
// "shop_order_info_log",
|
// "shop_order_info_log",
|
||||||
"shop_wechat_deposit"
|
// "shop_wechat_deposit"
|
||||||
|
"shop_users"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user