调整
This commit is contained in:
parent
17e1c168eb
commit
9fd489d5a5
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.label.controller.admin;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Tag(name = "管理后台 - 标签库")
|
||||
@RestController
|
||||
@RequestMapping("/base/busiLabel")
|
||||
@Validated
|
||||
public class BusiLabelController {
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.label.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 业务标签 DO
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
@TableName("base_busi_label")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusiLabel extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键标识
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
/**
|
||||
* 主表名称
|
||||
*/
|
||||
private String mainTable;
|
||||
/**
|
||||
* 主表id
|
||||
*/
|
||||
private String mainId;
|
||||
/**
|
||||
* 标签库标签id
|
||||
*/
|
||||
private String labelId;
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
private String labelName;
|
||||
/**
|
||||
* 标签内容
|
||||
*/
|
||||
private String labelContent;
|
||||
/**
|
||||
* 系统标识
|
||||
*/
|
||||
private String systemCode;
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.label.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 客户管理扩展Mapper
|
||||
*
|
||||
* @author pqz
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusiLabelMapper extends BaseMapper<BusiLabel> {
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.label.service;
|
||||
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import cn.iocoder.yudao.module.label.vo.BusiLabelSaveReqVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标签库 Service 接口
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
public interface BusiLabelService extends IService<BusiLabel> {
|
||||
|
||||
/**
|
||||
* 通过mainId查询业务标签
|
||||
*
|
||||
* @param mainId mainId
|
||||
* @return java.util.List<cn.iocoder.yudao.module.label.entity.BusiLabel>
|
||||
* @author PQZ
|
||||
* @date 18:22 2024/8/4
|
||||
**/
|
||||
List<BusiLabel> listByMainId(String mainId);
|
||||
|
||||
/**
|
||||
* 保存标签
|
||||
*
|
||||
* @param mainId 主表id
|
||||
* @param mainTable 主表名称
|
||||
* @param labelList 标签集合
|
||||
* @return void
|
||||
* @author PQZ
|
||||
* @date 18:39 2024/8/4
|
||||
**/
|
||||
void saveBusiLable(String mainId, String mainTable, List<BusiLabel> labelList);
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.label.service.impl;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import cn.iocoder.yudao.module.label.mapper.BusiLabelMapper;
|
||||
import cn.iocoder.yudao.module.label.service.BusiLabelService;
|
||||
import cn.iocoder.yudao.module.label.vo.BusiLabelSaveReqVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标签库 Service 实现类
|
||||
*
|
||||
* @author 后台管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusiLabelServiceImpl extends ServiceImpl<BusiLabelMapper, BusiLabel> implements BusiLabelService {
|
||||
|
||||
/**
|
||||
* 通过mainId查询业务标签
|
||||
*
|
||||
* @param mainId mainId
|
||||
* @return java.util.List<cn.iocoder.yudao.module.label.entity.BusiLabel>
|
||||
* @author PQZ
|
||||
* @date 18:22 2024/8/4
|
||||
**/
|
||||
@Override
|
||||
public List<BusiLabel> listByMainId(String mainId) {
|
||||
LambdaQueryWrapper<BusiLabel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BaseDO::getDeleted,0).eq(BusiLabel::getMainId,mainId);
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存标签
|
||||
*
|
||||
* @param mainId 主表id
|
||||
* @param mainTable 主表名称
|
||||
* @param labelList 标签集合
|
||||
* @return void
|
||||
* @author PQZ
|
||||
* @date 18:39 2024/8/4
|
||||
**/
|
||||
@Override
|
||||
public void saveBusiLable(String mainId, String mainTable, List<BusiLabel> labelList) {
|
||||
/*1、删除已有标签信息*/
|
||||
LambdaQueryWrapper<BusiLabel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BaseDO::getDeleted,0).eq(BusiLabel::getMainId,mainId);
|
||||
this.remove(lambdaQueryWrapper);
|
||||
/*2、保存标签信息*/
|
||||
labelList.forEach(item -> {
|
||||
item.setId(null);
|
||||
item.setMainId(mainId);
|
||||
item.setMainTable(mainTable);
|
||||
});
|
||||
this.saveBatch(labelList);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.label.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 业务标签分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BusiLabelPageReqVO extends BusiLabel {
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.label.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务标签 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusiLabelRespVO extends BusiLabel {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.iocoder.yudao.module.label.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 业务标签新增/修改 Request VO")
|
||||
@Data
|
||||
public class BusiLabelSaveReqVO {
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<?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.label.mapper.BusiLabelMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user