Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
a211f529
Commit
a211f529
authored
Dec 12, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:ekp推送接口
parent
a7fdb14e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
204 additions
and
4 deletions
+204
-4
EkpInsuranceProperties.java
...cloud/plus/v1/yifu/ekp/config/EkpInsuranceProperties.java
+15
-1
EkpInsuranceUtil.java
...om/yifu/cloud/plus/v1/yifu/ekp/util/EkpInsuranceUtil.java
+47
-1
ekpInsuranceConfig.properties
...mmon-ekp/src/main/resources/ekpInsuranceConfig.properties
+5
-1
EkpUpdateParam.java
...yifu/cloud/plus/v1/yifu/insurances/vo/EkpUpdateParam.java
+56
-0
TInsuranceDetailServiceImpl.java
...s/service/insurance/impl/TInsuranceDetailServiceImpl.java
+81
-1
No files found.
yifu-common/yifu-common-ekp/src/main/java/com/yifu/cloud/plus/v1/yifu/ekp/config/EkpInsuranceProperties.java
View file @
a211f529
...
...
@@ -26,5 +26,19 @@ public class EkpInsuranceProperties {
String
insuranceLoginName
;
String
insuranceFocSubject
;
String
insuranceDocSubject
;
/**
* ekp修改接口描述
*/
String
insuranceUpdateDocSubject
;
/**
* ekp修改FdModelId
*/
String
insuranceUpdateFdModelId
;
/**
* ekp修改FdFlowId
*/
String
insuranceUpdateFdFlowId
;
}
yifu-common/yifu-common-ekp/src/main/java/com/yifu/cloud/plus/v1/yifu/ekp/util/EkpInsuranceUtil.java
View file @
a211f529
...
...
@@ -3,8 +3,10 @@ package com.yifu.cloud.plus.v1.yifu.ekp.util;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.ekp.config.EkpInsuranceProperties
;
import
com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants
;
import
com.yifu.cloud.plus.v1.yifu.ekp.vo.EKPInsurancePushParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInteractiveParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpUpdateParam
;
import
com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceSettlePushParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -44,7 +46,7 @@ public class EkpInsuranceUtil {
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
wholeForm
.
add
(
"docSubject"
,
ekpInsuranceProperties
.
getInsurance
F
ocSubject
());
wholeForm
.
add
(
"docSubject"
,
ekpInsuranceProperties
.
getInsurance
D
ocSubject
());
wholeForm
.
add
(
"docCreator"
,
"{\"LoginName\":\"admin\"}"
);
wholeForm
.
add
(
"docStatus"
,
ekpInsuranceProperties
.
getInsuranceDocStatus
());
wholeForm
.
add
(
"fdModelId"
,
ekpInsuranceProperties
.
getInsuranceFdModelId
());
...
...
@@ -73,6 +75,50 @@ public class EkpInsuranceUtil {
}
}
/**
* 商险修改信息推送ekp
*
* @author licancan
* @param param
* @return {@link String}
*/
public
String
sendUpdateToEkp
(
EkpUpdateParam
param
){
log
.
info
(
"推送EKP开始--商险修改"
);
RestTemplate
yourRestTemplate
=
new
RestTemplate
();
try
{
String
formValues
=
new
ObjectMapper
().
writeValueAsString
(
param
);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap
<
String
,
Object
>
wholeForm
=
new
LinkedMultiValueMap
<>();
wholeForm
.
add
(
"docSubject"
,
ekpInsuranceProperties
.
getInsuranceUpdateDocSubject
());
wholeForm
.
add
(
"docCreator"
,
"{\"LoginName\":\"admin\"}"
);
wholeForm
.
add
(
"docStatus"
,
ekpInsuranceProperties
.
getInsuranceDocStatus
());
wholeForm
.
add
(
"fdModelId"
,
ekpInsuranceProperties
.
getInsuranceUpdateFdModelId
());
wholeForm
.
add
(
"fdFlowId"
,
ekpInsuranceProperties
.
getInsuranceUpdateFdFlowId
());
wholeForm
.
add
(
"formValues"
,
formValues
);
log
.
info
(
"wholeForm:"
+
wholeForm
);
HttpHeaders
headers
=
new
HttpHeaders
();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers
.
setContentType
(
MediaType
.
MULTIPART_FORM_DATA
);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
entity
=
new
HttpEntity
<
MultiValueMap
<
String
,
Object
>>(
wholeForm
,
headers
);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity
<
String
>
obj
=
yourRestTemplate
.
exchange
(
ekpInsuranceProperties
.
getInsuranceUrl
(),
HttpMethod
.
POST
,
entity
,
String
.
class
);
String
body
=
obj
.
getBody
();
if
(
StringUtils
.
isBlank
(
body
)){
log
.
error
(
EkpConstants
.
SEND_FAILED
);
return
null
;
}
else
{
log
.
info
(
EkpConstants
.
SEND_SUCCESS
+
body
);
return
body
;
}
}
catch
(
Exception
e
){
log
.
error
(
EkpConstants
.
SEND_FAILED
+
":"
,
e
);
return
null
;
}
}
/**
* 将类转换成EKP要求的格式
*
...
...
yifu-common/yifu-common-ekp/src/main/resources/ekpInsuranceConfig.properties
View file @
a211f529
...
...
@@ -4,6 +4,10 @@ insurance.insuranceFdModelId=181d73279372e5a55438a47d7436ab7e
insurance.insuranceFdFlowId
=
18267f206233f29cbd3c5ee425c9408a
insurance.insuranceDocStatus
=
20
insurance.insuranceLoginName
=
admin
insurance.insuranceFocSubject
=
\u
85AA
\u
8D44
\u
8BA2
\u5355\u
660E
\u
7EC6
\u6570\u
636E
\u
63A5
\u
53E3
insurance.insuranceDocSubject
=
\u5546\u9669\u
63a8
\u9001\u0065\u
006b
\u0070\u
63a5
\u
53e3
insurance.insuranceUpdateDocSubject
=
\u5546\u9669\u
63a8
\u9001\u0065\u
006b
\u0070\u
4fee
\u6539\u
63a5
\u
53e3
insurance.insuranceUpdateFdModelId
=
1850416f69cc813f128474e478b83794
insurance.insuranceUpdateFdFlowId
=
185041a4d264c3892a0543e43be925eb
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/vo/EkpUpdateParam.java
0 → 100644
View file @
a211f529
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @author licancan
* @description ekp更新请求参数
* @date 2022-12-12 14:09:35
*/
@Data
public
class
EkpUpdateParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
581367013151512283L
;
/**
* 保单开始时间
**/
private
String
fd_3b5bf02d3b8fc4
;
/**
* 保单结束时间
**/
private
String
fd_3b5bf02e1d47cc
;
/**
* 投保类型
*/
private
String
fd_3b5bf02fa14596
;
/**
* 发票号
*/
private
String
fd_3b5bf030ab1a56
;
/**
* 购买标准
*/
private
String
fd_3b5bf031b52314
;
/**
* 商险ID
*/
private
String
fd_3b5bf032d7a822
;
/**
* 商险变更ID
*/
private
String
fd_3b5bf033da86b2
;
/**
* 变更记录
*/
private
String
fd_3b5bf0b7b4c058
;
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceDetailServiceImpl.java
View file @
a211f529
...
...
@@ -54,6 +54,7 @@ import java.math.RoundingMode;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.ThreadPoolExecutor
;
...
...
@@ -2049,13 +2050,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//设置发票号
detail
.
setInvoiceNo
(
success
.
getInvoiceNo
());
detailList
.
add
(
detail
);
//推送修改信息
EkpUpdateParam
ekpUpdateParam
=
new
EkpUpdateParam
();
ekpUpdateParam
.
setFd_3b5bf02d3b8fc4
(
success
.
getPolicyStart
());
ekpUpdateParam
.
setFd_3b5bf02e1d47cc
(
success
.
getPolicyEnd
());
ekpUpdateParam
.
setFd_3b5bf02fa14596
(
getBuyType
(
detail
.
getBuyType
()));
ekpUpdateParam
.
setFd_3b5bf030ab1a56
(
success
.
getInvoiceNo
());
ekpUpdateParam
.
setFd_3b5bf031b52314
(
detail
.
getBuyStandard
());
ekpUpdateParam
.
setFd_3b5bf032d7a822
(
detail
.
getId
());
ekpUpdateParam
.
setFd_3b5bf0b7b4c058
(
"操作人:"
+
user
.
getNickname
()
+
";操作时间:"
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
))
+
";变更前发票号:"
+
detail
.
getInvoiceNo
()
+
";变更后发票号:"
+
success
.
getInvoiceNo
());
eKPInsuranceUtil
.
sendUpdateToEkp
(
ekpUpdateParam
);
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
detailList
)){
this
.
updateBatchById
(
detailList
);
//todo 推给EKP
}
//操作记录
...
...
@@ -2066,6 +2076,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return
R
.
ok
(
operateList
,
InsurancesConstants
.
OPERATE_SUCCESS
);
}
/**
* 购买类型转换
*
* @author licancan
* @param buyType
* @return {@link String}
*/
private
String
getBuyType
(
Integer
buyType
){
String
result
;
switch
(
buyType
){
case
1
:
result
=
"新增"
;
break
;
case
3
:
result
=
"批增"
;
break
;
case
4
:
result
=
"替换"
;
break
;
default
:
result
=
""
;
}
return
result
;
}
/**
* 已投保信息修改
*
...
...
@@ -2116,6 +2151,26 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//变更记录
tBusinessOperateService
.
saveModificationRecord
(
detail
.
getId
(),
oldDetail
,
detail
,
success
.
getReason
());
//推送修改信息
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"操作人:"
+
user
.
getNickname
()
+
";操作时间:"
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
if
(!
detail
.
getPolicyStart
().
toString
().
equals
(
success
.
getPolicyStart
())){
sb
.
append
(
";变更前保单开始时间:"
+
detail
.
getPolicyStart
()
+
";变更后保单开始时间:"
+
success
.
getPolicyStart
());
}
if
(!
detail
.
getPolicyEnd
().
toString
().
equals
(
success
.
getPolicyEnd
())){
sb
.
append
(
";变更前保单结束时间:"
+
detail
.
getPolicyEnd
()
+
";变更后保单结束时间:"
+
success
.
getPolicyEnd
());
}
if
(!
detail
.
getBuyType
().
equals
(
success
.
getBuyType
())){
sb
.
append
(
";变更前投保类型:"
+
getBuyType
(
detail
.
getBuyType
())
+
";变更后投保类型:"
+
getBuyType
(
success
.
getBuyType
()));
}
EkpUpdateParam
ekpUpdateParam
=
new
EkpUpdateParam
();
ekpUpdateParam
.
setFd_3b5bf02d3b8fc4
(
success
.
getPolicyStart
());
ekpUpdateParam
.
setFd_3b5bf02e1d47cc
(
success
.
getPolicyEnd
());
ekpUpdateParam
.
setFd_3b5bf02fa14596
(
getBuyType
(
success
.
getBuyType
()));
ekpUpdateParam
.
setFd_3b5bf031b52314
(
detail
.
getBuyStandard
());
ekpUpdateParam
.
setFd_3b5bf032d7a822
(
detail
.
getId
());
ekpUpdateParam
.
setFd_3b5bf0b7b4c058
(
sb
.
toString
());
eKPInsuranceUtil
.
sendUpdateToEkp
(
ekpUpdateParam
);
}
}
...
...
@@ -2140,6 +2195,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public
R
<
String
>
updateInsuranceInsuredById
(
InsuranceInsuredDetailParam
param
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
user
==
null
||
Common
.
isEmpty
(
user
.
getId
()))
{
return
R
.
failed
(
CommonConstants
.
PLEASE_LOG_IN
);
}
if
(
StringUtils
.
isBlank
(
param
.
getId
())){
R
.
failed
(
InsurancesConstants
.
ID_IS_EMPTY
);
}
...
...
@@ -2185,7 +2244,28 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if
(
Objects
.
nonNull
(
param
.
getBuyType
())){
byId
.
setBuyType
(
param
.
getBuyType
());
}
//变更记录
tBusinessOperateService
.
saveModificationRecord
(
byId
.
getId
(),
old
,
byId
,
param
.
getReason
());
//推送修改信息
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"操作人:"
+
user
.
getNickname
()
+
";操作时间:"
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)));
if
(!
byId
.
getPolicyStart
().
toString
().
equals
(
param
.
getPolicyStart
())){
sb
.
append
(
";变更前保单开始时间:"
+
byId
.
getPolicyStart
()
+
";变更后保单开始时间:"
+
param
.
getPolicyStart
());
}
if
(!
byId
.
getPolicyEnd
().
toString
().
equals
(
param
.
getPolicyEnd
())){
sb
.
append
(
";变更前保单结束时间:"
+
byId
.
getPolicyEnd
()
+
";变更后保单结束时间:"
+
param
.
getPolicyEnd
());
}
if
(!
byId
.
getBuyType
().
equals
(
param
.
getBuyType
())){
sb
.
append
(
";变更前投保类型:"
+
getBuyType
(
byId
.
getBuyType
())
+
";变更后投保类型:"
+
getBuyType
(
param
.
getBuyType
()));
}
EkpUpdateParam
ekpUpdateParam
=
new
EkpUpdateParam
();
ekpUpdateParam
.
setFd_3b5bf02d3b8fc4
(
param
.
getPolicyStart
());
ekpUpdateParam
.
setFd_3b5bf02e1d47cc
(
param
.
getPolicyEnd
());
ekpUpdateParam
.
setFd_3b5bf02fa14596
(
getBuyType
(
param
.
getBuyType
()));
ekpUpdateParam
.
setFd_3b5bf031b52314
(
byId
.
getBuyStandard
());
ekpUpdateParam
.
setFd_3b5bf032d7a822
(
byId
.
getId
());
ekpUpdateParam
.
setFd_3b5bf0b7b4c058
(
sb
.
toString
());
eKPInsuranceUtil
.
sendUpdateToEkp
(
ekpUpdateParam
);
this
.
updateById
(
byId
);
return
R
.
ok
(
InsurancesConstants
.
OPERATE_SUCCESS
);
}
...
...
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