Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
travel-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cloud
travel-cloud
Commits
30ef05a5
提交
30ef05a5
authored
5月 14, 2025
作者:
hzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
保险功能实现
上级
7f3900fc
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
98 行增加
和
6 行删除
+98
-6
WeishiController.java
.../dromara/mall/controller/weishi/app/WeishiController.java
+18
-0
InsureInsureds.java
...n/java/org/dromara/mall/domain/weishi/InsureInsureds.java
+2
-0
InsurePolicyHolder.java
...va/org/dromara/mall/domain/weishi/InsurePolicyHolder.java
+2
-0
InsureTaxpayer.java
...n/java/org/dromara/mall/domain/weishi/InsureTaxpayer.java
+2
-0
IInsureService.java
.../java/org/dromara/mall/service/weishi/IInsureService.java
+14
-0
InsureServiceImpl.java
...g/dromara/mall/service/weishi/impl/InsureServiceImpl.java
+60
-6
没有找到文件。
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/app/WeishiController.java
浏览文件 @
30ef05a5
...
@@ -3,10 +3,15 @@ package org.dromara.mall.controller.weishi.app;
...
@@ -3,10 +3,15 @@ package org.dromara.mall.controller.weishi.app;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.domain.R
;
import
org.dromara.common.core.domain.R
;
import
org.dromara.common.mybatis.core.page.PageQuery
;
import
org.dromara.common.mybatis.core.page.TableDataInfo
;
import
org.dromara.common.satoken.utils.LoginHelper
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.req.ProposalRequest
;
import
org.dromara.common.weishi.model.req.ProposalRequest
;
import
org.dromara.common.weishi.model.res.*
;
import
org.dromara.common.weishi.model.res.*
;
import
org.dromara.common.weishi.service.WeishiService
;
import
org.dromara.common.weishi.service.WeishiService
;
import
org.dromara.mall.controller.weishi.admin.bo.InsureBo
;
import
org.dromara.mall.controller.weishi.admin.vo.InsureVo
;
import
org.dromara.mall.service.weishi.IInsureService
;
import
org.dromara.mall.service.weishi.IInsureService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -107,6 +112,7 @@ public class WeishiController {
...
@@ -107,6 +112,7 @@ public class WeishiController {
@PostMapping
(
"/insureCancel/{orderNum}"
)
@PostMapping
(
"/insureCancel/{orderNum}"
)
public
R
<
Void
>
insureCancel
(
@PathVariable
String
orderNum
)
{
public
R
<
Void
>
insureCancel
(
@PathVariable
String
orderNum
)
{
weishiService
.
insureCancel
(
getToken
(),
orderNum
);
weishiService
.
insureCancel
(
getToken
(),
orderNum
);
insureService
.
insureCancel
(
orderNum
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -118,9 +124,21 @@ public class WeishiController {
...
@@ -118,9 +124,21 @@ public class WeishiController {
@PostMapping
(
"/policyCancel/{policyNum}"
)
@PostMapping
(
"/policyCancel/{policyNum}"
)
public
R
<
Void
>
policyCancel
(
@PathVariable
String
policyNum
)
{
public
R
<
Void
>
policyCancel
(
@PathVariable
String
policyNum
)
{
weishiService
.
policyCancel
(
getToken
(),
policyNum
);
weishiService
.
policyCancel
(
getToken
(),
policyNum
);
insureService
.
policyCancel
(
policyNum
);
return
R
.
ok
();
return
R
.
ok
();
}
}
/**
* 订单列表
*/
@GetMapping
(
"/insureList"
)
public
TableDataInfo
<
InsureVo
>
list
(
PageQuery
pageQuery
)
{
InsureBo
bo
=
new
InsureBo
();
bo
.
setUserId
(
LoginHelper
.
getUserId
());
return
insureService
.
queryPageList
(
bo
,
pageQuery
);
}
/**
/**
* 获取token
* 获取token
*
*
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/InsureInsureds.java
浏览文件 @
30ef05a5
package
org
.
dromara
.
mall
.
domain
.
weishi
;
package
org
.
dromara
.
mall
.
domain
.
weishi
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -15,6 +16,7 @@ import java.io.Serial;
...
@@ -15,6 +16,7 @@ import java.io.Serial;
* @date 2025-05-14
* @date 2025-05-14
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"weishi_insure_insureds"
)
@TableName
(
"weishi_insure_insureds"
)
public
class
InsureInsureds
extends
TenantEntity
{
public
class
InsureInsureds
extends
TenantEntity
{
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/InsurePolicyHolder.java
浏览文件 @
30ef05a5
package
org
.
dromara
.
mall
.
domain
.
weishi
;
package
org
.
dromara
.
mall
.
domain
.
weishi
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,6 +15,7 @@ import java.io.Serial;
...
@@ -14,6 +15,7 @@ import java.io.Serial;
* @date 2025-05-14
* @date 2025-05-14
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"weishi_insure_policy_holder"
)
@TableName
(
"weishi_insure_policy_holder"
)
public
class
InsurePolicyHolder
extends
TenantEntity
{
public
class
InsurePolicyHolder
extends
TenantEntity
{
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/InsureTaxpayer.java
浏览文件 @
30ef05a5
package
org
.
dromara
.
mall
.
domain
.
weishi
;
package
org
.
dromara
.
mall
.
domain
.
weishi
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,6 +15,7 @@ import java.io.Serial;
...
@@ -14,6 +15,7 @@ import java.io.Serial;
* @date 2025-05-14
* @date 2025-05-14
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"weishi_insure_taxpayer"
)
@TableName
(
"weishi_insure_taxpayer"
)
public
class
InsureTaxpayer
extends
TenantEntity
{
public
class
InsureTaxpayer
extends
TenantEntity
{
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/IInsureService.java
浏览文件 @
30ef05a5
...
@@ -30,4 +30,18 @@ public interface IInsureService extends IBaseService<InsureVo, InsureBo, Insure>
...
@@ -30,4 +30,18 @@ public interface IInsureService extends IBaseService<InsureVo, InsureBo, Insure>
*/
*/
void
apply
(
ApplyRequest
req
,
ApplyResponse
res
);
void
apply
(
ApplyRequest
req
,
ApplyResponse
res
);
/**
* 订单取消
*
* @param orderNum 订单号
*/
void
insureCancel
(
String
orderNum
);
/**
* 保单取消
*
* @param policyNum 保单号
*/
void
policyCancel
(
String
policyNum
);
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/impl/InsureServiceImpl.java
浏览文件 @
30ef05a5
...
@@ -140,8 +140,8 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -140,8 +140,8 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
//保存投保人信息
//保存投保人信息
ApplyResponse
.
PolicyHolder
ph
=
unit
.
getPolicyHolder
();
ApplyResponse
.
PolicyHolder
ph
=
unit
.
getPolicyHolder
();
InsurePolicyHolder
iph
=
BeanUtil
.
copyProperties
(
ph
,
InsurePolicyHolder
.
class
);
InsurePolicyHolder
iph
=
BeanUtil
.
copyProperties
(
ph
,
InsurePolicyHolder
.
class
);
iph
.
setOrderNum
(
res
.
getOrderNum
())
;
iph
.
setOrderNum
(
res
.
getOrderNum
())
iph
.
setPolicyNum
(
unit
.
getPolicyNum
());
.
setPolicyNum
(
unit
.
getPolicyNum
());
policyHolderMapper
.
insert
(
iph
);
policyHolderMapper
.
insert
(
iph
);
//保存被保人信息
//保存被保人信息
List
<
ApplyResponse
.
Insured
>
insureds
=
unit
.
getInsureds
();
List
<
ApplyResponse
.
Insured
>
insureds
=
unit
.
getInsureds
();
...
@@ -149,13 +149,67 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -149,13 +149,67 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
for
(
ApplyResponse
.
Insured
insured
:
insureds
)
{
for
(
ApplyResponse
.
Insured
insured
:
insureds
)
{
InsureInsureds
ins
=
BeanUtil
.
copyProperties
(
insured
,
InsureInsureds
.
class
);
InsureInsureds
ins
=
BeanUtil
.
copyProperties
(
insured
,
InsureInsureds
.
class
);
IssueResponse
.
Insured
iri
=
StreamUtils
.
findFirst
(
arInsureds
,
a
->
StringUtils
.
equals
(
a
.
getIDNum
(),
insured
.
getIDNum
()));
IssueResponse
.
Insured
iri
=
StreamUtils
.
findFirst
(
arInsureds
,
a
->
StringUtils
.
equals
(
a
.
getIDNum
(),
insured
.
getIDNum
()));
ins
.
setOrderNum
(
res
.
getOrderNum
());
ins
.
setPolicyNum
(
unit
.
getPolicyNum
());
assert
iri
!=
null
;
assert
iri
!=
null
;
ins
.
setActRefund
(
iri
.
getActRefund
());
ins
.
setOrderNum
(
res
.
getOrderNum
())
ins
.
setStdRefund
(
iri
.
getStdRefund
());
.
setPolicyNum
(
unit
.
getPolicyNum
())
.
setActRefund
(
iri
.
getActRefund
())
.
setStdRefund
(
iri
.
getStdRefund
());
insuredsMapper
.
insert
(
ins
);
insuredsMapper
.
insert
(
ins
);
}
}
}
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
insureCancel
(
String
orderNum
)
{
//获取订单详情
IssueResponse
issueRes
=
weishiService
.
insureDetail
(
getToken
(),
orderNum
);
//获取投保单位
List
<
InsureUnit
>
unitList
=
unitMapper
.
selectList
(
InsureUnit:
:
getOrderNum
,
orderNum
);
//获取被保人信息
List
<
InsureInsureds
>
insuredList
=
insuredsMapper
.
selectList
(
InsureInsureds:
:
getOrderNum
,
orderNum
);
//跟新退款信息
updateRefundInfo
(
issueRes
,
unitList
,
insuredList
);
}
@Override
public
void
policyCancel
(
String
policyNum
)
{
//获取投保单位
List
<
InsureUnit
>
unitList
=
unitMapper
.
selectList
(
InsureUnit:
:
getPolicyNum
,
policyNum
);
//获取被保人信息
List
<
InsureInsureds
>
insuredList
=
insuredsMapper
.
selectList
(
InsureInsureds:
:
getPolicyNum
,
policyNum
);
//获取订单详情
IssueResponse
issueRes
=
weishiService
.
insureDetail
(
getToken
(),
unitList
.
get
(
0
).
getOrderNum
());
updateRefundInfo
(
issueRes
,
unitList
,
insuredList
);
}
/**
* 跟新退款信息
*
* @param issueRes 订单详情
* @param unitList 投保单位集合
* @param insuredList 被保人信息集合
*/
private
void
updateRefundInfo
(
IssueResponse
issueRes
,
List
<
InsureUnit
>
unitList
,
List
<
InsureInsureds
>
insuredList
)
{
//跟新退款信息
List
<
IssueResponse
.
Unit
>
units
=
issueRes
.
getUnits
();
for
(
InsureUnit
unit
:
unitList
)
{
//跟新投保信息
IssueResponse
.
Unit
iru
=
StreamUtils
.
findFirst
(
units
,
u
->
StringUtils
.
equals
(
u
.
getPolicyNum
(),
unit
.
getPolicyNum
()));
assert
iru
!=
null
;
unit
.
setActRefund
(
iru
.
getActRefund
())
.
setStdRefund
(
iru
.
getStdRefund
());
unitMapper
.
updateById
(
unit
);
//跟新被保人信息
List
<
InsureInsureds
>
insureds
=
StreamUtils
.
filter
(
insuredList
,
i
->
StringUtils
.
equals
(
i
.
getPolicyNum
(),
unit
.
getPolicyNum
()));
List
<
IssueResponse
.
Insured
>
iriList
=
iru
.
getInsureds
();
for
(
InsureInsureds
insured
:
insureds
)
{
IssueResponse
.
Insured
iri
=
StreamUtils
.
findFirst
(
iriList
,
i
->
StringUtils
.
equals
(
i
.
getIDNum
(),
insured
.
getIdNum
()));
assert
iri
!=
null
;
insured
.
setActRefund
(
iri
.
getActRefund
())
.
setStdRefund
(
iri
.
getStdRefund
());
insuredsMapper
.
updateById
(
insured
);
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论