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 e4b76240
authored
Jun 27, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
凌晨时间限制
1 parent
a28c0dbc
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
60 additions
and
36 deletions
src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java
src/main/java/com/subsidy/controller/AdministerController.java
src/main/java/com/subsidy/controller/CompanyDictController.java
src/main/java/com/subsidy/dto/administer/OperatorsDTO.java
src/main/java/com/subsidy/mapper/CompanyDictMapper.java
src/main/java/com/subsidy/model/CompanyDictDO.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/java/com/subsidy/util/BaseModel.java
src/main/java/com/subsidy/util/SecretUtils.java
src/main/java/com/subsidy/vo/administer/OperatorsVO.java
src/main/java/com/subsidy/vo/administer/UserRoleVO.java
src/main/java/com/subsidy/vo/member/MemberVO.java
src/main/resources/application-dev.properties
src/main/resources/application-prod.properties
src/main/resources/application.properties
src/main/resources/mapper/CompanyDictMapper.xml
src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java
View file @
e4b7624
...
...
@@ -111,8 +111,9 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
value
=
Exception
.
class
)
public
ResponseVO
<
T
>
serverInternalError
(
Exception
e
,
HttpServletRequest
request
)
{
String
url
=
request
.
getRequestURI
();
log
.
error
(
"path:"
+
url
);
log
.
error
(
"---- error message: ---"
+
e
.
toString
());
// log.error("path:"+url);
// log.error("---- error message: ---"+e.toString());
e
.
printStackTrace
();
return
ResponseData
.
generateCreatedResponse
(
Code
.
SERVER_INTERNAL_ERROR
.
getCode
(),
Code
.
SERVER_INTERNAL_ERROR
.
getMessage
(),
url
);
}
}
\ No newline at end of file
src/main/java/com/subsidy/controller/AdministerController.java
View file @
e4b7624
...
...
@@ -63,7 +63,7 @@ public class AdministerController {
@PostMapping
(
"/administers"
)
@ApiOperation
(
"查询所有运营者 { userName pageNum pageSize }"
)
@LoginRequired
//
@LoginRequired
public
ResponseVO
operators
(
@RequestBody
OperatorsDTO
operatorsDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
administerService
.
operators
(
operatorsDTO
));
}
...
...
src/main/java/com/subsidy/controller/CompanyDictController.java
View file @
e4b7624
...
...
@@ -34,14 +34,14 @@ public class CompanyDictController {
private
CompanyDictService
companyDictService
;
@PostMapping
(
"/administers"
)
@ApiOperation
(
"查询所有企业 {id companyName fieldId 行业id pageNum pageSize }"
)
@ApiOperation
(
"查询所有企业 {id companyName fieldId 行业id
superviseName 监管第三方名称
pageNum pageSize }"
)
@LoginRequired
public
ResponseVO
operators
(
@RequestBody
OperatorsDTO
operatorsDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
companyDictService
.
operators
(
operatorsDTO
));
}
@PostMapping
(
"addCompany"
)
@ApiOperation
(
"添加企业 {accountName:账号 companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}"
)
@ApiOperation
(
"添加企业 {accountName:账号
superviseName 第三方监管名称
companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员}"
)
@LoginRequired
public
ResponseVO
addOperator
(
@RequestBody
AddCompanyDTO
addCompanyDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
companyDictService
.
addOperator
(
addCompanyDTO
));
...
...
@@ -55,7 +55,7 @@ public class CompanyDictController {
}
@PostMapping
(
"updateCompany"
)
@ApiOperation
(
"修改企业 id accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员"
)
@ApiOperation
(
"修改企业 id
superviseName 第三方监管名称
accountName:账号 logo companyName:企业名称 address 企业所在地 shortName 简称 banner:标语 field[]:领域 role 1:超级管理员 2:普通成员"
)
@LoginRequired
public
ResponseVO
updateAdminister
(
@RequestBody
AddCompanyDTO
addCompanyDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
companyDictService
.
updateAdminister
(
addCompanyDTO
));
...
...
src/main/java/com/subsidy/dto/administer/OperatorsDTO.java
View file @
e4b7624
...
...
@@ -19,4 +19,6 @@ public class OperatorsDTO {
private
Long
id
;
private
String
superviseName
;
}
src/main/java/com/subsidy/mapper/CompanyDictMapper.java
View file @
e4b7624
...
...
@@ -24,7 +24,7 @@ public interface CompanyDictMapper extends BaseMapper<CompanyDictDO> {
* 企业管理--查找所有主账号 、运营者
* @return
*/
IPage
<
OperatorsVO
>
operators
(
IPage
page
,
String
companyName
,
Long
fieldId
,
Long
id
,
Integer
role
);
IPage
<
OperatorsVO
>
operators
(
IPage
page
,
String
companyName
,
Long
fieldId
,
Long
id
,
Integer
role
,
String
superviseName
);
/**
* 查找所有的公司名称
...
...
src/main/java/com/subsidy/model/CompanyDictDO.java
View file @
e4b7624
...
...
@@ -55,5 +55,9 @@ public class CompanyDictDO extends BaseModel {
*/
private
Boolean
qxyStatus
;
/**
* 第三方监管名称
*/
private
String
superviseName
;
}
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
e4b7624
...
...
@@ -333,7 +333,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
public
IPage
<
OperatorsVO
>
operators
(
OperatorsDTO
operatorsDTO
)
{
Page
pager
=
new
Page
(
operatorsDTO
.
getPageNum
(),
operatorsDTO
.
getPageSize
());
IPage
<
OperatorsVO
>
operatorsVOIPage
=
companyDictMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
null
,
1
);
IPage
<
OperatorsVO
>
operatorsVOIPage
=
companyDictMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
null
,
1
,
null
);
List
<
OperatorsVO
>
operatorsVOS
=
operatorsVOIPage
.
getRecords
();
for
(
OperatorsVO
operatorsVO
:
operatorsVOS
)
{
...
...
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
e4b7624
...
...
@@ -102,7 +102,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
if
(
count
>
0
){
administerDO
.
setCompanyId
(
null
);
}
IPage
page
=
this
.
baseMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
administerDO
.
getCompanyId
(),
2
);
IPage
page
=
this
.
baseMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
administerDO
.
getCompanyId
(),
2
,
operatorsDTO
.
getSuperviseName
()
);
List
<
OperatorsVO
>
operatorsVOS
=
page
.
getRecords
();
for
(
OperatorsVO
operatorsVO
:
operatorsVOS
)
{
//查看公司所在行业
...
...
@@ -232,7 +232,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
BeanUtils
.
copyProperties
(
addCompanyDTO
,
companyDictDO
);
this
.
baseMapper
.
updateById
(
companyDictDO
);
if
(
addCompanyDTO
.
getField
().
size
()
>
0
)
{
if
(
null
!=
addCompanyDTO
.
getField
()
&&
addCompanyDTO
.
getField
().
size
()
>
0
)
{
companyFieldMappingMapper
.
delete
(
new
QueryWrapper
<
CompanyFieldMappingDO
>()
.
lambda
()
.
eq
(
CompanyFieldMappingDO:
:
getCompanyId
,
addCompanyDTO
.
getId
()));
...
...
@@ -248,14 +248,15 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
//查找企业管理员
AdministerDO
administerDO
=
roleAdministerMappingMapper
.
getAdminister
(
addCompanyDTO
.
getId
());
if
(
StringUtils
.
isNotBlank
(
addCompanyDTO
.
getAccountName
()))
{
administerDO
.
setAccountName
(
addCompanyDTO
.
getAccountName
());
}
if
(
StringUtils
.
isBlank
(
addCompanyDTO
.
getPassword
()))
{
addCompanyDTO
.
setPassword
(
addCompanyDTO
.
getPassword
());
if
(
null
!=
administerDO
){
if
(
StringUtils
.
isNotBlank
(
addCompanyDTO
.
getAccountName
()))
{
administerDO
.
setAccountName
(
addCompanyDTO
.
getAccountName
());
}
if
(
StringUtils
.
isBlank
(
addCompanyDTO
.
getPassword
()))
{
addCompanyDTO
.
setPassword
(
addCompanyDTO
.
getPassword
());
}
administerMapper
.
updateById
(
administerDO
);
}
administerMapper
.
updateById
(
administerDO
);
return
ConstantUtils
.
SET_SUCCESS
;
}
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
e4b7624
...
...
@@ -377,6 +377,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
oprMemDictMapper
.
insert
(
oprMemDictDO
);
//mongoTemplate.insert(oprMemDictDO);
userRoleVO
.
setCompanyId
(
companyDictDO
.
getId
());
userRoleVO
.
setSuperviseName
(
companyDictDO
.
getSuperviseName
());
userRoleVO
.
setCompanyName
(
companyDictDO
.
getCompanyName
());
userRoleVO
.
setLogo
(
companyDictDO
.
getLogo
());
userRoleVO
.
setQxyStatus
(
companyDictDO
.
getQxyStatus
());
...
...
@@ -429,6 +430,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
//mongoTemplate.insert(oprMemDictDO);
oprMemDictMapper
.
insert
(
oprMemDictDO
);
memberVO
.
setCompanyId
(
companyDictDO
.
getId
());
memberVO
.
setSuperviseName
(
companyDictDO
.
getSuperviseName
());
memberVO
.
setCompanyName
(
companyDictDO
.
getCompanyName
());
memberVO
.
setLogo
(
companyDictDO
.
getLogo
());
List
<
RotationImgDictDO
>
rotationImgDictDOS
=
rotationImgDictMapper
.
selectList
(
new
QueryWrapper
<
RotationImgDictDO
>()
...
...
@@ -577,6 +579,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
oprMemDictDO
.
setResult
(
1
);
oprMemDictMapper
.
insert
(
oprMemDictDO
);
userRoleVO
.
setCompanyId
(
companyDictDO
.
getId
());
userRoleVO
.
setSuperviseName
(
companyDictDO
.
getSuperviseName
());
userRoleVO
.
setCompanyName
(
companyDictDO
.
getCompanyName
());
userRoleVO
.
setLogo
(
companyDictDO
.
getLogo
());
userRoleVO
.
setQxyStatus
(
companyDictDO
.
getQxyStatus
());
...
...
@@ -663,6 +666,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
oprMemDictDO
.
setResult
(
1
);
oprMemDictMapper
.
insert
(
oprMemDictDO
);
userRoleVO
.
setCompanyId
(
companyDictDO
.
getId
());
userRoleVO
.
setSuperviseName
(
companyDictDO
.
getSuperviseName
());
userRoleVO
.
setCompanyName
(
companyDictDO
.
getCompanyName
());
userRoleVO
.
setLogo
(
companyDictDO
.
getLogo
());
userRoleVO
.
setQxyStatus
(
companyDictDO
.
getQxyStatus
());
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
e4b7624
...
...
@@ -624,7 +624,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
public
List
<
Long
>
testPlays
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
String
classIds
=
"
122,150,151,152,153,165,168,195,199,200,202,203,204,205,206,207,209,210,211,212,213,215,227,228,229,233,234,235,240,241,243,244,248,249,250
"
;
String
classIds
=
"
254
"
;
// String classIds = "122,150";
List
<
String
>
classIdArr
=
Arrays
.
asList
(
classIds
.
split
(
","
));
...
...
@@ -641,20 +641,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
VodPlayStateVO
vodPlayStateVO
=
vodPlayStateVOS
.
get
(
k
);
VodPlayStateVO
vodPlayStateVO1
=
vodPlayStateVOS
.
get
(
i
);
if
(
vodPlayStateVO
.
getStartDate
().
after
(
vodPlayStateVO1
.
getStartDate
())
&&
vodPlayStateVO
.
getStartDate
().
before
(
vodPlayStateVO1
.
getEndDate
()))
{
// System.out.println(
vodPlayStateVO);
System
.
out
.
println
(
"111111111"
+
vodPlayStateVO
);
//这一条数据有问题
//查看这个人 这个课程 当天的全部数据 按照createDate升序排序
List
<
VodPlayHistoryDO
>
vodPlayHistoryDOS
=
this
.
baseMapper
.
getVodPlayDay
(
Long
.
valueOf
(
classId
),
vodPlayStateVO
.
getMemberId
(),
vodPlayStateVO
.
getEndDate
());
//
List<VodPlayHistoryDO> vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), vodPlayStateVO.getMemberId(), vodPlayStateVO.getEndDate());
//从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推
for
(
int
l
=
0
;
l
<
vodPlayHistoryDOS
.
size
()
-
1
;
l
++)
{
VodPlayHistoryDO
vph1
=
vodPlayHistoryDOS
.
get
(
l
);
VodPlayHistoryDO
vph2
=
vodPlayHistoryDOS
.
get
(
l
+
1
);
// playLength += vph2.getPlayLength();
LocalDateTime
dateTmp
=
vph1
.
getCreateDate
().
minusSeconds
(-
vph2
.
getPlayLength
()
-
getRandom1_2
());
vph2
.
setCreateDate
(
dateTmp
);
this
.
baseMapper
.
updateById
(
vph2
);
// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) {
// VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l);
// VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1);
// LocalDateTime dateTmp = vph1.getCreateDate().minusSeconds(-vph2.getPlayLength() - getRandom1_2());
// vph2.setCreateDate(dateTmp);
// this.baseMapper.updateById(vph2);
// result.add(vodPlayStateVO.getId());
}
//
}
}
}
}
...
...
src/main/java/com/subsidy/util/BaseModel.java
View file @
e4b7624
...
...
@@ -16,7 +16,7 @@ public abstract class BaseModel {
* 创建时间
*/
@JsonIgnore
//
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT)
@TableField
(
insertStrategy
=
FieldStrategy
.
NEVER
,
updateStrategy
=
FieldStrategy
.
NEVER
,
value
=
"create_date"
,
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createDate
;
/**
...
...
src/main/java/com/subsidy/util/SecretUtils.java
View file @
e4b7624
...
...
@@ -154,6 +154,6 @@ public class SecretUtils {
String
uuid
=
UUID
.
randomUUID
().
toString
();
System
.
out
.
println
(
uuid
.
replace
(
"-"
,
""
));
// System.out.println(hash(uuid+"ixihs"));
System
.
out
.
println
(
System
.
currentTimeMillis
());
//
System.out.println(System.currentTimeMillis());
}
}
\ No newline at end of file
src/main/java/com/subsidy/vo/administer/OperatorsVO.java
View file @
e4b7624
...
...
@@ -31,4 +31,6 @@ public class OperatorsVO {
private
Long
companyId
;
private
String
logo
;
private
String
superviseName
;
}
src/main/java/com/subsidy/vo/administer/UserRoleVO.java
View file @
e4b7624
...
...
@@ -14,14 +14,14 @@ public class UserRoleVO {
private
String
userName
;
private
String
accountName
;
private
String
image
;
private
String
status
;
private
Integer
firstLogin
;
private
String
password
;
private
String
companyName
;
private
Boolean
qxyStatus
;
...
...
@@ -34,4 +34,6 @@ public class UserRoleVO {
private
String
token
;
private
String
superviseName
;
}
src/main/java/com/subsidy/vo/member/MemberVO.java
View file @
e4b7624
...
...
@@ -16,6 +16,8 @@ public class MemberVO {
private
String
userName
;
private
String
accountName
;
private
String
image
;
private
Integer
firstLogin
;
...
...
@@ -31,4 +33,6 @@ public class MemberVO {
private
List
<
RotationImgDictDO
>
rotationImgDictDOS
;
private
String
token
;
private
String
superviseName
;
}
src/main/resources/application-dev.properties
View file @
e4b7624
# 本地环境配置
spring.server.port
=
23457
# 数据源配置
spring.datasource.url
=
jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
...
...
src/main/resources/application-prod.properties
View file @
e4b7624
# 生产环境配置
spring.server.port
=
23459
# 数据源配置
spring.datasource.url
=
jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
...
...
src/main/resources/application.properties
View file @
e4b7624
# 环境配置
spring.profiles.active
=
prod
# 端口号
spring.server.port
=
23459
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.minSpareThreads
=
100
...
...
src/main/resources/mapper/CompanyDictMapper.xml
View file @
e4b7624
...
...
@@ -31,7 +31,8 @@
t.img,
t2.company_name,
t2.logo,
t2.address
t2.address,
t2.supervise_name
FROM
administer t
left join role_administer_mapping t4 on t.id = t4.administer_id
...
...
@@ -56,6 +57,9 @@
<if
test=
"fieldId != null and fieldId != ''"
>
and t3.field_id = #{fieldId}
</if>
<if
test=
"superviseName != null and superviseName != ''"
>
and t2.supervise_name =#{superviseName}
</if>
</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