Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 205d0ae8
authored
Jun 05, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
结束两个月居家办公
1 parent
2db33758
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
527 additions
and
56 deletions
pom.xml
src/main/java/com/subsidy/common/configure/QXueYouConfig.java
src/main/java/com/subsidy/controller/CertCompanyMappingController.java
src/main/java/com/subsidy/controller/CertDictController.java
src/main/java/com/subsidy/controller/CertTypeDictController.java
src/main/java/com/subsidy/controller/MemberController.java
src/main/java/com/subsidy/dto/cert/GetAllCertsDTO.java
src/main/java/com/subsidy/dto/cert/GetOneCertDTO.java
src/main/java/com/subsidy/dto/exercise/ImportHistory.java
src/main/java/com/subsidy/mapper/CertCompanyMappingMapper.java
src/main/java/com/subsidy/mapper/CertMemberMappingMapper.java
src/main/java/com/subsidy/mapper/OprAdmDictMapper.java
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
src/main/java/com/subsidy/model/CertDictDO.java
src/main/java/com/subsidy/model/CompanyDictDO.java
src/main/java/com/subsidy/service/CertDictService.java
src/main/java/com/subsidy/service/MemberService.java
src/main/java/com/subsidy/service/impl/CertDictServiceImpl.java
src/main/java/com/subsidy/service/impl/CertMemberMappingServiceImpl.java
src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/util/ResultMode.java
src/main/java/com/subsidy/util/SecretUtils.java
src/main/java/com/subsidy/util/websocket/ChatEndPoint.java
src/main/java/com/subsidy/util/websocket/GetHttpSessionConfigurator.java
src/main/java/com/subsidy/util/websocket/Message.java
src/main/java/com/subsidy/util/websocket/MessageUtils.java
src/main/java/com/subsidy/util/websocket/Result.java
src/main/java/com/subsidy/util/websocket/ResultMessage.java
src/main/java/com/subsidy/util/websocket/WebsocketConfig.java
src/main/java/com/subsidy/vo/administer/UserRoleVO.java
src/main/java/com/subsidy/vo/cert/GetListVO.java
src/main/java/com/subsidy/vo/cert/GetOneCertVO.java
src/main/java/com/subsidy/vo/cert/GetSignInfoVO.java
src/main/java/com/subsidy/vo/member/MemberVO.java
src/main/java/com/subsidy/vo/member/MyCoursesVO.java
src/main/java/com/subsidy/vo/member/QxyVO.java
src/main/resources/application-dev.properties
src/main/resources/application-prod.properties
src/main/resources/mapper/CertCompanyMappingMapper.xml
src/main/resources/mapper/CertMemberMappingMapper.xml
src/main/resources/mapper/MemberMapper.xml
src/main/resources/mapper/OprAdmDictMapper.xml
src/main/resources/mapper/OprMemDictMapper.xml
pom.xml
View file @
205d0ae
...
...
@@ -133,11 +133,11 @@
<version>
${swagger2.version}
</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.amdelamar</groupId>-->
<!-- <artifactId>jhash</artifactId>-->
<!-- <version>${jhash.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.amdelamar</groupId>-->
<!-- <artifactId>jhash</artifactId>-->
<!-- <version>${jhash.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>
org.apache.poi
</groupId>
...
...
@@ -208,10 +208,16 @@
<version>
${jedis.version}
</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
<!-- </dependency>-->
<!--webSocket-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
<!-- </dependency>-->
</dependencies>
...
...
src/main/java/com/subsidy/common/configure/QXueYouConfig.java
0 → 100644
View file @
205d0ae
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
;
}
src/main/java/com/subsidy/controller/CertCompanyMappingController.java
View file @
205d0ae
...
...
@@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
io.swagger.annotations.Api
;
import
sun.security.provider.certpath.ResponderId
;
/**
* <p>
...
...
@@ -32,7 +31,7 @@ public class CertCompanyMappingController {
@PostMapping
(
"getCompanyCertsWithStatus"
)
@ApiOperation
(
"获取某个公司的项目证书(返回学生报名状态) companyId 公司id typeId 类型id(查全部传空) memberId 学生id"
)
public
ResponseVO
getCompanyCertsWithStatus
(
@Request
Param
GetCompanyCertsWithStatusDTO
getCompanyCertsDTO
){
public
ResponseVO
getCompanyCertsWithStatus
(
@Request
Body
GetCompanyCertsWithStatusDTO
getCompanyCertsDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
certCompanyMappingService
.
getCompanyCertsWithStatus
(
getCompanyCertsDTO
));
}
...
...
src/main/java/com/subsidy/controller/CertDictController.java
View file @
205d0ae
...
...
@@ -5,6 +5,7 @@ import com.subsidy.common.ResponseData;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.dto.cert.AddCertDTO
;
import
com.subsidy.dto.cert.GetAllCertsDTO
;
import
com.subsidy.dto.cert.GetOneCertDTO
;
import
com.subsidy.model.CertDictDO
;
import
com.subsidy.service.CertDictService
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -33,7 +34,7 @@ public class CertDictController {
private
CertDictService
certDictService
;
@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
){
return
ResponseData
.
generateCreatedResponse
(
0
,
certDictService
.
addCert
(
addCertDTO
));
}
...
...
@@ -51,9 +52,9 @@ public class CertDictController {
}
@PostMapping
(
"getOneCert"
)
@ApiOperation
(
"获取一个证书 id"
)
public
ResponseVO
getOneCert
(
@RequestBody
CertDictDO
certDictD
O
){
return
ResponseData
.
generateCreatedResponse
(
0
,
certDictService
.
getOneCert
(
certDictD
O
));
@ApiOperation
(
"获取一个证书 id
userId
"
)
public
ResponseVO
getOneCert
(
@RequestBody
GetOneCertDTO
getOneCertDT
O
){
return
ResponseData
.
generateCreatedResponse
(
0
,
certDictService
.
getOneCert
(
getOneCertDT
O
));
}
@PostMapping
(
"getAllCerts"
)
...
...
src/main/java/com/subsidy/controller/CertTypeDictController.java
View file @
205d0ae
...
...
@@ -33,7 +33,7 @@ public class CertTypeDictController {
@PostMapping
(
"getCompanyCertTypes"
)
@ApiOperation
(
"(手机端)获取某个公司所有的证书类型 companyId"
)
public
ResponseVO
getCompanyCertTypes
(
@Request
Param
CertCompanyMappingDO
certCompanyMappingDO
){
public
ResponseVO
getCompanyCertTypes
(
@Request
Body
CertCompanyMappingDO
certCompanyMappingDO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
certTypeDictService
.
getCompanyCertTypes
(
certCompanyMappingDO
));
}
...
...
src/main/java/com/subsidy/controller/MemberController.java
View file @
205d0ae
...
...
@@ -167,4 +167,11 @@ public class MemberController {
public
ResponseVO
changeDepartments
(
@RequestBody
ChangeDepartmentsDTO
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
));
}
}
src/main/java/com/subsidy/dto/cert/GetAllCertsDTO.java
View file @
205d0ae
...
...
@@ -10,7 +10,7 @@ public class GetAllCertsDTO {
private
Integer
pageNum
;
private
Long
certT
ypeId
;
private
Long
t
ypeId
;
private
String
certName
;
...
...
src/main/java/com/subsidy/dto/cert/GetOneCertDTO.java
0 → 100644
View file @
205d0ae
package
com
.
subsidy
.
dto
.
cert
;
import
lombok.Data
;
@Data
public
class
GetOneCertDTO
{
private
Integer
id
;
private
Long
userId
;
}
src/main/java/com/subsidy/dto/exercise/ImportHistory.java
View file @
205d0ae
package
com
.
subsidy
.
dto
.
exercise
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.subsidy.util.excel.ExcelColumnUtil
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
@Data
public
class
ImportHistory
{
...
...
@@ -57,6 +59,7 @@ public class ImportHistory {
private
String
result
;
@ExcelColumnUtil
(
value
=
"create_date"
,
col
=
10
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
String
create_date
;
}
src/main/java/com/subsidy/mapper/CertCompanyMappingMapper.java
View file @
205d0ae
...
...
@@ -21,7 +21,7 @@ import java.util.List;
public
interface
CertCompanyMappingMapper
extends
BaseMapper
<
CertCompanyMappingDO
>
{
//获取某个公司的某个类型下的证书 companyId typeId
List
<
CertDictDO
>
getCompanyCerts
(
Long
C
ompanyId
,
Long
typeId
);
List
<
CertDictDO
>
getCompanyCerts
(
Long
c
ompanyId
,
Long
typeId
);
//获取全部证书公司映射情况 分页 包含企业状态
IPage
<
GetCompanyCertsVO
>
getCompanyCertStatus
(
IPage
page
);
...
...
src/main/java/com/subsidy/mapper/CertMemberMappingMapper.java
View file @
205d0ae
...
...
@@ -34,5 +34,7 @@ public interface CertMemberMappingMapper extends BaseMapper<CertMemberMappingDO>
*/
GetSignInfoVO
getSignInfo
(
Long
memberId
,
Long
certId
);
int
memberCertStatus
(
Long
memberId
,
Long
certId
);
}
src/main/java/com/subsidy/mapper/OprAdmDictMapper.java
View file @
205d0ae
...
...
@@ -32,5 +32,4 @@ public interface OprAdmDictMapper extends BaseMapper<OprAdmDictDO> {
List
<
OprAdmDictDO
>
getRecordByDate
();
void
deleteById
(
Long
id
);
}
src/main/java/com/subsidy/mapper/OprMemDictMapper.java
View file @
205d0ae
...
...
@@ -23,5 +23,4 @@ public interface OprMemDictMapper extends BaseMapper<OprMemDictDO> {
List
<
OprMemDictDO
>
getRecordByDate
();
void
deleteById
(
Long
id
);
}
src/main/java/com/subsidy/model/CertDictDO.java
View file @
205d0ae
...
...
@@ -57,6 +57,11 @@ public class CertDictDO extends BaseModel {
private
String
coverPage
;
/**
* 详情封面
*/
private
String
detailPage
;
/**
* 详情
*/
private
String
detail
;
...
...
src/main/java/com/subsidy/model/CompanyDictDO.java
View file @
205d0ae
...
...
@@ -50,5 +50,10 @@ public class CompanyDictDO extends BaseModel {
*/
private
String
address
;
/**
* 是否需要跳转到Q学友
*/
private
Boolean
qxyStatus
;
}
src/main/java/com/subsidy/service/CertDictService.java
View file @
205d0ae
...
...
@@ -3,6 +3,7 @@ package com.subsidy.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.dto.cert.AddCertDTO
;
import
com.subsidy.dto.cert.GetAllCertsDTO
;
import
com.subsidy.dto.cert.GetOneCertDTO
;
import
com.subsidy.model.CertDictDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.subsidy.vo.cert.GetAllCertsVO
;
...
...
@@ -27,7 +28,7 @@ public interface CertDictService extends IService<CertDictDO> {
String
updateCert
(
AddCertDTO
addCertDTO
);
GetOneCertVO
getOneCert
(
CertDictDO
certDictD
O
);
GetOneCertVO
getOneCert
(
GetOneCertDTO
getOneCertDT
O
);
IPage
<
GetAllCertsVO
>
getAllCerts
(
GetAllCertsDTO
getAllCertsDTO
);
...
...
src/main/java/com/subsidy/service/MemberService.java
View file @
205d0ae
...
...
@@ -63,4 +63,5 @@ public interface MemberService extends IService<MemberDO> {
String
changeDepartments
(
ChangeDepartmentsDTO
changeDepartmentsDTO
);
QxyVO
qxy
(
MemberDO
memberDO
);
}
src/main/java/com/subsidy/service/impl/CertDictServiceImpl.java
View file @
205d0ae
...
...
@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.subsidy.dto.cert.AddCertDTO
;
import
com.subsidy.dto.cert.GetAllCertsDTO
;
import
com.subsidy.mapper.CertRequirementMapper
;
import
com.subsidy.mapper.CertTypeDictMapper
;
import
com.subsidy.mapper.CertTypeMappingMapper
;
import
com.subsidy.dto.cert.GetOneCertDTO
;
import
com.subsidy.mapper.*
;
import
com.subsidy.model.*
;
import
com.subsidy.mapper.CertDictMapper
;
import
com.subsidy.service.CertDictService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.service.CertTypeDictService
;
...
...
@@ -17,6 +15,7 @@ import com.subsidy.util.ConstantUtils;
import
com.subsidy.vo.cert.GetAllCertsVO
;
import
com.subsidy.vo.cert.GetAllCertsWithoutTypeVO
;
import
com.subsidy.vo.cert.GetOneCertVO
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -46,6 +45,9 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO>
@Autowired
private
CertRequirementMapper
certRequirementMapper
;
@Autowired
private
CertMemberMappingMapper
certMemberMappingMapper
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
addCert
(
AddCertDTO
addCertDTO
)
{
...
...
@@ -106,23 +108,31 @@ public class CertDictServiceImpl extends ServiceImpl<CertDictMapper, CertDictDO>
return
ConstantUtils
.
SET_SUCCESS
;
}
public
GetOneCertVO
getOneCert
(
CertDictDO
certDictD
O
)
{
public
GetOneCertVO
getOneCert
(
GetOneCertDTO
getOneCertDT
O
)
{
GetOneCertVO
getOneCertVO
=
new
GetOneCertVO
();
CertDictDO
certDictDO1
=
this
.
baseMapper
.
selectById
(
certDictD
O
.
getId
());
CertDictDO
certDictDO1
=
this
.
baseMapper
.
selectById
(
getOneCertDT
O
.
getId
());
BeanUtils
.
copyProperties
(
certDictDO1
,
getOneCertVO
);
//查看证书有哪些类型
List
<
CertTypeDictDO
>
certTypeDictDOS
=
certTypeDictMapper
.
getCertTypes
(
certDictDO
.
getId
());
List
<
CertTypeDictDO
>
certTypeDictDOS
=
certTypeDictMapper
.
getCertTypes
(
certDictDO
1
.
getId
());
getOneCertVO
.
setCertTypeDictDOS
(
certTypeDictDOS
);
Integer
count
=
certMemberMappingMapper
.
memberCertStatus
(
getOneCertDTO
.
getUserId
(),
certDictDO1
.
getId
());
if
(
count
>
0
){
getOneCertVO
.
setStatus
(
true
);
}
else
{
getOneCertVO
.
setStatus
(
false
);
}
return
getOneCertVO
;
}
public
IPage
<
GetAllCertsVO
>
getAllCerts
(
GetAllCertsDTO
getAllCertsDTO
)
{
Page
pager
=
new
Page
(
getAllCertsDTO
.
getPageNum
(),
getAllCertsDTO
.
getPageSize
());
IPage
<
GetAllCertsVO
>
getAllCertsVOIPage
=
this
.
baseMapper
.
getAllCerts
(
pager
,
getAllCertsDTO
.
get
Cert
TypeId
(),
getAllCertsDTO
.
getCertName
());
IPage
<
GetAllCertsVO
>
getAllCertsVOIPage
=
this
.
baseMapper
.
getAllCerts
(
pager
,
getAllCertsDTO
.
getTypeId
(),
getAllCertsDTO
.
getCertName
());
List
<
GetAllCertsVO
>
getAllCertsVOS
=
getAllCertsVOIPage
.
getRecords
();
for
(
GetAllCertsVO
gav
:
getAllCertsVOS
){
...
...
src/main/java/com/subsidy/service/impl/CertMemberMappingServiceImpl.java
View file @
205d0ae
...
...
@@ -23,6 +23,7 @@ import com.subsidy.vo.cert.GetSignInfoVO;
import
com.subsidy.vo.cert.SignManagementVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -47,6 +48,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
@Autowired
private
CertRequirementMapper
certRequirementMapper
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
signUp
(
SignUpDTO
signUpDTO
)
{
List
<
CertMemberFileMappingDO
>
certMemberFileMappingDOS
=
signUpDTO
.
getFiles
();
...
...
@@ -54,13 +56,14 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
for
(
CertMemberFileMappingDO
certMemberFileMappingDO
:
certMemberFileMappingDOS
)
{
certMemberFileMappingDO
.
setCertId
(
signUpDTO
.
getCertId
());
certMemberFileMappingDO
.
setMemberId
(
signUpDTO
.
getMemberId
());
certMemberFileMappingDO
.
setRequirementId
(
certMemberFileMappingDO
.
getRequirementId
());
certMemberFileMappingMapper
.
insert
(
certMemberFileMappingDO
);
}
CertMemberMappingDO
certMemberMappingDO
=
new
CertMemberMappingDO
();
certMemberMappingDO
.
setCertId
(
signUpDTO
.
getCertId
());
certMemberMappingDO
.
setMemberId
(
signUpDTO
.
getMemberId
());
certMemberMappingDO
.
setOrderNo
(
System
.
currentTimeMillis
());
certMemberMappingDO
.
setStatus
(
"
报名成功
"
);
certMemberMappingDO
.
setStatus
(
"
等待确认
"
);
this
.
baseMapper
.
insert
(
certMemberMappingDO
);
//生成订单逻辑 TODO
...
...
@@ -93,7 +96,7 @@ public class CertMemberMappingServiceImpl extends ServiceImpl<CertMemberMappingM
public
String
changeStatus
(
CertMemberMappingDO
certMemberMappingDO
)
{
CertMemberMappingDO
certMemberMappingDO1
=
this
.
baseMapper
.
selectById
(
certMemberMappingDO
.
getId
());
certMemberMappingDO1
.
setStatus
(
certMemberMappingDO
.
getStatus
());
this
.
baseMapper
.
updateById
(
certMemberMappingDO
);
this
.
baseMapper
.
updateById
(
certMemberMappingDO
1
);
return
ConstantUtils
.
SET_SUCCESS
;
}
...
...
src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java
View file @
205d0ae
...
...
@@ -9,14 +9,20 @@ import com.subsidy.service.ExerciseDoneResultService;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.util.excel.ExcelUtil
;
import
com.subsidy.vo.exercise.GetDoneDetailVO
;
import
org.apache.poi.ss.usermodel.DateUtil
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.swing.text.DateFormatter
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Random
;
/**
...
...
@@ -62,9 +68,9 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul
.
eq
(
ExerciseDoneHistoryDO:
:
getDoneId
,
exerciseDoneResultDO
.
getId
())
.
eq
(
ExerciseDoneHistoryDO:
:
getMemberId
,
exerciseDoneResultDO
.
getMemberId
())
.
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
){
ExerciseDoneHistoryDO
ex
=
new
ExerciseDoneHistoryDO
();
...
...
@@ -74,7 +80,9 @@ public class ExerciseDoneResultServiceImpl extends ServiceImpl<ExerciseDoneResul
ex
.
setDoneId
(
s
.
getId
());
ex
.
setClassId
(
s
.
getClassId
());
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
);
}
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
205d0ae
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/util/ResultMode.java
0 → 100644
View file @
205d0ae
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
;
}
}
src/main/java/com/subsidy/util/SecretUtils.java
View file @
205d0ae
package
com
.
subsidy
.
util
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.math.BigInteger
;
import
java.nio.charset.StandardCharsets
;
import
java.security.MessageDigest
;
import
java.util.Arrays
;
import
java.util.Random
;
import
java.util.UUID
;
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
)
{
...
...
src/main/java/com/subsidy/util/websocket/ChatEndPoint.java
0 → 100644
View file @
205d0ae
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
);
}
}
src/main/java/com/subsidy/util/websocket/GetHttpSessionConfigurator.java
0 → 100644
View file @
205d0ae
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);
}
}
src/main/java/com/subsidy/util/websocket/Message.java
0 → 100644
View file @
205d0ae
package
com
.
subsidy
.
util
.
websocket
;
import
lombok.Data
;
/**
* 浏览器给服务端发的websocket数据
*/
@Data
public
class
Message
{
private
String
toName
;
private
String
message
;
}
src/main/java/com/subsidy/util/websocket/MessageUtils.java
0 → 100644
View file @
205d0ae
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
;
}
}
src/main/java/com/subsidy/util/websocket/Result.java
0 → 100644
View file @
205d0ae
package
com
.
subsidy
.
util
.
websocket
;
import
lombok.Data
;
/**
* 登陆响应给浏览器的数据
*/
@Data
public
class
Result
{
private
Boolean
flag
;
private
String
message
;
}
src/main/java/com/subsidy/util/websocket/ResultMessage.java
0 → 100644
View file @
205d0ae
package
com
.
subsidy
.
util
.
websocket
;
import
lombok.Data
;
/**
* 服务端发送给浏览器的websocket数据
*/
@Data
public
class
ResultMessage
{
private
Boolean
isSystem
;
private
String
fromName
;
private
Object
message
;
//系统消息的话就是数组
}
src/main/java/com/subsidy/util/websocket/WebsocketConfig.java
0 → 100644
View file @
205d0ae
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
();
}
}
src/main/java/com/subsidy/vo/administer/UserRoleVO.java
View file @
205d0ae
...
...
@@ -24,6 +24,8 @@ public class UserRoleVO {
private
String
companyName
;
private
Boolean
qxyStatus
;
private
Long
companyId
;
private
String
logo
;
...
...
src/main/java/com/subsidy/vo/cert/GetListVO.java
View file @
205d0ae
...
...
@@ -4,4 +4,16 @@ import lombok.Data;
@Data
public
class
GetListVO
{
private
Integer
id
;
private
String
certName
;
private
Integer
certId
;
private
String
coverPage
;
private
String
createDate
;
private
String
status
;
}
src/main/java/com/subsidy/vo/cert/GetOneCertVO.java
View file @
205d0ae
...
...
@@ -11,4 +11,6 @@ public class GetOneCertVO extends CertDictDO {
private
List
<
CertTypeDictDO
>
certTypeDictDOS
;
private
Boolean
status
;
}
src/main/java/com/subsidy/vo/cert/GetSignInfoVO.java
View file @
205d0ae
...
...
@@ -5,8 +5,15 @@ import lombok.Data;
@Data
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
;
}
src/main/java/com/subsidy/vo/member/MemberVO.java
View file @
205d0ae
...
...
@@ -24,6 +24,8 @@ public class MemberVO {
private
Long
companyId
;
private
Boolean
qxyStatus
;
private
String
logo
;
private
List
<
RotationImgDictDO
>
rotationImgDictDOS
;
...
...
src/main/java/com/subsidy/vo/member/MyCoursesVO.java
View file @
205d0ae
...
...
@@ -16,6 +16,8 @@ public class MyCoursesVO {
private
String
courseName
;
private
String
startDate
;
private
String
endDate
;
private
Integer
totalCnt
;
...
...
src/main/java/com/subsidy/vo/member/QxyVO.java
0 → 100644
View file @
205d0ae
package
com
.
subsidy
.
vo
.
member
;
import
lombok.Data
;
@Data
public
class
QxyVO
{
private
String
token
;
}
src/main/resources/application-dev.properties
View file @
205d0ae
...
...
@@ -49,4 +49,8 @@ spring.redis.password=Ykhl@208
spring.redis.port
=
6389
spring.redis.lettuce.pool.max-
idle
=
16
spring.redis.lettuce.pool.max-
active
=
32
spring.redis.lettuce.pool.min-
idle
=
8
\ No newline at end of file
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
src/main/resources/application-prod.properties
View file @
205d0ae
...
...
@@ -43,4 +43,8 @@ spring.redis.password=Ykhl@302
spring.redis.port
=
20260
spring.redis.lettuce.pool.max-
idle
=
16
spring.redis.lettuce.pool.max-
active
=
32
spring.redis.lettuce.pool.min-
idle
=
8
\ No newline at end of file
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
src/main/resources/mapper/CertCompanyMappingMapper.xml
View file @
205d0ae
...
...
@@ -22,19 +22,20 @@
<select
id=
"getCompanyCerts"
resultType=
"com.subsidy.model.CertDictDO"
>
SELECT
t2
.*
distinct t
.*
FROM
cert_company_mapping
t
LEFT JOIN cert_type_mapping t3 ON t.cert_
id = t3.cert_id
LEFT JOIN cert_dict t2 ON t.cert_id = t2.
id
cert_dict
t
LEFT JOIN cert_type_mapping t3 ON t.
id = t3.cert_id
LEFT JOIN cert_company_mapping t2 ON t.id = t2.cert_
id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.company_id = #{companyId}
AND t
2
.company_id = #{companyId}
<if
test=
"typeId != null and typeId !=''"
>
AND t3.type_id = #{typeId}
</if>
order by t.id
</select>
<select
id=
"getCompanyCertStatus"
resultType=
"com.subsidy.vo.cert.GetCompanyCertsVO"
>
...
...
src/main/resources/mapper/CertMemberMappingMapper.xml
View file @
205d0ae
...
...
@@ -80,7 +80,8 @@
t2.cert_name,
t2.id AS cert_id,
t2.cover_page,
t.create_date
t.create_date,
t.status
FROM
cert_member_mapping t
LEFT JOIN cert_dict t2 ON t.cert_id = t2.id
...
...
@@ -96,14 +97,32 @@
<select
id=
"getSignInfo"
resultType=
"com.subsidy.vo.cert.GetSignInfoVO"
>
SELECT
t2.user_name,
t.order_no
t.order_no,
t.status,
t3.cert_name
FROM
cert_member_mapping t
LEFT JOIN member t2 ON t.member_id = t2.id
left join cert_dict t3 on t.cert_id = t3.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
and t.cert_id =#{certId}
and t.member_id = #{memberId}
</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>
src/main/resources/mapper/MemberMapper.xml
View file @
205d0ae
...
...
@@ -66,6 +66,7 @@
t2.id AS classId,
t2.class_name,
t3.course_name,
t2.start_date,
t2.end_date,
t4.cnt AS totalCnt,
t5.result AS studyCnt,
...
...
src/main/resources/mapper/OprAdmDictMapper.xml
View file @
205d0ae
...
...
@@ -20,10 +20,6 @@
id, user_id, opr_type
</sql>
<delete
id=
"deleteById"
>
delete from opr_adm_dict
where id = #{id}
</delete>
<select
id=
"getHistory"
resultType=
"com.subsidy.vo.opr.GetHistoryVO"
>
SELECT
...
...
src/main/resources/mapper/OprMemDictMapper.xml
View file @
205d0ae
...
...
@@ -20,10 +20,6 @@
id, user_id, opr_type
</sql>
<delete
id=
"deleteById"
>
delete from opr_mem_dict
where id = #{id}
</delete>
<select
id=
"getHistory"
resultType=
"com.subsidy.vo.opr.GetHistoryVO"
>
SELECT
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment