Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
AutogeneralShanghai
yd-backend
Commits
be4a466d
Commit
be4a466d
authored
Jun 13, 2022
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电子报聘审批通知5
parent
2f84ae8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
9 deletions
+78
-9
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsHiringServiceImpl.java
+14
-0
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringServiceImpl.java
+64
-9
No files found.
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsHiringServiceImpl.java
View file @
be4a466d
...
...
@@ -75,6 +75,8 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
private
MdDropOptionsDALService
mdDropOptionsDALService
;
@Autowired
private
WechatService
wechatService
;
@Autowired
private
AclFileUploadDALService
aclFileUploadDALService
;
@Autowired
public
void
setAgmsHiringDalService
(
AgmsHiringDALService
agmsHiringDalService
){
...
...
@@ -644,6 +646,18 @@ public class AgmsHiringServiceImpl implements AgmsHiringService {
setting
.
setUpdatedAt
(
new
Date
());
setting
.
setUpdatedBy
(
operater
);
aclPractitionerSettingDalService
.
save
(
setting
);
// 更新经纪人微信二维码targetId为practitionerId
AclFileUpload
aclFileUpload
=
new
AclFileUpload
();
aclFileUpload
.
setTargetType
(
1
);
aclFileUpload
.
setTargetId
(
hiringBasicInfoId
);
aclFileUpload
.
setTargetUseFor
(
9
);
aclFileUpload
.
setIsActive
(
1
);
List
<
AclFileUpload
>
aclFileUploadList
=
aclFileUploadDALService
.
findByAclFileUpload
(
aclFileUpload
);
for
(
AclFileUpload
file
:
aclFileUploadList
)
{
file
.
setTargetId
(
practitioner
.
getId
());
aclFileUploadDALService
.
updateFileUpload
(
file
);
}
}
private
PractitionerHiringApproveSteps
getHiringApproveStatus
(
Long
loginId
,
String
practitionerLevelId
,
List
<
PractitionerHiringApproveRecords
>
practitionerHiringApproveRecordsList
)
{
...
...
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringServiceImpl.java
View file @
be4a466d
...
...
@@ -9,9 +9,9 @@ import com.yd.dal.entity.customer.*;
import
com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps
;
import
com.yd.dal.entity.practitioner.hiring.*
;
import
com.yd.dal.mapper.customer.*
;
import
com.yd.dal.service.customer.AclFileUploadDALService
;
import
com.yd.dal.service.customer.AclPractitionerDALService
;
import
com.yd.dal.service.customer.AclPractitionerHiringApproveRecordsDALService
;
import
com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService
;
import
com.yd.dal.service.practitioner.PractitionerHiringDALService
;
import
com.yd.rmi.ali.oss.service.OssService
;
import
com.yd.rmi.ali.send.service.SendService
;
...
...
@@ -63,7 +63,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
@Autowired
private
AclPractitionerPotentialMapper
aclPractitionerPotentialMapper
;
@Autowired
private
Acl
PractitionerSubordinateSystemDALService
aclPractitionerSubordinateSystem
DALService
;
private
Acl
FileUploadDALService
aclFileUpload
DALService
;
private
PractitionerHiringDALService
practitionerHiringDalService
;
private
SystemConfigService
systemConfigService
;
...
...
@@ -908,21 +908,73 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
public
SaveWeChatQRcodeResponseVO
saveWeChatQRcode
(
SaveWeChatQRcodeRequestVO
requestVO
)
{
SaveWeChatQRcodeResponseVO
resp
=
new
SaveWeChatQRcodeResponseVO
();
try
{
String
mediaId
=
requestVO
.
getVxUrlQRcode
();
String
vxUrl
=
requestVO
.
getVxUrlQRcode
();
Long
basicInfoId
=
requestVO
.
getHiringBasicInfoId
();
String
imgUrl
=
this
.
uploadImageToOss
(
mediaId
,
basicInfoId
,
2
);
if
(
imgUrl
==
null
)
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830024"
)));
Map
<
String
,
Object
>
input
=
HttpUtil
.
getInput
(
vxUrl
);
if
(!(
boolean
)
input
.
get
(
"success"
))
{
throw
new
Exception
(
ZHBErrorConfig
.
getErrorInfo
(
"830025"
));
}
//获取图片流
InputStream
inputStream
=
(
InputStream
)
input
.
get
(
"is"
);
if
(
inputStream
==
null
)
{
throw
new
Exception
(
"获取图片流失败"
);
}
//判断图像尺寸
BufferedImage
img
=
ImageIO
.
read
(
inputStream
);
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
ImageIO
.
write
(
img
,
"jpg"
,
os
);
inputStream
=
new
ByteArrayInputStream
(
os
.
toByteArray
());
//上传图片至阿里云
String
prefix
=
"brokerHiring/"
+
basicInfoId
+
"/"
;
String
originalFilename
=
generateKey
(
9
);
String
key
=
prefix
+
originalFilename
+
".jpg"
;
String
ossPath
=
ossService
.
putFileToOss
(
null
,
key
,
inputStream
);
if
(
ossPath
==
null
)
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
}
else
{
AclPractitionerHiringBasicInfo
basicInfo
=
new
AclPractitionerHiringBasicInfo
();
basicInfo
.
setId
(
basicInfoId
);
basicInfo
.
setWechatId
(
requestVO
.
getWechatId
());
basicInfo
.
setWechatQRcodeOssPath
(
imgUrl
);
basicInfo
.
setWechatQRcodeOssPath
(
ossPath
);
basicInfoMapper
.
updateByPrimaryKeySelective
(
basicInfo
);
// 2.将微信二维码设置到ydLife经纪人的个人设置
// 2.1 将之前上传的二维码设置为不启用
AclFileUpload
oldUpload
=
new
AclFileUpload
();
oldUpload
.
setTargetId
(
basicInfoId
);
oldUpload
.
setTargetType
(
1
);
oldUpload
.
setIsActive
(
1
);
oldUpload
.
setTargetUseFor
(
9
);
List
<
AclFileUpload
>
uploads
=
aclFileUploadDALService
.
findByAclFileUpload
(
oldUpload
);
if
(!
uploads
.
isEmpty
())
{
for
(
AclFileUpload
fileUpload
:
uploads
)
{
fileUpload
.
setIsActive
(
0
);
aclFileUploadDALService
.
updateFileUpload
(
fileUpload
);
}
}
// 2.2 保存入库
AclFileUpload
aclFileUpload
=
new
AclFileUpload
();
aclFileUpload
.
setTargetType
(
1
);
aclFileUpload
.
setTargetId
(
basicInfoId
);
aclFileUpload
.
setTargetNo
(
""
);
aclFileUpload
.
setFileType
(
"jpg"
);
aclFileUpload
.
setFileName
(
originalFilename
);
aclFileUpload
.
setFilePath
(
ossPath
);
aclFileUpload
.
setTargetUseFor
(
9
);
aclFileUpload
.
setFileSize
(
String
.
valueOf
(
inputStream
.
available
()));
aclFileUpload
.
setIsActive
(
1
);
aclFileUpload
.
setRemark
(
"报聘时上传的微信二维, targetId是basicInfoId"
);
aclFileUpload
.
setUploadedAt
(
new
Date
());
aclFileUpload
.
setUploadedBy
(-
1L
);
aclFileUpload
.
setTargetSeq
(
1
);
aclFileUploadDALService
.
saveFileUpload
(
aclFileUpload
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
resp
.
setImgUrl
(
imgUrl
);
resp
.
setImgUrl
(
ossPath
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -1005,8 +1057,11 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
if
(!(
boolean
)
input
.
get
(
"success"
))
{
throw
new
Exception
(
ZHBErrorConfig
.
getErrorInfo
(
"830025"
));
}
//获取
头像
流
//获取
图片
流
InputStream
inputStream
=
(
InputStream
)
input
.
get
(
"is"
);
if
(
inputStream
==
null
)
{
throw
new
Exception
(
"获取图片流失败"
);
}
//判断图像尺寸
BufferedImage
img
=
ImageIO
.
read
(
inputStream
);
...
...
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