Compare commits
10 Commits
a8bd6bd1bb
...
6b69b29567
Author | SHA1 | Date |
---|---|---|
|
6b69b29567 | |
|
b92a8cef22 | |
|
fa6963552a | |
|
a098a62a6b | |
|
cf644531f8 | |
|
0960b70277 | |
|
ba27959f19 | |
|
69e70e451b | |
|
7f0e928cd5 | |
|
0689fdb194 |
|
@ -84,11 +84,24 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 是否授权
|
||||
*/
|
||||
private Boolean isAuth=false;
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
public Boolean getAuth() {
|
||||
return isAuth;
|
||||
}
|
||||
|
||||
public void setAuth(Boolean auth) {
|
||||
isAuth = auth;
|
||||
}
|
||||
|
||||
public Long getDeptId () {
|
||||
return deptId;
|
||||
}
|
||||
|
|
|
@ -96,6 +96,11 @@ public class SysUser extends BaseEntity {
|
|||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 是否授权
|
||||
*/
|
||||
private Boolean isAuth = false;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
|
@ -122,6 +127,8 @@ public class SysUser extends BaseEntity {
|
|||
*/
|
||||
private List<SysRole> roles;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 角色组
|
||||
*/
|
||||
|
@ -137,6 +144,14 @@ public class SysUser extends BaseEntity {
|
|||
*/
|
||||
private Long roleId;
|
||||
|
||||
public Boolean getAuth() {
|
||||
return isAuth;
|
||||
}
|
||||
|
||||
public void setAuth(Boolean auth) {
|
||||
isAuth = auth;
|
||||
}
|
||||
|
||||
public SysUser (Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
|
|
@ -3,12 +3,15 @@ package com.muyu.common.system.remote;
|
|||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
*
|
||||
|
@ -16,6 +19,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
*/
|
||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||
public interface RemoteUserService {
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
@PostMapping("/user/UserList")
|
||||
public Result<List<SysUser>> userList (@RequestBody SysUser user);
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
|
@ -9,6 +10,8 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
*
|
||||
|
@ -22,6 +25,13 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
|||
public RemoteUserService create (Throwable throwable) {
|
||||
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteUserService() {
|
||||
|
||||
|
||||
@Override
|
||||
public Result<List<SysUser>> userList(SysUser user) {
|
||||
return Result.error("获取用户列表失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<LoginUser> getUserInfo (String username, String source) {
|
||||
return Result.error("获取用户失败:" + throwable.getMessage());
|
||||
|
|
|
@ -18,6 +18,16 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules-system</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<!-- PostgreSQL JDBC驱动 -->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
|
|
|
@ -5,6 +5,7 @@ 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.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
package com.muyu.etl.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
import com.muyu.etl.domain.req.SourceAccreditReq;
|
||||
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.etl.domain.AssetAccredit;
|
||||
import com.muyu.etl.service.IAssetAccreditService;
|
||||
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 ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/assetAccredit")
|
||||
public class AssetAccreditController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAssetAccreditService assetAccreditService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<AssetAccredit>> list(AssetAccredit assetAccredit)
|
||||
{
|
||||
startPage();
|
||||
List<AssetAccredit> list = assetAccreditService.selectAssetAccreditList(assetAccredit);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AssetAccredit assetAccredit)
|
||||
{
|
||||
List<AssetAccredit> list = assetAccreditService.selectAssetAccreditList(assetAccredit);
|
||||
ExcelUtil<AssetAccredit> util = new ExcelUtil<AssetAccredit>(AssetAccredit.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(assetAccreditService.selectAssetAccreditById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据表id获取授权信息
|
||||
*/
|
||||
@GetMapping(value = "/GetAssetAccreditByDataAssetId")
|
||||
public Result getAssetAccreditByDataAssetId(@RequestParam("id") Long id)
|
||||
{
|
||||
return assetAccreditService.getAssetAccreditByDataAssetId(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody AssetAccreditReq assetAccreditReq)
|
||||
{
|
||||
return assetAccreditService.insertAssetAccredit(assetAccreditReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权删除
|
||||
*/
|
||||
@Log(title = "授权删除", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/DeleteAssetAccreditByAssetIds")
|
||||
public Result deleteSourceAccreditBySourceIds(@RequestBody AssetAccreditReq assetAccreditReq)
|
||||
{
|
||||
return assetAccreditService.deleteAssetAccreditByAssetIds(assetAccreditReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody AssetAccredit assetAccredit)
|
||||
{
|
||||
return toAjax(assetAccreditService.updateAssetAccredit(assetAccredit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(assetAccreditService.deleteAssetAccreditByIds(ids));
|
||||
}
|
||||
}
|
|
@ -80,7 +80,7 @@ public class AssetModelController extends BaseController
|
|||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@PostMapping("/UpdateAssetModel")
|
||||
public Result edit(@RequestBody AssetModel assetModel)
|
||||
{
|
||||
return toAjax(assetModelService.updateAssetModel(assetModel));
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.muyu.common.core.utils.poi.ExcelUtil;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
* 数据接入Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-20
|
||||
|
@ -37,7 +37,7 @@ public class DataSourceController extends BaseController
|
|||
private IDataSourceService dataSourceService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询数据接入列表
|
||||
*/
|
||||
@RequiresPermissions("system:source:list")
|
||||
@GetMapping("/list")
|
||||
|
@ -48,24 +48,36 @@ public class DataSourceController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
//获取数据源中表的数据(KVT结构)
|
||||
@PostMapping("/AssetsList")
|
||||
public Result assetsList(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.assetsList(dataSource);
|
||||
}
|
||||
|
||||
|
||||
//数据接入同步资产结构
|
||||
@PostMapping("/SynchronousData")
|
||||
public Result synchronousData(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.synchronousData(dataSource);
|
||||
}
|
||||
|
||||
//根据数据接入信息获取资产表列表信息
|
||||
@PostMapping("/DataAssetList")
|
||||
public Result dataAssetList(@RequestBody DataSource dataSource)
|
||||
{
|
||||
return dataSourceService.dataAssetList(dataSource);
|
||||
}
|
||||
|
||||
//统计选中数据接入的数据(数据接入量 数据接入表中字段量 数据接入表中数据量)
|
||||
@GetMapping("/Statistics")
|
||||
public Result statistics(){
|
||||
return dataSourceService.statistics();
|
||||
}
|
||||
|
||||
//根据数据表信息获取资产模型字段列表信息
|
||||
@PostMapping("/AssetModelList")
|
||||
public Result assetModelList(@RequestBody DataAsset dataAsset)
|
||||
{
|
||||
|
@ -98,7 +110,7 @@ public class DataSourceController extends BaseController
|
|||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dataSourceService.selectDataSourceById(id));
|
||||
return Result.success(dataSourceService.selectDataSourceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package com.muyu.etl.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.etl.domain.Dictionary;
|
||||
import com.muyu.etl.service.IDictionaryService;
|
||||
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 ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dictionary")
|
||||
public class DictionaryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDictionaryService dictionaryService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<Dictionary>> list(Dictionary dictionary)
|
||||
{
|
||||
startPage();
|
||||
List<Dictionary> list = dictionaryService.selectDictionaryList(dictionary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Dictionary dictionary)
|
||||
{
|
||||
List<Dictionary> list = dictionaryService.selectDictionaryList(dictionary);
|
||||
ExcelUtil<Dictionary> util = new ExcelUtil<Dictionary>(Dictionary.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dictionaryService.selectDictionaryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据源id获取字典详细信息
|
||||
*/
|
||||
@GetMapping(value = "/GetDictionaryList")
|
||||
public Result getDictionaryList(@RequestParam("dataSourceId") Long dataSourceId){
|
||||
return dictionaryService.getDictionaryList(dataSourceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key删除字典详细信息
|
||||
*/
|
||||
@GetMapping(value = "/DeleteDictionary")
|
||||
public Result deleteDictionary(@RequestParam("id") Long id){
|
||||
return dictionaryService.deleteDictionary(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody Dictionary dictionary)
|
||||
{
|
||||
return toAjax(dictionaryService.insertDictionary(dictionary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody Dictionary dictionary)
|
||||
{
|
||||
return toAjax(dictionaryService.updateDictionary(dictionary));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dictionaryService.deleteDictionaryByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.muyu.etl.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.etl.domain.DictionaryData;
|
||||
import com.muyu.etl.service.IDictionaryDataService;
|
||||
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 ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/data")
|
||||
public class DictionaryDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDictionaryDataService dictionaryDataService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<DictionaryData>> list(DictionaryData dictionaryData)
|
||||
{
|
||||
startPage();
|
||||
List<DictionaryData> list = dictionaryDataService.selectDictionaryDataList(dictionaryData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DictionaryData dictionaryData)
|
||||
{
|
||||
List<DictionaryData> list = dictionaryDataService.selectDictionaryDataList(dictionaryData);
|
||||
ExcelUtil<DictionaryData> util = new ExcelUtil<DictionaryData>(DictionaryData.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(dictionaryDataService.selectDictionaryDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody DictionaryData dictionaryData)
|
||||
{
|
||||
return toAjax(dictionaryDataService.insertDictionaryData(dictionaryData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody DictionaryData dictionaryData)
|
||||
{
|
||||
return toAjax(dictionaryDataService.updateDictionaryData(dictionaryData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(dictionaryDataService.deleteDictionaryDataByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.muyu.etl.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.etl.domain.req.SourceAccreditReq;
|
||||
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.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.service.ISourceAccreditService;
|
||||
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 ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sourceAccredit")
|
||||
public class SourceAccreditController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISourceAccreditService sourceAccreditService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SourceAccredit>> list(SourceAccredit sourceAccredit)
|
||||
{
|
||||
startPage();
|
||||
List<SourceAccredit> list = sourceAccreditService.selectSourceAccreditList(sourceAccredit);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:export")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SourceAccredit sourceAccredit)
|
||||
{
|
||||
List<SourceAccredit> list = sourceAccreditService.selectSourceAccreditList(sourceAccredit);
|
||||
ExcelUtil<SourceAccredit> util = new ExcelUtil<SourceAccredit>(SourceAccredit.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sourceAccreditService.selectSourceAccreditById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据源id获取授权信息
|
||||
*/
|
||||
@GetMapping(value = "/GetSourceAccreditByDataSourceId")
|
||||
public Result getSourceAccreditByDataSourceId(@RequestParam("id") Long id)
|
||||
{
|
||||
return sourceAccreditService.getSourceAccreditByDataSourceId(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:add")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody SourceAccreditReq sourceAccreditReq)
|
||||
{
|
||||
return sourceAccreditService.insertSourceAccredit(sourceAccreditReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权删除
|
||||
*/
|
||||
@Log(title = "授权删除", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/DeleteSourceAccreditBySourceIds")
|
||||
public Result deleteSourceAccreditBySourceIds(@RequestBody SourceAccreditReq sourceAccreditReq)
|
||||
{
|
||||
return sourceAccreditService.deleteSourceAccreditBySourceIds(sourceAccreditReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:edit")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody SourceAccredit sourceAccredit)
|
||||
{
|
||||
return toAjax(sourceAccreditService.updateSourceAccredit(sourceAccredit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@RequiresPermissions("system:accredit:remove")
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sourceAccreditService.deleteSourceAccreditByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.muyu.etl.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_accredit
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public class AssetAccredit extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 部门id */
|
||||
@Excel(name = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/** 数据表id */
|
||||
@Excel(name = "数据表id")
|
||||
private Long dataAssetId;
|
||||
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setDataAssetId(Long dataAssetId)
|
||||
{
|
||||
this.dataAssetId = dataAssetId;
|
||||
}
|
||||
|
||||
public Long getDataAssetId()
|
||||
{
|
||||
return dataAssetId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("dataAssetId", getDataAssetId())
|
||||
.append("userId", getUserId())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,16 +1,33 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
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 com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 asset_model
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AssetModel extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -65,145 +82,23 @@ public class AssetModel extends BaseEntity
|
|||
/** 字典key */
|
||||
@Excel(name = "字典key")
|
||||
private String dictKey;
|
||||
/** 字典id */
|
||||
@Excel(name = "字典key")
|
||||
private Long dictionaryId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
/** 字典信息 */
|
||||
@Excel(name = "字典信息")
|
||||
private List<DictionaryData> dictionaryDatas;
|
||||
|
||||
public Long getDictionaryId() {
|
||||
return dictionaryId;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
public void setDictionaryId(Long dictionaryId) {
|
||||
this.dictionaryId = dictionaryId;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDataAssetId(Long dataAssetId)
|
||||
{
|
||||
this.dataAssetId = dataAssetId;
|
||||
}
|
||||
|
||||
public Long getDataAssetId()
|
||||
{
|
||||
return dataAssetId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setComment(String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getComment()
|
||||
{
|
||||
return comment;
|
||||
}
|
||||
public void setIsPrimaryKey(String isPrimaryKey)
|
||||
{
|
||||
this.isPrimaryKey = isPrimaryKey;
|
||||
}
|
||||
|
||||
public String getIsPrimaryKey()
|
||||
{
|
||||
return isPrimaryKey;
|
||||
}
|
||||
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(String length)
|
||||
{
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public String getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
public void setDecimalPlaces(String decimalPlaces)
|
||||
{
|
||||
this.decimalPlaces = decimalPlaces;
|
||||
}
|
||||
|
||||
public String getDecimalPlaces()
|
||||
{
|
||||
return decimalPlaces;
|
||||
}
|
||||
public void setIsNull(String isNull)
|
||||
{
|
||||
this.isNull = isNull;
|
||||
}
|
||||
|
||||
public String getIsNull()
|
||||
{
|
||||
return isNull;
|
||||
}
|
||||
public void setIsDict(String isDict)
|
||||
{
|
||||
this.isDict = isDict;
|
||||
}
|
||||
|
||||
public String getIsDict()
|
||||
{
|
||||
return isDict;
|
||||
}
|
||||
public void setDictKey(String dictKey)
|
||||
{
|
||||
this.dictKey = dictKey;
|
||||
}
|
||||
|
||||
public String getDictKey()
|
||||
{
|
||||
return dictKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dataAssetId", getDataAssetId())
|
||||
.append("name", getName())
|
||||
.append("comment", getComment())
|
||||
.append("isPrimaryKey", getIsPrimaryKey())
|
||||
.append("type", getType())
|
||||
.append("mappingType", getMappingType())
|
||||
.append("length", getLength())
|
||||
.append("decimalPlaces", getDecimalPlaces())
|
||||
.append("isNull", getIsNull())
|
||||
.append("isDict", getIsDict())
|
||||
.append("defaultValue", getDefaultValue())
|
||||
.append("dictKey", getDictKey())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
public List<DictionaryData> getDictionaryDatas() {
|
||||
return dictionaryDatas;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,29 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
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;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 data_asset
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-22
|
||||
*/
|
||||
@SuperBuilder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DataAsset extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -109,4 +122,21 @@ public class DataAsset extends BaseEntity
|
|||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
|
||||
public DataAsset dataAssetBuilder(DataSource dataSource, ResultSet resultSet) {
|
||||
try {
|
||||
return DataAsset.builder()
|
||||
.tableName(resultSet.getString("t_name"))
|
||||
.tableComment(resultSet.getString("table_comment") == null ? "-":resultSet.getString("table_comment"))
|
||||
.tableCount(Long.valueOf(resultSet.getString("table_rows")))
|
||||
.fields(Long.valueOf(resultSet.getString("fields")))
|
||||
.dataSourceId(dataSource.getId())
|
||||
.createBy(SecurityUtils.getUsername())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,31 @@ public class DataSource extends BaseEntity
|
|||
/** 数据来源名称 */
|
||||
@Excel(name = "数据来源名称")
|
||||
private String systemName;
|
||||
/** 连接驱动名称 */
|
||||
@Excel(name = "连接驱动名称")
|
||||
private String jdbcDriver;
|
||||
|
||||
/** 模式名称 */
|
||||
@Excel(name = "数据来源名称")
|
||||
private String modeName;
|
||||
|
||||
|
||||
|
||||
public String getJdbcDriver() {
|
||||
return jdbcDriver;
|
||||
}
|
||||
|
||||
public void setJdbcDriver(String jdbcDriver) {
|
||||
this.jdbcDriver = jdbcDriver;
|
||||
}
|
||||
|
||||
public String getModeName() {
|
||||
return modeName;
|
||||
}
|
||||
|
||||
public void setModeName(String modeName) {
|
||||
this.modeName = modeName;
|
||||
}
|
||||
|
||||
public List<TableDetail> getTableList() {
|
||||
return tableList;
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
package com.muyu.etl.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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 dictionary
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class Dictionary extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 字典名称 */
|
||||
@Excel(name = "字典名称")
|
||||
private String dictionaryName;
|
||||
|
||||
/** 字典key */
|
||||
@Excel(name = "字典key")
|
||||
private String dictionaryKey;
|
||||
|
||||
/** 数据源ID */
|
||||
@Excel(name = "数据源ID")
|
||||
private Long dataSourceId;
|
||||
|
||||
/** 字典数据集合 */
|
||||
@Excel(name = "数据源ID")
|
||||
private List<DictionaryData> dictionaryDataList;
|
||||
|
||||
public List<DictionaryData> getDictionaryDataList() {
|
||||
return dictionaryDataList;
|
||||
}
|
||||
|
||||
public void setDictionaryDataList(List<DictionaryData> dictionaryDataList) {
|
||||
this.dictionaryDataList = dictionaryDataList;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDictionaryName(String dictionaryName)
|
||||
{
|
||||
this.dictionaryName = dictionaryName;
|
||||
}
|
||||
|
||||
public String getDictionaryName()
|
||||
{
|
||||
return dictionaryName;
|
||||
}
|
||||
public void setDictionaryKey(String dictionaryKey)
|
||||
{
|
||||
this.dictionaryKey = dictionaryKey;
|
||||
}
|
||||
|
||||
public String getDictionaryKey()
|
||||
{
|
||||
return dictionaryKey;
|
||||
}
|
||||
|
||||
public Long getDataSourceId() {
|
||||
return dataSourceId;
|
||||
}
|
||||
|
||||
public void setDataSourceId(Long dataSourceId) {
|
||||
this.dataSourceId = dataSourceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dictionaryName", getDictionaryName())
|
||||
.append("dictionaryKey", getDictionaryKey())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package com.muyu.etl.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;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 dictionary_data
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public class DictionaryData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 字典表ID */
|
||||
@Excel(name = "字典表ID")
|
||||
private Long dictionaryId;
|
||||
|
||||
/** 字典标签 */
|
||||
@Excel(name = "字典标签")
|
||||
private String label;
|
||||
|
||||
/** 字典值 */
|
||||
@Excel(name = "字典值")
|
||||
private String val;
|
||||
|
||||
/** 是否修改 */
|
||||
@Excel(name = "字典值")
|
||||
private Boolean isEdit=false;
|
||||
|
||||
public Boolean getEdit() {
|
||||
return isEdit=false;
|
||||
}
|
||||
|
||||
public void setEdit(Boolean edit) {
|
||||
isEdit = false;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDictionaryId(Long dictionaryId)
|
||||
{
|
||||
this.dictionaryId = dictionaryId;
|
||||
}
|
||||
|
||||
public Long getDictionaryId()
|
||||
{
|
||||
return dictionaryId;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getVal() {
|
||||
return val;
|
||||
}
|
||||
|
||||
public void setVal(String val) {
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("dictionaryId", getDictionaryId())
|
||||
.append("label", getLabel())
|
||||
.append("val", getVal())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package com.muyu.etl.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;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 source_accredit
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public class SourceAccredit extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 部门id */
|
||||
@Excel(name = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/** 数据源id */
|
||||
@Excel(name = "数据源id")
|
||||
private Long dataSourceId;
|
||||
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDataSourceId() {
|
||||
return dataSourceId;
|
||||
}
|
||||
|
||||
public void setDataSourceId(Long dataSourceId) {
|
||||
this.dataSourceId = dataSourceId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("dataSourceId", getDataSourceId())
|
||||
.append("userId", getUserId())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.muyu.etl.domain.custom;
|
|||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -15,6 +16,7 @@ import java.util.Map;
|
|||
* @Date 2024/4/21 9:54
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AssetsModule {
|
||||
|
@ -23,4 +25,11 @@ public class AssetsModule {
|
|||
|
||||
private List<TableAssets> tableAssets;
|
||||
private TableDetail tableDetail;
|
||||
|
||||
public AssetsModule assetsModuleBuilder(List<Map<String, VTClass>> kvtList, HashMap<String, String> map) {
|
||||
return AssetsModule.builder()
|
||||
.kvtList(kvtList)
|
||||
.structure(map)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu.etl.domain.custom;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName Statistics
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/4/23 20:43
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Statistics {
|
||||
private Long dataAsset;
|
||||
private Long assetModel;
|
||||
private Long dataModel;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.muyu.etl.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName AccreditModel
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/4/26 9:09
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AccreditModel {
|
||||
private List<Long> userAccreditModelIds;
|
||||
private List<Long> deptAccreditModelIds;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.etl.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SourceAccreditReq
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/4/26 15:19
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AssetAccreditReq {
|
||||
private List<Long> deptIds;
|
||||
private Long userId;
|
||||
private Long dataAssetId;
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.etl.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName SourceAccreditReq
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/4/26 15:19
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class SourceAccreditReq {
|
||||
private List<Long> deptIds;
|
||||
private Long userId;
|
||||
private Long dataSourceId;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.etl.feign;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @ClassName SysUserFeignService
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/4/25 16:05
|
||||
*/
|
||||
@FeignClient("muyu-system")
|
||||
public interface SysUserFeignService {
|
||||
@GetMapping("/user/list")
|
||||
public Result<TableDataInfo<SysUser>> list (SysUser user);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.etl.domain.AssetAccredit;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public interface AssetAccreditMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public AssetAccredit selectAssetAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<AssetAccredit> selectAssetAccreditList(AssetAccredit assetAccredit);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetAccredit(AssetAccredit assetAccredit);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetAccredit(AssetAccredit assetAccredit);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetAccreditByIds(Long[] ids);
|
||||
|
||||
void deleteAssetAccreditByAssetIds(@Param("assetIds") List<Long> assetIds);
|
||||
|
||||
List<AssetAccredit> getAssetAccreditByDataAssetId(@Param("id") Long id);
|
||||
|
||||
List<AssetAccredit> getAssetAccreditByUserId(@Param("id") Long id);
|
||||
|
||||
void deleteAssetAccreditByDeptUser(@Param("deptIds") List<Long> deptIds, @Param("userId") Long userId, @Param("dataAssetId") Long dataAssetId);
|
||||
|
||||
void insertBatchAssetAccredit(@Param("assetAccredits") List<AssetAccredit> assetAccredits);
|
||||
|
||||
void deleteAssetAccreditByUser(@Param("userIds") List<Long> userIds, @Param("dataAssetId") Long dataAssetId);
|
||||
}
|
|
@ -61,4 +61,8 @@ public interface AssetModelMapper
|
|||
public int deleteAssetModelByIds(Long[] ids);
|
||||
|
||||
void batchInsert(@Param("tableAssets") List<AssetModel> tableAssets);
|
||||
|
||||
List<AssetModel> getAssetModelList(@Param("longs") List<Long> longs);
|
||||
|
||||
void updAssetModelDict(Long id);
|
||||
}
|
||||
|
|
|
@ -62,4 +62,10 @@ public interface DataAssetMapper
|
|||
public int deleteDataAssetByIds(Long[] ids);
|
||||
|
||||
void batchInsert(@Param("dataAssets") ArrayList<DataAsset> dataAssets);
|
||||
|
||||
List<DataAsset> selectDataAssetBatchId(@Param("longs") List<Long> longs);
|
||||
|
||||
List<DataAsset> getDataAssetList(@Param("ids") Long[] ids);
|
||||
|
||||
List<DataAsset> getDataAssetByAssetId(@Param("assetIds") List<Long> assetIds);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface DictionaryDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public DictionaryData selectDictionaryDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<DictionaryData> selectDictionaryDataList(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictionaryData(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictionaryData(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryDataByIds(Long[] ids);
|
||||
|
||||
List<DictionaryData> getDictionaryDataList(@Param("dictionaryIds") List<Long> dictionaryIds);
|
||||
|
||||
void deleteDictionaryData(@Param("id") Long id);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface DictionaryMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public Dictionary selectDictionaryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<Dictionary> selectDictionaryList(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictionary(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictionary(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryByIds(Long[] ids);
|
||||
|
||||
List<Dictionary> getDictionaryList(@Param("dataSourceId") Long dataSourceId);
|
||||
|
||||
List<Dictionary> getDictionaryDataList(@Param("strings") List<String> strings);
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public interface SourceAccreditMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public SourceAccredit selectSourceAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<SourceAccredit> selectSourceAccreditList(SourceAccredit sourceAccredit);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSourceAccredit(SourceAccredit sourceAccredit);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSourceAccredit(SourceAccredit sourceAccredit);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSourceAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSourceAccreditByIds(Long[] ids);
|
||||
|
||||
void deleteSourceAccreditBySourceIds(@Param("sourceIds") List<Long> sourceIds);
|
||||
|
||||
List<SourceAccredit> getSourceAccreditByDataSourceId(@Param("id") Long id);
|
||||
|
||||
List<SourceAccredit> getSourceAccreditByUserId(@Param("id") Long id);
|
||||
|
||||
void insertBatchSourceAccredit(@Param("sourceAccredits") List<SourceAccredit> sourceAccredits);
|
||||
|
||||
void deleteSourceAccreditByDeptUser(@Param("deptIds") List<Long> deptIds, @Param("userId") Long userId, @Param("dataSourceId") Long dataSourceId);
|
||||
|
||||
void deleteSourceAccreditByUser(@Param("userIds") List<Long> userIds, @Param("dataSourceId") Long dataSourceId);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.etl.domain.AssetAccredit;
|
||||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public interface IAssetAccreditService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public AssetAccredit selectAssetAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<AssetAccredit> selectAssetAccreditList(AssetAccredit assetAccredit);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param assetAccreditReq 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetAccredit(AssetAccredit assetAccredit);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetAccreditByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetAccreditById(Long id);
|
||||
|
||||
Result getAssetAccreditByDataAssetId(Long id);
|
||||
|
||||
Result deleteAssetAccreditByAssetIds(AssetAccreditReq assetAccreditReq);
|
||||
}
|
|
@ -73,4 +73,6 @@ public interface IDataSourceService
|
|||
Result dataAssetList(DataSource dataSource);
|
||||
|
||||
Result assetModelList(DataAsset dataAsset);
|
||||
|
||||
Result statistics();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface IDictionaryDataService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public DictionaryData selectDictionaryDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<DictionaryData> selectDictionaryDataList(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictionaryData(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictionaryData(DictionaryData dictionaryData);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryDataById(Long id);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface IDictionaryService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public Dictionary selectDictionaryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<Dictionary> selectDictionaryList(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictionary(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictionary(Dictionary dictionary);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictionaryById(Long id);
|
||||
|
||||
Result getDictionaryList(Long dataSourceId);
|
||||
|
||||
Result deleteDictionary(Long id);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.domain.req.SourceAccreditReq;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
public interface ISourceAccreditService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public SourceAccredit selectSourceAccreditById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<SourceAccredit> selectSourceAccreditList(SourceAccredit sourceAccredit);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccreditReq 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public Result insertSourceAccredit(SourceAccreditReq sourceAccreditReq);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSourceAccredit(SourceAccredit sourceAccredit);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSourceAccreditByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSourceAccreditById(Long id);
|
||||
|
||||
Result getSourceAccreditByDataSourceId(Long id);
|
||||
|
||||
Result deleteSourceAccreditBySourceIds(SourceAccreditReq sourceAccreditReq);
|
||||
}
|
|
@ -0,0 +1,169 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.domain.model.AccreditModel;
|
||||
import com.muyu.etl.domain.req.AssetAccreditReq;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.AssetAccreditMapper;
|
||||
import com.muyu.etl.domain.AssetAccredit;
|
||||
import com.muyu.etl.service.IAssetAccreditService;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
@Service
|
||||
public class AssetAccreditServiceImpl implements IAssetAccreditService
|
||||
{
|
||||
@Autowired
|
||||
private AssetAccreditMapper assetAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public AssetAccredit selectAssetAccreditById(Long id)
|
||||
{
|
||||
return assetAccreditMapper.selectAssetAccreditById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<AssetAccredit> selectAssetAccreditList(AssetAccredit assetAccredit)
|
||||
{
|
||||
return assetAccreditMapper.selectAssetAccreditList(assetAccredit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param assetAccreditReq 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Result insertAssetAccredit(AssetAccreditReq assetAccreditReq)
|
||||
{
|
||||
deleteAssetAccreditByAssetIds(assetAccreditReq);
|
||||
List<AssetAccredit> assetAccredits = new ArrayList<>();
|
||||
if (assetAccreditReq.getUserId() != null){
|
||||
AssetAccredit assetAccredit = new AssetAccredit();
|
||||
assetAccredit.setDataAssetId(assetAccreditReq.getDataAssetId());
|
||||
assetAccredit.setUserId(assetAccreditReq.getUserId());
|
||||
assetAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
assetAccredit.setCreateTime(new Date());
|
||||
assetAccredits.add(assetAccredit);
|
||||
}else{
|
||||
assetAccredits.addAll(assetAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
AssetAccredit assetAccredit = new AssetAccredit();
|
||||
assetAccredit.setDataAssetId(assetAccreditReq.getDataAssetId());
|
||||
assetAccredit.setDeptId(deptId);
|
||||
assetAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
assetAccredit.setCreateTime(new Date());
|
||||
return assetAccredit;
|
||||
}).toList());
|
||||
List<Long> deptIds = assetAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
assetAccredits.addAll(sysUsers.stream().filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream().map(sysUser -> {
|
||||
AssetAccredit assetAccredit = new AssetAccredit();
|
||||
assetAccredit.setDataAssetId(assetAccreditReq.getDataAssetId());
|
||||
assetAccredit.setUserId(sysUser.getUserId());
|
||||
assetAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
assetAccredit.setCreateTime(new Date());
|
||||
return assetAccredit;
|
||||
}).toList());
|
||||
}
|
||||
assetAccreditMapper.insertBatchAssetAccredit(assetAccredits);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param assetAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAssetAccredit(AssetAccredit assetAccredit)
|
||||
{
|
||||
assetAccredit.setUpdateTime(DateUtils.getNowDate());
|
||||
return assetAccreditMapper.updateAssetAccredit(assetAccredit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetAccreditByIds(Long[] ids)
|
||||
{
|
||||
return assetAccreditMapper.deleteAssetAccreditByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetAccreditById(Long id)
|
||||
{
|
||||
return assetAccreditMapper.deleteAssetAccreditById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getAssetAccreditByDataAssetId(Long id) {
|
||||
List<AssetAccredit> assetAccreditList = assetAccreditMapper.getAssetAccreditByDataAssetId(id);
|
||||
List<Long> userAccreditIds = assetAccreditList.stream().map(AssetAccredit::getUserId).filter(Objects::nonNull).toList();
|
||||
List<Long> deptAccreditIds = assetAccreditList.stream().map(AssetAccredit::getDeptId).filter(Objects::nonNull).toList();
|
||||
AccreditModel accreditModel = new AccreditModel();
|
||||
accreditModel.setDeptAccreditModelIds(deptAccreditIds);
|
||||
accreditModel.setUserAccreditModelIds(userAccreditIds);
|
||||
return Result.success(accreditModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result deleteAssetAccreditByAssetIds(AssetAccreditReq assetAccreditReq) {
|
||||
if (assetAccreditReq.getUserId() != null){
|
||||
assetAccreditMapper.deleteAssetAccreditByDeptUser(null,assetAccreditReq.getUserId(),assetAccreditReq.getDataAssetId());
|
||||
}else{
|
||||
List<Long> deptIds = assetAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
List<Long> userIds = sysUsers.stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.map(SysUser::getUserId).toList();
|
||||
assetAccreditMapper.deleteAssetAccreditByUser(userIds,assetAccreditReq.getDataAssetId());
|
||||
assetAccreditMapper.deleteAssetAccreditByDeptUser(assetAccreditReq.getDeptIds(),null,assetAccreditReq.getDataAssetId());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.muyu.etl.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.AssetModelMapper;
|
||||
|
@ -67,6 +68,7 @@ public class AssetModelServiceImpl implements IAssetModelService
|
|||
public int updateAssetModel(AssetModel assetModel)
|
||||
{
|
||||
assetModel.setUpdateTime(DateUtils.getNowDate());
|
||||
assetModel.setUpdateBy(SecurityUtils.getUsername());
|
||||
return assetModelMapper.updateAssetModel(assetModel);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.common.system.domain.SysRole;
|
||||
import com.muyu.etl.domain.*;
|
||||
import com.muyu.etl.domain.custom.AssetsModule;
|
||||
import com.muyu.etl.domain.custom.TableAssets;
|
||||
import com.muyu.etl.domain.custom.TableDetail;
|
||||
import com.muyu.etl.domain.custom.VTClass;
|
||||
import com.muyu.etl.mapper.AssetModelMapper;
|
||||
import com.muyu.etl.mapper.DataAssetMapper;
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
import com.muyu.etl.domain.custom.*;
|
||||
import com.muyu.etl.feign.SysUserFeignService;
|
||||
import com.muyu.etl.mapper.*;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.DataSourceMapper;
|
||||
import com.muyu.etl.service.IDataSourceService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
|
@ -29,6 +30,7 @@ import com.muyu.etl.service.IDataSourceService;
|
|||
* @date 2024-04-20
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class DataSourceServiceImpl implements IDataSourceService
|
||||
{
|
||||
@Autowired
|
||||
|
@ -40,8 +42,25 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
@Autowired
|
||||
private AssetModelMapper assetModelMapper;
|
||||
|
||||
@Autowired
|
||||
private DictionaryDataMapper dictionaryDataMapper;
|
||||
|
||||
@Autowired
|
||||
private DictionaryServiceImpl dictionaryService;
|
||||
|
||||
@Autowired
|
||||
private SourceAccreditMapper sourceAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private AssetAccreditMapper assetAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserFeignService sysUserFeignService;
|
||||
|
||||
private final ExecutorService executorService = Executors.newFixedThreadPool(6);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
* 根据id查询数据接入集合
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
|
@ -49,11 +68,12 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
@Override
|
||||
public DataSource selectDataSourceById(Long id)
|
||||
{
|
||||
return dataSourceMapper.selectDataSourceById(id);
|
||||
DataSource dataSource = dataSourceMapper.selectDataSourceById(id);
|
||||
return dataSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
* 查询数据接入列表
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
|
@ -61,51 +81,35 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
@Override
|
||||
public List<DataSource> selectDataSourceList(DataSource dataSource)
|
||||
{
|
||||
List<DataSource> dataSourceList = new ArrayList<DataSource>();
|
||||
List<DataSource> dataSources = dataSourceMapper.selectDataSourceList(dataSource);
|
||||
// dataSources.stream()
|
||||
// .map(source -> {
|
||||
// String user = source.getUsername();
|
||||
// String password = source.getPassword();
|
||||
// String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
// String jdbcUrl = "jdbc:mysql://"+source.getLinkAddress()+":"+source.getPort()+"/"+source.getDatabaseName();
|
||||
// Connection conn = null;
|
||||
// Result result = this.testConnection(source);
|
||||
// if (result.getCode()==200){
|
||||
// try {
|
||||
// Class.forName(jdbcDriver);
|
||||
// conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
// List<TableDetail> tableNames = new ArrayList<>();
|
||||
// String sql="SELECT TABLE_NAME table_name,TABLE_COMMENT table_comment,TABLE_ROWS table_count FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '"+source.getDatabaseName()+"'";
|
||||
// PreparedStatement ps = conn.prepareStatement(sql);
|
||||
// ResultSet resultSet = ps.executeQuery();
|
||||
// while (resultSet.next()){
|
||||
// TableDetail tableDetail = new TableDetail();
|
||||
// tableDetail.setTableName(resultSet.getString("table_name"));
|
||||
// tableDetail.setTableComment(resultSet.getString("table_comment"));
|
||||
// tableDetail.setTableCount(Long.valueOf(resultSet.getString("table_count")));
|
||||
// tableNames.add(tableDetail);
|
||||
// }
|
||||
// source.setTableList(tableNames);
|
||||
// ps.close();
|
||||
// sql="SELECT count(*) count FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '"+source.getDatabaseName()+"'";
|
||||
// PreparedStatement pst = conn.prepareStatement(sql);
|
||||
// ResultSet resultSet1 = pst.executeQuery();
|
||||
// while (resultSet1.next()){
|
||||
// long count = resultSet1.getLong("count");
|
||||
// source.setCount(count);
|
||||
// }
|
||||
// pst.close();
|
||||
// } catch (ClassNotFoundException | SQLException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }).toList();
|
||||
return dataSources;
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
//判断登录人是否为管理员,不是则需要过滤掉未授权的信息
|
||||
if (roles.get(0).getRoleId()==1){
|
||||
dataSourceList = dataSources;
|
||||
}else{
|
||||
//数据接入过滤完的主键id集合
|
||||
ArrayList<Long> longs1 = new ArrayList<>();
|
||||
//已授权的数据接入id集合
|
||||
List<Long> sourceIds = sourceAccreditMapper.getSourceAccreditByUserId(SecurityUtils.getUserId()).stream().map(SourceAccredit::getDataSourceId).filter(Objects::nonNull).toList();
|
||||
//已授权数据模型表的主键id集合
|
||||
List<Long> assetIds = assetAccreditMapper.getAssetAccreditByUserId(SecurityUtils.getUserId()).stream().map(AssetAccredit::getDataAssetId).filter(Objects::nonNull).toList();
|
||||
//判断已授权数据模型表的主键id集合是否为空
|
||||
if (!assetIds.isEmpty()){
|
||||
//获取已授权的数据模型表的数据源id集合
|
||||
List<Long> longs = dataAssetMapper.getDataAssetByAssetId(assetIds).stream().map(DataAsset::getDataSourceId).toList();
|
||||
//添加到已授权的数据源id集合中
|
||||
longs1.addAll(longs);
|
||||
}
|
||||
longs1.addAll(sourceIds);
|
||||
//从所有的数据源信息集合中过滤掉未授权的数据源信息
|
||||
dataSourceList = dataSources.stream().filter(dataSourceInfo -> longs1.contains(dataSourceInfo.getId())).toList();
|
||||
}
|
||||
return dataSourceList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
* 新增数据接入信息
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
|
@ -115,11 +119,17 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
{
|
||||
dataSource.setCreateTime(DateUtils.getNowDate());
|
||||
dataSource.setCreateBy(SecurityUtils.getUsername());
|
||||
//判断添加的数据源数据库类型
|
||||
if ("MySql".equals(dataSource.getType())){
|
||||
dataSource.setJdbcDriver("com.mysql.cj.jdbc.Driver");
|
||||
}else{
|
||||
dataSource.setJdbcDriver("org.postgresql.Driver");
|
||||
}
|
||||
return dataSourceMapper.insertDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
* 修改数据接入信息
|
||||
*
|
||||
* @param dataSource 【请填写功能名称】
|
||||
* @return 结果
|
||||
|
@ -129,23 +139,72 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
{
|
||||
dataSource.setUpdateTime(DateUtils.getNowDate());
|
||||
dataSource.setUpdateBy(SecurityUtils.getUsername());
|
||||
//判断修改的数据源数据库类型
|
||||
if ("MySql".equals(dataSource.getType())){
|
||||
dataSource.setJdbcDriver("com.mysql.cj.jdbc.Driver");
|
||||
}else{
|
||||
dataSource.setJdbcDriver("org.postgresql.Driver");
|
||||
}
|
||||
return dataSourceMapper.updateDataSource(dataSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
* 批量删除数据接入
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteDataSourceByIds(Long[] ids)
|
||||
{
|
||||
//删除数据接入的数据模型表及关联数据
|
||||
deleteChildLevel(ids,"delete");
|
||||
return dataSourceMapper.deleteDataSourceByIds(ids);
|
||||
}
|
||||
|
||||
//删除数据接入的用户授权数据
|
||||
public void deleteAccredit(List<Long> sourceIds,List<Long> assetIds){
|
||||
//删除数据接入的用户授权数据
|
||||
if (!sourceIds.isEmpty()){
|
||||
sourceAccreditMapper.deleteSourceAccreditBySourceIds(sourceIds);
|
||||
}
|
||||
//删除数据接入的数据模型表及关联数据
|
||||
if (!assetIds.isEmpty()){
|
||||
assetAccreditMapper.deleteAssetAccreditByAssetIds(assetIds);
|
||||
}
|
||||
}
|
||||
|
||||
//删除数据接入相关信息(数据表,数据表中字段,关联字典)
|
||||
public void deleteChildLevel(Long[] ids,String type){
|
||||
//获取数据模型表
|
||||
List<DataAsset> dataAssetList=dataAssetMapper.getDataAssetList(ids);
|
||||
//数据模型表主键id集合
|
||||
List<Long> dataAssetIds = new ArrayList<>();
|
||||
if (!dataAssetList.isEmpty()){
|
||||
//获取数据模型表主键id集合
|
||||
dataAssetIds = dataAssetList.stream().map(DataAsset::getId).toList();
|
||||
//获取数据模型表关联的字典表
|
||||
List<AssetModel> assetModelList=assetModelMapper.getAssetModelList(dataAssetIds);
|
||||
//根据数据模型表id删除数据模型表信息
|
||||
dataAssetMapper.deleteDataAssetByIds(dataAssetIds.toArray(Long[]::new));
|
||||
//根据数据模型表id删除数据模型表的字段信息
|
||||
if (!assetModelList.isEmpty()){
|
||||
List<Long> assetModelIds = assetModelList.stream().map(AssetModel::getId).toList();
|
||||
assetModelMapper.deleteAssetModelByIds(assetModelIds.toArray(Long[]::new));
|
||||
}
|
||||
}
|
||||
//删除数据接入的用户授权数据
|
||||
if ("delete".equals(type)){
|
||||
deleteAccredit(Arrays.stream(ids).toList(),dataAssetIds);
|
||||
}else{
|
||||
deleteAccredit(new ArrayList<Long>(),dataAssetIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
* 删除数据接入信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
|
@ -156,41 +215,43 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
return dataSourceMapper.deleteDataSourceById(id);
|
||||
}
|
||||
|
||||
//测试连接
|
||||
|
||||
@Override
|
||||
public Result testConnection(DataSource dataSource) {
|
||||
String user = dataSource.getUsername();
|
||||
String password = dataSource.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
String jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
if (dataSource.getConnectionParam()!=null && dataSource.getConnectionParam()!=""){
|
||||
jdbcUrl = jdbcUrl+"?"+dataSource.getConnectionParam();
|
||||
}
|
||||
Connection conn = null;
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
Class.forName(dataSource.getJdbcDriver());
|
||||
} catch (ClassNotFoundException e) {
|
||||
return Result.error("连接失败");
|
||||
}
|
||||
try {
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
conn.close();
|
||||
}catch (Exception e){
|
||||
return Result.error("连接失败");
|
||||
}
|
||||
|
||||
return Result.success("连接成功");
|
||||
}
|
||||
|
||||
//获取数据模型的数据(KVT结构)
|
||||
public AssetsModule getStructure(DataSource dataSource){
|
||||
String user = dataSource.getUsername();
|
||||
String password = dataSource.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
String jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
if (dataSource.getConnectionParam()!=null && dataSource.getConnectionParam()!=""){
|
||||
jdbcUrl = jdbcUrl+"?"+dataSource.getConnectionParam();
|
||||
}
|
||||
Connection conn = null;
|
||||
List<Map<String, VTClass>> kvtList = new ArrayList<>();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
//进行jdbc驱动
|
||||
Class.forName(dataSource.getJdbcDriver());
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
} catch (SQLException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -198,13 +259,10 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
PreparedStatement pst = conn.prepareStatement(dataSource.getSql());
|
||||
ResultSet resultSet = pst.executeQuery();
|
||||
ResultSetMetaData rsd = resultSet.getMetaData();
|
||||
//循环查询到的每一列信息
|
||||
for(int i = 1; i <= rsd.getColumnCount(); i++) {
|
||||
String substring = rsd.getColumnClassName(i).substring(rsd.getColumnClassName(i).indexOf("java.lang.") + 10);
|
||||
System.out.print("java类型:"+substring);
|
||||
System.out.print(" 数据库类型:"+rsd.getColumnTypeName(i));
|
||||
System.out.print(" 字段名称:"+rsd.getColumnName(i));
|
||||
System.out.println();
|
||||
map.put(rsd.getColumnName(i),substring);
|
||||
String[] split = rsd.getColumnClassName(i).split("\\.");
|
||||
map.put(rsd.getColumnName(i),split[split.length-1]);
|
||||
}
|
||||
int columnCount = rsd.getColumnCount();
|
||||
// 遍历每一行的数据
|
||||
|
@ -224,84 +282,98 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
kvtList.add(stringVTClassHashMap);
|
||||
}
|
||||
pst.close();
|
||||
conn.close();
|
||||
pst = null;
|
||||
conn = null;
|
||||
} catch(SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
AssetsModule assetsModule = new AssetsModule();
|
||||
assetsModule.setKvtList(kvtList);
|
||||
assetsModule.setStructure(map);
|
||||
return assetsModule;
|
||||
return new AssetsModule().assetsModuleBuilder(kvtList,map);
|
||||
}
|
||||
|
||||
//获取数据模型表内字段信息的映射类型map集合
|
||||
public Map<String,String> getTypeMap(DataSource dataSource, String tableName){
|
||||
String jdbcUrl="";
|
||||
String sql="";
|
||||
jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
if (dataSource.getType().equals("MySql")){
|
||||
sql = "select * from "+tableName+" where 2=1";
|
||||
}else{
|
||||
sql = "select * from "+dataSource.getModeName()+"."+tableName+" where 2=1";
|
||||
}
|
||||
Connection conn = null;
|
||||
Map<String, String> map = new HashMap<>();
|
||||
try {
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
PreparedStatement pst = null;
|
||||
pst = conn.prepareStatement(sql);
|
||||
ResultSet resultSet = pst.executeQuery();
|
||||
ResultSetMetaData rsd = resultSet.getMetaData();
|
||||
for(int i = 1; i <= rsd.getColumnCount(); i++) {
|
||||
String substring="";
|
||||
if (rsd.getColumnClassName(i).contains(".")){
|
||||
String[] split = rsd.getColumnClassName(i).split("\\.");
|
||||
substring = split[split.length-1];
|
||||
}else{
|
||||
substring = rsd.getColumnClassName(i);
|
||||
}
|
||||
map.put(rsd.getColumnName(i),substring);
|
||||
}
|
||||
pst.close();
|
||||
pst=null;
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public List<AssetModel> getTableAssets(DataSource dataSource, String tableName){
|
||||
String user = dataSource.getUsername();
|
||||
String password = dataSource.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
String jdbcUrl="";
|
||||
jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
Connection conn = null;
|
||||
List<AssetModel> assetModels = new ArrayList<>();
|
||||
long staTime = new Date().getTime();
|
||||
Map<String, String> typeMap = getTypeMap(dataSource, tableName);
|
||||
long endTime = new Date().getTime();
|
||||
log.info("查询表字段类型信息耗时:"+(endTime-staTime)+"ms");
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
} catch (SQLException | ClassNotFoundException e) {
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
} catch (SQLException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
PreparedStatement pst = conn.prepareStatement("SELECT COLUMN_NAME,DATA_TYPE,IS_NULLABLE,COLUMN_KEY,COLUMN_DEFAULT,COLUMN_COMMENT,CHARACTER_MAXIMUM_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '"+dataSource.getDatabaseName()+"' AND TABLE_NAME = '"+tableName+"'");
|
||||
ResultSet resultSet = pst.executeQuery();
|
||||
ResultSetMetaData rsd = resultSet.getMetaData();
|
||||
while (resultSet.next()) {
|
||||
AssetModel assetModel = new AssetModel();
|
||||
|
||||
assetModel.setComment(resultSet.getString("COLUMN_COMMENT"));
|
||||
assetModel.setName(resultSet.getString("COLUMN_NAME"));
|
||||
if (resultSet.getString("CHARACTER_MAXIMUM_LENGTH")!=null){
|
||||
assetModel.setLength(resultSet.getString("CHARACTER_MAXIMUM_LENGTH"));
|
||||
}else if (resultSet.getString("NUMERIC_PRECISION")!=null){
|
||||
assetModel.setLength(resultSet.getString("NUMERIC_PRECISION"));
|
||||
}else{
|
||||
assetModel.setLength("-");
|
||||
}
|
||||
if (resultSet.getString("NUMERIC_SCALE")!=null){
|
||||
assetModel.setDecimalPlaces(resultSet.getString("NUMERIC_SCALE"));
|
||||
}else{
|
||||
assetModel.setDecimalPlaces("-");
|
||||
}
|
||||
|
||||
//是否不可为空
|
||||
if (resultSet.getString("IS_NULLABLE").equals("NO")){
|
||||
assetModel.setIsNull("N");
|
||||
}else{
|
||||
assetModel.setIsNull("Y");
|
||||
}
|
||||
//是否有默认值
|
||||
if (resultSet.getString("COLUMN_DEFAULT")!=null){
|
||||
assetModel.setDefaultValue(resultSet.getString("COLUMN_DEFAULT"));
|
||||
}else{
|
||||
assetModel.setDefaultValue("-");
|
||||
}
|
||||
assetModel.setIsDict("");
|
||||
assetModel.setDictKey("");
|
||||
assetModel.setType(resultSet.getString("DATA_TYPE"));
|
||||
//是否主键
|
||||
if ("PRI".equals(resultSet.getString("COLUMN_KEY"))){
|
||||
assetModel.setIsPrimaryKey("Y");
|
||||
}else{
|
||||
assetModel.setIsPrimaryKey("N");
|
||||
}
|
||||
assetModel.setCreateBy(SecurityUtils.getUsername());
|
||||
assetModel.setCreateTime(new Date());
|
||||
assetModel.setMappingType("String");
|
||||
assetModels.add(assetModel);
|
||||
DatabaseMetaData metaData = conn.getMetaData();
|
||||
ResultSet columnsRS = metaData.getColumns(dataSource.getDatabaseName(),dataSource.getModeName(), tableName, "%");
|
||||
ResultSet primaryKeyRS = metaData.getPrimaryKeys(dataSource.getDatabaseName(), dataSource.getModeName(), tableName);
|
||||
String primaryKeyColumnName ="";
|
||||
while (primaryKeyRS.next()) {
|
||||
primaryKeyColumnName = primaryKeyRS.getString("COLUMN_NAME");
|
||||
}
|
||||
|
||||
pst.close();
|
||||
while (columnsRS.next()) {
|
||||
AssetModel build = AssetModel.builder()
|
||||
.createBy(SecurityUtils.getUsername())
|
||||
.createTime(new Date())
|
||||
.length(String.valueOf(columnsRS.getInt("COLUMN_SIZE")))
|
||||
.decimalPlaces(String.valueOf(columnsRS.getInt("DECIMAL_DIGITS")))
|
||||
.name(columnsRS.getString("COLUMN_NAME"))
|
||||
.type(columnsRS.getString("TYPE_NAME"))
|
||||
.mappingType(typeMap.get(columnsRS.getString("COLUMN_NAME")))
|
||||
.dictKey("")
|
||||
.isDict("")
|
||||
.isNull(columnsRS.getString("IS_NULLABLE").substring(0, 1))
|
||||
.isPrimaryKey(columnsRS.getString("COLUMN_NAME").equals(primaryKeyColumnName) ? "Y" : "N")
|
||||
.comment(columnsRS.getString("REMARKS")==null || columnsRS.getString("REMARKS")=="" ? "-" : columnsRS.getString("REMARKS"))
|
||||
.defaultValue(columnsRS.getString("COLUMN_DEF")==null || columnsRS.getString("COLUMN_DEF")=="" ? "-":columnsRS.getString("COLUMN_DEF"))
|
||||
.build();
|
||||
assetModels.add(build);
|
||||
}
|
||||
columnsRS.close();
|
||||
primaryKeyRS.close();
|
||||
conn.close();
|
||||
} catch(SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -309,16 +381,13 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
public AssetsModule getAssets(DataSource dataSource){
|
||||
String user = dataSource.getUsername();
|
||||
String password = dataSource.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
String jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
Connection conn = null;
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
List<AssetModel> assetModels = getTableAssets(dataSource,dataSource.getTableName());
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
Class.forName(dataSource.getJdbcDriver());
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
} catch (SQLException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -349,6 +418,7 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result structureList(DataSource dataSource) {
|
||||
AssetsModule kvt = getStructure(dataSource);
|
||||
return Result.success(kvt);
|
||||
|
@ -356,48 +426,103 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
|
||||
@Override
|
||||
public Result synchronousData(DataSource dataSource) {
|
||||
String user = dataSource.getUsername();
|
||||
String password = dataSource.getPassword();
|
||||
String jdbcDriver = "com.mysql.cj.jdbc.Driver";
|
||||
String jdbcUrl = "jdbc:mysql://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
Connection conn = null;
|
||||
deleteChildLevel(new Long[]{dataSource.getId()},"synchronous");
|
||||
String jdbcUrl = "";
|
||||
String sql;
|
||||
jdbcUrl = "jdbc:"+dataSource.getType().toLowerCase()+"://"+dataSource.getLinkAddress()+":"+dataSource.getPort()+"/"+dataSource.getDatabaseName();
|
||||
if (dataSource.getType().equals("MySql")){
|
||||
sql="SELECT TABLE_NAME t_name,TABLE_COMMENT table_comment,TABLE_ROWS table_rows,(SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE TABLE_SCHEMA = '"+dataSource.getDatabaseName()+"' and TABLE_NAME=t_name) fields FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='"+dataSource.getDatabaseName()+"'";
|
||||
}else{
|
||||
sql="SELECT \n" +
|
||||
" c.relname AS t_name,\n" +
|
||||
" pgd.description AS table_comment,\n" +
|
||||
" COUNT(col.column_name) AS fields,\n" +
|
||||
" c.reltuples AS table_rows\n" +
|
||||
"FROM \n" +
|
||||
" pg_catalog.pg_class c\n" +
|
||||
"LEFT JOIN \n" +
|
||||
" pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n" +
|
||||
"LEFT JOIN \n" +
|
||||
" pg_catalog.pg_description pgd ON pgd.objoid = c.oid\n" +
|
||||
"LEFT JOIN \n" +
|
||||
" information_schema.columns col ON c.relname = col.table_name AND n.nspname = col.table_schema\n" +
|
||||
"WHERE \n" +
|
||||
" n.nspname = '"+dataSource.getModeName()+"' \n" +
|
||||
"AND \n" +
|
||||
" c.relkind = 'r' \n" +
|
||||
"GROUP BY \n" +
|
||||
" c.relname, pgd.description, c.reltuples";
|
||||
}
|
||||
Connection conn;
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
ArrayList<DataAsset> dataAssets = new ArrayList<>();
|
||||
try {
|
||||
Class.forName(jdbcDriver);
|
||||
conn = DriverManager.getConnection(jdbcUrl, user, password);
|
||||
String sql="SELECT TABLE_NAME t_name,TABLE_COMMENT table_comment,TABLE_ROWS table_rows,(SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE TABLE_SCHEMA = '"+dataSource.getDatabaseName()+"' and TABLE_NAME=t_name) fields FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='"+dataSource.getDatabaseName()+"'";
|
||||
PreparedStatement ps = conn.prepareStatement(sql);
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
while (resultSet.next()){
|
||||
DataAsset dataAsset = new DataAsset();
|
||||
dataAsset.setTableName(resultSet.getString("t_name"));
|
||||
dataAsset.setTableComment(resultSet.getString("table_comment"));
|
||||
dataAsset.setTableCount(Long.valueOf(resultSet.getString("table_rows")));
|
||||
dataAsset.setFields(Long.valueOf(resultSet.getString("fields")));
|
||||
dataAsset.setDataSourceId(dataSource.getId());
|
||||
dataAsset.setCreateBy(SecurityUtils.getUsername());
|
||||
dataAsset.setCreateTime(new Date());
|
||||
dataAssets.add(dataAsset);
|
||||
}
|
||||
dataAssetMapper.batchInsert(dataAssets);
|
||||
for (DataAsset dataAsset : dataAssets) {
|
||||
List<AssetModel> tableAssets = getTableAssets(dataSource, dataAsset.getTableName());
|
||||
tableAssets.stream().forEach(assetModel -> assetModel.setDataAssetId(dataAsset.getId()));
|
||||
assetModelMapper.batchInsert(tableAssets);
|
||||
}
|
||||
long startTime = new Date().getTime();
|
||||
Class.forName(dataSource.getJdbcDriver());
|
||||
conn = DriverManager.getConnection(jdbcUrl, dataSource.getUsername(), dataSource.getPassword());
|
||||
|
||||
Future<List<DataAsset>> dataAssetsFuture = executorService.submit(() -> {
|
||||
PreparedStatement ps = conn.prepareStatement(sql);
|
||||
ResultSet resultSet = ps.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
dataAssets.add(new DataAsset().dataAssetBuilder(dataSource, resultSet));
|
||||
}
|
||||
return dataAssets;
|
||||
});
|
||||
CompletableFuture<List<DataAsset>> completableFuture = CompletableFuture.completedFuture(null).thenCompose(unused -> {
|
||||
try {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
return dataAssetsFuture.get(); // 等待Future完成并获取结果
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
throw new RuntimeException("Error getting result from Future", e);
|
||||
}
|
||||
}, executorService);
|
||||
} catch (RuntimeException e) {
|
||||
return CompletableFuture.failedFuture(e);
|
||||
}
|
||||
});
|
||||
List<AssetModel> assetModels = new ArrayList<>();
|
||||
completableFuture.thenAccept(dataAssetss -> {
|
||||
dataAssetMapper.batchInsert(dataAssets);
|
||||
|
||||
List<CompletableFuture<Void>> assetModelFutures = new ArrayList<>();
|
||||
for (DataAsset dataAsset : dataAssets) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
||||
List<AssetModel> tableAssets = getTableAssets(dataSource, dataAsset.getTableName());
|
||||
tableAssets.forEach(assetModel -> assetModel.setDataAssetId(dataAsset.getId()));
|
||||
assetModels.addAll(tableAssets);
|
||||
}, executorService);
|
||||
assetModelFutures.add(future);
|
||||
}
|
||||
CompletableFuture.allOf(assetModelFutures.toArray(new CompletableFuture[0])).join();
|
||||
assetModelMapper.batchInsert(assetModels);
|
||||
});
|
||||
|
||||
long endTime = new Date().getTime();
|
||||
log.info("处理总耗时: " + (endTime - startTime) + "ms");
|
||||
|
||||
return Result.success();
|
||||
} catch (SQLException | ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result dataAssetList(DataSource dataSource) {
|
||||
DataAsset dataAsset = new DataAsset();
|
||||
dataAsset.setDataSourceId(dataSource.getId());
|
||||
List<DataAsset> dataAssetList = new ArrayList<>();
|
||||
List<DataAsset> dataAssets = dataAssetMapper.selectDataAssetList(dataAsset);
|
||||
return Result.success(dataAssets);
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
if (roles.get(0).getRoleId()==1){
|
||||
dataAssetList = dataAssets;
|
||||
}else{
|
||||
List<Long> assetIds = assetAccreditMapper.getAssetAccreditByUserId(SecurityUtils.getUserId()).stream().map(AssetAccredit::getDataAssetId).filter(Objects::nonNull).toList();
|
||||
dataAssetList = dataAssets.stream().filter(dataAssetInfo -> assetIds.contains(dataAssetInfo.getId())).toList();
|
||||
}
|
||||
return Result.success(dataAssetList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -405,6 +530,64 @@ public class DataSourceServiceImpl implements IDataSourceService
|
|||
AssetModel assetModel = new AssetModel();
|
||||
assetModel.setDataAssetId(dataAsset.getId());
|
||||
List<AssetModel> assetModels = assetModelMapper.selectAssetModelList(assetModel);
|
||||
List<String> strings = assetModels.stream().map(AssetModel::getDictKey).toList();
|
||||
if (!strings.isEmpty()){
|
||||
Result<List<Dictionary>> result = dictionaryService.getDictionaryDataList(strings);
|
||||
List<Dictionary> data = result.getData();
|
||||
assetModels.stream()
|
||||
.forEach(assetModelInfo -> {
|
||||
data.stream().forEach(dataInfo -> {
|
||||
if (assetModelInfo.getDictKey().equals(dataInfo.getDictionaryKey())){
|
||||
assetModelInfo.setDictionaryDatas(dataInfo.getDictionaryDataList());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return Result.success(assetModels);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result statistics() {
|
||||
//查询所有数据源
|
||||
List<DataSource> dataSourceList = new ArrayList<>();
|
||||
List<DataSource> dataSources = dataSourceMapper.selectDataSourceList(new DataSource());
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getSysUser().getRoles();
|
||||
List<Long> assetIds;
|
||||
if (roles.get(0).getRoleId()==1){
|
||||
assetIds = new ArrayList<>();
|
||||
dataSourceList = dataSources;
|
||||
}else{
|
||||
ArrayList<Long> longs1 = new ArrayList<>();
|
||||
List<Long> sourceIds = sourceAccreditMapper.getSourceAccreditByUserId(SecurityUtils.getUserId()).stream().map(SourceAccredit::getDataSourceId).filter(Objects::nonNull).toList();
|
||||
assetIds = assetAccreditMapper.getAssetAccreditByUserId(SecurityUtils.getUserId()).stream().map(AssetAccredit::getDataAssetId).filter(Objects::nonNull).toList();
|
||||
if (!assetIds.isEmpty()){
|
||||
List<Long> longs = dataAssetMapper.getDataAssetByAssetId(assetIds).stream().map(DataAsset::getDataSourceId).toList();
|
||||
longs1.addAll(longs);
|
||||
}
|
||||
longs1.addAll(sourceIds);
|
||||
dataSourceList = dataSources.stream().filter(dataSourceInfo -> longs1.contains(dataSourceInfo.getId())).toList();
|
||||
}
|
||||
//获取所有数据源的主键
|
||||
List<Long> longs = dataSourceList.stream().map(dataSource -> dataSource.getId()).toList();
|
||||
Statistics statistics = new Statistics();
|
||||
if (!longs.isEmpty()){
|
||||
List<DataAsset> dataAssetList=dataAssetMapper.selectDataAssetBatchId(longs);
|
||||
if (roles.get(0).getRoleId()!=1){
|
||||
dataAssetList = dataAssetList.stream().filter(dataAsset -> assetIds.contains(dataAsset.getId())).toList();
|
||||
}
|
||||
|
||||
statistics.setDataAsset(Long.valueOf(dataSourceList.size()));
|
||||
long sum1;
|
||||
long sum2=0;
|
||||
sum1 = dataAssetList.stream().mapToLong(dataAsset -> Long.valueOf(dataAsset.getFields())).sum();
|
||||
sum2 = dataAssetList.stream().mapToLong(dataAsset -> Long.valueOf(dataAsset.getTableCount())).sum();
|
||||
statistics.setAssetModel(sum1);
|
||||
statistics.setDataModel(sum2);
|
||||
}else{
|
||||
statistics.setAssetModel(0L);
|
||||
statistics.setDataModel(0L);
|
||||
}
|
||||
|
||||
return Result.success(statistics);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.DictionaryDataMapper;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import com.muyu.etl.service.IDictionaryDataService;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class DictionaryDataServiceImpl implements IDictionaryDataService
|
||||
{
|
||||
@Autowired
|
||||
private DictionaryDataMapper dictionaryDataMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public DictionaryData selectDictionaryDataById(Long id)
|
||||
{
|
||||
return dictionaryDataMapper.selectDictionaryDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<DictionaryData> selectDictionaryDataList(DictionaryData dictionaryData)
|
||||
{
|
||||
return dictionaryDataMapper.selectDictionaryDataList(dictionaryData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictionaryData(DictionaryData dictionaryData)
|
||||
{
|
||||
dictionaryData.setCreateTime(DateUtils.getNowDate());
|
||||
dictionaryData.setCreateBy(SecurityUtils.getUsername());
|
||||
return dictionaryDataMapper.insertDictionaryData(dictionaryData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionaryData 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictionaryData(DictionaryData dictionaryData)
|
||||
{
|
||||
dictionaryData.setUpdateTime(DateUtils.getNowDate());
|
||||
dictionaryData.setUpdateBy(SecurityUtils.getUsername());
|
||||
return dictionaryDataMapper.updateDictionaryData(dictionaryData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictionaryDataByIds(Long[] ids)
|
||||
{
|
||||
return dictionaryDataMapper.deleteDictionaryDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictionaryDataById(Long id)
|
||||
{
|
||||
return dictionaryDataMapper.deleteDictionaryDataById(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.etl.domain.DictionaryData;
|
||||
import com.muyu.etl.mapper.AssetModelMapper;
|
||||
import com.muyu.etl.mapper.DictionaryDataMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.DictionaryMapper;
|
||||
import com.muyu.etl.domain.Dictionary;
|
||||
import com.muyu.etl.service.IDictionaryService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
public class DictionaryServiceImpl implements IDictionaryService
|
||||
{
|
||||
@Autowired
|
||||
private DictionaryMapper dictionaryMapper;
|
||||
|
||||
@Autowired
|
||||
private DictionaryDataMapper dictionaryDataMapper;
|
||||
|
||||
@Autowired
|
||||
private AssetModelMapper assetModelMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public Dictionary selectDictionaryById(Long id)
|
||||
{
|
||||
return dictionaryMapper.selectDictionaryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<Dictionary> selectDictionaryList(Dictionary dictionary)
|
||||
{
|
||||
return dictionaryMapper.selectDictionaryList(dictionary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictionary(Dictionary dictionary)
|
||||
{
|
||||
dictionary.setCreateTime(DateUtils.getNowDate());
|
||||
dictionary.setCreateBy(SecurityUtils.getUsername());
|
||||
return dictionaryMapper.insertDictionary(dictionary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param dictionary 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictionary(Dictionary dictionary)
|
||||
{
|
||||
dictionary.setUpdateTime(DateUtils.getNowDate());
|
||||
dictionary.setUpdateBy(SecurityUtils.getUsername());
|
||||
return dictionaryMapper.updateDictionary(dictionary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictionaryByIds(Long[] ids)
|
||||
{
|
||||
return dictionaryMapper.deleteDictionaryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictionaryById(Long id)
|
||||
{
|
||||
return dictionaryMapper.deleteDictionaryById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getDictionaryList(Long dataSourceId) {
|
||||
List<Dictionary> dictionaryList=dictionaryMapper.getDictionaryList(dataSourceId);
|
||||
if (!dictionaryList.isEmpty()){
|
||||
List<DictionaryData> dictionaryDataList=dictionaryDataMapper.getDictionaryDataList(dictionaryList.stream().map(Dictionary::getId).toList());
|
||||
dictionaryList.stream()
|
||||
.forEach(dictionary -> {
|
||||
List<DictionaryData> dictionaryDatas = dictionaryDataList.stream().filter(dictionaryData -> dictionaryData.getDictionaryId() == dictionary.getId()).toList();
|
||||
dictionary.setDictionaryDataList(dictionaryDatas);
|
||||
});
|
||||
}
|
||||
return Result.success(dictionaryList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result deleteDictionary(Long id) {
|
||||
dictionaryDataMapper.deleteDictionaryData(id);
|
||||
dictionaryMapper.deleteDictionaryById(id);
|
||||
assetModelMapper.updAssetModelDict(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
public Result getDictionaryDataList(List<String> strings) {
|
||||
List<Dictionary> dictionaryList = dictionaryMapper.getDictionaryDataList(strings);
|
||||
if (!dictionaryList.isEmpty()){
|
||||
List<DictionaryData> dictionaryDataList=dictionaryDataMapper.getDictionaryDataList(dictionaryList.stream().map(Dictionary::getId).toList());
|
||||
dictionaryList.stream()
|
||||
.forEach(dictionary -> {
|
||||
List<DictionaryData> dictionaryDatas = dictionaryDataList.stream().filter(dictionaryData -> dictionaryData.getDictionaryId() == dictionary.getId()).toList();
|
||||
dictionary.setDictionaryDataList(dictionaryDatas);
|
||||
});
|
||||
}
|
||||
return Result.success(dictionaryList);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,174 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.etl.domain.model.AccreditModel;
|
||||
import com.muyu.etl.domain.req.SourceAccreditReq;
|
||||
import com.muyu.etl.feign.SysUserFeignService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.etl.mapper.SourceAccreditMapper;
|
||||
import com.muyu.etl.domain.SourceAccredit;
|
||||
import com.muyu.etl.service.ISourceAccreditService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-04-25
|
||||
*/
|
||||
@Service
|
||||
public class SourceAccreditServiceImpl implements ISourceAccreditService
|
||||
{
|
||||
@Autowired
|
||||
private SourceAccreditMapper sourceAccreditMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public SourceAccredit selectSourceAccreditById(Long id)
|
||||
{
|
||||
return sourceAccreditMapper.selectSourceAccreditById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<SourceAccredit> selectSourceAccreditList(SourceAccredit sourceAccredit)
|
||||
{
|
||||
return sourceAccreditMapper.selectSourceAccreditList(sourceAccredit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccreditReq 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Result insertSourceAccredit(SourceAccreditReq sourceAccreditReq)
|
||||
{
|
||||
deleteSourceAccreditBySourceIds(sourceAccreditReq);
|
||||
List<SourceAccredit> sourceAccredits;
|
||||
if (sourceAccreditReq.getUserId() != null){
|
||||
sourceAccredits = new ArrayList<>();
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setUserId(sourceAccreditReq.getUserId());
|
||||
sourceAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
sourceAccredit.setCreateTime(new Date());
|
||||
sourceAccredits.add(sourceAccredit);
|
||||
}else{
|
||||
|
||||
sourceAccredits = new ArrayList<>(sourceAccreditReq.getDeptIds().stream().map(deptId -> {
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setDeptId(deptId);
|
||||
sourceAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
sourceAccredit.setCreateTime(new Date());
|
||||
return sourceAccredit;
|
||||
}).toList());
|
||||
List<Long> deptIds = sourceAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
sourceAccredits.addAll(sysUsers.stream().filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream().map(sysUser -> {
|
||||
SourceAccredit sourceAccredit = new SourceAccredit();
|
||||
sourceAccredit.setDataSourceId(sourceAccreditReq.getDataSourceId());
|
||||
sourceAccredit.setUserId(sysUser.getUserId());
|
||||
sourceAccredit.setCreateBy(SecurityUtils.getUsername());
|
||||
sourceAccredit.setCreateTime(new Date());
|
||||
return sourceAccredit;
|
||||
}).toList());
|
||||
}
|
||||
sourceAccreditMapper.insertBatchSourceAccredit(sourceAccredits);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param sourceAccredit 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSourceAccredit(SourceAccredit sourceAccredit)
|
||||
{
|
||||
sourceAccredit.setUpdateTime(DateUtils.getNowDate());
|
||||
return sourceAccreditMapper.updateSourceAccredit(sourceAccredit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSourceAccreditByIds(Long[] ids)
|
||||
{
|
||||
return sourceAccreditMapper.deleteSourceAccreditByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSourceAccreditById(Long id)
|
||||
{
|
||||
return sourceAccreditMapper.deleteSourceAccreditById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getSourceAccreditByDataSourceId(Long id) {
|
||||
List<SourceAccredit> sourceAccreditList = sourceAccreditMapper.getSourceAccreditByDataSourceId(id);
|
||||
List<Long> userAccreditIds = sourceAccreditList.stream().map(SourceAccredit::getUserId).filter(Objects::nonNull).toList();
|
||||
List<Long> deptAccreditIds = sourceAccreditList.stream().map(SourceAccredit::getDeptId).filter(Objects::nonNull).toList();
|
||||
AccreditModel accreditModel = new AccreditModel();
|
||||
accreditModel.setDeptAccreditModelIds(deptAccreditIds);
|
||||
accreditModel.setUserAccreditModelIds(userAccreditIds);
|
||||
return Result.success(accreditModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result deleteSourceAccreditBySourceIds(SourceAccreditReq sourceAccreditReq) {
|
||||
if (sourceAccreditReq.getUserId() != null){
|
||||
sourceAccreditMapper.deleteSourceAccreditByDeptUser(null,sourceAccreditReq.getUserId(),sourceAccreditReq.getDataSourceId());
|
||||
}else{
|
||||
List<Long> deptIds = sourceAccreditReq.getDeptIds();
|
||||
Result<List<SysUser>> list = remoteUserService.userList(new SysUser());
|
||||
List<SysUser> sysUsers = list.getData();
|
||||
List<Long> userIds = sysUsers.stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.filter(sysUser -> deptIds.contains(sysUser.getDeptId())).toList().stream()
|
||||
.map(SysUser::getUserId).toList();
|
||||
sourceAccreditMapper.deleteSourceAccreditByUser(userIds,sourceAccreditReq.getDataSourceId());
|
||||
sourceAccreditMapper.deleteSourceAccreditByDeptUser(sourceAccreditReq.getDeptIds(),null,sourceAccreditReq.getDataSourceId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.etl.mapper.AssetAccreditMapper">
|
||||
|
||||
<resultMap type="com.muyu.etl.domain.AssetAccredit" id="AssetAccreditResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="dataAssetId" column="data_asset_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAssetAccreditVo">
|
||||
select id, dept_id, data_asset_id, user_id, remark, create_by, create_time, update_by, update_time from asset_accredit
|
||||
</sql>
|
||||
|
||||
<select id="selectAssetAccreditList" parameterType="com.muyu.etl.domain.AssetAccredit" resultMap="AssetAccreditResult">
|
||||
<include refid="selectAssetAccreditVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="dataAssetId != null "> and data_asset_id = #{dataAssetId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAssetAccreditById" parameterType="Long" resultMap="AssetAccreditResult">
|
||||
<include refid="selectAssetAccreditVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getAssetAccreditByDataAssetId" resultType="com.muyu.etl.domain.AssetAccredit">
|
||||
<include refid="selectAssetAccreditVo"></include>
|
||||
<where>
|
||||
and data_asset_id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
<select id="getAssetAccreditByUserId" resultType="com.muyu.etl.domain.AssetAccredit">
|
||||
<include refid="selectAssetAccreditVo"></include>
|
||||
<where>
|
||||
and user_id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertAssetAccredit" parameterType="com.muyu.etl.domain.AssetAccredit" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into asset_accredit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="dataAssetId != null">data_asset_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="dataAssetId != null">#{dataAssetId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBatchAssetAccredit">
|
||||
insert into asset_accredit
|
||||
<trim prefix="(" suffix=")">
|
||||
dept_id,
|
||||
data_asset_id,
|
||||
user_id,
|
||||
create_by,
|
||||
create_time
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="assetAccredits" item="assetAccredit" separator=",">
|
||||
(
|
||||
<if test="assetAccredit.deptId !=null">#{assetAccredit.deptId},</if>
|
||||
<if test="assetAccredit.deptId ==null">null,</if>
|
||||
#{assetAccredit.dataAssetId},
|
||||
<if test="assetAccredit.userId !=null">#{assetAccredit.userId},</if>
|
||||
<if test="assetAccredit.userId ==null">null,</if>
|
||||
#{assetAccredit.createBy},
|
||||
#{assetAccredit.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateAssetAccredit" parameterType="com.muyu.etl.domain.AssetAccredit">
|
||||
update asset_accredit
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="dataAssetId != null">data_asset_id = #{dataAssetId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAssetAccreditById" parameterType="Long">
|
||||
delete from asset_accredit where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAssetAccreditByIds" parameterType="String">
|
||||
delete from asset_accredit where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteAssetAccreditByAssetIds">
|
||||
delete from asset_accredit where data_asset_id in
|
||||
<foreach item="assetId" collection="assetIds" open="(" separator="," close=")">
|
||||
#{assetId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteAssetAccreditByDeptUser">
|
||||
delete from asset_accredit where
|
||||
data_asset_id = #{dataAssetId}
|
||||
<if test="userId !=null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="deptIds != null">
|
||||
and dept_id in
|
||||
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
<delete id="deleteAssetAccreditByUser">
|
||||
delete from asset_accredit where data_asset_id = #{dataAssetId}
|
||||
and user_id in (
|
||||
<foreach collection="userIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
|
@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isDict" column="is_dict" />
|
||||
<result property="defaultValue" column="default_value" />
|
||||
<result property="dictKey" column="dict_key" />
|
||||
<result property="dictionaryId" column="dictionary_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -26,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectAssetModelVo">
|
||||
select id, data_asset_id, name, comment, is_primary_key, type, mapping_type, length, decimal_places, is_null, is_dict,default_value, dict_key, create_by, create_time, update_by, update_time, remark from asset_model
|
||||
select id, data_asset_id, name, comment, is_primary_key, type, mapping_type, length, decimal_places, is_null, is_dict,default_value, dict_key,dictionary_id, create_by, create_time, update_by, update_time, remark from asset_model
|
||||
</sql>
|
||||
|
||||
<select id="selectAssetModelList" parameterType="com.muyu.etl.domain.AssetModel" resultMap="AssetModelResult">
|
||||
|
@ -44,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isDict != null and isDict != ''"> and is_dict = #{isDict}</if>
|
||||
<if test="defaultValue != null and defaultValue != ''"> and default_value = #{defaultValue}</if>
|
||||
<if test="dictKey != null and dictKey != ''"> and dict_key = #{dictKey}</if>
|
||||
<if test="dictionaryId != null and dictionaryId != ''"> and dictionary_id = #{dictionaryId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -51,7 +53,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectAssetModelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getAssetModelList" resultType="com.muyu.etl.domain.AssetModel">
|
||||
<include refid="selectAssetModelVo"></include>
|
||||
<where>
|
||||
and data_asset_id in (
|
||||
<foreach collection="longs" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertAssetModel" parameterType="com.muyu.etl.domain.AssetModel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into asset_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -148,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isDict != null">is_dict = #{isDict},</if>
|
||||
<if test="defaultValue != null">default_value = #{defaultValue},</if>
|
||||
<if test="dictKey != null">dict_key = #{dictKey},</if>
|
||||
<if test="dictionaryId != null">dictionary_id = #{dictionaryId},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
|
@ -156,6 +169,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updAssetModelDict">
|
||||
update asset_model set is_dict='', dict_key='',dictionary_id=null where dictionary_id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAssetModelById" parameterType="Long">
|
||||
delete from asset_model where id = #{id}
|
||||
|
|
|
@ -37,7 +37,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectDataAssetVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectDataAssetBatchId" resultType="com.muyu.etl.domain.DataAsset">
|
||||
select * from data_asset where data_source_id
|
||||
in (
|
||||
<foreach collection="longs" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
<select id="getDataAssetList" resultType="com.muyu.etl.domain.DataAsset">
|
||||
<include refid="selectDataAssetVo"></include>
|
||||
<where>
|
||||
and data_source_id in (
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
<select id="getDataAssetByAssetId" resultType="com.muyu.etl.domain.DataAsset">
|
||||
<include refid="selectDataAssetVo"></include>
|
||||
<where>
|
||||
and id in (
|
||||
<foreach collection="assetIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertDataAsset" parameterType="com.muyu.etl.domain.DataAsset" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into data_asset
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -24,10 +24,12 @@
|
|||
<result property="remark" column="remark" />
|
||||
<result property="type" column="type" />
|
||||
<result property="systemName" column="system_name" />
|
||||
<result property="modeName" column="mode_name" />
|
||||
<result property="jdbcDriver" column="jdbc_driver" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDataSourceVo">
|
||||
select id, data_source_name, link_address, port, database_name, username, password, connection_param, init_num, max_num, max_wait_time, max_wait_size, create_by, create_time, update_by, update_time, remark, type, system_name from data_source
|
||||
select id, data_source_name, link_address, port, database_name, username, password, connection_param, init_num, max_num, max_wait_time, max_wait_size, create_by, create_time, update_by, update_time, remark, type, system_name,mode_name,jdbc_driver from data_source
|
||||
</sql>
|
||||
|
||||
<select id="selectDataSourceList" parameterType="com.muyu.etl.domain.DataSource" resultMap="DataSourceResult">
|
||||
|
@ -46,6 +48,8 @@
|
|||
<if test="maxWaitSize != null "> and max_wait_size = #{maxWaitSize}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="systemName != null and systemName != ''"> and system_name like concat('%', #{systemName}, '%')</if>
|
||||
<if test="modeName != null and modeName != ''"> and mode_name like concat('%', #{modeName}, '%')</if>
|
||||
<if test="jdbcDriver != null and jdbcDriver != ''"> and jdbc_driver like concat('%', #{jdbcDriver}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -75,6 +79,8 @@
|
|||
<if test="remark != null">remark,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="systemName != null">system_name,</if>
|
||||
<if test="modeName != null">mode_name,</if>
|
||||
<if test="jdbcDriver != null">jdbc_driver,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataSourceName != null">#{dataSourceName},</if>
|
||||
|
@ -95,6 +101,8 @@
|
|||
<if test="remark != null">#{remark},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="systemName != null">#{systemName},</if>
|
||||
<if test="modeName != null">#{modeName},</if>
|
||||
<if test="jdbcDriver != null">#{jdbcDriver},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -119,6 +127,8 @@
|
|||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="systemName != null">system_name = #{systemName},</if>
|
||||
<if test="modeName != null">mode_name = #{modeName},</if>
|
||||
<if test="jdbcDriver != null">jdbc_driver = #{jdbcDriver},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.etl.mapper.DictionaryDataMapper">
|
||||
|
||||
<resultMap type="com.muyu.etl.domain.DictionaryData" id="DictionaryDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="dictionaryId" column="dictionary_id" />
|
||||
<result property="label" column="label" />
|
||||
<result property="val" column="val" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictionaryDataVo">
|
||||
select id, dictionary_id, label, val, create_by, create_time, update_by, update_time, remark from dictionary_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictionaryDataList" parameterType="com.muyu.etl.domain.DictionaryData" resultMap="DictionaryDataResult">
|
||||
<include refid="selectDictionaryDataVo"/>
|
||||
<where>
|
||||
<if test="dictionaryId != null "> and dictionary_id = #{dictionaryId}</if>
|
||||
<if test="label != null and dictionaryTag != ''"> and label = #{label}</if>
|
||||
<if test="val != null and dictionaryValue != ''"> and val = #{val}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictionaryDataById" parameterType="Long" resultMap="DictionaryDataResult">
|
||||
<include refid="selectDictionaryDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getDictionaryDataList" resultType="com.muyu.etl.domain.DictionaryData">
|
||||
<include refid="selectDictionaryDataVo"></include>
|
||||
<where>
|
||||
and dictionary_id in (
|
||||
<foreach collection="dictionaryIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertDictionaryData" parameterType="com.muyu.etl.domain.DictionaryData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dictionary_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictionaryId != null">dictionary_id,</if>
|
||||
<if test="label != null">label,</if>
|
||||
<if test="val != null">val,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictionaryId != null">#{dictionaryId},</if>
|
||||
<if test="label != null">#{label},</if>
|
||||
<if test="val != null">#{val},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDictionaryData" parameterType="com.muyu.etl.domain.DictionaryData">
|
||||
update dictionary_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictionaryId != null">dictionary_id = #{dictionaryId},</if>
|
||||
<if test="label != null">label = #{label},</if>
|
||||
<if test="val != null">val = #{val},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDictionaryDataById" parameterType="Long">
|
||||
delete from dictionary_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictionaryDataByIds" parameterType="String">
|
||||
delete from dictionary_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteDictionaryData">
|
||||
delete from dictionary_data where dictionary_id = #{id}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.etl.mapper.DictionaryMapper">
|
||||
|
||||
<resultMap type="com.muyu.etl.domain.Dictionary" id="DictionaryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="dictionaryName" column="dictionary_name" />
|
||||
<result property="dictionaryKey" column="dictionary_key" />
|
||||
<result property="dataSourceId" column="data_source_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictionaryVo">
|
||||
select id, dictionary_name, dictionary_key,data_source_id, create_by, create_time, update_by, update_time, remark from dictionary
|
||||
</sql>
|
||||
|
||||
<select id="selectDictionaryList" parameterType="com.muyu.etl.domain.Dictionary" resultMap="DictionaryResult">
|
||||
<include refid="selectDictionaryVo"/>
|
||||
<where>
|
||||
<if test="dictionaryName != null and dictionaryName != ''"> and dictionary_name like concat('%', #{dictionaryName}, '%')</if>
|
||||
<if test="dictionaryKey != null and dictionaryKey != ''"> and dictionary_key = #{dictionaryKey}</if>
|
||||
<if test="dataSourceId != null"> and data_source_id = #{dataSourceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictionaryById" parameterType="Long" resultMap="DictionaryResult">
|
||||
<include refid="selectDictionaryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getDictionaryList" resultType="com.muyu.etl.domain.Dictionary">
|
||||
<include refid="selectDictionaryVo"></include>
|
||||
<where>
|
||||
and data_source_id = #{dataSourceId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="getDictionaryDataList" resultType="com.muyu.etl.domain.Dictionary">
|
||||
<include refid="selectDictionaryVo"></include>
|
||||
<where>
|
||||
and dictionary_key in (
|
||||
<foreach collection="strings" item="string" separator=",">
|
||||
#{string}
|
||||
</foreach>
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertDictionary" parameterType="com.muyu.etl.domain.Dictionary" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dictionary
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dictionaryName != null">dictionary_name,</if>
|
||||
<if test="dictionaryKey != null">dictionary_key,</if>
|
||||
<if test="dataSourceId != null">data_source_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dictionaryName != null">#{dictionaryName},</if>
|
||||
<if test="dictionaryKey != null">#{dictionaryKey},</if>
|
||||
<if test="dataSourceId != null">#{dataSourceId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDictionary" parameterType="com.muyu.etl.domain.Dictionary">
|
||||
update dictionary
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="dictionaryName != null">dictionary_name = #{dictionaryName},</if>
|
||||
<if test="dictionaryKey != null">dictionary_key = #{dictionaryKey},</if>
|
||||
<if test="dataSourceId != null">data_source_id = #{dataSourceId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDictionaryById" parameterType="Long">
|
||||
delete from dictionary where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictionaryByIds" parameterType="String">
|
||||
delete from dictionary where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,148 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.etl.mapper.SourceAccreditMapper">
|
||||
|
||||
<resultMap type="com.muyu.etl.domain.SourceAccredit" id="SourceAccreditResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="dataSourceId" column="data_source_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSourceAccreditVo">
|
||||
select id, dept_id, data_source_id, user_id, remark, create_by, create_time, update_by, update_time from source_accredit
|
||||
</sql>
|
||||
|
||||
<select id="selectSourceAccreditList" parameterType="com.muyu.etl.domain.SourceAccredit" resultMap="SourceAccreditResult">
|
||||
<include refid="selectSourceAccreditVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="dataSourceId != null "> and data_source_id = #{dataSourceId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSourceAccreditById" parameterType="Long" resultMap="SourceAccreditResult">
|
||||
<include refid="selectSourceAccreditVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getSourceAccreditByDataSourceId" resultType="com.muyu.etl.domain.SourceAccredit">
|
||||
<include refid="selectSourceAccreditVo"></include>
|
||||
<where>
|
||||
and data_source_id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
<select id="getSourceAccreditByUserId" resultType="com.muyu.etl.domain.SourceAccredit">
|
||||
<include refid="selectSourceAccreditVo"></include>
|
||||
<where>
|
||||
and user_id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSourceAccredit" parameterType="com.muyu.etl.domain.SourceAccredit" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into source_accredit
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="dataSourceId != null">data_source_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{dept_id},</if>
|
||||
<if test="dataSourceId != null">#{dataSourceId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBatchSourceAccredit">
|
||||
insert into source_accredit
|
||||
<trim prefix="(" suffix=")">
|
||||
dept_id,
|
||||
data_source_id,
|
||||
user_id,
|
||||
create_by,
|
||||
create_time
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="sourceAccredits" item="sourceAccredit" separator=",">
|
||||
(
|
||||
<if test="sourceAccredit.deptId !=null">#{sourceAccredit.deptId},</if>
|
||||
<if test="sourceAccredit.deptId ==null">null,</if>
|
||||
#{sourceAccredit.dataSourceId},
|
||||
<if test="sourceAccredit.userId !=null">#{sourceAccredit.userId},</if>
|
||||
<if test="sourceAccredit.userId ==null">null,</if>
|
||||
#{sourceAccredit.createBy},
|
||||
#{sourceAccredit.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateSourceAccredit" parameterType="com.muyu.etl.domain.SourceAccredit">
|
||||
update source_accredit
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="dataSourceId != null">data_source_id = #{dataSourceId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSourceAccreditById" parameterType="Long">
|
||||
delete from source_accredit where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSourceAccreditByIds" parameterType="String">
|
||||
delete from source_accredit where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteSourceAccreditBySourceIds">
|
||||
delete from source_accredit where data_source_id in
|
||||
<foreach item="sourceId" collection="sourceIds" open="(" separator="," close=")">
|
||||
#{sourceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteSourceAccreditByDeptUser">
|
||||
delete from source_accredit where
|
||||
data_source_id = #{dataSourceId}
|
||||
<if test="userId !=null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="deptIds != null">
|
||||
and dept_id in
|
||||
<foreach item="deptId" collection="deptIds" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
<delete id="deleteSourceAccreditByUser">
|
||||
delete from source_accredit where
|
||||
data_source_id = #{dataSourceId}
|
||||
and user_id in (
|
||||
<foreach collection="userIds" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</delete>
|
||||
</mapper>
|
|
@ -23,6 +23,7 @@ public class SysFileController {
|
|||
@Autowired
|
||||
private ISysFileService sysFileService;
|
||||
|
||||
|
||||
/**
|
||||
* 文件上传请求
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>muyu-rule-engine</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
package com.muyu;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello world!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.rule.engine.ClassLoading;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
/**
|
||||
* @ClassName CustomClassLoader
|
||||
* @Description 描述
|
||||
* @Author Xin.Yao
|
||||
* @Date 2024/5/1 19:37
|
||||
*/
|
||||
public class CustomClassLoader extends ClassLoader {
|
||||
public Class<?> defineClassFromBytes(String name, byte[] data) {
|
||||
return defineClass(name, data, 0, data.length);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.rule.engine;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuYuRuleEngineApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuRuleEngineApplication.class, args);
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.muyu.rule.engine.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.rule.engine.domain.EngineMaintenance;
|
||||
import com.muyu.rule.engine.service.IEngineMaintenanceService;
|
||||
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 ruoyi
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/maintenance")
|
||||
public class EngineMaintenanceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEngineMaintenanceService engineMaintenanceService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<EngineMaintenance>> list(EngineMaintenance engineMaintenance)
|
||||
{
|
||||
startPage();
|
||||
List<EngineMaintenance> list = engineMaintenanceService.selectEngineMaintenanceList(engineMaintenance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EngineMaintenance engineMaintenance)
|
||||
{
|
||||
List<EngineMaintenance> list = engineMaintenanceService.selectEngineMaintenanceList(engineMaintenance);
|
||||
ExcelUtil<EngineMaintenance> util = new ExcelUtil<EngineMaintenance>(EngineMaintenance.class);
|
||||
util.exportExcel(response, list, "【请填写功能名称】数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(engineMaintenanceService.selectEngineMaintenanceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试方法
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/TestMethod")
|
||||
public Result testMethod(@RequestParam("code") String code)
|
||||
{
|
||||
return engineMaintenanceService.testMethod(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody EngineMaintenance engineMaintenance)
|
||||
{
|
||||
return toAjax(engineMaintenanceService.insertEngineMaintenance(engineMaintenance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化规则引擎类
|
||||
*/
|
||||
@PostMapping("/InitializeRuleEngine")
|
||||
public Result initializeRuleEngine(@RequestBody EngineMaintenance engineMaintenance)
|
||||
{
|
||||
return engineMaintenanceService.initializeRuleEngine(engineMaintenance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody EngineMaintenance engineMaintenance)
|
||||
{
|
||||
return toAjax(engineMaintenanceService.updateEngineMaintenance(engineMaintenance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*/
|
||||
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(engineMaintenanceService.deleteEngineMaintenanceByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
package com.muyu.rule.engine.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;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 engine_maintenance
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public class EngineMaintenance extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 规则引擎名称 */
|
||||
@Excel(name = "规则引擎名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/** 规则引擎类型 */
|
||||
@Excel(name = "规则引擎类型")
|
||||
private String type;
|
||||
|
||||
|
||||
/** 规则引擎激活状态 */
|
||||
@Excel(name = "规则引擎激活状态")
|
||||
private String isActivate;
|
||||
|
||||
|
||||
/** 规则引擎状态 */
|
||||
@Excel(name = "规则引擎状态")
|
||||
private String status;
|
||||
|
||||
|
||||
/** 规则引擎描述 */
|
||||
@Excel(name = "规则引擎描述")
|
||||
private String description;
|
||||
|
||||
|
||||
|
||||
/** 规则引擎编码 */
|
||||
@Excel(name = "规则引擎编码")
|
||||
private String code;
|
||||
|
||||
|
||||
/** 规则引擎级别 */
|
||||
@Excel(name = "规则引擎级别")
|
||||
private String level;
|
||||
|
||||
|
||||
/** 编辑代码文本 */
|
||||
@Excel(name = "编辑代码文本")
|
||||
private String codeText;
|
||||
|
||||
|
||||
public String getCodeText() {
|
||||
return codeText;
|
||||
}
|
||||
|
||||
public void setCodeText(String codeText) {
|
||||
this.codeText = codeText;
|
||||
}
|
||||
|
||||
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 setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setIsActivate(String isActivate)
|
||||
{
|
||||
this.isActivate = isActivate;
|
||||
}
|
||||
|
||||
public String getIsActivate()
|
||||
{
|
||||
return isActivate;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setLevel(String level)
|
||||
{
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("type", getType())
|
||||
.append("isActivate", getIsActivate())
|
||||
.append("status", getStatus())
|
||||
.append("description", getDescription())
|
||||
.append("code", getCode())
|
||||
.append("level", getLevel())
|
||||
.append("codeText", getCodeText())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.rule.engine.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.rule.engine.domain.EngineMaintenance;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public interface EngineMaintenanceMapper
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public EngineMaintenance selectEngineMaintenanceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<EngineMaintenance> selectEngineMaintenanceList(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEngineMaintenance(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEngineMaintenance(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEngineMaintenanceById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEngineMaintenanceByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.rule.engine.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.rule.engine.domain.EngineMaintenance;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
public interface IEngineMaintenanceService
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
public EngineMaintenance selectEngineMaintenanceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
public List<EngineMaintenance> selectEngineMaintenanceList(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertEngineMaintenance(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateEngineMaintenance(EngineMaintenance engineMaintenance);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEngineMaintenanceByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEngineMaintenanceById(Long id);
|
||||
|
||||
Result initializeRuleEngine(EngineMaintenance engineMaintenance);
|
||||
|
||||
Result testMethod(String code);
|
||||
}
|
|
@ -0,0 +1,220 @@
|
|||
package com.muyu.rule.engine.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.rule.engine.ClassLoading.CustomClassLoader;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.rule.engine.mapper.EngineMaintenanceMapper;
|
||||
import com.muyu.rule.engine.domain.EngineMaintenance;
|
||||
import com.muyu.rule.engine.service.IEngineMaintenanceService;
|
||||
|
||||
import javax.tools.JavaCompiler;
|
||||
import javax.tools.StandardJavaFileManager;
|
||||
import javax.tools.ToolProvider;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-05-02
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class EngineMaintenanceServiceImpl implements IEngineMaintenanceService
|
||||
{
|
||||
@Autowired
|
||||
private EngineMaintenanceMapper engineMaintenanceMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public EngineMaintenance selectEngineMaintenanceById(Long id)
|
||||
{
|
||||
return engineMaintenanceMapper.selectEngineMaintenanceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public List<EngineMaintenance> selectEngineMaintenanceList(EngineMaintenance engineMaintenance)
|
||||
{
|
||||
return engineMaintenanceMapper.selectEngineMaintenanceList(engineMaintenance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertEngineMaintenance(EngineMaintenance engineMaintenance)
|
||||
{
|
||||
String className = "Rule"+Character.toUpperCase(engineMaintenance.getCode().charAt(0)) + engineMaintenance.getCode().substring(1)+"Class";
|
||||
engineMaintenance.setCreateTime(DateUtils.getNowDate());
|
||||
engineMaintenance.setCreateBy(SecurityUtils.getUsername());
|
||||
engineMaintenance.setCodeText("package com.muyu.rule.engine.domain;\n\n\n"+
|
||||
"public class " + className + " {\n" +
|
||||
"}");
|
||||
return engineMaintenanceMapper.insertEngineMaintenance(engineMaintenance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param engineMaintenance 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEngineMaintenance(EngineMaintenance engineMaintenance)
|
||||
{
|
||||
engineMaintenance.setUpdateTime(DateUtils.getNowDate());
|
||||
engineMaintenance.setUpdateBy(SecurityUtils.getUsername());
|
||||
return engineMaintenanceMapper.updateEngineMaintenance(engineMaintenance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*
|
||||
* @param ids 需要删除的【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEngineMaintenanceByIds(Long[] ids)
|
||||
{
|
||||
return engineMaintenanceMapper.deleteEngineMaintenanceByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除【请填写功能名称】信息
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteEngineMaintenanceById(Long id)
|
||||
{
|
||||
return engineMaintenanceMapper.deleteEngineMaintenanceById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result initializeRuleEngine(EngineMaintenance engineMaintenance) {
|
||||
try {
|
||||
//创建源文件
|
||||
String className = "Rule"+Character.toUpperCase(engineMaintenance.getCode().charAt(0)) + engineMaintenance.getCode().substring(1)+"Class";
|
||||
// 源文件路径和名称
|
||||
String javaPath = "D:\\idea\\ruoyi-could-server-muyu\\muyu-modules\\muyu-rule-engine\\src\\main\\java\\com\\muyu\\rule\\engine\\domain\\";
|
||||
String classPath = "D:\\idea\\ruoyi-could-server-muyu\\muyu-modules\\muyu-rule-engine\\target\\classes\\";
|
||||
String filename = javaPath+className+".java";
|
||||
File file = new File(filename);
|
||||
// 确保源文件所在的目录存在
|
||||
File fileParent = file.getParentFile();
|
||||
|
||||
|
||||
if (!fileParent.exists()) {
|
||||
fileParent.mkdir();
|
||||
}
|
||||
// 确保源文件存在,如果已存在则先删除再创建
|
||||
if (file.exists()) {
|
||||
file.delete(); // 删除存在的文件
|
||||
}
|
||||
file.createNewFile();
|
||||
// 将源代码写入文件
|
||||
FileWriter fw = new FileWriter(file);
|
||||
fw.write(engineMaintenance.getCodeText());
|
||||
fw.flush();
|
||||
fw.close();
|
||||
// 使用JavaCompiler 编译java文件
|
||||
// 获取系统Java编译器
|
||||
JavaCompiler jc = ToolProvider.getSystemJavaCompiler();
|
||||
// 获取标准文件管理器
|
||||
StandardJavaFileManager fileManager = jc.getStandardFileManager(null, null, null);
|
||||
// 获取要编译的文件对象
|
||||
Iterable fileObjects = fileManager.getJavaFileObjects(filename);
|
||||
// 设置编译选项,指定输出目录
|
||||
List<String> options = Arrays.asList("-d", classPath);
|
||||
// 创建编译任务
|
||||
JavaCompiler.CompilationTask cTask = jc.getTask(null, fileManager, null, options, null, fileObjects);
|
||||
// 执行编译任务
|
||||
Boolean call = cTask.call();
|
||||
// 关闭文件管理器
|
||||
fileManager.close();
|
||||
if (call){
|
||||
return Result.success("初始化成功");
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
Result.error("初始化失败");
|
||||
}
|
||||
return Result.error("初始化失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result testMethod(String code) {
|
||||
String className = "com.muyu.rule.engine.domain.Rule"+Character.toUpperCase(code.charAt(0)) + code.substring(1)+"Class";
|
||||
String classPath = "D:\\idea\\ruoyi-could-server-muyu\\muyu-modules\\muyu-rule-engine\\target\\classes"+className.replace(".", "\\")+".class";
|
||||
try {
|
||||
// 读取类文件
|
||||
byte[] classData = Files.readAllBytes(Paths.get(classPath));
|
||||
CustomClassLoader customClassLoader = new CustomClassLoader();
|
||||
Class<?> aClass = customClassLoader.defineClassFromBytes(className,classData);
|
||||
// 实例化类
|
||||
Object obj = aClass.newInstance();
|
||||
//获取类中所有方法
|
||||
Method[] methods = aClass.getDeclaredMethods();
|
||||
for (Method method : methods) {
|
||||
method.invoke(obj);
|
||||
}
|
||||
customClassLoader = null;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
Result.error("测试失败");
|
||||
}
|
||||
|
||||
return Result.success("测试成功");
|
||||
}
|
||||
|
||||
public String getTypeCodeText(EngineMaintenance engineMaintenance) {
|
||||
String className =Character.toUpperCase(engineMaintenance.getCode().charAt(0)) + engineMaintenance.getCode().substring(1);
|
||||
switch (engineMaintenance.getType()) {
|
||||
case "data-set":
|
||||
className = className+"DataSetContext";
|
||||
return "package com.muyu.rule.engine.domain;\n" +
|
||||
"\n" +
|
||||
"public class "+className+" {\n" +
|
||||
"\n" +
|
||||
" private final RecordContext recordContext;\n" +
|
||||
"\n" +
|
||||
" public DataSetContext (RecordContext recordContext) {\n" +
|
||||
" this.recordContext = recordContext;\n" +
|
||||
" }\n" +
|
||||
"}\n";
|
||||
case "data-record":
|
||||
return "记录";
|
||||
default:
|
||||
return "数据字段";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,28 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9205
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-ruleEngine
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 43.142.44.217:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.rule.engine.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/muyu-system"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.rule.engine.mapper.EngineMaintenanceMapper">
|
||||
|
||||
<resultMap type="com.muyu.rule.engine.domain.EngineMaintenance" id="EngineMaintenanceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="isActivate" column="is_activate" />
|
||||
<result property="status" column="status" />
|
||||
<result property="description" column="description" />
|
||||
<result property="code" column="code" />
|
||||
<result property="level" column="level" />
|
||||
<result property="codeText" column="code_text" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEngineMaintenanceVo">
|
||||
select id, name, type, is_activate, status, description, code, level,code_text, remark, create_by, create_time, update_by, update_time from engine_maintenance
|
||||
</sql>
|
||||
|
||||
<select id="selectEngineMaintenanceList" parameterType="com.muyu.rule.engine.domain.EngineMaintenance" resultMap="EngineMaintenanceResult">
|
||||
<include refid="selectEngineMaintenanceVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="isActivate != null and isActivate != ''"> and is_activate = #{isActivate}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="level != null and level != ''"> and level = #{level}</if>
|
||||
<if test="codeText != null and codeText != ''"> and code_text = #{codeText}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEngineMaintenanceById" parameterType="Long" resultMap="EngineMaintenanceResult">
|
||||
<include refid="selectEngineMaintenanceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertEngineMaintenance" parameterType="com.muyu.rule.engine.domain.EngineMaintenance" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into engine_maintenance
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="isActivate != null">is_activate,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="code != null">code,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="codeText != null">code_text,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="isActivate != null">#{isActivate},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="codeText != null">#{codeText},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEngineMaintenance" parameterType="com.muyu.rule.engine.domain.EngineMaintenance">
|
||||
update engine_maintenance
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="isActivate != null">is_activate = #{isActivate},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="code != null">code = #{code},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="codeText != null">code_text = #{codeText},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEngineMaintenanceById" parameterType="Long">
|
||||
delete from engine_maintenance where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEngineMaintenanceByIds" parameterType="String">
|
||||
delete from engine_maintenance where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -5,6 +5,7 @@ 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.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
|
|
|
@ -59,7 +59,6 @@ public class SysUserController extends BaseController {
|
|||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SysUser>> list (SysUser user) {
|
||||
startPage();
|
||||
|
@ -67,6 +66,16 @@ public class SysUserController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@PostMapping("/UserList")
|
||||
public Result<List<SysUser>> userList (@RequestBody SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
<module>muyu-job</module>
|
||||
<module>muyu-file</module>
|
||||
<module>muyu-etl</module>
|
||||
<module>muyu-rule-engine</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>muyu-modules</artifactId>
|
||||
|
|
Loading…
Reference in New Issue