Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
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
hubin
long-tern-care-service
Commits
68c687d0
Commit
68c687d0
authored
Feb 15, 2022
by
黄荣荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评定相关功能
parent
3e5bc2af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
492 additions
and
3 deletions
+492
-3
pom.xml
assessment/assessment-service/pom.xml
+1
-0
TaskController.java
...main/java/com/hungraim/ltc/controller/TaskController.java
+0
-0
TaskMapper.java
...ervice/src/main/java/com/hungraim/ltc/dao/TaskMapper.java
+2
-0
PageDto.java
...t-service/src/main/java/com/hungraim/ltc/dto/PageDto.java
+10
-0
QueryDto.java
...-service/src/main/java/com/hungraim/ltc/dto/QueryDto.java
+25
-0
TaskService.java
...e/src/main/java/com/hungraim/ltc/service/TaskService.java
+28
-0
TppesApiException.java
...main/java/com/hungraim/ltc/service/TppesApiException.java
+18
-0
TaskServiceImpl.java
...n/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
+167
-3
ChDisableEvaluateMapper.xml
...ice/src/main/resources/mapper/ChDisableEvaluateMapper.xml
+22
-0
TaskGroupInfoByPageVO.java
...ungraim/ltc/pojo/vo/assessment/TaskGroupInfoByPageVO.java
+40
-0
SignatureUtil.java
...re/src/main/java/com/hungraim/ltc/util/SignatureUtil.java
+0
-0
SocketCallUtil.java
...e/src/main/java/com/hungraim/ltc/util/SocketCallUtil.java
+173
-0
pom.xml
pom.xml
+6
-0
No files found.
assessment/assessment-service/pom.xml
View file @
68c687d0
...
...
@@ -84,6 +84,7 @@
<version>
0.0.1
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
...
...
assessment/assessment-service/src/main/java/com/hungraim/ltc/controller/TaskController.java
View file @
68c687d0
This diff is collapsed.
Click to expand it.
assessment/assessment-service/src/main/java/com/hungraim/ltc/dao/TaskMapper.java
View file @
68c687d0
...
...
@@ -57,4 +57,6 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
List
<
AllotTaskHisVO
>
allotTaskHisList
(
@Param
(
"taskId"
)
Integer
taskId
);
Page
<
ReTaskDistributionVO
>
reTaskDistributionList
(
Page
<
ReTaskDistributionVO
>
page
,
@Param
(
"organIds"
)
List
<
Long
>
organIds
,
String
districtProvincial
,
String
districtCity
,
String
districtArea
,
String
realName
,
String
certiCode
);
Page
<
TaskGroupInfoByPageVO
>
taskGroupInfoListByPage
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNo
,
Integer
pageNo
,
Integer
pageSize
);
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/dto/PageDto.java
0 → 100644
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
dto
;
import
lombok.Data
;
@Data
public
class
PageDto
{
private
Integer
pageNo
=
1
;
private
Integer
pageSize
=
10
;
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/dto/QueryDto.java
0 → 100644
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
dto
;
import
lombok.Data
;
@Data
public
class
QueryDto
extends
PageDto
{
private
String
aprEmpId
;
private
String
appointStartTime
;
private
String
appointEndTime
;
private
String
queryBeginDate
;
private
String
queryEndDate
;
private
String
groupNum
;
private
String
status
;
private
String
taskGroupNo
;
private
String
empId
;
private
String
organId
;
private
String
taskId
;
private
String
refuseReason
;
private
String
refuseRemark
;
private
String
taskPushId
;
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/TaskService.java
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach
;
import
com.hungraim.ltc.pojo.entity.assessment.ChAprReport
;
import
com.hungraim.ltc.pojo.entity.assessment.ChAprTask
;
import
com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason
;
import
com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel
;
import
com.hungraim.ltc.pojo.vo.assessment.*
;
...
...
@@ -10,6 +13,7 @@ import org.springframework.stereotype.Service;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 失能评定Service
...
...
@@ -54,4 +58,28 @@ public interface TaskService {
List
<
ChRefuseReason
>
refuseReasonList
();
Result
<
List
<
ChFndAttach
>>
reportFileList
(
Long
reportId
);
Result
<
Object
>
taskRefuseCause
(
String
taskId
,
String
optType
,
String
aprOrganId
,
String
aprEmpId
,
String
optTime
,
String
refuseReason
,
String
refuseRemark
,
String
status
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
;
Result
<
Object
>
deleteVodFile
(
String
fileId
,
String
taskId
);
int
uploadVideo
(
String
taskId
,
String
videoUrl
,
String
videoName
,
String
padUserName
,
String
fileId
);
List
<
Map
<
String
,
Object
>>
findReportVideo
(
String
taskId
);
Result
<
Object
>
startApprTask
(
String
taskId
,
String
operationId
,
String
operationOrganId
,
String
taskGroupNo
)
throws
TppesApiException
;
List
<
TaskGroupInfoVO
>
queryAppraisalInfo
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNum
,
Integer
pageNo
,
Integer
pageSize
);
Page
<
TaskGroupInfoByPageVO
>
queryAppraisalInfoByPage
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNum
,
Integer
pageNo
,
Integer
pageSize
);
ChAprReport
taskReportDetails
(
String
taskId
)
throws
TppesApiException
;
ChAprTask
singleTaskDetails
(
String
taskId
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
;
ChAprTask
singleTaskDetailsWuXi
(
String
taskId
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
;
ChAprReport
queryAprReportForWUXI
(
String
taskId
)
throws
TppesApiException
;
IPage
<
ChAprTask
>
apprTaskDetailInfo
(
String
appointStartTime
,
String
appointEndTime
,
String
status
,
String
taskGroupNo
,
Integer
pageNo
,
Integer
pageSize
)
throws
TppesApiException
;
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/TppesApiException.java
0 → 100644
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
service
;
public
class
TppesApiException
extends
Exception
{
private
static
final
long
serialVersionUID
=
8755420483172678311L
;
public
TppesApiException
()
{
super
();
}
public
TppesApiException
(
String
message
)
{
super
(
message
);
}
public
TppesApiException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
}
assessment/assessment-service/src/main/java/com/hungraim/ltc/service/impl/TaskServiceImpl.java
View file @
68c687d0
...
...
@@ -3,6 +3,8 @@ package com.hungraim.ltc.service.impl;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.dao.*
;
...
...
@@ -13,6 +15,7 @@ import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import
com.hungraim.ltc.pojo.vo.assessment.*
;
import
com.hungraim.ltc.pojo.vo.system.AttachUpdateVo
;
import
com.hungraim.ltc.service.TaskService
;
import
com.hungraim.ltc.service.TppesApiException
;
import
com.hungraim.ltc.util.AttachType
;
import
com.hungraim.ltc.util.Result
;
import
com.hungraim.ltc.util.ResultCode
;
...
...
@@ -24,9 +27,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* @author czz
...
...
@@ -461,4 +462,166 @@ public class TaskServiceImpl implements TaskService {
}
return
listResult
;
}
/**
* 单条任务拒绝
* @return
*/
@Override
public
Result
<
Object
>
taskRefuseCause
(
String
taskId
,
String
optType
,
String
aprOrganId
,
String
aprEmpId
,
String
optTime
,
String
refuseReason
,
String
refuseRemark
,
String
status
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
{
if
(
taskId
!=
""
&&
taskId
!=
null
){
ChAprTask
task
=
taskMapper
.
selectById
(
taskId
);
if
(
task
!=
null
)
{
task
.
setTaskStatus
(
0
);
taskMapper
.
updateById
(
task
);
return
Result
.
success
();
}
}
return
Result
.
failed
();
}
/**
* 开始鉴定
* @return
*/
@Override
public
Result
<
Object
>
startApprTask
(
String
taskId
,
String
operationId
,
String
operationOrganId
,
String
taskGroupNo
)
throws
TppesApiException
{
if
(
taskId
!=
""
&&
taskId
!=
null
){
ChAprTask
task
=
taskMapper
.
selectById
(
taskId
);
if
(
task
!=
null
)
{
task
.
setAprType
(
0
);
taskMapper
.
updateById
(
task
);
return
Result
.
success
();
}
}
return
Result
.
failed
();
}
@Override
public
Result
<
Object
>
deleteVodFile
(
String
fileId
,
String
taskId
)
{
return
Result
.
success
();
}
@Override
public
int
uploadVideo
(
String
taskId
,
String
videoUrl
,
String
videoName
,
String
padUserName
,
String
fileId
)
{
return
1
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
findReportVideo
(
String
taskId
)
{
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
return
list
;
}
/**
* 查询鉴定任务组信息
*
* @return
* @author fanglg
*/
@Override
public
List
<
TaskGroupInfoVO
>
queryAppraisalInfo
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNum
,
Integer
pageNo
,
Integer
pageSize
)
{
List
<
TaskGroupInfoVO
>
taskGroupInfoVOIList
=
taskMapper
.
taskGroupInfoList
(
groupNum
);
return
taskGroupInfoVOIList
;
}
/**
* 查询鉴定任务组信息
*
* @return
* @author fanglg
*/
@Override
public
Page
<
TaskGroupInfoByPageVO
>
queryAppraisalInfoByPage
(
String
aprEmpId
,
String
appointStartTime
,
String
appointEndTime
,
String
queryBeginDate
,
String
queryEndDate
,
String
groupNum
,
Integer
pageNo
,
Integer
pageSize
)
{
Page
<
TaskGroupInfoByPageVO
>
taskGroupInfoVOIList
=
taskMapper
.
taskGroupInfoListByPage
(
aprEmpId
,
appointStartTime
,
appointEndTime
,
queryBeginDate
,
queryEndDate
,
groupNum
,
pageNo
,
pageSize
);
return
taskGroupInfoVOIList
;
}
/**
* 获取鉴定报告详情
* @return
*/
@Override
public
ChAprReport
taskReportDetails
(
String
taskId
)
throws
TppesApiException
{
LambdaQueryWrapper
<
ChAprReport
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
eq
(
ChAprReport:
:
getTaskId
,
taskId
);
ChAprReport
chAprReport
=
aprReportMapper
.
selectOne
(
wrapper
);
return
chAprReport
;
}
/**
* 单条任务详情
* @return
*/
@Override
public
ChAprTask
singleTaskDetails
(
String
taskId
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
{
LambdaQueryWrapper
<
ChAprTask
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
eq
(
ChAprTask:
:
getTaskId
,
taskId
);
ChAprTask
aprTask
=
taskMapper
.
selectOne
(
wrapper
);
return
aprTask
;
}
/**
* 无锡单条任务详情
* @return
*/
@Override
public
ChAprTask
singleTaskDetailsWuXi
(
String
taskId
,
String
taskGroupNo
,
String
taskPushId
)
throws
TppesApiException
{
LambdaQueryWrapper
<
ChAprTask
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
eq
(
ChAprTask:
:
getTaskId
,
taskId
);
ChAprTask
aprTask
=
taskMapper
.
selectOne
(
wrapper
);
return
aprTask
;
}
/**
* 获取无锡鉴定报告详情
* @return
*/
@Override
public
ChAprReport
queryAprReportForWUXI
(
String
taskId
)
throws
TppesApiException
{
LambdaQueryWrapper
<
ChAprReport
>
wrapper
=
Wrappers
.
lambdaQuery
();
wrapper
.
eq
(
ChAprReport:
:
getTaskId
,
taskId
);
ChAprReport
chAprReport
=
aprReportMapper
.
selectOne
(
wrapper
);
return
chAprReport
;
}
/**
* 鉴定人员鉴定任务详情获取
* @return
*/
@Override
public
IPage
<
ChAprTask
>
apprTaskDetailInfo
(
String
appointStartTime
,
String
appointEndTime
,
String
status
,
String
taskGroupNo
,
Integer
pageNo
,
Integer
pageSize
)
throws
TppesApiException
{
LambdaQueryWrapper
<
ChAprTask
>
wrapper
=
Wrappers
.
lambdaQuery
();
/*if(appointStartTime!=null && !"".equals(appointStartTime)){
wrapper.gt("appointStartTime",appointStartTime);
}
if(appointEndTime!=null && !"".equals(appointEndTime)){
wrapper.lt("appointEndTime",appointEndTime);
}
if(status!=null && !"".equals(status)){
wrapper.eq("status",status);
}
wrapper.eq("taskGroupNo",taskGroupNo);*/
Page
<
ChAprTask
>
page
=
new
Page
<>(
pageNo
,
pageSize
,
false
);
IPage
<
ChAprTask
>
chAprTaskPage
=
taskMapper
.
selectPage
(
page
,
wrapper
);
return
chAprTaskPage
;
}
}
\ No newline at end of file
assessment/assessment-service/src/main/resources/mapper/ChDisableEvaluateMapper.xml
View file @
68c687d0
...
...
@@ -383,4 +383,25 @@
</where>
</select>
<select
id=
"taskGroupInfoListByPage"
resultType=
"com.hungraim.ltc.pojo.vo.assessment.TaskGroupInfoByPageVO"
>
select
push.assign_time "date",
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_CITY = dis.DISTRICT_CODE) districPity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
push.Group_number groupNo,
emp.real_name aprEmpName,
emp.certi_code idCard,
push.task_push_id taskGroupNo
from ch_apr_task_push push
left join ch_apr_task task on push.task_id = task.task_id
left join CH_FND_ORGAN organ on organ.organ_id = task.organ_id
left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id
left join ch_apr_emp emp on emp.emp_id = push.emp_id
</select>
</mapper>
\ No newline at end of file
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/assessment/TaskGroupInfoByPageVO.java
0 → 100644
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
pojo
.
vo
.
assessment
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 评定任务分组管理列表详情
*/
@Data
public
class
TaskGroupInfoByPageVO
{
/**
* 分组日期
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
date
;
/**
* 评定起点地址
*/
private
String
address
;
/**
* 组号
*/
private
String
groupNo
;
/**
* 评定组长姓名
*/
private
String
aprEmpName
;
/**
* 评定组长身份证号码
*/
private
String
idCard
;
/**
* 组号
*/
private
String
taskGroupNo
;
}
common/common-core/src/main/java/com/hungraim/ltc/util/SignatureUtil.java
0 → 100644
View file @
68c687d0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
common/common-core/src/main/java/com/hungraim/ltc/util/SocketCallUtil.java
0 → 100644
View file @
68c687d0
package
com
.
hungraim
.
ltc
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
java.io.*
;
import
java.net.Socket
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
public
class
SocketCallUtil
{
private
final
static
Logger
logger
=
LogManager
.
getLogger
(
SocketCallUtil
.
class
);
/**
* 调用前置机
* @param ip
* @param port
* @param jsonStr 需要传输给前置机的报文
* @return
* @throws Exception
*/
public
static
String
callSocket
(
String
ip
,
int
port
,
String
jsonStr
)
{
Socket
socket
=
null
;
InputStream
in
=
null
;
PrintWriter
out
=
null
;
try
{
socket
=
new
Socket
(
ip
,
port
);
out
=
new
PrintWriter
(
new
OutputStreamWriter
(
socket
.
getOutputStream
(),
"utf-8"
));
jsonStr
=
URLEncoder
.
encode
(
jsonStr
,
"UTF-8"
);
String
oraMessage
=
"http://iai.tencentcloudapi.com/Method=TCY&outputStr="
+
jsonStr
;
String
length8Str
=
getByteLength8
(
oraMessage
);
String
message
=
"readFully"
+
length8Str
+
"nodecrypt"
+
oraMessage
;
out
.
print
(
message
);
out
.
flush
();
in
=
socket
.
getInputStream
();
Thread
.
sleep
(
1000
);
byte
[]
buf
=
new
byte
[
1024
];
List
<
Byte
>
byteList
=
new
ArrayList
<
Byte
>();
while
((
in
.
read
(
buf
))
!=
-
1
)
{
for
(
byte
bt
:
buf
)
{
byteList
.
add
(
bt
);
}
}
byte
[]
b
=
new
byte
[
byteList
.
size
()];
int
i
=
0
;
Iterator
<
Byte
>
iterator
=
byteList
.
iterator
();
while
(
iterator
.
hasNext
())
{
b
[
i
]
=
iterator
.
next
();
i
++;
}
byte
[]
byteLength8
=
new
byte
[
8
];
System
.
arraycopy
(
b
,
0
,
byteLength8
,
0
,
8
);
int
length8
=
Integer
.
parseInt
(
new
String
(
byteLength8
));
byte
[]
bytes
=
new
byte
[
length8
];
System
.
arraycopy
(
b
,
8
,
bytes
,
0
,
length8
);
return
URLDecoder
.
decode
(
new
String
(
bytes
,
"UTF-8"
),
"UTF-8"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
"调用前置机异常"
;
}
finally
{
try
{
in
.
close
();
out
.
close
();
if
(!
socket
.
isClosed
())
{
socket
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 获取byte字符的8位长度(不足八位左补零) add by oydg 20140902
*
* @param content
* @return
*/
private
static
String
getByteLength8
(
String
content
)
{
String
length8
=
""
;
if
(
null
==
content
)
{
return
length8
;
}
String
length
=
(
content
.
length
()
+
8
)
+
""
;
int
size
=
length
.
length
();
for
(
int
i
=
0
;
i
<
8
-
size
;
i
++)
{
length
=
"0"
+
length
;
}
length8
=
length
;
return
length8
;
}
/**
* 通过socket连接前置机进行互联网接口的对接
*
* @param socketIp 前置机IP
* @param socketPort 前置机端口
* @param url 目标请求的URL
* @param characterEncoding 字符集编码
* @param isProxy 是否开启代理请求
* @return
*/
public
static
String
commentSocketUtil
(
String
socketIp
,
int
socketPort
,
String
url
,
String
input
,
String
characterEncoding
,
String
isProxy
)
{
Socket
socket
=
null
;
try
{
socket
=
new
Socket
(
socketIp
,
socketPort
);
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"openProxy"
,
isProxy
);
//必传 启用代理 TRUE、FALSE,一般传TRUE,不要传FALSE
json
.
put
(
"encode"
,
characterEncoding
);
//非必传,不传默认UTF-8,如http(s)接口提供方反馈中文乱码,按对方编码设置
json
.
put
(
"contentType"
,
"application/json"
);
//非必传 Content-Type 按实际需要填写
if
(
"deleteVideoFile"
.
equals
(
input
)){
json
.
put
(
"requestMethod"
,
"GET"
);
//必传 POST、GET
}
else
{
json
.
put
(
"requestMethod"
,
"POST"
);
//必传 POST、GET
json
.
put
(
"outputString"
,
input
);
//参数
}
String
jsonStr
=
URLEncoder
.
encode
(
json
.
toString
(),
characterEncoding
);
String
oraMessage
=
url
+
"Method=WAN&outputStr="
+
jsonStr
;
String
length8Str
=
getByteLength8
(
oraMessage
);
logger
.
info
(
"开始连接前置机,请求的目标地址为:"
+
url
);
if
(
socket
.
isConnected
())
{
InputStream
in
=
new
BufferedInputStream
(
socket
.
getInputStream
());
OutputStream
out
=
socket
.
getOutputStream
();
String
message
=
"readFully"
+
length8Str
+
"nodecrypt"
+
oraMessage
;
out
.
write
((
message
).
getBytes
());
out
.
flush
();
byte
htmlByte
[]
=
readInputStream
(
in
);
String
result
=
new
String
(
htmlByte
,
characterEncoding
);
logger
.
info
(
"前置机返回外部接口信息:"
+
url
);
return
result
;
}
else
{
logger
.
info
(
"程序正常,但是连接前置机失败!"
);
return
"程序正常,但是连接前置机失败!"
;
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"前置机socket访问外部接口连接失败:"
+
e
.
getStackTrace
());
return
"查询失败"
;
}
finally
{
if
(!
socket
.
isClosed
())
{
try
{
socket
.
close
();
}
catch
(
Exception
e
)
{
logger
.
info
(
"关闭前置机socket连接错误:"
+
e
.
getStackTrace
());
}
}
}
}
/**
* 流转byte[],无需修改
*
* @param inStream
* @return
* @throws Exception
*/
private
static
byte
[]
readInputStream
(
InputStream
inStream
)
throws
Exception
{
ByteArrayOutputStream
outStream
=
new
ByteArrayOutputStream
();
byte
[]
buffer
=
new
byte
[
9024
];
int
len
=
0
;
while
((
len
=
inStream
.
read
(
buffer
))
!=
-
1
)
{
outStream
.
write
(
buffer
,
0
,
len
);
}
inStream
.
close
();
return
outStream
.
toByteArray
();
}
}
pom.xml
View file @
68c687d0
...
...
@@ -54,6 +54,12 @@
<artifactId>
lombok
</artifactId>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
1.2.69
</version>
</dependency>
</dependencies>
...
...
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