Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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
xingmin
yd-csf
Commits
a360bd18
Commit
a360bd18
authored
Dec 31, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复29
parent
290c4d3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
37 deletions
+41
-37
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
+41
-37
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
View file @
a360bd18
...
...
@@ -41,14 +41,14 @@ import java.util.*;
import
java.util.stream.Collectors
;
/**
* @author Zhang Jianan
* @description 针对表【policy(保单表)】的数据库操作Service实现
* @createDate 2025-09-18 15:07:25
*/
* @author Zhang Jianan
* @description 针对表【policy(保单表)】的数据库操作Service实现
* @createDate 2025-09-18 15:07:25
*/
@Service
@Slf4j
public
class
PolicyServiceImpl
extends
ServiceImpl
<
PolicyMapper
,
Policy
>
implements
PolicyService
{
implements
PolicyService
{
@Resource
private
PolicyAdditionalService
policyAdditionalService
;
...
...
@@ -134,7 +134,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
if
(
CollUtil
.
isNotEmpty
(
apiProductPlanAdditionalInfoDtoList
))
{
// 转换为实体类
List
<
PolicyAdditional
>
policyAdditionalList
=
apiProductPlanAdditionalInfoDtoList
.
stream
().
map
(
additionalDto
->
{
PolicyAdditional
policyAdditional
=
new
PolicyAdditional
();
PolicyAdditional
policyAdditional
=
new
PolicyAdditional
();
BeanUtils
.
copyProperties
(
additionalDto
,
policyAdditional
);
policyAdditional
.
setPolicyBizId
(
policyBizId
);
...
...
@@ -154,25 +154,27 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
/**
* 查询列表
*
* @param dto
* @return
*/
@Override
public
List
<
Policy
>
queryList
(
QueryPolicyDto
dto
)
{
List
<
Policy
>
list
=
baseMapper
.
selectList
(
new
LambdaQueryWrapper
<
Policy
>()
.
in
(!
CollectionUtils
.
isEmpty
(
dto
.
getPolicyNoList
()),
Policy:
:
getPolicyNo
,
dto
.
getPolicyNoList
())
.
in
(!
CollectionUtils
.
isEmpty
(
dto
.
getPolicyNoList
()),
Policy:
:
getPolicyNo
,
dto
.
getPolicyNoList
())
);
return
list
;
}
/**
* 根据保单号查询单个对象
*
* @param policyNo
* @return
*/
@Override
public
Policy
queryOne
(
String
policyNo
)
{
return
this
.
getOne
(
new
LambdaQueryWrapper
<
Policy
>().
eq
(
Policy:
:
getPolicyNo
,
policyNo
).
last
(
" limit 1 "
));
return
this
.
getOne
(
new
LambdaQueryWrapper
<
Policy
>().
eq
(
Policy:
:
getPolicyNo
,
policyNo
).
last
(
" limit 1 "
));
}
@Override
...
...
@@ -195,13 +197,12 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
return
CollUtil
.
newArrayList
();
}
try
{
log
.
info
(
JSONUtil
.
parseObj
(
result
).
toString
());
log
.
info
(
"Feign返回数据: {}"
,
JSONUtil
.
parseObj
(
result
).
toString
());
// 直接使用Map来处理数据,避免复杂的类型转换
Object
data
=
result
.
getData
();
List
<
Map
<
String
,
Object
>>
policyProductInfoList
=
new
ArrayList
<>();
// 将数据转换为JSONObject进行解析
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
data
);
...
...
@@ -214,6 +215,9 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
Map
<
String
,
Object
>
infoMap
=
new
HashMap
<>();
infoMap
.
put
(
"productLaunchBizId"
,
record
.
getStr
(
"productLaunchBizId"
));
infoMap
.
put
(
"productName"
,
record
.
getStr
(
"productName"
));
infoMap
.
put
(
"title"
,
record
.
getStr
(
"title"
));
infoMap
.
put
(
"shortTitle"
,
record
.
getStr
(
"shortTitle"
));
infoMap
.
put
(
"status"
,
record
.
getStr
(
"status"
));
// 解析自定义属性
JSONArray
attributeSettingArray
=
record
.
getJSONArray
(
"apiAttributeSettingDtoList"
);
...
...
@@ -224,12 +228,13 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
policyProductInfoList
.
add
(
infoMap
);
}
}
log
.
info
(
"解析后的保单产品信息: {}"
,
JSONUtil
.
toJsonStr
(
policyProductInfoList
));
return
policyProductInfoList
;
}
catch
(
Exception
e
)
{
log
.
error
(
"解析Feign返回数据失败: {}"
,
e
.
getMessage
(),
e
);
return
CollUtil
.
newArrayList
();
}
return
null
;
}
/**
...
...
@@ -242,33 +247,32 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
for
(
int
i
=
0
;
i
<
attributeSettingArray
.
size
();
i
++)
{
JSONObject
attribute
=
attributeSettingArray
.
getJSONObject
(
i
);
// 根据实际字段名设置属性
// infoMap.put("insuranceCompanyBizId", attribute.getStr("fieldName")
);
// infoMap.put("insuranceCompany", attribute.getStr("fieldName"));
//
infoMap.put("reconciliationCompanyBizId", attribute.getStr("fieldName"));
// infoMap.put("reconciliationCompany", attribute.getStr("fieldName"));
}
}
/**
* 从附加险列表中获取保险公司业务ID
*
* @param apiAttributeSettingDtoList
* @param infoMap
*/
private
void
getInfo
(
List
<
ApiAttributeSettingDto
>
apiAttributeSettingDtoList
,
Map
<
String
,
Object
>
infoMap
)
{
if
(
CollUtil
.
isEmpty
(
apiAttributeSettingDtoList
))
{
return
;
}
// insuranceCompanyBizId
// insuranceCompany
// reconciliationCompanyBizId
// reconciliationCompany
for
(
ApiAttributeSettingDto
dto
:
apiAttributeSettingDtoList
)
{
String
name
=
attribute
.
getStr
(
"name"
);
String
value
=
attribute
.
getStr
(
"value"
);
//
根据属性名称设置对应的字段
switch
(
name
)
{
case
"保险公司"
:
infoMap
.
put
(
"insuranceCompany"
,
value
);
infoMap
.
put
(
"insuranceCompanyBizId"
,
attribute
.
getStr
(
"fieldValueBizId"
));
break
;
case
"对账公司"
:
infoMap
.
put
(
"reconciliationCompany"
,
value
);
infoMap
.
put
(
"reconciliationCompanyBizId"
,
attribute
.
getStr
(
"fieldValueBizId"
));
break
;
case
"产品计划类型"
:
infoMap
.
put
(
"productPlanType"
,
value
);
break
;
case
"是否区分吸烟"
:
infoMap
.
put
(
"isSmokingDistinguish"
,
value
);
break
;
default
:
// 其他自定义属性
infoMap
.
put
(
name
,
value
);
break
;
}
}
}
}
...
...
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