新增:当前登录用户信息
This commit is contained in:
@@ -16,6 +16,7 @@ import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.oa.entity.Company;
|
||||
import com.gxwebsoft.oa.param.LinkParam;
|
||||
import com.gxwebsoft.oa.service.LinkService;
|
||||
@@ -56,6 +57,8 @@ public class WebsiteController extends BaseController {
|
||||
private LinkService linkService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@ApiOperation("获取网站信息")
|
||||
@GetMapping("/getSiteInfo")
|
||||
@@ -63,6 +66,8 @@ public class WebsiteController extends BaseController {
|
||||
final Integer tenantId = getTenantId();
|
||||
String key = "SiteInfo:" + tenantId;
|
||||
final String siteInfo = redisUtil.get(key);
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
System.out.println("access_token = " + access_token);
|
||||
|
||||
// 从缓存读取信息
|
||||
if(StrUtil.isNotBlank(siteInfo)){
|
||||
@@ -73,8 +78,6 @@ public class WebsiteController extends BaseController {
|
||||
final WebsiteParam websiteParam = new WebsiteParam();
|
||||
if (websiteService.count() == 0) {
|
||||
// 请求主服务器获取租户信息
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.get("https://server.gxwebsoft.com/api/auth/tenant")
|
||||
.header("Authorization", access_token)
|
||||
.header("Tenantid", tenantId.toString())
|
||||
@@ -220,11 +223,26 @@ public class WebsiteController extends BaseController {
|
||||
param.setDeleted(0);
|
||||
param.setStatus(0);
|
||||
website.setCategoryList(articleCategoryService.listRel(param));
|
||||
|
||||
// 读取友情链接
|
||||
final LinkParam linkParam = new LinkParam();
|
||||
linkParam.setLinkType("友情链接");
|
||||
website.setLinks(linkService.listRel(linkParam));
|
||||
|
||||
// 读取会员信息
|
||||
if(access_token != null){
|
||||
// 请求主服务器获取租户信息
|
||||
String result = HttpRequest.get("https://server.gxwebsoft.com/api/auth/user")
|
||||
.header("Authorization", access_token)
|
||||
.header("Tenantid", tenantId.toString())
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
final String data = jsonObject.getString("data");
|
||||
final User user = JSONObject.parseObject(data, User.class);
|
||||
website.setUserInfo(user);
|
||||
}
|
||||
|
||||
// 授权信息
|
||||
HashMap<String, Object> config = new HashMap<>();
|
||||
config.put("LICENSE_CODE", "");
|
||||
|
||||
@@ -57,11 +57,6 @@ public class WebsiteFieldController extends BaseController {
|
||||
@ApiOperation("添加应用参数")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody WebsiteField websiteField) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
websiteField.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (websiteFieldService.save(websiteField)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.entity.UserInfo;
|
||||
import com.gxwebsoft.oa.entity.Link;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -153,6 +155,10 @@ public class Website implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private List<Link> links;
|
||||
|
||||
@ApiModelProperty(value = "用户信息")
|
||||
@TableField(exist = false)
|
||||
private User userInfo;
|
||||
|
||||
@ApiModelProperty(value = "配置信息")
|
||||
@TableField(exist = false)
|
||||
private Object config;
|
||||
|
||||
@@ -31,18 +31,15 @@ public class WebsiteField implements Serializable {
|
||||
@ApiModelProperty(value = "网站ID")
|
||||
private Integer websiteId;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
@ApiModelProperty(value = "参数名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "参数值")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1删除")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<if test="param.goodsCategoryId != null">
|
||||
AND a.goods_category_id = #{param.goodsCategoryId}
|
||||
</if>
|
||||
<if test="param.goods_id != null">
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.active != null">
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
|
||||
@@ -36,10 +36,6 @@ public class WebsiteFieldParam extends BaseParam {
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1删除")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.gxwebsoft.oa.service.AppService;
|
||||
import com.gxwebsoft.oa.service.AppUserService;
|
||||
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;
|
||||
@@ -69,12 +70,22 @@ public class AppController extends BaseController {
|
||||
new LambdaQueryWrapper<App>()
|
||||
.eq(App::getAppStatus, "已下架")
|
||||
);
|
||||
Integer totalNum6 = appService.count(
|
||||
new LambdaQueryWrapper<App>()
|
||||
.eq(App::getShowCase,true)
|
||||
);
|
||||
Integer totalNum7 = appService.count(
|
||||
new LambdaQueryWrapper<App>()
|
||||
.eq(App::getShowIndex, true)
|
||||
);
|
||||
|
||||
data.put("totalNum", totalNum);
|
||||
data.put("totalNum2", totalNum2);
|
||||
data.put("totalNum3", totalNum3);
|
||||
data.put("totalNum4", totalNum4);
|
||||
data.put("totalNum5", totalNum5);
|
||||
data.put("totalNum6", totalNum6);
|
||||
data.put("totalNum7", totalNum7);
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@@ -114,6 +125,7 @@ public class AppController extends BaseController {
|
||||
return appPageResult;
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('oa:app:list')")
|
||||
@ApiOperation("查询全部应用管理记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<App>> list(AppParam param) {
|
||||
|
||||
@@ -201,6 +201,12 @@ public class App implements Serializable {
|
||||
@ApiModelProperty(value = "是否作为案例展示")
|
||||
private Boolean showCase;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Boolean recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否显示在首页")
|
||||
private Boolean showIndex;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
<if test="param.showCase != null">
|
||||
AND a.show_case = #{param.showCase}
|
||||
</if>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</if>
|
||||
<if test="param.showIndex != null">
|
||||
AND a.show_index = #{param.showIndex}
|
||||
</if>
|
||||
<if test="param.parentId != null">
|
||||
AND a.parent_id = #{param.parentId}
|
||||
</if>
|
||||
|
||||
@@ -225,4 +225,12 @@ public class AppParam extends BaseParam {
|
||||
@TableField(exist = false)
|
||||
private Boolean showCase;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
@TableField(exist = false)
|
||||
private Boolean recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否显示到首页")
|
||||
@TableField(exist = false)
|
||||
private Boolean showIndex;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,12 @@ public class Goods implements Serializable {
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "一级分类")
|
||||
private String categoryParent;
|
||||
|
||||
@ApiModelProperty(value = "二级分类")
|
||||
private String categoryChildren;
|
||||
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String specs;
|
||||
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
<if test="param.categoryId != null">
|
||||
AND a.category_id = #{param.categoryId}
|
||||
</if>
|
||||
<if test="param.categoryParent != null">
|
||||
AND a.category_parent LIKE CONCAT('%', #{param.categoryParent}, '%')
|
||||
</if>
|
||||
<if test="param.categoryChildren != null">
|
||||
AND a.category_children LIKE CONCAT('%', #{param.categoryChildren}, '%')
|
||||
</if>
|
||||
<if test="param.specs != null">
|
||||
AND a.specs LIKE CONCAT('%', #{param.specs}, '%')
|
||||
</if>
|
||||
|
||||
@@ -44,6 +44,12 @@ public class GoodsParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "一级分类")
|
||||
private String categoryParent;
|
||||
|
||||
@ApiModelProperty(value = "二级分类")
|
||||
private String categoryChildren;
|
||||
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String specs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user