From 24adb6f0bca36a858ef83b24d8b9e3323623790f Mon Sep 17 00:00:00 2001 From: tuyp Date: Wed, 14 Sep 2022 10:38:54 +0800 Subject: [PATCH] 监管版本备份 --- src/main/java/com/subsidy/controller/CertClassController.java | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/controller/CertClassMemberMappingController.java | 22 ++++++++++++++++++++++ src/main/java/com/subsidy/controller/CertMemberMappingController.java | 2 ++ src/main/java/com/subsidy/controller/MemberController.java | 2 +- src/main/java/com/subsidy/dto/cert/AddCertClassDTO.java | 15 +++++++++++++++ src/main/java/com/subsidy/mapper/CertClassMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/mapper/CertClassMemberMappingMapper.java | 18 ++++++++++++++++++ src/main/java/com/subsidy/model/CertClassDO.java | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/CertClassMemberMappingDO.java | 33 +++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/model/MemberDO.java | 5 +++++ src/main/java/com/subsidy/service/CertClassMemberMappingService.java | 16 ++++++++++++++++ src/main/java/com/subsidy/service/CertClassService.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CertClassMemberMappingServiceImpl.java | 20 ++++++++++++++++++++ src/main/java/com/subsidy/service/impl/CertClassServiceImpl.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 6 ++++++ src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java | 2 ++ src/main/java/com/subsidy/vo/member/CheckStatusVO.java | 1 + src/main/resources/mapper/CertClassMapper.xml | 40 ++++++++++++++++++++++++++++++++++++++++ src/main/resources/mapper/CertClassMemberMappingMapper.xml | 23 +++++++++++++++++++++++ src/main/resources/mapper/CompanyDictMapper.xml | 1 + 20 files changed, 468 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/subsidy/controller/CertClassController.java create mode 100644 src/main/java/com/subsidy/controller/CertClassMemberMappingController.java create mode 100644 src/main/java/com/subsidy/dto/cert/AddCertClassDTO.java create mode 100644 src/main/java/com/subsidy/mapper/CertClassMapper.java create mode 100644 src/main/java/com/subsidy/mapper/CertClassMemberMappingMapper.java create mode 100644 src/main/java/com/subsidy/model/CertClassDO.java create mode 100644 src/main/java/com/subsidy/model/CertClassMemberMappingDO.java create mode 100644 src/main/java/com/subsidy/service/CertClassMemberMappingService.java create mode 100644 src/main/java/com/subsidy/service/CertClassService.java create mode 100644 src/main/java/com/subsidy/service/impl/CertClassMemberMappingServiceImpl.java create mode 100644 src/main/java/com/subsidy/service/impl/CertClassServiceImpl.java create mode 100644 src/main/resources/mapper/CertClassMapper.xml create mode 100644 src/main/resources/mapper/CertClassMemberMappingMapper.xml diff --git a/src/main/java/com/subsidy/controller/CertClassController.java b/src/main/java/com/subsidy/controller/CertClassController.java new file mode 100644 index 0000000..76d2d1d --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertClassController.java @@ -0,0 +1,43 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.cert.AddCertClassDTO; +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.service.CertClassService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 证书班级映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ +@RestController +@Api(tags = "证书班级映射表") +@RequestMapping("/certClassMapping") +public class CertClassController { + + @Autowired + private CertClassService certClassMappingService; + + + @PostMapping("addCertClass") + @ApiOperation("添加班级 userId:登录人id certId courseId classTypeId className startDate endDate testRule 是否视频看完再做测试 isOrder 是否按照顺序播放 isFastPlay 是否快进 memberIds [] 班级学员") + @LoginRequired + public ResponseVO addClass(@RequestBody AddCertClassDTO addCertClassDTO){ + return ResponseData.generateCreatedResponse(0,certClassMappingService.addClass(addCertClassDTO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/CertClassMemberMappingController.java b/src/main/java/com/subsidy/controller/CertClassMemberMappingController.java new file mode 100644 index 0000000..89c3c21 --- /dev/null +++ b/src/main/java/com/subsidy/controller/CertClassMemberMappingController.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-09-06 + */ +@RestController +@Api(tags = "证书班级人员映射表") +@RequestMapping("/certClassMemberMapping") +public class CertClassMemberMappingController { + +} diff --git a/src/main/java/com/subsidy/controller/CertMemberMappingController.java b/src/main/java/com/subsidy/controller/CertMemberMappingController.java index 0dfaf18..8cd14e2 100644 --- a/src/main/java/com/subsidy/controller/CertMemberMappingController.java +++ b/src/main/java/com/subsidy/controller/CertMemberMappingController.java @@ -64,4 +64,6 @@ public class CertMemberMappingController { return ResponseData.generateCreatedResponse(0,certMemberMappingService.getSignInfo(certMemberMappingDO)); } + + } diff --git a/src/main/java/com/subsidy/controller/MemberController.java b/src/main/java/com/subsidy/controller/MemberController.java index 2d1fe45..49d9811 100644 --- a/src/main/java/com/subsidy/controller/MemberController.java +++ b/src/main/java/com/subsidy/controller/MemberController.java @@ -55,7 +55,7 @@ public class MemberController { } @PostMapping("updateMember") - @ApiOperation("编辑成员 {id companyId userName accountName accountNameEn telephone gender image idCard status departmentIds jobIds}") + @ApiOperation("编辑成员 {id companyId userName accountName accountNameEn telephone gender image idCard idCardPhoto status departmentIds jobIds}") @LoginRequired public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){ return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO)); diff --git a/src/main/java/com/subsidy/dto/cert/AddCertClassDTO.java b/src/main/java/com/subsidy/dto/cert/AddCertClassDTO.java new file mode 100644 index 0000000..9885c89 --- /dev/null +++ b/src/main/java/com/subsidy/dto/cert/AddCertClassDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.cert; + +import com.subsidy.model.CertClassDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCertClassDTO extends CertClassDO { + + private Long userId; + + private List memberIds; + +} diff --git a/src/main/java/com/subsidy/mapper/CertClassMapper.java b/src/main/java/com/subsidy/mapper/CertClassMapper.java new file mode 100644 index 0000000..9a1396c --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertClassMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertClassDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 证书班级映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ + @Repository +public interface CertClassMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/mapper/CertClassMemberMappingMapper.java b/src/main/java/com/subsidy/mapper/CertClassMemberMappingMapper.java new file mode 100644 index 0000000..97e2ddb --- /dev/null +++ b/src/main/java/com/subsidy/mapper/CertClassMemberMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CertClassMemberMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 证书班级人员映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ + @Repository +public interface CertClassMemberMappingMapper extends BaseMapper { + +} diff --git a/src/main/java/com/subsidy/model/CertClassDO.java b/src/main/java/com/subsidy/model/CertClassDO.java new file mode 100644 index 0000000..5fa1324 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertClassDO.java @@ -0,0 +1,124 @@ +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-09-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_class_mapping") +public class CertClassDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 证书id + */ + private Long certId; + + /** + * 班级名称 + */ + private String className; + + /** + * 班级类型:平台支持/企业自荐 + */ + private String classType; + + /** + * 班级类型id + */ + private Long classTypeId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 开课时间 + */ + private String startDate; + + /** + * 结课时间 + */ + private String endDate; + + /** + * 按序解锁时视频 1按照顺序解锁 + */ + private Long isOrder; + + /** + * 是否能快进 1:可以快进 + */ + private Long isFastPlay; + + /** + * 班级状态 + */ + private String openStatus; + + /** + * 1限制/0不限制 + */ + private Integer testRule; + + /** + * 学习上限时长 + */ + private Integer limitHour; + + /** + * 首次进入班级时人脸验证 + */ + private Integer imageClassCheck; + + /** + * 测试前人脸验证 + */ + private Integer imageTestCheck; + + /** + * 活跃度检测开启/关闭 + */ + private Integer activityDetection; + + /** + * 活跃度检测方式 1:常规 2:滑块 3:人脸识别 + */ + private Integer activityDetectionMethod; + + /** + * 首次播放允许拖曳 + */ + private Integer firstDragAllowed; + + /** + * 首次播放允许倍速 + */ + private Integer firstSpeedAllowed; + + /** + * 课时抓拍 + */ + private Integer playSnap; + + +} diff --git a/src/main/java/com/subsidy/model/CertClassMemberMappingDO.java b/src/main/java/com/subsidy/model/CertClassMemberMappingDO.java new file mode 100644 index 0000000..923a7a5 --- /dev/null +++ b/src/main/java/com/subsidy/model/CertClassMemberMappingDO.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-09-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("cert_class_member_mapping") +public class CertClassMemberMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long certClassId; + + private Long memberId; + + +} diff --git a/src/main/java/com/subsidy/model/MemberDO.java b/src/main/java/com/subsidy/model/MemberDO.java index 9d7ae91..67d1500 100644 --- a/src/main/java/com/subsidy/model/MemberDO.java +++ b/src/main/java/com/subsidy/model/MemberDO.java @@ -101,6 +101,11 @@ public class MemberDO extends BaseModel { private String idCard; /** + * 身份证照片 + */ + private String idCardPhoto; + + /** * 第一次登录 */ private Integer firstLogin; diff --git a/src/main/java/com/subsidy/service/CertClassMemberMappingService.java b/src/main/java/com/subsidy/service/CertClassMemberMappingService.java new file mode 100644 index 0000000..1134837 --- /dev/null +++ b/src/main/java/com/subsidy/service/CertClassMemberMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.CertClassMemberMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 证书班级人员映射表 服务类 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ +public interface CertClassMemberMappingService extends IService { + +} diff --git a/src/main/java/com/subsidy/service/CertClassService.java b/src/main/java/com/subsidy/service/CertClassService.java new file mode 100644 index 0000000..0d84084 --- /dev/null +++ b/src/main/java/com/subsidy/service/CertClassService.java @@ -0,0 +1,20 @@ +package com.subsidy.service; + +import com.subsidy.dto.cert.AddCertClassDTO; +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.model.CertClassDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 证书班级映射表 服务类 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ +public interface CertClassService extends IService { + + Long addClass(AddCertClassDTO addCertClassDTO); + +} diff --git a/src/main/java/com/subsidy/service/impl/CertClassMemberMappingServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertClassMemberMappingServiceImpl.java new file mode 100644 index 0000000..1109fb2 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertClassMemberMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.CertClassMemberMappingDO; +import com.subsidy.mapper.CertClassMemberMappingMapper; +import com.subsidy.service.CertClassMemberMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 证书班级人员映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ +@Service +public class CertClassMemberMappingServiceImpl extends ServiceImpl implements CertClassMemberMappingService { + +} diff --git a/src/main/java/com/subsidy/service/impl/CertClassServiceImpl.java b/src/main/java/com/subsidy/service/impl/CertClassServiceImpl.java new file mode 100644 index 0000000..d476b88 --- /dev/null +++ b/src/main/java/com/subsidy/service/impl/CertClassServiceImpl.java @@ -0,0 +1,58 @@ +package com.subsidy.service.impl; + +import com.subsidy.common.constant.CourseNotification; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.cert.AddCertClassDTO; +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.jobs.CourseNotificationJob; +import com.subsidy.mapper.CertClassMemberMappingMapper; +import com.subsidy.model.*; +import com.subsidy.mapper.CertClassMapper; +import com.subsidy.service.CertClassService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.DateFormatUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + *

+ * 证书班级映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2022-09-06 + */ +@Service +public class CertClassServiceImpl extends ServiceImpl implements CertClassService { + + + @Autowired + private CertClassMemberMappingMapper certClassMemberMappingMapper; + + @Transactional(rollbackFor = Exception.class) + public Long addClass(AddCertClassDTO addCertClassDTO) { + + //新建一个班级 + CertClassDO certClassDO = new CertClassDO(); + BeanUtils.copyProperties(addCertClassDTO, certClassDO); + this.baseMapper.insert(certClassDO); + + //班级里添加成员 + List memberIds = addCertClassDTO.getMemberIds(); + for (Long lg : memberIds) { + CertClassMemberMappingDO certClassMemberMappingDO = new CertClassMemberMappingDO(); + certClassMemberMappingDO.setMemberId(lg); + certClassMemberMappingDO.setCertClassId(certClassDO.getId()); + certClassMemberMappingMapper.insert(certClassMemberMappingDO); + } + return certClassDO.getId(); + } + +} diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 1c1672d..349059d 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -662,6 +662,12 @@ public class MemberServiceImpl extends ServiceImpl imple checkStatusVO.setSMSStatus(false); } + if (StringUtils.isEmpty(memberDO1.getIdCardPhoto())){ + checkStatusVO.setIdCardStatus(false); + }else { + checkStatusVO.setIdCardStatus(true); + } + return checkStatusVO; } diff --git a/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java index 8ab3ea2..4f836c3 100644 --- a/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java +++ b/src/main/java/com/subsidy/vo/company/GetCompanyMembersVO.java @@ -11,6 +11,8 @@ public class GetCompanyMembersVO { private String idCard; + private String idCardPhoto; + private String companyName; private Integer firstLogin; diff --git a/src/main/java/com/subsidy/vo/member/CheckStatusVO.java b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java index 5c56033..a6f2f84 100644 --- a/src/main/java/com/subsidy/vo/member/CheckStatusVO.java +++ b/src/main/java/com/subsidy/vo/member/CheckStatusVO.java @@ -9,4 +9,5 @@ public class CheckStatusVO { private Boolean imageStatus; + private Boolean idCardStatus; } diff --git a/src/main/resources/mapper/CertClassMapper.xml b/src/main/resources/mapper/CertClassMapper.xml new file mode 100644 index 0000000..f882879 --- /dev/null +++ b/src/main/resources/mapper/CertClassMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, cert_id, class_name, class_type, class_type_id, course_id, start_date, end_date, is_order, is_fast_play, open_status, test_rule, limit_hour, image_class_check, image_test_check, activity_detection, activity_detection_method, first_drag_allowed, first_speed_allowed, play_snap + + + diff --git a/src/main/resources/mapper/CertClassMemberMappingMapper.xml b/src/main/resources/mapper/CertClassMemberMappingMapper.xml new file mode 100644 index 0000000..aa2ad74 --- /dev/null +++ b/src/main/resources/mapper/CertClassMemberMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, cert_class_mapping_id, member_id + + + diff --git a/src/main/resources/mapper/CompanyDictMapper.xml b/src/main/resources/mapper/CompanyDictMapper.xml index a9ad5f9..f1ff3d1 100644 --- a/src/main/resources/mapper/CompanyDictMapper.xml +++ b/src/main/resources/mapper/CompanyDictMapper.xml @@ -80,6 +80,7 @@ t.id, t.user_name, t.id_card, + t.id_card_photo, t2.company_name, t.first_login, t.check_image, -- libgit2 0.25.0