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
9f41992f
Commit
9f41992f
authored
Jan 05, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复53
parent
94c76e8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
21 deletions
+38
-21
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCommissionController.java
+3
-2
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyService.java
+5
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
+30
-18
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiCommissionController.java
View file @
9f41992f
...
@@ -149,7 +149,7 @@ public class ApiCommissionController {
...
@@ -149,7 +149,7 @@ public class ApiCommissionController {
.
eq
(
Commission:
:
getReconciliationYearMonth
,
reconciliationYearMonth
));
.
eq
(
Commission:
:
getReconciliationYearMonth
,
reconciliationYearMonth
));
// 数据处理
// 数据处理
List
<
Commission
>
entities
=
processData
(
dataList
,
loginUserId
);
List
<
Commission
>
entities
=
processData
(
dataList
,
loginUserId
,
reconciliationYearMonth
);
// // 转换为 VO
// // 转换为 VO
// List<CommissionVO> commissionVOList = commissionService.getCommissionList(entities);
// List<CommissionVO> commissionVOList = commissionService.getCommissionList(entities);
...
@@ -209,12 +209,13 @@ public class ApiCommissionController {
...
@@ -209,12 +209,13 @@ public class ApiCommissionController {
/**
/**
* 1.处理导入的数据
* 1.处理导入的数据
*/
*/
private
List
<
Commission
>
processData
(
List
<
CommissionExcelDTO
>
dataList
,
String
loginUserId
)
{
private
List
<
Commission
>
processData
(
List
<
CommissionExcelDTO
>
dataList
,
String
loginUserId
,
String
reconciliationYearMonth
)
{
List
<
Commission
>
entities
=
new
ArrayList
<>();
List
<
Commission
>
entities
=
new
ArrayList
<>();
for
(
CommissionExcelDTO
data
:
dataList
)
{
for
(
CommissionExcelDTO
data
:
dataList
)
{
// 数据验证
// 数据验证
Commission
entity
=
CommissionExcelDTO
.
convertToEntityNew
(
data
,
loginUserId
);
Commission
entity
=
CommissionExcelDTO
.
convertToEntityNew
(
data
,
loginUserId
);
entity
.
setCommissionBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_COMMISSION
.
getCode
()));
entity
.
setCommissionBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_COMMISSION
.
getCode
()));
entity
.
setReconciliationYearMonth
(
reconciliationYearMonth
);
entities
.
add
(
entity
);
entities
.
add
(
entity
);
}
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/PolicyService.java
View file @
9f41992f
...
@@ -6,6 +6,8 @@ import com.yd.csf.service.dto.*;
...
@@ -6,6 +6,8 @@ import com.yd.csf.service.dto.*;
import
com.yd.csf.service.model.Policy
;
import
com.yd.csf.service.model.Policy
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yd.csf.service.vo.PolicyVO
;
import
com.yd.csf.service.vo.PolicyVO
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -28,5 +30,7 @@ public interface PolicyService extends IService<Policy> {
...
@@ -28,5 +30,7 @@ public interface PolicyService extends IService<Policy> {
List
<
QueryPolicyAndBrokerDto
>
queryPolicyBrokerList
(
String
policyNo
);
List
<
QueryPolicyAndBrokerDto
>
queryPolicyBrokerList
(
String
policyNo
);
List
<
Map
<
String
,
Object
>>
getPolicyProductInfo
(
List
<
String
>
productLaunchBizIdList
);
List
<
PolicyProductInfo
>
getPolicyProductInfo
(
List
<
String
>
productLaunchBizIdList
);
Map
<
String
,
PolicyProductInfo
>
getPolicyProductInfoMap
(
Collection
<
String
>
productLaunchBizIdList
);
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyServiceImpl.java
View file @
9f41992f
...
@@ -38,6 +38,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -38,6 +38,7 @@ import org.springframework.util.CollectionUtils;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -183,7 +184,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
...
@@ -183,7 +184,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>
>
getPolicyProductInfo
(
List
<
String
>
productLaunchBizIdList
)
{
public
List
<
PolicyProductInfo
>
getPolicyProductInfo
(
List
<
String
>
productLaunchBizIdList
)
{
ApiRelProjectProductLaunchPageRequest
pageRequest
=
new
ApiRelProjectProductLaunchPageRequest
();
ApiRelProjectProductLaunchPageRequest
pageRequest
=
new
ApiRelProjectProductLaunchPageRequest
();
pageRequest
.
setProductLaunchBizIdList
(
productLaunchBizIdList
);
pageRequest
.
setProductLaunchBizIdList
(
productLaunchBizIdList
);
pageRequest
.
setPageNo
(
1
);
pageRequest
.
setPageNo
(
1
);
...
@@ -201,7 +202,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
...
@@ -201,7 +202,7 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
// 直接使用Map来处理数据,避免复杂的类型转换
// 直接使用Map来处理数据,避免复杂的类型转换
Object
data
=
result
.
getData
();
Object
data
=
result
.
getData
();
List
<
Map
<
String
,
Object
>
>
policyProductInfoList
=
new
ArrayList
<>();
List
<
PolicyProductInfo
>
policyProductInfoList
=
new
ArrayList
<>();
// 将数据转换为JSONObject进行解析
// 将数据转换为JSONObject进行解析
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
data
);
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
data
);
...
@@ -212,20 +213,20 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
...
@@ -212,20 +213,20 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
for
(
int
i
=
0
;
i
<
recordsArray
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
recordsArray
.
size
();
i
++)
{
JSONObject
record
=
recordsArray
.
getJSONObject
(
i
);
JSONObject
record
=
recordsArray
.
getJSONObject
(
i
);
Map
<
String
,
Object
>
infoMap
=
new
HashMap
<>
();
PolicyProductInfo
productInfo
=
new
PolicyProductInfo
();
infoMap
.
put
(
"productLaunchBizId"
,
record
.
getStr
(
"productLaunchBizId"
));
productInfo
.
setProductLaunchBizId
(
record
.
getStr
(
"productLaunchBizId"
));
infoMap
.
put
(
"productName"
,
record
.
getStr
(
"productName"
));
productInfo
.
setProductName
(
record
.
getStr
(
"productName"
));
infoMap
.
put
(
"title"
,
record
.
getStr
(
"title"
));
productInfo
.
setTitle
(
record
.
getStr
(
"title"
));
infoMap
.
put
(
"shortTitle"
,
record
.
getStr
(
"shortTitle"
));
productInfo
.
setShortTitle
(
record
.
getStr
(
"shortTitle"
));
infoMap
.
put
(
"status"
,
record
.
getStr
(
"status"
));
productInfo
.
setStatus
(
record
.
getStr
(
"status"
));
// 解析自定义属性
// 解析自定义属性
JSONArray
attributeSettingArray
=
record
.
getJSONArray
(
"apiAttributeSettingDtoList"
);
JSONArray
attributeSettingArray
=
record
.
getJSONArray
(
"apiAttributeSettingDtoList"
);
if
(
attributeSettingArray
!=
null
)
{
if
(
attributeSettingArray
!=
null
)
{
getInfoFromJsonArray
(
attributeSettingArray
,
infoMap
);
getInfoFromJsonArray
(
attributeSettingArray
,
productInfo
);
}
}
policyProductInfoList
.
add
(
infoMap
);
policyProductInfoList
.
add
(
productInfo
);
}
}
}
}
...
@@ -237,10 +238,22 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
...
@@ -237,10 +238,22 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
}
}
}
}
@Override
public
Map
<
String
,
PolicyProductInfo
>
getPolicyProductInfoMap
(
Collection
<
String
>
productLaunchBizIdList
)
{
// 校验参数
if
(
CollectionUtils
.
isEmpty
(
productLaunchBizIdList
))
{
return
Collections
.
emptyMap
();
}
List
<
PolicyProductInfo
>
policyProductInfoList
=
getPolicyProductInfo
(
new
ArrayList
<>(
productLaunchBizIdList
));
return
policyProductInfoList
.
stream
()
.
collect
(
Collectors
.
toMap
(
PolicyProductInfo:
:
getProductLaunchBizId
,
Function
.
identity
()));
}
/**
/**
* 从JSON数组中解析自定义属性
* 从JSON数组中解析自定义属性
*/
*/
private
void
getInfoFromJsonArray
(
JSONArray
attributeSettingArray
,
Map
<
String
,
Object
>
infoMap
)
{
private
void
getInfoFromJsonArray
(
JSONArray
attributeSettingArray
,
PolicyProductInfo
productInfo
)
{
if
(
attributeSettingArray
==
null
||
attributeSettingArray
.
isEmpty
())
{
if
(
attributeSettingArray
==
null
||
attributeSettingArray
.
isEmpty
())
{
return
;
return
;
}
}
...
@@ -253,22 +266,21 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
...
@@ -253,22 +266,21 @@ public class PolicyServiceImpl extends ServiceImpl<PolicyMapper, Policy>
// 根据属性名称设置对应的字段
// 根据属性名称设置对应的字段
switch
(
name
)
{
switch
(
name
)
{
case
"保险公司"
:
case
"保险公司"
:
infoMap
.
put
(
"insuranceCompany"
,
value
);
productInfo
.
setInsuranceCompany
(
value
);
infoMap
.
put
(
"insuranceCompanyBizId"
,
attribute
.
getStr
(
"fieldValueBizId"
));
productInfo
.
setInsuranceCompanyBizId
(
attribute
.
getStr
(
"fieldValueBizId"
));
break
;
break
;
case
"对账公司"
:
case
"对账公司"
:
infoMap
.
put
(
"reconciliationCompany"
,
value
);
productInfo
.
setReconciliationCompany
(
value
);
infoMap
.
put
(
"reconciliationCompanyBizId"
,
attribute
.
getStr
(
"fieldValueBizId"
));
productInfo
.
setReconciliationCompanyBizId
(
attribute
.
getStr
(
"fieldValueBizId"
));
break
;
break
;
case
"产品计划类型"
:
case
"产品计划类型"
:
infoMap
.
put
(
"productPlanType"
,
value
);
productInfo
.
setProductPlanType
(
value
);
break
;
break
;
case
"是否区分吸烟"
:
case
"是否区分吸烟"
:
infoMap
.
put
(
"isSmokingDistinguish"
,
value
);
productInfo
.
setIsSmokingDistinguish
(
value
);
break
;
break
;
default
:
default
:
// 其他自定义属性
// 其他自定义属性
infoMap
.
put
(
name
,
value
);
break
;
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