diff --git a/admin-hanhai-vue/.env.development b/admin-hanhai-vue/.env.development index 292a4c9..4c01d55 100644 --- a/admin-hanhai-vue/.env.development +++ b/admin-hanhai-vue/.env.development @@ -1,5 +1,6 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8000/education-admin/ +VUE_APP_API_BASE_URL=https://www.jgyt.chat/education-admin/ +//VUE_APP_API_BASE_URL=http://localhost:8000/education-admin/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/admin-hanhai-vue/.env.production b/admin-hanhai-vue/.env.production index dbb9959..d119e26 100644 --- a/admin-hanhai-vue/.env.production +++ b/admin-hanhai-vue/.env.production @@ -1,4 +1,5 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://localhost:8000/education-admin/ +VUE_APP_API_BASE_URL=https://www.jgyt.chat/education-admin/ +//VUE_APP_API_BASE_URL=http://localhost:8000/education-admin/ VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index ac70b7f..11202d9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -72,6 +72,9 @@ public class ShiroConfig { } } + //小程序验证放开 + filterChainDefinitionMap.put("/education/**", "anon"); //图片上传验证放开 + filterChainDefinitionMap.put("/sys/oss/file/upload", "anon"); //图片上传验证放开 filterChainDefinitionMap.put("/sys/common/upload", "anon"); //图片上传验证放开 filterChainDefinitionMap.put("/sys/cas/client/validateLogin", "anon"); //cas验证登录 diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationThesis/entity/EducationThesis.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationThesis/entity/EducationThesis.java index 1cddd32..ab4e8c6 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationThesis/entity/EducationThesis.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/educationThesis/entity/EducationThesis.java @@ -3,7 +3,10 @@ package org.jeecg.modules.educationThesis.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Date; +import java.util.List; + import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -70,4 +73,26 @@ public class EducationThesis implements Serializable { @Excel(name = "适用人群", width = 15) @ApiModelProperty(value = "适用人群") private java.lang.String suit; + + + //发表方向列表 + @TableField(exist = false) + List educationTargetList; + + //师资力量列表 + @TableField(exist = false) + List educationTeacherList; + + //课程安排列表 + @TableField(exist = false) + List educationCourseList; + + //期刊推荐列表 + @TableField(exist = false) + List educationPeriodicalList; + + //附加材料列表 + @TableField(exist = false) + List educationDocumentList; + } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/PageBean.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/PageBean.java new file mode 100644 index 0000000..e2fe1a1 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/PageBean.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.api.bean; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class PageBean { + /**显示条数*/ + @ApiModelProperty(value = "显示条数" ) + private Integer pageSize; + /**当前页*/ + @ApiModelProperty(value = "当前页" ) + private Integer pageNo; + + public PageBean() { + this.pageNo = 1; + this.pageSize = 1000; + } +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/ConfigController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/ConfigController.java new file mode 100644 index 0000000..ca5c183 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/ConfigController.java @@ -0,0 +1,82 @@ +package org.jeecg.modules.api.educationController; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.PageBean; +import org.jeecg.modules.api.service.ConfigService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Api(tags="系统配置-相关接口") +@RestController +@RequestMapping("/education/config") +@Slf4j +public class ConfigController { + + /******************************************************************************************************************/ + //配置信息 + @Resource + private ConfigService configService; + /******************************************************************************************************************/ + //查看系统配置列表 + @ApiOperation(value="系统配置-查询系统配置列表", notes="系统配置-查询系统配置列表") + @RequestMapping(value = "/queryConfigList", method = {RequestMethod.GET}) + public Result queryConfigList(PageBean pageBean){ + return configService.queryConfigList(pageBean); + } + + //查看系统配置详情 + @ApiOperation(value="系统配置-查询系统配置详情", notes="系统配置-查询系统配置详情") + @RequestMapping(value = "/queryConfigByParamCode", method = {RequestMethod.GET}) + public Result queryConfigByParamCode(String paramCode){ + return configService.queryConfigByParamCode(paramCode); + } + + //查看概述说明列表 + @ApiOperation(value="系统配置-查询概述说明列表", notes="系统配置-查询概述说明列表") + @RequestMapping(value = "/querySummaryList", method = {RequestMethod.GET}) + public Result querySummaryList(PageBean pageBean){ + return configService.querySummaryList(pageBean); + } + + //查看概述说明详情 + @ApiOperation(value="系统配置-查询概述说明详情", notes="系统配置-查询概述说明详情") + @RequestMapping(value = "/querySummaryByParamCode", method = {RequestMethod.GET}) + public Result querySummaryByParamCode(String paramCode){ + return configService.querySummaryByParamCode(paramCode); + } + + //获取论文分类列表 + @ApiOperation(value="系统配置-获取论文分类列表", notes="系统配置-获取论文分类列表") + @RequestMapping(value = "/queryCategoryThesisList", method = {RequestMethod.GET}) + public Result queryCategoryThesisList(String pid, PageBean pageBean){ + return configService.queryCategoryThesisList(pid, pageBean); + } + + //获取服务分类列表 + @ApiOperation(value="系统配置-获取服务分类列表", notes="系统配置-获取服务分类列表") + @RequestMapping(value = "/queryCategoryServiceList", method = {RequestMethod.GET}) + public Result queryCategoryServiceList(PageBean pageBean){ + return configService.queryCategoryServiceList(pageBean); + } + + //获取专业分类列表 + @ApiOperation(value="系统配置-获取专业分类列表", notes="系统配置-获取专业分类列表") + @RequestMapping(value = "/queryCategoryMajorList", method = {RequestMethod.GET}) + public Result queryCategoryMajorList(PageBean pageBean){ + return configService.queryCategoryMajorList(pageBean); + } + + //获取阶段分类列表 + @ApiOperation(value="系统配置-获取阶段分类列表", notes="系统配置-获取阶段分类列表") + @RequestMapping(value = "/queryCategoryPeriodList", method = {RequestMethod.GET}) + public Result queryCategoryPeriodList(PageBean pageBean){ + return configService.queryCategoryPeriodList(pageBean); + } + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/IndexController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/IndexController.java new file mode 100644 index 0000000..a06e88a --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/educationController/IndexController.java @@ -0,0 +1,64 @@ +package org.jeecg.modules.api.educationController; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.PageBean; +import org.jeecg.modules.api.service.IndexService; +import org.jeecg.modules.educationArticle.entity.EducationArticle; +import org.jeecg.modules.educationBanner.entity.EducationBanner; +import org.jeecg.modules.educationThesis.entity.EducationThesis; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@Api(tags="首页-相关接口") +@RestController +@RequestMapping("/education/index") +@Slf4j +public class IndexController { + + /******************************************************************************************************************/ + @Resource + private IndexService indexService; + /******************************************************************************************************************/ + + //获取banner图列表 + @ApiOperation(value="首页-获取banner图列表", notes="type:0-首页 1-案例 2-服务 3-其他") + @RequestMapping(value = "/queryBannerList", method = {RequestMethod.GET}) + public Result queryBannerList(EducationBanner educationBanner, PageBean pageBean){ + return indexService.queryBannerList(educationBanner, pageBean); + } + + //获取论文文章列表 + @ApiOperation(value="首页-获取论文文章列表", notes="首页-获取论文文章列表") + @RequestMapping(value = "/queryThesisList", method = {RequestMethod.GET}) + public Result queryThesisList(EducationThesis educationThesis, PageBean pageBean){ + return indexService.queryThesisList(educationThesis, pageBean); + } + + //获取论文文章详情 + @ApiOperation(value="首页-获取论文文章详情", notes="首页-获取论文文章详情") + @RequestMapping(value = "/queryThesisById", method = {RequestMethod.GET}) + public Result queryThesisById(String thesisId){ + return indexService.queryThesisById(thesisId); + } + + //获取案例文章列表 + @ApiOperation(value="首页-获取案例文章列表", notes="首页-获取案例文章列表") + @RequestMapping(value = "/queryAriticleList", method = {RequestMethod.GET}) + public Result queryAriticleList(EducationArticle educationArticle, PageBean pageBean){ + return indexService.queryAriticleList(educationArticle, pageBean); + } + + //获取案例文章详情 + @ApiOperation(value="首页-获取案例文章详情", notes="首页-获取案例文章详情") + @RequestMapping(value = "/queryAriticleById", method = {RequestMethod.GET}) + public Result queryAriticleById(String articleId){ + return indexService.queryAriticleById(articleId); + } + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java new file mode 100644 index 0000000..57bf6a9 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java @@ -0,0 +1,28 @@ +package org.jeecg.modules.api.service; + +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.PageBean; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +public interface ConfigService { + + //查询系统配置列表 + public Result queryConfigList(PageBean pageBean); + //查询系统配置详情 + public Result queryConfigByParamCode(String paramCode); + //查看概述说明列表 + public Result querySummaryList(PageBean pageBean); + //查看概述说明详情 + public Result querySummaryByParamCode(String paramCode); + //获取论文分类列表 + public Result queryCategoryThesisList(String pid, PageBean pageBean); + //获取服务分类列表 + public Result queryCategoryServiceList(PageBean pageBean); + //获取专业分类列表 + public Result queryCategoryMajorList(PageBean pageBean); + //获取阶段分类列表 + public Result queryCategoryPeriodList(PageBean pageBean); + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IndexService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IndexService.java new file mode 100644 index 0000000..aa3d8c9 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/IndexService.java @@ -0,0 +1,29 @@ +package org.jeecg.modules.api.service; + +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.PageBean; +import org.jeecg.modules.educationArticle.entity.EducationArticle; +import org.jeecg.modules.educationBanner.entity.EducationBanner; +import org.jeecg.modules.educationThesis.entity.EducationThesis; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +public interface IndexService { + + //获取banner图列表 + public Result queryBannerList(EducationBanner educationBanner, PageBean pageBean); + + //获取论文文章列表 + public Result queryThesisList(EducationThesis educationThesis, PageBean pageBean); + + //获取论文文章详情 + public Result queryThesisById(String thesisId); + + //获取案例文章列表 + public Result queryAriticleList(EducationArticle educationArticle, PageBean pageBean); + + //获取案例文章详情 + public Result queryAriticleById(String articleId); + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java new file mode 100644 index 0000000..aa19c5e --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java @@ -0,0 +1,308 @@ +package org.jeecg.modules.api.service.impl; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.PageBean; +import org.jeecg.modules.api.service.ConfigService; +import org.jeecg.modules.educationCategoryMajor.entity.EducationCategoryMajor; +import org.jeecg.modules.educationCategoryMajor.service.IEducationCategoryMajorService; +import org.jeecg.modules.educationCategoryPeriod.entity.EducationCategoryPeriod; +import org.jeecg.modules.educationCategoryPeriod.service.IEducationCategoryPeriodService; +import org.jeecg.modules.educationCategoryService.entity.EducationCategoryService; +import org.jeecg.modules.educationCategoryService.service.IEducationCategoryServiceService; +import org.jeecg.modules.educationCategoryThesis.entity.EducationCategoryThesis; +import org.jeecg.modules.educationCategoryThesis.service.IEducationCategoryThesisService; +import org.jeecg.modules.educationConfig.entity.EducationConfig; +import org.jeecg.modules.educationConfig.service.IEducationConfigService; +import org.jeecg.modules.educationSummary.entity.EducationSummary; +import org.jeecg.modules.educationSummary.service.IEducationSummaryService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +@Slf4j +public class ConfigServiceImpl implements ConfigService { + + /******************************************************************************************************************/ + //系统配置信息 + @Resource + private IEducationConfigService educationConfigService; + //概述说明信息 + @Resource + private IEducationSummaryService educationSummaryService; + //概述说明信息 + @Resource + private IEducationCategoryThesisService educationCategoryThesisService; + //概述说明信息 + @Resource + private IEducationCategoryServiceService educationCategoryServiceService; + //概述说明信息 + @Resource + private IEducationCategoryMajorService educationCategoryMajorService; + //概述说明信息 + @Resource + private IEducationCategoryPeriodService educationCategoryPeriodService; + /******************************************************************************************************************/ + //查询系统配置列表 + @Override + public Result queryConfigList(PageBean pageBean) { + log.info("开始查询系统配置列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationConfigService + .lambdaQuery(); + + //组装查询条件 + //按照创建时间降序排列 + query.orderByDesc(EducationConfig::getCreateTime); + + //获取系统配置列表信息 + pageList = query.page(page); + + log.info("系统配置查询结束"); + return Result.OK("系统配置列表", pageList); + }catch (Exception e){ + log.error("系统配置查询失败"); + e.printStackTrace(); + return Result.error("系统配置列表查询失败"); + } + } + + //查询系统配置详情 + @Override + public Result queryConfigByParamCode(String paramCode) { + log.info("开始查询系统配置详情"); + //返回信息 + String massege = ""; + + try{ + EducationConfig config = educationConfigService + .lambdaQuery() + .eq(EducationConfig::getParamCode, paramCode) + .one(); + + log.info("系统配置详情查询结束"); + return Result.OK("配置详情", config); + }catch (Exception e){ + log.error("系统配置详情查询失败"); + e.printStackTrace(); + return Result.error("配置详情查询失败"); + } + } + + //查询概述说明列表 + @Override + public Result querySummaryList(PageBean pageBean) { + log.info("开始查询概述说明列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationSummaryService + .lambdaQuery(); + + //组装查询条件 + //按照创建时间降序排列 + query.orderByDesc(EducationSummary::getCreateTime); + + //获取概述说明列表信息 + pageList = query.page(page); + + log.info("概述说明查询结束"); + return Result.OK("概述说明列表", pageList); + }catch (Exception e){ + log.error("概述说明查询失败"); + e.printStackTrace(); + return Result.error("概述说明列表查询失败"); + } + } + + //查询概述说明详情 + @Override + public Result querySummaryByParamCode(String paramCode) { + log.info("开始查询概述说明详情"); + //返回信息 + String massege = ""; + + try{ + EducationSummary config = educationSummaryService + .lambdaQuery() + .eq(EducationSummary::getParamCode, paramCode) + .one(); + + log.info("概述说明详情查询结束"); + return Result.OK("概述说明详情", config); + }catch (Exception e){ + log.error("概述说明详情查询失败"); + e.printStackTrace(); + return Result.error("概述说明详情查询失败"); + } + } + + //获取论文分类列表 + @Override + public Result queryCategoryThesisList(String pid, PageBean pageBean) { + log.info("开始查询论文分类列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationCategoryThesisService + .lambdaQuery(); + + //组装查询条件 + if(StringUtils.isNotEmpty(pid)){ + query.eq(EducationCategoryThesis::getPid, pid); + } + + //按照创建时间降序排列 + query.orderByDesc(EducationCategoryThesis::getCreateTime); + + //获取论文分类列表信息 + pageList = query.page(page); + + log.info("论文分类查询结束"); + return Result.OK("论文分类列表", pageList); + }catch (Exception e){ + log.error("论文分类查询失败"); + e.printStackTrace(); + return Result.error("论文分类列表查询失败"); + } + } + + //获取服务分类列表 + @Override + public Result queryCategoryServiceList(PageBean pageBean) { + log.info("开始查询服务分类列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationCategoryServiceService + .lambdaQuery(); + + //组装查询条件 + //按照创建时间降序排列 + query.orderByDesc(EducationCategoryService::getCreateTime); + + //获取服务分类列表信息 + pageList = query.page(page); + + log.info("服务分类查询结束"); + return Result.OK("服务分类列表", pageList); + }catch (Exception e){ + log.error("服务分类查询失败"); + e.printStackTrace(); + return Result.error("服务分类列表查询失败"); + } + } + + //获取专业分类列表 + @Override + public Result queryCategoryMajorList(PageBean pageBean) { + log.info("开始查询专业分类列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationCategoryMajorService + .lambdaQuery(); + + //组装查询条件 + //按照创建时间降序排列 + query.orderByDesc(EducationCategoryMajor::getCreateTime); + + //获取专业分类列表信息 + pageList = query.page(page); + + log.info("专业分类查询结束"); + return Result.OK("专业分类列表", pageList); + }catch (Exception e){ + log.error("专业分类查询失败"); + e.printStackTrace(); + return Result.error("专业分类列表查询失败"); + } + } + + //获取阶段分类列表 + @Override + public Result queryCategoryPeriodList(PageBean pageBean) { + log.info("开始查询阶段分类列表"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationCategoryPeriodService + .lambdaQuery(); + + //组装查询条件 + //按照创建时间降序排列 + query.orderByDesc(EducationCategoryPeriod::getCreateTime); + + //获取阶段分类列表信息 + pageList = query.page(page); + + log.info("阶段分类查询结束"); + return Result.OK("阶段分类列表", pageList); + }catch (Exception e){ + log.error("阶段分类查询失败"); + e.printStackTrace(); + return Result.error("阶段分类列表查询失败"); + } + } + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java new file mode 100644 index 0000000..a8a5342 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java @@ -0,0 +1,283 @@ +package org.jeecg.modules.api.service.impl; + +import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.config.shiro.ShiroRealm; +import org.jeecg.modules.api.bean.PageBean; +import org.jeecg.modules.api.service.IndexService; +import org.jeecg.modules.educationArticle.entity.EducationArticle; +import org.jeecg.modules.educationArticle.service.IEducationArticleService; +import org.jeecg.modules.educationBanner.entity.EducationBanner; +import org.jeecg.modules.educationBanner.service.IEducationBannerService; +import org.jeecg.modules.educationThesis.entity.*; +import org.jeecg.modules.educationThesis.service.*; +import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Service +@Slf4j +public class IndexServiceImpl implements IndexService { + + /******************************************************************************************************************/ + //轮播图信息 + @Resource + private IEducationBannerService educationBannerService; + //论文文章信息 + @Resource + private IEducationThesisService educationThesisService; + //案例文章信息 + @Resource + private IEducationArticleService educationArticleService; + //发表方向信息 + @Resource + private IEducationTargetService educationTargetService; + //师资力量信息 + @Resource + private IEducationTeacherService educationTeacherService; + //课程安排信息 + @Resource + private IEducationCourseService educationCourseService; + //期刊推荐信息 + @Resource + private IEducationPeriodicalService educationPeriodicalService; + //附加材料信息 + @Resource + private IEducationDocumentService educationDocumentService; + /******************************************************************************************************************/ + + //获取banner图列表 + @Override + public Result queryBannerList(EducationBanner educationBanner, PageBean pageBean) { + log.info("开始查询轮播图信息"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationBannerService + .lambdaQuery(); + + //组装查询条件 + if(StringUtils.isNotBlank(educationBanner.getTitle())){ + //标题 + query.like(EducationBanner::getTitle, educationBanner.getTitle()); + } + if(StringUtils.isNotBlank(educationBanner.getType())){ + //分类 + query.eq(EducationBanner::getType, educationBanner.getType()); + } + + //按照排序编号升序排列 + query.orderByAsc(EducationBanner::getOrderNo); + + //获取轮播图信息 + pageList = query.page(page); + + log.info("轮播图信息查询结束"); + return Result.OK("轮播图列表", pageList); + }catch (Exception e){ + log.info("轮播图信息查询失败"); + e.printStackTrace(); + return Result.error("轮播图列表查询失败"); + } + } + + //获取论文文章列表 + @Override + public Result queryThesisList(EducationThesis educationThesis, PageBean pageBean) { + log.info("开始查询论文文章信息"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationThesisService + .lambdaQuery(); + + //组装查询条件 + if(StringUtils.isNotBlank(educationThesis.getTitle())){ + //标题 + query.like(EducationThesis::getTitle, educationThesis.getTitle()); + } + if(StringUtils.isNotBlank(educationThesis.getCategoryOne())){ + //论文一级分类 + query.eq(EducationThesis::getCategoryOne, educationThesis.getCategoryOne()); + } + if(StringUtils.isNotBlank(educationThesis.getCategoryTwo())){ + //论文二级分类 + query.eq(EducationThesis::getCategoryTwo, educationThesis.getCategoryTwo()); + } + + //按照创建时间降序排列 + query.orderByDesc(EducationThesis::getCreateTime); + + //获取论文文章信息 + pageList = query.page(page); + + log.info("论文文章信息查询结束"); + return Result.OK("论文文章列表", pageList); + }catch (Exception e){ + log.info("论文文章信息列表查询失败"); + e.printStackTrace(); + return Result.error("论文文章列表查询失败"); + } + } + + //获取论文文章详情 + @Override + public Result queryThesisById(String thesisId) { + log.info("开始查询论文文章信息"); + //返回信息 + String massege = ""; + + try{ + //1、查询论文文章详情 + EducationThesis one = educationThesisService.getById(thesisId); + if(null == one){ + log.info("论文文章不存在,请检查论文文章编号:{}", thesisId); + return Result.OK("论文文章不存在,请检查论文文章编号:{}", thesisId); + } + + //发表方向 + List targetList = educationTargetService + .lambdaQuery() + .eq(EducationTarget::getThesisId, thesisId) + .list(); + one.setEducationTargetList(targetList); + + //师资力量 + List teacherList = educationTeacherService + .lambdaQuery() + .eq(EducationTeacher::getThesisId, thesisId) + .list(); + one.setEducationTeacherList(teacherList); + + //课程安排 + List courseList = educationCourseService + .lambdaQuery() + .eq(EducationCourse::getThesisId, thesisId) + .list(); + one.setEducationCourseList(courseList); + + //期刊推荐 + List periodicalList = educationPeriodicalService + .lambdaQuery() + .eq(EducationPeriodical::getThesisId, thesisId) + .list(); + one.setEducationPeriodicalList(periodicalList); + + //附加材料 + List documentList = educationDocumentService + .lambdaQuery() + .eq(EducationDocument::getThesisId, thesisId) + .list(); + one.setEducationDocumentList(documentList); + + //2、返回案例文章信息 + log.info("论文文章信息查询结束"); + return Result.OK("论文文章信息", one); + }catch (Exception e){ + log.info("论文文章信息查询失败"); + e.printStackTrace(); + return Result.error("论文文章信息查询失败"); + } + } + + //获取案例文章列表 + @Override + public Result queryAriticleList(EducationArticle educationArticle, PageBean pageBean) { + log.info("开始查询案例文章信息"); + //返回信息 + String massege = ""; + //分页信息 + Page page = null; + //查询信息 + LambdaQueryChainWrapper query = null; + //返回信息 + Page pageList = null; + + try{ + //分页 + page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); + query = educationArticleService + .lambdaQuery(); + + //组装查询条件 + if(StringUtils.isNotBlank(educationArticle.getTitle())){ + //标题 + query.like(EducationArticle::getTitle, educationArticle.getTitle()); + } + if(StringUtils.isNotBlank(educationArticle.getCategoryServiceId())){ + //服务分类 + query.eq(EducationArticle::getCategoryServiceId, educationArticle.getCategoryServiceId()); + } + if(StringUtils.isNotBlank(educationArticle.getCategoryMajorId())){ + //专业分类 + query.eq(EducationArticle::getCategoryMajorId, educationArticle.getCategoryMajorId()); + } + if(StringUtils.isNotBlank(educationArticle.getCategoryPeriodId())){ + //阶段分类 + query.eq(EducationArticle::getCategoryPeriodId, educationArticle.getCategoryPeriodId()); + } + + //按照创建时间降序排列 + query.orderByDesc(EducationArticle::getCreateTime); + + //获取案例文章信息 + pageList = query.page(page); + + log.info("案例文章信息查询结束"); + return Result.OK("案例文章列表", pageList); + }catch (Exception e){ + log.info("案例文章信息列表查询失败"); + e.printStackTrace(); + return Result.error("案例文章列表查询失败"); + } + } + + //获取案例文章详情 + @Override + public Result queryAriticleById(String articleId) { + log.info("开始查询案例文章信息"); + //返回信息 + String massege = ""; + + try{ + //1、查询案例文章详情 + EducationArticle one = educationArticleService.getById(articleId); + if(null == one){ + log.info("案例文章不存在,请检查案例文章编号:{}", articleId); + return Result.OK("案例文章不存在,请检查案例文章编号:{}", articleId); + } + + //2、返回案例文章信息 + log.info("案例文章信息查询结束"); + return Result.OK("案例文章信息", one); + }catch (Exception e){ + log.info("案例文章信息查询失败"); + e.printStackTrace(); + return Result.error("案例文章信息查询失败"); + } + } +}