Commit 205d0ae8 by 涂亚平

结束两个月居家办公

1 parent 2db33758
Showing with 524 additions and 51 deletions
...@@ -133,11 +133,11 @@ ...@@ -133,11 +133,11 @@
<version>${swagger2.version}</version> <version>${swagger2.version}</version>
</dependency> </dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>com.amdelamar</groupId>--> <!-- <groupId>com.amdelamar</groupId>-->
<!-- <artifactId>jhash</artifactId>--> <!-- <artifactId>jhash</artifactId>-->
<!-- <version>${jhash.version}</version>--> <!-- <version>${jhash.version}</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
...@@ -208,10 +208,16 @@ ...@@ -208,10 +208,16 @@
<version>${jedis.version}</version> <version>${jedis.version}</version>
</dependency> </dependency>
<!-- <dependency>--> <!--webSocket-->
<!-- <groupId>org.springframework.boot</groupId>--> <dependency>
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>--> <groupId>org.springframework.boot</groupId>
<!-- </dependency>--> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
<!-- </dependency>-->
</dependencies> </dependencies>
......
package com.subsidy.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "qxueyou")
public class QXueYouConfig {
private String appId;
private String securityKey;
private String url;
}
...@@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import sun.security.provider.certpath.ResponderId;
/** /**
* <p> * <p>
...@@ -32,7 +31,7 @@ public class CertCompanyMappingController { ...@@ -32,7 +31,7 @@ public class CertCompanyMappingController {
@PostMapping("getCompanyCertsWithStatus") @PostMapping("getCompanyCertsWithStatus")
@ApiOperation("获取某个公司的项目证书(返回学生报名状态) companyId 公司id typeId 类型id(查全部传空) memberId 学生id") @ApiOperation("获取某个公司的项目证书(返回学生报名状态) companyId 公司id typeId 类型id(查全部传空) memberId 学生id")
public ResponseVO getCompanyCertsWithStatus(@RequestParam GetCompanyCertsWithStatusDTO getCompanyCertsDTO){ public ResponseVO getCompanyCertsWithStatus(@RequestBody GetCompanyCertsWithStatusDTO getCompanyCertsDTO){
return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCertsWithStatus(getCompanyCertsDTO)); return ResponseData.generateCreatedResponse(0,certCompanyMappingService.getCompanyCertsWithStatus(getCompanyCertsDTO));
} }
......
...@@ -5,6 +5,7 @@ import com.subsidy.common.ResponseData; ...@@ -5,6 +5,7 @@ import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO; import com.subsidy.common.ResponseVO;
import com.subsidy.dto.cert.AddCertDTO; import com.subsidy.dto.cert.AddCertDTO;
import com.subsidy.dto.cert.GetAllCertsDTO; import com.subsidy.dto.cert.GetAllCertsDTO;
import com.subsidy.dto.cert.GetOneCertDTO;
import com.subsidy.model.CertDictDO; import com.subsidy.model.CertDictDO;
import com.subsidy.service.CertDictService; import com.subsidy.service.CertDictService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -33,7 +34,7 @@ public class CertDictController { ...@@ -33,7 +34,7 @@ public class CertDictController {
private CertDictService certDictService; private CertDictService certDictService;
@PostMapping("addCert") @PostMapping("addCert")
@ApiOperation("添加证书 certName price coverPage title副标题 scribePrice 划线价格 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeIds[] 类型id requirementDesc 条件说明 submitDesc 提交说明") @ApiOperation("添加证书 certName price coverPage title副标题 scribePrice 划线价格 certDesc 证书简介 detail chargeAndSubsidy 学费和补贴 serviceProcess服务流程 refundGuarantee 退费流程 typeIds[] 类型id requirementDesc 条件说明 submitDesc 提交说明")
public ResponseVO addCert(@RequestBody AddCertDTO addCertDTO){ public ResponseVO addCert(@RequestBody AddCertDTO addCertDTO){
return ResponseData.generateCreatedResponse(0,certDictService.addCert(addCertDTO)); return ResponseData.generateCreatedResponse(0,certDictService.addCert(addCertDTO));
} }
...@@ -51,9 +52,9 @@ public class CertDictController { ...@@ -51,9 +52,9 @@ public class CertDictController {
} }
@PostMapping("getOneCert") @PostMapping("getOneCert")
@ApiOperation("获取一个证书 id") @ApiOperation("获取一个证书 id userId")
public ResponseVO getOneCert(@RequestBody CertDictDO certDictDO){ public ResponseVO getOneCert(@RequestBody GetOneCertDTO getOneCertDTO){
return ResponseData.generateCreatedResponse(0,certDictService.getOneCert(certDictDO)); return ResponseData.generateCreatedResponse(0,certDictService.getOneCert(getOneCertDTO));
} }
@PostMapping("getAllCerts") @PostMapping("getAllCerts")
......
...@@ -33,7 +33,7 @@ public class CertTypeDictController { ...@@ -33,7 +33,7 @@ public class CertTypeDictController {
@PostMapping("getCompanyCertTypes") @PostMapping("getCompanyCertTypes")
@ApiOperation("(手机端)获取某个公司所有的证书类型 companyId") @ApiOperation("(手机端)获取某个公司所有的证书类型 companyId")
public ResponseVO getCompanyCertTypes(@RequestParam CertCompanyMappingDO certCompanyMappingDO){ public ResponseVO getCompanyCertTypes(@RequestBody CertCompanyMappingDO certCompanyMappingDO){
return ResponseData.generateCreatedResponse(0,certTypeDictService.getCompanyCertTypes(certCompanyMappingDO)); return ResponseData.generateCreatedResponse(0,certTypeDictService.getCompanyCertTypes(certCompanyMappingDO));
} }
......
...@@ -167,4 +167,11 @@ public class MemberController { ...@@ -167,4 +167,11 @@ public class MemberController {
public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){ public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){
return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO)); return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO));
} }
@PostMapping("qxy")
@ApiOperation("Q学友授权 telephone 手机号")
public ResponseVO qxy(@RequestBody MemberDO memberDO){
return ResponseData.generateCreatedResponse(0,memberService.qxy(memberDO));
}
} }
...@@ -10,7 +10,7 @@ public class GetAllCertsDTO { ...@@ -10,7 +10,7 @@ public class GetAllCertsDTO {
private Integer pageNum; private Integer pageNum;
private Long certTypeId; private Long typeId;
private String certName; private String certName;
......
package com.subsidy.dto.cert;
import lombok.Data;
@Data
public class GetOneCertDTO {
private Integer id;
private Long userId;
}
package com.subsidy.dto.exercise; package com.subsidy.dto.exercise;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.subsidy.util.excel.ExcelColumnUtil; import com.subsidy.util.excel.ExcelColumnUtil;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@Data @Data
public class ImportHistory { public class ImportHistory {
...@@ -57,6 +59,7 @@ public class ImportHistory { ...@@ -57,6 +59,7 @@ public class ImportHistory {
private String result; private String result;
@ExcelColumnUtil(value = "create_date", col = 10) @ExcelColumnUtil(value = "create_date", col = 10)
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String create_date; private String create_date;
} }
...@@ -21,7 +21,7 @@ import java.util.List; ...@@ -21,7 +21,7 @@ import java.util.List;
public interface CertCompanyMappingMapper extends BaseMapper<CertCompanyMappingDO> { public interface CertCompanyMappingMapper extends BaseMapper<CertCompanyMappingDO> {
//获取某个公司的某个类型下的证书 companyId typeId //获取某个公司的某个类型下的证书 companyId typeId
List<CertDictDO> getCompanyCerts(Long CompanyId, Long typeId); List<CertDictDO> getCompanyCerts(Long companyId, Long typeId);
//获取全部证书公司映射情况 分页 包含企业状态 //获取全部证书公司映射情况 分页 包含企业状态
IPage<GetCompanyCertsVO> getCompanyCertStatus(IPage page); IPage<GetCompanyCertsVO> getCompanyCertStatus(IPage page);
......
...@@ -34,5 +34,7 @@ public interface CertMemberMappingMapper extends BaseMapper<CertMemberMappingDO> ...@@ -34,5 +34,7 @@ public interface CertMemberMappingMapper extends BaseMapper<CertMemberMappingDO>
*/ */
GetSignInfoVO getSignInfo(Long memberId,Long certId); GetSignInfoVO getSignInfo(Long memberId,Long certId);
int memberCertStatus(Long memberId,Long certId);
} }
...@@ -32,5 +32,4 @@ public interface OprAdmDictMapper extends BaseMapper<OprAdmDictDO> { ...@@ -32,5 +32,4 @@ public interface OprAdmDictMapper extends BaseMapper<OprAdmDictDO> {
List<OprAdmDictDO> getRecordByDate(); List<OprAdmDictDO> getRecordByDate();
void deleteById(Long id);
} }
...@@ -23,5 +23,4 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> { ...@@ -23,5 +23,4 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List<OprMemDictDO> getRecordByDate(); List<OprMemDictDO> getRecordByDate();
void deleteById(Long id);
} }
...@@ -57,6 +57,11 @@ public class CertDictDO extends BaseModel { ...@@ -57,6 +57,11 @@ public class CertDictDO extends BaseModel {
private String coverPage; private String coverPage;
/** /**
* 详情封面
*/
private String detailPage;
/**
* 详情 * 详情
*/ */
private String detail; private String detail;
......
...@@ -50,5 +50,10 @@ public class CompanyDictDO extends BaseModel { ...@@ -50,5 +50,10 @@ public class CompanyDictDO extends BaseModel {
*/ */
private String address; private String address;
/**
* 是否需要跳转到Q学友
*/
private Boolean qxyStatus;
} }
...@@ -3,6 +3,7 @@ package com.subsidy.service; ...@@ -3,6 +3,7 @@ package com.subsidy.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.subsidy.dto.cert.AddCertDTO; import com.subsidy.dto.cert.AddCertDTO;
import com.subsidy.dto.cert.GetAllCertsDTO; import com.subsidy.dto.cert.GetAllCertsDTO;
import com.subsidy.dto.cert.GetOneCertDTO;
import com.subsidy.model.CertDictDO; import com.subsidy.model.CertDictDO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.subsidy.vo.cert.GetAllCertsVO; import com.subsidy.vo.cert.GetAllCertsVO;
...@@ -27,7 +28,7 @@ public interface CertDictService extends IService<CertDictDO> { ...@@ -27,7 +28,7 @@ public interface CertDictService extends IService<CertDictDO> {
String updateCert(AddCertDTO addCertDTO); String updateCert(AddCertDTO addCertDTO);
GetOneCertVO getOneCert(CertDictDO certDictDO); GetOneCertVO getOneCert(GetOneCertDTO getOneCertDTO);
IPage<GetAllCertsVO> getAllCerts(GetAllCertsDTO getAllCertsDTO); IPage<GetAllCertsVO> getAllCerts(GetAllCertsDTO getAllCertsDTO);
......
...@@ -63,4 +63,5 @@ public interface MemberService extends IService<MemberDO> { ...@@ -63,4 +63,5 @@ public interface MemberService extends IService<MemberDO> {
String changeDepartments(ChangeDepartmentsDTO changeDepartmentsDTO); String changeDepartments(ChangeDepartmentsDTO changeDepartmentsDTO);
QxyVO qxy(MemberDO memberDO);
} }
...@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.subsidy.dto.cert.AddCertDTO; import com.subsidy.dto.cert.AddCertDTO;
import com.subsidy.dto.cert.GetAllCertsDTO; import com.subsidy.dto.cert.GetAllCertsDTO;
import com.subsidy.mapper.CertRequirementMapper; import com.subsidy.dto.cert.GetOneCertDTO;
import com.subsidy.mapper.CertTypeDictMapper; import com.subsidy.mapper.*;
import com.subsidy.mapper.CertTypeMappingMapper;
import com.subsidy.model.*; import com.subsidy.model.*;
import com.subsidy.mapper.CertDictMapper;
import com.subsidy.service.CertDictService; import com.subsidy.service.CertDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.service.CertTypeDictService; import com.subsidy.service.CertTypeDictService;
...@@ -17,6 +15,7 @@ import com.subsidy.util.ConstantUtils; ...@@ -17,6 +15,7 @@ import com.subsidy.util.ConstantUtils;
import com.subsidy.vo.cert.GetAllCertsVO; import com.subsidy.vo.cert.GetAllCertsVO;
import com.subsidy.vo.cert.GetAllCertsWithoutTypeVO; import com.subsidy.vo.cert.GetAllCertsWithoutTypeVO;
import com.subsidy.vo.cert.GetOneCertVO; import com.subsidy.vo.cert.GetOneCertVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -46,6 +45,9 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO> ...@@ -46,6 +45,9 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO>
@Autowired @Autowired
private CertRequirementMapper certRequirementMapper; private CertRequirementMapper certRequirementMapper;
@Autowired
private CertMemberMappingMapper certMemberMappingMapper;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String addCert(AddCertDTO addCertDTO) { public String addCert(AddCertDTO addCertDTO) {
...@@ -106,23 +108,31 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO> ...@@ -106,23 +108,31 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO>
return ConstantUtils.SET_SUCCESS; return ConstantUtils.SET_SUCCESS;
} }
public GetOneCertVO getOneCert(CertDictDO certDictDO) { public GetOneCertVO getOneCert(GetOneCertDTO getOneCertDTO) {
GetOneCertVO getOneCertVO = new GetOneCertVO(); GetOneCertVO getOneCertVO = new GetOneCertVO();
CertDictDO certDictDO1 = this.baseMapper.selectById(certDictDO.getId()); CertDictDO certDictDO1 = this.baseMapper.selectById(getOneCertDTO.getId());
BeanUtils.copyProperties(certDictDO1, getOneCertVO); BeanUtils.copyProperties(certDictDO1, getOneCertVO);
//查看证书有哪些类型 //查看证书有哪些类型
List<CertTypeDictDO> certTypeDictDOS = certTypeDictMapper.getCertTypes(certDictDO.getId()); List<CertTypeDictDO> certTypeDictDOS = certTypeDictMapper.getCertTypes(certDictDO1.getId());
getOneCertVO.setCertTypeDictDOS(certTypeDictDOS); getOneCertVO.setCertTypeDictDOS(certTypeDictDOS);
Integer count = certMemberMappingMapper.memberCertStatus(getOneCertDTO.getUserId(),certDictDO1.getId());
if (count > 0){
getOneCertVO.setStatus(true);
}else {
getOneCertVO.setStatus(false);
}
return getOneCertVO; return getOneCertVO;
} }
public IPage<GetAllCertsVO> getAllCerts(GetAllCertsDTO getAllCertsDTO) { public IPage<GetAllCertsVO> getAllCerts(GetAllCertsDTO getAllCertsDTO) {
Page pager = new Page(getAllCertsDTO.getPageNum(), getAllCertsDTO.getPageSize()); Page pager = new Page(getAllCertsDTO.getPageNum(), getAllCertsDTO.getPageSize());
IPage<GetAllCertsVO> getAllCertsVOIPage = this.baseMapper.getAllCerts(pager,getAllCertsDTO.getCertTypeId(),getAllCertsDTO.getCertName()); IPage<GetAllCertsVO> getAllCertsVOIPage = this.baseMapper.getAllCerts(pager,getAllCertsDTO.getTypeId(),getAllCertsDTO.getCertName());
List<GetAllCertsVO> getAllCertsVOS = getAllCertsVOIPage.getRecords(); List<GetAllCertsVO> getAllCertsVOS = getAllCertsVOIPage.getRecords();
for (GetAllCertsVO gav : getAllCertsVOS){ for (GetAllCertsVO gav : getAllCertsVOS){
......
...@@ -23,6 +23,7 @@ import com.subsidy.vo.cert.GetSignInfoVO; ...@@ -23,6 +23,7 @@ import com.subsidy.vo.cert.GetSignInfoVO;
import com.subsidy.vo.cert.SignManagementVO; import com.subsidy.vo.cert.SignManagementVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -47,6 +48,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM ...@@ -47,6 +48,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
@Autowired @Autowired
private CertRequirementMapper certRequirementMapper; private CertRequirementMapper certRequirementMapper;
@Transactional(rollbackFor = Exception.class)
public String signUp(SignUpDTO signUpDTO) { public String signUp(SignUpDTO signUpDTO) {
List<CertMemberFileMappingDO> certMemberFileMappingDOS = signUpDTO.getFiles(); List<CertMemberFileMappingDO> certMemberFileMappingDOS = signUpDTO.getFiles();
...@@ -54,13 +56,14 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM ...@@ -54,13 +56,14 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
for (CertMemberFileMappingDO certMemberFileMappingDO : certMemberFileMappingDOS) { for (CertMemberFileMappingDO certMemberFileMappingDO : certMemberFileMappingDOS) {
certMemberFileMappingDO.setCertId(signUpDTO.getCertId()); certMemberFileMappingDO.setCertId(signUpDTO.getCertId());
certMemberFileMappingDO.setMemberId(signUpDTO.getMemberId()); certMemberFileMappingDO.setMemberId(signUpDTO.getMemberId());
certMemberFileMappingDO.setRequirementId(certMemberFileMappingDO.getRequirementId());
certMemberFileMappingMapper.insert(certMemberFileMappingDO); certMemberFileMappingMapper.insert(certMemberFileMappingDO);
} }
CertMemberMappingDO certMemberMappingDO = new CertMemberMappingDO(); CertMemberMappingDO certMemberMappingDO = new CertMemberMappingDO();
certMemberMappingDO.setCertId(signUpDTO.getCertId()); certMemberMappingDO.setCertId(signUpDTO.getCertId());
certMemberMappingDO.setMemberId(signUpDTO.getMemberId()); certMemberMappingDO.setMemberId(signUpDTO.getMemberId());
certMemberMappingDO.setOrderNo(System.currentTimeMillis()); certMemberMappingDO.setOrderNo(System.currentTimeMillis());
certMemberMappingDO.setStatus("报名成功"); certMemberMappingDO.setStatus("等待确认");
this.baseMapper.insert(certMemberMappingDO); this.baseMapper.insert(certMemberMappingDO);
//生成订单逻辑 TODO //生成订单逻辑 TODO
...@@ -93,7 +96,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM ...@@ -93,7 +96,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
public String changeStatus(CertMemberMappingDO certMemberMappingDO) { public String changeStatus(CertMemberMappingDO certMemberMappingDO) {
CertMemberMappingDO certMemberMappingDO1 = this.baseMapper.selectById(certMemberMappingDO.getId()); CertMemberMappingDO certMemberMappingDO1 = this.baseMapper.selectById(certMemberMappingDO.getId());
certMemberMappingDO1.setStatus(certMemberMappingDO.getStatus()); certMemberMappingDO1.setStatus(certMemberMappingDO.getStatus());
this.baseMapper.updateById(certMemberMappingDO); this.baseMapper.updateById(certMemberMappingDO1);
return ConstantUtils.SET_SUCCESS; return ConstantUtils.SET_SUCCESS;
} }
......
...@@ -9,14 +9,20 @@ import com.subsidy.service.ExerciseDoneResultService; ...@@ -9,14 +9,20 @@ import com.subsidy.service.ExerciseDoneResultService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.util.excel.ExcelUtil; import com.subsidy.util.excel.ExcelUtil;
import com.subsidy.vo.exercise.GetDoneDetailVO; import com.subsidy.vo.exercise.GetDoneDetailVO;
import org.apache.poi.ss.usermodel.DateUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.swing.text.DateFormatter;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Random; import java.util.Random;
/** /**
...@@ -63,8 +69,8 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul ...@@ -63,8 +69,8 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul
.eq(ExerciseDoneHistoryDO::getMemberId,exerciseDoneResultDO.getMemberId()) .eq(ExerciseDoneHistoryDO::getMemberId,exerciseDoneResultDO.getMemberId())
.eq(ExerciseDoneHistoryDO::getPaperId,exerciseDoneResultDO.getPaperId())); .eq(ExerciseDoneHistoryDO::getPaperId,exerciseDoneResultDO.getPaperId()));
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter =
DateTimeFormatter.ofPattern("EEE MMM dd HH:mm:ss zzz yyyy",Locale.ENGLISH);
//遍历写入 //遍历写入
for (ExerciseDoneHistoryDO exerciseDoneHistoryDO : exerciseDoneHistoryDOS){ for (ExerciseDoneHistoryDO exerciseDoneHistoryDO : exerciseDoneHistoryDOS){
ExerciseDoneHistoryDO ex = new ExerciseDoneHistoryDO(); ExerciseDoneHistoryDO ex = new ExerciseDoneHistoryDO();
...@@ -74,7 +80,9 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul ...@@ -74,7 +80,9 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul
ex.setDoneId(s.getId()); ex.setDoneId(s.getId());
ex.setClassId(s.getClassId()); ex.setClassId(s.getClassId());
ex.setPaperId(s.getPaperId()); ex.setPaperId(s.getPaperId());
ex.setCreateDate(LocalDateTime.parse(s.getCreate_date(),df)); // DateUtil.getJavaDate()
ex.setCreateDate(LocalDateTime.parse(s.getCreate_date(),formatter));
exerciseDoneHistoryMapper.insert(ex); exerciseDoneHistoryMapper.insert(ex);
} }
......
package com.subsidy.util;
public class ResultMode {
/**
* 成功:true,失败:false
*/
private boolean success;
/**
* 返回编码
*/
private int resultCode;
/**
* 返回消息
*/
private String msg;
/**
* 结果数据
*/
private Object data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public int getResultCode() {
return resultCode;
}
public void setResultCode(int resultCode) {
this.resultCode = resultCode;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
package com.subsidy.util; package com.subsidy.util;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import java.math.BigInteger; import java.math.BigInteger;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Random;
import java.util.UUID; import java.util.UUID;
public class SecretUtils { public class SecretUtils {
...@@ -61,6 +64,38 @@ public class SecretUtils { ...@@ -61,6 +64,38 @@ public class SecretUtils {
} }
/**
* Q学友SHA加密
* @param arr
* @return
*/
public static String gen(String... arr) {
if (StringUtils.isAnyEmpty(arr)) {
throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr));
} else {
Arrays.sort(arr);
StringBuilder sb = new StringBuilder();
String[] var2 = arr;
int var3 = arr.length;
for (int var4 = 0; var4 < var3; ++var4) {
String a = var2[var4];
sb.append(a);
}
return DigestUtils.sha1Hex(sb.toString());
}
}
public static String getNonce(int length) {
String val = "";
Random random = new Random();
//参数length,表示生成几位随机数
for (int i = 0; i < length; i++) {
val += String.valueOf(random.nextInt(10));
}
return val;
}
private static byte[] md5(String s) private static byte[] md5(String s)
{ {
......
package com.subsidy.util.websocket;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpSession;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@ServerEndpoint(value = "/chat",configurator = GetHttpSessionConfigurator.class) //与前端的那个对应
@Component
public class ChatEndPoint {
/**
* 用来存储每一个客户端对象对应的ChatEndPoint
*/
private static Map<String, ChatEndPoint> onlineUsers = new ConcurrentHashMap<>();
/**
* 声明session对象 通过该对象可以发送消息给指定的用户/客户端
*/
private Session session;
/**
* 声明一个HttpSession对象,我们之前在HttpSession对象中存储了用户名
*/
private HttpSession httpSession;
/**
* 连接建立时候被调用
*/
@OnOpen
public void open(Session session, EndpointConfig endpointConfig) {
//将局部的Session对象赋值给成员Session
this.session = session;
//获取httpSession对象
HttpSession httpSession = (HttpSession) session.getUserProperties().get(HttpSession.class.getName());
this.httpSession = httpSession;
//从httpSession对象中获取用户名
String userName = (String) httpSession.getAttribute("user");
//将当前对象存储到容器里面 当前chatEndpoint对象
onlineUsers.put(userName, this);
//将当前在线用户的用户名推送给所有的客户端
//1.获取消息
//所有在线的用户名
String msg = MessageUtils.getMessage(true, null, getName());
// 2.调用方法进行系统消息的推送
broadcastAllUsers(msg);
}
private void broadcastAllUsers(String message){
try {
//要将该消息推送给所有的客户端
Set<String> set = onlineUsers.keySet();
for (String user : set){
ChatEndPoint chatEndPoint = onlineUsers.get(user);
chatEndPoint.session.getBasicRemote().sendText(message);
}
}catch (Exception e){
e.printStackTrace();
}
}
private Set<String> getName() {
return onlineUsers.keySet();
}
/**
* 接收到客户端发送的数据时候被调用
*/
@OnMessage
public void onMessage(String msg, Session session) {
try {
//将msg转换成Message对象
ObjectMapper objectMapper = new ObjectMapper();
Message message = objectMapper.readValue(msg,Message.class);
//获取要接受数据的人
String toName = message.getToName();
//获取消息数据
String data = message.getMessage();
//获取当前登录的用户
String userName = (String) httpSession.getAttribute("user");
//获取推送给指定用户的消息格式的数据
String result = MessageUtils.getMessage(false,userName,data);
//发送数据
onlineUsers.get(toName).session.getBasicRemote().sendText(result);
}catch (Exception e){
e.printStackTrace();
}
}
/**
* 客户端关闭时候被调用
*/
@OnClose
public void onClose(Session session) {
//获取当前登录的用户
String userName = (String) httpSession.getAttribute("user");
// 从容器中删除指定的用户
onlineUsers.remove(userName);
//获取推送消息
String msg = MessageUtils.getMessage(true,null,getName());
broadcastAllUsers(msg);
}
}
package com.subsidy.util.websocket;
import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;
public class GetHttpSessionConfigurator extends ServerEndpointConfig.Configurator {
@Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
HttpSession httpSession = (HttpSession) request.getHttpSession();
//将HttpSession对象存储到配置对象中
sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
// super.modifyHandshake(sec, request, response);
}
}
package com.subsidy.util.websocket;
import lombok.Data;
/**
* 浏览器给服务端发的websocket数据
*/
@Data
public class Message {
private String toName;
private String message;
}
package com.subsidy.util.websocket;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* 封装消息的工具类
*/
public class MessageUtils {
public static String getMessage(Boolean isSystemMessage,String fromName,Object message){
try {
ResultMessage resultMessage = new ResultMessage();
resultMessage.setIsSystem(isSystemMessage);
resultMessage.setMessage(message);
if (fromName != null){
resultMessage.setFromName(fromName);
}
ObjectMapper objectMapper = new ObjectMapper();
return objectMapper.writeValueAsString(resultMessage);
}catch (Exception e){
e.printStackTrace();
}
return null;
}
}
package com.subsidy.util.websocket;
import lombok.Data;
/**
* 登陆响应给浏览器的数据
*/
@Data
public class Result {
private Boolean flag;
private String message;
}
package com.subsidy.util.websocket;
import lombok.Data;
/**
* 服务端发送给浏览器的websocket数据
*/
@Data
public class ResultMessage {
private Boolean isSystem;
private String fromName;
private Object message; //系统消息的话就是数组
}
package com.subsidy.util.websocket;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebsocketConfig {
/**
* 注入 ServerEndpointExporter 对象,可以自动注册使用了@ServerEndpoint注解的bean
*/
@Bean
public ServerEndpointExporter serverEndpointExporter(){
return new ServerEndpointExporter();
}
}
...@@ -24,6 +24,8 @@ public class UserRoleVO { ...@@ -24,6 +24,8 @@ public class UserRoleVO {
private String companyName; private String companyName;
private Boolean qxyStatus;
private Long companyId; private Long companyId;
private String logo; private String logo;
......
...@@ -4,4 +4,16 @@ import lombok.Data; ...@@ -4,4 +4,16 @@ import lombok.Data;
@Data @Data
public class GetListVO { public class GetListVO {
private Integer id;
private String certName;
private Integer certId;
private String coverPage;
private String createDate;
private String status;
} }
...@@ -11,4 +11,6 @@ public class GetOneCertVO extends CertDictDO { ...@@ -11,4 +11,6 @@ public class GetOneCertVO extends CertDictDO {
private List<CertTypeDictDO> certTypeDictDOS; private List<CertTypeDictDO> certTypeDictDOS;
private Boolean status;
} }
...@@ -5,8 +5,15 @@ import lombok.Data; ...@@ -5,8 +5,15 @@ import lombok.Data;
@Data @Data
public class GetSignInfoVO { public class GetSignInfoVO {
private Long memberId; // private Long memberId;
private Long certId; // private Long certId;
private String userName;
private String orderNo;
private String certName;
private String status;
} }
...@@ -24,6 +24,8 @@ public class MemberVO { ...@@ -24,6 +24,8 @@ public class MemberVO {
private Long companyId; private Long companyId;
private Boolean qxyStatus;
private String logo; private String logo;
private List<RotationImgDictDO> rotationImgDictDOS; private List<RotationImgDictDO> rotationImgDictDOS;
......
...@@ -16,6 +16,8 @@ public class MyCoursesVO { ...@@ -16,6 +16,8 @@ public class MyCoursesVO {
private String courseName; private String courseName;
private String startDate;
private String endDate; private String endDate;
private Integer totalCnt; private Integer totalCnt;
......
package com.subsidy.vo.member;
import lombok.Data;
@Data
public class QxyVO {
private String token;
}
...@@ -50,3 +50,7 @@ spring.redis.port=6389 ...@@ -50,3 +50,7 @@ spring.redis.port=6389
spring.redis.lettuce.pool.max-idle=16 spring.redis.lettuce.pool.max-idle=16
spring.redis.lettuce.pool.max-active=32 spring.redis.lettuce.pool.max-active=32
spring.redis.lettuce.pool.min-idle=8 spring.redis.lettuce.pool.min-idle=8
qxueyou.appId=qxywz5nnWMI77CM3Tx
qxueyou.securityKey=626737T1-65K0-5xC2-0Y0V-2Aq95qxy
qxueyou.url=https://dev.qxueyou.com/auth/user/token
\ No newline at end of file
...@@ -44,3 +44,7 @@ spring.redis.port=20260 ...@@ -44,3 +44,7 @@ spring.redis.port=20260
spring.redis.lettuce.pool.max-idle=16 spring.redis.lettuce.pool.max-idle=16
spring.redis.lettuce.pool.max-active=32 spring.redis.lettuce.pool.max-active=32
spring.redis.lettuce.pool.min-idle=8 spring.redis.lettuce.pool.min-idle=8
qxueyou.appId=qxy1a2n6h16012nJ6x
qxueyou.securityKey=44420Tlu-P463-9041-2h1q-29Z59qxy
qxueyou.url=https://www.qxueyou.com/auth/user/token
\ No newline at end of file
...@@ -22,19 +22,20 @@ ...@@ -22,19 +22,20 @@
<select id="getCompanyCerts" resultType="com.subsidy.model.CertDictDO"> <select id="getCompanyCerts" resultType="com.subsidy.model.CertDictDO">
SELECT SELECT
t2.* distinct t.*
FROM FROM
cert_company_mapping t cert_dict t
LEFT JOIN cert_type_mapping t3 ON t.cert_id = t3.cert_id LEFT JOIN cert_type_mapping t3 ON t.id = t3.cert_id
LEFT JOIN cert_dict t2 ON t.cert_id = t2.id LEFT JOIN cert_company_mapping t2 ON t.id = t2.cert_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 t.company_id = #{companyId} AND t2.company_id = #{companyId}
<if test="typeId != null and typeId !=''"> <if test="typeId != null and typeId !=''">
AND t3.type_id = #{typeId} AND t3.type_id = #{typeId}
</if> </if>
order by t.id
</select> </select>
<select id="getCompanyCertStatus" resultType="com.subsidy.vo.cert.GetCompanyCertsVO"> <select id="getCompanyCertStatus" resultType="com.subsidy.vo.cert.GetCompanyCertsVO">
......
...@@ -80,7 +80,8 @@ ...@@ -80,7 +80,8 @@
t2.cert_name, t2.cert_name,
t2.id AS cert_id, t2.id AS cert_id,
t2.cover_page, t2.cover_page,
t.create_date t.create_date,
t.status
FROM FROM
cert_member_mapping t cert_member_mapping t
LEFT JOIN cert_dict t2 ON t.cert_id = t2.id LEFT JOIN cert_dict t2 ON t.cert_id = t2.id
...@@ -96,14 +97,32 @@ ...@@ -96,14 +97,32 @@
<select id="getSignInfo" resultType="com.subsidy.vo.cert.GetSignInfoVO"> <select id="getSignInfo" resultType="com.subsidy.vo.cert.GetSignInfoVO">
SELECT SELECT
t2.user_name, t2.user_name,
t.order_no t.order_no,
t.status,
t3.cert_name
FROM FROM
cert_member_mapping t cert_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id LEFT JOIN member t2 ON t.member_id = t2.id
left join cert_dict t3 on t.cert_id = t3.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 t.cert_id =#{certId} and t.cert_id =#{certId}
and t.member_id = #{memberId} and t.member_id = #{memberId}
</select> </select>
<select id="memberCertStatus" resultType="integer">
SELECT
count( 1 )
FROM
cert_member_mapping t
WHERE
t.delete_date IS NULL
AND t.member_id = #{memberId}
AND t.cert_id = #{certId}
AND (
t.`status` = "等待确认"
OR t.`status` = "等待支付"
OR t.`status` = "有效订单")
</select>
</mapper> </mapper>
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
t2.id AS classId, t2.id AS classId,
t2.class_name, t2.class_name,
t3.course_name, t3.course_name,
t2.start_date,
t2.end_date, t2.end_date,
t4.cnt AS totalCnt, t4.cnt AS totalCnt,
t5.result AS studyCnt, t5.result AS studyCnt,
......
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
id, user_id, opr_type id, user_id, opr_type
</sql> </sql>
<delete id="deleteById">
delete from opr_adm_dict
where id = #{id}
</delete>
<select id="getHistory" resultType="com.subsidy.vo.opr.GetHistoryVO"> <select id="getHistory" resultType="com.subsidy.vo.opr.GetHistoryVO">
SELECT SELECT
......
...@@ -20,10 +20,6 @@ ...@@ -20,10 +20,6 @@
id, user_id, opr_type id, user_id, opr_type
</sql> </sql>
<delete id="deleteById">
delete from opr_mem_dict
where id = #{id}
</delete>
<select id="getHistory" resultType="com.subsidy.vo.opr.GetHistoryVO"> <select id="getHistory" resultType="com.subsidy.vo.opr.GetHistoryVO">
SELECT SELECT
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!