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
9ae33511
Commit
9ae33511
authored
Oct 11, 2025
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
来佣接口23
parent
4494f649
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
33 deletions
+34
-33
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyFollowController.java
+2
-2
yd-csf-service/src/main/java/com/yd/csf/service/dto/AddToPolicyRequest.java
+4
-3
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
+28
-28
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiPolicyFollowController.java
View file @
9ae33511
...
...
@@ -262,8 +262,8 @@ public class ApiPolicyFollowController {
@Operation
(
summary
=
"保存到保单库"
)
@PostMapping
(
"/addToPolicy"
)
public
Result
<
Boolean
>
addToPolicy
(
@RequestBody
AddToPolicyRequest
addToPolicyRequest
,
HttpServletRequest
request
)
{
if
(
StringUtils
.
isBlank
(
addToPolicyRequest
.
getPolicyBizId
()))
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
()
);
if
(
CollectionUtils
.
isEmpty
(
addToPolicyRequest
.
getPolicyNoList
()))
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
"保单号列表不能为空"
);
}
return
Result
.
success
(
policyFollowService
.
addToPolicy
(
addToPolicyRequest
));
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dto/AddToPolicyRequest.java
View file @
9ae33511
...
...
@@ -4,14 +4,15 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
AddToPolicyRequest
implements
Serializable
{
/**
*
新单编
号
*
保单
号
*/
@Schema
(
description
=
"
新单编号
"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
String
policyBizId
;
@Schema
(
description
=
"
保单号列表
"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
private
List
<
String
>
policyNoList
;
private
static
final
long
serialVersionUID
=
1L
;
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
View file @
9ae33511
...
...
@@ -193,41 +193,41 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
@Override
public
Boolean
addToPolicy
(
AddToPolicyRequest
addToPolicyRequest
)
{
String
policyBizId
=
addToPolicyRequest
.
getPolicyBizId
();
PolicyFollow
policyFollow
=
getByPolicyBizId
(
policyBizId
);
if
(
policyFollow
==
null
)
{
throw
new
BusinessException
(
ErrorCode
.
NOT_FOUND_ERROR
.
getCode
(),
"Policy biz id not found"
);
}
// 获取当前登录用户
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
// 保存到保单库
Policy
policy
=
policyService
.
getOne
(
new
QueryWrapper
<
Policy
>().
eq
(
"policy_biz_id"
,
policyBizId
));
if
(
policy
!=
null
)
{
// 更新
BeanUtils
.
copyProperties
(
policyFollow
,
policy
,
"id"
);
policy
.
setUpdaterId
(
loginUserId
);
policy
.
setUpdateTime
(
new
Date
());
return
policyService
.
updateById
(
policy
);
}
else
{
// 不存在则创建
policy
=
new
Policy
();
BeanUtils
.
copyProperties
(
policyFollow
,
policy
,
"id"
);
policy
.
setId
(
null
);
policy
.
setPolicyBizId
(
policyBizId
);
policy
.
setCreatorId
(
loginUserId
);
policy
.
setCreateTime
(
new
Date
());
policy
.
setUpdaterId
(
loginUserId
);
policy
.
setUpdateTime
(
new
Date
());
return
policyService
.
save
(
policy
);
List
<
String
>
policyNoList
=
addToPolicyRequest
.
getPolicyNoList
();
// 查询所有跟进记录
List
<
PolicyFollow
>
policyFollowList
=
list
(
new
QueryWrapper
<
PolicyFollow
>().
in
(
"policy_no"
,
policyNoList
));
for
(
PolicyFollow
policyFollow
:
policyFollowList
)
{
// 查询保单是否存在
String
policyBizId
=
policyFollow
.
getPolicyBizId
();
Policy
policy
=
policyService
.
getOne
(
new
QueryWrapper
<
Policy
>().
eq
(
"policy_biz_id"
,
policyBizId
));
if
(
policy
!=
null
)
{
// 更新
BeanUtils
.
copyProperties
(
policyFollow
,
policy
,
"id"
);
policy
.
setUpdaterId
(
loginUserId
);
policy
.
setUpdateTime
(
new
Date
());
policyService
.
updateById
(
policy
);
}
else
{
// 不存在则创建
policy
=
new
Policy
();
BeanUtils
.
copyProperties
(
policyFollow
,
policy
,
"id"
);
policy
.
setId
(
null
);
policy
.
setPolicyBizId
(
policyBizId
);
policy
.
setCreatorId
(
loginUserId
);
policy
.
setCreateTime
(
new
Date
());
policy
.
setUpdaterId
(
loginUserId
);
policy
.
setUpdateTime
(
new
Date
());
policyService
.
save
(
policy
);
}
}
return
true
;
}
}
...
...
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