Commit b88cae93 by 涂亚平

行业领域

1 parent 1b25b560
Showing with 392 additions and 86 deletions
...@@ -222,12 +222,6 @@ ...@@ -222,12 +222,6 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.322</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId> <artifactId>spring-boot-starter-cache</artifactId>
</dependency> </dependency>
......
...@@ -40,12 +40,6 @@ public class CategoryController { ...@@ -40,12 +40,6 @@ public class CategoryController {
return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO)); 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") @PostMapping("addCategory")
@ApiOperation("新增行业领域 name companyId categoryDOS[name 行业领域名称]") @ApiOperation("新增行业领域 name companyId categoryDOS[name 行业领域名称]")
@LoginRequired @LoginRequired
...@@ -61,7 +55,7 @@ public class CategoryController { ...@@ -61,7 +55,7 @@ public class CategoryController {
} }
@PostMapping("updateCategory") @PostMapping("updateCategory")
@ApiOperation("修改行业领域 id name companyId categoryDOS[name 行业领域名称]") @ApiOperation("修改行业领域 id name categoryDOS[name 行业领域名称]")
@LoginRequired @LoginRequired
public ResponseVO updateCategory(@RequestBody GetCategoriesVO getCategoriesVO){ public ResponseVO updateCategory(@RequestBody GetCategoriesVO getCategoriesVO){
return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(getCategoriesVO)); return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(getCategoriesVO));
......
package com.subsidy.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 课程经营范围字典表 前端控制器
* </p>
*
* @author Tuyp
* @since 2022-08-04
*/
@RestController
@Api(tags = "课程经营范围字典表")
@RequestMapping("/course-business-mapping-do")
public class CourseBusinessMappingController {
}
...@@ -35,7 +35,7 @@ public class CourseDictController { ...@@ -35,7 +35,7 @@ public class CourseDictController {
private CourseDictService courseDictService; private CourseDictService courseDictService;
@PostMapping("addCourse") @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 @LoginRequired
public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){ public ResponseVO addCourse(@RequestBody AddCourseDTO addCourseDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO)); return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(addCourseDTO));
...@@ -49,14 +49,14 @@ public class CourseDictController { ...@@ -49,14 +49,14 @@ public class CourseDictController {
} }
@PostMapping("queryCourses") @PostMapping("queryCourses")
@ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId rankId courseType openStatus") @ApiOperation("平台运营者--查询课程 pageSize pageNum courseName fieldId categoryId jobId businessId rankId courseType openStatus")
@LoginRequired @LoginRequired
public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO));
} }
@PostMapping("updateCourses") @PostMapping("updateCourses")
@ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[]") @ApiOperation("编辑课程 id courseName courseType coverPage openStatus fieldDictDOS[] categoryDOS[] jobDictDOS[] rankDictDOS[] businessIds[]")
@LoginRequired @LoginRequired
public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){ public ResponseVO updateCourses(@RequestBody UpdateCoursesDTO updateCoursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO)); return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(updateCoursesDTO));
......
...@@ -25,7 +25,7 @@ import io.swagger.annotations.Api; ...@@ -25,7 +25,7 @@ import io.swagger.annotations.Api;
* @since 2022-01-20 * @since 2022-01-20
*/ */
@RestController @RestController
@Api(tags = "行业字典表") @Api(tags = "行业字典表--弃用了??")
@RequestMapping("/fieldDict") @RequestMapping("/fieldDict")
public class FieldDictController { public class FieldDictController {
......
...@@ -64,7 +64,7 @@ public class VodDictController { ...@@ -64,7 +64,7 @@ public class VodDictController {
} }
@PostMapping("updateVod") @PostMapping("updateVod")
@ApiOperation("新增视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode") @ApiOperation("修改视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode")
@LoginRequired @LoginRequired
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) { public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) {
vodDictService.updateVod(vodDictDO); vodDictService.updateVod(vodDictDO);
......
...@@ -62,4 +62,9 @@ public class AddCourseDTO { ...@@ -62,4 +62,9 @@ public class AddCourseDTO {
*/ */
private List<Long> rankDictDOS; private List<Long> rankDictDOS;
/**
* 经营范围
*/
private List<Long> businessIds;
} }
...@@ -19,6 +19,8 @@ public class QueryCoursesDTO { ...@@ -19,6 +19,8 @@ public class QueryCoursesDTO {
private Long rankId; private Long rankId;
private Long businessId;
private Long jobId; private Long jobId;
private Long companyId; private Long companyId;
......
...@@ -54,5 +54,10 @@ public class UpdateCoursesDTO { ...@@ -54,5 +54,10 @@ public class UpdateCoursesDTO {
*/ */
private List<Long> rankDictDOS; private List<Long> rankDictDOS;
/**
* 经营范围
*/
private List<Long> businessIds;
} }
...@@ -5,8 +5,14 @@ import lombok.Data; ...@@ -5,8 +5,14 @@ import lombok.Data;
@Data @Data
public class ImageCheckDTO { public class ImageCheckDTO {
/**
* 用户id
*/
private Long id; private Long id;
/**
* 班级id
*/
private Long classId; private Long classId;
} }
...@@ -23,4 +23,11 @@ public interface BusinessScopeDictMapper extends BaseMapper<BusinessScopeDictDO> ...@@ -23,4 +23,11 @@ public interface BusinessScopeDictMapper extends BaseMapper<BusinessScopeDictDO>
IPage<BusinessScopeDictVO> queryBusinessScopePage(Page page, Long companyId, String businessScopeName); IPage<BusinessScopeDictVO> queryBusinessScopePage(Page page, Long companyId, String businessScopeName);
List<BusinessScopeDictVO> queryBusinessScopeChildNode(); List<BusinessScopeDictVO> queryBusinessScopeChildNode();
}
/**
* 查看某个课程下的经营范围
*/
List<BusinessScopeDictDO> getBusinessScope(Long courseId);
}
package com.subsidy.mapper;
import com.subsidy.model.CourseBusinessMappingDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 课程经营范围字典表 Mapper 接口
* </p>
*
* @author Tuyp
* @since 2022-08-04
*/
@Repository
public interface CourseBusinessMappingMapper extends BaseMapper<CourseBusinessMappingDO> {
}
...@@ -27,7 +27,7 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> { ...@@ -27,7 +27,7 @@ public interface CourseDictMapper extends BaseMapper<CourseDictDO> {
* courseName fieldId categoryId jobId courseRank courseType * courseName fieldId categoryId jobId courseRank courseType
* @return * @return
*/ */
IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus); IPage<QueryCoursesVO > queryCourses(IPage page, String courseName, Long fieldId,Long categoryId,Long jobId,Long rankId, String courseType,Long companyId,Integer openStatus,Long businessId);
/** /**
* 通过课程id查询课程下的学生-----弃用 * 通过课程id查询课程下的学生-----弃用
......
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;
/**
* <p>
* 课程经营范围字典表
* </p>
*
* @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;
}
...@@ -20,8 +20,6 @@ public interface CategoryService extends IService<CategoryDO> { ...@@ -20,8 +20,6 @@ public interface CategoryService extends IService<CategoryDO> {
IPage<GetCategoriesVO> getCategories(GetCategoriesDTO getCategoriesDTO); IPage<GetCategoriesVO> getCategories(GetCategoriesDTO getCategoriesDTO);
List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO);
String addCategory(GetCategoriesVO getCategoriesVO); String addCategory(GetCategoriesVO getCategoriesVO);
String deleteCategory(CategoryDO categoryDO); String deleteCategory(CategoryDO categoryDO);
......
package com.subsidy.service;
import com.subsidy.model.CourseBusinessMappingDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 课程经营范围字典表 服务类
* </p>
*
* @author Tuyp
* @since 2022-08-04
*/
public interface CourseBusinessMappingService extends IService<CourseBusinessMappingDO> {
}
...@@ -46,19 +46,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO> ...@@ -46,19 +46,6 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO>
} }
public List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO) {
if (null == getCategoriesDTO.getCompanyId()) {
return this.baseMapper.selectList(new QueryWrapper<CategoryDO>()
.lambda()
.isNull(CategoryDO::getCompanyId));
} else {
return this.baseMapper.selectList(new QueryWrapper<CategoryDO>()
.lambda()
.eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId()));
}
}
public String addCategory(GetCategoriesVO getCategoriesVO) { public String addCategory(GetCategoriesVO getCategoriesVO) {
int count; int count;
......
...@@ -76,16 +76,25 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM ...@@ -76,16 +76,25 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
this.baseMapper.deleteBatchIds(list.stream().map(ContentVodMappingDO::getId).collect(Collectors.toList())); this.baseMapper.deleteBatchIds(list.stream().map(ContentVodMappingDO::getId).collect(Collectors.toList()));
} }
for (int i = 0; i < addContentVod.getVodIds().size(); i++) { List<ContentVodMappingDO> contentVodMappingList = this.baseMapper.selectList(new QueryWrapper<ContentVodMappingDO>()
.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<ContentVodMappingDO>().lambda() ContentVodMappingDO cvm = this.baseMapper.selectOne(new QueryWrapper<ContentVodMappingDO>().lambda()
.eq(ContentVodMappingDO::getVodId, addContentVod.getVodIds().get(i).getVodId()) .eq(ContentVodMappingDO::getVodId, contentVodDTO.getVodId())
.eq(ContentVodMappingDO::getContentId, addContentVod.getContentId())); .eq(ContentVodMappingDO::getContentId, addContentVod.getContentId()));
if(cvm == null) { if(cvm == null) {
ContentVodMappingDO contentVodMappingDO = new ContentVodMappingDO(); ContentVodMappingDO contentVodMappingDO = new ContentVodMappingDO();
contentVodMappingDO.setContentId(addContentVod.getContentId()); contentVodMappingDO.setContentId(addContentVod.getContentId());
contentVodMappingDO.setVodId(addContentVod.getVodIds().get(i).getVodId()); contentVodMappingDO.setVodId(contentVodDTO.getVodId());
contentVodMappingDO.setVodAliasName(addContentVod.getVodIds().get(i).getVodAliasName()); contentVodMappingDO.setVodAliasName(contentVodDTO.getVodAliasName());
contentVodMappingDO.setOrderNo(i+1); contentVodMappingDO.setOrderNo(++ orderNo);
this.baseMapper.insert(contentVodMappingDO); this.baseMapper.insert(contentVodMappingDO);
} }
} }
......
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;
/**
* <p>
* 课程经营范围字典表 服务实现类
* </p>
*
* @author Tuyp
* @since 2022-08-04
*/
@Service
public class CourseBusinessMappingServiceImpl extends ServiceImpl<CourseBusinessMappingMapper, CourseBusinessMappingDO> implements CourseBusinessMappingService {
}
...@@ -9,31 +9,14 @@ import com.subsidy.dto.course.AddCourseDTO; ...@@ -9,31 +9,14 @@ import com.subsidy.dto.course.AddCourseDTO;
import com.subsidy.dto.course.QueryCoursesDTO; import com.subsidy.dto.course.QueryCoursesDTO;
import com.subsidy.dto.course.UpdateCoursesDTO; import com.subsidy.dto.course.UpdateCoursesDTO;
import com.subsidy.dto.field.QueryFieldsDTO; import com.subsidy.dto.field.QueryFieldsDTO;
import com.subsidy.mapper.CategoryMapper; import com.subsidy.mapper.*;
import com.subsidy.mapper.CourseCategoryMappingMapper; import com.subsidy.model.*;
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.service.CourseDictService; import com.subsidy.service.CourseDictService;
import com.subsidy.util.ConstantUtils; import com.subsidy.util.ConstantUtils;
import com.subsidy.util.excel.ExcelUtil; 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 com.subsidy.vo.course.QueryCoursesVO;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactory;
...@@ -42,6 +25,7 @@ import org.springframework.scheduling.annotation.Async; ...@@ -42,6 +25,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -86,6 +70,12 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -86,6 +70,12 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
@Autowired @Autowired
private RankDictMapper rankDictMapper; private RankDictMapper rankDictMapper;
@Autowired
private CourseBusinessMappingMapper courseBusinessMappingMapper;
@Autowired
private BusinessScopeDictMapper businessScopeDictMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String addCourse(AddCourseDTO addCourseDTO) { public String addCourse(AddCourseDTO addCourseDTO) {
...@@ -154,6 +144,19 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -154,6 +144,19 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
} }
} }
//经营范围
if (null != addCourseDTO.getBusinessIds()) {
List<Long> 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; return ConstantUtils.ADD_SUCCESS;
} }
...@@ -184,14 +187,40 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -184,14 +187,40 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public IPage<QueryCoursesVO> queryCourses(QueryCoursesDTO queryCoursesDTO) { public IPage<QueryCoursesVO> queryCourses(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus()); IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getFieldId(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), queryCoursesDTO.getCourseType(), null, queryCoursesDTO.getOpenStatus(), queryCoursesDTO.getBusinessId());
List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords(); List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
//课程类目 //行业领域
List<CategoryDO> categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); List<CategoryDO> categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId());
queryCoursesVO.setCategoryDOS(categoryDOS);
List<CategoriesVO> 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<BusinessScopeDictDO> businessScopeDictDOS = businessScopeDictMapper.getBusinessScope(queryCoursesVO.getId());
List<BusinessVO> 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<JobDictDO> jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); List<JobDictDO> jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId());
...@@ -304,12 +333,29 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -304,12 +333,29 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
courseRankMappingMapper.insert(courseRankMappingDO); courseRankMappingMapper.insert(courseRankMappingDO);
} }
} }
return ConstantUtils.DELETE_SUCCESS;
//经营范围
if (null != updateCoursesDTO.getBusinessIds()) {
courseBusinessMappingMapper.delete(new QueryWrapper<CourseBusinessMappingDO>()
.lambda()
.eq(CourseBusinessMappingDO::getCourseId, updateCoursesDTO.getId()));
List<Long> 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) { public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) {
Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize());
IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus()); IPage<QueryCoursesVO> iPage = this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), null, queryCoursesDTO.getCategoryId(), queryCoursesDTO.getJobId(), queryCoursesDTO.getRankId(), null, queryCoursesDTO.getCompanyId(), queryCoursesDTO.getOpenStatus(),
queryCoursesDTO.getBusinessId());
List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords(); List<QueryCoursesVO> queryCoursesVOS = iPage.getRecords();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) { for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
...@@ -318,9 +364,20 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD ...@@ -318,9 +364,20 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
List<FieldDictDO> fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId()); List<FieldDictDO> fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId());
queryCoursesVO.setFieldDictDOS(fieldDictDOS); queryCoursesVO.setFieldDictDOS(fieldDictDOS);
//课程类目 //行业领域
List<CategoryDO> categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId()); List<CategoryDO> categoryDOS = categoryMapper.queryCourseCategory(queryCoursesVO.getId());
queryCoursesVO.setCategoryDOS(categoryDOS);
List<CategoriesVO> 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<JobDictDO> jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId()); List<JobDictDO> jobDictDOS = jobDictMapper.queryCourseJobs(queryCoursesVO.getId());
......
...@@ -75,7 +75,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -75,7 +75,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO h5CheckResult(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(),imageCheckDTO.getClassId(),0); return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 0);
} }
public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO loginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
...@@ -83,18 +83,18 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -83,18 +83,18 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception { public SendIdCardInfoVO h5LoginCheck(ImageCheckDTO imageCheckDTO) throws Exception {
return H5IdCheckCard(imageCheckDTO.getId(),imageCheckDTO.getClassId(),1); return H5IdCheckCard(imageCheckDTO.getId(), imageCheckDTO.getClassId(), 1);
} }
/** /**
* 当天验证次数超过 * 当天验证次数超过
*/ */
public void getDailyCheckCnt(Long memberId){ public void getDailyCheckCnt(Long memberId) {
int count = imageCheckRecordMapper.selectCount(new QueryWrapper<ImageCheckRecordDO>() int count = imageCheckRecordMapper.selectCount(new QueryWrapper<ImageCheckRecordDO>()
.lambda() .lambda()
.eq(ImageCheckRecordDO::getMemberId,memberId) .eq(ImageCheckRecordDO::getMemberId, memberId)
.ge(ImageCheckRecordDO::getCreateDate,LocalDateTime.now())); .ge(ImageCheckRecordDO::getCreateDate, LocalDateTime.now()));
if (count>3){ if (count > 3) {
throw new HttpException(18001); throw new HttpException(18001);
} }
} }
...@@ -127,7 +127,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -127,7 +127,13 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
String sign = sign(signList1, idCardTicketsVO.getValue()); String sign = sign(signList1, idCardTicketsVO.getValue());
//合作方后台上送身份信息 //合作方后台上送身份信息
SendIdCardInfoVO sendIdCardInfoVO = this.h5SendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign); SendIdCardInfoVO sendIdCardInfoVO = null;
if (StringUtils.isEmpty(memberDO.getCheckImage())){
sendIdCardInfoVO = this.h5SendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign);
}else {
sendIdCardInfoVO = this.h5SendIdCardInfoCompare(imageCheckRecordDO.getId()+"",memberDO,sign);
}
if (!"0".equals(sendIdCardInfoVO.getCode())) { if (!"0".equals(sendIdCardInfoVO.getCode())) {
imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId()); imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId());
throw new HttpException(10026); throw new HttpException(10026);
...@@ -177,7 +183,14 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -177,7 +183,14 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
String sign = sign(signList1, idCardTicketsVO.getValue()); String sign = sign(signList1, idCardTicketsVO.getValue());
//合作方后台上送身份信息 //合作方后台上送身份信息
SendIdCardInfoVO sendIdCardInfoVO = this.sendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign); // 查看之前是否有验证过,没有的话就调取权威库,有的话就进行两个图片对比
SendIdCardInfoVO sendIdCardInfoVO = null;
if (StringUtils.isEmpty(memberDO.getCheckImage())) {
sendIdCardInfoVO = this.sendIdCardInfo(imageCheckRecordDO.getId() + "", memberDO, sign);
}else {
sendIdCardInfoVO = this.sendIdCardInfoCompare(imageCheckRecordDO.getId()+"",memberDO,sign);
}
if (!"0".equals(sendIdCardInfoVO.getCode())) { if (!"0".equals(sendIdCardInfoVO.getCode())) {
imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId()); imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId());
throw new HttpException(10026); throw new HttpException(10026);
...@@ -225,7 +238,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -225,7 +238,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//如果是签到页的认证,则把图片写到member表里 //如果是签到页的认证,则把图片写到member表里
MemberDO memberDO = memberMapper.selectById(imageCheckRecordDO.getMemberId()); MemberDO memberDO = memberMapper.selectById(imageCheckRecordDO.getMemberId());
memberDO.setImage(checkImageResultVO.getPhoto()); memberDO.setImage(checkImageResultVO.getPhoto());
memberDO.setCheckTime(DateFormatUtil.format(new Date(),DateFormatUtil.FMT_sdf14_L)); memberDO.setCheckTime(DateFormatUtil.format(new Date(), DateFormatUtil.FMT_sdf14_L));
memberMapper.updateById(memberDO); memberMapper.updateById(memberDO);
if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 60)) { if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 60)) {
...@@ -277,7 +290,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -277,7 +290,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
/** /**
* PC端 合作方后台上送身份信息 POST请求 * PC端 合作方后台上送身份信息 POST请求 权威库 姓名+身份证
*/ */
public SendIdCardInfoVO sendIdCardInfo(String orderNo, MemberDO memberDO, String sign) { public SendIdCardInfoVO sendIdCardInfo(String orderNo, MemberDO memberDO, String sign) {
String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo; String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo;
...@@ -300,7 +313,30 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -300,7 +313,30 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
/** /**
* PC端 合作方后台上送身份信息 POST请求 * PC端 合作方后台上送身份信息 POST请求 图片对比
*/
public SendIdCardInfoVO sendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign) {
String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo;
String input = "{\n" +
" \"webankAppId\":\"" + WBAPPID + "\",\n" +
" \"orderNo\":\"" + orderNo + "\",\n" +
" \"sourcePhotoStr\":\"" + memberDO.getCheckImage() + "\"," +
" \"sourcePhotoType\":\"" + 2 + "\"," +
" \"userId\":\"" + memberDO.getId() + "\"," +
" \"version\":\"1.0.0\"," +
" \"sign\":\"" + sign + "\"" +
"}";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
ResponseEntity<SendIdCardInfoVO> 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) { public SendIdCardInfoVO h5SendIdCardInfo(String orderNo, MemberDO memberDO, String sign) {
String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo; String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo;
...@@ -324,6 +360,31 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap ...@@ -324,6 +360,31 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
} }
/** /**
* H5端 合作方后台上送身份信息 POST请求 图片对比
*/
public SendIdCardInfoVO h5SendIdCardInfoCompare(String orderNo, MemberDO memberDO, String sign) {
String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo;
String input = "{\n" +
" \"appId\":\"" + WBAPPID + "\",\n" +
" \"orderNo\":\"" + orderNo + "\",\n" +
" \"sourcePhotoStr\":\"" + memberDO.getCheckImage() + "\"," +
" \"sourcePhotoType\":\"" + 2 + "\"," +
" \"userId\":\"" + memberDO.getId() + "\"," +
" \"version\":\"1.0.0\"," +
" \"sign\":\"" + sign + "\"," +
" \"nonce\":\"" + NONCE + "\"" +
"}";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
ResponseEntity<SendIdCardInfoVO> responseEntity = restTemplateConfig.restTemplate()
.exchange(url, HttpMethod.POST, new HttpEntity<>(input, headers), SendIdCardInfoVO.class);
return responseEntity.getBody();
}
/**
* 获取nonce ticket * 获取nonce ticket
*/ */
public IdCardTicketsVO nonceTicket(String accessToken, String usrId) { public IdCardTicketsVO nonceTicket(String accessToken, String usrId) {
......
...@@ -20,6 +20,8 @@ import org.springframework.web.socket.TextMessage; ...@@ -20,6 +20,8 @@ import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketMessage; import org.springframework.web.socket.WebSocketMessage;
import org.springframework.web.socket.WebSocketSession; import org.springframework.web.socket.WebSocketSession;
import javax.websocket.OnMessage;
import java.io.IOException; import java.io.IOException;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -60,7 +62,7 @@ public class WebSocketUtil implements WebSocketHandler { ...@@ -60,7 +62,7 @@ public class WebSocketUtil implements WebSocketHandler {
ConcurrentHashMap<String, ScheduledFuture> taskMap = new ConcurrentHashMap<>(1); ConcurrentHashMap<String, ScheduledFuture> taskMap = new ConcurrentHashMap<>(1);
/** /**
* 处理成功连接WebSocket * 处理成功连接WebSocket 建立直接后调用
* @param session * @param session
*/ */
@Override @Override
...@@ -178,6 +180,7 @@ public class WebSocketUtil implements WebSocketHandler { ...@@ -178,6 +180,7 @@ public class WebSocketUtil implements WebSocketHandler {
oprMemDictDO.setIpAddress(session.getRemoteAddress().getHostName()); oprMemDictDO.setIpAddress(session.getRemoteAddress().getHostName());
oprMemDictMapper.insert(oprMemDictDO); oprMemDictMapper.insert(oprMemDictDO);
taskMap.get(session.getId()).cancel(true); taskMap.get(session.getId()).cancel(true);
} }
beatsNum++; beatsNum++;
} else if (null != session && session.isOpen()) { } else if (null != session && session.isOpen()) {
......
package com.subsidy.vo.businessScope;
import com.subsidy.model.BusinessScopeDictDO;
import lombok.Data;
@Data
public class BusinessVO extends BusinessScopeDictDO {
private String parentName;
}
package com.subsidy.vo.catagory;
import com.subsidy.model.CategoryDO;
import lombok.Data;
@Data
public class CategoriesVO extends CategoryDO {
private String parentName;
}
...@@ -5,6 +5,8 @@ import com.subsidy.model.CourseDictDO; ...@@ -5,6 +5,8 @@ import com.subsidy.model.CourseDictDO;
import com.subsidy.model.FieldDictDO; import com.subsidy.model.FieldDictDO;
import com.subsidy.model.JobDictDO; import com.subsidy.model.JobDictDO;
import com.subsidy.model.RankDictDO; import com.subsidy.model.RankDictDO;
import com.subsidy.vo.businessScope.BusinessVO;
import com.subsidy.vo.catagory.CategoriesVO;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.formula.functions.Rank; import org.apache.poi.ss.formula.functions.Rank;
...@@ -68,7 +70,7 @@ public class QueryCoursesVO { ...@@ -68,7 +70,7 @@ public class QueryCoursesVO {
/** /**
* 课程类目 * 课程类目
*/ */
private List<CategoryDO> categoryDOS; private List<CategoriesVO> categoryDOS;
/** /**
* 适用岗位 * 适用岗位
...@@ -80,5 +82,9 @@ public class QueryCoursesVO { ...@@ -80,5 +82,9 @@ public class QueryCoursesVO {
*/ */
private List<RankDictDO> rankDictDOS; private List<RankDictDO> rankDictDOS;
/**
* 经营范围
*/
private List<BusinessVO> businessVOS;
} }
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<if test="companyId == null or companyId == ''"> <if test="companyId == null or companyId == ''">
AND company_id IS NULL AND company_id IS NULL
</if> </if>
AND parent_id = 0 AND parent_id is null
AND delete_date IS NULL AND delete_date IS NULL
</where> </where>
</select> </select>
...@@ -44,8 +44,20 @@ ...@@ -44,8 +44,20 @@
FROM FROM
business_scope_dict business_scope_dict
WHERE WHERE
parent_id != 0 parent_id is not null
AND delete_date IS NULL AND delete_date IS NULL
</select> </select>
<select id="getBusinessScope" parameterType="long" resultType="com.subsidy.model.BusinessScopeDictDO">
SELECT
t2.*
FROM
course_business_mapping t
LEFT JOIN business_scope_dict t2 ON t.business_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.course_id = #{courseId}
</select>
</mapper> </mapper>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
WHERE WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t.parent_id IS NULL AND t.parent_id IS NULL
<if test="name =null and name != ''"> <if test="name !=null and name != ''">
AND t.`name` like concat('%',#{name} ,'%') AND t.`name` like concat('%',#{name} ,'%')
</if> </if>
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
......
<?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.subsidy.mapper.CourseBusinessMappingMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.subsidy.model.CourseBusinessMappingDO">
<id column="id" property="id" />
<result column="create_date" property="createDate" />
<result column="update_date" property="updateDate" />
<result column="delete_date" property="deleteDate" />
<result column="course_id" property="courseId" />
<result column="business_id" property="businessId" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_date,
update_date,
delete_date,
id, course_id, business_id
</sql>
</mapper>
...@@ -28,12 +28,14 @@ ...@@ -28,12 +28,14 @@
LEFT JOIN course_category_mapping t3 ON t.id = t3.course_id 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_job_mapping t4 ON t.id = t4.course_id
left join course_rank_mapping t5 on t.id = t5.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 WHERE
t.delete_date IS NULL t.delete_date IS NULL
AND t2.delete_date IS NULL AND t2.delete_date IS NULL
AND t3.delete_date IS NULL AND t3.delete_date IS NULL
AND t4.delete_date IS NULL AND t4.delete_date IS NULL
and t5.delete_date is null and t5.delete_date is null
and t6.delete_date is null
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">
and t.company_id = #{companyId} and t.company_id = #{companyId}
</if> </if>
...@@ -61,6 +63,9 @@ ...@@ -61,6 +63,9 @@
<if test="openStatus != null and openStatus != ''"> <if test="openStatus != null and openStatus != ''">
and t.open_status = #{openStatus} and t.open_status = #{openStatus}
</if> </if>
<if test="businessId != null and businessId != ''">
and t6.business_id = #{businessId}
</if>
</select> </select>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
......
...@@ -6,7 +6,7 @@ setParent=com.subsidy ...@@ -6,7 +6,7 @@ setParent=com.subsidy
# mapper.xml文件生成路径 # mapper.xml文件生成路径
mapperPath=/src/main/resources/mapper/ 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 driverName=com.mysql.cj.jdbc.Driver
userName=devloper userName=devloper
password=dev@1553$ password=dev@1553$
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!