Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
663f5dde
Commit
663f5dde
authored
Mar 17, 2022
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature_20220222_huayi
parents
bc3c3fde
2518b4cf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
17 deletions
+36
-17
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
+2
-1
src/main/java/cn/timer/api/controller/LoginController.java
+4
-0
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+0
-0
src/main/java/cn/timer/api/utils/ExcelUtils.java
+0
-0
src/main/java/cn/timer/api/utils/HttpUtils.java
+30
-16
No files found.
src/main/java/cn/timer/api/bean/yggl/YgglMainEmp.java
View file @
663f5dde
...
...
@@ -224,6 +224,7 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@ApiModelProperty
(
value
=
"员工登陆账号(手机号)"
,
example
=
"员工登陆账号(手机号)"
)
private
String
empLoginPhone
;
@ApiModelProperty
(
value
=
"是否已投保:0否 1是"
,
example
=
""
)
private
int
isInsure
;
}
src/main/java/cn/timer/api/controller/LoginController.java
View file @
663f5dde
...
...
@@ -784,6 +784,10 @@ public class LoginController {
}
qyzxEmpLogin1
.
setOrgId
(
ctrl
.
getId
());
if
(
ctrl
.
getStatus
().
equals
(
9
))
{
return
ResultUtil
.
error
(
"9"
,
"服务器变更"
);
}
if
(
SysRoleType
.
U_TYPE_ADMIN
.
getType
().
equals
(
ctrl
.
getUserType
())
||
SysRoleType
.
U_TYPE_C_ADMIN
.
getType
().
equals
(
ctrl
.
getUserType
()))
{
}
else
{
...
...
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
0 → 100644
View file @
663f5dde
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/ExcelUtils.java
0 → 100644
View file @
663f5dde
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/HttpUtils.java
View file @
663f5dde
package
cn
.
timer
.
api
.
utils
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.PrintWriter
;
import
java.io.*
;
import
java.net.ConnectException
;
import
java.net.SocketTimeoutException
;
import
java.net.URL
;
import
java.net.URLConnection
;
import
java.nio.charset.StandardCharsets
;
import
java.security.cert.X509Certificate
;
import
java.util.Map
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
com.alibaba.fastjson.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -44,10 +44,10 @@ public class HttpUtils
String
urlNameString
=
url
+
"?"
+
param
;
log
.
info
(
"sendGet - {}"
,
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
URLConnection
connection
=
realUrl
.
openConnection
();
HttpsURLConnection
connection
=
(
HttpsURLConnection
)
realUrl
.
openConnection
();
connection
.
setRequestProperty
(
"accept"
,
"*/*"
);
connection
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
connection
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
connection
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
)"
);
connection
.
connect
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
connection
.
getInputStream
()));
String
line
;
...
...
@@ -97,11 +97,12 @@ public class HttpUtils
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public
static
String
sendPost
(
String
url
,
String
param
)
public
static
String
sendPost
(
String
url
,
Map
paramMap
,
Map
bodyMap
)
{
PrintWriter
out
=
null
;
DataOutputStream
out
=
null
;
BufferedReader
in
=
null
;
StringBuilder
result
=
new
StringBuilder
();
String
param
=
getParamString
(
paramMap
);
try
{
String
urlNameString
=
url
+
"?"
+
param
;
...
...
@@ -110,15 +111,16 @@ public class HttpUtils
URLConnection
conn
=
realUrl
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
conn
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
utf
-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
text/json;charset=UTF
-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
out
=
new
PrintWriter
(
conn
.
getOutputStream
());
out
.
print
(
param
);
out
=
new
DataOutputStream
(
conn
.
getOutputStream
());
String
json
=
JSONObject
.
toJSONString
(
bodyMap
);
out
.
write
(
json
.
getBytes
(
StandardCharsets
.
UTF_8
));
out
.
flush
();
in
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
()
,
"utf-8"
));
in
=
new
BufferedReader
(
new
InputStreamReader
(
conn
.
getInputStream
()));
String
line
;
while
((
line
=
in
.
readLine
())
!=
null
)
{
...
...
@@ -176,9 +178,9 @@ public class HttpUtils
HttpsURLConnection
conn
=
(
HttpsURLConnection
)
console
.
openConnection
();
conn
.
setRequestProperty
(
"accept"
,
"*/*"
);
conn
.
setRequestProperty
(
"connection"
,
"Keep-Alive"
);
conn
.
setRequestProperty
(
"
user-agent"
,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1
)"
);
conn
.
setRequestProperty
(
"
User-Agent"
,
"Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt
)"
);
conn
.
setRequestProperty
(
"Accept-Charset"
,
"utf-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
utf
-8"
);
conn
.
setRequestProperty
(
"contentType"
,
"
text/json;charset=UTF
-8"
);
conn
.
setDoOutput
(
true
);
conn
.
setDoInput
(
true
);
...
...
@@ -245,4 +247,16 @@ public class HttpUtils
return
true
;
}
}
/*参数转为字符串*/
private
static
String
getParamString
(
Map
<
String
,
String
>
paramMap
){
if
(
null
==
paramMap
||
paramMap
.
isEmpty
()){
return
""
;
}
StringBuilder
builder
=
new
StringBuilder
();
for
(
String
key
:
paramMap
.
keySet
()
){
builder
.
append
(
"&"
)
.
append
(
key
).
append
(
"="
).
append
(
paramMap
.
get
(
key
));
}
return
builder
.
deleteCharAt
(
0
).
toString
();
}
}
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