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
c78fc1fe
Commit
c78fc1fe
authored
Jan 22, 2021
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成pdf后放至oss,ydlife查询经纪人合同
parent
02cf64fd
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
262 additions
and
56 deletions
+262
-56
yd-api/src/main/java/com/yd/api/practitioner/PractitionerHiringController.java
+19
-12
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerHiringContractService.java
+3
-1
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerHiringService.java
+3
-0
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringContractServiceImpl.java
+102
-33
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringServiceImpl.java
+72
-8
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/GeneratePDFRequestVO.java
+1
-1
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/GeneratePDFResponseVO.java
+10
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/QueryPractitionerInfoRequestVO.java
+11
-0
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/QueryPractitionerInfoResponseVO.java
+11
-0
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitioner.java
+16
-0
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
+14
-1
No files found.
yd-api/src/main/java/com/yd/api/practitioner/PractitionerHiringController.java
View file @
c78fc1fe
...
@@ -18,8 +18,7 @@ public class PractitionerHiringController {
...
@@ -18,8 +18,7 @@ public class PractitionerHiringController {
@Autowired
@Autowired
private
PractitionerHiringService
practitionerHiringService
;
private
PractitionerHiringService
practitionerHiringService
;
@Autowired
private
PractitionerHiringContractService
hiringContractService
;
/**
/**
* 保存报聘经纪人组织关系
* 保存报聘经纪人组织关系
...
@@ -236,19 +235,26 @@ public class PractitionerHiringController {
...
@@ -236,19 +235,26 @@ public class PractitionerHiringController {
* @param requestVO 请求数据
* @param requestVO 请求数据
* @return 响应数据
* @return 响应数据
*/
*/
@RequestMapping
(
"/
hiring
PDF"
)
@RequestMapping
(
"/
generate
PDF"
)
public
Object
hiringApprove
(
@RequestBody
Hiring
PDFRequestVO
requestVO
){
public
Object
generatePDF
(
@RequestBody
Generate
PDFRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
JsonResult
result
=
new
JsonResult
();
try
{
GeneratePDFResponseVO
responseVO
=
practitionerHiringService
.
generatePDF
(
requestVO
);
// PractitionerPDFTest.main(null);
result
.
addResult
(
responseVO
);
Long
hiringBasicInfoId
=
requestVO
.
getHiringBasicInfoId
();
result
.
setData
(
responseVO
);
hiringContractService
.
generatePractitionerContract
(
hiringBasicInfoId
);
return
result
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 报聘成功后查看经纪人信息
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/queryPractitionerInfo"
)
public
Object
queryPractitionerInfo
(
@RequestBody
QueryPractitionerInfoRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
QueryPractitionerInfoResponseVO
responseVO
=
practitionerHiringService
.
queryPractitionerInfo
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
return
result
;
}
}
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerHiringContractService.java
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
service
;
package
com
.
yd
.
api
.
practitioner
.
service
;
import
com.yd.api.practitioner.vo.hiring.GeneratePDFRequestVO
;
import
java.util.Map
;
import
java.util.Map
;
public
interface
PractitionerHiringContractService
{
public
interface
PractitionerHiringContractService
{
String
generatePractitionerContract
(
Long
hiringBasicInfoId
)
;
String
generatePractitionerContract
(
String
practitionerNO
,
String
contractNo
,
Long
hiringBasicInfoId
)
throws
Exception
;
Map
<
String
,
String
>
initHiringBasicInfoData
(
Long
hiringBasicInfoId
);
Map
<
String
,
String
>
initHiringBasicInfoData
(
Long
hiringBasicInfoId
);
...
...
yd-api/src/main/java/com/yd/api/practitioner/service/PractitionerHiringService.java
View file @
c78fc1fe
...
@@ -53,4 +53,7 @@ public interface PractitionerHiringService {
...
@@ -53,4 +53,7 @@ public interface PractitionerHiringService {
SavePayrollPictureResponseVO
savePayrollPicture
(
SavePayRollPictureRequestVO
requestVO
);
SavePayrollPictureResponseVO
savePayrollPicture
(
SavePayRollPictureRequestVO
requestVO
);
GeneratePDFResponseVO
generatePDF
(
GeneratePDFRequestVO
requestVO
);
QueryPractitionerInfoResponseVO
queryPractitionerInfo
(
QueryPractitionerInfoRequestVO
requestVO
);
}
}
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringContractServiceImpl.java
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
service
.
impl
;
package
com
.
yd
.
api
.
practitioner
.
service
.
impl
;
import
com.yd.api.practitioner.service.PractitionerHiringContractService
;
import
com.yd.api.practitioner.service.PractitionerHiringContractService
;
import
com.yd.api.practitioner.vo.hiring.GeneratePDFRequestVO
;
import
com.yd.dal.entity.customer.*
;
import
com.yd.dal.entity.customer.*
;
import
com.yd.dal.entity.practitioner.hiring.HiringBasicInfo
;
import
com.yd.dal.entity.practitioner.hiring.HiringMemberShip
;
import
com.yd.dal.entity.practitioner.hiring.HiringPersonalStatements
;
import
com.yd.dal.entity.practitioner.hiring.HiringWorkingExperience
;
import
com.yd.dal.mapper.customer.*
;
import
com.yd.dal.mapper.customer.*
;
import
com.yd.dal.mapper.practitioner.PractitionerHiringMapper
;
import
com.yd.dal.mapper.practitioner.PractitionerHiringMapper
;
import
com.libs.pdf.*
;
import
com.libs.pdf.*
;
...
@@ -13,15 +10,11 @@ import com.yd.rmi.ali.oss.service.OssService;
...
@@ -13,15 +10,11 @@ import com.yd.rmi.ali.oss.service.OssService;
import
com.yd.util.CommonUtil
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.HttpUtil
;
import
com.yd.util.HttpUtil
;
import
com.yd.util.PDFConfiguration
;
import
com.yd.util.PDFConfiguration
;
import
com.yd.util.config.ZHBErrorConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.FileNotFoundException
;
import
java.io.*
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -54,7 +47,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -54,7 +47,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
* @return
* @return
*/
*/
@Override
@Override
public
String
generatePractitionerContract
(
Long
hiringBasicInfoId
)
{
public
String
generatePractitionerContract
(
String
practitionerNO
,
String
contractNo
,
Long
hiringBasicInfoId
)
throws
Exception
{
//1、从DB中按照hiringBasicInfoId,获取经纪人的文字信息
//1、从DB中按照hiringBasicInfoId,获取经纪人的文字信息
Map
<
String
,
String
>
initDatas
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
initDatas
=
new
HashMap
<
String
,
String
>();
initDatas
=
initHiringBasicInfoData
(
hiringBasicInfoId
);
initDatas
=
initHiringBasicInfoData
(
hiringBasicInfoId
);
...
@@ -63,21 +57,98 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -63,21 +57,98 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
Map
<
String
,
String
>
initImages
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
initImages
=
new
HashMap
<
String
,
String
>();
initImages
=
initHiringImageInfoData
(
hiringBasicInfoId
);
initImages
=
initHiringImageInfoData
(
hiringBasicInfoId
);
//ag_acl_practitioner.employee_no
//ag_acl_practitioner.practitioner_code
String
practitionerNO
=
"YDSH00009"
;
String
contractNO
=
"CTSH00009"
;
//String practitionerNO = "YDSH00009";
//String contractNO = "CTSH00009";
//3、PDF模板生成合同文件,存本地临时文件后,上传oss
//3、PDF模板生成合同文件,存本地临时文件后,上传oss
String
contractFile
=
generatePractitionerPDF
(
practitionerNO
,
initDatas
,
initImages
);
String
contractFile
=
generatePractitionerPDF
(
practitionerNO
,
initDatas
,
initImages
);
//上传至oss ossService
//上传至oss ossService
String
contractFileOSS
=
contractFile
;
String
contractFileOSS
=
this
.
putContractFileToOSS
(
contractFile
,
hiringBasicInfoId
)
;
//4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path
//4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path
// 经纪人经纪人类型级别定义表ag_acl_practitioner_setting
// 经纪人经纪人类型级别定义表ag_acl_practitioner_setting
return
contractFileOSS
;
return
contractFileOSS
;
}
}
private
String
putContractFileToOSS
(
String
contractFile
,
Long
basicInfoId
)
throws
Exception
{
StringBuffer
directory
=
new
StringBuffer
();
directory
.
append
(
"brokerHiring/"
).
append
(
basicInfoId
).
append
(
"/"
);
File
tempFile
=
new
File
(
contractFile
.
trim
());
//数据源不存在
if
(!
tempFile
.
exists
())
{
throw
new
Exception
(
"目标文件地址不存在!"
);
}
//非文件类型
if
(!
tempFile
.
isFile
())
{
throw
new
Exception
(
"目标文件不是文件类型!"
);
}
InputStream
is
=
null
;
String
ossPath
=
null
;
try
{
is
=
new
BufferedInputStream
(
new
FileInputStream
(
tempFile
));
//读取数据源
String
fileName
=
tempFile
.
getName
();
String
key
=
directory
.
append
(
fileName
).
toString
();
ossPath
=
ossService
.
putFileToOss
(
null
,
key
,
is
);
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
is
!=
null
)
{
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
return
ossPath
;
}
public
static
String
copyFile
(
String
src
,
String
dest
)
throws
IOException
,
ClassNotFoundException
{
File
srcFile
=
new
File
(
src
);
//源文件数据源
File
desFile
=
new
File
(
dest
);
//写入到目标数据源
//数据源不存在
if
(!
srcFile
.
exists
()
||
!
desFile
.
exists
())
{
throw
new
ClassNotFoundException
(
"源文件或者拷贝目标文件地址不存在!"
);
}
//非文件类型
if
(!
srcFile
.
isFile
()
||
!
desFile
.
isFile
())
{
return
"源文件或者目标文件不是文件类型!"
;
}
InputStream
is
=
null
;
OutputStream
os
=
null
;
byte
[]
buf
=
new
byte
[
1024
];
//缓存区
int
len
=
0
;
//读取长度
try
{
is
=
new
BufferedInputStream
(
new
FileInputStream
(
srcFile
));
//读取数据源
os
=
new
BufferedOutputStream
(
new
FileOutputStream
(
desFile
));
//写入到数据源
while
((
len
=
is
.
read
(
buf
))
!=
-
1
)
{
//读取长度不为-1,继续读取
os
.
write
(
buf
);
//读取内容之后马上写入目标数据源
}
os
.
flush
();
//输出
return
"文件拷贝成功!查看拷贝文件路径:"
+
desFile
.
getPath
();
}
catch
(
FileNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
is
!=
null
)
is
.
close
();
if
(
os
!=
null
)
os
.
close
();
}
return
"文件拷贝失败"
;
}
/**
/**
* 申请ID的数据列表
* 申请ID的数据列表
*
*
...
@@ -114,8 +185,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -114,8 +185,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//PDF模板中定义的文字key,和值的集合
//PDF模板中定义的文字key,和值的集合
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
data
=
new
HashMap
<
String
,
String
>();
//1页
//1页
data
.
put
(
"contactNo"
,
"C-SH-0001"
);
data
.
put
(
"contactNo"
,
second
.
getContractNo
()
);
data
.
put
(
"practitionerNo"
,
"YDSH00127"
);
data
.
put
(
"practitionerNo"
,
second
.
getPractitionerCode
()
);
data
.
put
(
"subsystem"
,
memberShip
.
getSubsystem
());
data
.
put
(
"subsystem"
,
memberShip
.
getSubsystem
());
data
.
put
(
"practitioner"
,
basicInfo
.
getName
());
data
.
put
(
"practitioner"
,
basicInfo
.
getName
());
data
.
put
(
"idNo"
,
basicInfo
.
getIdNo
());
data
.
put
(
"idNo"
,
basicInfo
.
getIdNo
());
...
@@ -130,12 +201,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -130,12 +201,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
data
.
put
(
"firstPartyAddress"
,
firstPartyAddress
);
data
.
put
(
"firstPartyAddress"
,
firstPartyAddress
);
// 设置一些地址
// 设置一些地址
this
.
setSomeAddress
(
data
,
hiringBasicInfoId
);
this
.
setSomeAddress
(
data
,
hiringBasicInfoId
);
Calendar
now
=
Calendar
.
getInstance
();
System
.
out
.
println
(
"----------------合同年月日------------------"
);
System
.
out
.
println
(
"年: "
+
now
.
get
(
Calendar
.
YEAR
));
System
.
out
.
println
(
"月: "
+
(
now
.
get
(
Calendar
.
MONTH
)
+
1
)
+
""
);
System
.
out
.
println
(
"日: "
+
now
.
get
(
Calendar
.
DAY_OF_MONTH
));
Calendar
now
=
Calendar
.
getInstance
();
data
.
put
(
"contactYear"
,
now
.
get
(
Calendar
.
YEAR
)
+
""
);
data
.
put
(
"contactYear"
,
now
.
get
(
Calendar
.
YEAR
)
+
""
);
data
.
put
(
"contactMonth"
,
(
now
.
get
(
Calendar
.
MONTH
)
+
1
)
+
""
);
data
.
put
(
"contactMonth"
,
(
now
.
get
(
Calendar
.
MONTH
)
+
1
)
+
""
);
data
.
put
(
"contactDay"
,
now
.
get
(
Calendar
.
DAY_OF_MONTH
)
+
""
);
data
.
put
(
"contactDay"
,
now
.
get
(
Calendar
.
DAY_OF_MONTH
)
+
""
);
...
@@ -232,7 +299,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -232,7 +299,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
if
(
mentor
!=
null
)
{
if
(
mentor
!=
null
)
{
mentorAddress
.
append
(
mentor
.
getProvinceName
()).
append
(
mentor
.
getCityName
());
mentorAddress
.
append
(
mentor
.
getProvinceName
()).
append
(
mentor
.
getCityName
());
}
}
data
.
put
(
"secondMentorAddress"
,
"上海市浦东新区张杨路560号中融恒瑞国际西楼1706室"
);
data
.
put
(
"secondMentorAddress"
,
mentorAddress
.
toString
()
);
data
.
put
(
"secondMentorMobileNo"
,
mentorMobile
);
data
.
put
(
"secondMentorMobileNo"
,
mentorMobile
);
}
}
...
@@ -369,27 +436,27 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -369,27 +436,27 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
Long
mdDropOptionId
=
memberShip
==
null
?
null
:
memberShip
.
getMdDropOptionId
();
Long
mdDropOptionId
=
memberShip
==
null
?
null
:
memberShip
.
getMdDropOptionId
();
if
(
Long
.
valueOf
(
"30"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"30"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition1"
,
unC
heckFile
);
images
.
put
(
"secondPosition1"
,
c
heckFile
);
return
;
return
;
}
}
if
(
Long
.
valueOf
(
"32"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"32"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition2"
,
unC
heckFile
);
images
.
put
(
"secondPosition2"
,
c
heckFile
);
return
;
return
;
}
}
if
(
Long
.
valueOf
(
"33"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"33"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition3"
,
unC
heckFile
);
images
.
put
(
"secondPosition3"
,
c
heckFile
);
return
;
return
;
}
}
if
(
Long
.
valueOf
(
"34"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"34"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition4"
,
unC
heckFile
);
images
.
put
(
"secondPosition4"
,
c
heckFile
);
return
;
return
;
}
}
if
(
Long
.
valueOf
(
"35"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"35"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition5"
,
unC
heckFile
);
images
.
put
(
"secondPosition5"
,
c
heckFile
);
return
;
return
;
}
}
if
(
Long
.
valueOf
(
"36"
).
equals
(
mdDropOptionId
))
{
if
(
Long
.
valueOf
(
"36"
).
equals
(
mdDropOptionId
))
{
images
.
put
(
"secondPosition6"
,
unC
heckFile
);
images
.
put
(
"secondPosition6"
,
c
heckFile
);
return
;
return
;
}
}
...
@@ -403,7 +470,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -403,7 +470,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
images
.
put
(
"secondPersonalStatement3"
,
checkFile
);
images
.
put
(
"secondPersonalStatement3"
,
checkFile
);
images
.
put
(
"secondPersonalStatement4"
,
checkFile
);
images
.
put
(
"secondPersonalStatement4"
,
checkFile
);
images
.
put
(
"secondPersonalStatement5"
,
checkFile
);
images
.
put
(
"secondPersonalStatement5"
,
checkFile
);
images
.
put
(
"secondPersonalStatement6"
,
c
heckFile
);
images
.
put
(
"secondPersonalStatement6"
,
unC
heckFile
);
}
}
private
void
setIDType
(
Map
<
String
,
String
>
images
,
String
idType
,
String
checkFile
,
String
unCheckFile
)
{
private
void
setIDType
(
Map
<
String
,
String
>
images
,
String
idType
,
String
checkFile
,
String
unCheckFile
)
{
...
@@ -418,7 +485,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -418,7 +485,7 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
return
;
return
;
}
}
if
(
idType
.
indexOf
(
"台胞
照
"
)
>
0
)
{
if
(
idType
.
indexOf
(
"台胞
证
"
)
>
0
)
{
images
.
put
(
"secondIDType2"
,
checkFile
);
images
.
put
(
"secondIDType2"
,
checkFile
);
return
;
return
;
}
}
...
@@ -511,7 +578,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -511,7 +578,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
//准备加盖电子印章的源文件
//准备加盖电子印章的源文件
String
signSourcePDF
=
templateResultPDF
;
String
signSourcePDF
=
templateResultPDF
;
//电子印章文件
//电子印章文件
String
signImage
=
"D:\\pcs12\\上海银盾保险经纪有限公司.png"
;
/*String signImage = "D:\\pcs12\\上海银盾保险经纪有限公司.png";
signImage = PDFConfiguration.getProperty("pdf.signImage");
signImage = PDFConfiguration.getProperty("pdf.signImage");
float x = 450;
float x = 450;
float y = 150;
float y = 150;
...
@@ -521,7 +589,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
...
@@ -521,7 +589,8 @@ public class PractitionerHiringContractServiceImpl implements PractitionerHiring
PDFSign.sign(signResultPDF, password, keyStorePath, signSourcePDF, signImage, x, y);
PDFSign.sign(signResultPDF, password, keyStorePath, signSourcePDF, signImage, x, y);
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}*/
return
signResultPDF
;
return
templateResultPDF
;
}
}
}
}
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringServiceImpl.java
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
service
.
impl
;
package
com
.
yd
.
api
.
practitioner
.
service
.
impl
;
import
com.yd.api.practitioner.service.PractitionerHiringContractService
;
import
com.yd.api.practitioner.service.PractitionerHiringService
;
import
com.yd.api.practitioner.service.PractitionerHiringService
;
import
com.yd.api.practitioner.vo.hiring.*
;
import
com.yd.api.practitioner.vo.hiring.*
;
import
com.yd.api.result.CommonResult
;
import
com.yd.api.result.CommonResult
;
...
@@ -47,6 +48,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
...
@@ -47,6 +48,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private
AclPractitionerHiringContractTermsConfirmsMapper
contractTermsConfirmsMapper
;
private
AclPractitionerHiringContractTermsConfirmsMapper
contractTermsConfirmsMapper
;
@Autowired
@Autowired
private
AclPractitionerHiringApproveRecordsMapper
recordsMapper
;
private
AclPractitionerHiringApproveRecordsMapper
recordsMapper
;
@Autowired
private
PractitionerHiringContractService
hiringContractService
;
@Autowired
private
AclPractitionerMapper
aclPractitionerMapper
;
private
PractitionerHiringDALService
practitionerHiringDalService
;
private
PractitionerHiringDALService
practitionerHiringDalService
;
private
SystemConfigService
systemConfigService
;
private
SystemConfigService
systemConfigService
;
...
@@ -474,14 +479,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
...
@@ -474,14 +479,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
//余下的仅有0.不可审批(未到) 1.可审批两种状态
//余下的仅有0.不可审批(未到) 1.可审批两种状态
//approvalIdentity的参数意义0.既是辅导人又是团队长 1.辅导人 2.团队长
//approvalIdentity的参数意义0.既是辅导人又是团队长 1.辅导人 2.团队长
//当approvalIdentity为0,1时,审批状态为可审批 当为2时判断辅导人是否审批
//当approvalIdentity为0,1时,审批状态为可审批 当为2时判断辅导人是否审批
if
(
approvalIdentity
==
0
||
approvalIdentity
==
1
){
if
(
approvalIdentity
==
0
||
approvalIdentity
==
1
)
{
hiringApproveStatus
=
1L
;
hiringApproveStatus
=
1L
;
hiringApproveStepsSeq
=
1L
;
hiringApproveStepsSeq
=
1L
;
}
else
{
}
else
{
//判断辅导人是否审批,仅需判断hiringApproveRecordsList.isEmpty(),因为辅导人是第一步,团队长为第二步
//判断辅导人是否审批,仅需判断hiringApproveRecordsList.isEmpty(),因为辅导人是第一步,团队长为第二步
if
(
hiringApproveRecordsList
.
isEmpty
())
{
if
(
hiringApproveRecordsList
.
isEmpty
())
{
hiringApproveStatus
=
0L
;
hiringApproveStatus
=
0L
;
}
else
{
}
else
{
hiringApproveStatus
=
1L
;
hiringApproveStatus
=
1L
;
hiringApproveStepsSeq
=
2L
;
hiringApproveStepsSeq
=
2L
;
}
}
...
@@ -497,15 +502,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
...
@@ -497,15 +502,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
List
<
MdPractitionerHiringApproveSteps
>
hiringApproveStepsList
=
systemConfigService
.
findHiringApproveStepsAll
();
List
<
MdPractitionerHiringApproveSteps
>
hiringApproveStepsList
=
systemConfigService
.
findHiringApproveStepsAll
();
List
<
AclPractitionerHiringApproveRecords
>
hiringApproveRecordsList
=
new
ArrayList
<>();
List
<
AclPractitionerHiringApproveRecords
>
hiringApproveRecordsList
=
new
ArrayList
<>();
//当approvalIdentity=0时需要保存两条记录
//当approvalIdentity=0时需要保存两条记录
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
1L
){
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
1L
)
{
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
1
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
1
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(!
hasStepSeq
)
{
if
(!
hasStepSeq
)
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
return
responseVO
;
return
responseVO
;
}
}
}
}
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
2L
){
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
2L
)
{
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
2
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
2
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(!
hasStepSeq
)
{
if
(!
hasStepSeq
)
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
return
responseVO
;
return
responseVO
;
...
@@ -678,6 +683,65 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
...
@@ -678,6 +683,65 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
return
resp
;
return
resp
;
}
}
@Override
public
GeneratePDFResponseVO
generatePDF
(
GeneratePDFRequestVO
requestVO
)
{
GeneratePDFResponseVO
resp
=
new
GeneratePDFResponseVO
();
try
{
Long
hiringBasicInfoId
=
requestVO
.
getHiringBasicInfoId
();
Long
practitionerId
=
requestVO
.
getPractitionerId
();
if
(
hiringBasicInfoId
==
null
)
{
resp
.
setCommonResult
(
new
CommonResult
(
true
,
"此经纪人无电子合同"
));
return
resp
;
}
AclPractitioner
practitioner
=
aclPractitionerMapper
.
selectByPrimaryKey
(
practitionerId
);
String
practitionerCode
=
practitioner
==
null
?
null
:
practitioner
.
getPractitionerCode
();
String
contractNo
=
practitioner
==
null
?
null
:
practitioner
.
getContractNo
();
if
(
StringUtils
.
isEmpty
(
practitionerCode
)
||
StringUtils
.
isEmpty
(
contractNo
))
{
resp
.
setCommonResult
(
new
CommonResult
(
true
,
"内部编号和员工合同编号不能为空,请注意保存"
));
return
resp
;
}
String
contractOssPath
=
hiringContractService
.
generatePractitionerContract
(
practitionerCode
,
contractNo
,
hiringBasicInfoId
);
//4、经纪人表生成经纪人记录ag_acl_practitioner,ag_acl_practitioner.contract_oss_path
// 经纪人经纪人类型级别定义表ag_acl_practitioner_setting
AclPractitioner
updateObj
=
new
AclPractitioner
();
updateObj
.
setId
(
practitionerId
);
updateObj
.
setContractOssPath
(
contractOssPath
);
aclPractitionerMapper
.
updateByPrimaryKeySelective
(
updateObj
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
resp
.
setContractOssPath
(
contractOssPath
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
}
return
resp
;
}
@Override
public
QueryPractitionerInfoResponseVO
queryPractitionerInfo
(
QueryPractitionerInfoRequestVO
requestVO
)
{
QueryPractitionerInfoResponseVO
resp
=
new
QueryPractitionerInfoResponseVO
();
try
{
Long
practitionerId
=
requestVO
.
getPractitionerId
();
if
(
practitionerId
==
null
)
{
resp
.
setCommonResult
(
new
CommonResult
(
false
,
"practitionerId不能为空"
));
}
else
{
AclPractitioner
practitioner
=
aclPractitionerMapper
.
selectByPrimaryKey
(
practitionerId
);
resp
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
resp
.
setPractitioner
(
practitioner
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
resp
.
setCommonResult
(
new
CommonResult
(
false
,
e
.
getMessage
()));
}
return
resp
;
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
private
boolean
addStepToList
(
HiringApproveRequestVO
requestVO
,
private
boolean
addStepToList
(
HiringApproveRequestVO
requestVO
,
int
stepSeq
,
int
stepSeq
,
...
@@ -731,7 +795,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
...
@@ -731,7 +795,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private
String
generateKey
(
int
targetUseFor
)
{
private
String
generateKey
(
int
targetUseFor
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyMMdd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyMMdd"
);
return
targetUseFor
+
sdf
.
format
(
new
Date
());
return
targetUseFor
+
sdf
.
format
(
new
Date
());
}
}
}
}
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/
Hiring
PDFRequestVO.java
→
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/
Generate
PDFRequestVO.java
View file @
c78fc1fe
...
@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.hiring;
...
@@ -3,7 +3,7 @@ package com.yd.api.practitioner.vo.hiring;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
public
class
Hiring
PDFRequestVO
{
public
class
Generate
PDFRequestVO
{
/**
/**
* 经纪人id
* 经纪人id
*/
*/
...
...
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/GeneratePDFResponseVO.java
0 → 100644
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
vo
.
hiring
;
import
com.yd.api.result.CommonResult
;
import
lombok.Data
;
@Data
public
class
GeneratePDFResponseVO
{
private
CommonResult
commonResult
;
private
String
contractOssPath
;
}
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/QueryPractitionerInfoRequestVO.java
0 → 100644
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
vo
.
hiring
;
import
lombok.Data
;
@Data
public
class
QueryPractitionerInfoRequestVO
{
/**
* 经纪人id
*/
private
Long
practitionerId
;
}
yd-api/src/main/java/com/yd/api/practitioner/vo/hiring/QueryPractitionerInfoResponseVO.java
0 → 100644
View file @
c78fc1fe
package
com
.
yd
.
api
.
practitioner
.
vo
.
hiring
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.customer.AclPractitioner
;
import
lombok.Data
;
@Data
public
class
QueryPractitionerInfoResponseVO
{
private
CommonResult
commonResult
;
private
AclPractitioner
practitioner
;
}
yd-api/src/main/java/com/yd/dal/entity/customer/AclPractitioner.java
View file @
c78fc1fe
...
@@ -202,5 +202,20 @@ public class AclPractitioner implements Serializable {
...
@@ -202,5 +202,20 @@ public class AclPractitioner implements Serializable {
*/
*/
private
Integer
gender
;
private
Integer
gender
;
/**
* 经纪人合同号
*/
private
String
contractNo
;
/**
* 经纪人PDF合同地址
*/
private
String
contractOssPath
;
/**
* 经纪人报聘信息表id
*/
private
String
hiringBasicInfoId
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclPractitionerMapper.xml
View file @
c78fc1fe
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
<result
column=
"mentor_id"
jdbcType=
"BIGINT"
property=
"mentorId"
/>
<result
column=
"mentor_id"
jdbcType=
"BIGINT"
property=
"mentorId"
/>
<result
column=
"introducer_id"
jdbcType=
"BIGINT"
property=
"introducerId"
/>
<result
column=
"introducer_id"
jdbcType=
"BIGINT"
property=
"introducerId"
/>
<result
column=
"gender"
jdbcType=
"INTEGER"
property=
"gender"
/>
<result
column=
"gender"
jdbcType=
"INTEGER"
property=
"gender"
/>
<result
column=
"contract_no"
jdbcType=
"VARCHAR"
property=
"contractNo"
/>
<result
column=
"contract_oss_path"
jdbcType=
"VARCHAR"
property=
"contractOssPath"
/>
<result
column=
"hiring_basic_info_id"
jdbcType=
"BIGINT"
property=
"hiringBasicInfoId"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code,
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code,
...
@@ -48,7 +51,8 @@
...
@@ -48,7 +51,8 @@
practitioner_reg_company, effective_start_date, effective_end_date, remark, customer_id,
practitioner_reg_company, effective_start_date, effective_end_date, remark, customer_id,
employee_no, is_active, created_at, created_by, updated_at, updated_by, province_id,
employee_no, is_active, created_at, created_by, updated_at, updated_by, province_id,
province_name, city_id, city_name, cert_list, bio_intro, wechat_id, qq_id, is_profile_show,
province_name, city_id, city_name, cert_list, bio_intro, wechat_id, qq_id, is_profile_show,
is_name_show, is_mobile_show, education_level, mentor_id, introducer_id, gender
is_name_show, is_mobile_show, education_level, mentor_id, introducer_id, gender,
contract_no, contract_oss_path, hiring_basic_info_id
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -442,6 +446,15 @@
...
@@ -442,6 +446,15 @@
<if
test=
"gender != null"
>
<if
test=
"gender != null"
>
gender = #{gender,jdbcType=INTEGER},
gender = #{gender,jdbcType=INTEGER},
</if>
</if>
<if
test=
"contractNo != null"
>
contract_no = #{contractNo,jdbcType=INTEGER},
</if>
<if
test=
"contractOssPath != null"
>
contract_oss_path = #{contractOssPath,jdbcType=INTEGER},
</if>
<if
test=
"hiringBasicInfoId != null"
>
hiring_basic_info_id = #{hiringBasicInfoId,jdbcType=INTEGER},
</if>
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
...
...
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