diff --git a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java index 27fd2a7..0d8fd36 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/config/MybatisPlusConfig.java @@ -56,7 +56,8 @@ public class MybatisPlusConfig { "sys_tenant", "sys_dictionary", "sys_dictionary_data", - "sys_email_record" + "sys_email_record", + "sys_plug" ).contains(tableName); } }; diff --git a/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java b/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java index c56cd45..fef6b48 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/CacheClient.java @@ -33,7 +33,6 @@ public class CacheClient { * 写入redis缓存 * @param key [表名]:id * @param entity 实体类对象 - * 示例 cacheClient.set("merchant:"+id,merchant) */ public void set(String key, T entity){ stringRedisTemplate.opsForValue().set(prefix(key), JSONUtil.toJSONString(entity)); diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java index fe88c32..9666701 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/MainController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/MainController.java @@ -20,7 +20,6 @@ import com.gxwebsoft.common.core.security.JwtSubject; import com.gxwebsoft.common.core.security.JwtUtil; import com.gxwebsoft.common.core.utils.CacheClient; import com.gxwebsoft.common.core.utils.CommonUtil; -import com.gxwebsoft.common.core.utils.JSONUtil; import com.gxwebsoft.common.core.utils.RedisUtil; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; @@ -33,7 +32,6 @@ import com.gxwebsoft.common.system.result.CaptchaResult; import com.gxwebsoft.common.system.result.LoginResult; import com.gxwebsoft.common.system.service.*; import com.wf.captcha.SpecCaptcha; -import io.jsonwebtoken.Claims; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; diff --git a/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java b/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java index b485c86..b2d7dbf 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/MenuController.java @@ -146,9 +146,9 @@ public class MenuController extends BaseController { public ApiResult install(@PathVariable("id") Integer id){ if(menuService.install(id)){ // 更新安装次数 - final Plug plug = plugService.getOne(new LambdaQueryWrapper().eq(Plug::getMenuId, id)); - plug.setInstalls(plug.getInstalls() + 1); - plugService.updateById(plug); +// final Plug plug = plugService.getOne(new LambdaQueryWrapper().eq(Plug::getMenuId, id)); +// plug.setInstalls(plug.getInstalls() + 1); +// plugService.updateById(plug); return success("安装成功"); } return fail("安装失败",id); diff --git a/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java b/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java index 9b8fab2..d932d18 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/PlugController.java @@ -1,17 +1,15 @@ package com.gxwebsoft.common.system.controller; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.gxwebsoft.common.core.annotation.OperationLog; -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.common.system.entity.Menu; -import com.gxwebsoft.common.system.entity.Plug; import com.gxwebsoft.common.system.entity.User; -import com.gxwebsoft.common.system.param.PlugParam; -import com.gxwebsoft.common.system.service.MenuService; import com.gxwebsoft.common.system.service.PlugService; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; +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; @@ -24,7 +22,7 @@ import java.util.List; * 插件扩展控制器 * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ @Api(tags = "插件扩展管理") @RestController @@ -32,20 +30,17 @@ import java.util.List; public class PlugController extends BaseController { @Resource private PlugService plugService; - @Resource - private MenuService menuService; @PreAuthorize("hasAuthority('sys:plug:list')") @OperationLog @ApiOperation("分页查询插件扩展") @GetMapping("/page") public ApiResult> page(PlugParam param) { - // 如果不传userId,只显示审核通过的插件 - if (param.getUserId() == null) { - param.setStatus(20); - } + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(plugService.page(page, page.getWrapper())); // 使用关联查询 - return success(plugService.pageRel(param)); + //return success(plugService.pageRel(param)); } @PreAuthorize("hasAuthority('sys:plug:list')") @@ -53,8 +48,11 @@ public class PlugController extends BaseController { @ApiOperation("查询全部插件扩展") @GetMapping() public ApiResult> list(PlugParam param) { + PageParam page = new PageParam<>(param); + page.setDefaultOrder("create_time desc"); + return success(plugService.list(page.getOrderWrapper())); // 使用关联查询 - return success(plugService.listRel(param)); + //return success(plugService.listRel(param)); } @PreAuthorize("hasAuthority('sys:plug:list')") @@ -62,8 +60,9 @@ public class PlugController extends BaseController { @ApiOperation("根据id查询插件扩展") @GetMapping("/{id}") public ApiResult get(@PathVariable("id") Integer id) { + return success(plugService.getById(id)); // 使用关联查询 - return success(plugService.getByIdRel(id)); + //return success(plugService.getByIdRel(id)); } @PreAuthorize("hasAuthority('sys:plug:save')") @@ -120,7 +119,7 @@ public class PlugController extends BaseController { @ApiOperation("批量修改插件扩展") @PutMapping("/batch") public ApiResult removeBatch(@RequestBody BatchParam batchParam) { - if (batchParam.update(plugService, "menu_id")) { + if (batchParam.update(plugService, "plug_id")) { return success("修改成功"); } return fail("修改失败"); @@ -137,35 +136,4 @@ public class PlugController extends BaseController { return fail("删除失败"); } - @PreAuthorize("hasAuthority('sys:plug:save')") - @OperationLog - @ApiOperation("发布插件") - @PostMapping("/plug") - public ApiResult plug(@RequestBody Plug plug){ - final Integer menuId = plug.getParentId(); - // 查重 - final int count = plugService.count(new LambdaQueryWrapper().eq(Plug::getMenuId, menuId)); - if(count > 0){ - return fail("请勿重复发布"); - } - // 准备数据 - final Menu menu = menuService.getById(menuId); - plug.setUserId(getLoginUserId()); - plug.setMenuId(menuId); - plug.setTenantId(getTenantId()); - plug.setIcon(menu.getIcon()); - plug.setPath(menu.getPath()); - plug.setComponent(menu.getComponent()); - plug.setAuthority(menu.getAuthority()); - plug.setTitle(menu.getTitle()); - plug.setMenuType(menu.getMenuType()); - plug.setMeta(menu.getMeta()); - plug.setParentId(menu.getParentId()); - plug.setHide(menu.getHide()); - plug.setSortNumber(menu.getSortNumber()); - if(plugService.save(plug)){ - return success("发布成功"); - } - return fail("发布失败"); - } } diff --git a/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java b/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java index 683010f..a293fcd 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/FileRecord.java @@ -49,9 +49,6 @@ public class FileRecord implements Serializable { @TableLogic private Integer deleted; - @ApiModelProperty("商户编号") - private String merchantCode; - @ApiModelProperty(value = "租户id") private Integer tenantId; diff --git a/src/main/java/com/gxwebsoft/common/system/entity/Plug.java b/src/main/java/com/gxwebsoft/common/system/entity/Plug.java index b2dcd7c..620f3fc 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/Plug.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/Plug.java @@ -1,21 +1,24 @@ package com.gxwebsoft.common.system.entity; -import com.baomidou.mybatisplus.annotation.*; +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 com.baomidou.mybatisplus.annotation.TableLogic; +import java.io.Serializable; +import java.util.Date; + import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - /** * 插件扩展 * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ @Data @EqualsAndHashCode(callSuper = false) @@ -23,89 +26,51 @@ import java.util.List; @TableName("sys_plug") public class Plug implements Serializable { private static final long serialVersionUID = 1L; - public static final int TYPE_MENU = 0; // 菜单类型 - public static final int TYPE_BTN = 1; // 按钮类型 @ApiModelProperty(value = "插件id") @TableId(value = "plug_id", type = IdType.AUTO) private Integer plugId; - @ApiModelProperty(value = "菜单ID") - private Integer menuId; - - @ApiModelProperty(value = "上级id, 0是顶级") - private Integer parentId; - @ApiModelProperty(value = "菜单名称") - private String title; + private String plugName; - @ApiModelProperty(value = "菜单路由地址") - private String path; + @ApiModelProperty(value = "插件ID") + private String plugCode; - @ApiModelProperty(value = "菜单组件地址, 目录可为空") - private String component; - - @ApiModelProperty(value = "类型, 0菜单, 1按钮") - private Integer menuType; + @ApiModelProperty(value = "插件类型 10后台模块") + private Integer plugType; @ApiModelProperty(value = "排序号") private Integer sortNumber; - @ApiModelProperty(value = "权限标识") - private String authority; + @ApiModelProperty(value = "插件价格") + private BigDecimal price; - @ApiModelProperty(value = "打开位置") - private String target; + @ApiModelProperty(value = "评分") + private BigDecimal score; - @ApiModelProperty(value = "菜单图标") - private String icon; + @ApiModelProperty(value = "下载次数") + private Integer clicks; - @ApiModelProperty(value = "图标颜色") - private String color; + @ApiModelProperty(value = "安装次数") + private Integer installs; - @ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") - private Integer hide; - - @ApiModelProperty(value = "菜单侧栏选中的path") - private String active; - - @ApiModelProperty(value = "其它路由元信息") - private String meta; - - @ApiModelProperty(value = "插件描述") + @ApiModelProperty(value = "备注") private String comments; @ApiModelProperty(value = "插件详情") private String content; - @ApiModelProperty("评分") - private BigDecimal score; - - @ApiModelProperty("插件价格") - private BigDecimal price; - - @ApiModelProperty("浏览次数") - private Integer clicks; - - @ApiModelProperty("安装次数") - private Integer installs; - - @ApiModelProperty(value = "关联应用ID") - private Integer appId; + @ApiModelProperty(value = "状态, 10待审核 20已通过 30已驳回") + private Integer status; @ApiModelProperty(value = "用户ID") private Integer userId; - @ApiModelProperty(value = "状态") - private Integer status; - @ApiModelProperty(value = "是否删除, 0否, 1是") @TableLogic private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - @ApiModelProperty(value = "租户id") private Integer tenantId; @@ -115,27 +80,4 @@ public class Plug implements Serializable { @ApiModelProperty(value = "修改时间") private Date updateTime; - @ApiModelProperty("子菜单") - @TableField(exist = false) - private List children; - - @ApiModelProperty("角色权限树选中状态") - @TableField(exist = false) - private Boolean checked; - - @ApiModelProperty("租户名称") - @TableField(exist = false) - private String tenantName; - - @ApiModelProperty("企业名称") - @TableField(exist = false) - private String companyName; - - @ApiModelProperty("企业简称") - @TableField(exist = false) - private String shortName; - - @ApiModelProperty("企业域名") - @TableField(exist = false) - private String domain; } diff --git a/src/main/java/com/gxwebsoft/common/system/entity/User.java b/src/main/java/com/gxwebsoft/common/system/entity/User.java index afc0140..f1efda6 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/User.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/User.java @@ -236,14 +236,6 @@ public class User implements UserDetails { @TableField(exist = false) private String unionid; - @ApiModelProperty("所属商户的编号") - @TableField(exist = false) - private String merchantCode; - - @ApiModelProperty("所属商户名称") - @TableField(exist = false) - private String merchantName; - @ApiModelProperty("ico文件") @TableField(exist = false) private String logo; diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java b/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java index 1ab815e..617b94b 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserGrade.java @@ -58,9 +58,6 @@ public class UserGrade implements Serializable { @TableLogic private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - @ApiModelProperty(value = "租户id") private Integer tenantId; diff --git a/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java b/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java index 9ce9cf7..b60ff48 100644 --- a/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java +++ b/src/main/java/com/gxwebsoft/common/system/entity/UserOauth.java @@ -55,9 +55,6 @@ public class UserOauth implements Serializable { @TableLogic private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - @ApiModelProperty(value = "租户id") private Integer tenantId; diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java b/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java index 600b1a2..effb815 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java +++ b/src/main/java/com/gxwebsoft/common/system/mapper/PlugMapper.java @@ -1,6 +1,5 @@ package com.gxwebsoft.common.system.mapper; -import com.baomidou.mybatisplus.annotation.InterceptorIgnore; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.gxwebsoft.common.system.entity.Plug; @@ -13,7 +12,7 @@ import java.util.List; * 插件扩展Mapper * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ public interface PlugMapper extends BaseMapper { @@ -24,7 +23,6 @@ public interface PlugMapper extends BaseMapper { * @param param 查询参数 * @return List */ - @InterceptorIgnore(tenantLine = "true") List selectPageRel(@Param("page") IPage page, @Param("param") PlugParam param); @@ -36,7 +34,4 @@ public interface PlugMapper extends BaseMapper { */ List selectListRel(@Param("param") PlugParam param); - @InterceptorIgnore(tenantLine = "true") - List getMenuByClone(@Param("param") PlugParam param); - } diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml index 629a8d7..e093983 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/FileRecordMapper.xml @@ -7,11 +7,9 @@ SELECT a.*, b.username create_username, b.nickname create_nickname, - b.avatar, - c.merchant_code + b.avatar FROM sys_file_record a LEFT JOIN sys_user b ON a.create_user_id = b.user_id - LEFT JOIN shop_merchant c ON a.merchant_code = c.merchant_code AND a.id = #{param.id} @@ -52,9 +50,6 @@ AND a.content_type LIKE CONCAT('%', #{param.contentType}, '%') - - AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') - diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml index cdaeafb..5ea80d8 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/PlugMapper.xml @@ -4,64 +4,47 @@ - SELECT a.*,b.tenant_name,c.company_name,c.short_name,c.domain + SELECT a.* FROM sys_plug a - LEFT JOIN sys_tenant b ON a.tenant_id = b.tenant_id - LEFT JOIN sys_company c ON a.tenant_id = c.tenant_id - AND a.plug_id = #{param.plugId} + AND a.plug_id = #{param.plugId} - - AND a.menu_id = #{param.menuId} + + AND a.plug_name LIKE CONCAT('%', #{param.plugName}, '%') - - AND a.parent_id = #{param.parentId} + + AND a.plug_code LIKE CONCAT('%', #{param.plugCode}, '%') - - AND a.title LIKE CONCAT('%', #{param.title}, '%') - - - AND a.path LIKE CONCAT('%', #{param.path}, '%') - - - AND a.component LIKE CONCAT('%', #{param.component}, '%') - - - AND a.menu_type = #{param.menuType} + + AND a.plug_type = #{param.plugType} AND a.sort_number = #{param.sortNumber} - - AND a.authority LIKE CONCAT('%', #{param.authority}, '%') + + AND a.price = #{param.price} - - AND a.target LIKE CONCAT('%', #{param.target}, '%') + + AND a.score = #{param.score} - - AND a.icon LIKE CONCAT('%', #{param.icon}, '%') + + AND a.clicks = #{param.clicks} - - AND a.color LIKE CONCAT('%', #{param.color}, '%') + + AND a.installs = #{param.installs} - - AND a.hide = #{param.hide} + + AND a.comments LIKE CONCAT('%', #{param.comments}, '%') - - AND a.active LIKE CONCAT('%', #{param.active}, '%') - - - AND a.meta LIKE CONCAT('%', #{param.meta}, '%') - - - AND a.app_id = #{param.appId} - - - AND a.user_id = #{param.userId} + + AND a.content LIKE CONCAT('%', #{param.content}, '%') - AND a.status = #{param.status} + AND a.status = #{param.status} + + + AND a.user_id = #{param.userId} AND a.deleted = #{param.deleted} @@ -69,22 +52,12 @@ AND a.deleted = 0 - - AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') - AND a.create_time >= #{param.createTimeStart} AND a.create_time <= #{param.createTimeEnd} - - AND (a.title LIKE CONCAT('%', #{param.keywords}, '%') - OR a.menu_id = #{param.keywords} - OR c.company_name LIKE CONCAT('%', #{param.keywords}, '%') - OR c.short_name LIKE CONCAT('%', #{param.keywords}, '%') - ) - @@ -98,8 +71,4 @@ - - diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml index 2756fc4..5797863 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserGradeMapper.xml @@ -40,9 +40,6 @@ AND a.deleted = 0 - - AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') - AND a.create_time >= #{param.createTimeStart} diff --git a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml index 7901e72..049cde1 100644 --- a/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml +++ b/src/main/java/com/gxwebsoft/common/system/mapper/xml/UserOauthMapper.xml @@ -37,9 +37,6 @@ AND a.deleted = 0 - - AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') - AND a.create_time >= #{param.createTimeStart} diff --git a/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java b/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java index 97dc845..8da8a26 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/FileRecordParam.java @@ -64,7 +64,4 @@ public class FileRecordParam extends BaseParam { @TableField(exist = false) private String avatar; - @ApiModelProperty("商户编号") - private String merchantCode; - } diff --git a/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java b/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java index 87e79af..adefbf3 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/PlugParam.java @@ -9,11 +9,13 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + /** * 插件扩展查询参数 * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ @Data @EqualsAndHashCode(callSuper = false) @@ -26,58 +28,43 @@ public class PlugParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer plugId; - @ApiModelProperty(value = "菜单id") - @QueryField(type = QueryType.EQ) - private Integer menuId; - - @ApiModelProperty(value = "上级id, 0是顶级") - @QueryField(type = QueryType.EQ) - private Integer parentId; - @ApiModelProperty(value = "菜单名称") - private String title; + private String plugName; - @ApiModelProperty(value = "菜单路由地址") - private String path; + @ApiModelProperty(value = "插件ID") + private String plugCode; - @ApiModelProperty(value = "菜单组件地址, 目录可为空") - private String component; - - @ApiModelProperty(value = "类型, 0菜单, 1按钮") + @ApiModelProperty(value = "插件类型 10后台模块") @QueryField(type = QueryType.EQ) - private Integer menuType; + private Integer plugType; @ApiModelProperty(value = "排序号") @QueryField(type = QueryType.EQ) private Integer sortNumber; - @ApiModelProperty(value = "权限标识") - private String authority; - - @ApiModelProperty(value = "打开位置") - private String target; - - @ApiModelProperty(value = "菜单图标") - private String icon; - - @ApiModelProperty(value = "图标颜色") - private String color; - - @ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)") + @ApiModelProperty(value = "插件价格") @QueryField(type = QueryType.EQ) - private Integer hide; + private BigDecimal price; - @ApiModelProperty(value = "菜单侧栏选中的path") - private String active; - - @ApiModelProperty(value = "其它路由元信息") - private String meta; - - @ApiModelProperty(value = "关联应用ID") + @ApiModelProperty(value = "评分") @QueryField(type = QueryType.EQ) - private Integer appId; + private BigDecimal score; - @ApiModelProperty(value = "状态") + @ApiModelProperty(value = "下载次数") + @QueryField(type = QueryType.EQ) + private Integer clicks; + + @ApiModelProperty(value = "安装次数") + @QueryField(type = QueryType.EQ) + private Integer installs; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "插件详情") + private String content; + + @ApiModelProperty(value = "状态, 10待审核 20已通过 30已驳回") @QueryField(type = QueryType.EQ) private Integer status; @@ -89,7 +76,4 @@ public class PlugParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - } diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java index c10fb53..9ddab83 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/UserGradeParam.java @@ -57,7 +57,4 @@ public class UserGradeParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - } diff --git a/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java b/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java index 5cb1efe..4566ec8 100644 --- a/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java +++ b/src/main/java/com/gxwebsoft/common/system/param/UserOauthParam.java @@ -54,7 +54,4 @@ public class UserOauthParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer deleted; - @ApiModelProperty(value = "商户编码") - private String merchantCode; - } diff --git a/src/main/java/com/gxwebsoft/common/system/service/PlugService.java b/src/main/java/com/gxwebsoft/common/system/service/PlugService.java index 18d1194..09f2899 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/PlugService.java +++ b/src/main/java/com/gxwebsoft/common/system/service/PlugService.java @@ -11,7 +11,7 @@ import java.util.List; * 插件扩展Service * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ public interface PlugService extends IService { @@ -34,11 +34,9 @@ public interface PlugService extends IService { /** * 根据id查询 * - * @param menuId 菜单id + * @param plugId 插件id * @return Plug */ - Plug getByIdRel(Integer menuId); - - Boolean cloneMenu(PlugParam param); + Plug getByIdRel(Integer plugId); } diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java index c328274..f70e8ff 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/PlugServiceImpl.java @@ -1,16 +1,13 @@ package com.gxwebsoft.common.system.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gxwebsoft.common.system.mapper.PlugMapper; +import com.gxwebsoft.common.system.service.PlugService; +import com.gxwebsoft.common.system.entity.Plug; +import com.gxwebsoft.common.system.param.PlugParam; import com.gxwebsoft.common.core.web.PageParam; import com.gxwebsoft.common.core.web.PageResult; -import com.gxwebsoft.common.system.entity.Plug; -import com.gxwebsoft.common.system.mapper.PlugMapper; -import com.gxwebsoft.common.system.param.PlugParam; -import com.gxwebsoft.common.system.service.PlugService; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; import java.util.List; @@ -18,7 +15,7 @@ import java.util.List; * 插件扩展Service实现 * * @author 科技小王子 - * @since 2023-05-18 11:57:37 + * @since 2023-10-12 09:53:07 */ @Service public class PlugServiceImpl extends ServiceImpl implements PlugService { @@ -26,7 +23,7 @@ public class PlugServiceImpl extends ServiceImpl implements Pl @Override public PageResult pageRel(PlugParam param) { PageParam page = new PageParam<>(param); - page.setDefaultOrder("create_time desc"); + //page.setDefaultOrder("create_time desc"); List list = baseMapper.selectPageRel(page, param); return new PageResult<>(list, page.getTotal()); } @@ -36,77 +33,15 @@ public class PlugServiceImpl extends ServiceImpl implements Pl List list = baseMapper.selectListRel(param); // 排序 PageParam page = new PageParam<>(); - page.setDefaultOrder("create_time desc"); + //page.setDefaultOrder("create_time desc"); return page.sortRecords(list); } @Override - public Plug getByIdRel(Integer menuId) { + public Plug getByIdRel(Integer plugId) { PlugParam param = new PlugParam(); - param.setMenuId(menuId); + param.setPlugId(plugId); return param.getOne(baseMapper.selectListRel(param)); } - @Override - @Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE) - public Boolean cloneMenu(PlugParam param) { - System.out.println("准备待克隆的菜单数据 = " + param); - // 删除本项目菜单 - baseMapper.delete(new LambdaQueryWrapper().eq(Plug::getDeleted,0)); - // 顶级栏目 - param.setParentId(0); - final List list = baseMapper.getMenuByClone(param); -// final List menuIds = list.stream().map(Menu::getMenuId).collect(Collectors.toList()); - - list.forEach(d -> { - Plug plug = new Plug(); - plug.setParentId(0); - plug.setTitle(d.getTitle()); - plug.setPath(d.getPath()); - plug.setComponent(d.getComponent()); - plug.setMenuType(d.getMenuType()); - plug.setSortNumber(d.getSortNumber()); - plug.setAuthority(d.getAuthority()); - plug.setIcon(d.getIcon()); - plug.setHide(d.getHide()); - plug.setMeta(d.getMeta()); - save(plug); - // 二级菜单 - param.setParentId(d.getMenuId()); - final List list1 = baseMapper.getMenuByClone(param); - list1.forEach(d1 -> { - final Plug menu1 = new Plug(); - menu1.setParentId(plug.getMenuId()); - menu1.setTitle(d1.getTitle()); - menu1.setPath(d1.getPath()); - menu1.setComponent(d1.getComponent()); - menu1.setMenuType(d1.getMenuType()); - menu1.setSortNumber(d1.getSortNumber()); - menu1.setAuthority(d1.getAuthority()); - menu1.setIcon(d1.getIcon()); - menu1.setHide(d1.getHide()); - menu1.setMeta(d1.getMeta()); - save(menu1); - // 三级菜单 - param.setParentId(d1.getMenuId()); - final List list2 = baseMapper.getMenuByClone(param); - list2.forEach(d2 -> { - final Plug menu2 = new Plug(); - menu2.setParentId(menu1.getMenuId()); - menu2.setTitle(d2.getTitle()); - menu2.setPath(d2.getPath()); - menu2.setComponent(d2.getComponent()); - menu2.setMenuType(d2.getMenuType()); - menu2.setSortNumber(d2.getSortNumber()); - menu2.setAuthority(d2.getAuthority()); - menu2.setIcon(d2.getIcon()); - menu2.setHide(d2.getHide()); - menu2.setMeta(d2.getMeta()); - save(menu2); - }); - }); - }); - return true; - } - } diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index bf1c0a3..7647dd9 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -3,16 +3,16 @@ # 数据源配置 spring: datasource: - url: jdbc:mysql://127.0.0.1:3308/com_gxwebsoft_oa?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 - username: com_gxwebsoft_oa - password: EZfW2R4YiWfbLHLw + url: jdbc:mysql://127.0.0.1:3308/gxwebsoft_core?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 + username: gxwebsoft_core + password: jdj7HYEdYHnYEFBy driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource # 日志配置 logging: file: - name: websoft-api.log + name: websoft-core.log level: root: WARN com.gxwebsoft: ERROR diff --git a/src/test/java/com/gxwebsoft/generator/SysGenerator.java b/src/test/java/com/gxwebsoft/generator/SysGenerator.java index 5aa450d..8d1b0dd 100644 --- a/src/test/java/com/gxwebsoft/generator/SysGenerator.java +++ b/src/test/java/com/gxwebsoft/generator/SysGenerator.java @@ -53,7 +53,8 @@ public class SysGenerator { // "sys_user_oauth" // "sys_user_grade" // "sys_user_referee" - "sys_notice" +// "sys_notice" + "sys_plug" }; // 需要去除的表前缀