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 b17282a8
authored
Mar 08, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
脚本调整结束,按照时长分配,(第一个脚本)
1 parent
381a1b2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
41 deletions
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/VodPlayHistoryServiceImpl.java
src/main/java/com/subsidy/util/EncryptUtil.java
src/main/resources/application.properties
src/main/resources/mapper/CompanyDictMapper.xml
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
b17282a
...
...
@@ -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
,
0
);
IPage
<
OperatorsVO
>
operatorsVOIPage
=
companyDictMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
null
,
1
);
List
<
OperatorsVO
>
operatorsVOS
=
operatorsVOIPage
.
getRecords
();
for
(
OperatorsVO
operatorsVO
:
operatorsVOS
)
{
...
...
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
b17282a
...
...
@@ -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
(),
null
);
IPage
page
=
this
.
baseMapper
.
operators
(
pager
,
operatorsDTO
.
getCompanyName
(),
operatorsDTO
.
getFieldId
(),
administerDO
.
getCompanyId
(),
2
);
List
<
OperatorsVO
>
operatorsVOS
=
page
.
getRecords
();
for
(
OperatorsVO
operatorsVO
:
operatorsVOS
)
{
//查看公司所在行业
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
b17282a
This diff is collapsed.
Click to expand it.
src/main/java/com/subsidy/util/EncryptUtil.java
View file @
b17282a
package
com
.
subsidy
.
util
;
import
com.amdelamar.jhash.Hash
;
import
com.amdelamar.jhash.algorithms.Type
;
import
com.amdelamar.jhash.exception.InvalidHashException
;
public
class
EncryptUtil
{
/**
* 设置密文密码
*
* @param password 原始密码
* @return 加密密码
*/
public
static
String
encrypt
(
String
password
)
{
char
[]
chars
=
password
.
toCharArray
();
return
Hash
.
password
(
chars
).
algorithm
(
Type
.
PBKDF2_SHA256
).
create
();
}
/**
* 验证加密密码
*
* @param encryptedPassword 密文密码
* @param plainPassword 明文密码
* @return 验证是否成功
*/
public
static
boolean
verify
(
String
encryptedPassword
,
String
plainPassword
)
{
char
[]
chars
=
plainPassword
.
toCharArray
();
try
{
return
Hash
.
password
(
chars
).
algorithm
(
Type
.
PBKDF2_SHA256
).
verify
(
encryptedPassword
);
}
catch
(
InvalidHashException
e
)
{
return
false
;
}
}
}
//
package com.subsidy.util;
//
//
import com.amdelamar.jhash.Hash;
//
import com.amdelamar.jhash.algorithms.Type;
//
import com.amdelamar.jhash.exception.InvalidHashException;
//
//
public class EncryptUtil {
//
//
/**
//
* 设置密文密码
//
*
//
* @param password 原始密码
//
* @return 加密密码
//
*/
//
public static String encrypt(String password) {
//
char[] chars = password.toCharArray();
//
return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create();
//
}
//
//
/**
//
* 验证加密密码
//
*
//
* @param encryptedPassword 密文密码
//
* @param plainPassword 明文密码
//
* @return 验证是否成功
//
*/
//
public static boolean verify(String encryptedPassword, String plainPassword) {
//
char[] chars = plainPassword.toCharArray();
//
try {
//
return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword);
//
} catch (InvalidHashException e) {
//
return false;
//
}
//
}
//
}
src/main/resources/application.properties
View file @
b17282a
# 环境配置
spring.profiles.active
=
prod
spring.profiles.active
=
dev
# 端口号
spring.server.port
=
2345
9
spring.server.port
=
2345
7
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount
=
600
...
...
src/main/resources/mapper/CompanyDictMapper.xml
View file @
b17282a
...
...
@@ -34,14 +34,18 @@
t2.address
FROM
administer t
left join role_administer_mapping t4 on t.id = t4.administer_id
left join company_dict t2 on t.company_id = t2.id
left join company_field_mapping t3 on t2.id = t3.company_id
WHERE
t.delete_date IS NULL
and t2.delete_date is null
and t3.delete_date is null
<if
test=
"role != null"
>
and t.role = #{role}
<if
test=
"role == 1"
>
(and t4.role = 1 or t4.role_id = 3)
</if>
<if
test=
"role == 2"
>
(and t4.role = 2)
</if>
<if
test=
"id != null and id != ''"
>
and t2.id = #{id}
...
...
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