yangshun 3 hete
szülő
commit
ba63bdb355

+ 104 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/controller/admin/expertinfo/ExpertInfoController.java

@@ -0,0 +1,104 @@
+package com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import com.cy.guoyan.admin.framework.common.pojo.PageParam;
+import com.cy.guoyan.admin.framework.common.pojo.PageResult;
+import com.cy.guoyan.admin.framework.common.pojo.CommonResult;
+import com.cy.guoyan.admin.framework.common.util.object.BeanUtils;
+import static com.cy.guoyan.admin.framework.common.pojo.CommonResult.success;
+
+import com.cy.guoyan.admin.framework.excel.core.util.ExcelUtils;
+
+import com.cy.guoyan.admin.framework.apilog.core.annotation.ApiAccessLog;
+import static com.cy.guoyan.admin.framework.apilog.core.enums.OperateTypeEnum.*;
+
+import com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo.*;
+import com.cy.guoyan.admin.module.guoyan.dal.dataobject.expertinfo.ExpertInfoDO;
+import com.cy.guoyan.admin.module.guoyan.service.expertinfo.ExpertInfoService;
+
+@Tag(name = "管理后台 - 专家信息")
+@RestController
+@RequestMapping("/guoyan/expert-info")
+@Validated
+public class ExpertInfoController {
+
+    @Resource
+    private ExpertInfoService expertInfoService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建专家信息")
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:create')")
+    public CommonResult<Long> createExpertInfo(@Valid @RequestBody ExpertInfoSaveReqVO createReqVO) {
+        return success(expertInfoService.createExpertInfo(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新专家信息")
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:update')")
+    public CommonResult<Boolean> updateExpertInfo(@Valid @RequestBody ExpertInfoSaveReqVO updateReqVO) {
+        expertInfoService.updateExpertInfo(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除专家信息")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:delete')")
+    public CommonResult<Boolean> deleteExpertInfo(@RequestParam("id") Long id) {
+        expertInfoService.deleteExpertInfo(id);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete-list")
+    @Parameter(name = "ids", description = "编号", required = true)
+    @Operation(summary = "批量删除专家信息")
+                @PreAuthorize("@ss.hasPermission('guoyan:expert-info:delete')")
+    public CommonResult<Boolean> deleteExpertInfoList(@RequestParam("ids") List<Long> ids) {
+        expertInfoService.deleteExpertInfoListByIds(ids);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得专家信息")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:query')")
+    public CommonResult<ExpertInfoRespVO> getExpertInfo(@RequestParam("id") Long id) {
+        ExpertInfoDO expertInfo = expertInfoService.getExpertInfo(id);
+        return success(BeanUtils.toBean(expertInfo, ExpertInfoRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得专家信息分页")
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:query')")
+    public CommonResult<PageResult<ExpertInfoRespVO>> getExpertInfoPage(@Valid ExpertInfoPageReqVO pageReqVO) {
+        PageResult<ExpertInfoDO> pageResult = expertInfoService.getExpertInfoPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, ExpertInfoRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出专家信息 Excel")
+    @PreAuthorize("@ss.hasPermission('guoyan:expert-info:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportExpertInfoExcel(@Valid ExpertInfoPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ExpertInfoDO> list = expertInfoService.getExpertInfoPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "专家信息.xls", "数据", ExpertInfoRespVO.class,
+                        BeanUtils.toBean(list, ExpertInfoRespVO.class));
+    }
+
+}

+ 44 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/controller/admin/expertinfo/vo/ExpertInfoPageReqVO.java

@@ -0,0 +1,44 @@
+package com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import com.cy.guoyan.admin.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static com.cy.guoyan.admin.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 专家信息分页 Request VO")
+@Data
+public class ExpertInfoPageReqVO extends PageParam {
+
+    @Schema(description = "专家姓名", example = "王五")
+    private String expertName;
+
+    @Schema(description = "性别")
+    private String gender;
+
+    @Schema(description = "政治面貌", example = "2")
+    private String politicalStatus;
+
+    @Schema(description = "电话")
+    private String phone;
+
+    @Schema(description = "职业状态", example = "2")
+    private String jobStatus;
+
+    @Schema(description = "民族")
+    private String ethnicity;
+
+    @Schema(description = "籍贯")
+    private String birthplace;
+
+    @Schema(description = "电子邮箱")
+    private String email;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 135 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/controller/admin/expertinfo/vo/ExpertInfoRespVO.java

@@ -0,0 +1,135 @@
+package com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo;
+
+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.*;
+import com.cy.guoyan.admin.framework.excel.core.annotations.DictFormat;
+import com.cy.guoyan.admin.framework.excel.core.convert.DictConvert;
+
+@Schema(description = "管理后台 - 专家信息 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ExpertInfoRespVO {
+
+    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29963")
+    @ExcelProperty("主键ID")
+    private Long id;
+
+    @Schema(description = "专家姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+    @ExcelProperty("专家姓名")
+    private String expertName;
+
+    @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("性别")
+    private String gender;
+
+    @Schema(description = "政治面貌", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty(value = "政治面貌", converter = DictConvert.class)
+    @DictFormat("expert_political_aspects") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+    private String politicalStatus;
+
+    @Schema(description = "电话", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("电话")
+    private String phone;
+
+    @Schema(description = "职业状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty(value = "职业状态", converter = DictConvert.class)
+    @DictFormat("expert_professional_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+    private String jobStatus;
+
+    @Schema(description = "现任/原任职务", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("现任/原任职务")
+    private String currentOrFormerTitle;
+
+    @Schema(description = "身份证号/护照号", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("身份证号/护照号")
+    private String idOrPassport;
+
+    @Schema(description = "银行卡号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19485")
+    @ExcelProperty("银行卡号")
+    private String bankAccount;
+
+    @Schema(description = "开户行", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+    @ExcelProperty("开户行")
+    private String bankName;
+
+    @Schema(description = "专业技术职称/职业资格")
+    @ExcelProperty("专业技术职称/职业资格")
+    private String professionalTitle;
+
+    @Schema(description = "主要成果奖励、荣誉称号、出版著作、授权专利等", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("主要成果奖励、荣誉称号、出版著作、授权专利等")
+    private String majorAchievements;
+
+    @Schema(description = "国内外主要学术组织、社会团体及其他智库兼职情况", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("国内外主要学术组织、社会团体及其他智库兼职情况")
+    private String academicSocietyRoles;
+
+    @Schema(description = "专业、熟悉领域", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("专业、熟悉领域")
+    private String specialties;
+
+    @Schema(description = "学术、学历背景", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("学术、学历背景")
+    private String academicBackground;
+
+    @Schema(description = "专业经验-年", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("专业经验-年")
+    private String yearsOfExperience;
+
+    @Schema(description = "专业影响力", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("专业影响力")
+    private String professionalInfluence;
+
+    @Schema(description = "主要学习和工作经历", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("主要学习和工作经历")
+    private String workAndStudyExperience;
+
+    @Schema(description = "主要成绩")
+    @ExcelProperty("主要成绩")
+    private String mainContributions;
+
+    @Schema(description = "专家头衔", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("专家头衔")
+    private String expertTitle;
+
+    @Schema(description = "入库日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("入库日期")
+    private String entryDate;
+
+    @Schema(description = "民族")
+    @ExcelProperty("民族")
+    private String ethnicity;
+
+    @Schema(description = "籍贯")
+    @ExcelProperty("籍贯")
+    private String birthplace;
+
+    @Schema(description = "现工作单位及职务")
+    @ExcelProperty("现工作单位及职务")
+    private String currentWorkplace;
+
+    @Schema(description = "通讯地址")
+    @ExcelProperty("通讯地址")
+    private String address;
+
+    @Schema(description = "电子邮箱")
+    @ExcelProperty("电子邮箱")
+    private String email;
+
+    @Schema(description = "毕业院校及专业-在职")
+    @ExcelProperty("毕业院校及专业-在职")
+    private String graduatedSchool;
+
+    @Schema(description = "备注")
+    @ExcelProperty("备注")
+    private String remarks;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 114 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/controller/admin/expertinfo/vo/ExpertInfoSaveReqVO.java

@@ -0,0 +1,114 @@
+package com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 专家信息新增/修改 Request VO")
+@Data
+public class ExpertInfoSaveReqVO {
+
+    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29963")
+    private Long id;
+
+    @Schema(description = "专家姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
+    @NotEmpty(message = "专家姓名不能为空")
+    private String expertName;
+
+    @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "性别不能为空")
+    private String gender;
+
+    @Schema(description = "政治面貌", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotEmpty(message = "政治面貌不能为空")
+    private String politicalStatus;
+
+    @Schema(description = "电话", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "电话不能为空")
+    private String phone;
+
+    @Schema(description = "职业状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotEmpty(message = "职业状态不能为空")
+    private String jobStatus;
+
+    @Schema(description = "现任/原任职务", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "现任/原任职务不能为空")
+    private String currentOrFormerTitle;
+
+    @Schema(description = "身份证号/护照号", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "身份证号/护照号不能为空")
+    private String idOrPassport;
+
+    @Schema(description = "银行卡号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19485")
+    @NotEmpty(message = "银行卡号不能为空")
+    private String bankAccount;
+
+    @Schema(description = "开户行", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
+    @NotEmpty(message = "开户行不能为空")
+    private String bankName;
+
+    @Schema(description = "专业技术职称/职业资格")
+    private String professionalTitle;
+
+    @Schema(description = "主要成果奖励、荣誉称号、出版著作、授权专利等", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "主要成果奖励、荣誉称号、出版著作、授权专利等不能为空")
+    private String majorAchievements;
+
+    @Schema(description = "国内外主要学术组织、社会团体及其他智库兼职情况", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "国内外主要学术组织、社会团体及其他智库兼职情况不能为空")
+    private String academicSocietyRoles;
+
+    @Schema(description = "专业、熟悉领域", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "专业、熟悉领域不能为空")
+    private String specialties;
+
+    @Schema(description = "学术、学历背景", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "学术、学历背景不能为空")
+    private String academicBackground;
+
+    @Schema(description = "专业经验-年", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "专业经验-年不能为空")
+    private String yearsOfExperience;
+
+    @Schema(description = "专业影响力", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "专业影响力不能为空")
+    private String professionalInfluence;
+
+    @Schema(description = "主要学习和工作经历", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "主要学习和工作经历不能为空")
+    private String workAndStudyExperience;
+
+    @Schema(description = "主要成绩")
+    private String mainContributions;
+
+    @Schema(description = "专家头衔", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "专家头衔不能为空")
+    private String expertTitle;
+
+    @Schema(description = "入库日期", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "入库日期不能为空")
+    private String entryDate;
+
+    @Schema(description = "民族")
+    private String ethnicity;
+
+    @Schema(description = "籍贯")
+    private String birthplace;
+
+    @Schema(description = "现工作单位及职务")
+    private String currentWorkplace;
+
+    @Schema(description = "通讯地址")
+    private String address;
+
+    @Schema(description = "电子邮箱")
+    private String email;
+
+    @Schema(description = "毕业院校及专业-在职")
+    private String graduatedSchool;
+
+    @Schema(description = "备注")
+    private String remarks;
+
+}

+ 144 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/dal/dataobject/expertinfo/ExpertInfoDO.java

@@ -0,0 +1,144 @@
+package com.cy.guoyan.admin.module.guoyan.dal.dataobject.expertinfo;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import com.cy.guoyan.admin.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 专家信息 DO
+ *
+ * @author 管理员
+ */
+@TableName("guoyan_expert_info")
+@KeySequence("guoyan_expert_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ExpertInfoDO extends BaseDO {
+
+    /**
+     * 主键ID
+     */
+    @TableId
+    private Long id;
+    /**
+     * 专家姓名
+     */
+    private String expertName;
+    /**
+     * 性别
+     */
+    private String gender;
+    /**
+     * 政治面貌
+     *
+     * 枚举 {@link TODO expert_political_aspects 对应的类}
+     */
+    private String politicalStatus;
+    /**
+     * 电话
+     */
+    private String phone;
+    /**
+     * 职业状态
+     *
+     * 枚举 {@link TODO expert_professional_status 对应的类}
+     */
+    private String jobStatus;
+    /**
+     * 现任/原任职务
+     */
+    private String currentOrFormerTitle;
+    /**
+     * 身份证号/护照号
+     */
+    private String idOrPassport;
+    /**
+     * 银行卡号
+     */
+    private String bankAccount;
+    /**
+     * 开户行
+     */
+    private String bankName;
+    /**
+     * 专业技术职称/职业资格
+     */
+    private String professionalTitle;
+    /**
+     * 主要成果奖励、荣誉称号、出版著作、授权专利等
+     */
+    private String majorAchievements;
+    /**
+     * 国内外主要学术组织、社会团体及其他智库兼职情况
+     */
+    private String academicSocietyRoles;
+    /**
+     * 专业、熟悉领域
+     */
+    private String specialties;
+    /**
+     * 学术、学历背景
+     */
+    private String academicBackground;
+    /**
+     * 专业经验-年
+     */
+    private String yearsOfExperience;
+    /**
+     * 专业影响力
+     */
+    private String professionalInfluence;
+    /**
+     * 主要学习和工作经历
+     */
+    private String workAndStudyExperience;
+    /**
+     * 主要成绩
+     */
+    private String mainContributions;
+    /**
+     * 专家头衔
+     */
+    private String expertTitle;
+    /**
+     * 入库日期
+     */
+    private String entryDate;
+    /**
+     * 民族
+     */
+    private String ethnicity;
+    /**
+     * 籍贯
+     */
+    private String birthplace;
+    /**
+     * 现工作单位及职务
+     */
+    private String currentWorkplace;
+    /**
+     * 通讯地址
+     */
+    private String address;
+    /**
+     * 电子邮箱
+     */
+    private String email;
+    /**
+     * 毕业院校及专业-在职
+     */
+    private String graduatedSchool;
+    /**
+     * 备注
+     */
+    private String remarks;
+
+
+}

+ 34 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/dal/mysql/expertinfo/ExpertInfoMapper.java

@@ -0,0 +1,34 @@
+package com.cy.guoyan.admin.module.guoyan.dal.mysql.expertinfo;
+
+import java.util.*;
+
+import com.cy.guoyan.admin.framework.common.pojo.PageResult;
+import com.cy.guoyan.admin.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.cy.guoyan.admin.framework.mybatis.core.mapper.BaseMapperX;
+import com.cy.guoyan.admin.module.guoyan.dal.dataobject.expertinfo.ExpertInfoDO;
+import org.apache.ibatis.annotations.Mapper;
+import com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo.*;
+
+/**
+ * 专家信息 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface ExpertInfoMapper extends BaseMapperX<ExpertInfoDO> {
+
+    default PageResult<ExpertInfoDO> selectPage(ExpertInfoPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<ExpertInfoDO>()
+                .likeIfPresent(ExpertInfoDO::getExpertName, reqVO.getExpertName())
+                .eqIfPresent(ExpertInfoDO::getGender, reqVO.getGender())
+                .eqIfPresent(ExpertInfoDO::getPoliticalStatus, reqVO.getPoliticalStatus())
+                .eqIfPresent(ExpertInfoDO::getPhone, reqVO.getPhone())
+                .eqIfPresent(ExpertInfoDO::getJobStatus, reqVO.getJobStatus())
+                .eqIfPresent(ExpertInfoDO::getEthnicity, reqVO.getEthnicity())
+                .eqIfPresent(ExpertInfoDO::getBirthplace, reqVO.getBirthplace())
+                .eqIfPresent(ExpertInfoDO::getEmail, reqVO.getEmail())
+                .betweenIfPresent(ExpertInfoDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(ExpertInfoDO::getId));
+    }
+
+}

+ 62 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/service/expertinfo/ExpertInfoService.java

@@ -0,0 +1,62 @@
+package com.cy.guoyan.admin.module.guoyan.service.expertinfo;
+
+import java.util.*;
+import javax.validation.*;
+import com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo.*;
+import com.cy.guoyan.admin.module.guoyan.dal.dataobject.expertinfo.ExpertInfoDO;
+import com.cy.guoyan.admin.framework.common.pojo.PageResult;
+import com.cy.guoyan.admin.framework.common.pojo.PageParam;
+
+/**
+ * 专家信息 Service 接口
+ *
+ * @author 管理员
+ */
+public interface ExpertInfoService {
+
+    /**
+     * 创建专家信息
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createExpertInfo(@Valid ExpertInfoSaveReqVO createReqVO);
+
+    /**
+     * 更新专家信息
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateExpertInfo(@Valid ExpertInfoSaveReqVO updateReqVO);
+
+    /**
+     * 删除专家信息
+     *
+     * @param id 编号
+     */
+    void deleteExpertInfo(Long id);
+
+    /**
+    * 批量删除专家信息
+    *
+    * @param ids 编号
+    */
+    void deleteExpertInfoListByIds(List<Long> ids);
+
+    /**
+     * 获得专家信息
+     *
+     * @param id 编号
+     * @return 专家信息
+     */
+    ExpertInfoDO getExpertInfo(Long id);
+
+    /**
+     * 获得专家信息分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 专家信息分页
+     */
+    PageResult<ExpertInfoDO> getExpertInfoPage(ExpertInfoPageReqVO pageReqVO);
+
+}

+ 92 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/guoyan/service/expertinfo/ExpertInfoServiceImpl.java

@@ -0,0 +1,92 @@
+package com.cy.guoyan.admin.module.guoyan.service.expertinfo;
+
+import cn.hutool.core.collection.CollUtil;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import com.cy.guoyan.admin.module.guoyan.controller.admin.expertinfo.vo.*;
+import com.cy.guoyan.admin.module.guoyan.dal.dataobject.expertinfo.ExpertInfoDO;
+import com.cy.guoyan.admin.framework.common.pojo.PageResult;
+import com.cy.guoyan.admin.framework.common.pojo.PageParam;
+import com.cy.guoyan.admin.framework.common.util.object.BeanUtils;
+
+import com.cy.guoyan.admin.module.guoyan.dal.mysql.expertinfo.ExpertInfoMapper;
+
+import static com.cy.guoyan.admin.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static com.cy.guoyan.admin.framework.common.util.collection.CollectionUtils.convertList;
+import static com.cy.guoyan.admin.framework.common.util.collection.CollectionUtils.diffList;
+import static com.cy.guoyan.admin.module.system.enums.ErrorCodeConstants.*;
+
+/**
+ * 专家信息 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class ExpertInfoServiceImpl implements ExpertInfoService {
+
+    @Resource
+    private ExpertInfoMapper expertInfoMapper;
+
+    @Override
+    public Long createExpertInfo(ExpertInfoSaveReqVO createReqVO) {
+        // 插入
+        ExpertInfoDO expertInfo = BeanUtils.toBean(createReqVO, ExpertInfoDO.class);
+        expertInfoMapper.insert(expertInfo);
+        // 返回
+        return expertInfo.getId();
+    }
+
+    @Override
+    public void updateExpertInfo(ExpertInfoSaveReqVO updateReqVO) {
+        // 校验存在
+        validateExpertInfoExists(updateReqVO.getId());
+        // 更新
+        ExpertInfoDO updateObj = BeanUtils.toBean(updateReqVO, ExpertInfoDO.class);
+        expertInfoMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteExpertInfo(Long id) {
+        // 校验存在
+        validateExpertInfoExists(id);
+        // 删除
+        expertInfoMapper.deleteById(id);
+    }
+
+    @Override
+        public void deleteExpertInfoListByIds(List<Long> ids) {
+        // 校验存在
+        validateExpertInfoExists(ids);
+        // 删除
+        expertInfoMapper.deleteByIds(ids);
+        }
+
+    private void validateExpertInfoExists(List<Long> ids) {
+        List<ExpertInfoDO> list = expertInfoMapper.selectByIds(ids);
+        if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+            throw exception(EXPERT_INFO_NOT_EXISTS);
+        }
+    }
+
+    private void validateExpertInfoExists(Long id) {
+        if (expertInfoMapper.selectById(id) == null) {
+            throw exception(EXPERT_INFO_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public ExpertInfoDO getExpertInfo(Long id) {
+        return expertInfoMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<ExpertInfoDO> getExpertInfoPage(ExpertInfoPageReqVO pageReqVO) {
+        return expertInfoMapper.selectPage(pageReqVO);
+    }
+
+}

+ 2 - 0
guoyan-module-system/src/main/java/com/cy/guoyan/admin/module/system/enums/ErrorCodeConstants.java

@@ -157,6 +157,7 @@ public interface ErrorCodeConstants {
 
     ErrorCode BANNER_NOT_EXISTS = new ErrorCode(1_002_100_001, "文章不存在");
 
+    ErrorCode EXPERT_INFO_NOT_EXISTS = new ErrorCode(1_002_100_010, "专家信息不存在");
 
     ErrorCode CHAT_SESSION_NOT_EXISTS = new ErrorCode(1_002_084_000, "AI聊天会话不存在");
 
@@ -171,4 +172,5 @@ public interface ErrorCodeConstants {
 
     ErrorCode FILE_OPERATE_LOG_NOT_EXISTS = new ErrorCode(1_002_090_000, "文件操作记录不存在");
 
+
 }

+ 12 - 0
guoyan-module-system/src/main/resources/mapper/expertinfo/ExpertInfoMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.cy.guoyan.admin.module.guoyan.dal.mysql.expertinfo.ExpertInfoMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>