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
0728cad8
Commit
0728cad8
authored
Sep 06, 2024
by
18310373984@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20240904沟通修改内容修改提交
parent
c386785e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
252 additions
and
58 deletions
+252
-58
DisableController.java
...n/java/com/hungraim/ltc/controller/DisableController.java
+14
-9
SrvOrganController.java
.../java/com/hungraim/ltc/controller/SrvOrganController.java
+20
-2
CallFaceInterfaceLogMapper.java
...java/com/hungraim/ltc/dao/CallFaceInterfaceLogMapper.java
+16
-0
DisableApplyMapper.java
...rc/main/java/com/hungraim/ltc/dao/DisableApplyMapper.java
+4
-1
FaceAuthUtil.java
...java/com/hungraim/ltc/facelocation/util/FaceAuthUtil.java
+53
-3
DisableService.java
...rc/main/java/com/hungraim/ltc/service/DisableService.java
+2
-2
SrvOrganEmpService.java
...ain/java/com/hungraim/ltc/service/SrvOrganEmpService.java
+3
-1
DisableServiceImpl.java
...ava/com/hungraim/ltc/service/impl/DisableServiceImpl.java
+8
-3
SrvOrganEmpServiceImpl.java
...com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
+29
-16
ChDisableApplyMapper.xml
...ervice/src/main/resources/mapper/ChDisableApplyMapper.xml
+0
-0
ChDisableInfoHis.java
...hungraim/ltc/pojo/entity/assessment/ChDisableInfoHis.java
+3
-0
CallFaceInterfaceLog.java
...ungraim/ltc/pojo/entity/disable/CallFaceInterfaceLog.java
+48
-0
ChDisableApply.java
.../com/hungraim/ltc/pojo/entity/disable/ChDisableApply.java
+3
-0
ChDisableApplyHis.java
...m/hungraim/ltc/pojo/entity/disable/ChDisableApplyHis.java
+2
-0
ChDisableInfo.java
...a/com/hungraim/ltc/pojo/entity/disable/ChDisableInfo.java
+1
-0
ChDisableInfoChange.java
...hungraim/ltc/pojo/entity/disable/ChDisableInfoChange.java
+1
-1
ChSrvOrganEmp.java
...hungraim/ltc/pojo/entity/serviceManage/ChSrvOrganEmp.java
+6
-0
DisableExamineInfoVO.java
...om/hungraim/ltc/pojo/vo/disable/DisableExamineInfoVO.java
+3
-0
DisableUpdateDetailVO.java
...m/hungraim/ltc/pojo/vo/disable/DisableUpdateDetailVO.java
+2
-0
DisableVO.java
...main/java/com/hungraim/ltc/pojo/vo/disable/DisableVO.java
+2
-0
FileUtils.java
...n-core/src/main/java/com/hungraim/ltc/util/FileUtils.java
+11
-3
FileUploadController.java
.../hungraim/ltc/system/controller/FileUploadController.java
+21
-17
No files found.
apply/apply-service/src/main/java/com/hungraim/ltc/controller/DisableController.java
View file @
0728cad8
...
...
@@ -193,10 +193,11 @@ public class DisableController {
String
organId
,
String
districtProvincial
,
String
districtCity
,
String
districtArea
,
String
realName
,
String
certiCode
,
String
dataFrom
,
String
srvOrganName
)
{
String
srvOrganName
,
String
hasAcptSrvAddress
)
{
Page
<
DisableVO
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
page
=
disableService
.
disableList
(
page
,
organId
,
districtProvincial
,
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
1
);
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
1
,
hasAcptSrvAddress
);
return
Result
.
success
(
page
);
}
...
...
@@ -223,7 +224,7 @@ public class DisableController {
String
srvOrganName
)
{
Page
<
DisableVO
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
page
=
disableService
.
disableList
(
page
,
organId
,
districtProvincial
,
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
2
);
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
2
,
null
);
return
Result
.
success
(
page
);
}
...
...
@@ -261,8 +262,8 @@ public class DisableController {
* @return 失能信息详情
*/
@RequestMapping
(
"/disableExamineInfo"
)
public
Result
<
DisableExamineInfoVO
>
disableExamineInfo
(
String
applyId
)
{
DisableExamineInfoVO
disableExamineInfoVO
=
disableService
.
disableExamineInfo
(
applyId
);
public
Result
<
DisableExamineInfoVO
>
disableExamineInfo
(
String
applyId
,
String
from
)
{
DisableExamineInfoVO
disableExamineInfoVO
=
disableService
.
disableExamineInfo
(
applyId
,
from
);
return
Result
.
success
(
disableExamineInfoVO
);
}
...
...
@@ -315,9 +316,10 @@ public class DisableController {
if
(
StringUtils
.
isBlank
(
chDisableApply
.
getAcptProvincial
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptCity
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptArea
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptAddress
()))
{
return
Result
.
failed
(
"接受评定地址不能为空!"
);
}
if
(
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvProvincial
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvCity
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvArea
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvAddress
()))
{
//修改为不是必填项,根据该字段判断是否精准定位
/* if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) {
return Result.failed("接受服务地址不能为空!");
}
}
*/
if
(
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictProvincial
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictCity
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictCode
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDetail
()))
{
return
Result
.
failed
(
"现住址不能为空!"
);
}
...
...
@@ -373,9 +375,12 @@ public class DisableController {
return
Result
.
failed
(
"接受评定地址不能为空!"
);
}
//|| StringUtils.isBlank(chDisableApply.getAcptSrvStreet())
if
(
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvProvincial
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvCity
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvArea
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAcptSrvAddress
()))
{
//修改为不是必填项,根据该字段判断是否精准定位
/* if (StringUtils.isBlank(chDisableApply.getAcptSrvProvincial()) || StringUtils.isBlank(chDisableApply.getAcptSrvCity()) || StringUtils.isBlank(chDisableApply.getAcptSrvArea()) || StringUtils.isBlank(chDisableApply.getAcptSrvAddress())) {
return Result.failed("接受服务地址不能为空!");
}
}
*/
//|| StringUtils.isBlank(chDisableApply.getStreet())
if
(
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictProvincial
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictCity
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDistrictCode
())
||
StringUtils
.
isBlank
(
chDisableApply
.
getAdressDetail
()))
{
return
Result
.
failed
(
"现住址不能为空!"
);
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/controller/SrvOrganController.java
View file @
0728cad8
...
...
@@ -247,7 +247,7 @@ public class SrvOrganController {
* @return 返回操作结果
*/
@PostMapping
(
"/srvOrganEmp"
)
public
Result
saveOrUpdateSrvOrganEmp
(
SrvOrganEmpVo
srvOrganEmpVo
)
{
public
Result
saveOrUpdateSrvOrganEmp
(
@RequestHeader
(
"Authorization"
)
String
token
,
SrvOrganEmpVo
srvOrganEmpVo
)
{
if
(
null
==
srvOrganEmpVo
.
getOrganId
()
||
null
==
srvOrganEmpVo
.
getSrvOrganId
()
||
StrUtil
.
isBlank
(
srvOrganEmpVo
.
getEmpName
())
...
...
@@ -262,7 +262,25 @@ public class SrvOrganController {
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
try
{
return
srvOrganEmpService
.
saveOrUpdateSrvOrganEmp
(
srvOrganEmpVo
);
Integer
userId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"userId"
);
return
srvOrganEmpService
.
saveOrUpdateSrvOrganEmp
(
srvOrganEmpVo
,
userId
);
}
catch
(
RuntimeException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
}
@PostMapping
(
"/saveEmpFace"
)
public
Result
saveEmpFace
(
@RequestHeader
(
"Authorization"
)
String
token
,
SrvOrganEmpVo
srvOrganEmpVo
)
{
//参数传faceId,certiNum,
if
(
null
==
srvOrganEmpVo
.
getEmpId
()
||
StrUtil
.
isBlank
(
srvOrganEmpVo
.
getCertifNum
())
||
null
==
srvOrganEmpVo
.
getPhotoList
()
||
null
==
srvOrganEmpVo
.
getEmpName
()
||
null
==
srvOrganEmpVo
.
getGender
())
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
try
{
Integer
userId
=
TokenParsingUtil
.
TokenParsing
(
token
,
"userId"
);
return
srvOrganEmpService
.
saveEmpFace
(
srvOrganEmpVo
,
userId
);
}
catch
(
RuntimeException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
}
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/dao/CallFaceInterfaceLogMapper.java
0 → 100644
View file @
0728cad8
package
com
.
hungraim
.
ltc
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.hungraim.ltc.pojo.entity.disable.CallFaceInterfaceLog
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
/**
* 腾讯云调用接口记录Mapper
*
* @author czz
*/
@Mapper
@Repository
public
interface
CallFaceInterfaceLogMapper
extends
BaseMapper
<
CallFaceInterfaceLog
>
{
}
apply/apply-service/src/main/java/com/hungraim/ltc/dao/DisableApplyMapper.java
View file @
0728cad8
...
...
@@ -33,11 +33,14 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> {
*/
Page
<
DisableVO
>
disableList
(
Page
<
DisableVO
>
page
,
@Param
(
"organIds"
)
List
<
String
>
organIds
,
@Param
(
"provincial"
)
String
provincial
,
@Param
(
"city"
)
String
city
,
@Param
(
"area"
)
String
area
,
@Param
(
"name"
)
String
name
,
@Param
(
"certiCode"
)
String
certiCode
,
@Param
(
"dataFrom"
)
String
dataFrom
,
@Param
(
"srvOrganName"
)
String
srvOrganName
,
@Param
(
"applyMethod"
)
Integer
applyMethod
);
@Param
(
"dataFrom"
)
String
dataFrom
,
@Param
(
"srvOrganName"
)
String
srvOrganName
,
@Param
(
"applyMethod"
)
Integer
applyMethod
,
@Param
(
"hasAcptSrvAddress"
)
String
hasAcptSrvAddress
);
DisableExamineInfoVO
selectDisableExamineInfoByApplyId
(
String
applyId
);
DisableExamineInfoVO
selectDisableExamineInfoByApplyIdNew
(
String
applyId
);
List
<
ExamineRecord
>
listExamineRecordByApplyId
(
String
applyId
);
DisableInfoVO
getDisableInfo
(
String
disableInfoId
);
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/facelocation/util/FaceAuthUtil.java
View file @
0728cad8
package
com
.
hungraim
.
ltc
.
facelocation
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.hungraim.ltc.dao.CallFaceInterfaceLogMapper
;
import
com.hungraim.ltc.pojo.entity.disable.CallFaceInterfaceLog
;
import
com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganEmp
;
import
com.tencentcloudapi.common.AbstractModel
;
import
com.tencentcloudapi.common.Credential
;
...
...
@@ -15,6 +18,9 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.util.Base64
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.hungraim.ltc.util.Result
;
/**
* <pre>
...
...
@@ -28,7 +34,10 @@ public class FaceAuthUtil {
@Autowired
private
FaceAuthProperties
faceAuthProperties
;
public
Result
<
String
>
addFace
(
ChSrvOrganEmp
faceAuthParam
,
String
filePath
){
@Autowired
private
CallFaceInterfaceLogMapper
callFaceInterfaceLogMapper
;
public
Result
<
String
>
addFace
(
ChSrvOrganEmp
faceAuthParam
,
String
filePath
,
Integer
userId
){
try
{
//设置文件路径
...
...
@@ -59,8 +68,23 @@ public class FaceAuthUtil {
log
.
info
(
"gender:::::"
+
req
.
getGender
());
log
.
info
(
"照片base:::::"
+
imageToBase64
(
filePath
));
req
.
setImage
(
imageToBase64
(
filePath
));
Map
map
=
new
HashMap
();
//记录调用接口传的参数
map
.
put
(
"groupId"
,
faceAuthProperties
.
getGroupId
());
map
.
put
(
"personName"
,
req
.
getPersonName
());
map
.
put
(
"personId"
,
req
.
getPersonId
());
map
.
put
(
"gender"
,
req
.
getGender
());
CreatePersonResponse
resp
=
client
.
CreatePerson
(
req
);
log
.
info
(
"腾讯云返回:"
+
AbstractModel
.
toJsonString
(
resp
));
try
{
//增加接口调用记录
addCallFaceInterfaceLog
(
userId
,
JSON
.
toJSONString
(
map
),
"CreatePerson"
,
"创建人员"
,
AbstractModel
.
toJsonString
(
resp
),
resp
.
getFaceId
(),
null
,
null
);
}
catch
(
Exception
e
){
log
.
error
(
"增加CreatePerson接口调用记录失败:"
+
e
.
toString
());
}
return
Result
.
success
(
resp
.
getFaceId
());
}
catch
(
Exception
e
)
{
...
...
@@ -71,6 +95,10 @@ public class FaceAuthUtil {
public
String
imageToBase64
(
String
imagePath
)
{
String
base64String
=
""
;
//如果上传报错,本地测试将这两行打开
//同时将FileUtils类uploadFile方法注释打开
// File filePath=new File("D:/");
// File file = new File(filePath,imagePath);
File
file
=
new
File
(
imagePath
);
try
(
FileInputStream
fileInputStream
=
new
FileInputStream
(
file
))
{
byte
[]
bytes
=
new
byte
[(
int
)
file
.
length
()];
...
...
@@ -84,7 +112,7 @@ public class FaceAuthUtil {
public
Result
<
String
>
deleteFace
(
ChSrvOrganEmp
faceAuthParam
){
public
Result
<
String
>
deleteFace
(
ChSrvOrganEmp
faceAuthParam
,
Integer
userId
){
try
{
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey
...
...
@@ -109,7 +137,13 @@ public class FaceAuthUtil {
DeleteFaceResponse
resp
=
client
.
DeleteFace
(
req
);
// 输出json格式的字符串回包
System
.
out
.
println
(
AbstractModel
.
toJsonString
(
resp
));
try
{
//增加接口调用记录
addCallFaceInterfaceLog
(
userId
,
JSON
.
toJSONString
(
req
.
getFaceIds
()),
"DeleteFace"
,
"删除人脸"
,
AbstractModel
.
toJsonString
(
resp
),
null
,
null
,
null
);
}
catch
(
Exception
e
){
log
.
error
(
"增加DeleteFace接口调用记录失败:"
+
e
.
toString
());
}
// 输出json格式的字符串回包
return
Result
.
success
(
resp
.
getRequestId
());
...
...
@@ -118,4 +152,20 @@ public class FaceAuthUtil {
return
Result
.
failed
(
e
.
getMessage
());
}
}
//记录调用日志
private
void
addCallFaceInterfaceLog
(
Integer
userId
,
String
callParam
,
String
interfaceMethod
,
String
interfaceName
,
String
callResult
,
String
faceId
,
String
isMatch
,
String
score
){
CallFaceInterfaceLog
callFaceInterfaceLog
=
new
CallFaceInterfaceLog
();
callFaceInterfaceLog
.
setPcUserId
(
userId
);
callFaceInterfaceLog
.
setCallParam
(
callParam
);
callFaceInterfaceLog
.
setInterfaceMethod
(
interfaceMethod
);
callFaceInterfaceLog
.
setInterfaceName
(
interfaceName
);
callFaceInterfaceLog
.
setCallResult
(
callResult
);
callFaceInterfaceLog
.
setFaceId
(
faceId
);
callFaceInterfaceLog
.
setIsMatch
(
isMatch
);
callFaceInterfaceLog
.
setScore
(
score
);
callFaceInterfaceLogMapper
.
insert
(
callFaceInterfaceLog
);
}
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/DisableService.java
View file @
0728cad8
...
...
@@ -23,7 +23,7 @@ public interface DisableService {
Page
<
DisableVO
>
disableList
(
Page
<
DisableVO
>
page
,
String
organId
,
String
districtProvincial
,
String
districtCity
,
String
districtArea
,
String
realName
,
String
certiCode
,
String
dataFrom
,
String
srvOrganName
,
Integer
applyMethod
);
String
srvOrganName
,
Integer
applyMethod
,
String
hasAcptSrvAddress
);
/**
* 失能审核信息详情
...
...
@@ -31,7 +31,7 @@ public interface DisableService {
* @param applyId 失能人员id
* @return 失能审核信息详情
*/
DisableExamineInfoVO
disableExamineInfo
(
String
applyId
);
DisableExamineInfoVO
disableExamineInfo
(
String
applyId
,
String
from
);
/**
* 失能人员信息详情(失能人员信息修改申请详情页面)
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/service/SrvOrganEmpService.java
View file @
0728cad8
...
...
@@ -65,7 +65,7 @@ public interface SrvOrganEmpService {
* eduId: "", // 文化水平
* fileDataList: [], // 对应数据库中的文件数据列表
*/
Result
saveOrUpdateSrvOrganEmp
(
SrvOrganEmpVo
srvOrganEmpVo
);
Result
saveOrUpdateSrvOrganEmp
(
SrvOrganEmpVo
srvOrganEmpVo
,
Integer
userId
);
Workbook
srvOrganExport
(
Long
organId
,
Long
srvOrganId
,
Boolean
isInvolveChild
,
String
empName
,
String
srvOrganName
,
String
certifNum
,
Short
isLock
,
Short
empType
);
...
...
@@ -77,4 +77,6 @@ public interface SrvOrganEmpService {
Result
selectEmpBySrvOrganId
(
String
srvOrganId
);
Workbook
chSrvTaskDetailExport
(
Long
empId
,
String
empName
,
String
status
,
String
sevrTime
);
Result
saveEmpFace
(
SrvOrganEmpVo
srvOrganEmpVo
,
Integer
userId
)
;
}
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/DisableServiceImpl.java
View file @
0728cad8
...
...
@@ -113,14 +113,14 @@ public class DisableServiceImpl implements DisableService {
@Override
public
Page
<
DisableVO
>
disableList
(
Page
<
DisableVO
>
page
,
String
organId
,
String
districtProvincial
,
String
districtCity
,
String
districtArea
,
String
realName
,
String
certiCode
,
String
dataFrom
,
String
srvOrganName
,
Integer
applyMethod
)
{
String
srvOrganName
,
Integer
applyMethod
,
String
hasAcptSrvAddress
)
{
// 没有organId参数的时候,这个集合就为null
List
<
String
>
organIds
=
null
;
if
(
StrUtil
.
isNotBlank
(
organId
))
{
organIds
=
Arrays
.
asList
(
organId
.
split
(
","
));
}
Page
<
DisableVO
>
disableVOPage
=
disableApplyMapper
.
disableList
(
page
,
organIds
,
districtProvincial
,
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
applyMethod
);
districtCity
,
districtArea
,
realName
,
certiCode
,
dataFrom
,
srvOrganName
,
applyMethod
,
hasAcptSrvAddress
);
List
<
DisableVO
>
records
=
disableVOPage
.
getRecords
();
for
(
DisableVO
record
:
records
)
{
String
birthday
=
record
.
getBirthday
();
...
...
@@ -140,8 +140,13 @@ public class DisableServiceImpl implements DisableService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
DisableExamineInfoVO
disableExamineInfo
(
String
applyId
)
{
public
DisableExamineInfoVO
disableExamineInfo
(
String
applyId
,
String
from
)
{
//如果from字段不为空,则代表从失能申请页面调用,需要支持失能人员显示最新修改信息
DisableExamineInfoVO
disableExamineInfoVO
=
disableApplyMapper
.
selectDisableExamineInfoByApplyId
(
applyId
);
if
(
StringUtils
.
isNotEmpty
(
from
)){
//修改逻辑:待审核记录查申请表(待审核记录,还未写到正式表),审核通过记录查正式表ch_disable_info
disableExamineInfoVO
=
disableApplyMapper
.
selectDisableExamineInfoByApplyIdNew
(
applyId
);
}
List
<
ExamineRecord
>
examineRecords
=
disableApplyMapper
.
listExamineRecordByApplyId
(
applyId
);
disableExamineInfoVO
.
setExamineRecords
(
examineRecords
);
try
{
...
...
apply/apply-service/src/main/java/com/hungraim/ltc/service/impl/SrvOrganEmpServiceImpl.java
View file @
0728cad8
...
...
@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
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.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.hungraim.ltc.api.AttachFeignService
;
import
com.hungraim.ltc.dao.*
;
...
...
@@ -31,6 +32,7 @@ import com.hungraim.ltc.util.Result;
import
com.hungraim.ltc.util.ResultCode
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
oracle.sql.DATE
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -135,7 +137,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
Result
saveOrUpdateSrvOrganEmp
(
SrvOrganEmpVo
srvOrganEmpVo
)
{
public
Result
saveOrUpdateSrvOrganEmp
(
SrvOrganEmpVo
srvOrganEmpVo
,
Integer
userId
)
{
Long
empId
=
srvOrganEmpVo
.
getEmpId
();
ChSrvOrganEmp
chSrvOrganEmp
=
new
ChSrvOrganEmp
();
BeanUtils
.
copyProperties
(
srvOrganEmpVo
,
chSrvOrganEmp
);
...
...
@@ -164,7 +166,7 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvempRiskLevel
.
setFcd
(
new
Date
());
chSrvempRiskLevelMapper
.
insert
(
chSrvempRiskLevel
);
Result
<
String
>
faceReult
=
updatePhotoAttachs
(
srvOrganEmpVo
,
chSrvOrganEmp
);
//上传标准照
Result
<
String
>
faceReult
=
updatePhotoAttachs
(
srvOrganEmpVo
,
userId
);
//上传标准照
if
(
StrUtil
.
equals
(
faceReult
.
getCode
(),
ResultCode
.
SUCCESS
.
getCode
()))
{
chSrvOrganEmp
.
setFaceId
(
faceReult
.
getData
());
//腾讯云人脸库Id
chSrvOrganEmpMapper
.
updateById
(
chSrvOrganEmp
);
//更新护理人员信息
...
...
@@ -176,14 +178,6 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chSrvOrganEmpMapper
.
updateById
(
chSrvOrganEmp
);
updateAttachs
(
srvOrganEmpVo
,
empId
);
//上传标准照保存到人脸库
Result
<
String
>
faceReult
=
updatePhotoAttachs
(
srvOrganEmpVo
,
chSrvOrganEmp
);
String
faceId
=
faceReult
.
getData
();
//上传标准照
chSrvOrganEmp
.
setFaceId
(
faceId
);
chSrvOrganEmpMapper
.
updateById
(
chSrvOrganEmp
);
if
(!
StrUtil
.
equals
(
faceReult
.
getCode
(),
ResultCode
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
faceReult
.
getMsg
());
//人脸库上传失败,页面显示错误信息
}
}
return
Result
.
success
();
}
...
...
@@ -198,14 +192,33 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
Result
saveEmpFace
(
SrvOrganEmpVo
srvOrganEmpVo
,
Integer
userId
)
{
//修改护理人员需要将修改基本信息和标准照片保存分开
//上传标准照保存到人脸库
Result
<
String
>
faceReult
=
updatePhotoAttachs
(
srvOrganEmpVo
,
userId
);
if
(!
StrUtil
.
equals
(
faceReult
.
getCode
(),
ResultCode
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
faceReult
.
getMsg
());
//人脸库上传失败,页面显示错误信息
}
else
{
String
faceId
=
faceReult
.
getData
();
//上传标准照
UpdateWrapper
updateWrapper
=
new
UpdateWrapper
();
updateWrapper
.
eq
(
"emp_Id"
,
srvOrganEmpVo
.
getEmpId
());
updateWrapper
.
set
(
"face_id"
,
faceId
);
updateWrapper
.
set
(
"LCD"
,
new
DATE
());
chSrvOrganEmpMapper
.
update
(
null
,
updateWrapper
);
}
return
Result
.
success
();
}
//保存到本地及人脸库
private
Result
<
String
>
updatePhotoAttachs
(
SrvOrganEmpVo
srvOrganEmpVo
,
ChSrvOrganEmp
chSrvOrganEmp
)
{
private
Result
<
String
>
updatePhotoAttachs
(
SrvOrganEmpVo
srvOrganEmpVo
,
Integer
userId
)
{
if
(
srvOrganEmpVo
.
getPhotoList
()!=
null
&&
srvOrganEmpVo
.
getPhotoList
().
size
()>
0
)
{
//标准照必传
//修改标准照
AttachUpdateVo
attachPhotoUpdateVo
=
new
AttachUpdateVo
();
attachPhotoUpdateVo
.
setChFndAttachs
(
srvOrganEmpVo
.
getPhotoList
());
attachPhotoUpdateVo
.
setCtrlId
(
chSrvOrganEmp
.
getEmpId
());
attachPhotoUpdateVo
.
setCtrlId
(
srvOrganEmpVo
.
getEmpId
());
attachPhotoUpdateVo
.
setAttachType
(
AttachType
.
SRV_EMP_Photo
.
getUploadType
());
attachFeignService
.
updateAttachs
(
attachPhotoUpdateVo
);
...
...
@@ -216,17 +229,17 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
chFndAttach
=
attachFeignService
.
selectAttachById
(
chFndAttach
.
getAttachId
()).
getData
();
}
log
.
info
(
"filePath2:"
+
chFndAttach
.
getFilePath
());
if
(
StringUtils
.
isNotEmpty
(
chSrvOrganEmp
.
getFaceId
()))
{
if
(
StringUtils
.
isNotEmpty
(
srvOrganEmpVo
.
getFaceId
()))
{
//先删除人员信息
Result
<
String
>
delresult
=
faceAuthUtil
.
deleteFace
(
chSrvOrganEmp
);
Result
<
String
>
delresult
=
faceAuthUtil
.
deleteFace
(
srvOrganEmpVo
,
userId
);
log
.
info
(
"删除人脸信息:"
+
delresult
);
Result
addResult
=
faceAuthUtil
.
addFace
(
srvOrganEmpVo
,
chFndAttach
.
getFilePath
());
Result
addResult
=
faceAuthUtil
.
addFace
(
srvOrganEmpVo
,
chFndAttach
.
getFilePath
()
,
userId
);
log
.
info
(
"新增人脸信息:"
+
addResult
);
return
addResult
;
}
else
{
//在新增人员信息
Result
addResult
=
faceAuthUtil
.
addFace
(
srvOrganEmpVo
,
chFndAttach
.
getFilePath
());
Result
addResult
=
faceAuthUtil
.
addFace
(
srvOrganEmpVo
,
chFndAttach
.
getFilePath
()
,
userId
);
log
.
info
(
"新增人脸信息:"
+
addResult
);
return
addResult
;
}
...
...
apply/apply-service/src/main/resources/mapper/ChDisableApplyMapper.xml
View file @
0728cad8
This diff is collapsed.
Click to expand it.
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/assessment/ChDisableInfoHis.java
View file @
0728cad8
...
...
@@ -395,6 +395,9 @@ public class ChDisableInfoHis implements Serializable {
* 待遇类型(1失能、0失智)
*/
private
Integer
treatmentType
;
private
Integer
positioningDistance
;
//定位距离
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/CallFaceInterfaceLog.java
0 → 100644
View file @
0728cad8
package
com
.
hungraim
.
ltc
.
pojo
.
entity
.
disable
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.hungraim.ltc.pojo.entity.PageInfo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 失能人员申请
*/
@Data
@TableName
(
"ch_call_face_interface_log"
)
@KeySequence
(
value
=
"s_ch_call_face_interface_log"
)
public
class
CallFaceInterfaceLog
extends
PageInfo
implements
Serializable
{
/**
* 失能申请id
*/
@TableId
(
value
=
"call_log_id"
,
type
=
IdType
.
INPUT
)
private
Long
callLogId
;
//pc端登录用户Id
private
Integer
pcUserId
;
//app端登录用户ID
private
Integer
appUserId
;
//app端人脸识别身份证号
private
String
certifNum
;
//调用参数
private
String
callParam
;
//接口方法:CreatePerson 创建人员接口 DeletePerson删除创建人员接口 DetectLiveFaceAccurate 静态活检高精度版接口 VerifyPerson 人员验证接口
private
String
interfaceMethod
;
//接口名称
private
String
interfaceName
;
//腾讯云接口返回信息
private
String
callResult
;
//创建人员接口返回的face_id
private
String
faceId
;
//静态活检接口返回的活体打分和人员验证接口返回的相似度评分
private
String
score
;
//人员验证接口返回的is_match=true为同一人,is_match=false不是同一人
private
String
isMatch
;
//调用时间
private
Date
callTime
;
private
static
final
long
serialVersionUID
=
1L
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableApply.java
View file @
0728cad8
...
...
@@ -651,5 +651,8 @@ public class ChDisableApply extends PageInfo implements Serializable {
@TableField
(
exist
=
false
)
private
List
<
ChFndAttach
>
fileDataList
;
private
Integer
positioningDistance
;
//定位距离
private
static
final
long
serialVersionUID
=
1L
;
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableApplyHis.java
View file @
0728cad8
...
...
@@ -604,6 +604,8 @@ public class ChDisableApplyHis implements Serializable {
*/
private
Short
treatmentType
;
private
Integer
positioningDistance
;
//定位距离
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getApplyHisId
()
{
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableInfo.java
View file @
0728cad8
...
...
@@ -143,4 +143,5 @@ public class ChDisableInfo extends PageInfo implements Serializable {
private
Integer
exitSrvOrganId
;
private
java
.
util
.
Date
exitTime
;
private
Integer
positioningDistance
;
//定位距离
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/disable/ChDisableInfoChange.java
View file @
0728cad8
...
...
@@ -471,7 +471,7 @@ public class ChDisableInfoChange {
*/
private
Long
reviewFrequency
;
private
Integer
positioningDistance
;
//定位距离
...
...
common/common-core/src/main/java/com/hungraim/ltc/pojo/entity/serviceManage/ChSrvOrganEmp.java
View file @
0728cad8
...
...
@@ -181,7 +181,12 @@ public class ChSrvOrganEmp implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
//是否人脸识别,Y=是,N等于否
private
String
isFace
;
//腾讯云人脸库faceId
private
String
faceId
;
}
\ No newline at end of file
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/disable/DisableExamineInfoVO.java
View file @
0728cad8
...
...
@@ -134,4 +134,7 @@ public class DisableExamineInfoVO {
private
String
applyTime
;
private
List
<
ChFndAttach
>
fileDataList
;
//定位距离
private
Integer
positioningDistance
;
//定位距离
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/disable/DisableUpdateDetailVO.java
View file @
0728cad8
...
...
@@ -157,4 +157,6 @@ public class DisableUpdateDetailVO {
*/
private
Long
reviewFrequency
;
private
Integer
positioningDistance
;
//定位距离
}
common/common-core/src/main/java/com/hungraim/ltc/pojo/vo/disable/DisableVO.java
View file @
0728cad8
...
...
@@ -60,4 +60,6 @@ public class DisableVO implements Serializable {
private
Integer
applyMethod
;
private
String
applyTime
;
private
String
hasAcptSrvAddress
;
//接受服务地址是否已维护,Y是,N否
}
common/common-core/src/main/java/com/hungraim/ltc/util/FileUtils.java
View file @
0728cad8
...
...
@@ -28,7 +28,7 @@ public class FileUtils {
* @param path 存放文件的根路径
* @return 返回文件具体保存的路径,包含文件名称
*/
public
static
String
uploadFile
(
MultipartFile
uploadFile
,
String
path
)
{
public
static
String
uploadFile
(
MultipartFile
uploadFile
,
String
path
)
throws
IOException
{
log
.
info
(
"开始进行文件上传"
);
try
{
//获取到文件名
...
...
@@ -50,13 +50,21 @@ public class FileUtils {
//文件上传
String
realFilePath
=
realDirPath
+
"/"
+
realName
;
log
.
info
(
"文件上传路径以及名称:{}"
,
realFilePath
);
/*
//如果上传报错,本地测试将块注释代码打开
//同时将FaceAuthUtil,imageToBase64方法注释打开
File filePath=new File("D:/");
if(!filePath.exists()){
filePath.mkdirs();
}
File file = new File(filePath,realFilePath);**/
File
file
=
new
File
(
realFilePath
);
uploadFile
.
transferTo
(
file
);
return
realFilePath
;
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
log
.
info
(
"上传失败:"
+
e
.
getMessage
());
throw
new
IOException
(
"上传文件失败:"
+
e
.
getMessage
());
}
return
null
;
}
...
...
system/system-admin-service/src/main/java/com/hungraim/ltc/system/controller/FileUploadController.java
View file @
0728cad8
...
...
@@ -38,24 +38,28 @@ public class FileUploadController {
*/
@PostMapping
(
"/uploadFile"
)
public
Result
uploadFile
(
MultipartFile
file
,
Short
uploadType
)
{
if
(
null
==
uploadType
||
null
==
file
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
//过滤上传资料类型
String
originalFilename
=
file
.
getOriginalFilename
();
//文件类型
String
fileType
=
originalFilename
.
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
));
List
<
String
>
fileTypes
=
fileUploadConfig
.
getType
();
log
.
info
(
"支持图片类型:"
+
fileTypes
+
",上传的图片类型:"
+
fileType
);
if
(!
fileTypes
.
stream
().
anyMatch
(
e
->
e
.
equalsIgnoreCase
(
fileType
))){
log
.
info
(
"上传文件错误"
);
return
Result
.
failed
(
ResultCode
.
FILE_TYPE_ERROR
);
try
{
if
(
null
==
uploadType
||
null
==
file
)
{
return
Result
.
failed
(
ResultCode
.
REQUEST_PARAM_ERROR
);
}
//过滤上传资料类型
String
originalFilename
=
file
.
getOriginalFilename
();
//文件类型
String
fileType
=
originalFilename
.
substring
(
file
.
getOriginalFilename
().
lastIndexOf
(
"."
));
List
<
String
>
fileTypes
=
fileUploadConfig
.
getType
();
log
.
info
(
"支持图片类型:"
+
fileTypes
+
",上传的图片类型:"
+
fileType
);
if
(!
fileTypes
.
stream
().
anyMatch
(
e
->
e
.
equalsIgnoreCase
(
fileType
))){
log
.
info
(
"上传文件错误"
);
return
Result
.
failed
(
ResultCode
.
FILE_TYPE_ERROR
);
}
String
realPath
=
FileUtils
.
uploadFile
(
file
,
fileUploadConfig
.
getPath
());
log
.
info
(
"文件上传成功:{}"
,
realPath
);
Long
attachId
=
attachService
.
saveFileInfo
(
originalFilename
,
realPath
,
uploadType
);
log
.
info
(
"保存成功,文件id:{}"
,
attachId
);
return
Result
.
success
(
attachId
);
}
catch
(
Exception
e
){
return
Result
.
failed
(
e
.
getMessage
());
}
String
realPath
=
FileUtils
.
uploadFile
(
file
,
fileUploadConfig
.
getPath
());
log
.
info
(
"文件上传成功:{}"
,
realPath
);
Long
attachId
=
attachService
.
saveFileInfo
(
originalFilename
,
realPath
,
uploadType
);
log
.
info
(
"保存成功,文件id:{}"
,
attachId
);
return
Result
.
success
(
attachId
);
}
...
...
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