Merge remote-tracking branch 'origin/master'
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled
yudao-ui-admin CI / build (14.x) (push) Has been cancelled
yudao-ui-admin CI / build (16.x) (push) Has been cancelled
This commit is contained in:
commit
f1acce8447
@ -39,21 +39,19 @@ public abstract class BaseEntity implements Serializable, TransPojo {
|
||||
* 使用 String 类型的原因是,未来可能会存在非数值的情况,留好拓展性。
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
|
||||
private String creator;
|
||||
private String createBy;
|
||||
/**
|
||||
* 更新者,目前使用 SysUser 的 id 编号
|
||||
*
|
||||
* 使用 String 类型的原因是,未来可能会存在非数值的情况,留好拓展性。
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR)
|
||||
private String updater;
|
||||
private String updateBy;
|
||||
|
||||
private Long creatorId;
|
||||
|
||||
private String createBy;
|
||||
private Long updatorId;
|
||||
private Long updaterId;
|
||||
|
||||
private String updateBy;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
|
@ -1,106 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mdpf.controller.cat;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.convert.cat.AttApiCatConvert;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttApiCatDO;
|
||||
import cn.iocoder.yudao.module.mdpf.service.cat.IAttApiCatService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理Controller
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
*/
|
||||
@Tag(name = "数据服务类目管理")
|
||||
@RestController
|
||||
@RequestMapping("/att/AttApiCat")
|
||||
@Validated
|
||||
public class AttApiCatController {
|
||||
@Resource
|
||||
private IAttApiCatService attApiCatService;
|
||||
|
||||
@Operation(summary = "查询数据服务类目管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('att:cat:attapicat:list')")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<List<AttApiCatRespVO>> list(AttApiCatPageReqVO attApiCat) {
|
||||
List<AttApiCatDO> attApiCatList = attApiCatService.getAttApiCatList(attApiCat);
|
||||
return CommonResult.success(BeanUtils.toBean(attApiCatList, AttApiCatRespVO.class));
|
||||
}
|
||||
|
||||
// @Operation(summary = "导出数据服务类目管理列表")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attapicat:export')")
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, AttApiCatPageReqVO exportReqVO) {
|
||||
// exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<AttApiCatDO> list = (List<AttApiCatDO>) attApiCatService.getAttApiCatPage(exportReqVO).getList();
|
||||
// ExcelUtil<AttApiCatRespVO> util = new ExcelUtil<>(AttApiCatRespVO.class);
|
||||
// util.exportExcel(response, AttApiCatConvert.INSTANCE.convertToRespVOList(list), "应用管理数据");
|
||||
// }
|
||||
|
||||
// @Operation(summary = "导入数据服务类目管理列表")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attapicat:import')")
|
||||
// @PostMapping("/importData")
|
||||
// public CommonResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
// ExcelUtil<AttApiCatRespVO> util = new ExcelUtil<>(AttApiCatRespVO.class);
|
||||
// List<AttApiCatRespVO> importExcelList = util.importExcel(file.getInputStream());
|
||||
//// String operName = getUsername();
|
||||
// String message = attApiCatService.importAttApiCat(importExcelList, updateSupport, "");
|
||||
// return CommonResult.success(message);
|
||||
// }
|
||||
|
||||
@Operation(summary = "获取数据服务类目管理详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('att:cat:attapicat:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult<AttApiCatRespVO> getInfo(@PathVariable("id") Long id) {
|
||||
AttApiCatDO attApiCatDO = attApiCatService.getAttApiCatById(id);
|
||||
return CommonResult.success(BeanUtils.toBean(attApiCatDO, AttApiCatRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增数据服务类目管理")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attapicat:add')")
|
||||
@PostMapping
|
||||
public CommonResult<Long> add(@Valid @RequestBody AttApiCatSaveReqVO attApiCat) {
|
||||
// attApiCat.setCreator(getUserId());
|
||||
// attApiCat.setc(getNickName());
|
||||
attApiCat.setCreateTime(LocalDateTime.now());
|
||||
return CommonResult.success(attApiCatService.createAttApiCat(attApiCat));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改数据服务类目管理")
|
||||
@PreAuthorize("@ss.hasPermi('att:cat:attapicat:edit')")
|
||||
@PutMapping
|
||||
public CommonResult<Integer> edit(@Valid @RequestBody AttApiCatSaveReqVO attApiCat) {
|
||||
// attApiCat.setUpdatorId(getUserId());
|
||||
// attApiCat.setUpdateBy(getNickName());
|
||||
attApiCat.setUpdateTime(LocalDateTime.now());
|
||||
return CommonResult.success(attApiCatService.updateAttApiCat(attApiCat));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除数据服务类目管理")
|
||||
@PreAuthorize("@ss.hasPermi('att:cat:attapicat:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult<Integer> remove(@PathVariable Long[] ids) {
|
||||
return CommonResult.success(attApiCatService.removeAttApiCat(Arrays.asList(ids)));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package cn.iocoder.yudao.module.mdpf.controller.cat;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttCleanCatDO;
|
||||
import cn.iocoder.yudao.module.mdpf.service.cat.IAttCleanCatService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 清洗规则类目Controller
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Tag(name = "清洗规则类目")
|
||||
@RestController
|
||||
@RequestMapping("/att/attCleanCat")
|
||||
@Validated
|
||||
public class AttCleanCatController {
|
||||
@Resource
|
||||
private IAttCleanCatService attCleanCatService;
|
||||
|
||||
@Operation(summary = "查询清洗规则类目列表")
|
||||
@GetMapping("/listPage")
|
||||
public CommonResult<PageResult<AttCleanCatRespVO>> listPage(AttCleanCatPageReqVO attCleanCat) {
|
||||
PageResult<AttCleanCatDO> page = attCleanCatService.getAttCleanCatPage(attCleanCat);
|
||||
return CommonResult.success(BeanUtils.toBean(page, AttCleanCatRespVO.class));
|
||||
}
|
||||
@Operation(summary = "查询清洗规则类目列表")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<List<AttCleanCatRespVO>> list(AttCleanCatPageReqVO attCleanCat) {
|
||||
List<AttCleanCatDO> page = attCleanCatService.getAttCleanCatList(attCleanCat);
|
||||
return CommonResult.success(BeanUtils.toBean(page, AttCleanCatRespVO.class));
|
||||
}
|
||||
|
||||
// @Operation(summary = "导出清洗规则类目列表")
|
||||
//// @PreAuthorize("@ss.hasPermi('att:cat:attcleancat:export')")
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, AttCleanCatPageReqVO exportReqVO) {
|
||||
// exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<AttCleanCatDO> list = (List<AttCleanCatDO>) attCleanCatService.getAttCleanCatPage(exportReqVO).getRows();
|
||||
// ExcelUtil<AttCleanCatRespVO> util = new ExcelUtil<>(AttCleanCatRespVO.class);
|
||||
// util.exportExcel(response, AttCleanCatConvert.INSTANCE.convertToRespVOList(list), "应用管理数据");
|
||||
// }
|
||||
//
|
||||
// @Operation(summary = "导入清洗规则类目列表")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attcleancat:import')")
|
||||
// @Log(title = "清洗规则类目", businessType = BusinessType.IMPORT)
|
||||
// @PostMapping("/importData")
|
||||
// public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
|
||||
// ExcelUtil<AttCleanCatRespVO> util = new ExcelUtil<>(AttCleanCatRespVO.class);
|
||||
// List<AttCleanCatRespVO> importExcelList = util.importExcel(file.getInputStream());
|
||||
// String operName = getUsername();
|
||||
// String message = attCleanCatService.importAttCleanCat(importExcelList, updateSupport, operName);
|
||||
// return success(message);
|
||||
// }
|
||||
|
||||
@Operation(summary = "获取清洗规则类目详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult<AttCleanCatRespVO> getInfo(@PathVariable("id") Long id) {
|
||||
AttCleanCatDO attCleanCatDO = attCleanCatService.getAttCleanCatById(id);
|
||||
return CommonResult.success(BeanUtils.toBean(attCleanCatDO, AttCleanCatRespVO.class));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增清洗规则类目")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attcleancat:add')")
|
||||
// @Log(title = "清洗规则类目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public CommonResult<Long> add(@Valid @RequestBody AttCleanCatSaveReqVO attCleanCat) {
|
||||
// attCleanCat.setCreatorId(getUserId());
|
||||
// attCleanCat.setCreateBy(getNickName());
|
||||
attCleanCat.setCreateTime(LocalDateTime.now());
|
||||
return CommonResult.success(attCleanCatService.createAttCleanCat(attCleanCat));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改清洗规则类目")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attcleancat:edit')")
|
||||
@PutMapping
|
||||
public CommonResult<Integer> edit(@Valid @RequestBody AttCleanCatSaveReqVO attCleanCat) {
|
||||
// attCleanCat.setUpdatorId(getUserId());
|
||||
// attCleanCat.setUpdateBy(getNickName());
|
||||
attCleanCat.setUpdateTime(LocalDateTime.now());
|
||||
return CommonResult.success(attCleanCatService.updateAttCleanCat(attCleanCat));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除清洗规则类目")
|
||||
// @PreAuthorize("@ss.hasPermi('att:cat:attcleancat:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult<Integer> remove(@PathVariable Long ids) {
|
||||
return CommonResult.success(attCleanCatService.removeAttCleanCat(ids));
|
||||
}
|
||||
|
||||
}
|
@ -4,21 +4,18 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理 Request VO 对象 ATT_API_CAT
|
||||
* 清洗规则类目 Request VO 对象 ATT_CLEAN_CAT
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Schema(description = "数据服务类目管理 Request VO")
|
||||
@Schema(description = "清洗规则类目 Request VO")
|
||||
@Data
|
||||
public class AttApiCatPageReqVO extends PageParam {
|
||||
public class AttCleanCatPageReqVO extends PageParam {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Schema(description = "ID", example = "")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类别名称", example = "")
|
||||
private String name;
|
||||
|
||||
@ -34,8 +31,6 @@ public class AttApiCatPageReqVO extends PageParam {
|
||||
@Schema(description = "层级编码", example = "")
|
||||
private String code;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
|
||||
|
@ -9,19 +9,20 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理 Response VO 对象 ATT_API_CAT
|
||||
* 清洗规则类目 Response VO 对象 ATT_CLEAN_CAT
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Schema(description = "数据服务类目管理 Response VO")
|
||||
@Schema(description = "清洗规则类目 Response VO")
|
||||
@Data
|
||||
public class AttApiCatRespVO implements Serializable {
|
||||
public class AttCleanCatRespVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "ID")
|
||||
@Schema(description = "ID")
|
||||
|
||||
@Excel(name = "id")
|
||||
@Schema(description = "id", example = "")
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "类别名称")
|
@ -7,14 +7,14 @@ import lombok.Data;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理 创建/修改 Request VO ATT_API_CAT
|
||||
* 清洗规则类目 创建/修改 Request VO ATT_CLEAN_CAT
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Schema(description = "数据服务类目管理 Response VO")
|
||||
@Schema(description = "清洗规则类目 Response VO")
|
||||
@Data
|
||||
public class AttApiCatSaveReqVO extends BaseDO {
|
||||
public class AttCleanCatSaveReqVO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -34,8 +34,6 @@ public class AttApiCatSaveReqVO extends BaseDO {
|
||||
@Schema(description = "描述", example = "")
|
||||
@Size(max = 256, message = "描述长度不能超过256个字符")
|
||||
private String description;
|
||||
@Schema(description = "有效状态", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
@Schema(description = "层级编码", example = "")
|
||||
@Size(max = 256, message = "层级编码长度不能超过256个字符")
|
||||
@ -45,5 +43,8 @@ public class AttApiCatSaveReqVO extends BaseDO {
|
||||
@Size(max = 256, message = "备注长度不能超过256个字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "有效状态", example = "")
|
||||
private Boolean validFlag;
|
||||
|
||||
|
||||
}
|
@ -39,7 +39,7 @@ public class AttAuditRuleController {
|
||||
private IAttAuditRuleService attAuditRuleService;
|
||||
|
||||
@Operation(summary = "查询稽查规则列表")
|
||||
@PreAuthorize("@ss.hasPermi('att:rule:auditrule:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:list')")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<PageResult<AttAuditRuleRespVO>> list(AttAuditRulePageReqVO attAuditRule) {
|
||||
PageResult<AttAuditRuleDO> page = attAuditRuleService.getAttAuditRulePage(attAuditRule);
|
||||
@ -78,7 +78,7 @@ public class AttAuditRuleController {
|
||||
}
|
||||
|
||||
@Operation(summary = "新增稽查规则")
|
||||
@PreAuthorize("@ss.hasPermi('att:rule:auditrule:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:add')")
|
||||
@PostMapping
|
||||
public CommonResult<Long> add(@Valid @RequestBody AttAuditRuleSaveReqVO attAuditRule) {
|
||||
// attAuditRule.setCreatorId(getUserId());
|
||||
@ -88,7 +88,7 @@ public class AttAuditRuleController {
|
||||
}
|
||||
|
||||
@Operation(summary = "修改稽查规则")
|
||||
@PreAuthorize("@ss.hasPermi('att:rule:auditrule:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:edit')")
|
||||
@PutMapping
|
||||
public CommonResult<Integer> edit(@Valid @RequestBody AttAuditRuleSaveReqVO attAuditRule) {
|
||||
// attAuditRule.setUpdatorId(getUserId());
|
||||
@ -98,7 +98,7 @@ public class AttAuditRuleController {
|
||||
}
|
||||
|
||||
@Operation(summary = "删除稽查规则")
|
||||
@PreAuthorize("@ss.hasPermi('att:rule:auditrule:remove')")
|
||||
// @PreAuthorize("@ss.hasPermi('att:rule:auditrule:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult<Integer> remove(@PathVariable Long[] ids) {
|
||||
return CommonResult.success(attAuditRuleService.removeAttAuditRule(Arrays.asList(ids)));
|
||||
|
@ -38,7 +38,7 @@ public class AttCleanRuleController {
|
||||
private IAttCleanRuleService attCleanRuleService;
|
||||
|
||||
@Operation(summary = "查询清洗规则列表")
|
||||
@PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:list')")
|
||||
// @PreAuthorize("@ss.hasPermi('att:rule:attcleanrule:list')")
|
||||
@GetMapping("/list")
|
||||
public CommonResult<PageResult<AttCleanRuleRespVO>> list(AttCleanRulePageReqVO attCleanRule) {
|
||||
PageResult<AttCleanRuleDO> page = attCleanRuleService.getAttCleanRulePage(attCleanRule);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.mdpf.controller.rule.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.mdpf.core.page.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -51,11 +51,11 @@ public class AttAuditRuleRespVO implements Serializable {
|
||||
|
||||
@Excel(name = "删除标志")
|
||||
@Schema(description = "删除标志", example = "")
|
||||
private Boolean delFlag;
|
||||
private Boolean deleted;
|
||||
|
||||
@Excel(name = "创建人")
|
||||
@Schema(description = "创建人", example = "")
|
||||
private String createBy;
|
||||
private String creator;
|
||||
|
||||
@Excel(name = "创建人id")
|
||||
@Schema(description = "创建人id", example = "")
|
||||
@ -67,7 +67,7 @@ public class AttAuditRuleRespVO implements Serializable {
|
||||
|
||||
@Excel(name = "更新人")
|
||||
@Schema(description = "更新人", example = "")
|
||||
private String updateBy;
|
||||
private String updater;
|
||||
|
||||
@Excel(name = "更新人id")
|
||||
@Schema(description = "更新人id", example = "")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.mdpf.controller.rule.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -14,7 +15,7 @@ import javax.validation.constraints.Size;
|
||||
*/
|
||||
@Schema(description = "稽查规则 Response VO")
|
||||
@Data
|
||||
public class AttAuditRuleSaveReqVO extends BaseEntity {
|
||||
public class AttAuditRuleSaveReqVO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -62,11 +62,11 @@ public class AttCleanRuleRespVO implements Serializable {
|
||||
|
||||
@Excel(name = "删除标志")
|
||||
@Schema(description = "删除标志", example = "")
|
||||
private Boolean delFlag;
|
||||
private Boolean deleted;
|
||||
|
||||
@Excel(name = "创建人")
|
||||
@Schema(description = "创建人", example = "")
|
||||
private String createBy;
|
||||
private String creator;
|
||||
|
||||
@Excel(name = "创建人id")
|
||||
@Schema(description = "创建人id", example = "")
|
||||
@ -78,7 +78,7 @@ public class AttCleanRuleRespVO implements Serializable {
|
||||
|
||||
@Excel(name = "更新人")
|
||||
@Schema(description = "更新人", example = "")
|
||||
private String updateBy;
|
||||
private String updater;
|
||||
|
||||
@Excel(name = "更新人id")
|
||||
@Schema(description = "更新人id", example = "")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.mdpf.controller.rule.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -15,7 +16,7 @@ import javax.validation.constraints.Size;
|
||||
*/
|
||||
@Schema(description = "清洗规则 Response VO")
|
||||
@Data
|
||||
public class AttCleanRuleSaveReqVO extends BaseEntity {
|
||||
public class AttCleanRuleSaveReqVO extends BaseDO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -1,49 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mdpf.convert.cat;
|
||||
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttApiCatDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理 Convert
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface AttApiCatConvert {
|
||||
AttApiCatConvert INSTANCE = Mappers.getMapper(AttApiCatConvert.class);
|
||||
|
||||
/**
|
||||
* PageReqVO 转换为 DO
|
||||
* @param attApiCatPageReqVO 请求参数
|
||||
* @return AttApiCatDO
|
||||
*/
|
||||
AttApiCatDO convertToDO(AttApiCatPageReqVO attApiCatPageReqVO);
|
||||
|
||||
/**
|
||||
* SaveReqVO 转换为 DO
|
||||
* @param attApiCatSaveReqVO 保存请求参数
|
||||
* @return AttApiCatDO
|
||||
*/
|
||||
AttApiCatDO convertToDO(AttApiCatSaveReqVO attApiCatSaveReqVO);
|
||||
|
||||
/**
|
||||
* DO 转换为 RespVO
|
||||
* @param attApiCatDO 实体对象
|
||||
* @return AttApiCatRespVO
|
||||
*/
|
||||
AttApiCatRespVO convertToRespVO(AttApiCatDO attApiCatDO);
|
||||
|
||||
/**
|
||||
* DOList 转换为 RespVOList
|
||||
* @param attApiCatDOList 实体对象列表
|
||||
* @return List<AttApiCatRespVO>
|
||||
*/
|
||||
List<AttApiCatRespVO> convertToRespVOList(List<AttApiCatDO> attApiCatDOList);
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.mdpf.convert.cat;
|
||||
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttCleanCatDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 清洗规则类目 Convert
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface AttCleanCatConvert {
|
||||
AttCleanCatConvert INSTANCE = Mappers.getMapper(AttCleanCatConvert.class);
|
||||
|
||||
/**
|
||||
* PageReqVO 转换为 DO
|
||||
* @param attCleanCatPageReqVO 请求参数
|
||||
* @return AttCleanCatDO
|
||||
*/
|
||||
AttCleanCatDO convertToDO(AttCleanCatPageReqVO attCleanCatPageReqVO);
|
||||
|
||||
/**
|
||||
* SaveReqVO 转换为 DO
|
||||
* @param attCleanCatSaveReqVO 保存请求参数
|
||||
* @return AttCleanCatDO
|
||||
*/
|
||||
AttCleanCatDO convertToDO(AttCleanCatSaveReqVO attCleanCatSaveReqVO);
|
||||
|
||||
/**
|
||||
* DO 转换为 RespVO
|
||||
* @param attCleanCatDO 实体对象
|
||||
* @return AttCleanCatRespVO
|
||||
*/
|
||||
AttCleanCatRespVO convertToRespVO(AttCleanCatDO attCleanCatDO);
|
||||
|
||||
/**
|
||||
* DOList 转换为 RespVOList
|
||||
* @param attCleanCatDOList 实体对象列表
|
||||
* @return List<AttCleanCatRespVO>
|
||||
*/
|
||||
List<AttCleanCatRespVO> convertToRespVOList(List<AttCleanCatDO> attCleanCatDOList);
|
||||
}
|
@ -1,30 +1,30 @@
|
||||
package cn.iocoder.yudao.module.mdpf.dal.dataobject.cat;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理 DO 对象 ATT_API_CAT
|
||||
* 清洗规则类目 DO 对象 ATT_CLEAN_CAT
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "ATT_API_CAT")
|
||||
@TableName(value = "ATT_CLEAN_CAT")
|
||||
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
// @KeySequence("ATT_API_CAT_seq")
|
||||
// @KeySequence("ATT_CLEAN_CAT_seq")
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AttApiCatDO extends BaseEntity {
|
||||
public class AttCleanCatDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
@TableId(type = IdType.AUTO)
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 类别名称 */
|
||||
@ -45,9 +45,9 @@ public class AttApiCatDO extends BaseEntity {
|
||||
/** 是否有效 */
|
||||
private Boolean validFlag;
|
||||
|
||||
private String remark;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private Boolean delFlag;
|
||||
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
@ -21,7 +22,7 @@ import lombok.*;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AttAuditRuleDO extends BaseEntity {
|
||||
public class AttAuditRuleDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -49,9 +50,6 @@ public class AttAuditRuleDO extends BaseEntity {
|
||||
/** 是否有效 */
|
||||
private Boolean validFlag;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private Boolean delFlag;
|
||||
|
||||
/**
|
||||
* 数据元规则关联id
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.mdpf.dal.dataobject.rule;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
@ -21,7 +22,7 @@ import lombok.*;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AttCleanRuleDO extends BaseEntity {
|
||||
public class AttCleanRuleDO extends BaseDO {
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -46,8 +47,6 @@ public class AttCleanRuleDO extends BaseEntity {
|
||||
private Boolean validFlag;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private Boolean delFlag;
|
||||
|
||||
/**
|
||||
* 数据元规则关联id
|
||||
|
@ -1,38 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mdpf.dal.mapper.cat;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttApiCatDO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理Mapper接口
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
*/
|
||||
@Mapper
|
||||
@DS("slave")
|
||||
public interface AttApiCatMapper extends BaseMapperX<AttApiCatDO> {
|
||||
|
||||
default PageResult<AttApiCatDO> selectPage(AttApiCatPageReqVO reqVO) {
|
||||
// 定义排序的字段(防止 SQL 注入,与数据库字段名称一致)
|
||||
Set<String> allowedColumns = new HashSet<>(Arrays.asList("id", "create_time", "update_time"));
|
||||
|
||||
// 构造动态查询条件
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AttApiCatDO>()
|
||||
.likeIfPresent(AttApiCatDO::getName, reqVO.getName())
|
||||
.eqIfPresent(AttApiCatDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(AttApiCatDO::getSortOrder, reqVO.getSortOrder())
|
||||
.eqIfPresent(AttApiCatDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(AttApiCatDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(AttApiCatDO::getCreateTime, reqVO.getCreateTime()));
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.mdpf.dal.mapper.cat;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttCleanCatDO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 清洗规则类目Mapper接口
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Mapper
|
||||
@DS("slave")
|
||||
public interface AttCleanCatMapper extends BaseMapperX<AttCleanCatDO> {
|
||||
|
||||
default PageResult<AttCleanCatDO> selectPage(AttCleanCatPageReqVO reqVO) {
|
||||
// 定义排序的字段(防止 SQL 注入,与数据库字段名称一致)
|
||||
Set<String> allowedColumns = new HashSet<>(Arrays.asList("id", "create_time", "update_time"));
|
||||
|
||||
// 构造动态查询条件
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AttCleanCatDO>()
|
||||
.likeIfPresent(AttCleanCatDO::getName, reqVO.getName())
|
||||
.eqIfPresent(AttCleanCatDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(AttCleanCatDO::getSortOrder, reqVO.getSortOrder())
|
||||
.eqIfPresent(AttCleanCatDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(AttCleanCatDO::getCode, reqVO.getCode()));
|
||||
// 如果 reqVO.getName() 不为空,则添加 name 的精确匹配条件(name = '<name>')
|
||||
// .likeIfPresent(AttCleanCatDO::getName, reqVO.getName())
|
||||
// 按照 createTime 字段降序排序
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttAuditRulePageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.AttAuditRuleDO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -43,7 +44,7 @@ public interface AttAuditRuleMapper extends BaseMapperX<AttAuditRuleDO> {
|
||||
.orderByDesc(AttAuditRuleDO::getCreateTime);
|
||||
|
||||
// 构造动态查询条件
|
||||
return selectPage(reqVO);
|
||||
return selectPage(reqVO,queryparam);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,103 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mdpf.service.cat;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttApiCatDO;
|
||||
import cn.iocoder.yudao.module.mdpf.dto.cat.dto.AttApiCatReqDTO;
|
||||
import cn.iocoder.yudao.module.mdpf.dto.cat.dto.AttApiCatRespDTO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 数据服务类目管理Service接口
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
*/
|
||||
public interface IAttApiCatService extends IService<AttApiCatDO> {
|
||||
|
||||
/**
|
||||
* 获得数据服务类目管理分页列表
|
||||
*
|
||||
* @param pageReqVO 分页请求
|
||||
* @return 数据服务类目管理分页列表
|
||||
*/
|
||||
PageResult<AttApiCatDO> getAttApiCatPage(AttApiCatPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 创建数据服务类目管理
|
||||
*
|
||||
* @param createReqVO 数据服务类目管理信息
|
||||
* @return 数据服务类目管理编号
|
||||
*/
|
||||
Long createAttApiCat(AttApiCatSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新数据服务类目管理
|
||||
*
|
||||
* @param updateReqVO 数据服务类目管理信息
|
||||
*/
|
||||
int updateAttApiCat(AttApiCatSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除数据服务类目管理
|
||||
*
|
||||
* @param idList 数据服务类目管理编号
|
||||
*/
|
||||
int removeAttApiCat(Collection<Long> idList);
|
||||
|
||||
/**
|
||||
* 获得数据服务类目管理详情
|
||||
*
|
||||
* @param id 数据服务类目管理编号
|
||||
* @return 数据服务类目管理
|
||||
*/
|
||||
AttApiCatDO getAttApiCatById(Long id);
|
||||
|
||||
/**
|
||||
* 获得全部数据服务类目管理列表
|
||||
*
|
||||
* @return 数据服务类目管理列表
|
||||
*/
|
||||
List<AttApiCatDO> getAttApiCatList();
|
||||
|
||||
/**
|
||||
* 获得全部数据服务类目管理列表
|
||||
*
|
||||
* @return 数据服务类目管理列表
|
||||
*/
|
||||
List<AttApiCatDO> getAttApiCatList(AttApiCatPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得全部数据服务类目管理 Map
|
||||
*
|
||||
* @return 数据服务类目管理 Map
|
||||
*/
|
||||
Map<Long, AttApiCatDO> getAttApiCatMap();
|
||||
|
||||
|
||||
/**
|
||||
* 导入数据服务类目管理数据
|
||||
*
|
||||
* @param importExcelList 数据服务类目管理数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
String importAttApiCat(List<AttApiCatRespVO> importExcelList, boolean isUpdateSupport, String operName);
|
||||
|
||||
/**
|
||||
* 生成code
|
||||
*
|
||||
* @param parentId
|
||||
* @param parentCode
|
||||
* @return
|
||||
*/
|
||||
String createCode(Long parentId, String parentCode);
|
||||
|
||||
List<AttApiCatRespDTO> getAttApiCatList(AttApiCatReqDTO attApiCatReqDTO);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.mdpf.service.cat;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttCleanCatDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 清洗规则类目Service接口
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
public interface IAttCleanCatService extends IService<AttCleanCatDO> {
|
||||
|
||||
/**
|
||||
* 获得清洗规则类目分页列表
|
||||
*
|
||||
* @param pageReqVO 分页请求
|
||||
* @return 清洗规则类目分页列表
|
||||
*/
|
||||
PageResult<AttCleanCatDO> getAttCleanCatPage(AttCleanCatPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 创建清洗规则类目
|
||||
*
|
||||
* @param createReqVO 清洗规则类目信息
|
||||
* @return 清洗规则类目编号
|
||||
*/
|
||||
Long createAttCleanCat(AttCleanCatSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新清洗规则类目
|
||||
*
|
||||
* @param updateReqVO 清洗规则类目信息
|
||||
*/
|
||||
int updateAttCleanCat(AttCleanCatSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除清洗规则类目
|
||||
*
|
||||
* @param idList 清洗规则类目编号
|
||||
*/
|
||||
int removeAttCleanCat(Long idList);
|
||||
|
||||
/**
|
||||
* 获得清洗规则类目详情
|
||||
*
|
||||
* @param id 清洗规则类目编号
|
||||
* @return 清洗规则类目
|
||||
*/
|
||||
AttCleanCatDO getAttCleanCatById(Long id);
|
||||
|
||||
/**
|
||||
* 获得全部清洗规则类目列表
|
||||
*
|
||||
* @return 清洗规则类目列表
|
||||
*/
|
||||
List<AttCleanCatDO> getAttCleanCatList(AttCleanCatPageReqVO attCleanCat);
|
||||
List<AttCleanCatDO> getAttCleanCatList();
|
||||
|
||||
/**
|
||||
* 获得全部清洗规则类目 Map
|
||||
*
|
||||
* @return 清洗规则类目 Map
|
||||
*/
|
||||
Map<Long, AttCleanCatDO> getAttCleanCatMap();
|
||||
|
||||
|
||||
/**
|
||||
* 导入清洗规则类目数据
|
||||
*
|
||||
* @param importExcelList 清洗规则类目数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
String importAttCleanCat(List<AttCleanCatRespVO> importExcelList, boolean isUpdateSupport, String operName);
|
||||
|
||||
|
||||
/**
|
||||
* 生成code
|
||||
*
|
||||
* @param parentId
|
||||
* @param parentCode
|
||||
* @return
|
||||
*/
|
||||
String createCode(Long parentId, String parentCode);
|
||||
|
||||
}
|
@ -1,228 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mdpf.service.cat.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttApiCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttApiCatDO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.mapper.cat.AttApiCatMapper;
|
||||
import cn.iocoder.yudao.module.mdpf.dto.cat.dto.AttApiCatReqDTO;
|
||||
import cn.iocoder.yudao.module.mdpf.dto.cat.dto.AttApiCatRespDTO;
|
||||
import cn.iocoder.yudao.module.mdpf.service.cat.IAttApiCatService;
|
||||
import cn.iocoder.yudao.module.mdpf.util.YouBianCodeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 数据服务类目管理Service业务层处理
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-03-11
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class AttApiCatServiceImpl extends ServiceImpl<AttApiCatMapper, AttApiCatDO> implements IAttApiCatService {
|
||||
@Resource
|
||||
private AttApiCatMapper attApiCatMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<AttApiCatDO> getAttApiCatPage(AttApiCatPageReqVO pageReqVO) {
|
||||
return attApiCatMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createAttApiCat(AttApiCatSaveReqVO createReqVO) {
|
||||
AttApiCatDO dictType = BeanUtils.toBean(createReqVO, AttApiCatDO.class);
|
||||
dictType.setCode(createCode(createReqVO.getParentId(), null));
|
||||
attApiCatMapper.insert(dictType);
|
||||
return dictType.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAttApiCat(AttApiCatSaveReqVO updateReqVO) {
|
||||
// 相关校验
|
||||
|
||||
// 更新数据服务类目管理
|
||||
AttApiCatDO updateObj = BeanUtils.toBean(updateReqVO, AttApiCatDO.class);
|
||||
return attApiCatMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeAttApiCat(Collection<Long> idList) {
|
||||
// 批量删除数据服务类目管理
|
||||
return attApiCatMapper.deleteBatchIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttApiCatDO getAttApiCatById(Long id) {
|
||||
return attApiCatMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttApiCatDO> getAttApiCatList() {
|
||||
return attApiCatMapper.selectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttApiCatDO> getAttApiCatList(AttApiCatPageReqVO reqVO) {
|
||||
LambdaQueryWrapperX<AttApiCatDO> queryWrapperX = new LambdaQueryWrapperX<>();
|
||||
queryWrapperX.likeIfPresent(AttApiCatDO::getName, reqVO.getName())
|
||||
.eqIfPresent(AttApiCatDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(AttApiCatDO::getSortOrder, reqVO.getSortOrder())
|
||||
.eqIfPresent(AttApiCatDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(AttApiCatDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(AttApiCatDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByAsc(AttApiCatDO::getSortOrder);
|
||||
return attApiCatMapper.selectList(queryWrapperX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, AttApiCatDO> getAttApiCatMap() {
|
||||
List<AttApiCatDO> attApiCatList = attApiCatMapper.selectList();
|
||||
return attApiCatList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AttApiCatDO::getId,
|
||||
attApiCatDO -> attApiCatDO,
|
||||
// 保留已存在的值
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createCode(Long parentId, String parentCode) {
|
||||
String categoryCode = null;
|
||||
/*
|
||||
* 分成三种情况
|
||||
* 1.数据库无数据 调用YouBianCodeUtil.getNextYouBianCode(null);
|
||||
* 2.添加子节点,无兄弟元素 YouBianCodeUtil.getSubYouBianCode(parentCode,null);
|
||||
* 3.添加子节点有兄弟元素 YouBianCodeUtil.getNextYouBianCode(lastCode);
|
||||
* */
|
||||
//找同类 确定上一个最大的code值
|
||||
LambdaQueryWrapper<AttApiCatDO> query = new LambdaQueryWrapper<AttApiCatDO>()
|
||||
.eq(AttApiCatDO::getParentId, parentId)
|
||||
.likeRight(StringUtils.isNotBlank(parentCode), AttApiCatDO::getCode, parentCode)
|
||||
.isNotNull(AttApiCatDO::getCode)
|
||||
.orderByDesc(AttApiCatDO::getCode);
|
||||
List<AttApiCatDO> list = baseMapper.selectList(query);
|
||||
if (list == null || list.size() == 0) {
|
||||
if (parentId == 0) {
|
||||
//情况1
|
||||
categoryCode = YouBianCodeUtil.getNextYouBianCode(null);
|
||||
} else {
|
||||
//情况2
|
||||
AttApiCatDO parent = baseMapper.selectById(parentId);
|
||||
categoryCode = YouBianCodeUtil.getSubYouBianCode(parent.getCode(), null);
|
||||
}
|
||||
} else {
|
||||
//情况3
|
||||
categoryCode = YouBianCodeUtil.getNextYouBianCode(list.get(0).getCode());
|
||||
}
|
||||
return categoryCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据服务类目管理数据
|
||||
*
|
||||
* @param importExcelList 数据服务类目管理数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String importAttApiCat(List<AttApiCatRespVO> importExcelList, boolean isUpdateSupport, String operName) {
|
||||
if (cn.iocoder.yudao.module.mdpf.util.StringUtils.isNull(importExcelList) || importExcelList.size() == 0) {
|
||||
throw new ServiceException(500,"导入数据不能为空!");
|
||||
}
|
||||
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
List<String> successMessages = new ArrayList<>();
|
||||
List<String> failureMessages = new ArrayList<>();
|
||||
|
||||
for (AttApiCatRespVO respVO : importExcelList) {
|
||||
try {
|
||||
AttApiCatDO attApiCatDO = BeanUtils.toBean(respVO, AttApiCatDO.class);
|
||||
Long attApiCatId = respVO.getId();
|
||||
if (isUpdateSupport) {
|
||||
if (attApiCatId != null) {
|
||||
AttApiCatDO existingAttApiCat = attApiCatMapper.selectById(attApiCatId);
|
||||
if (existingAttApiCat != null) {
|
||||
attApiCatMapper.updateById(attApiCatDO);
|
||||
successNum++;
|
||||
successMessages.add("数据更新成功,ID为 " + attApiCatId + " 的数据服务类目管理记录。");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据更新失败,ID为 " + attApiCatId + " 的数据服务类目管理记录不存在。");
|
||||
}
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据更新失败,某条记录的ID不存在。");
|
||||
}
|
||||
} else {
|
||||
QueryWrapper<AttApiCatDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", attApiCatId);
|
||||
AttApiCatDO existingAttApiCat = attApiCatMapper.selectOne(queryWrapper);
|
||||
if (existingAttApiCat == null) {
|
||||
attApiCatMapper.insert(attApiCatDO);
|
||||
successNum++;
|
||||
successMessages.add("数据插入成功,ID为 " + attApiCatId + " 的数据服务类目管理记录。");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据插入失败,ID为 " + attApiCatId + " 的数据服务类目管理记录已存在。");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String errorMsg = "数据导入失败,错误信息:" + e.getMessage();
|
||||
failureMessages.add(errorMsg);
|
||||
log.error(errorMsg, e);
|
||||
}
|
||||
}
|
||||
StringBuilder resultMsg = new StringBuilder();
|
||||
if (failureNum > 0) {
|
||||
resultMsg.append("很抱歉,导入失败!共 ").append(failureNum).append(" 条数据格式不正确,错误如下:");
|
||||
resultMsg.append("<br/>").append(String.join("<br/>", failureMessages));
|
||||
throw new ServiceException(500,resultMsg.toString());
|
||||
} else {
|
||||
resultMsg.append("恭喜您,数据已全部导入成功!共 ").append(successNum).append(" 条。");
|
||||
}
|
||||
return resultMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AttApiCatRespDTO> getAttApiCatList(AttApiCatReqDTO attApiCatReqDTO) {
|
||||
LambdaQueryWrapperX<AttApiCatDO> queryWrapperX = new LambdaQueryWrapperX<>();
|
||||
queryWrapperX.likeIfPresent(AttApiCatDO::getName, attApiCatReqDTO.getName())
|
||||
.eqIfPresent(AttApiCatDO::getParentId, attApiCatReqDTO.getParentId())
|
||||
.eqIfPresent(AttApiCatDO::getSortOrder, attApiCatReqDTO.getSortOrder())
|
||||
.eqIfPresent(AttApiCatDO::getDescription, attApiCatReqDTO.getDescription())
|
||||
.eqIfPresent(AttApiCatDO::getCode, attApiCatReqDTO.getCode())
|
||||
.orderByAsc(AttApiCatDO::getSortOrder);
|
||||
List<AttApiCatDO> attApiCatDOS = attApiCatMapper.selectList(queryWrapperX);
|
||||
if (attApiCatDOS!=null&&attApiCatDOS.size()>0) {
|
||||
List<AttApiCatRespDTO> attApiCatRespDTOS = new ArrayList<>();
|
||||
for (int i = 0; i < attApiCatDOS.size(); i++) {
|
||||
AttApiCatDO attApiCatDO = attApiCatDOS.get(i);
|
||||
AttApiCatRespDTO attApiCatRespDTO = BeanUtils.toBean(attApiCatDO, AttApiCatRespDTO.class);
|
||||
attApiCatRespDTOS.add(attApiCatRespDTO);
|
||||
}
|
||||
return attApiCatRespDTOS;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
@ -0,0 +1,230 @@
|
||||
package cn.iocoder.yudao.module.mdpf.service.cat.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatPageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatRespVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.cat.vo.AttCleanCatSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.controller.rule.vo.AttCleanRulePageReqVO;
|
||||
import cn.iocoder.yudao.module.mdpf.core.text.Convert;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.dataobject.cat.AttCleanCatDO;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.mapper.cat.AttCleanCatMapper;
|
||||
import cn.iocoder.yudao.module.mdpf.service.cat.IAttCleanCatService;
|
||||
import cn.iocoder.yudao.module.mdpf.service.rule.IAttCleanRuleService;
|
||||
import cn.iocoder.yudao.module.mdpf.util.StringUtils;
|
||||
import cn.iocoder.yudao.module.mdpf.util.YouBianCodeUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 清洗规则类目Service业务层处理
|
||||
*
|
||||
* @author qdata
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class AttCleanCatServiceImpl extends ServiceImpl<AttCleanCatMapper, AttCleanCatDO> implements IAttCleanCatService {
|
||||
@Resource
|
||||
private AttCleanCatMapper attCleanCatMapper;
|
||||
@Resource
|
||||
private IAttCleanRuleService attCleanRuleService;
|
||||
|
||||
@Override
|
||||
public PageResult<AttCleanCatDO> getAttCleanCatPage(AttCleanCatPageReqVO pageReqVO) {
|
||||
return attCleanCatMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Long createAttCleanCat(AttCleanCatSaveReqVO createReqVO) {
|
||||
AttCleanCatDO dictType = BeanUtils.toBean(createReqVO, AttCleanCatDO.class);
|
||||
dictType.setCode(createCode(createReqVO.getParentId(), null));
|
||||
attCleanCatMapper.insert(dictType);
|
||||
return dictType.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int updateAttCleanCat(AttCleanCatSaveReqVO updateReqVO) {
|
||||
// 相关校验
|
||||
|
||||
// 更新清洗规则类目
|
||||
AttCleanCatDO updateObj = BeanUtils.toBean(updateReqVO, AttCleanCatDO.class);
|
||||
return attCleanCatMapper.updateById(updateObj);
|
||||
}
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int removeAttCleanCat(Long idList) {
|
||||
// 批量删除清洗规则类目
|
||||
int count = 0;
|
||||
AttCleanCatDO cat = baseMapper.selectById(idList);
|
||||
|
||||
//判断是否存在数据
|
||||
AttCleanRulePageReqVO vo = new AttCleanRulePageReqVO();
|
||||
vo.setType(Convert.toStr(idList));
|
||||
if (attCleanRuleService.getCount(vo) > 0) {
|
||||
throw new RuntimeException("存在清洗规则模型,不允许删除");
|
||||
}
|
||||
|
||||
if (cat != null) {
|
||||
count += baseMapper.delete(Wrappers.lambdaQuery(AttCleanCatDO.class)
|
||||
.likeRight(AttCleanCatDO::getCode, cat.getCode()));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public AttCleanCatDO getAttCleanCatById(Long id) {
|
||||
return attCleanCatMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanCatDO> getAttCleanCatList(AttCleanCatPageReqVO attCleanCat) {
|
||||
LambdaQueryWrapperX<AttCleanCatDO> queryWrapperX = new LambdaQueryWrapperX<>();
|
||||
queryWrapperX.likeIfPresent(AttCleanCatDO::getName, attCleanCat.getName())
|
||||
.likeIfPresent(AttCleanCatDO::getCode, attCleanCat.getCode())
|
||||
.orderByAsc(AttCleanCatDO::getSortOrder);
|
||||
return attCleanCatMapper.selectList(queryWrapperX);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanCatDO> getAttCleanCatList() {
|
||||
return attCleanCatMapper.selectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Map<Long, AttCleanCatDO> getAttCleanCatMap() {
|
||||
List<AttCleanCatDO> attCleanCatList = attCleanCatMapper.selectList();
|
||||
return attCleanCatList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
AttCleanCatDO::getId,
|
||||
attCleanCatDO -> attCleanCatDO,
|
||||
// 保留已存在的值
|
||||
(existing, replacement) -> existing
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入清洗规则类目数据
|
||||
*
|
||||
* @param importExcelList 清洗规则类目数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("slave")
|
||||
public String importAttCleanCat(List<AttCleanCatRespVO> importExcelList, boolean isUpdateSupport, String operName) {
|
||||
if (StringUtils.isNull(importExcelList) || importExcelList.size() == 0) {
|
||||
throw new RuntimeException("导入数据不能为空!");
|
||||
}
|
||||
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
List<String> successMessages = new ArrayList<>();
|
||||
List<String> failureMessages = new ArrayList<>();
|
||||
|
||||
for (AttCleanCatRespVO respVO : importExcelList) {
|
||||
try {
|
||||
AttCleanCatDO attCleanCatDO = BeanUtils.toBean(respVO, AttCleanCatDO.class);
|
||||
Long attCleanCatId = respVO.getId();
|
||||
if (isUpdateSupport) {
|
||||
if (attCleanCatId != null) {
|
||||
AttCleanCatDO existingAttCleanCat = attCleanCatMapper.selectById(attCleanCatId);
|
||||
if (existingAttCleanCat != null) {
|
||||
attCleanCatMapper.updateById(attCleanCatDO);
|
||||
successNum++;
|
||||
successMessages.add("数据更新成功,ID为 " + attCleanCatId + " 的清洗规则类目记录。");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据更新失败,ID为 " + attCleanCatId + " 的清洗规则类目记录不存在。");
|
||||
}
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据更新失败,某条记录的ID不存在。");
|
||||
}
|
||||
} else {
|
||||
QueryWrapper<AttCleanCatDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", attCleanCatId);
|
||||
AttCleanCatDO existingAttCleanCat = attCleanCatMapper.selectOne(queryWrapper);
|
||||
if (existingAttCleanCat == null) {
|
||||
attCleanCatMapper.insert(attCleanCatDO);
|
||||
successNum++;
|
||||
successMessages.add("数据插入成功,ID为 " + attCleanCatId + " 的清洗规则类目记录。");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMessages.add("数据插入失败,ID为 " + attCleanCatId + " 的清洗规则类目记录已存在。");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String errorMsg = "数据导入失败,错误信息:" + e.getMessage();
|
||||
failureMessages.add(errorMsg);
|
||||
log.error(errorMsg, e);
|
||||
}
|
||||
}
|
||||
StringBuilder resultMsg = new StringBuilder();
|
||||
if (failureNum > 0) {
|
||||
resultMsg.append("很抱歉,导入失败!共 ").append(failureNum).append(" 条数据格式不正确,错误如下:");
|
||||
resultMsg.append("<br/>").append(String.join("<br/>", failureMessages));
|
||||
throw new RuntimeException(resultMsg.toString());
|
||||
} else {
|
||||
resultMsg.append("恭喜您,数据已全部导入成功!共 ").append(successNum).append(" 条。");
|
||||
}
|
||||
return resultMsg.toString();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public String createCode(Long parentId, String parentCode) {
|
||||
String categoryCode = null;
|
||||
/*
|
||||
* 分成三种情况
|
||||
* 1.数据库无数据 调用YouBianCodeUtil.getNextYouBianCode(null);
|
||||
* 2.添加子节点,无兄弟元素 YouBianCodeUtil.getSubYouBianCode(parentCode,null);
|
||||
* 3.添加子节点有兄弟元素 YouBianCodeUtil.getNextYouBianCode(lastCode);
|
||||
* */
|
||||
//找同类 确定上一个最大的code值
|
||||
LambdaQueryWrapper<AttCleanCatDO> query = new LambdaQueryWrapper<AttCleanCatDO>()
|
||||
.eq(AttCleanCatDO::getParentId, parentId)
|
||||
.likeRight(StringUtils.isNotBlank(parentCode), AttCleanCatDO::getCode, parentCode)
|
||||
.isNotNull(AttCleanCatDO::getCode)
|
||||
.orderByDesc(AttCleanCatDO::getCode);
|
||||
List<AttCleanCatDO> list = baseMapper.selectList(query);
|
||||
if (list == null || list.size() == 0) {
|
||||
if (parentId == 0) {
|
||||
//情况1
|
||||
categoryCode = YouBianCodeUtil.getNextYouBianCode(null);
|
||||
} else {
|
||||
//情况2
|
||||
AttCleanCatDO parent = baseMapper.selectById(parentId);
|
||||
categoryCode = YouBianCodeUtil.getSubYouBianCode(parent.getCode(), null);
|
||||
}
|
||||
} else {
|
||||
//情况3
|
||||
categoryCode = YouBianCodeUtil.getNextYouBianCode(list.get(0).getCode());
|
||||
}
|
||||
return categoryCode;
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums.RuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.mapper.rule.AttAuditRuleMapper;
|
||||
import cn.iocoder.yudao.module.mdpf.service.rule.IAttAuditRuleService;
|
||||
import cn.iocoder.yudao.module.mdpf.util.StringUtils;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -38,11 +39,13 @@ public class AttAuditRuleServiceImpl extends ServiceImpl<AttAuditRuleMapper, Att
|
||||
private AttAuditRuleMapper attAuditRuleMapper;
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public PageResult<AttAuditRuleDO> getAttAuditRulePage(AttAuditRulePageReqVO pageReqVO) {
|
||||
return attAuditRuleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Long createAttAuditRule(AttAuditRuleSaveReqVO createReqVO) {
|
||||
AttAuditRuleDO dictType = BeanUtils.toBean(createReqVO, AttAuditRuleDO.class);
|
||||
attAuditRuleMapper.insert(dictType);
|
||||
@ -50,6 +53,7 @@ public class AttAuditRuleServiceImpl extends ServiceImpl<AttAuditRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int updateAttAuditRule(AttAuditRuleSaveReqVO updateReqVO) {
|
||||
// 相关校验
|
||||
|
||||
@ -59,6 +63,7 @@ public class AttAuditRuleServiceImpl extends ServiceImpl<AttAuditRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int removeAttAuditRule(Collection<Long> idList) {
|
||||
// 批量删除稽查规则
|
||||
return attAuditRuleMapper.deleteBatchIds(idList);
|
||||
|
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.mdpf.dal.dataobject.rule.enums.CleanRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.mdpf.dal.mapper.rule.AttCleanRuleMapper;
|
||||
import cn.iocoder.yudao.module.mdpf.service.rule.IAttCleanRuleService;
|
||||
import cn.iocoder.yudao.module.mdpf.util.StringUtils;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -42,11 +43,13 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public PageResult<AttCleanRuleDO> getAttCleanRulePage(AttCleanRulePageReqVO pageReqVO) {
|
||||
return attCleanRuleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Long createAttCleanRule(AttCleanRuleSaveReqVO createReqVO) {
|
||||
List<AttCleanRuleDO> code = attCleanRuleMapper.selectList("code", createReqVO.getCode());
|
||||
if (code.size() > 0) {
|
||||
@ -58,6 +61,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int updateAttCleanRule(AttCleanRuleSaveReqVO updateReqVO) {
|
||||
// 相关校验
|
||||
List<AttCleanRuleDO> code = attCleanRuleMapper.selectList("code", updateReqVO.getCode());
|
||||
@ -70,22 +74,26 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public int removeAttCleanRule(Collection<Long> idList) {
|
||||
// 批量删除清洗规则
|
||||
return attCleanRuleMapper.deleteBatchIds(idList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public AttCleanRuleDO getAttCleanRuleById(Long id) {
|
||||
return attCleanRuleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanRuleDO> getAttCleanRuleList() {
|
||||
return attCleanRuleMapper.selectList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanRuleRespVO> getAttCleanRuleList(AttCleanRulePageReqVO attCleanRule) {
|
||||
|
||||
MPJLambdaWrapper<AttCleanRuleDO> lambdaWrapper = new MPJLambdaWrapper();
|
||||
@ -107,6 +115,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Map<Long, AttCleanRuleDO> getAttCleanRuleMap() {
|
||||
List<AttCleanRuleDO> attCleanRuleList = attCleanRuleMapper.selectList();
|
||||
return attCleanRuleList.stream()
|
||||
@ -126,6 +135,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("slave")
|
||||
public String importAttCleanRule(List<AttCleanRuleRespVO> importExcelList, boolean isUpdateSupport,
|
||||
String operName) {
|
||||
if (StringUtils.isNull(importExcelList) || importExcelList.size() == 0) {
|
||||
@ -188,6 +198,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanRuleRespVO> getAttCleanRuleTree(Long dataElemId) {
|
||||
// 1. 获取所有清洗规则列表
|
||||
List<AttCleanRuleDO> list = attCleanRuleMapper.selectAttCleanRuleList(dataElemId);
|
||||
@ -198,6 +209,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public List<AttCleanRuleRespVO> getCleaningRuleTree(Long[] dataElemId) {
|
||||
List<AttCleanRuleDO> list =null;
|
||||
if (dataElemId == null || dataElemId.length == 0) {
|
||||
@ -213,6 +225,7 @@ public class AttCleanRuleServiceImpl extends ServiceImpl<AttCleanRuleMapper, Att
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("slave")
|
||||
public Long getCount(AttCleanRulePageReqVO vo) {
|
||||
return attCleanRuleMapper.selectCount(Wrappers.lambdaQuery(AttCleanRuleDO.class)
|
||||
.likeRight(AttCleanRuleDO::getType, vo.getType()));
|
||||
|
@ -1,115 +0,0 @@
|
||||
<?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="cn.iocoder.yudao.module.mdpf.dal.mapper.cat.AttApiCatMapper">
|
||||
|
||||
<resultMap type="AttApiCatDO" id="AttApiCatResult">
|
||||
<result property="id" column="ID" />
|
||||
<result property="name" column="NAME" />
|
||||
<result property="parentId" column="PARENT_ID" />
|
||||
<result property="sortOrder" column="SORT_ORDER" />
|
||||
<result property="description" column="DESCRIPTION" />
|
||||
<result property="code" column="CODE" />
|
||||
<result property="validFlag" column="VALID_FLAG" />
|
||||
<result property="delFlag" column="DEL_FLAG" />
|
||||
<result property="createBy" column="CREATE_BY" />
|
||||
<result property="creatorId" column="CREATOR_ID" />
|
||||
<result property="createTime" column="CREATE_TIME" />
|
||||
<result property="updateBy" column="UPDATE_BY" />
|
||||
<result property="updaterId" column="UPDATER_ID" />
|
||||
<result property="updateTime" column="UPDATE_TIME" />
|
||||
<result property="remark" column="REMARK" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttApiCatVo">
|
||||
select ID, NAME, PARENT_ID, SORT_ORDER, DESCRIPTION, CODE, VALID_FLAG, DEL_FLAG, CREATE_BY, CREATOR_ID, CREATE_TIME, UPDATE_BY, UPDATER_ID, UPDATE_TIME, REMARK from ATT_API_CAT
|
||||
</sql>
|
||||
|
||||
<select id="selectAttApiCatList" parameterType="AttApiCatDO" resultMap="AttApiCatResult">
|
||||
<include refid="selectAttApiCatVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and NAME like concat('%', #{name}, '%')</if>
|
||||
<if test="parentId != null "> and PARENT_ID = #{parentId}</if>
|
||||
<if test="sortOrder != null "> and SORT_ORDER = #{sortOrder}</if>
|
||||
<if test="description != null and description != ''"> and DESCRIPTION = #{description}</if>
|
||||
<if test="code != null and code != ''"> and CODE = #{code}</if>
|
||||
<if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAttApiCatById" parameterType="Long" resultMap="AttApiCatResult">
|
||||
<include refid="selectAttApiCatVo"/>
|
||||
where ID = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAttApiCat" parameterType="AttApiCatDO">
|
||||
insert into ATT_API_CAT
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">ID,</if>
|
||||
<if test="name != null">NAME,</if>
|
||||
<if test="parentId != null">PARENT_ID,</if>
|
||||
<if test="sortOrder != null">SORT_ORDER,</if>
|
||||
<if test="description != null">DESCRIPTION,</if>
|
||||
<if test="code != null">CODE,</if>
|
||||
<if test="validFlag != null">VALID_FLAG,</if>
|
||||
<if test="delFlag != null">DEL_FLAG,</if>
|
||||
<if test="createBy != null">CREATE_BY,</if>
|
||||
<if test="creatorId != null">CREATOR_ID,</if>
|
||||
<if test="createTime != null">CREATE_TIME,</if>
|
||||
<if test="updateBy != null">UPDATE_BY,</if>
|
||||
<if test="updaterId != null">UPDATER_ID,</if>
|
||||
<if test="updateTime != null">UPDATE_TIME,</if>
|
||||
<if test="remark != null">REMARK,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="sortOrder != null">#{sortOrder},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="code != null">#{code},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updaterId != null">#{updaterId},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAttApiCat" parameterType="AttApiCatDO">
|
||||
update ATT_API_CAT
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">NAME = #{name},</if>
|
||||
<if test="parentId != null">PARENT_ID = #{parentId},</if>
|
||||
<if test="sortOrder != null">SORT_ORDER = #{sortOrder},</if>
|
||||
<if test="description != null">DESCRIPTION = #{description},</if>
|
||||
<if test="code != null">CODE = #{code},</if>
|
||||
<if test="validFlag != null">VALID_FLAG = #{validFlag},</if>
|
||||
<if test="delFlag != null">DEL_FLAG = #{delFlag},</if>
|
||||
<if test="createBy != null">CREATE_BY = #{createBy},</if>
|
||||
<if test="creatorId != null">CREATOR_ID = #{creatorId},</if>
|
||||
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
||||
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
||||
<if test="updaterId != null">UPDATER_ID = #{updaterId},</if>
|
||||
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
||||
<if test="remark != null">REMARK = #{remark},</if>
|
||||
</trim>
|
||||
where ID = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAttApiCatById" parameterType="Long">
|
||||
delete from ATT_API_CAT where ID = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAttApiCatByIds" parameterType="String">
|
||||
delete from ATT_API_CAT where ID in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -12,11 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="level" column="LEVEL" />
|
||||
<result property="description" column="DESCRIPTION" />
|
||||
<result property="validFlag" column="VALID_FLAG" />
|
||||
<result property="delFlag" column="DEL_FLAG" />
|
||||
<result property="createBy" column="CREATE_BY" />
|
||||
<result property="deleted" column="deleted" />
|
||||
<result property="creator" column="CREATE_BY" />
|
||||
<result property="creatorId" column="CREATOR_ID" />
|
||||
<result property="createTime" column="CREATE_TIME" />
|
||||
<result property="updateBy" column="UPDATE_BY" />
|
||||
<result property="updater" column="UPDATE_BY" />
|
||||
<result property="updaterId" column="UPDATER_ID" />
|
||||
<result property="updateTime" column="UPDATE_TIME" />
|
||||
<result property="remark" column="REMARK" />
|
||||
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttAuditRuleVo">
|
||||
select ID, NAME, QUALITY_DIM, TYPE, LEVEL, DESCRIPTION, CODE, USE_CASE, EXAMPLE, ICON_PATH, STRATEGY_KEY,VALID_FLAG, DEL_FLAG, CREATE_BY, CREATOR_ID, CREATE_TIME, UPDATE_BY, UPDATER_ID, UPDATE_TIME, REMARK from ATT_AUDIT_RULE
|
||||
select ID, NAME, QUALITY_DIM, TYPE, LEVEL, DESCRIPTION, CODE, USE_CASE, EXAMPLE, ICON_PATH, STRATEGY_KEY,VALID_FLAG, deleted, CREATOR, CREATOR_ID, CREATE_TIME, UPDATER, UPDATER_ID, UPDATE_TIME, REMARK from ATT_AUDIT_RULE
|
||||
</sql>
|
||||
|
||||
<select id="selectAttAuditRuleList" parameterType="Long" resultMap="AttAuditRuleResult">
|
||||
@ -43,9 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
r.RULE_CONFIG AS "ruleConfig"
|
||||
from
|
||||
ATT_AUDIT_RULE a
|
||||
LEFT JOIN DP_DATA_ELEM_RULE_REL r ON a.ID = r.RULE_ID AND r.RULE_TYPE = '1' AND r.DATA_ELEM_ID = #{dataElemId} AND r.DEL_FLAG = '0'
|
||||
LEFT JOIN DP_DATA_ELEM_RULE_REL r ON a.ID = r.RULE_ID AND r.RULE_TYPE = '1' AND r.DATA_ELEM_ID = #{dataElemId} AND r.DELETED = '0'
|
||||
WHERE
|
||||
a.DEL_FLAG = '0'
|
||||
a.DELETED = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectAttAuditRuleByID" parameterType="Long" resultMap="AttAuditRuleResult">
|
||||
@ -63,11 +63,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="level != null">LEVEL,</if>
|
||||
<if test="description != null">DESCRIPTION,</if>
|
||||
<if test="validFlag != null">VALID_FLAG,</if>
|
||||
<if test="delFlag != null">DEL_FLAG,</if>
|
||||
<if test="createBy != null">CREATE_BY,</if>
|
||||
<if test="delFlag != null">DELETED,</if>
|
||||
<if test="createBy != null">CREATOR,</if>
|
||||
<if test="creatorId != null">CREATOR_ID,</if>
|
||||
<if test="createTime != null">CREATE_TIME,</if>
|
||||
<if test="updateBy != null">UPDATE_BY,</if>
|
||||
<if test="updateBy != null">UPDATER,</if>
|
||||
<if test="updaterId != null">UPDATER_ID,</if>
|
||||
<if test="updateTime != null">UPDATE_TIME,</if>
|
||||
<if test="remark != null">REMARK,</if>
|
||||
@ -85,11 +85,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="validFlag != null">#{validFlag},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="delFlag != null">#{deleted},</if>
|
||||
<if test="createBy != null">#{createor},</if>
|
||||
<if test="creatorId != null">#{creatorId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateBy != null">#{updater},</if>
|
||||
<if test="updaterId != null">#{updaterId},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
@ -110,11 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="level != null">LEVEL = #{level},</if>
|
||||
<if test="description != null">DESCRIPTION = #{description},</if>
|
||||
<if test="validFlag != null">VALID_FLAG = #{validFlag},</if>
|
||||
<if test="delFlag != null">DEL_FLAG = #{delFlag},</if>
|
||||
<if test="createBy != null">CREATE_BY = #{createBy},</if>
|
||||
<if test="delFlag != null">deleted = #{deleted},</if>
|
||||
<if test="createBy != null">CREATEOR = #{createor},</if>
|
||||
<if test="creatorId != null">CREATOR_ID = #{creatorId},</if>
|
||||
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
||||
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
|
||||
<if test="updateBy != null">UPDATER = #{updater},</if>
|
||||
<if test="updaterId != null">UPDATER_ID = #{updaterId},</if>
|
||||
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
||||
<if test="remark != null">REMARK = #{remark},</if>
|
||||
|
Loading…
x
Reference in New Issue
Block a user