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
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
268 additions
and
62 deletions
+268
-62
yd-api/src/main/java/com/yd/api/practitioner/PractitionerHiringController.java
+20
-13
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
+77
-13
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 {
@Autowired
private
PractitionerHiringService
practitionerHiringService
;
@Autowired
private
PractitionerHiringContractService
hiringContractService
;
/**
* 保存报聘经纪人组织关系
...
...
@@ -236,19 +235,26 @@ public class PractitionerHiringController {
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
"/
hiring
PDF"
)
public
Object
hiringApprove
(
@RequestBody
Hiring
PDFRequestVO
requestVO
){
@RequestMapping
(
"/
generate
PDF"
)
public
Object
generatePDF
(
@RequestBody
Generate
PDFRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
try
{
// PractitionerPDFTest.main(null);
Long
hiringBasicInfoId
=
requestVO
.
getHiringBasicInfoId
();
hiringContractService
.
generatePractitionerContract
(
hiringBasicInfoId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
GeneratePDFResponseVO
responseVO
=
practitionerHiringService
.
generatePDF
(
requestVO
);
result
.
addResult
(
responseVO
);
result
.
setData
(
responseVO
);
return
result
;
}
/**
* 报聘成功后查看经纪人信息
* @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
;
}
}
\ 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
;
import
com.yd.api.practitioner.vo.hiring.GeneratePDFRequestVO
;
import
java.util.Map
;
public
interface
PractitionerHiringContractService
{
String
generatePractitionerContract
(
Long
hiringBasicInfoId
)
;
String
generatePractitionerContract
(
String
practitionerNO
,
String
contractNo
,
Long
hiringBasicInfoId
)
throws
Exception
;
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 {
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
This diff is collapsed.
Click to expand it.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerHiringServiceImpl.java
View file @
c78fc1fe
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.vo.hiring.*
;
import
com.yd.api.result.CommonResult
;
...
...
@@ -47,6 +48,10 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private
AclPractitionerHiringContractTermsConfirmsMapper
contractTermsConfirmsMapper
;
@Autowired
private
AclPractitionerHiringApproveRecordsMapper
recordsMapper
;
@Autowired
private
PractitionerHiringContractService
hiringContractService
;
@Autowired
private
AclPractitionerMapper
aclPractitionerMapper
;
private
PractitionerHiringDALService
practitionerHiringDalService
;
private
SystemConfigService
systemConfigService
;
...
...
@@ -403,12 +408,12 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
/**
* ydLife经纪人审批详情查询接口
*
基本信息查询同AGMS一致,代码直接copy过来的,以免后期AGMS展示数据与ydLife不一致,修改麻烦
* 基本信息查询同AGMS一致,代码直接copy过来的,以免后期AGMS展示数据与ydLife不一致,修改麻烦
* 有关"查询是否可进行审批操作"说明
*
进行到经纪人审批详情查询的经纪人都有权限审批
*
判断相对AGMS简单,因为一个经纪人审批和辅导员/团队长是一对一,不像AGMS为一对多
*
所以只要需要判断ag_md_practitioner_hiring_approve_steps是否有practitionerId即可判断是否审批
*
ydLife审批逻辑不可变更,辅导人审批->团队长审批
* 进行到经纪人审批详情查询的经纪人都有权限审批
* 判断相对AGMS简单,因为一个经纪人审批和辅导员/团队长是一对一,不像AGMS为一对多
* 所以只要需要判断ag_md_practitioner_hiring_approve_steps是否有practitionerId即可判断是否审批
* ydLife审批逻辑不可变更,辅导人审批->团队长审批
*/
@Override
public
HiringDetailQueryResponseVO
detailQuery
(
HiringDetailQueryRequestVO
requestVO
)
{
...
...
@@ -474,14 +479,14 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
//余下的仅有0.不可审批(未到) 1.可审批两种状态
//approvalIdentity的参数意义0.既是辅导人又是团队长 1.辅导人 2.团队长
//当approvalIdentity为0,1时,审批状态为可审批 当为2时判断辅导人是否审批
if
(
approvalIdentity
==
0
||
approvalIdentity
==
1
){
if
(
approvalIdentity
==
0
||
approvalIdentity
==
1
)
{
hiringApproveStatus
=
1L
;
hiringApproveStepsSeq
=
1L
;
}
else
{
}
else
{
//判断辅导人是否审批,仅需判断hiringApproveRecordsList.isEmpty(),因为辅导人是第一步,团队长为第二步
if
(
hiringApproveRecordsList
.
isEmpty
())
{
hiringApproveStatus
=
0L
;
}
else
{
}
else
{
hiringApproveStatus
=
1L
;
hiringApproveStepsSeq
=
2L
;
}
...
...
@@ -497,15 +502,15 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
List
<
MdPractitionerHiringApproveSteps
>
hiringApproveStepsList
=
systemConfigService
.
findHiringApproveStepsAll
();
List
<
AclPractitionerHiringApproveRecords
>
hiringApproveRecordsList
=
new
ArrayList
<>();
//当approvalIdentity=0时需要保存两条记录
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
1L
){
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
1
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
1L
)
{
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
1
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(!
hasStepSeq
)
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
return
responseVO
;
}
}
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
2L
){
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
2
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(
approvalIdentity
==
0L
||
approvalIdentity
==
2L
)
{
boolean
hasStepSeq
=
addStepToList
(
requestVO
,
2
,
hiringApproveStepsList
,
hiringApproveRecordsList
);
if
(!
hasStepSeq
)
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830025"
)));
return
responseVO
;
...
...
@@ -678,6 +683,65 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
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"
)
private
boolean
addStepToList
(
HiringApproveRequestVO
requestVO
,
int
stepSeq
,
...
...
@@ -731,7 +795,7 @@ public class PractitionerHiringServiceImpl implements PractitionerHiringService
private
String
generateKey
(
int
targetUseFor
)
{
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;
import
lombok.Data
;
@Data
public
class
Hiring
PDFRequestVO
{
public
class
Generate
PDFRequestVO
{
/**
* 经纪人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 {
*/
private
Integer
gender
;
/**
* 经纪人合同号
*/
private
String
contractNo
;
/**
* 经纪人PDF合同地址
*/
private
String
contractOssPath
;
/**
* 经纪人报聘信息表id
*/
private
String
hiringBasicInfoId
;
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 @@
<result
column=
"mentor_id"
jdbcType=
"BIGINT"
property=
"mentorId"
/>
<result
column=
"introducer_id"
jdbcType=
"BIGINT"
property=
"introducerId"
/>
<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>
<sql
id=
"Base_Column_List"
>
id, insurer_id, insurer_branch_id, dept_id, subordinate_system_id, practitioner_code,
...
...
@@ -48,7 +51,8 @@
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,
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>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -442,6 +446,15 @@
<if
test=
"gender != null"
>
gender = #{gender,jdbcType=INTEGER},
</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>
where id = #{id,jdbcType=BIGINT}
</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