添加了字典的结构和修改了资产结构的bug
parent
4ace242c67
commit
96ca4dc5dc
|
@ -0,0 +1,42 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 资产数据字典对象 asset_data_dict
|
||||
*
|
||||
* @author xiaohuang
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AssetDataDict extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 数据接入id */
|
||||
@Excel(name = "数据接入id")
|
||||
private Long basicId;
|
||||
|
||||
/** 字典名称 */
|
||||
@Excel(name = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 资产赋权对象 AssetImpower
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/4/28
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class AssetImpower {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@Excel(name = "表id")
|
||||
private Long tableId;
|
||||
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
|
||||
public void setId(Long id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setTableId(Long tableId){
|
||||
this.tableId = tableId;
|
||||
}
|
||||
|
||||
public Long getTableId(){
|
||||
return tableId;
|
||||
}
|
||||
|
||||
public Long getTypeId(){
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Long typeId){
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
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("tableId",getTableId())
|
||||
.append("typeId",getTypeId())
|
||||
.append("userId",getUserId())
|
||||
.append("remark",getRemark())
|
||||
.append("creeteTime",getCreateTime())
|
||||
.append("updateBy",getUpdateBy())
|
||||
.append("updateTime",getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.muyu.etl.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* 字典详细信息 DictInfo
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/4/26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
@SuperBuilder
|
||||
public class DictInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersiom = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private BigInteger id;
|
||||
|
||||
@Excel(name = "字典id")
|
||||
private BigInteger dictId;
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
@Excel(name = "字典名称")
|
||||
private String infoName;
|
||||
|
||||
/**
|
||||
* 字典类型
|
||||
*/
|
||||
@Excel(name = "字典类型")
|
||||
private String infoValue;
|
||||
|
||||
/**
|
||||
* 字典信息
|
||||
*/
|
||||
@JsonProperty("isEdit")
|
||||
private String isEdit;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.etl.domain.resp;
|
||||
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典响应对象
|
||||
* @ClassName BasicDictResp
|
||||
* @Description 描述
|
||||
* @Author SaiSai.Liu
|
||||
* @Date 2024/4/24 21:23
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class BasicDictResp {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 数据接入id */
|
||||
private Long basicId;
|
||||
|
||||
/** 字典名称 */
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
private String dictType;
|
||||
|
||||
|
||||
private List<DictInfo> dictInfoList;
|
||||
|
||||
}
|
|
@ -7,15 +7,21 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
import com.muyu.etl.domain.BasicConfigInfo;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
import com.muyu.etl.domain.Structure;
|
||||
import com.muyu.etl.domain.resp.BasicDictResp;
|
||||
import com.muyu.etl.domain.resp.TableTreeResp;
|
||||
import com.muyu.etl.service.AssetDataDictService;
|
||||
import com.muyu.etl.service.BasicConfigInfoService;
|
||||
import com.muyu.etl.service.DictInfoService;
|
||||
import com.muyu.etl.service.StructureService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -26,35 +32,35 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class BasicConfigInfoController extends BaseController
|
||||
{
|
||||
public class BasicConfigInfoController extends BaseController {
|
||||
@Autowired
|
||||
private BasicConfigInfoService basicConfigInfoService;
|
||||
|
||||
@Autowired
|
||||
private AssetDataDictService assetDataDictService;
|
||||
@Autowired
|
||||
private DictInfoService dictInfoService;
|
||||
@Autowired
|
||||
private StructureService structureService;
|
||||
/**
|
||||
* 查询基础信息列表
|
||||
*/
|
||||
@RequiresPermissions("etl:info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<BasicConfigInfo>> list(BasicConfigInfo basicConfigInfo)
|
||||
{
|
||||
public Result<TableDataInfo<BasicConfigInfo>> list(BasicConfigInfo basicConfigInfo) {
|
||||
startPage();
|
||||
List<BasicConfigInfo> list = basicConfigInfoService.selectBasicConfigInfoList(basicConfigInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出基础信息列表
|
||||
*/
|
||||
@RequiresPermissions("etl:info:export")
|
||||
@Log(title = "基础信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BasicConfigInfo basicConfigInfo)
|
||||
{
|
||||
public void export(HttpServletResponse response, BasicConfigInfo basicConfigInfo) {
|
||||
List<BasicConfigInfo> list = basicConfigInfoService.selectBasicConfigInfoList(basicConfigInfo);
|
||||
ExcelUtil<BasicConfigInfo> util = new ExcelUtil<BasicConfigInfo>(BasicConfigInfo.class);
|
||||
ExcelUtil<BasicConfigInfo> util = new ExcelUtil<>(BasicConfigInfo.class);
|
||||
util.exportExcel(response, list, "基础信息数据");
|
||||
}
|
||||
|
||||
|
@ -63,8 +69,7 @@ public class BasicConfigInfoController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("etl:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public Result getInfo(@PathVariable("id") Long id) {
|
||||
return success(basicConfigInfoService.selectBasicConfigInfoById(id));
|
||||
}
|
||||
|
||||
|
@ -74,8 +79,7 @@ public class BasicConfigInfoController extends BaseController
|
|||
@RequiresPermissions("etl:info:add")
|
||||
@Log(title = "基础信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody BasicConfigInfo configQueryReq)
|
||||
{
|
||||
public Result add(@RequestBody BasicConfigInfo configQueryReq) {
|
||||
return toAjax(basicConfigInfoService.insertBasicConfigInfo(configQueryReq));
|
||||
}
|
||||
|
||||
|
@ -85,8 +89,7 @@ public class BasicConfigInfoController extends BaseController
|
|||
@RequiresPermissions("etl:info:edit")
|
||||
@Log(title = "基础信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody BasicConfigInfo basicConfigInfo)
|
||||
{
|
||||
public Result edit(@RequestBody BasicConfigInfo basicConfigInfo) {
|
||||
return toAjax(basicConfigInfoService.updateBasicConfigInfo(basicConfigInfo));
|
||||
}
|
||||
|
||||
|
@ -96,8 +99,7 @@ public class BasicConfigInfoController extends BaseController
|
|||
@RequiresPermissions("etl:info:remove")
|
||||
@Log(title = "基础信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
public Result remove(@PathVariable Long[] ids) {
|
||||
return toAjax(basicConfigInfoService.deleteBasicConfigInfoByIds(ids));
|
||||
}
|
||||
|
||||
|
@ -111,18 +113,73 @@ public class BasicConfigInfoController extends BaseController
|
|||
return toAjax(basicConfigInfoService.connectionTest(basicConfigInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成功链接中的
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:info:test")
|
||||
@Log(title = "获取成功链接中的")
|
||||
@GetMapping("/dataConstruct")
|
||||
public Result<TableDataInfo<List>> getData(){
|
||||
public Result<TableDataInfo<List>> getData() {
|
||||
return getDataTable(basicConfigInfoService.getDataByEtl());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 树级结构数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:table:list")
|
||||
@Log(title = "获取已成功链接的树级结构")
|
||||
@GetMapping("/getTableTree")
|
||||
public Result<List<TableTreeResp>> getTableTree(){
|
||||
public Result<List<TableTreeResp>> getTableTree() {
|
||||
return Result.success(basicConfigInfoService.getTableTree());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过接入id查询数据库所属字典
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:table:dictList")
|
||||
@Log(title = "描述")
|
||||
@GetMapping("/getDict/{basicId}")
|
||||
public Result<List<BasicDictResp>> getDict(@PathVariable Long basicId) {
|
||||
return Result.success(assetDataDictService.getDict(basicId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加字典表
|
||||
* @param assetDataDict
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:table:list")
|
||||
@Log(title = "添加字典内容")
|
||||
@PostMapping("/insertDict")
|
||||
public Result insertDictInfo(@RequestBody AssetDataDict assetDataDict) throws ServletException {
|
||||
return Result.success(assetDataDictService.insertAssetDataDict(assetDataDict));
|
||||
}
|
||||
/**
|
||||
* 添加字典详细信息
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:table:add")
|
||||
@Log(title = "添加字典表")
|
||||
@PostMapping("/insertDictInfo")
|
||||
public Result insertDict(@RequestBody DictInfo dictInfo) throws ServletException {
|
||||
return Result.success(dictInfoService.insertDictInfo(dictInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产结构中字典信息
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("etl:table:update")
|
||||
@Log(title = "修改资产结构中字典信息")
|
||||
@PutMapping("/updateStructureInfo")
|
||||
public Result updateStructureInfo(@RequestBody Structure structure){
|
||||
return Result.success(structureService.updateStructure(structure),"修改成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资产数据字典Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AssetDataDictMapper extends BaseMapper<AssetDataDict>
|
||||
{
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
public AssetDataDict selectAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产数据字典列表
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 资产数据字典集合
|
||||
*/
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 新增资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 删除资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除资产数据字典
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.etl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典详细内容Mapper接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface DictInfoMapper extends BaseMapper<DictInfo>
|
||||
{
|
||||
/**
|
||||
* 查询字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
public DictInfo selectDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询字典详细内容列表
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 字典详细内容集合
|
||||
*/
|
||||
public List<DictInfo> selectDictInfoList(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 新增字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 修改字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 删除字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除字典详细内容
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
import com.muyu.etl.domain.resp.BasicDictResp;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
/**
|
||||
* 资产数据字典Service接口
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
public interface AssetDataDictService extends IService<AssetDataDict>
|
||||
{
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
public AssetDataDict selectAssetDataDictById(Long id);
|
||||
|
||||
/**
|
||||
* 查询资产数据字典列表
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 资产数据字典集合
|
||||
*/
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 新增资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean insertAssetDataDict(AssetDataDict assetDataDict) throws ServletException;
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict);
|
||||
|
||||
/**
|
||||
* 批量删除资产数据字典
|
||||
*
|
||||
* @param ids 需要删除的资产数据字典主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除资产数据字典信息
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAssetDataDictById(Long id);
|
||||
|
||||
List<BasicDictResp> getDict(Long basicId);
|
||||
}
|
|
@ -5,16 +5,16 @@ import com.muyu.etl.domain.BasicConfigInfo;
|
|||
import com.muyu.etl.domain.resp.TableTreeResp;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.rmi.server.ServerCloneException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 接口 BasicConfigInfoService
|
||||
* Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* on 2024/4/21
|
||||
* @author muyu
|
||||
* @date 2024-04-20
|
||||
*/
|
||||
public interface BasicConfigInfoService extends IService<BasicConfigInfo> {
|
||||
public interface BasicConfigInfoService extends IService<BasicConfigInfo>
|
||||
{
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package com.muyu.etl.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典详细内容Service接口
|
||||
*
|
||||
* @author xiaohuang
|
||||
* @date 2024-04-28
|
||||
*/
|
||||
public interface DictInfoService extends IService<DictInfo>
|
||||
{
|
||||
/**
|
||||
* 查询字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
public DictInfo selectDictInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询字典详细内容列表
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 字典详细内容集合
|
||||
*/
|
||||
public List<DictInfo> selectDictInfoList(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 新增字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean insertDictInfo(DictInfo dictInfo)
|
||||
throws ServletException;
|
||||
|
||||
/**
|
||||
* 修改字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictInfo(DictInfo dictInfo);
|
||||
|
||||
/**
|
||||
* 批量删除字典详细内容
|
||||
*
|
||||
* @param ids 需要删除的字典详细内容主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除字典详细内容信息
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictInfoById(Long id);
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.etl.domain.AssetDataDict;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
import com.muyu.etl.domain.resp.BasicDictResp;
|
||||
import com.muyu.etl.mapper.AssetDataDictMapper;
|
||||
import com.muyu.etl.service.AssetDataDictService;
|
||||
import com.muyu.etl.service.DictInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 资产数据字典Service业务层处理
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class AssetDataDictServiceImpl extends ServiceImpl<AssetDataDictMapper, AssetDataDict> implements AssetDataDictService {
|
||||
@Autowired
|
||||
private AssetDataDictMapper assetDataDictMapper;
|
||||
@Autowired
|
||||
private DictInfoService dictInfoService;
|
||||
|
||||
/**
|
||||
* 查询资产数据字典
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
@Override
|
||||
public AssetDataDict selectAssetDataDictById(Long id) {
|
||||
return assetDataDictMapper.selectAssetDataDictById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产数据字典列表
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 资产数据字典
|
||||
*/
|
||||
@Override
|
||||
public List<AssetDataDict> selectAssetDataDictList(AssetDataDict assetDataDict) {
|
||||
return assetDataDictMapper.selectAssetDataDictList(assetDataDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean insertAssetDataDict(AssetDataDict assetDataDict) throws ServletException {
|
||||
assetDataDict.setCreateTime(DateUtils.getNowDate());
|
||||
AssetDataDict one = this.getOne(new LambdaQueryWrapper<AssetDataDict>(AssetDataDict.class) {{
|
||||
eq(AssetDataDict::getDictType, assetDataDict.getDictType());
|
||||
eq(AssetDataDict::getBasicId, assetDataDict.getBasicId());
|
||||
}});
|
||||
if (one!=null){
|
||||
throw new ServletException("该字典已存在");
|
||||
}
|
||||
boolean b = this.saveOrUpdate(assetDataDict, new LambdaUpdateWrapper<AssetDataDict>(AssetDataDict.class) {{
|
||||
eq(AssetDataDict::getDictType,assetDataDict.getDictType());
|
||||
eq(AssetDataDict::getBasicId,assetDataDict.getBasicId());
|
||||
}});
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资产数据字典
|
||||
*
|
||||
* @param assetDataDict 资产数据字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAssetDataDict(AssetDataDict assetDataDict) {
|
||||
assetDataDict.setUpdateTime(DateUtils.getNowDate());
|
||||
return assetDataDictMapper.updateAssetDataDict(assetDataDict);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资产数据字典
|
||||
*
|
||||
* @param ids 需要删除的资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetDataDictByIds(Long[] ids) {
|
||||
return assetDataDictMapper.deleteAssetDataDictByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产数据字典信息
|
||||
*
|
||||
* @param id 资产数据字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAssetDataDictById(Long id) {
|
||||
return assetDataDictMapper.deleteAssetDataDictById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasicDictResp> getDict(Long basicId) {
|
||||
List<AssetDataDict> list = this.list(new LambdaQueryWrapper<AssetDataDict>() {{
|
||||
eq(AssetDataDict::getBasicId, basicId);
|
||||
or(assetDataDictLambdaQueryWrapper -> assetDataDictLambdaQueryWrapper.eq(AssetDataDict::getId, 1L));
|
||||
}});
|
||||
List<BasicDictResp> collect = list.stream().map(assetDataDict -> {
|
||||
List<DictInfo> dictInfoList = dictInfoService.list(
|
||||
new LambdaQueryWrapper<DictInfo>()
|
||||
.eq(DictInfo::getDictId, assetDataDict.getId()
|
||||
)
|
||||
);
|
||||
return BasicDictResp.builder()
|
||||
.id(assetDataDict.getId())
|
||||
.dictType(assetDataDict.getDictType())
|
||||
.dictName(assetDataDict.getDictName())
|
||||
.dictInfoList(dictInfoList)
|
||||
.basicId(assetDataDict.getBasicId())
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import com.muyu.etl.domain.TableInfo;
|
|||
import com.muyu.etl.domain.resp.TableInfoStructureResp;
|
||||
import com.muyu.etl.domain.resp.TableTreeResp;
|
||||
import com.muyu.etl.mapper.BasicConfigInfoMapper;
|
||||
|
||||
import com.muyu.etl.service.BasicConfigInfoService;
|
||||
import com.muyu.etl.service.StructureService;
|
||||
import com.muyu.etl.service.TableInfoService;
|
||||
|
@ -161,7 +162,7 @@ public class BasicConfigInfoServiceImpl extends ServiceImpl<BasicConfigInfoMapp
|
|||
TableInfo build = TableInfo.builder()
|
||||
.basicId(basicConfigInfo.getId())
|
||||
.tableName(tableName1)
|
||||
.tableRemark(tableRemark.isEmpty()? "null":tableRemark)
|
||||
.tableRemark(tableRemark==null? "null":tableRemark)
|
||||
.parentId(tableInfo.getId())
|
||||
.center("Y")
|
||||
.updateBy(SecurityUtils.getUsername())
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
package com.muyu.etl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.etl.domain.DictInfo;
|
||||
import com.muyu.etl.mapper.DictInfoMapper;
|
||||
import com.muyu.etl.service.DictInfoService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典详细内容Service业务层处理
|
||||
*
|
||||
* @author Saisai
|
||||
* @date 2024-04-24
|
||||
*/
|
||||
@Log4j2
|
||||
@Service
|
||||
public class DictInfoServiceImpl extends ServiceImpl<DictInfoMapper, DictInfo> implements DictInfoService {
|
||||
@Autowired
|
||||
private DictInfoMapper dictInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询字典详细内容
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
@Override
|
||||
public DictInfo selectDictInfoById(Long id) {
|
||||
return dictInfoMapper.selectDictInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典详细内容列表
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 字典详细内容
|
||||
*/
|
||||
@Override
|
||||
public List<DictInfo> selectDictInfoList(DictInfo dictInfo) {
|
||||
return dictInfoMapper.selectDictInfoList(dictInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean insertDictInfo(DictInfo dictInfo) throws ServletException {
|
||||
dictInfo.setCreateTime(DateUtils.getNowDate());
|
||||
DictInfo one = this.getOne(new LambdaQueryWrapper<DictInfo>() {{
|
||||
eq(DictInfo::getDictId, dictInfo.getDictId());
|
||||
eq(DictInfo::getInfoName, dictInfo.getInfoName());
|
||||
eq(DictInfo::getInfoValue, dictInfo.getInfoValue());
|
||||
}});
|
||||
if (one!=null){
|
||||
throw new ServletException("该字典内容已存在");
|
||||
}
|
||||
boolean b = this.saveOrUpdate(dictInfo, new LambdaUpdateWrapper<DictInfo>(DictInfo.class) {{
|
||||
eq(DictInfo::getDictId, dictInfo.getDictId());
|
||||
eq(DictInfo::getInfoName, dictInfo.getInfoName());
|
||||
eq(DictInfo::getInfoValue, dictInfo.getInfoValue());
|
||||
}});
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典详细内容
|
||||
*
|
||||
* @param dictInfo 字典详细内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictInfo(DictInfo dictInfo) {
|
||||
dictInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return dictInfoMapper.updateDictInfo(dictInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典详细内容
|
||||
*
|
||||
* @param ids 需要删除的字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictInfoByIds(Long[] ids) {
|
||||
return dictInfoMapper.deleteDictInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典详细内容信息
|
||||
*
|
||||
* @param id 字典详细内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictInfoById(Long id) {
|
||||
return dictInfoMapper.deleteDictInfoById(id);
|
||||
}
|
||||
}
|
|
@ -23,4 +23,10 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue