From b88cae93022cc84d3ba69137c7da3eb6929f3646 Mon Sep 17 00:00:00 2001 From: tuyp Date: Fri, 5 Aug 2022 15:12:04 +0800 Subject: [PATCH] 行业领域 --- pom.xml | 6 ------ src/main/java/com/subsidy/controller/CategoryController.java | 8 +------- src/main/java/com/subsidy/controller/CourseBusinessMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/CourseDictController.java | 6 +++--- src/main/java/com/subsidy/controller/FieldDictController.java | 2 +- src/main/java/com/subsidy/controller/VodDictController.java | 2 +- src/main/java/com/subsidy/dto/course/AddCourseDTO.java | 5 +++++ src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java | 2 ++ src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java | 5 +++++ src/main/java/com/subsidy/dto/image/ImageCheckDTO.java | 6 ++++++ src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java | 9 ++++++++- src/main/java/com/subsidy/mapper/CourseBusinessMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/CourseDictMapper.java | 2 +- src/main/java/com/subsidy/model/CourseBusinessMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/CategoryService.java | 2 -- src/main/java/com/subsidy/service/CourseBusinessMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java | 13 ------------- src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java | 19 ++++++++++++++----- src/main/java/com/subsidy/service/impl/CourseBusinessMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------- src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ src/main/java/com/subsidy/util/websocket/WebSocketUtil.java | 5 ++++- src/main/java/com/subsidy/vo/businessScope/BusinessVO.java | 11 +++++++++++ src/main/java/com/subsidy/vo/catagory/CategoriesVO.java | 11 +++++++++++ src/main/java/com/subsidy/vo/course/QueryCoursesVO.java | 8 +++++++- src/main/resources/mapper/BusinessScopeDictMapper.xml | 16 ++++++++++++++-- src/main/resources/mapper/CategoryMapper.xml | 2 +- src/main/resources/mapper/CourseBusinessMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/CourseDictMapper.xml | 5 +++++ src/main/resources/mybatis-plus.properties | 2 +- 30 files changed, 392 insertions(+), 87 deletions(-) create mode 100644 src/main/java/com/subsidy/controller/CourseBusinessMappingController.java create mode 100644 src/main/java/com/subsidy/mapper/CourseBusinessMappingMapper.java create mode 100644 src/main/java/com/subsidy/model/CourseBusinessMappingDO.java create mode 100644 src/main/java/com/subsidy/service/CourseBusinessMappingService.java create mode 100644 src/main/java/com/subsidy/service/impl/CourseBusinessMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/vo/businessScope/BusinessVO.java create mode 100644 src/main/java/com/subsidy/vo/catagory/CategoriesVO.java create mode 100644 src/main/resources/mapper/CourseBusinessMappingMapper.xml diff --git a/pom.xml b/pom.xml index 642b6a3..ffd6513 100644 --- a/pom.xml +++ b/pom.xml @@ -222,12 +222,6 @@ - com.tencentcloudapi - tencentcloud-sdk-java - 3.1.322 - - - org.springframework.boot spring-boot-starter-cache diff --git a/src/main/java/com/subsidy/controller/CategoryController.java b/src/main/java/com/subsidy/controller/CategoryController.java index 58dac9e..938ca47 100644 --- a/src/main/java/com/subsidy/controller/CategoryController.java +++ b/src/main/java/com/subsidy/controller/CategoryController.java @@ -40,12 +40,6 @@ public class CategoryController { return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO)); } - @PostMapping("getAll") - @ApiOperation("查询所有类目【是否还有用?】 companyId") - public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){ - return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO)); - } - @PostMapping("addCategory") @ApiOperation("新增行业领域 name companyId categoryDOS[name 行业领域名称]") @LoginRequired @@ -61,7 +55,7 @@ public class CategoryController { } @PostMapping("updateCategory") - @ApiOperation("修改行业领域 id name companyId categoryDOS[name 行业领域名称]") + @ApiOperation("修改行业领域 id name categoryDOS[name 行业领域名称]") @LoginRequired public ResponseVO updateCategory(@RequestBody GetCategoriesVO getCategoriesVO){ return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(getCategoriesVO)); diff --git a/src/main/java/com/subsidy/controller/CourseBusinessMappingController.java b/src/main/java/com/subsidy/controller/CourseBusinessMappingController.java new file mode 100644 index 0000000..b2c1683 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CourseBusinessMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程经营范围字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2022-08-04 + */ +@RestController +@Api(tags = "课程经营范围字典表") +@RequestMapping("/course-business-mapping-do") +public class CourseBusinessMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/CourseDictController.java b/src/main/java/com/subsidy/controller/CourseDictController.java index 7c1751d..f1ba6ab 100644 --- a/src/main/java/com/subsidy/controller/CourseDictController.java +++ b/src/main/java/com/subsidy/controller/CourseDictController.java @@ -35,7 +35,7 @@ public class CourseDictController { private CourseDictService courseDictService; @PostMapping("addCourse") - @ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") + @ApiOperation("添加课程 companyId courseName courseType coverPage openStatus remark fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[] businessIds[]") @LoginRequired public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO)); @@ -49,14 +49,14 @@ public class CourseDictController { } @PostMapping("queryCourses") - @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus") + @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId businessId rankId courseType openStatus") @LoginRequired public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); } @PostMapping("updateCourses") - @ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") + @ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[] businessIds[]") @LoginRequired public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){ return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO)); diff --git a/src/main/java/com/subsidy/controller/FieldDictController.java b/src/main/java/com/subsidy/controller/FieldDictController.java index 3983e1e..4ed7c5c 100644 --- a/src/main/java/com/subsidy/controller/FieldDictController.java +++ b/src/main/java/com/subsidy/controller/FieldDictController.java @@ -25,7 +25,7 @@ import io.swagger.annotations.Api; * @since 2022-01-20 */ @RestController -@Api(tags = "行业字典表") +@Api(tags = "行业字典表--弃用了??") @RequestMapping("/fieldDict") public class FieldDictController { diff --git a/src/main/java/com/subsidy/controller/VodDictController.java b/src/main/java/com/subsidy/controller/VodDictController.java index 498302c..617e27c 100644 --- a/src/main/java/com/subsidy/controller/VodDictController.java +++ b/src/main/java/com/subsidy/controller/VodDictController.java @@ -64,7 +64,7 @@ public class VodDictController { } @PostMapping("updateVod") - @ApiOperation("新增视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode") + @ApiOperation("修改视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode") @LoginRequired public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) { vodDictService.updateVod(vodDictDO); diff --git a/src/main/java/com/subsidy/dto/course/AddCourseDTO.java b/src/main/java/com/subsidy/dto/course/AddCourseDTO.java index 5b576b9..4405956 100644 --- a/src/main/java/com/subsidy/dto/course/AddCourseDTO.java +++ b/src/main/java/com/subsidy/dto/course/AddCourseDTO.java @@ -62,4 +62,9 @@ public class AddCourseDTO { */ private List rankDictDOS; + /** + * 经营范围 + */ + private List businessIds; + } diff --git a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java index 1e6db0c..1fd28bd 100644 --- a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java +++ b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -19,6 +19,8 @@ public class QueryCoursesDTO { private Long rankId; + private Long businessId; + private Long jobId; private Long companyId; diff --git a/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java index f60bf41..855b29d 100644 --- a/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java +++ b/src/main/java/com/subsidy/dto/course/UpdateCoursesDTO.java @@ -54,5 +54,10 @@ public class UpdateCoursesDTO { */ private List rankDictDOS; + /** + * 经营范围 + */ + private List businessIds; + } diff --git a/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java b/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java index 7356ad9..256868b 100644 --- a/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java +++ b/src/main/java/com/subsidy/dto/image/ImageCheckDTO.java @@ -5,8 +5,14 @@ import lombok.Data; @Data public class ImageCheckDTO { + /** + * 用户id + */ private Long id; + /** + * 班级id + */ private Long classId; } diff --git a/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java b/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java index b995031..1c0a315 100644 --- a/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java +++ b/src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java @@ -23,4 +23,11 @@ public interface BusinessScopeDictMapper extends BaseMapper IPage queryBusinessScopePage(Page page, Long companyId, String businessScopeName); List queryBusinessScopeChildNode(); -} + + /** + * 查看某个课程下的经营范围 + */ + List getBusinessScope(Long courseId); + + + } diff --git a/src/main/java/com/subsidy/mapper/CourseBusinessMappingMapper.java b/src/main/java/com/subsidy/mapper/CourseBusinessMappingMapper.java new file mode 100644 index 0000000..21d4685 --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CourseBusinessMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseBusinessMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课程经营范围字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2022-08-04 + */ + @Repository +public interface CourseBusinessMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CourseDictMapper.java b/src/main/java/com/subsidy/mapper/CourseDictMapper.java index de11d4d..c35773d 100644 --- a/src/main/java/com/subsidy/mapper/CourseDictMapper.java +++ b/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -27,7 +27,7 @@ public interface CourseDictMapper extends BaseMapper { * courseName fieldId categoryId jobId courseRank courseType * @return */ - IPage queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus); + IPage queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus,Long businessId); /** * 通过课程id查询课程下的学生-----弃用 diff --git a/src/main/java/com/subsidy/model/CourseBusinessMappingDO.java b/src/main/java/com/subsidy/model/CourseBusinessMappingDO.java new file mode 100644 index 0000000..36837bc --- /dev/null +++ b/src/main/java/com/subsidy/model/CourseBusinessMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程经营范围字典表 + *

+ * + * @author Tuyp + * @since 2022-08-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_business_mapping") +public class CourseBusinessMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + private Long businessId; + + +} diff --git a/src/main/java/com/subsidy/service/CategoryService.java b/src/main/java/com/subsidy/service/CategoryService.java index 406f7e9..38d05b2 100644 --- a/src/main/java/com/subsidy/service/CategoryService.java +++ b/src/main/java/com/subsidy/service/CategoryService.java @@ -20,8 +20,6 @@ public interface CategoryService extends IService { IPage getCategories(GetCategoriesDTO getCategoriesDTO); - List getAll(GetCategoriesDTO getCategoriesDTO); - String addCategory(GetCategoriesVO getCategoriesVO); String deleteCategory(CategoryDO categoryDO); diff --git a/src/main/java/com/subsidy/service/CourseBusinessMappingService.java b/src/main/java/com/subsidy/service/CourseBusinessMappingService.java new file mode 100644 index 0000000..3987132 --- /dev/null +++ b/src/main/java/com/subsidy/service/CourseBusinessMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CourseBusinessMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程经营范围字典表 服务类 + *

+ * + * @author Tuyp + * @since 2022-08-04 + */ +public interface CourseBusinessMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java index d004f97..8e1b6bc 100644 --- a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java @@ -46,19 +46,6 @@ public class CategoryServiceImpl extends ServiceImpl } - public List getAll(GetCategoriesDTO getCategoriesDTO) { - - if (null == getCategoriesDTO.getCompanyId()) { - return this.baseMapper.selectList(new QueryWrapper() - .lambda() - .isNull(CategoryDO::getCompanyId)); - } else { - return this.baseMapper.selectList(new QueryWrapper() - .lambda() - .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); - } - } - public String addCategory(GetCategoriesVO getCategoriesVO) { int count; diff --git a/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java index ea14c0f..fe3350f 100644 --- a/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java @@ -76,16 +76,25 @@ public class ContentVodMappingServiceImpl extends ServiceImpl contentVodMappingList = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ContentVodMappingDO::getContentId, addContentVod.getContentId()) + .orderByDesc(ContentVodMappingDO::getOrderNo)); + int orderNo = 0; + if(CollectionUtils.isNotEmpty(contentVodMappingList)) { + orderNo = contentVodMappingList.get(0).getOrderNo(); + } + + for (ContentVodDTO contentVodDTO : addContentVod.getVodIds()) { ContentVodMappingDO cvm = this.baseMapper.selectOne(new QueryWrapper().lambda() - .eq(ContentVodMappingDO::getVodId, addContentVod.getVodIds().get(i).getVodId()) + .eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId()) .eq(ContentVodMappingDO::getContentId, addContentVod.getContentId())); if(cvm == null) { ContentVodMappingDO contentVodMappingDO = new ContentVodMappingDO(); contentVodMappingDO.setContentId(addContentVod.getContentId()); - contentVodMappingDO.setVodId(addContentVod.getVodIds().get(i).getVodId()); - contentVodMappingDO.setVodAliasName(addContentVod.getVodIds().get(i).getVodAliasName()); - contentVodMappingDO.setOrderNo(i+1); + contentVodMappingDO.setVodId(contentVodDTO.getVodId()); + contentVodMappingDO.setVodAliasName(contentVodDTO.getVodAliasName()); + contentVodMappingDO.setOrderNo(++ orderNo); this.baseMapper.insert(contentVodMappingDO); } } diff --git a/src/main/java/com/subsidy/service/impl/CourseBusinessMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseBusinessMappingServiceImpl.java new file mode 100644 index 0000000..da3770c --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CourseBusinessMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CourseBusinessMappingDO; +import com.subsidy.mapper.CourseBusinessMappingMapper; +import com.subsidy.service.CourseBusinessMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程经营范围字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2022-08-04 + */ +@Service +public class CourseBusinessMappingServiceImpl extends ServiceImpl implements CourseBusinessMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java index d04cca1..5a36c16 100644 --- a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -9,31 +9,14 @@ import com.subsidy.dto.course.AddCourseDTO; import com.subsidy.dto.course.QueryCoursesDTO; import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.dto.field.QueryFieldsDTO; -import com.subsidy.mapper.CategoryMapper; -import com.subsidy.mapper.CourseCategoryMappingMapper; -import com.subsidy.mapper.CourseDictMapper; -import com.subsidy.mapper.CourseFieldMappingMapper; -import com.subsidy.mapper.CourseJobMappingMapper; -import com.subsidy.mapper.CourseRankMappingMapper; -import com.subsidy.mapper.FieldDictMapper; -import com.subsidy.mapper.JobDictMapper; -import com.subsidy.mapper.PaperDictMapper; -import com.subsidy.mapper.RankDictMapper; -import com.subsidy.mapper.RoleAdministerMappingMapper; -import com.subsidy.model.CategoryDO; -import com.subsidy.model.CourseCategoryMappingDO; -import com.subsidy.model.CourseDictDO; -import com.subsidy.model.CourseFieldMappingDO; -import com.subsidy.model.CourseJobMappingDO; -import com.subsidy.model.CourseRankMappingDO; -import com.subsidy.model.FieldDictDO; -import com.subsidy.model.JobDictDO; -import com.subsidy.model.PaperDictDO; -import com.subsidy.model.RankDictDO; -import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; import com.subsidy.service.CourseDictService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.excel.ExcelUtil; +import com.subsidy.vo.businessScope.BusinessScopeDictVO; +import com.subsidy.vo.businessScope.BusinessVO; +import com.subsidy.vo.catagory.CategoriesVO; import com.subsidy.vo.course.QueryCoursesVO; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.BeanFactory; @@ -42,6 +25,7 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; /** @@ -86,6 +70,12 @@ public class CourseDictServiceImpl extends ServiceImpl businessId = addCourseDTO.getBusinessIds(); + for (Long lg : businessId) { + CourseBusinessMappingDO courseBusinessMappingDO = new CourseBusinessMappingDO(); + courseBusinessMappingDO.setBusinessId(lg); + courseBusinessMappingDO.setCourseId(courseDictDO.getId()); + courseBusinessMappingMapper.insert(courseBusinessMappingDO); + + } + } + return ConstantUtils.ADD_SUCCESS; } @@ -184,14 +187,40 @@ public class CourseDictServiceImpl extends ServiceImpl queryCourses(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); - IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus(), queryCoursesDTO.getBusinessId()); List queryCoursesVOS = iPage.getRecords(); for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { - //课程类目 + //行业领域 List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); - queryCoursesVO.setCategoryDOS(categoryDOS); + + List categoriesVOS = new ArrayList<>(); + for (CategoryDO categoryDO : categoryDOS) { + CategoriesVO categoriesVO = new CategoriesVO(); + BeanUtils.copyProperties(categoryDO, categoriesVO); + if (categoriesVO.getParentId() != null) { + CategoryDO categoryDO1 = categoryMapper.selectById(categoryDO.getParentId()); + categoriesVO.setParentName(categoryDO1.getName()); + } + categoriesVOS.add(categoriesVO); + } + queryCoursesVO.setCategoryDOS(categoriesVOS); + + //经营范围 + List businessScopeDictDOS = businessScopeDictMapper.getBusinessScope(queryCoursesVO.getId()); + + List businessVOS = new ArrayList<>(); + for (BusinessScopeDictDO bsd : businessScopeDictDOS) { + BusinessVO businessVO = new BusinessVO(); + BeanUtils.copyProperties(bsd, businessVO); + if (bsd.getParentId() != null) { + BusinessScopeDictDO businessScopeDictDO = businessScopeDictMapper.selectById(bsd.getParentId()); + businessVO.setParentName(businessScopeDictDO.getBusinessScopeName()); + } + businessVOS.add(businessVO); + } + queryCoursesVO.setBusinessVOS(businessVOS); //适用岗位 List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); @@ -304,12 +333,29 @@ public class CourseDictServiceImpl extends ServiceImpl() + .lambda() + .eq(CourseBusinessMappingDO::getCourseId, updateCoursesDTO.getId())); + + List businessId = updateCoursesDTO.getBusinessIds(); + for (Long lg : businessId) { + CourseBusinessMappingDO courseBusinessMappingDO = new CourseBusinessMappingDO(); + courseBusinessMappingDO.setBusinessId(lg); + courseBusinessMappingDO.setCourseId(updateCoursesDTO.getId()); + courseBusinessMappingMapper.insert(courseBusinessMappingDO); + } + + } + return ConstantUtils.SUCCESS_UPDATE; } public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) { Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); - IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus()); + IPage iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus(), + queryCoursesDTO.getBusinessId()); List queryCoursesVOS = iPage.getRecords(); for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { @@ -318,9 +364,20 @@ public class CourseDictServiceImpl extends ServiceImpl fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId()); queryCoursesVO.setFieldDictDOS(fieldDictDOS); - //课程类目 + //行业领域 List categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); - queryCoursesVO.setCategoryDOS(categoryDOS); + + List categoriesVOS = new ArrayList<>(); + for (CategoryDO categoryDO : categoryDOS) { + CategoriesVO categoriesVO = new CategoriesVO(); + BeanUtils.copyProperties(categoryDO, categoriesVO); + if (categoriesVO.getParentId() != null) { + CategoryDO categoryDO1 = categoryMapper.selectById(categoryDO.getId()); + categoriesVO.setParentName(categoryDO1.getName()); + } + categoriesVOS.add(categoriesVO); + } + queryCoursesVO.setCategoryDOS(categoriesVOS); //适用岗位 List jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); diff --git a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java index eb7749e..69912d3 100644 --- a/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/ImageCheckRecordServiceImpl.java @@ -75,7 +75,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl() - .lambda() - .eq(ImageCheckRecordDO::getMemberId,memberId) - .ge(ImageCheckRecordDO::getCreateDate,LocalDateTime.now())); - if (count>3){ + .lambda() + .eq(ImageCheckRecordDO::getMemberId, memberId) + .ge(ImageCheckRecordDO::getCreateDate, LocalDateTime.now())); + if (count > 3) { throw new HttpException(18001); } } @@ -127,7 +127,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl 60)) { @@ -277,7 +290,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl responseEntity = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.POST, new HttpEntity<>(input, headers), SendIdCardInfoVO.class); + return responseEntity.getBody(); + } + + /** + * H5端 合作方后台上送身份信息 POST请求 权威库 姓名+身份证 */ public SendIdCardInfoVO h5SendIdCardInfo(String orderNo, MemberDO memberDO, String sign) { String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo; @@ -324,6 +360,31 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl responseEntity = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.POST, new HttpEntity<>(input, headers), SendIdCardInfoVO.class); + return responseEntity.getBody(); + } + + + /** * 获取nonce ticket */ public IdCardTicketsVO nonceTicket(String accessToken, String usrId) { diff --git a/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java b/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java index 4ec482e..8bbee2a 100644 --- a/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java +++ b/src/main/java/com/subsidy/util/websocket/WebSocketUtil.java @@ -20,6 +20,8 @@ import org.springframework.web.socket.TextMessage; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketMessage; import org.springframework.web.socket.WebSocketSession; + +import javax.websocket.OnMessage; import java.io.IOException; import java.util.Calendar; import java.util.Date; @@ -60,7 +62,7 @@ public class WebSocketUtil implements WebSocketHandler { ConcurrentHashMap taskMap = new ConcurrentHashMap<>(1); /** - * 处理成功连接WebSocket + * 处理成功连接WebSocket 建立直接后调用 * @param session */ @Override @@ -178,6 +180,7 @@ public class WebSocketUtil implements WebSocketHandler { oprMemDictDO.setIpAddress(session.getRemoteAddress().getHostName()); oprMemDictMapper.insert(oprMemDictDO); taskMap.get(session.getId()).cancel(true); + } beatsNum++; } else if (null != session && session.isOpen()) { diff --git a/src/main/java/com/subsidy/vo/businessScope/BusinessVO.java b/src/main/java/com/subsidy/vo/businessScope/BusinessVO.java new file mode 100644 index 0000000..433b0ce --- /dev/null +++ b/src/main/java/com/subsidy/vo/businessScope/BusinessVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.businessScope; + +import com.subsidy.model.BusinessScopeDictDO; +import lombok.Data; + +@Data +public class BusinessVO extends BusinessScopeDictDO { + + private String parentName; + +} diff --git a/src/main/java/com/subsidy/vo/catagory/CategoriesVO.java b/src/main/java/com/subsidy/vo/catagory/CategoriesVO.java new file mode 100644 index 0000000..496f4fa --- /dev/null +++ b/src/main/java/com/subsidy/vo/catagory/CategoriesVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.catagory; + +import com.subsidy.model.CategoryDO; +import lombok.Data; + +@Data +public class CategoriesVO extends CategoryDO { + + private String parentName; + +} diff --git a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java index 575819e..30478b7 100644 --- a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java +++ b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java @@ -5,6 +5,8 @@ import com.subsidy.model.CourseDictDO; import com.subsidy.model.FieldDictDO; import com.subsidy.model.JobDictDO; import com.subsidy.model.RankDictDO; +import com.subsidy.vo.businessScope.BusinessVO; +import com.subsidy.vo.catagory.CategoriesVO; import lombok.Data; import org.apache.poi.ss.formula.functions.Rank; @@ -68,7 +70,7 @@ public class QueryCoursesVO { /** * 课程类目 */ - private List categoryDOS; + private List categoryDOS; /** * 适用岗位 @@ -80,5 +82,9 @@ public class QueryCoursesVO { */ private List rankDictDOS; + /** + * 经营范围 + */ + private List businessVOS; } diff --git a/src/main/resources/mapper/BusinessScopeDictMapper.xml b/src/main/resources/mapper/BusinessScopeDictMapper.xml index c499655..87a47c1 100644 --- a/src/main/resources/mapper/BusinessScopeDictMapper.xml +++ b/src/main/resources/mapper/BusinessScopeDictMapper.xml @@ -33,7 +33,7 @@ AND company_id IS NULL - AND parent_id = 0 + AND parent_id is null AND delete_date IS NULL @@ -44,8 +44,20 @@ FROM business_scope_dict WHERE - parent_id != 0 + parent_id is not null AND delete_date IS NULL + + diff --git a/src/main/resources/mapper/CategoryMapper.xml b/src/main/resources/mapper/CategoryMapper.xml index 84b0eac..1614d65 100644 --- a/src/main/resources/mapper/CategoryMapper.xml +++ b/src/main/resources/mapper/CategoryMapper.xml @@ -39,7 +39,7 @@ WHERE t.delete_date IS NULL AND t.parent_id IS NULL - + AND t.`name` like concat('%',#{name} ,'%') diff --git a/src/main/resources/mapper/CourseBusinessMappingMapper.xml b/src/main/resources/mapper/CourseBusinessMappingMapper.xml new file mode 100644 index 0000000..4424dfe --- /dev/null +++ b/src/main/resources/mapper/CourseBusinessMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, business_id + + + diff --git a/src/main/resources/mapper/CourseDictMapper.xml b/src/main/resources/mapper/CourseDictMapper.xml index 265c64f..2f337fe 100644 --- a/src/main/resources/mapper/CourseDictMapper.xml +++ b/src/main/resources/mapper/CourseDictMapper.xml @@ -28,12 +28,14 @@ LEFT JOIN course_category_mapping t3 ON t.id = t3.course_id LEFT JOIN course_job_mapping t4 ON t.id = t4.course_id left join course_rank_mapping t5 on t.id = t5.course_id + left join course_business_mapping t6 on t.id = t6.course_id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL AND t3.delete_date IS NULL AND t4.delete_date IS NULL and t5.delete_date is null + and t6.delete_date is null and t.company_id = #{companyId} @@ -61,6 +63,9 @@ and t.open_status = #{openStatus} + + and t6.business_id = #{businessId} + diff --git a/src/main/resources/mybatis-plus.properties b/src/main/resources/mybatis-plus.properties index a2493eb..a1b3cbc 100644 --- a/src/main/resources/mybatis-plus.properties +++ b/src/main/resources/mybatis-plus.properties @@ -6,7 +6,7 @@ setParent=com.subsidy # mapper.xml文件生成路径 mapperPath=/src/main/resources/mapper/ # 数据库地址 -url=jdbc:mysql://47.97.19.66:3306/subsidy_test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true +url=jdbc:mysql://116.62.57.92:3306/subsidy_test?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true driverName=com.mysql.cj.jdbc.Driver userName=devloper password=dev@1553$ \ No newline at end of file -- libgit2 0.25.0