Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
竹天卫
tianjin-cement
Commits
2bccf2fa
Commit
2bccf2fa
authored
Oct 30, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校核计算 测试完成 加上校验版本
parent
03f25c1d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
769 additions
and
494 deletions
+769
-494
TokenFilter.java
...n/java/cn/wise/sc/cement/business/filter/TokenFilter.java
+1
-1
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+21
-19
WeiXinService.java
...n/wise/sc/cement/business/service/impl/WeiXinService.java
+6
-6
CheckCountUtil.java
.../java/cn/wise/sc/cement/business/util/CheckCountUtil.java
+732
-459
Global.java
...n/java/cn/wise/sc/cement/business/util/weixin/Global.java
+6
-6
application.yml
cement-business/src/main/resources/application.yml
+2
-2
fastdfs-client.properties
cement-business/src/main/resources/fastdfs-client.properties
+1
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/filter/TokenFilter.java
View file @
2bccf2fa
...
@@ -25,7 +25,7 @@ import org.springframework.web.filter.OncePerRequestFilter;
...
@@ -25,7 +25,7 @@ import org.springframework.web.filter.OncePerRequestFilter;
@Component
@Component
public
class
TokenFilter
extends
OncePerRequestFilter
{
public
class
TokenFilter
extends
OncePerRequestFilter
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"
WeiXinService
"
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"
TokenFilter
"
);
public
static
final
String
TOKEN_KEY
=
"Authorization"
;
public
static
final
String
TOKEN_KEY
=
"Authorization"
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
2bccf2fa
...
@@ -265,10 +265,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -265,10 +265,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
if
(!
teamNameList
.
contains
(
teamId
)){
charge
=
charge
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
team
.
getCharge
()
:
(
charge
.
add
(
team
.
getCharge
()));
charge
=
charge
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
team
.
getCharge
()
:
(
charge
.
add
(
team
.
getCharge
()));
teamNameList
.
add
(
team
.
getName
());
teamNameList
.
add
(
team
.
getName
());
}
}
}
}
}
//选择Mg必须选择Ca;选择Al必须选择Fe
//选择Mg必须选择Ca;选择Al必须选择Fe
if
(
teamNameList
.
contains
(
"MgO"
)){
if
(
teamNameList
.
contains
(
"MgO"
)){
if
(!
teamNameList
.
contains
(
"CaO"
)){
if
(!
teamNameList
.
contains
(
"CaO"
)){
...
@@ -2722,7 +2724,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2722,7 +2724,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
else
if
(
j
==
10
)
{
}
else
if
(
j
==
10
)
{
obj
=
checkMethodStr
;
obj
=
checkMethodStr
;
}
else
{
}
else
{
obj
=
m
.
get
(
headers
[
j
])
.
toString
()
;
obj
=
m
.
get
(
headers
[
j
])
!=
null
?
m
.
get
(
headers
[
j
]).
toString
()
:
""
;
//如果序号带小数点 去除.0,保留整数
//如果序号带小数点 去除.0,保留整数
if
(
j
==
0
)
{
if
(
j
==
0
)
{
obj
=
obj
.
split
(
"\\."
)[
0
];
obj
=
obj
.
split
(
"\\."
)[
0
];
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/WeiXinService.java
View file @
2bccf2fa
...
@@ -47,7 +47,7 @@ public class WeiXinService {
...
@@ -47,7 +47,7 @@ public class WeiXinService {
System
.
out
.
println
(
"==================code==================="
);
System
.
out
.
println
(
"==================code==================="
);
System
.
out
.
println
(
code
);
System
.
out
.
println
(
code
);
try
{
try
{
String
accessToken
=
null
;
/*
String accessToken = null;
if (type.equals("PC")) {
if (type.equals("PC")) {
accessToken = getAccessToken();
accessToken = getAccessToken();
} else if (type.equals("APP")) {
} else if (type.equals("APP")) {
...
@@ -64,10 +64,10 @@ public class WeiXinService {
...
@@ -64,10 +64,10 @@ public class WeiXinService {
String UserId = jsonObject.getString("UserId");
String UserId = jsonObject.getString("UserId");
System.out.println("==================UserId===================");
System.out.println("==================UserId===================");
System.out.println(UserId);
System.out.println(UserId);
JSONObject
userJson
=
getUser
(
accessToken
,
UserId
);
JSONObject userJson = getUser(accessToken, UserId);
*/
QueryWrapper
<
SysUser
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SysUser
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"phone"
,
userJson
.
get
(
"mobile"
));
//
wrapper.eq("phone", userJson.get("mobile"));
//
wrapper.eq("phone", code); //暂时用手机号代替code
wrapper
.
eq
(
"phone"
,
code
);
//暂时用手机号代替code
SysUser
sysUser
=
userService
.
getOne
(
wrapper
);
SysUser
sysUser
=
userService
.
getOne
(
wrapper
);
if
(
sysUser
==
null
)
{
if
(
sysUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"非系统用户不允许登录!"
);
return
BaseResponse
.
errorMsg
(
"非系统用户不允许登录!"
);
...
@@ -83,8 +83,8 @@ public class WeiXinService {
...
@@ -83,8 +83,8 @@ public class WeiXinService {
sysUser
.
getName
(),
sysUser
.
getPhone
());
sysUser
.
getName
(),
sysUser
.
getPhone
());
System
.
out
.
println
(
token
);
System
.
out
.
println
(
token
);
redisUtil
.
setString
(
sysUser
.
getId
().
toString
(),
token
,
3600
);
redisUtil
.
setString
(
sysUser
.
getId
().
toString
(),
token
,
3600
);
sysUser
.
setWxId
(
UserId
);
//
sysUser.setWxId(UserId);
userService
.
updateById
(
sysUser
);
//
userService.updateById(sysUser);
return
BaseResponse
.
okData
(
token
);
return
BaseResponse
.
okData
(
token
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
BaseResponse
.
errorMsg
(
e
.
getMessage
());
return
BaseResponse
.
errorMsg
(
e
.
getMessage
());
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/CheckCountUtil.java
View file @
2bccf2fa
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/util/weixin/Global.java
View file @
2bccf2fa
...
@@ -10,22 +10,22 @@ package cn.wise.sc.cement.business.util.weixin;
...
@@ -10,22 +10,22 @@ package cn.wise.sc.cement.business.util.weixin;
public
interface
Global
{
public
interface
Global
{
//企业ID
public
final
static
String
corpId
=
"ww348f91b2573c1867"
;
//企业应用的id,整型。可在应用的设置页面查看
//企业应用的id,整型。可在应用的设置页面查看
public
final
static
int
agentId
=
1000002
;
public
final
static
int
agentId
=
1000002
;
public
final
static
int
agentIdPC
=
1000003
;
public
final
static
int
agentIdPC
=
1000003
;
//企业ID
public
final
static
String
corpId
=
"ww348f91b2573c1867"
;
//应用的凭证密钥
//应用的凭证密钥
public
final
static
String
agentSecret
=
"gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o"
;
public
final
static
String
agentSecret
=
"gFa_7XvXtCaoeAYERzjRwwz_OTJkJfgBb8weOKjmI3o"
;
public
final
static
String
agentSecretPC
=
"itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A"
;
//编译后的回调地址
//编译后的回调地址
public
final
static
String
backUrl
=
"https%3a%2f%2fprogram.oxogroup.com%2flab-system"
;
public
final
static
String
backUrl
=
"https%3a%2f%2fprogram.oxogroup.com%2flab-system"
;
//实验室管理系统链接
//实验室管理系统链接
public
final
static
String
systemUrl
=
"<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
corpId
+
"&redirect_uri="
+
backUrl
+
"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统"
+
"</a>,"
;
public
final
static
String
systemUrl
=
"<a href=\"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
corpId
+
"&redirect_uri="
+
backUrl
+
"%2f&response_type=code&scope=snsapi_base&state=#wechat_redirect\">天津院实验室管理系统"
+
"</a>,"
;
//应用的凭证密钥PC
public
final
static
String
agentSecretPC
=
"itCLYcwl9ggA9VfZam_iz96Ikp9StDFfVr4Adb0yY7A"
;
/**
/**
* 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET
* 微信公众平台,获取AccessToken的接口地址,Https请求方式:GET
...
...
cement-business/src/main/resources/application.yml
View file @
2bccf2fa
...
@@ -7,8 +7,8 @@ spring:
...
@@ -7,8 +7,8 @@ spring:
active
:
dev
active
:
dev
datasource
:
datasource
:
# 192.168.110.85 admin!@#123
# 192.168.110.85 admin!@#123
#
url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url
:
jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
username
:
root
password
:
admin!@#123
password
:
admin!@#123
driverClassName
:
com.mysql.cj.jdbc.Driver
driverClassName
:
com.mysql.cj.jdbc.Driver
...
...
cement-business/src/main/resources/fastdfs-client.properties
View file @
2bccf2fa
...
@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
...
@@ -4,7 +4,7 @@ fastdfs.charset=UTF-8
fastdfs.http.tracker_http_port
=
8888
fastdfs.http.tracker_http_port
=
8888
fastdfs.http.anti_steal_token
=
no
fastdfs.http.anti_steal_token
=
no
fastdfs.http.secret_key
=
FastDFS1234567890
fastdfs.http.secret_key
=
FastDFS1234567890
fastdfs.tracker_servers
=
192.168.110.85
:22122
fastdfs.tracker_servers
=
localhost
:22122
#fastdfs.tracker_servers=localhost:22122
#fastdfs.tracker_servers=localhost:22122
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment