Commit b88cae93 by 涂亚平

行业领域

1 parent 1b25b560
Showing with 393 additions and 87 deletions
......@@ -222,12 +222,6 @@
</dependency>
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.322</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
......
......@@ -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));
......
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 {
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));
......
......@@ -25,7 +25,7 @@ import io.swagger.annotations.Api;
* @since 2022-01-20
*/
@RestController
@Api(tags = "行业字典表")
@Api(tags = "行业字典表--弃用了??")
@RequestMapping("/fieldDict")
public class FieldDictController {
......
......@@ -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);
......
......@@ -62,4 +62,9 @@ public class AddCourseDTO {
*/
private List<Long> rankDictDOS;
/**
* 经营范围
*/
private List<Long> businessIds;
}
......@@ -19,6 +19,8 @@ public class QueryCoursesDTO {
private Long rankId;
private Long businessId;
private Long jobId;
private Long companyId;
......
......@@ -54,5 +54,10 @@ public class UpdateCoursesDTO {
*/
private List<Long> rankDictDOS;
/**
* 经营范围
*/
private List<Long> businessIds;
}
......@@ -5,8 +5,14 @@ import lombok.Data;
@Data
public class ImageCheckDTO {
/**
* 用户id
*/
private Long id;
/**
* 班级id
*/
private Long classId;
}
......@@ -23,4 +23,11 @@ public interface BusinessScopeDictMapper extends BaseMapper<BusinessScopeDictDO>
IPage<BusinessScopeDictVO> queryBusinessScopePage(Page page, Long companyId, String businessScopeName);
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> {
* courseName fieldId categoryId jobId courseRank courseType
* @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查询课程下的学生-----弃用
......
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> {
IPage<GetCategoriesVO> getCategories(GetCategoriesDTO getCategoriesDTO);
List<CategoryDO> getAll(GetCategoriesDTO getCategoriesDTO);
String addCategory(GetCategoriesVO getCategoriesVO);
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>
}
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) {
int count;
......
......@@ -76,16 +76,25 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
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()
.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);
}
}
......
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;
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<CourseDictMapper, CourseD
@Autowired
private RankDictMapper rankDictMapper;
@Autowired
private CourseBusinessMappingMapper courseBusinessMappingMapper;
@Autowired
private BusinessScopeDictMapper businessScopeDictMapper;
@Transactional(rollbackFor = Exception.class)
public String addCourse(AddCourseDTO addCourseDTO) {
......@@ -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;
}
......@@ -184,14 +187,40 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
public IPage<QueryCoursesVO> queryCourses(QueryCoursesDTO queryCoursesDTO) {
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();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
//课程类目
//行业领域
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());
......@@ -304,12 +333,29 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
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) {
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();
for (QueryCoursesVO queryCoursesVO : queryCoursesVOS) {
......@@ -318,9 +364,20 @@ public class CourseDictServiceImpl extends ServiceImpl<CourseDictMapper, CourseD
List<FieldDictDO> fieldDictDOS = fieldDictMapper.queryCourseFields(queryCoursesVO.getId());
queryCoursesVO.setFieldDictDOS(fieldDictDOS);
//课程类目
//行业领域
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());
......
......@@ -75,7 +75,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
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 {
......@@ -83,18 +83,18 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
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>()
.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<ImageCheckRecordMap
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())) {
imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId());
throw new HttpException(10026);
......@@ -177,7 +183,14 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
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())) {
imageCheckRecordMapper.deleteById(imageCheckRecordDO.getId());
throw new HttpException(10026);
......@@ -225,7 +238,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
//如果是签到页的认证,则把图片写到member表里
MemberDO memberDO = memberMapper.selectById(imageCheckRecordDO.getMemberId());
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);
if ((Double.valueOf(imageCheckRecordDO.getSimilarity()) > 60)) {
......@@ -277,7 +290,7 @@ public class ImageCheckRecordServiceImpl extends ServiceImpl<ImageCheckRecordMap
}
/**
* PC端 合作方后台上送身份信息 POST请求
* PC端 合作方后台上送身份信息 POST请求 权威库 姓名+身份证
*/
public SendIdCardInfoVO sendIdCardInfo(String orderNo, MemberDO memberDO, String sign) {
String url = "https://miniprogram-kyc.tencentcloudapi.com/api/server/h5/geth5faceid?orderNo=" + orderNo;
......@@ -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) {
String url = "https://kyc.qcloud.com/api/server/getAdvFaceId?orderNo=" + orderNo;
......@@ -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
*/
public IdCardTicketsVO nonceTicket(String accessToken, String usrId) {
......
......@@ -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<String, ScheduledFuture> 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()) {
......
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;
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<CategoryDO> categoryDOS;
private List<CategoriesVO> categoryDOS;
/**
* 适用岗位
......@@ -80,5 +82,9 @@ public class QueryCoursesVO {
*/
private List<RankDictDO> rankDictDOS;
/**
* 经营范围
*/
private List<BusinessVO> businessVOS;
}
......@@ -33,7 +33,7 @@
<if test="companyId == null or companyId == ''">
AND company_id IS NULL
</if>
AND parent_id = 0
AND parent_id is null
AND delete_date IS NULL
</where>
</select>
......@@ -44,8 +44,20 @@
FROM
business_scope_dict
WHERE
parent_id != 0
parent_id is not null
AND delete_date IS NULL
</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>
......@@ -39,7 +39,7 @@
WHERE
t.delete_date 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} ,'%')
</if>
<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 @@
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
<if test="companyId != null and companyId != ''">
and t.company_id = #{companyId}
</if>
......@@ -61,6 +63,9 @@
<if test="openStatus != null and openStatus != ''">
and t.open_status = #{openStatus}
</if>
<if test="businessId != null and businessId != ''">
and t6.business_id = #{businessId}
</if>
</select>
<sql id="Base_Column_List">
......
......@@ -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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!