修改/auth/tenant接口
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.AppRenewService;
|
||||
import com.gxwebsoft.common.system.entity.AppRenew;
|
||||
import com.gxwebsoft.common.system.param.AppRenewParam;
|
||||
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 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 2023-11-14 14:14:07
|
||||
*/
|
||||
@Api(tags = "续费管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/system/app-renew")
|
||||
public class AppRenewController extends BaseController {
|
||||
@Resource
|
||||
private AppRenewService appRenewService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询续费管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<AppRenew>> page(AppRenewParam param) {
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(appRenewService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(appRenewService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部续费管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<AppRenew>> list(AppRenewParam param) {
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(appRenewService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(appRenewService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询续费管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<AppRenew> get(@PathVariable("id") Integer id) {
|
||||
return success(appRenewService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(appRenewService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加续费管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody AppRenew appRenew) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
appRenew.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (appRenewService.save(appRenew)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改续费管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody AppRenew appRenew) {
|
||||
if (appRenewService.updateById(appRenew)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除续费管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (appRenewService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加续费管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<AppRenew> list) {
|
||||
if (appRenewService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改续费管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<AppRenew> batchParam) {
|
||||
if (batchParam.update(appRenewService, "app_renew_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appRenew:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除续费管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (appRenewService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.AppUserService;
|
||||
@@ -32,57 +33,47 @@ public class AppUserController extends BaseController {
|
||||
private AppUserService appUserService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询应用成员")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<AppUser>> page(AppUserParam param) {
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(appUserService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(appUserService.pageRel(param));
|
||||
// 使用关联查询
|
||||
return success(appUserService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部应用成员")
|
||||
@GetMapping()
|
||||
public ApiResult<List<AppUser>> list(AppUserParam param) {
|
||||
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(appUserService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(appUserService.listRel(param));
|
||||
// 使用关联查询
|
||||
if (param.getAppId() == null) {
|
||||
return fail("AppId不存在",null);
|
||||
}
|
||||
return success(appUserService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询应用成员")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<AppUser> get(@PathVariable("id") Integer id) {
|
||||
return success(appUserService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(appUserService.getByIdRel(id));
|
||||
// 使用关联查询
|
||||
return success(appUserService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加应用成员")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody AppUser appUser) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
appUser.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (appUserService.save(appUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
if (appUserService.count(new LambdaQueryWrapper<AppUser>()
|
||||
.eq(AppUser::getUserId, appUser.getUserId()).eq(AppUser::getAppId,appUser.getAppId())) > 0) {
|
||||
return fail("该成员已存在");
|
||||
}
|
||||
if (appUserService.save(appUser)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改应用成员")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody AppUser appUser) {
|
||||
@@ -93,14 +84,13 @@ public class AppUserController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除应用成员")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (appUserService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
return success("移除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
return fail("移除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:appUser:save')")
|
||||
|
||||
@@ -38,8 +38,6 @@ public class CompanyController extends BaseController {
|
||||
@Resource
|
||||
private CompanyMapper companyMapper;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:auth:user')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询企业信息不限租户")
|
||||
@GetMapping("/pageAll")
|
||||
public ApiResult<PageResult<Company>> pageAll(CompanyParam param) {
|
||||
|
||||
@@ -155,6 +155,9 @@ public class MainController extends BaseController {
|
||||
@GetMapping("/auth/tenant")
|
||||
public ApiResult<?> tenant() {
|
||||
Integer tenantId = getTenantId();
|
||||
if(tenantId == null){
|
||||
throw new BusinessException("缺少参数tenantId");
|
||||
}
|
||||
Tenant tenant = tenantService.getByIdRel(tenantId);
|
||||
// 企业信息
|
||||
Company company = companyService.getByTenantIdRel(tenantId);
|
||||
@@ -178,16 +181,6 @@ public class MainController extends BaseController {
|
||||
menu.setMenuType(0);
|
||||
list.add(menu);
|
||||
tenant.setMenu(list);
|
||||
// 查询游客用户
|
||||
User loginUser = userService.getByUsername("www", tenantId);
|
||||
tenant.setLoginUser(loginUser);
|
||||
// 设置过期时间
|
||||
Long tokenExpireTime = configProperties.getTokenExpireTime();
|
||||
// 签发token
|
||||
String access_token = JwtUtil.buildToken(new JwtSubject("www", tenantId),
|
||||
tokenExpireTime, configProperties.getTokenKey());
|
||||
tenant.setToken(access_token);
|
||||
tenant.setUsername("www");
|
||||
return success(tenant);
|
||||
}
|
||||
|
||||
|
||||
@@ -219,12 +219,16 @@ public class WxLoginController extends BaseController {
|
||||
String key = ACCESS_TOKEN_KEY.concat(":").concat(getTenantId().toString());
|
||||
// 获取微信小程序配置信息
|
||||
JSONObject setting = settingService.getBySettingKey("mp-weixin");
|
||||
if(setting == null){
|
||||
throw new BusinessException("请先配置小程序");
|
||||
}
|
||||
// 从缓存获取access_token
|
||||
String value = redisTemplate.opsForValue().get(key);
|
||||
if (value != null) {
|
||||
// 解析access_token
|
||||
JSONObject response = JSON.parseObject(value);
|
||||
return response.getString("access_token");
|
||||
System.out.println("response = " + response);
|
||||
// return response.getString("access_token");
|
||||
}
|
||||
// 微信获取凭证接口
|
||||
String apiUrl = "https://api.weixin.qq.com/cgi-bin/token";
|
||||
@@ -232,6 +236,7 @@ public class WxLoginController extends BaseController {
|
||||
String url = apiUrl.concat("?grant_type=client_credential").concat("&appid=").concat(setting.getString("appId")).concat("&secret=").concat(setting.getString("appSecret"));
|
||||
// 执行get请求
|
||||
String result = HttpUtil.get(url);
|
||||
System.out.println("result = " + result);
|
||||
// 解析access_token
|
||||
JSONObject response = JSON.parseObject(result);
|
||||
if (response.getString("access_token") != null) {
|
||||
@@ -239,7 +244,7 @@ public class WxLoginController extends BaseController {
|
||||
redisTemplate.opsForValue().set(key, result,7000L, TimeUnit.SECONDS);
|
||||
return response.getString("access_token");
|
||||
}
|
||||
return null;
|
||||
throw new BusinessException("小程序配置不正确");
|
||||
}
|
||||
|
||||
@ApiOperation("获取微信openId")
|
||||
|
||||
@@ -176,7 +176,7 @@ public class WxOfficialController extends BaseController {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + getAccessToken();
|
||||
TemplateMessage templateMessage = new TemplateMessage();
|
||||
templateMessage.setToUser(openId);
|
||||
templateMessage.setTemplateId("DSGpuDx1i7AWyRXejalnkq5AeslKnkm6T9omu6NPoLM"); // dVSbX2NRzAG7IuN4kkCQhgV-LjzxvApN3PgrGlon9JU
|
||||
templateMessage.setTemplateId("dVSbX2NRzAG7IuN4kkCQhgV-LjzxvApN3PgrGlon9JU");
|
||||
|
||||
/*
|
||||
您好,您已成功消费。
|
||||
@@ -187,9 +187,12 @@ public class WxOfficialController extends BaseController {
|
||||
{{productType.DATA}}:{{name.DATA}} 消费时间:{{time.DATA}} {{remark.DATA}}
|
||||
*/
|
||||
HashMap<String, TemplateMessageDTO> data = new HashMap<>();
|
||||
data.put("thing33",new TemplateMessageDTO("您的新的工单需要处理"));
|
||||
data.put("phrase5",new TemplateMessageDTO("网站故障"));
|
||||
data.put("time40",new TemplateMessageDTO("2023-11-11"));
|
||||
data.put("first",new TemplateMessageDTO("您收到了一条新的订单。"));
|
||||
data.put("tradeDateTime",new TemplateMessageDTO("02月18日 01时05分"));
|
||||
data.put("customerInfo",new TemplateMessageDTO("广州 王俊"));
|
||||
data.put("orderItemName",new TemplateMessageDTO("兴趣车型"));
|
||||
data.put("orderItemData",new TemplateMessageDTO("骐达 2011款 1.6 CVT 舒适版"));
|
||||
data.put("remark",new TemplateMessageDTO("截止24日09:39分,您尚有10个订单未处理。"));
|
||||
System.out.println("data = " + data);
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.post(url)
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 续费管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:14:07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "AppRenew对象", description = "续费管理")
|
||||
@TableName("sys_app_renew")
|
||||
public class AppRenew implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "app_renew_id", type = IdType.AUTO)
|
||||
private Integer appRenewId;
|
||||
|
||||
@ApiModelProperty(value = "续费金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -47,4 +48,24 @@ public class AppUser implements Serializable {
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@TableField(exist = false)
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@TableField(exist = false)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,17 +52,13 @@ public class Tenant implements Serializable {
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "游客")
|
||||
@TableField(exist = false)
|
||||
private String username;
|
||||
// @ApiModelProperty(value = "游客")
|
||||
// @TableField(exist = false)
|
||||
// private String username;
|
||||
|
||||
@ApiModelProperty(value = "游客身份")
|
||||
@TableField(exist = false)
|
||||
private String token;
|
||||
|
||||
@ApiModelProperty(value = "当前登录用户")
|
||||
@TableField(exist = false)
|
||||
private User loginUser;
|
||||
// @ApiModelProperty(value = "游客身份")
|
||||
// @TableField(exist = false)
|
||||
// private String token;
|
||||
|
||||
@ApiModelProperty(value = "菜单信息")
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -265,13 +265,13 @@ public class User implements UserDetails {
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("企业信息")
|
||||
@TableField(exist = false)
|
||||
private Company companyInfo;
|
||||
// @ApiModelProperty("企业信息")
|
||||
// @TableField(exist = false)
|
||||
// private Company companyInfo;
|
||||
|
||||
@ApiModelProperty("系统配置信息")
|
||||
@TableField(exist = false)
|
||||
private Object system;
|
||||
// @ApiModelProperty("系统配置信息")
|
||||
// @TableField(exist = false)
|
||||
// private Object system;
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.AppRenew;
|
||||
import com.gxwebsoft.common.system.param.AppRenewParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:14:07
|
||||
*/
|
||||
public interface AppRenewMapper extends BaseMapper<AppRenew> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<AppRenew>
|
||||
*/
|
||||
List<AppRenew> selectPageRel(@Param("page") IPage<AppRenew> page,
|
||||
@Param("param") AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<AppRenew> selectListRel(@Param("param") AppRenewParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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.gxwebsoft.common.system.mapper.AppRenewMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_app_renew a
|
||||
<where>
|
||||
<if test="param.appRenewId != null">
|
||||
AND a.app_renew_id = #{param.appRenewId}
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.startTime != null">
|
||||
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
||||
</if>
|
||||
<if test="param.endTime != null">
|
||||
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.appId != null">
|
||||
AND a.app_id = #{param.appId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.AppRenew">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.AppRenew">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
SELECT a.*, b.nickname,b.email,b.phone,b.avatar
|
||||
FROM sys_app_user a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.appUserId != null">
|
||||
AND a.app_user_id = #{param.appUserId}
|
||||
@@ -28,6 +29,13 @@
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.email LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.username LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.gxwebsoft.common.system.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 续费管理查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:14:07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "AppRenewParam对象", description = "续费管理查询参数")
|
||||
public class AppRenewParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer appRenewId;
|
||||
|
||||
@ApiModelProperty(value = "续费金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "应用ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer appId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1待确认")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.common.system.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
@@ -42,4 +43,24 @@ public class AppUserParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
@TableField(exist = false)
|
||||
private String username;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@TableField(exist = false)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty(value = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.AppRenew;
|
||||
import com.gxwebsoft.common.system.param.AppRenewParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:14:07
|
||||
*/
|
||||
public interface AppRenewService extends IService<AppRenew> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<AppRenew>
|
||||
*/
|
||||
PageResult<AppRenew> pageRel(AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<AppRenew>
|
||||
*/
|
||||
List<AppRenew> listRel(AppRenewParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param appRenewId 自增ID
|
||||
* @return AppRenew
|
||||
*/
|
||||
AppRenew getByIdRel(Integer appRenewId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.system.mapper.AppRenewMapper;
|
||||
import com.gxwebsoft.common.system.service.AppRenewService;
|
||||
import com.gxwebsoft.common.system.entity.AppRenew;
|
||||
import com.gxwebsoft.common.system.param.AppRenewParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 续费管理Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-11-14 14:14:07
|
||||
*/
|
||||
@Service
|
||||
public class AppRenewServiceImpl extends ServiceImpl<AppRenewMapper, AppRenew> implements AppRenewService {
|
||||
|
||||
@Override
|
||||
public PageResult<AppRenew> pageRel(AppRenewParam param) {
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>(param);
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
List<AppRenew> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AppRenew> listRel(AppRenewParam param) {
|
||||
List<AppRenew> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<AppRenew, AppRenewParam> page = new PageParam<>();
|
||||
//page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppRenew getByIdRel(Integer appRenewId) {
|
||||
AppRenewParam param = new AppRenewParam();
|
||||
param.setAppRenewId(appRenewId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,24 +80,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
if (user != null) {
|
||||
user.setRoles(userRoleService.listByUserId(user.getUserId()));
|
||||
user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null));
|
||||
// 系统配置信息
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 1)云存储
|
||||
String key = "setting:upload:" + user.getTenantId();
|
||||
final String upload = redisUtil.get(key);
|
||||
if(upload != null){
|
||||
final JSONObject object = JSONObject.parseObject(upload);
|
||||
map.put("uploadMethod",object.getString("uploadMethod"));
|
||||
map.put("bucketDomain",object.getString("bucketDomain"));
|
||||
map.put("fileUrl",object.getString("fileUrl") + "/");
|
||||
user.setSystem(map);
|
||||
}
|
||||
// // 系统配置信息
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
// // 1)云存储
|
||||
// String key = "setting:upload:" + user.getTenantId();
|
||||
// final String upload = redisUtil.get(key);
|
||||
// if(upload != null){
|
||||
// final JSONObject object = JSONObject.parseObject(upload);
|
||||
// map.put("uploadMethod",object.getString("uploadMethod"));
|
||||
// map.put("bucketDomain",object.getString("bucketDomain"));
|
||||
// map.put("fileUrl",object.getString("fileUrl") + "/");
|
||||
// user.setSystem(map);
|
||||
// }
|
||||
// 企业信息
|
||||
final Company company = companyService.getByTenantIdRel(user.getTenantId());
|
||||
if (company != null) {
|
||||
user.setCompanyId(company.getCompanyId());
|
||||
user.setCompanyInfo(company);
|
||||
}
|
||||
// final Company company = companyService.getByTenantIdRel(user.getTenantId());
|
||||
// if (company != null) {
|
||||
// user.setCompanyId(company.getCompanyId());
|
||||
// user.setCompanyInfo(company);
|
||||
// }
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 端口
|
||||
server:
|
||||
port: 9090
|
||||
port: 9091
|
||||
# socketIo
|
||||
socketio:
|
||||
port: 9191
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SysGenerator {
|
||||
// "sys_industry"
|
||||
// "sys_plug",
|
||||
// "sys_company"
|
||||
"sys_user_oauth"
|
||||
// "sys_user_oauth",
|
||||
// "sys_user_grade"
|
||||
// "sys_user_referee"
|
||||
// "sys_notice"
|
||||
@@ -62,7 +62,8 @@ public class SysGenerator {
|
||||
// "sys_user_group"
|
||||
// "sys_app",
|
||||
// "sys_app_user",
|
||||
// "sys_app_url"
|
||||
// "sys_app_url",
|
||||
"sys_app_renew"
|
||||
};
|
||||
// 需要去除的表前缀
|
||||
private static final String[] TABLE_PREFIX = new String[]{
|
||||
|
||||
Reference in New Issue
Block a user