From 72caf426a740144ca19e4f4dd12a3762a89fecbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=86=99=E6=9C=9D?= <13694051+wangxizhao123@user.noreply.gitee.com> Date: Tue, 23 Apr 2024 08:51:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=EF=BC=8C=E9=83=A8=E9=97=A8=E6=9F=A5=E8=AF=A2+?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6=EF=BC=8C=E7=94=A8=E6=88=B7=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- muyu-modules/muyu-goods/pom.xml | 88 ++++++++ .../com/muyu/goods/MuYuGoodsAppliction.java | 18 ++ .../goods/controller/AdminController.java | 98 +++++++++ .../java/com/muyu/goods/domain/Admin.java | 93 ++++++++ .../com/muyu/goods/mapper/AdminMapper.java | 64 ++++++ .../com/muyu/goods/service/IAdminService.java | 62 ++++++ .../goods/service/impl/AdminServiceImpl.java | 94 ++++++++ .../src/main/resources/bootstrap.yml | 28 +++ .../resources/mapper.goods/AdminMapper.xml | 71 ++++++ .../system/controller/AccreditController.java | 87 ++++++++ .../controller/AssetModelController.java | 121 +++++++++++ .../controller/DataAccessController.java | 104 +++++++++ .../controller/DataSourceController.java | 98 +++++++++ .../com/muyu/system/domain/AssetModel.java | 150 +++++++++++++ .../com/muyu/system/domain/DataAccess.java | 205 ++++++++++++++++++ .../com/muyu/system/domain/DataSource.java | 195 +++++++++++++++++ .../java/com/muyu/system/domain/Library.java | 13 ++ .../java/com/muyu/system/domain/Middle.java | 29 +++ .../com/muyu/system/domain/TableName.java | 8 + .../com/muyu/system/domain/vo/DeptVO.java | 93 ++++++++ .../com/muyu/system/domain/vo/SysUserVo.java | 143 ++++++++++++ .../com/muyu/system/domain/vo/TableVo.java | 91 ++++++++ .../muyu/system/mapper/AccreditMapper.java | 23 ++ .../muyu/system/mapper/AssetModelMapper.java | 72 ++++++ .../muyu/system/mapper/DataAccessMapper.java | 66 ++++++ .../muyu/system/mapper/DataSourceMapper.java | 62 ++++++ .../com/muyu/system/mapper/SysDeptMapper.java | 5 + .../com/muyu/system/mapper/SysUserMapper.java | 3 + .../muyu/system/service/AccreditService.java | 18 ++ .../system/service/IAssetModelService.java | 67 ++++++ .../system/service/IDataAccessService.java | 61 ++++++ .../system/service/IDataSourceService.java | 62 ++++++ .../muyu/system/service/SysDeptService.java | 9 + .../muyu/system/service/SysUserService.java | 3 + .../service/impl/AccreditServiceImpl.java | 50 +++++ .../service/impl/AssetModelServiceImpl.java | 112 ++++++++++ .../service/impl/DataAccessServiceImpl.java | 104 +++++++++ .../service/impl/DataSourceServiceImpl.java | 97 +++++++++ .../service/impl/SysDeptServiceImpl.java | 12 + .../service/impl/SysUserServiceImpl.java | 7 + .../mapper/system/AccreditMapper.xml | 30 +++ .../mapper/system/AssetModelMapper.xml | 109 ++++++++++ .../mapper/system/DataAccessMapper.xml | 114 ++++++++++ .../mapper/system/DataSourceMapper.xml | 116 ++++++++++ .../resources/mapper/system/SysDeptMapper.xml | 25 +++ .../resources/mapper/system/SysUserMapper.xml | 24 ++ muyu-modules/pom.xml | 1 + 47 files changed, 3205 insertions(+) create mode 100644 muyu-modules/muyu-goods/pom.xml create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/MuYuGoodsAppliction.java create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/controller/AdminController.java create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/domain/Admin.java create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/mapper/AdminMapper.java create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/IAdminService.java create mode 100644 muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/impl/AdminServiceImpl.java create mode 100644 muyu-modules/muyu-goods/src/main/resources/bootstrap.yml create mode 100644 muyu-modules/muyu-goods/src/main/resources/mapper.goods/AdminMapper.xml create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AccreditController.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AssetModelController.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataAccessController.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataSourceController.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/AssetModel.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataAccess.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataSource.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Library.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Middle.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/TableName.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/DeptVO.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/SysUserVo.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/TableVo.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AccreditMapper.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AssetModelMapper.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataAccessMapper.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataSourceMapper.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/AccreditService.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IAssetModelService.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataAccessService.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataSourceService.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AccreditServiceImpl.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AssetModelServiceImpl.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataAccessServiceImpl.java create mode 100644 muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataSourceServiceImpl.java create mode 100644 muyu-modules/muyu-system/src/main/resources/mapper/system/AccreditMapper.xml create mode 100644 muyu-modules/muyu-system/src/main/resources/mapper/system/AssetModelMapper.xml create mode 100644 muyu-modules/muyu-system/src/main/resources/mapper/system/DataAccessMapper.xml create mode 100644 muyu-modules/muyu-system/src/main/resources/mapper/system/DataSourceMapper.xml diff --git a/muyu-modules/muyu-goods/pom.xml b/muyu-modules/muyu-goods/pom.xml new file mode 100644 index 0000000..0c714ab --- /dev/null +++ b/muyu-modules/muyu-goods/pom.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + + com.muyu + muyu-modules + 3.6.3 + + + muyu-goods + + + 17 + 17 + UTF-8 + + + + + com.muyu + muyu-common-core + + + + + + + com.mysql + mysql-connector-j + + + + com.muyu + muyu-common-redis + + + + com.muyu + muyu-common-datasource + + + + + com.muyu + muyu-common-datascope + + + + + com.muyu + muyu-common-swagger + + + + + com.muyu + muyu-common-log + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/MuYuGoodsAppliction.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/MuYuGoodsAppliction.java new file mode 100644 index 0000000..b1baff7 --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/MuYuGoodsAppliction.java @@ -0,0 +1,18 @@ +package com.muyu.goods; + +import com.muyu.common.security.annotation.EnableCustomConfig; +import com.muyu.common.security.annotation.EnableMyFeignClients; +import com.muyu.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableMyFeignClients +public class MuYuGoodsAppliction { + public static void main(String[] args) { + SpringApplication.run(MuYuGoodsAppliction.class); + } +} diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/controller/AdminController.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/controller/AdminController.java new file mode 100644 index 0000000..c3898bd --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/controller/AdminController.java @@ -0,0 +1,98 @@ +package com.muyu.goods.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.goods.domain.Admin; +import com.muyu.goods.service.IAdminService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 测试信息Controller + * + * @author muyu + * @date 2024-04-21 + */ +@RestController +@RequestMapping("/admin") +public class AdminController extends BaseController +{ + @Autowired + private IAdminService adminService; + + /** + * 查询测试信息列表 + */ + @RequiresPermissions("goods:admin:list") + @GetMapping("/list") + public Result> list(Admin admin) + { + startPage(); + List list = adminService.selectAdminList(admin); + return getDataTable(list); + } + + /** + * 导出测试信息列表 + */ + @RequiresPermissions("goods:admin:export") + @Log(title = "测试信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Admin admin) + { + List list = adminService.selectAdminList(admin); + ExcelUtil util = new ExcelUtil(Admin.class); + util.exportExcel(response, list, "测试信息数据"); + } + + /** + * 获取测试信息详细信息 + */ + @RequiresPermissions("goods:admin:query") + @GetMapping(value = "/{id}") + public Result getInfo(@PathVariable("id") Long id) + { + return success(adminService.selectAdminById(id)); + } + + /** + * 新增测试信息 + */ + @RequiresPermissions("goods:admin:add") + @Log(title = "测试信息", businessType = BusinessType.INSERT) + @PostMapping + public Result add(@RequestBody Admin admin) + { + return toAjax(adminService.insertAdmin(admin)); + } + + /** + * 修改测试信息 + */ + @RequiresPermissions("goods:admin:edit") + @Log(title = "测试信息", businessType = BusinessType.UPDATE) + @PutMapping + public Result edit(@RequestBody Admin admin) + { + return toAjax(adminService.updateAdmin(admin)); + } + + /** + * 删除测试信息 + */ + @RequiresPermissions("goods:admin:remove") + @Log(title = "测试信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public Result remove(@PathVariable Long[] ids) + { + return toAjax(adminService.deleteAdminByIds(ids)); + } +} diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/domain/Admin.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/domain/Admin.java new file mode 100644 index 0000000..95c76ec --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/domain/Admin.java @@ -0,0 +1,93 @@ +package com.muyu.goods.domain; + +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 测试信息对象 admin + * + * @author muyu + * @date 2024-04-21 + */ +public class Admin extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 用户名 */ + @Excel(name = "用户名") + private String username; + + /** 密码 */ + @Excel(name = "密码") + private String password; + + /** 号码 */ + @Excel(name = "号码") + private String tel; + + /** 角色 */ + @Excel(name = "角色") + private Long typeId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setUsername(String username) + { + this.username = username; + } + + public String getUsername() + { + return username; + } + public void setPassword(String password) + { + this.password = password; + } + + public String getPassword() + { + return password; + } + public void setTel(String tel) + { + this.tel = tel; + } + + public String getTel() + { + return tel; + } + public void setTypeId(Long typeId) + { + this.typeId = typeId; + } + + public Long getTypeId() + { + return typeId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("username", getUsername()) + .append("password", getPassword()) + .append("tel", getTel()) + .append("typeId", getTypeId()) + .toString(); + } +} diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/mapper/AdminMapper.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/mapper/AdminMapper.java new file mode 100644 index 0000000..8aaace7 --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/mapper/AdminMapper.java @@ -0,0 +1,64 @@ +package com.muyu.goods.mapper; + +import com.muyu.goods.domain.Admin; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 测试信息Mapper接口 + * + * @author muyu + * @date 2024-04-21 + */ +@Mapper +public interface AdminMapper +{ + /** + * 查询测试信息 + * + * @param id 测试信息主键 + * @return 测试信息 + */ + public Admin selectAdminById(Long id); + + /** + * 查询测试信息列表 + * + * @param admin 测试信息 + * @return 测试信息集合 + */ + public List selectAdminList(Admin admin); + + /** + * 新增测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + public int insertAdmin(Admin admin); + + /** + * 修改测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + public int updateAdmin(Admin admin); + + /** + * 删除测试信息 + * + * @param id 测试信息主键 + * @return 结果 + */ + public int deleteAdminById(Long id); + + /** + * 批量删除测试信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAdminByIds(Long[] ids); +} diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/IAdminService.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/IAdminService.java new file mode 100644 index 0000000..fcc1501 --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/IAdminService.java @@ -0,0 +1,62 @@ +package com.muyu.goods.service; + +import com.muyu.goods.domain.Admin; + +import java.util.List; + +/** + * 测试信息Service接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface IAdminService +{ + /** + * 查询测试信息 + * + * @param id 测试信息主键 + * @return 测试信息 + */ + public Admin selectAdminById(Long id); + + /** + * 查询测试信息列表 + * + * @param admin 测试信息 + * @return 测试信息集合 + */ + public List selectAdminList(Admin admin); + + /** + * 新增测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + public int insertAdmin(Admin admin); + + /** + * 修改测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + public int updateAdmin(Admin admin); + + /** + * 批量删除测试信息 + * + * @param ids 需要删除的测试信息主键集合 + * @return 结果 + */ + public int deleteAdminByIds(Long[] ids); + + /** + * 删除测试信息信息 + * + * @param id 测试信息主键 + * @return 结果 + */ + public int deleteAdminById(Long id); +} diff --git a/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/impl/AdminServiceImpl.java b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/impl/AdminServiceImpl.java new file mode 100644 index 0000000..85f8030 --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/java/com/muyu/goods/service/impl/AdminServiceImpl.java @@ -0,0 +1,94 @@ +package com.muyu.goods.service.impl; + +import com.muyu.goods.domain.Admin; +import com.muyu.goods.mapper.AdminMapper; +import com.muyu.goods.service.IAdminService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 测试信息Service业务层处理 + * + * @author muyu + * @date 2024-04-21 + */ +@Service +public class AdminServiceImpl implements IAdminService +{ + @Autowired + private AdminMapper adminMapper; + + /** + * 查询测试信息 + * + * @param id 测试信息主键 + * @return 测试信息 + */ + @Override + public Admin selectAdminById(Long id) + { + return adminMapper.selectAdminById(id); + } + + /** + * 查询测试信息列表 + * + * @param admin 测试信息 + * @return 测试信息 + */ + @Override + public List selectAdminList(Admin admin) + { + return adminMapper.selectAdminList(admin); + } + + /** + * 新增测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + @Override + public int insertAdmin(Admin admin) + { + return adminMapper.insertAdmin(admin); + } + + /** + * 修改测试信息 + * + * @param admin 测试信息 + * @return 结果 + */ + @Override + public int updateAdmin(Admin admin) + { + return adminMapper.updateAdmin(admin); + } + + /** + * 批量删除测试信息 + * + * @param ids 需要删除的测试信息主键 + * @return 结果 + */ + @Override + public int deleteAdminByIds(Long[] ids) + { + return adminMapper.deleteAdminByIds(ids); + } + + /** + * 删除测试信息信息 + * + * @param id 测试信息主键 + * @return 结果 + */ + @Override + public int deleteAdminById(Long id) + { + return adminMapper.deleteAdminById(id); + } +} diff --git a/muyu-modules/muyu-goods/src/main/resources/bootstrap.yml b/muyu-modules/muyu-goods/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..3986000 --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/resources/bootstrap.yml @@ -0,0 +1,28 @@ +# Tomcat +server: + port: 9502 + +# Spring +spring: + application: + # 应用名称 + name: muyu-goods + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 129.211.23.219:8848 + config: + # 配置中心地址 + server-addr: 129.211.23.219:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} +logging: + level: + com.muyu.goods.mapper: DEBUG diff --git a/muyu-modules/muyu-goods/src/main/resources/mapper.goods/AdminMapper.xml b/muyu-modules/muyu-goods/src/main/resources/mapper.goods/AdminMapper.xml new file mode 100644 index 0000000..153c6cb --- /dev/null +++ b/muyu-modules/muyu-goods/src/main/resources/mapper.goods/AdminMapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + select id, username, password, tel, type_id from admin + + + + + + + + insert into admin + + username, + password, + tel, + type_id, + + + #{username}, + #{password}, + #{tel}, + #{typeId}, + + + + + update admin + + username = #{username}, + password = #{password}, + tel = #{tel}, + type_id = #{typeId}, + + where id = #{id} + + + + delete from admin where id = #{id} + + + + delete from admin where id in + + #{id} + + + diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AccreditController.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AccreditController.java new file mode 100644 index 0000000..5affa9b --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AccreditController.java @@ -0,0 +1,87 @@ +package com.muyu.system.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.system.domain.SysUser; +import com.muyu.system.domain.TableName; +import com.muyu.system.domain.vo.DeptVO; +import com.muyu.system.domain.vo.SysUserVo; +import com.muyu.system.domain.vo.TableVo; +import com.muyu.system.service.AccreditService; +import com.muyu.system.service.SysDeptService; +import com.muyu.system.service.SysUserService; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("accredit") +@Log4j2 +public class AccreditController extends BaseController { + @Autowired + private AccreditService service; + //部门信息 + @Autowired + private SysDeptService deptService; + @Autowired + private SysUserService userService; + + /** + * 获取表名 + * @return + */ + @GetMapping("tableNameList") + public Result> tableNameList(){ + List list = service.tableNameList(); + return Result.success(list); + } + + /** + * 获取表名 + * @return + */ + @GetMapping("tableNameList2") + public Result> tableNameList2(){ + List list = service.tableNameList2(); + return Result.success(list); + } + + @GetMapping("listSqlJdbc") + public Result listSqlJdbc(){ + return service.listSqlJdbc(); + } + + /** + * 获取表详情 + * @param tableName + * @return + */ + @PostMapping("selectTableXml/{tableName}") + public Result> selectTableXml(@PathVariable String tableName){ + List list = service.selectTableXml(tableName); + return Result.success(list); + } + + /** + * 查询部门 + * @return + */ + @GetMapping("/listDeptVo") + public Result list () { + List depts = deptService.selectDeptListVo(); + return success(depts); + } + + /** + * 查询用户 + * @return + */ + @GetMapping("/listSelectSysUser") + public Result> listSelectSysUser(){ + List list = userService.listSelectSysUser(); + return success(list); + } + +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AssetModelController.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AssetModelController.java new file mode 100644 index 0000000..0bbe41e --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/AssetModelController.java @@ -0,0 +1,121 @@ +package com.muyu.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.muyu.system.domain.Library; +import com.muyu.system.domain.vo.TableVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.system.domain.AssetModel; +import com.muyu.system.service.IAssetModelService; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.page.TableDataInfo; + +/** + * 资产详情Controller + * + * @author muyu + * @date 2024-04-21 + */ +@RestController +@RequestMapping("/model") +public class AssetModelController extends BaseController +{ + @Autowired + private IAssetModelService assetModelService; + + /** + * 查询资产详情列表 + */ + @RequiresPermissions("system:model:list") + @GetMapping("/list") + public Result> list(AssetModel assetModel) + { + startPage(); + List list = assetModelService.selectAssetModelList(assetModel); + return getDataTable(list); + } + + /** + * 导出资产详情列表 + */ + @RequiresPermissions("system:model:export") + @Log(title = "资产详情", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, AssetModel assetModel) + { + List list = assetModelService.selectAssetModelList(assetModel); + ExcelUtil util = new ExcelUtil(AssetModel.class); + util.exportExcel(response, list, "资产详情数据"); + } + + /** + * 获取资产详情详细信息 + */ + @RequiresPermissions("system:model:query") + @GetMapping(value = "/{annotation}") + public Result getInfo(@PathVariable("annotation") String annotation) + { + return success(assetModelService.selectAssetModelByAnnotation(annotation)); + } + + /** + * 新增资产详情 + */ + @RequiresPermissions("system:model:add") + @Log(title = "资产详情", businessType = BusinessType.INSERT) + @PostMapping + public Result add(@RequestBody AssetModel assetModel) + { + return toAjax(assetModelService.insertAssetModel(assetModel)); + } + + /** + * 修改资产详情 + */ + @RequiresPermissions("system:model:edit") + @Log(title = "资产详情", businessType = BusinessType.UPDATE) + @PutMapping + public Result edit(@RequestBody AssetModel assetModel) + { + return toAjax(assetModelService.updateAssetModel(assetModel)); + } + + /** + * 删除资产详情 + */ + @RequiresPermissions("system:model:remove") + @Log(title = "资产详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{annotations}") + public Result remove(@PathVariable String[] annotations) + { + return toAjax(assetModelService.deleteAssetModelByAnnotations(annotations)); + } + + /** + * 获取数据库的所有表 + * @return + */ + @GetMapping("library") + public Result> library() { + List list = assetModelService.library(); + return Result.success(list); + } + + /** + * 数据详情 + * @param libraryName + * @return + */ + @GetMapping("selectTable/{libraryName}") + public Result> selectTable(@PathVariable String libraryName){ + List list = assetModelService.selectTable(libraryName); + return Result.success(list); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataAccessController.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataAccessController.java new file mode 100644 index 0000000..1f2ec83 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataAccessController.java @@ -0,0 +1,104 @@ +package com.muyu.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.system.domain.DataAccess; +import com.muyu.system.service.IDataAccessService; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.page.TableDataInfo; + +/** + * 数据接入Controller + * + * @author muyu + * @date 2024-04-21 + */ +@RestController +@RequestMapping("/access") +public class DataAccessController extends BaseController +{ + @Autowired + private IDataAccessService dataAccessService; + + /** + * 查询数据接入列表 + */ + @RequiresPermissions("system:access:list") + @GetMapping("/list") + public Result> list(DataAccess dataAccess) + { + startPage(); + List list = dataAccessService.selectDataAccessList(dataAccess); + return getDataTable(list); + } + + /** + * 导出数据接入列表 + */ + @RequiresPermissions("system:access:export") + @Log(title = "数据接入", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DataAccess dataAccess) + { + List list = dataAccessService.selectDataAccessList(dataAccess); + ExcelUtil util = new ExcelUtil(DataAccess.class); + util.exportExcel(response, list, "数据接入数据"); + } + + /** + * 获取数据接入详细信息 + */ + @RequiresPermissions("system:access:query") + @GetMapping(value = "/{id}") + public Result getInfo(@PathVariable("id") Long id) + { + return success(dataAccessService.selectDataAccessById(id)); + } + + /** + * 新增数据接入 + */ + @RequiresPermissions("system:access:add") + @Log(title = "数据接入", businessType = BusinessType.INSERT) + @PostMapping + public Result add(@RequestBody DataAccess dataAccess) + { + return toAjax(dataAccessService.insertDataAccess(dataAccess)); + } + + /** + * 修改数据接入 + */ + @RequiresPermissions("system:access:edit") + @Log(title = "数据接入", businessType = BusinessType.UPDATE) + @PutMapping + public Result edit(@RequestBody DataAccess dataAccess) + { + return toAjax(dataAccessService.updateDataAccess(dataAccess)); + } + + /** + * 删除数据接入 + */ + @RequiresPermissions("system:access:remove") + @Log(title = "数据接入", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public Result remove(@PathVariable Long[] ids) + { + return toAjax(dataAccessService.deleteDataAccessByIds(ids)); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataSourceController.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataSourceController.java new file mode 100644 index 0000000..67eedc9 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/DataSourceController.java @@ -0,0 +1,98 @@ +package com.muyu.system.controller; + +import com.muyu.common.core.domain.Result; +import com.muyu.common.core.utils.poi.ExcelUtil; +import com.muyu.common.core.web.controller.BaseController; +import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.common.log.annotation.Log; +import com.muyu.common.log.enums.BusinessType; +import com.muyu.common.security.annotation.RequiresPermissions; +import com.muyu.system.domain.DataSource; +import com.muyu.system.service.IDataSourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 获取信息Controller + * + * @author muyu + * @date 2024-04-21 + */ +@RestController +@RequestMapping("/source") +public class DataSourceController extends BaseController +{ + @Autowired + private IDataSourceService dataSourceService; + + /** + * 查询获取信息列表 + */ + @RequiresPermissions("system:source:list") + @GetMapping("/list") + public Result> list(DataSource dataSource) + { + startPage(); + List list = dataSourceService.selectDataSourceList(dataSource); + return getDataTable(list); + } + + /** + * 导出获取信息列表 + */ + @RequiresPermissions("system:source:export") + @Log(title = "获取信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DataSource dataSource) + { + List list = dataSourceService.selectDataSourceList(dataSource); + ExcelUtil util = new ExcelUtil(DataSource.class); + util.exportExcel(response, list, "获取信息数据"); + } + + /** + * 获取获取信息详细信息 + */ + @RequiresPermissions("system:source:query") + @GetMapping(value = "/{id}") + public Result getInfo(@PathVariable("id") Long id) + { + return success(dataSourceService.selectDataSourceById(id)); + } + + /** + * 新增获取信息 + */ + @RequiresPermissions("system:source:add") + @Log(title = "获取信息", businessType = BusinessType.INSERT) + @PostMapping + public Result add(@RequestBody DataSource dataSource) + { + return toAjax(dataSourceService.insertDataSource(dataSource)); + } + + /** + * 修改获取信息 + */ + @RequiresPermissions("system:source:edit") + @Log(title = "获取信息", businessType = BusinessType.UPDATE) + @PutMapping + public Result edit(@RequestBody DataSource dataSource) + { + return toAjax(dataSourceService.updateDataSource(dataSource)); + } + + /** + * 删除获取信息 + */ + @RequiresPermissions("system:source:remove") + @Log(title = "获取信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public Result remove(@PathVariable Long[] ids) + { + return toAjax(dataSourceService.deleteDataSourceByIds(ids)); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/AssetModel.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/AssetModel.java new file mode 100644 index 0000000..358d686 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/AssetModel.java @@ -0,0 +1,150 @@ +package com.muyu.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 资产详情对象 asset_model + * + * @author muyu + * @date 2024-04-21 + */ +public class AssetModel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 名称 */ + @Excel(name = "名称") + private String name; + + /** 注释 */ + @Excel(name = "注释") + private String annotation; + + /** 是否主键Y/N */ + @Excel(name = "是否主键Y/N") + private String key; + + /** 类型 */ + @Excel(name = "类型") + private String type; + + /** 映射类型 */ + @Excel(name = "映射类型") + private String mappingType; + + /** 长度 */ + @Excel(name = "长度") + private Long length; + + /** 小数位 */ + @Excel(name = "小数位") + private Long decimalPlace; + + /** 是否为空 */ + @Excel(name = "是否为空") + private String nullNot; + + /** 默认值 */ + @Excel(name = "默认值") + private String defaultValue; + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setAnnotation(String annotation) + { + this.annotation = annotation; + } + + public String getAnnotation() + { + return annotation; + } + public void setKey(String key) + { + this.key = key; + } + + public String getKey() + { + return key; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setMappingType(String mappingType) + { + this.mappingType = mappingType; + } + + public String getMappingType() + { + return mappingType; + } + public void setLength(Long length) + { + this.length = length; + } + + public Long getLength() + { + return length; + } + public void setDecimalPlace(Long decimalPlace) + { + this.decimalPlace = decimalPlace; + } + + public Long getDecimalPlace() + { + return decimalPlace; + } + public void setNullNot(String nullNot) + { + this.nullNot = nullNot; + } + + public String getNullNot() + { + return nullNot; + } + public void setDefaultValue(String defaultValue) + { + this.defaultValue = defaultValue; + } + + public String getDefaultValue() + { + return defaultValue; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("name", getName()) + .append("annotation", getAnnotation()) + .append("key", getKey()) + .append("type", getType()) + .append("mappingType", getMappingType()) + .append("length", getLength()) + .append("decimalPlace", getDecimalPlace()) + .append("nullNot", getNullNot()) + .append("defaultValue", getDefaultValue()) + .toString(); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataAccess.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataAccess.java new file mode 100644 index 0000000..cbc7039 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataAccess.java @@ -0,0 +1,205 @@ +package com.muyu.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; + +/** + * 数据接入对象 data_access + * + * @author muyu + * @date 2024-04-21 + */ +public class DataAccess extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 接入源名称 */ + @Excel(name = "接入源名称") + private String name; + + /** 数据来源系统名称 */ + @Excel(name = "数据来源系统名称") + private String systemName; + + /** 数据接入类型 */ + @Excel(name = "数据接入类型") + private String type; + + /** 主机地址 */ + @Excel(name = "主机地址") + private String host; + + /** 端口号 */ + @Excel(name = "端口号") + private String port; + + /** 数据库名称 */ + @Excel(name = "数据库名称") + private String databaseName; + + /** 数据连接参数 */ + @Excel(name = "数据连接参数") + private String connectionParam; + + /** 初始连接数量 */ + @Excel(name = "初始连接数量") + private Integer initNum; + + /** 最大连接数量 */ + @Excel(name = "最大连接数量") + private Integer maxNum; + + /** 最大等待时间 */ + @Excel(name = "最大等待时间") + private Integer maxWaitTime; + + /** 最大等待次数 */ + @Excel(name = "最大等待次数") + private Integer maxWaitSize; + + /** 介绍 */ + @Excel(name = "介绍") + private String intor; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setSystemName(String systemName) + { + this.systemName = systemName; + } + + public String getSystemName() + { + return systemName; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setHost(String host) + { + this.host = host; + } + + public String getHost() + { + return host; + } + public void setPort(String port) + { + this.port = port; + } + + public String getPort() + { + return port; + } + public void setDatabaseName(String databaseName) + { + this.databaseName = databaseName; + } + + public String getDatabaseName() + { + return databaseName; + } + public void setConnectionParam(String connectionParam) + { + this.connectionParam = connectionParam; + } + + public String getConnectionParam() + { + return connectionParam; + } + public void setInitNum(Integer initNum) + { + this.initNum = initNum; + } + + public Integer getInitNum() + { + return initNum; + } + public void setMaxNum(Integer maxNum) + { + this.maxNum = maxNum; + } + + public Integer getMaxNum() + { + return maxNum; + } + public void setMaxWaitTime(Integer maxWaitTime) + { + this.maxWaitTime = maxWaitTime; + } + + public Integer getMaxWaitTime() + { + return maxWaitTime; + } + public void setMaxWaitSize(Integer maxWaitSize) + { + this.maxWaitSize = maxWaitSize; + } + + public Integer getMaxWaitSize() + { + return maxWaitSize; + } + public void setIntor(String intor) + { + this.intor = intor; + } + + public String getIntor() + { + return intor; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("systemName", getSystemName()) + .append("type", getType()) + .append("host", getHost()) + .append("port", getPort()) + .append("databaseName", getDatabaseName()) + .append("connectionParam", getConnectionParam()) + .append("initNum", getInitNum()) + .append("maxNum", getMaxNum()) + .append("maxWaitTime", getMaxWaitTime()) + .append("maxWaitSize", getMaxWaitSize()) + .append("intor", getIntor()) + .toString(); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataSource.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataSource.java new file mode 100644 index 0000000..2cd23e5 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/DataSource.java @@ -0,0 +1,195 @@ +package com.muyu.system.domain; + +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 获取信息对象 data_source + * + * @author muyu + * @date 2024-04-21 + */ +public class DataSource extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long id; + + /** 链接名 */ + @Excel(name = "链接名") + private String dataSourceName; + + /** 数据库来源系统名称 */ + @Excel(name = "数据库来源系统名称") + private String dataSourceSystemName; + + /** 数据库类型 */ + @Excel(name = "数据库类型") + private Long databaseType; + + /** ip地址 */ + @Excel(name = "ip地址") + private String ip; + + /** 端口号 */ + @Excel(name = "端口号") + private String port; + + /** 用户名 */ + @Excel(name = "用户名") + private String username; + + /** 密码 */ + @Excel(name = "密码") + private String password; + + /** 类型 '查询'/'存储' */ + @Excel(name = "类型 '查询'/'存储'") + private String type; + + /** ','拼接的连接参数 */ + @Excel(name = "','拼接的连接参数") + private String connectionParameter; + + /** ','拼接的连接配置 */ + @Excel(name = "','拼接的连接配置") + private String connectionConfig; + + /** 状态 'Y'/'N' */ + @Excel(name = "状态 'Y'/'N'") + private String status; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setDataSourceName(String dataSourceName) + { + this.dataSourceName = dataSourceName; + } + + public String getDataSourceName() + { + return dataSourceName; + } + public void setDataSourceSystemName(String dataSourceSystemName) + { + this.dataSourceSystemName = dataSourceSystemName; + } + + public String getDataSourceSystemName() + { + return dataSourceSystemName; + } + public void setDatabaseType(Long databaseType) + { + this.databaseType = databaseType; + } + + public Long getDatabaseType() + { + return databaseType; + } + public void setIp(String ip) + { + this.ip = ip; + } + + public String getIp() + { + return ip; + } + public void setPort(String port) + { + this.port = port; + } + + public String getPort() + { + return port; + } + public void setUsername(String username) + { + this.username = username; + } + + public String getUsername() + { + return username; + } + public void setPassword(String password) + { + this.password = password; + } + + public String getPassword() + { + return password; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setConnectionParameter(String connectionParameter) + { + this.connectionParameter = connectionParameter; + } + + public String getConnectionParameter() + { + return connectionParameter; + } + public void setConnectionConfig(String connectionConfig) + { + this.connectionConfig = connectionConfig; + } + + public String getConnectionConfig() + { + return connectionConfig; + } + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("dataSourceName", getDataSourceName()) + .append("dataSourceSystemName", getDataSourceSystemName()) + .append("databaseType", getDatabaseType()) + .append("ip", getIp()) + .append("port", getPort()) + .append("username", getUsername()) + .append("password", getPassword()) + .append("type", getType()) + .append("connectionParameter", getConnectionParameter()) + .append("connectionConfig", getConnectionConfig()) + .append("status", getStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Library.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Library.java new file mode 100644 index 0000000..b13ef68 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Library.java @@ -0,0 +1,13 @@ +package com.muyu.system.domain; + +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +public class Library { + private String name; + + public Library(String name) { + this.name = name; + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Middle.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Middle.java new file mode 100644 index 0000000..26b93cc --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/Middle.java @@ -0,0 +1,29 @@ +package com.muyu.system.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class Middle { + /** + * 主键 + */ + private Integer mid; + /** + * 接入主键 + */ + private Integer id; + /** + * 部门主键 + */ + private Integer deptId; + /** + * 权限 + */ + private Integer statusId; +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/TableName.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/TableName.java new file mode 100644 index 0000000..53419e2 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/TableName.java @@ -0,0 +1,8 @@ +package com.muyu.system.domain; + +import lombok.Data; + +@Data +public class TableName { + private String tableName; +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/DeptVO.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/DeptVO.java new file mode 100644 index 0000000..b111fb7 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/DeptVO.java @@ -0,0 +1,93 @@ +package com.muyu.system.domain.vo; + +import com.muyu.common.system.domain.SysDept; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +public class DeptVO { + /** + * 部门ID + */ + private Long deptId; + + /** + * 父部门ID + */ + private Long parentId; + + /** + * 祖级列表 + */ + private String ancestors; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 显示顺序 + */ + private Integer orderNum; + + /** + * 负责人 + */ + private String leader; + + /** + * 联系电话 + */ + private String phone; + + /** + * 邮箱 + */ + private String email; + + private Date createTime; + + /** + * 部门状态:0正常,1停用 + */ + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + /** + * 父部门名称 + */ + private String parentName; + + /** + * 子部门 + */ + private List children = new ArrayList(); + + /** + * 主键 + */ + private Integer mid; + /** + * 接入 + */ + private Integer id; + /** + * 权限 + */ + private Integer statusId; +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/SysUserVo.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/SysUserVo.java new file mode 100644 index 0000000..9e082d9 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/SysUserVo.java @@ -0,0 +1,143 @@ +package com.muyu.system.domain.vo; + +import com.muyu.common.core.annotation.Excel; +import com.muyu.common.core.annotation.Excel.ColumnType; +import com.muyu.common.core.annotation.Excel.Type; +import com.muyu.common.core.annotation.Excels; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.common.core.xss.Xss; +import com.muyu.common.system.domain.SysDept; +import com.muyu.common.system.domain.SysRole; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.util.Date; +import java.util.List; + +/** + * 用户对象 sys_user + * + * @author muyu + */ +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class SysUserVo extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") + private Long userId; + + /** + * 部门ID + */ + @Excel(name = "部门编号", type = Type.IMPORT) + private Long deptId; + + /** + * 用户账号 + */ + @Excel(name = "登录名称") + private String userName; + + /** + * 用户昵称 + */ + @Excel(name = "用户名称") + private String nickName; + + /** + * 用户邮箱 + */ + @Excel(name = "用户邮箱") + private String email; + + /** + * 手机号码 + */ + @Excel(name = "手机号码") + private String phonenumber; + + /** + * 用户性别 + */ + @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") + private String sex; + + /** + * 用户头像 + */ + private String avatar; + + /** + * 密码 + */ + private String password; + + /** + * 帐号状态(0正常 1停用) + */ + @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + private String status; + + /** + * 删除标志(0代表存在 2代表删除) + */ + private String delFlag; + + /** + * 最后登录IP + */ + @Excel(name = "最后登录IP", type = Type.EXPORT) + private String loginIp; + + /** + * 最后登录时间 + */ + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) + private Date loginDate; + + /** + * 部门对象 + */ + @Excels({ + @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), + @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) + }) + private SysDept dept; + + /** + * 角色对象 + */ + private List roles; + + /** + * 角色组 + */ + private Long[] roleIds; + + /** + * 岗位组 + */ + private Long[] postIds; + + /** + * 角色ID + */ + private Long roleId; + + private String DeptName; +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/TableVo.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/TableVo.java new file mode 100644 index 0000000..0986056 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/domain/vo/TableVo.java @@ -0,0 +1,91 @@ +package com.muyu.system.domain.vo; + +import lombok.Data; + +@Data +public class TableVo { + /** + * 表目录 + */ + private String tableCatalog; + /** + *表模式 + */ + private String tableSchema; + /** + *表名 + */ + private String TableName; + /** + *列名 + */ + private String columnName; + /** + *序号位置 + */ + private String ordinalPosition; + /** + *列默认 + */ + private String columnDefault; + /** + *是否为空 + */ + private String isNullable; + /** + *类型 + */ + private String dateType; + /** + *字符最大长度 + */ + private String characterMaximumLength; + /** + *字符八位长度 + */ + private String characterOctetLength; + /** + *数值精度 + */ + private String numericPrecision; + /** + *数值范围 + */ + private String numericScale; + /** + *精度 + */ + private String datetimePrecision; + /** + *字符集名称 + */ + private String characterSetName; + /** + * + */ + private String collationName; + /** + *排序规则名 + */ + private String columnType; + /** + *列键 + */ + private String columnKey; + /** + *额外的 + */ + private String extra; + /** + *特权 + */ + private String privileges; + /** + *备注 + */ + private String columnComment; + /** + *表达式 + */ + private String generationExpressio; +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AccreditMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AccreditMapper.java new file mode 100644 index 0000000..e9bc43e --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AccreditMapper.java @@ -0,0 +1,23 @@ +package com.muyu.system.mapper; + +import com.muyu.system.domain.Library; +import com.muyu.system.domain.TableName; +import com.muyu.system.domain.vo.TableVo; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface AccreditMapper { + List tableNameList(); + + + String database(); + + List selectTableXml(@Param("database") String database, @Param("tableName") String tableName); + + List tableNameList2(); + + int getNameSelTable(@Param("s") String s); + + void indexTableName(@Param("s") String s); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AssetModelMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AssetModelMapper.java new file mode 100644 index 0000000..2db5732 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/AssetModelMapper.java @@ -0,0 +1,72 @@ +package com.muyu.system.mapper; + +import java.util.List; +import com.muyu.system.domain.AssetModel; +import com.muyu.system.domain.Library; +import com.muyu.system.domain.vo.TableVo; +import org.apache.ibatis.annotations.Param; + +/** + * 资产详情Mapper接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface AssetModelMapper +{ + /** + * 查询资产详情 + * + * @param annotation 资产详情主键 + * @return 资产详情 + */ + public AssetModel selectAssetModelByAnnotation(String annotation); + + /** + * 查询资产详情列表 + * + * @param assetModel 资产详情 + * @return 资产详情集合 + */ + public List selectAssetModelList(AssetModel assetModel); + + /** + * 新增资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + public int insertAssetModel(AssetModel assetModel); + + /** + * 修改资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + public int updateAssetModel(AssetModel assetModel); + + /** + * 删除资产详情 + * + * @param annotation 资产详情主键 + * @return 结果 + */ + public int deleteAssetModelByAnnotation(String annotation); + + /** + * 批量删除资产详情 + * + * @param annotations 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAssetModelByAnnotations(String[] annotations); + + List library(); + + String database(); + + List selectTable(@Param("database") String database, @Param("libraryName") String libraryName); + + List library2(); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataAccessMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataAccessMapper.java new file mode 100644 index 0000000..bba8170 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataAccessMapper.java @@ -0,0 +1,66 @@ +package com.muyu.system.mapper; + +import java.util.List; +import com.muyu.system.domain.DataAccess; +import org.apache.ibatis.annotations.Param; + +/** + * 数据接入Mapper接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface DataAccessMapper +{ + /** + * 查询数据接入 + * + * @param id 数据接入主键 + * @return 数据接入 + */ + public DataAccess selectDataAccessById(Long id); + + /** + * 查询数据接入列表 + * + * @param dataAccess 数据接入 + * @return 数据接入集合 + */ + public List selectDataAccessList(DataAccess dataAccess); + + /** + * 新增数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + public int insertDataAccess(DataAccess dataAccess); + + /** + * 修改数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + public int updateDataAccess(DataAccess dataAccess); + + /** + * 删除数据接入 + * + * @param id 数据接入主键 + * @return 结果 + */ + public int deleteDataAccessById(Long id); + + /** + * 批量删除数据接入 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDataAccessByIds(Long[] ids); + + DataAccess oneDataAccess(); + + void insertMiddle(@Param("deptId") Long deptId, @Param("id") Long id); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataSourceMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataSourceMapper.java new file mode 100644 index 0000000..030ed96 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/DataSourceMapper.java @@ -0,0 +1,62 @@ +package com.muyu.system.mapper; + +import com.muyu.system.domain.DataSource; + +import java.util.List; + +/** + * 获取信息Mapper接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface DataSourceMapper +{ + /** + * 查询获取信息 + * + * @param id 获取信息主键 + * @return 获取信息 + */ + public DataSource selectDataSourceById(Long id); + + /** + * 查询获取信息列表 + * + * @param dataSource 获取信息 + * @return 获取信息集合 + */ + public List selectDataSourceList(DataSource dataSource); + + /** + * 新增获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + public int insertDataSource(DataSource dataSource); + + /** + * 修改获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + public int updateDataSource(DataSource dataSource); + + /** + * 删除获取信息 + * + * @param id 获取信息主键 + * @return 结果 + */ + public int deleteDataSourceById(Long id); + + /** + * 批量删除获取信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDataSourceByIds(Long[] ids); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysDeptMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysDeptMapper.java index 5ef9ab4..67f3d95 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysDeptMapper.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysDeptMapper.java @@ -2,6 +2,7 @@ package com.muyu.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.common.system.domain.SysDept; +import com.muyu.system.domain.vo.DeptVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -128,4 +129,8 @@ public interface SysDeptMapper extends BaseMapper { * @return 结果 */ public int deleteDeptById (Long deptId); + + List listDeptList(); + + List selectDeptListVo(); } diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysUserMapper.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysUserMapper.java index e037b34..5325e25 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysUserMapper.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/mapper/SysUserMapper.java @@ -2,6 +2,7 @@ package com.muyu.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.muyu.common.system.domain.SysUser; +import com.muyu.system.domain.vo.SysUserVo; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -139,4 +140,6 @@ public interface SysUserMapper extends BaseMapper { * @return 结果 */ public SysUser checkEmailUnique (String email); + + List listSelectSysUser(); } diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/AccreditService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/AccreditService.java new file mode 100644 index 0000000..f745619 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/AccreditService.java @@ -0,0 +1,18 @@ +package com.muyu.system.service; + +import com.muyu.common.core.domain.Result; +import com.muyu.system.domain.Library; +import com.muyu.system.domain.TableName; +import com.muyu.system.domain.vo.TableVo; + +import java.util.List; + +public interface AccreditService { + List tableNameList(); + + List selectTableXml(String tableName); + + List tableNameList2(); + + Result listSqlJdbc(); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IAssetModelService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IAssetModelService.java new file mode 100644 index 0000000..abec185 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IAssetModelService.java @@ -0,0 +1,67 @@ +package com.muyu.system.service; + +import java.util.List; +import com.muyu.system.domain.AssetModel; +import com.muyu.system.domain.Library; +import com.muyu.system.domain.vo.TableVo; + +/** + * 资产详情Service接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface IAssetModelService +{ + /** + * 查询资产详情 + * + * @param annotation 资产详情主键 + * @return 资产详情 + */ + public AssetModel selectAssetModelByAnnotation(String annotation); + + /** + * 查询资产详情列表 + * + * @param assetModel 资产详情 + * @return 资产详情集合 + */ + public List selectAssetModelList(AssetModel assetModel); + + /** + * 新增资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + public int insertAssetModel(AssetModel assetModel); + + /** + * 修改资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + public int updateAssetModel(AssetModel assetModel); + + /** + * 批量删除资产详情 + * + * @param annotations 需要删除的资产详情主键集合 + * @return 结果 + */ + public int deleteAssetModelByAnnotations(String[] annotations); + + /** + * 删除资产详情信息 + * + * @param annotation 资产详情主键 + * @return 结果 + */ + public int deleteAssetModelByAnnotation(String annotation); + + List library(); + + List selectTable(String libraryName); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataAccessService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataAccessService.java new file mode 100644 index 0000000..4c8ef93 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataAccessService.java @@ -0,0 +1,61 @@ +package com.muyu.system.service; + +import java.util.List; +import com.muyu.system.domain.DataAccess; + +/** + * 数据接入Service接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface IDataAccessService +{ + /** + * 查询数据接入 + * + * @param id 数据接入主键 + * @return 数据接入 + */ + public DataAccess selectDataAccessById(Long id); + + /** + * 查询数据接入列表 + * + * @param dataAccess 数据接入 + * @return 数据接入集合 + */ + public List selectDataAccessList(DataAccess dataAccess); + + /** + * 新增数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + public int insertDataAccess(DataAccess dataAccess); + + /** + * 修改数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + public int updateDataAccess(DataAccess dataAccess); + + /** + * 批量删除数据接入 + * + * @param ids 需要删除的数据接入主键集合 + * @return 结果 + */ + public int deleteDataAccessByIds(Long[] ids); + + /** + * 删除数据接入信息 + * + * @param id 数据接入主键 + * @return 结果 + */ + public int deleteDataAccessById(Long id); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataSourceService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataSourceService.java new file mode 100644 index 0000000..d2325c0 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/IDataSourceService.java @@ -0,0 +1,62 @@ +package com.muyu.system.service; + +import com.muyu.system.domain.DataSource; + +import java.util.List; + +/** + * 获取信息Service接口 + * + * @author muyu + * @date 2024-04-21 + */ +public interface IDataSourceService +{ + /** + * 查询获取信息 + * + * @param id 获取信息主键 + * @return 获取信息 + */ + public DataSource selectDataSourceById(Long id); + + /** + * 查询获取信息列表 + * + * @param dataSource 获取信息 + * @return 获取信息集合 + */ + public List selectDataSourceList(DataSource dataSource); + + /** + * 新增获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + public int insertDataSource(DataSource dataSource); + + /** + * 修改获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + public int updateDataSource(DataSource dataSource); + + /** + * 批量删除获取信息 + * + * @param ids 需要删除的获取信息主键集合 + * @return 结果 + */ + public int deleteDataSourceByIds(Long[] ids); + + /** + * 删除获取信息信息 + * + * @param id 获取信息主键 + * @return 结果 + */ + public int deleteDataSourceById(Long id); +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysDeptService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysDeptService.java index 140cf91..1786350 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysDeptService.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysDeptService.java @@ -2,6 +2,7 @@ package com.muyu.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.common.system.domain.SysDept; +import com.muyu.system.domain.vo.DeptVO; import com.muyu.system.domain.vo.TreeSelect; import java.util.List; @@ -135,4 +136,12 @@ public interface SysDeptService extends IService { * @return 结果 */ public int deleteDeptById (Long deptId); + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * + * @return 部门信息集合 + */ + List selectDeptListVo(); } diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysUserService.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysUserService.java index f4c6167..bd2cdbb 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysUserService.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/SysUserService.java @@ -2,6 +2,7 @@ package com.muyu.system.service; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.common.system.domain.SysUser; +import com.muyu.system.domain.vo.SysUserVo; import java.util.List; @@ -225,4 +226,6 @@ public interface SysUserService extends IService { * @return 结果 */ public String importUser (List userList, Boolean isUpdateSupport, String operName); + + List listSelectSysUser(); } diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AccreditServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AccreditServiceImpl.java new file mode 100644 index 0000000..da3909e --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AccreditServiceImpl.java @@ -0,0 +1,50 @@ +package com.muyu.system.service.impl; + +import com.muyu.common.core.domain.Result; +import com.muyu.system.domain.Library; +import com.muyu.system.domain.TableName; +import com.muyu.system.domain.vo.TableVo; +import com.muyu.system.mapper.AccreditMapper; +import com.muyu.system.service.AccreditService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class AccreditServiceImpl implements AccreditService { + @Autowired + private AccreditMapper mapper; + @Override + public List tableNameList() { + List list = mapper.tableNameList(); + System.out.println(list); + return list; + } + + @Override + public List selectTableXml(String tableName) { + String database = mapper.database(); + List list = mapper.selectTableXml(database,tableName); + System.out.println(list); + return list; + } + + @Override + public List tableNameList2() { + List list = mapper.tableNameList2(); + for (String s : list) { + if (mapper.getNameSelTable(s)>1){ + }else{ + mapper.indexTableName(s); + } + } + return list; + } + + @Override + public Result listSqlJdbc() { + + return null; + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AssetModelServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AssetModelServiceImpl.java new file mode 100644 index 0000000..88e6642 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/AssetModelServiceImpl.java @@ -0,0 +1,112 @@ +package com.muyu.system.service.impl; + +import java.util.ArrayList; +import java.util.List; + +import com.muyu.system.domain.Library; +import com.muyu.system.domain.vo.TableVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.muyu.system.mapper.AssetModelMapper; +import com.muyu.system.domain.AssetModel; +import com.muyu.system.service.IAssetModelService; + +/** + * 资产详情Service业务层处理 + * + * @author muyu + * @date 2024-04-21 + */ +@Service +public class AssetModelServiceImpl implements IAssetModelService +{ + @Autowired + private AssetModelMapper assetModelMapper; + + /** + * 查询资产详情 + * + * @param annotation 资产详情主键 + * @return 资产详情 + */ + @Override + public AssetModel selectAssetModelByAnnotation(String annotation) + { + return assetModelMapper.selectAssetModelByAnnotation(annotation); + } + + /** + * 查询资产详情列表 + * + * @param assetModel 资产详情 + * @return 资产详情 + */ + @Override + public List selectAssetModelList(AssetModel assetModel) + { + return assetModelMapper.selectAssetModelList(assetModel); + } + + /** + * 新增资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + @Override + public int insertAssetModel(AssetModel assetModel) + { + return assetModelMapper.insertAssetModel(assetModel); + } + + /** + * 修改资产详情 + * + * @param assetModel 资产详情 + * @return 结果 + */ + @Override + public int updateAssetModel(AssetModel assetModel) + { + return assetModelMapper.updateAssetModel(assetModel); + } + + /** + * 批量删除资产详情 + * + * @param annotations 需要删除的资产详情主键 + * @return 结果 + */ + @Override + public int deleteAssetModelByAnnotations(String[] annotations) + { + return assetModelMapper.deleteAssetModelByAnnotations(annotations); + } + + /** + * 删除资产详情信息 + * + * @param annotation 资产详情主键 + * @return 结果 + */ + @Override + public int deleteAssetModelByAnnotation(String annotation) + { + return assetModelMapper.deleteAssetModelByAnnotation(annotation); + } + + @Override + public List library() { + List list2 = assetModelMapper.library2(); + System.out.println(list2); + return list2; + } + + @Override + public List selectTable(String libraryName) { + String database = assetModelMapper.database(); + List list = assetModelMapper.selectTable(database,libraryName); + System.out.println(list); + return list; + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataAccessServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataAccessServiceImpl.java new file mode 100644 index 0000000..564dab1 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataAccessServiceImpl.java @@ -0,0 +1,104 @@ +package com.muyu.system.service.impl; + +import java.util.List; + +import com.muyu.common.system.domain.SysDept; +import com.muyu.system.mapper.SysDeptMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.muyu.system.mapper.DataAccessMapper; +import com.muyu.system.domain.DataAccess; +import com.muyu.system.service.IDataAccessService; + +/** + * 数据接入Service业务层处理 + * + * @author muyu + * @date 2024-04-21 + */ +@Service +public class DataAccessServiceImpl implements IDataAccessService +{ + @Autowired + private DataAccessMapper dataAccessMapper; + @Autowired + private SysDeptMapper sysDeptMapper; + + /** + * 查询数据接入 + * + * @param id 数据接入主键 + * @return 数据接入 + */ + @Override + public DataAccess selectDataAccessById(Long id) + { + return dataAccessMapper.selectDataAccessById(id); + } + + /** + * 查询数据接入列表 + * + * @param dataAccess 数据接入 + * @return 数据接入 + */ + @Override + public List selectDataAccessList(DataAccess dataAccess) + { + return dataAccessMapper.selectDataAccessList(dataAccess); + } + + /** + * 新增数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + @Override + public int insertDataAccess(DataAccess dataAccess) + { + int i = dataAccessMapper.insertDataAccess(dataAccess); + List list = sysDeptMapper.listDeptList(); + DataAccess dataAccess1 = dataAccessMapper.oneDataAccess(); + for (SysDept sysDept : list) { + dataAccessMapper.insertMiddle(sysDept.getDeptId(),dataAccess1.getId()); + } + return i; + } + + /** + * 修改数据接入 + * + * @param dataAccess 数据接入 + * @return 结果 + */ + @Override + public int updateDataAccess(DataAccess dataAccess) + { + return dataAccessMapper.updateDataAccess(dataAccess); + } + + /** + * 批量删除数据接入 + * + * @param ids 需要删除的数据接入主键 + * @return 结果 + */ + @Override + public int deleteDataAccessByIds(Long[] ids) + { + return dataAccessMapper.deleteDataAccessByIds(ids); + } + + /** + * 删除数据接入信息 + * + * @param id 数据接入主键 + * @return 结果 + */ + @Override + public int deleteDataAccessById(Long id) + { + return dataAccessMapper.deleteDataAccessById(id); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataSourceServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataSourceServiceImpl.java new file mode 100644 index 0000000..c792b0a --- /dev/null +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/DataSourceServiceImpl.java @@ -0,0 +1,97 @@ +package com.muyu.system.service.impl; + +import com.muyu.common.core.utils.DateUtils; +import com.muyu.system.domain.DataSource; +import com.muyu.system.mapper.DataSourceMapper; +import com.muyu.system.service.IDataSourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 获取信息Service业务层处理 + * + * @author muyu + * @date 2024-04-21 + */ +@Service +public class DataSourceServiceImpl implements IDataSourceService +{ + @Autowired + private DataSourceMapper dataSourceMapper; + + /** + * 查询获取信息 + * + * @param id 获取信息主键 + * @return 获取信息 + */ + @Override + public DataSource selectDataSourceById(Long id) + { + return dataSourceMapper.selectDataSourceById(id); + } + + /** + * 查询获取信息列表 + * + * @param dataSource 获取信息 + * @return 获取信息 + */ + @Override + public List selectDataSourceList(DataSource dataSource) + { + return dataSourceMapper.selectDataSourceList(dataSource); + } + + /** + * 新增获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + @Override + public int insertDataSource(DataSource dataSource) + { + dataSource.setCreateTime(DateUtils.getNowDate()); + return dataSourceMapper.insertDataSource(dataSource); + } + + /** + * 修改获取信息 + * + * @param dataSource 获取信息 + * @return 结果 + */ + @Override + public int updateDataSource(DataSource dataSource) + { + dataSource.setUpdateTime(DateUtils.getNowDate()); + return dataSourceMapper.updateDataSource(dataSource); + } + + /** + * 批量删除获取信息 + * + * @param ids 需要删除的获取信息主键 + * @return 结果 + */ + @Override + public int deleteDataSourceByIds(Long[] ids) + { + return dataSourceMapper.deleteDataSourceByIds(ids); + } + + /** + * 删除获取信息信息 + * + * @param id 获取信息主键 + * @return 结果 + */ + @Override + public int deleteDataSourceById(Long id) + { + return dataSourceMapper.deleteDataSourceById(id); + } +} diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysDeptServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysDeptServiceImpl.java index a55301b..d5c0d92 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysDeptServiceImpl.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysDeptServiceImpl.java @@ -11,6 +11,7 @@ import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.system.domain.SysDept; import com.muyu.common.system.domain.SysRole; import com.muyu.common.system.domain.SysUser; +import com.muyu.system.domain.vo.DeptVO; import com.muyu.system.domain.vo.TreeSelect; import com.muyu.system.mapper.SysDeptMapper; import com.muyu.system.mapper.SysRoleMapper; @@ -279,6 +280,17 @@ public class SysDeptServiceImpl extends ServiceImpl impl public int deleteDeptById (Long deptId) { return deptMapper.deleteDeptById(deptId); } + /** + * 查询部门管理数据 + * + * @param dept 部门信息 + * + * @return 部门信息集合 + */ + @Override + public List selectDeptListVo() { + return deptMapper.selectDeptListVo(); + } /** * 递归列表 diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysUserServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysUserServiceImpl.java index ab88e1c..f499f8c 100644 --- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysUserServiceImpl.java +++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/SysUserServiceImpl.java @@ -13,6 +13,7 @@ import com.muyu.common.system.domain.SysUser; import com.muyu.system.domain.SysPost; import com.muyu.system.domain.SysUserPost; import com.muyu.system.domain.SysUserRole; +import com.muyu.system.domain.vo.SysUserVo; import com.muyu.system.mapper.*; import com.muyu.system.service.SysUserService; import com.muyu.system.service.SysConfigService; @@ -500,4 +501,10 @@ public class SysUserServiceImpl extends ServiceImpl impl return successMsg.toString(); } + @Override + public List listSelectSysUser() { + return userMapper.listSelectSysUser(); + } + + } diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/AccreditMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/AccreditMapper.xml new file mode 100644 index 0000000..58e2a59 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/AccreditMapper.xml @@ -0,0 +1,30 @@ + + + + + insert into table_name (table_name) + values (#{s}); + + + + + + + + diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/AssetModelMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/AssetModelMapper.xml new file mode 100644 index 0000000..2328a6e --- /dev/null +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/AssetModelMapper.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + select name, annotation, key, type, mapping_type, length, decimal_place, null_not, default_value from asset_model + + + + + + + + + + + + + insert into asset_model + + name, + annotation, + key, + type, + mapping_type, + length, + decimal_place, + null_not, + default_value, + + + #{name}, + #{annotation}, + #{key}, + #{type}, + #{mappingType}, + #{length}, + #{decimalPlace}, + #{nullNot}, + #{defaultValue}, + + + + + update asset_model + + name = #{name}, + key = #{key}, + type = #{type}, + mapping_type = #{mappingType}, + length = #{length}, + decimal_place = #{decimalPlace}, + null_not = #{nullNot}, + default_value = #{defaultValue}, + + where annotation = #{annotation} + + + + delete from asset_model where annotation = #{annotation} + + + + delete from asset_model where annotation in + + #{annotation} + + + diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/DataAccessMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/DataAccessMapper.xml new file mode 100644 index 0000000..e50dd24 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/DataAccessMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + select id, name, systemName, type, host, port, databaseName, connectionParam, initNum, maxNum, maxWaitTime, maxWaitSize, intor from data_access + + + + + + + + + insert into data_access + + name, + systemName, + type, + host, + port, + databaseName, + connectionParam, + initNum, + maxNum, + maxWaitTime, + maxWaitSize, + intor, + + + #{name}, + #{systemName}, + #{type}, + #{host}, + #{port}, + #{databaseName}, + #{connectionParam}, + #{initNum}, + #{maxNum}, + #{maxWaitTime}, + #{maxWaitSize}, + #{intor}, + + + + insert into middle (id,dept_id,status_id) + values (#{id},#{deptId},0); + + + + update data_access + + name = #{name}, + systemName = #{systemName}, + type = #{type}, + host = #{host}, + port = #{port}, + databaseName = #{databaseName}, + connectionParam = #{connectionParam}, + initNum = #{initNum}, + maxNum = #{maxNum}, + maxWaitTime = #{maxWaitTime}, + maxWaitSize = #{maxWaitSize}, + intor = #{intor}, + + where id = #{id} + + + + delete from data_access where id = #{id} + + + + delete from data_access where id in + + #{id} + + + diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/DataSourceMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/DataSourceMapper.xml new file mode 100644 index 0000000..fa69085 --- /dev/null +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/DataSourceMapper.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, data_source_name, data_source_system_name, database_type, ip, port, username, password, type, connection_parameter, connection_config, status, create_by, create_time, update_by, update_time from data_source + + + + + + + + insert into data_source + + data_source_name, + data_source_system_name, + database_type, + ip, + port, + username, + password, + type, + connection_parameter, + connection_config, + status, + create_by, + create_time, + update_by, + update_time, + + + #{dataSourceName}, + #{dataSourceSystemName}, + #{databaseType}, + #{ip}, + #{port}, + #{username}, + #{password}, + #{type}, + #{connectionParameter}, + #{connectionConfig}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update data_source + + data_source_name = #{dataSourceName}, + data_source_system_name = #{dataSourceSystemName}, + database_type = #{databaseType}, + ip = #{ip}, + port = #{port}, + username = #{username}, + password = #{password}, + type = #{type}, + connection_parameter = #{connectionParameter}, + connection_config = #{connectionConfig}, + status = #{status}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from data_source where id = #{id} + + + + delete from data_source where id in + + #{id} + + + diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/SysDeptMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/SysDeptMapper.xml index a571d8b..13a4fb8 100644 --- a/muyu-modules/muyu-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -38,6 +38,25 @@ from sys_dept d + + select d.dept_id, + d.parent_id, + d.ancestors, + d.dept_name, + d.order_num, + d.leader, + d.phone, + d.email, + d.status, + d.del_flag, + d.create_by, + d.create_time, + m.mid, + m.id, + m.status_id + from sys_dept d left join middle m on d.dept_id = m.dept_id + + + + insert into sys_dept( diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/SysUserMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/SysUserMapper.xml index 6f633b7..40be588 100644 --- a/muyu-modules/muyu-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -81,6 +81,27 @@ left join sys_user_role ur on u.user_id = ur.user_id left join sys_role r on r.role_id = ur.role_id + + select u.user_id, + u.dept_id, + u.user_name, + u.nick_name, + u.email, + u.avatar, + u.phonenumber, + u.password, + u.sex, + u.status, + u.del_flag, + u.login_ip, + u.login_date, + u.create_by, + u.create_time, + u.remark, + d.dept_name + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + + insert into sys_user( diff --git a/muyu-modules/pom.xml b/muyu-modules/pom.xml index 846198c..dde9c19 100644 --- a/muyu-modules/pom.xml +++ b/muyu-modules/pom.xml @@ -13,6 +13,7 @@ muyu-gen muyu-job muyu-file + muyu-goods muyu-modules