feat(): 增加数据添加字典类型
parent
4a71865e3f
commit
4c6a93683d
|
@ -94,4 +94,10 @@ public class AssetTableDetails {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "是否字典")
|
@Excel(name = "是否字典")
|
||||||
private String yesNoDictionary;
|
private String yesNoDictionary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 映射字典
|
||||||
|
*/
|
||||||
|
@Excel(name = "映射字典")
|
||||||
|
private String mappingDictionary;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.etl.data.structure.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.etl.common.core.domain.Result;
|
||||||
|
import com.etl.common.log.annotation.Log;
|
||||||
|
import com.etl.common.log.enums.BusinessType;
|
||||||
|
import com.etl.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.etl.data.structure.domain.AssetTableDetails;
|
||||||
|
import com.etl.data.structure.service.IAssetTableDetailsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import static com.etl.common.core.domain.Result.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据详情Controller层
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
* @ClassName: AssetTableDetailsController 数据详情Controller层
|
||||||
|
* @CreateTime: 2024/4/29 下午2:25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/details")
|
||||||
|
public class AssetTableDetailsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAssetTableDetailsService assetTableDetailsService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据源信息详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("data:details:query")
|
||||||
|
@GetMapping(value = "/{assetStructureTableId}")
|
||||||
|
public Result findByAssetStructureTableIdlist(@PathVariable("assetStructureTableId") Long assetStructureTableId) {
|
||||||
|
return success(assetTableDetailsService.list(
|
||||||
|
new LambdaQueryWrapper<AssetTableDetails>()
|
||||||
|
.eq(AssetTableDetails::getAssetStructureTableId, assetStructureTableId))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据源详情信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("data:details:edit")
|
||||||
|
@Log(title = "数据详情", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public Result edit(@RequestBody AssetTableDetails assetTableDetails) {
|
||||||
|
return success(
|
||||||
|
assetTableDetailsService.updateAssetTableDetails(assetTableDetails)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -14,5 +14,18 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IAssetTableDetailsService extends IService<AssetTableDetails> {
|
public interface IAssetTableDetailsService extends IService<AssetTableDetails> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据详情
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public List<AssetTableDetails> selectAssetTableDetailsList();
|
public List<AssetTableDetails> selectAssetTableDetailsList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据详情
|
||||||
|
*
|
||||||
|
* @param assetTableDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean updateAssetTableDetails(AssetTableDetails assetTableDetails);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.etl.data.structure.service.impl;
|
package com.etl.data.structure.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.etl.data.structure.domain.AssetTableDetails;
|
import com.etl.data.structure.domain.AssetTableDetails;
|
||||||
import com.etl.data.structure.mapper.AssetTableDetailsMapper;
|
import com.etl.data.structure.mapper.AssetTableDetailsMapper;
|
||||||
|
@ -29,4 +30,23 @@ public class AssetTableDetailsServiceImpl extends ServiceImpl<AssetTableDetailsM
|
||||||
log.info("获取所有数据详情列表");
|
log.info("获取所有数据详情列表");
|
||||||
return this.list();
|
return this.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateAssetTableDetails(AssetTableDetails assetTableDetails) {
|
||||||
|
if ("Y".equals(assetTableDetails.getYesNoDictionary())){
|
||||||
|
return this.update(
|
||||||
|
new LambdaUpdateWrapper<AssetTableDetails>()
|
||||||
|
.eq(AssetTableDetails::getId, assetTableDetails.getId())
|
||||||
|
.set(AssetTableDetails::getYesNoDictionary, assetTableDetails.getYesNoDictionary())
|
||||||
|
.set(AssetTableDetails::getMappingDictionary, assetTableDetails.getMappingDictionary())
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
return this.update(
|
||||||
|
new LambdaUpdateWrapper<AssetTableDetails>()
|
||||||
|
.eq(AssetTableDetails::getId, assetTableDetails.getId())
|
||||||
|
.set(AssetTableDetails::getYesNoDictionary, assetTableDetails.getYesNoDictionary())
|
||||||
|
.set(AssetTableDetails::getYesNoDictionary, "")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue