Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
travel-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cloud
travel-cloud
Commits
1c352dd5
提交
1c352dd5
authored
5月 15, 2025
作者:
hzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
7f38b469
显示空白字符变更
内嵌
并排
正在显示
31 个修改的文件
包含
720 行增加
和
674 行删除
+720
-674
Api.java
...51weishi/src/main/java/org/dromara/common/weishi/Api.java
+37
-29
AbstractHttpDelegate.java
.../org/dromara/common/weishi/base/AbstractHttpDelegate.java
+12
-18
OrderStatus.java
.../java/org/dromara/common/weishi/constant/OrderStatus.java
+20
-0
ApplyRequest.java
...ava/org/dromara/common/weishi/model/req/ApplyRequest.java
+31
-0
ApplyResponse.java
...va/org/dromara/common/weishi/model/res/ApplyResponse.java
+14
-121
IssueResponse.java
...va/org/dromara/common/weishi/model/res/IssueResponse.java
+20
-142
ProposalResponse.java
...org/dromara/common/weishi/model/res/ProposalResponse.java
+10
-118
WeishiService.java
...java/org/dromara/common/weishi/service/WeishiService.java
+9
-1
WeishiServiceImpl.java
...dromara/common/weishi/service/impl/WeishiServiceImpl.java
+26
-10
AccountController.java
...omara/mall/controller/weishi/admin/AccountController.java
+53
-0
AccountBo.java
...rg/dromara/mall/controller/weishi/admin/bo/AccountBo.java
+50
-0
InsureBo.java
...org/dromara/mall/controller/weishi/admin/bo/InsureBo.java
+21
-40
InsureInsuredsBo.java
...ara/mall/controller/weishi/admin/bo/InsureInsuredsBo.java
+8
-19
InsureUnitBo.java
...dromara/mall/controller/weishi/admin/bo/InsureUnitBo.java
+10
-15
AccountVo.java
...rg/dromara/mall/controller/weishi/admin/vo/AccountVo.java
+52
-0
InsureInsuredsVo.java
...ara/mall/controller/weishi/admin/vo/InsureInsuredsVo.java
+6
-17
InsureUnitVo.java
...dromara/mall/controller/weishi/admin/vo/InsureUnitVo.java
+7
-11
InsureVo.java
...org/dromara/mall/controller/weishi/admin/vo/InsureVo.java
+27
-39
WeishiController.java
.../dromara/mall/controller/weishi/app/WeishiController.java
+7
-5
Account.java
...src/main/java/org/dromara/mall/domain/weishi/Account.java
+52
-0
Insure.java
.../src/main/java/org/dromara/mall/domain/weishi/Insure.java
+18
-8
InsureInsureds.java
...n/java/org/dromara/mall/domain/weishi/InsureInsureds.java
+5
-0
InsureUnit.java
.../main/java/org/dromara/mall/domain/weishi/InsureUnit.java
+13
-6
AccountMapper.java
.../src/main/java/org/dromara/mall/mapper/AccountMapper.java
+15
-0
IAccountService.java
...java/org/dromara/mall/service/weishi/IAccountService.java
+23
-0
IInsureService.java
.../java/org/dromara/mall/service/weishi/IInsureService.java
+7
-0
IThirdWeishiService.java
.../org/dromara/mall/service/weishi/IThirdWeishiService.java
+23
-0
AccountServiceImpl.java
.../dromara/mall/service/weishi/impl/AccountServiceImpl.java
+49
-0
InsureServiceImpl.java
...g/dromara/mall/service/weishi/impl/InsureServiceImpl.java
+36
-75
ThirdWeishiServiceImpl.java
...mara/mall/service/weishi/impl/ThirdWeishiServiceImpl.java
+52
-0
AccountMapper.xml
...oyi-mall/src/main/resources/mapper/mall/AccountMapper.xml
+7
-0
没有找到文件。
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/Api.java
浏览文件 @
1c352dd5
...
@@ -50,16 +50,23 @@ public class Api {
...
@@ -50,16 +50,23 @@ public class Api {
.
concat
(
apiEnum
.
getUrl
());
.
concat
(
apiEnum
.
getUrl
());
}
}
public
static
<
T
>
T
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
String
token
,
String
body
,
Class
<
T
>
clazz
)
{
return
v1
(
method
,
urlPrefix
,
urlSuffix
,
token
,
null
,
body
,
null
,
clazz
);
}
public
static
ApiHttpResponse
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
public
static
ApiHttpResponse
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
String
token
,
String
token
,
String
body
)
{
String
body
)
{
return
v1
(
method
,
urlPrefix
,
urlSuffix
,
token
,
null
,
body
,
null
);
return
v1
(
method
,
urlPrefix
,
urlSuffix
,
token
,
null
,
body
,
null
,
ApiHttpResponse
.
class
);
}
}
public
static
ApiHttpResponse
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
public
static
ApiHttpResponse
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
String
token
,
String
token
,
Map
<
String
,
Object
>
params
,
String
body
)
{
Map
<
String
,
Object
>
params
,
String
body
)
{
return
v1
(
method
,
urlPrefix
,
urlSuffix
,
token
,
params
,
body
,
null
);
return
v1
(
method
,
urlPrefix
,
urlSuffix
,
token
,
params
,
body
,
null
,
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -74,9 +81,9 @@ public class Api {
...
@@ -74,9 +81,9 @@ public class Api {
* @param file 文件
* @param file 文件
* @return 请求返回的结果
* @return 请求返回的结果
*/
*/
public
static
ApiHttpResponse
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
public
static
<
T
>
T
v1
(
RequestMethodEnum
method
,
String
urlPrefix
,
String
urlSuffix
,
String
token
,
String
token
,
Map
<
String
,
Object
>
params
,
String
body
,
File
file
)
{
Map
<
String
,
Object
>
params
,
String
body
,
File
file
,
Class
<
T
>
clazz
)
{
if
(
null
!=
params
&&
!
params
.
keySet
().
isEmpty
())
{
if
(
null
!=
params
&&
!
params
.
keySet
().
isEmpty
())
{
urlSuffix
=
urlSuffix
.
concat
(
"?"
).
concat
(
PayKit
.
createLinkString
(
params
,
true
));
urlSuffix
=
urlSuffix
.
concat
(
"?"
).
concat
(
PayKit
.
createLinkString
(
params
,
true
));
}
}
...
@@ -84,20 +91,21 @@ public class Api {
...
@@ -84,20 +91,21 @@ public class Api {
// 构建 Authorization
// 构建 Authorization
String
authorization
=
token
;
String
authorization
=
token
;
String
bodyRes
=
null
;
if
(
method
==
RequestMethodEnum
.
GET
)
{
if
(
method
==
RequestMethodEnum
.
GET
)
{
return
get
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
null
);
bodyRes
=
get
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
null
);
}
else
if
(
method
==
RequestMethodEnum
.
POST
)
{
}
else
if
(
method
==
RequestMethodEnum
.
POST
)
{
return
post
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
bodyRes
=
post
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
}
else
if
(
method
==
RequestMethodEnum
.
DELETE
)
{
}
else
if
(
method
==
RequestMethodEnum
.
DELETE
)
{
return
delete
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
bodyRes
=
delete
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
}
else
if
(
method
==
RequestMethodEnum
.
UPLOAD
)
{
}
else
if
(
method
==
RequestMethodEnum
.
UPLOAD
)
{
return
upload
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
,
file
);
bodyRes
=
upload
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
,
file
);
}
else
if
(
method
==
RequestMethodEnum
.
PATCH
)
{
}
else
if
(
method
==
RequestMethodEnum
.
PATCH
)
{
return
patch
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
bodyRes
=
patch
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
}
else
if
(
method
==
RequestMethodEnum
.
PUT
)
{
}
else
if
(
method
==
RequestMethodEnum
.
PUT
)
{
return
put
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
bodyRes
=
put
(
urlPrefix
.
concat
(
urlSuffix
),
authorization
,
body
);
}
}
return
null
;
return
JSON
.
parseObject
(
bodyRes
,
clazz
)
;
}
}
/**
/**
...
@@ -108,7 +116,7 @@ public class Api {
...
@@ -108,7 +116,7 @@ public class Api {
* @param data 请求参数
* @param data 请求参数
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
put
(
String
url
,
String
authorization
,
String
data
)
{
public
static
String
put
(
String
url
,
String
authorization
,
String
data
)
{
return
put
(
url
,
data
,
getHeaders
(
authorization
));
return
put
(
url
,
data
,
getHeaders
(
authorization
));
}
}
...
@@ -120,7 +128,7 @@ public class Api {
...
@@ -120,7 +128,7 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
put
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
static
String
put
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
return
HttpKit
.
getDelegate
().
put
(
url
,
data
,
headers
);
return
HttpKit
.
getDelegate
().
put
(
url
,
data
,
headers
);
}
}
...
@@ -132,7 +140,7 @@ public class Api {
...
@@ -132,7 +140,7 @@ public class Api {
* @param data 请求参数
* @param data 请求参数
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
patch
(
String
url
,
String
authorization
,
String
data
)
{
public
static
String
patch
(
String
url
,
String
authorization
,
String
data
)
{
return
patch
(
url
,
data
,
getHeaders
(
authorization
));
return
patch
(
url
,
data
,
getHeaders
(
authorization
));
}
}
...
@@ -144,7 +152,7 @@ public class Api {
...
@@ -144,7 +152,7 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
patch
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
static
String
patch
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
return
HttpKit
.
getDelegate
().
patch
(
url
,
data
,
headers
);
return
HttpKit
.
getDelegate
().
patch
(
url
,
data
,
headers
);
}
}
...
@@ -157,7 +165,7 @@ public class Api {
...
@@ -157,7 +165,7 @@ public class Api {
* @param file 上传文件
* @param file 上传文件
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
upload
(
String
url
,
String
authorization
,
String
data
,
File
file
)
{
public
static
String
upload
(
String
url
,
String
authorization
,
String
data
,
File
file
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
2
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
2
);
paramMap
.
put
(
"file"
,
file
);
paramMap
.
put
(
"file"
,
file
);
paramMap
.
put
(
"meta"
,
data
);
paramMap
.
put
(
"meta"
,
data
);
...
@@ -172,7 +180,7 @@ public class Api {
...
@@ -172,7 +180,7 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
upload
(
String
url
,
Map
<
String
,
Object
>
params
,
Map
<
String
,
String
>
headers
)
{
public
static
String
upload
(
String
url
,
Map
<
String
,
Object
>
params
,
Map
<
String
,
String
>
headers
)
{
return
HttpKit
.
getDelegate
().
post
(
url
,
params
,
headers
);
return
HttpKit
.
getDelegate
().
post
(
url
,
params
,
headers
);
}
}
...
@@ -190,7 +198,7 @@ public class Api {
...
@@ -190,7 +198,7 @@ public class Api {
* @param data 请求参数
* @param data 请求参数
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
delete
(
String
url
,
String
authorization
,
String
data
)
{
public
static
String
delete
(
String
url
,
String
authorization
,
String
data
)
{
return
delete
(
url
,
data
,
getHeaders
(
authorization
));
return
delete
(
url
,
data
,
getHeaders
(
authorization
));
}
}
...
@@ -202,7 +210,7 @@ public class Api {
...
@@ -202,7 +210,7 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
delete
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
static
String
delete
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
return
HttpKit
.
getDelegate
().
delete
(
url
,
data
,
headers
);
return
HttpKit
.
getDelegate
().
delete
(
url
,
data
,
headers
);
}
}
...
@@ -214,7 +222,7 @@ public class Api {
...
@@ -214,7 +222,7 @@ public class Api {
* @param data 请求参数
* @param data 请求参数
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
post
(
String
url
,
String
authorization
,
String
data
)
{
public
static
String
post
(
String
url
,
String
authorization
,
String
data
)
{
return
post
(
url
,
data
,
getHeaders
(
authorization
));
return
post
(
url
,
data
,
getHeaders
(
authorization
));
}
}
...
@@ -226,17 +234,17 @@ public class Api {
...
@@ -226,17 +234,17 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
post
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
static
String
post
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
log
.
info
(
"请求路径:{}"
,
url
);
log
.
info
(
"请求路径:{}"
,
url
);
log
.
info
(
"请求头:{}"
,
JSON
.
toJSONString
(
headers
));
log
.
info
(
"请求头:{}"
,
JSON
.
toJSONString
(
headers
));
log
.
info
(
"请求体:{}"
,
data
);
log
.
info
(
"请求体:{}"
,
data
);
StopWatch
watch
=
new
StopWatch
();
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
watch
.
start
();
ApiHttpResponse
res
=
HttpKit
.
getDelegate
().
post
(
url
,
data
,
headers
);
String
body
=
HttpKit
.
getDelegate
().
post
(
url
,
data
,
headers
);
log
.
info
(
"返回参数:{}"
,
JSON
.
toJSONString
(
res
)
);
log
.
info
(
"返回参数:{}"
,
body
);
watch
.
stop
();
watch
.
stop
();
log
.
info
(
"请求耗时:{}ms"
,
watch
.
getTotalTimeMillis
());
log
.
info
(
"请求耗时:{}ms"
,
watch
.
getTotalTimeMillis
());
return
res
;
return
body
;
}
}
/**
/**
...
@@ -247,7 +255,7 @@ public class Api {
...
@@ -247,7 +255,7 @@ public class Api {
* @param params 请求参数
* @param params 请求参数
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
get
(
String
url
,
String
authorization
,
Map
<
String
,
Object
>
params
)
{
public
static
String
get
(
String
url
,
String
authorization
,
Map
<
String
,
Object
>
params
)
{
return
get
(
url
,
params
,
getHeaders
(
authorization
));
return
get
(
url
,
params
,
getHeaders
(
authorization
));
}
}
...
@@ -263,17 +271,17 @@ public class Api {
...
@@ -263,17 +271,17 @@ public class Api {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
static
ApiHttpResponse
get
(
String
url
,
Map
<
String
,
Object
>
params
,
Map
<
String
,
String
>
headers
)
{
public
static
String
get
(
String
url
,
Map
<
String
,
Object
>
params
,
Map
<
String
,
String
>
headers
)
{
log
.
info
(
"请求路径:{}"
,
url
);
log
.
info
(
"请求路径:{}"
,
url
);
log
.
info
(
"请求头:{}"
,
JSON
.
toJSONString
(
headers
));
log
.
info
(
"请求头:{}"
,
JSON
.
toJSONString
(
headers
));
log
.
info
(
"请求参数:{}"
,
params
);
log
.
info
(
"请求参数:{}"
,
params
);
StopWatch
watch
=
new
StopWatch
();
StopWatch
watch
=
new
StopWatch
();
watch
.
start
();
watch
.
start
();
ApiHttpResponse
res
=
HttpKit
.
getDelegate
().
get
(
url
,
params
,
headers
);
String
body
=
HttpKit
.
getDelegate
().
get
(
url
,
params
,
headers
);
log
.
info
(
"返回参数:{}"
,
JSON
.
toJSONString
(
res
)
);
log
.
info
(
"返回参数:{}"
,
body
);
watch
.
stop
();
watch
.
stop
();
log
.
info
(
"请求耗时:{}ms"
,
watch
.
getTotalTimeMillis
());
log
.
info
(
"请求耗时:{}ms"
,
watch
.
getTotalTimeMillis
());
return
res
;
return
body
;
}
}
public
static
Map
<
String
,
String
>
getHeaders
(
String
authorization
)
{
public
static
Map
<
String
,
String
>
getHeaders
(
String
authorization
)
{
...
...
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/base/AbstractHttpDelegate.java
浏览文件 @
1c352dd5
...
@@ -74,9 +74,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -74,9 +74,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
get
(
String
url
,
Map
<
String
,
Object
>
paramMap
,
Map
<
String
,
String
>
headers
)
{
public
String
get
(
String
url
,
Map
<
String
,
Object
>
paramMap
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
getToResponse
(
url
,
paramMap
,
headers
);
return
getToResponse
(
url
,
paramMap
,
headers
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -109,9 +108,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -109,9 +108,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
post
(
String
url
,
Map
<
String
,
Object
>
paramMap
,
Map
<
String
,
String
>
headers
)
{
public
String
post
(
String
url
,
Map
<
String
,
Object
>
paramMap
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
postToResponse
(
url
,
headers
,
paramMap
);
return
postToResponse
(
url
,
headers
,
paramMap
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -122,9 +120,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -122,9 +120,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
post
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
String
post
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
postToResponse
(
url
,
headers
,
data
);
return
postToResponse
(
url
,
headers
,
data
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -148,9 +145,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -148,9 +145,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
patch
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
String
patch
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
patchToResponse
(
url
,
headers
,
data
);
return
patchToResponse
(
url
,
headers
,
data
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -174,9 +170,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -174,9 +170,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
delete
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
String
delete
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
deleteToResponse
(
url
,
headers
,
data
);
return
deleteToResponse
(
url
,
headers
,
data
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
@@ -200,9 +195,8 @@ public abstract class AbstractHttpDelegate {
...
@@ -200,9 +195,8 @@ public abstract class AbstractHttpDelegate {
* @param headers 请求头
* @param headers 请求头
* @return {@link ApiHttpResponse} 请求返回的结果
* @return {@link ApiHttpResponse} 请求返回的结果
*/
*/
public
ApiHttpResponse
put
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
public
String
put
(
String
url
,
String
data
,
Map
<
String
,
String
>
headers
)
{
HttpResponse
httpResponse
=
putToResponse
(
url
,
headers
,
data
);
return
putToResponse
(
url
,
headers
,
data
).
body
();
return
JSONObject
.
parseObject
(
httpResponse
.
body
(),
ApiHttpResponse
.
class
);
}
}
/**
/**
...
...
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/constant/OrderStatus.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
common
.
weishi
.
constant
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @author wenhe
*/
@Getter
@AllArgsConstructor
public
enum
OrderStatus
{
E
(
"E"
,
"已承保"
),
W
(
"W"
,
"已撤单"
),
P
(
"P"
,
"代支付"
),
A
(
"A"
,
"已作废"
),
D
(
"D"
,
"已删除"
);
private
final
String
key
;
private
final
String
value
;
}
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/model/req/ApplyRequest.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
common
.
weishi
.
model
.
req
;
package
org
.
dromara
.
common
.
weishi
.
model
.
req
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
...
@@ -14,54 +15,67 @@ public class ApplyRequest {
...
@@ -14,54 +15,67 @@ public class ApplyRequest {
/**
/**
* 流水号,幂等且唯一不能重复
* 流水号,幂等且唯一不能重复
*/
*/
@JSONField
(
name
=
"BatchNum"
)
private
String
BatchNum
;
private
String
BatchNum
;
/**
/**
* 产品id
* 产品id
*/
*/
@JSONField
(
name
=
"ProductId"
)
private
Integer
ProductId
;
private
Integer
ProductId
;
/**
/**
* 产品计划代码,需联系客户经理提供
* 产品计划代码,需联系客户经理提供
*/
*/
@JSONField
(
name
=
"ProductNum"
)
private
String
ProductNum
;
private
String
ProductNum
;
/**
/**
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@JSONField
(
name
=
"BeginDate"
)
private
String
BeginDate
;
private
String
BeginDate
;
/**
/**
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@JSONField
(
name
=
"EndDate"
)
private
String
EndDate
;
private
String
EndDate
;
/**
/**
* 旅行目的地
* 旅行目的地
*/
*/
@JSONField
(
name
=
"TourDest"
)
private
String
TourDest
;
private
String
TourDest
;
/**
/**
* 旅行团编号/航班号
* 旅行团编号/航班号
*/
*/
@JSONField
(
name
=
"TourNum"
)
private
String
TourNum
;
private
String
TourNum
;
/**
/**
* 标准保费合计,是Units中所有标准保费的总和
* 标准保费合计,是Units中所有标准保费的总和
*/
*/
@JSONField
(
name
=
"StdPremium"
)
private
BigDecimal
StdPremium
;
private
BigDecimal
StdPremium
;
/**
/**
* 实收保费合计,是Units中所有实收保费的总和
* 实收保费合计,是Units中所有实收保费的总和
*/
*/
@JSONField
(
name
=
"ActPremium"
)
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
/**
/**
* 投保单元列表,每个投保必须包含一个以上投保单元,一次投保多个被保险人且要求单人保单时此字段为多个元素,否则为单个元素
* 投保单元列表,每个投保必须包含一个以上投保单元,一次投保多个被保险人且要求单人保单时此字段为多个元素,否则为单个元素
*/
*/
@JSONField
(
name
=
"Units"
)
private
List
<
InsureUnit
>
Units
;
private
List
<
InsureUnit
>
Units
;
/**
/**
* 投保可选参数
* 投保可选参数
*/
*/
@JSONField
(
name
=
"Options"
)
private
Options
Options
;
private
Options
Options
;
/**
/**
* 支付参数,在余额不足时需要此参数
* 支付参数,在余额不足时需要此参数
*/
*/
@JSONField
(
name
=
"PaymentOptions"
)
private
PaymentOptions
PaymentOptions
;
private
PaymentOptions
PaymentOptions
;
/**
/**
* 发票信息,需要开票时填写
* 发票信息,需要开票时填写
*/
*/
@JSONField
(
name
=
"Taxpayer"
)
private
Taxpayer
Taxpayer
;
private
Taxpayer
Taxpayer
;
@Data
@Data
...
@@ -69,10 +83,12 @@ public class ApplyRequest {
...
@@ -69,10 +83,12 @@ public class ApplyRequest {
/**
/**
* 投保人信息,若未指定投保人,默认选取第一个成年人作为投保人
* 投保人信息,若未指定投保人,默认选取第一个成年人作为投保人
*/
*/
@JSONField
(
name
=
"PolicyHolder"
)
private
PolicyHolder
PolicyHolder
;
private
PolicyHolder
PolicyHolder
;
/**
/**
* 被保人列表
* 被保人列表
*/
*/
@JSONField
(
name
=
"Insureds"
)
private
List
<
Insurant
>
Insureds
;
private
List
<
Insurant
>
Insureds
;
}
}
...
@@ -81,26 +97,32 @@ public class ApplyRequest {
...
@@ -81,26 +97,32 @@ public class ApplyRequest {
/**
/**
* 投保人姓名/名称
* 投保人姓名/名称
*/
*/
@JSONField
(
name
=
"Name"
)
private
String
Name
;
private
String
Name
;
/**
/**
* 投保人性别
* 投保人性别
*/
*/
@JSONField
(
name
=
"Gender"
)
private
String
Gender
;
private
String
Gender
;
/**
/**
* 证件类型,参考字段枚举
* 证件类型,参考字段枚举
*/
*/
@JSONField
(
name
=
"IDTp"
)
private
String
IDTp
;
private
String
IDTp
;
/**
/**
* 证件代码
* 证件代码
*/
*/
@JSONField
(
name
=
"IDNum"
)
private
String
IDNum
;
private
String
IDNum
;
/**
/**
* 出生日期
* 出生日期
*/
*/
@JSONField
(
name
=
"Birthday"
)
private
String
Birthday
;
private
String
Birthday
;
/**
/**
* 手机号码
* 手机号码
*/
*/
@JSONField
(
name
=
"Mobile"
)
private
String
Mobile
;
private
String
Mobile
;
}
}
...
@@ -109,38 +131,47 @@ public class ApplyRequest {
...
@@ -109,38 +131,47 @@ public class ApplyRequest {
/**
/**
* 被保险人姓名
* 被保险人姓名
*/
*/
@JSONField
(
name
=
"Name"
)
private
String
Name
;
private
String
Name
;
/**
/**
* 性别,M代表男,F代表女,U代表未知
* 性别,M代表男,F代表女,U代表未知
*/
*/
@JSONField
(
name
=
"Gender"
)
private
String
Gender
;
private
String
Gender
;
/**
/**
* 证件类型,参考字段枚举
* 证件类型,参考字段枚举
*/
*/
@JSONField
(
name
=
"IDTp"
)
private
String
IDTp
;
private
String
IDTp
;
/**
/**
* 证件号码
* 证件号码
*/
*/
@JSONField
(
name
=
"IDNum"
)
private
String
IDNum
;
private
String
IDNum
;
/**
/**
* 出生日期
* 出生日期
*/
*/
@JSONField
(
name
=
"Birthday"
)
private
String
Birthday
;
private
String
Birthday
;
/**
/**
* 手机号码
* 手机号码
*/
*/
@JSONField
(
name
=
"Mobile"
)
private
String
Mobile
;
private
String
Mobile
;
/**
/**
* 与投保人关系,参考字段枚举
* 与投保人关系,参考字段枚举
*/
*/
@JSONField
(
name
=
"RelationTp"
)
private
String
RelationTp
;
private
String
RelationTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
@JSONField
(
name
=
"StdPremium"
)
private
BigDecimal
StdPremium
;
private
BigDecimal
StdPremium
;
/**
/**
* 实收保费
* 实收保费
*/
*/
@JSONField
(
name
=
"ActPremium"
)
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
}
}
...
...
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/model/res/ApplyResponse.java
浏览文件 @
1c352dd5
...
@@ -12,13 +12,13 @@ import java.util.List;
...
@@ -12,13 +12,13 @@ import java.util.List;
@AllArgsConstructor
@AllArgsConstructor
public
class
ApplyResponse
{
public
class
ApplyResponse
{
/**
/**
*
流水号
*
订单id
*/
*/
private
String
BatchNum
;
private
Integer
OrderID
;
/**
/**
*
产品代码
*
订单号
*/
*/
private
String
Product
Num
;
private
String
Order
Num
;
/**
/**
* 保单生效时间
* 保单生效时间
*/
*/
...
@@ -27,22 +27,6 @@ public class ApplyResponse {
...
@@ -27,22 +27,6 @@ public class ApplyResponse {
* 保单终止时间
* 保单终止时间
*/
*/
private
String
EndDate
;
private
String
EndDate
;
/**
* 旅行团编号
*/
private
String
TourNum
;
/**
* 旅行目的地
*/
private
String
TourDest
;
/**
* 发票大类,p - 个人,E - 企业,U - 未知
*/
private
String
InvoiceKind
;
/**
* 开具发票的类型
*/
private
String
InvoiceTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
...
@@ -52,48 +36,24 @@ public class ApplyResponse {
...
@@ -52,48 +36,24 @@ public class ApplyResponse {
*/
*/
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
/**
/**
* 投保单元列表
* 订单下载链接
*/
private
List
<
Unit
>
Units
;
/**
* 投保数据格式,P:图片, D - 数据
*/
private
String
DataTp
;
/**
* 订单号
*/
*/
private
String
Order
Num
;
private
String
Order
Url
;
/**
/**
*
计划ID
*
投保单元列表
*/
*/
private
int
PlanID
;
private
List
<
Unit
>
Units
;
/**
/**
* 返回代码,0:成功,其他:失败
* 返回代码,0:成功,其他:失败
*/
*/
private
int
ResultTp
;
private
Integer
ResultTp
;
/**
/**
* 返回内容
* 返回内容
*/
*/
private
String
ResultMsg
;
private
String
ResultMsg
;
/**
* 保单下载链接
*/
private
String
PolicyUrl
;
/**
* 订单下载链接
*/
private
String
OrderUrl
;
@Data
@Data
public
static
class
Unit
{
public
static
class
Unit
{
/**
* 投保人信息,投保人年龄必须大于18周岁
*/
private
PolicyHolder
PolicyHolder
;
/**
* 被保人列表
*/
private
List
<
Insured
>
Insureds
;
/**
/**
* 标准保费,Insureds下总被保险人数*标准单价
* 标准保费,Insureds下总被保险人数*标准单价
*/
*/
...
@@ -106,85 +66,18 @@ public class ApplyResponse {
...
@@ -106,85 +66,18 @@ public class ApplyResponse {
* 保单号,投保时返回
* 保单号,投保时返回
*/
*/
private
String
PolicyNum
;
private
String
PolicyNum
;
/**
* 保单url
*/
private
String
PolicyUrl
;
/**
/**
* 返回代码,0:成功,其他:失败
* 返回代码,0:成功,其他:失败
*/
*/
private
int
ResultTp
;
private
Integer
ResultTp
;
/**
/**
* 返回消息
* 返回消息
*/
*/
private
String
ResultMsg
;
private
String
ResultMsg
;
}
}
@Data
public
static
class
PolicyHolder
{
/**
* 投保人姓名/名称
*/
private
String
Name
;
/**
* 投保人性别
*/
private
String
Gender
;
/**
* 证件类型,参考字段枚举
*/
private
String
IDTp
;
/**
* 证件代码
*/
private
String
IDNum
;
/**
* 出生日期
*/
private
String
Birthday
;
/**
* 手机号码
*/
private
String
Mobile
;
}
@Data
public
static
class
Insured
{
/**
* 被保险人姓名
*/
private
String
Name
;
/**
* 性别,M男/F女/U未知
*/
private
String
Gender
;
/**
* 证件类型,参考字段枚举
*/
private
String
IDTp
;
/**
* 证件号码
*/
private
String
IDNum
;
/**
* 出生日期
*/
private
String
Birthday
;
/**
* 手机号码
*/
private
String
Mobile
;
/**
* 与投保人关系,参考字段枚举
*/
private
String
RelationTp
;
/**
* 标准保费
*/
private
BigDecimal
StdPremium
;
/**
* 实收保费
*/
private
BigDecimal
ActPremium
;
/**
* 被保险人ID
*/
private
int
InsuredID
;
}
}
}
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/model/res/IssueResponse.java
浏览文件 @
1c352dd5
...
@@ -15,37 +15,21 @@ import java.util.List;
...
@@ -15,37 +15,21 @@ import java.util.List;
@AllArgsConstructor
@AllArgsConstructor
public
class
IssueResponse
{
public
class
IssueResponse
{
/**
/**
*
渠道类型,默认是B
*
订单id
*/
*/
private
String
ChannelTp
;
private
Integer
OrderID
;
/**
/**
* 流水号
* 订单号
*/
private
String
BatchNum
;
/**
* 产品代码
*/
*/
private
String
Product
Num
;
private
String
Order
Num
;
/**
/**
* 保单生效时间
,格式:yyyy-MM-dd HH:mm:ss
* 保单生效时间
*/
*/
private
String
BeginDate
;
private
String
BeginDate
;
/**
/**
* 保单终止时间
,格式:yyyy-MM-dd HH:mm:ss
* 保单终止时间
*/
*/
private
String
EndDate
;
private
String
EndDate
;
/**
* 旅行团编号
*/
private
String
TourNum
;
/**
* 旅行目的地
*/
private
String
TourDest
;
/**
* 开具发票的类型
*/
private
String
InvoiceTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
...
@@ -55,54 +39,24 @@ public class IssueResponse {
...
@@ -55,54 +39,24 @@ public class IssueResponse {
*/
*/
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
/**
/**
*
投保单元列表
*
订单下载链接
*/
*/
private
List
<
Unit
>
Units
;
private
String
OrderUrl
;
/**
/**
* 投保数据格式
* 投保单元列表
*/
private
String
DataTp
;
/**
* 订单号
*/
private
String
OrderNum
;
/**
* 返回代码,0表示成功
*/
private
int
ResultNum
;
/**
* 付款链接,余额不足时返回
*/
private
String
PaymentUrl
;
/**
* 付款单号
*/
private
String
PaymentNum
;
/**
* 付款金额
*/
*/
private
BigDecimal
PaymentAmt
;
private
List
<
Unit
>
Units
;
/**
/**
* 返回代码
* 返回代码
,0:成功,其他:失败
*/
*/
private
String
ResultTp
;
private
Integer
ResultTp
;
/**
/**
*
提示文本
*
返回内容
*/
*/
private
String
ResultMsg
;
private
String
ResultMsg
;
@Data
@Data
@NoArgsConstructor
@AllArgsConstructor
public
static
class
Unit
{
public
static
class
Unit
{
/**
* 投保人信息,年龄必须大于18周岁
*/
private
PolicyHolder
PolicyHolder
;
/**
* 被保人列表
*/
private
List
<
Insured
>
Insureds
;
/**
/**
* 标准保费,Insureds下总被保险人数*标准单价
* 标准保费,Insureds下总被保险人数*标准单价
*/
*/
...
@@ -112,96 +66,20 @@ public class IssueResponse {
...
@@ -112,96 +66,20 @@ public class IssueResponse {
*/
*/
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
/**
/**
* 标准退款金额
* 保单号,投保时返回
*/
private
BigDecimal
StdRefund
;
/**
* 实际退款金额
*/
private
BigDecimal
ActRefund
;
/**
* 保单号,成功时返回
*/
*/
private
String
PolicyNum
;
private
String
PolicyNum
;
/**
/**
* 返回代码,0表示成功
* 保单url
*/
private
String
ResultTp
;
/**
* 提示文本
*/
private
String
ResultMsg
;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public
static
class
PolicyHolder
{
/**
* 投保人姓名/名称
*/
*/
private
String
Name
;
private
String
PolicyUrl
;
/**
/**
*
投保人性别
*
返回代码,0:成功,其他:失败
*/
*/
private
String
Gender
;
private
Integer
ResultTp
;
/**
/**
*
证件类型:I-身份证,P-护照,J-军官证,K-通行证,T-台湾通行证,G-港澳通行证,O-其他,E-统一信用代码
*
返回消息
*/
*/
private
String
IDTp
;
private
String
ResultMsg
;
/**
* 证件代码
*/
private
String
IDNum
;
/**
* 出生日期,格式:yyyy-MM-dd
*/
private
String
Birthday
;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public
static
class
Insured
{
/**
* 被保险人姓名
*/
private
String
Name
;
/**
* 性别:M-男,F-女,U-未知
*/
private
String
Gender
;
/**
* 证件类型:I-身份证,P-护照,J-军官证,K-通行证,T-台湾通行证,G-港澳通行证,O-其他,E-统一信用代码
*/
private
String
IDTp
;
/**
* 证件号码
*/
private
String
IDNum
;
/**
* 出生日期,格式:yyyy-MM-dd
*/
private
String
Birthday
;
/**
* 与投保人关系
*/
private
String
RelationTp
;
/**
* 标准保费
*/
private
BigDecimal
StdPremium
;
/**
* 实收保费
*/
private
BigDecimal
ActPremium
;
/**
* 标准退款金额
*/
private
BigDecimal
StdRefund
;
/**
* 实际退款金额
*/
private
BigDecimal
ActRefund
;
}
}
}
}
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/model/res/ProposalResponse.java
浏览文件 @
1c352dd5
...
@@ -7,13 +7,13 @@ import java.util.List;
...
@@ -7,13 +7,13 @@ import java.util.List;
@Data
@Data
public
class
ProposalResponse
{
public
class
ProposalResponse
{
/**
/**
*
流水号
*
订单id
*/
*/
private
String
BatchNum
;
private
Integer
OrderID
;
/**
/**
*
产品代码
*
订单号
*/
*/
private
String
Product
Num
;
private
String
Order
Num
;
/**
/**
* 保单生效时间
* 保单生效时间
*/
*/
...
@@ -22,22 +22,6 @@ public class ProposalResponse {
...
@@ -22,22 +22,6 @@ public class ProposalResponse {
* 保单终止时间
* 保单终止时间
*/
*/
private
String
EndDate
;
private
String
EndDate
;
/**
* 旅行团编号
*/
private
String
TourNum
;
/**
* 旅行目的地
*/
private
String
TourDest
;
/**
* 发票大类,p-个人,E-企业,U-未知
*/
private
String
InvoiceKind
;
/**
* 开具发票的类型
*/
private
String
InvoiceTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
...
@@ -49,23 +33,11 @@ public class ProposalResponse {
...
@@ -49,23 +33,11 @@ public class ProposalResponse {
/**
/**
* 投保单元列表
* 投保单元列表
*/
*/
private
List
<
Unit
>
Units
;
private
List
<
IssueResponse
.
Unit
>
Units
;
/**
* 投保数据格式,P-图片, D-数据
*/
private
String
DataTp
;
/**
* 订单号,后续签单,下载,撤单需要用
*/
private
String
OrderNum
;
/**
* 计划ID
*/
private
int
PlanID
;
/**
/**
* 返回代码,0:成功
,
其他:失败
* 返回代码,0:成功
,
其他:失败
*/
*/
private
int
ResultTp
;
private
Integer
ResultTp
;
/**
/**
* 返回内容
* 返回内容
*/
*/
...
@@ -73,14 +45,6 @@ public class ProposalResponse {
...
@@ -73,14 +45,6 @@ public class ProposalResponse {
@Data
@Data
public
static
class
Unit
{
public
static
class
Unit
{
/**
* 投保人信息,投保人年龄必须大于18周岁
*/
private
PolicyHolder
PolicyHolder
;
/**
* 被保人列表
*/
private
List
<
Insured
>
Insureds
;
/**
/**
* 标准保费,Insureds下总被保险人数*标准单价
* 标准保费,Insureds下总被保险人数*标准单价
*/
*/
...
@@ -90,88 +54,16 @@ public class ProposalResponse {
...
@@ -90,88 +54,16 @@ public class ProposalResponse {
*/
*/
private
BigDecimal
ActPremium
;
private
BigDecimal
ActPremium
;
/**
/**
*
核
保单号,投保时返回
* 保单号,投保时返回
*/
*/
private
String
PolicyNum
;
private
String
PolicyNum
;
/**
/**
* 返回代码,0:成功
,
其他:失败
* 返回代码,0:成功
,
其他:失败
*/
*/
private
int
ResultTp
;
private
Integer
ResultTp
;
/**
/**
* 返回消息
* 返回消息
*/
*/
private
String
ResultMsg
;
private
String
ResultMsg
;
}
}
@Data
public
static
class
PolicyHolder
{
/**
* 投保人姓名/名称
*/
private
String
Name
;
/**
* 投保人性别
*/
private
String
Gender
;
/**
* 证件类型,参考字段枚举
*/
private
String
IDTp
;
/**
* 证件代码
*/
private
String
IDNum
;
/**
* 出生日期
*/
private
String
Birthday
;
/**
* 手机号码
*/
private
String
Mobile
;
}
@Data
public
static
class
Insured
{
/**
* 被保险人姓名
*/
private
String
Name
;
/**
* 性别,M男/F女/U未知
*/
private
String
Gender
;
/**
* 证件类型,参考字段枚举
*/
private
String
IDTp
;
/**
* 证件号码
*/
private
String
IDNum
;
/**
* 出生日期
*/
private
String
Birthday
;
/**
* 手机号码
*/
private
String
Mobile
;
/**
* 与投保人关系,参考字段枚举
*/
private
String
RelationTp
;
/**
* 标准保费
*/
private
BigDecimal
StdPremium
;
/**
* 实收保费
*/
private
BigDecimal
ActPremium
;
/**
* 被保险人ID
*/
private
int
InsuredID
;
}
}
}
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/service/WeishiService.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
common
.
weishi
.
service
;
package
org
.
dromara
.
common
.
weishi
.
service
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.req.AuthRequest
;
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.*
;
...
@@ -18,6 +19,13 @@ public interface WeishiService {
...
@@ -18,6 +19,13 @@ public interface WeishiService {
*/
*/
AuthResponse
authorize
();
AuthResponse
authorize
();
/**
* 认证
* @param request 请求参数
* @return 响应参数
*/
AuthResponse
authorize
(
AuthRequest
request
);
/**
/**
* 保险下单接口
* 保险下单接口
*
*
...
@@ -40,7 +48,7 @@ public interface WeishiService {
...
@@ -40,7 +48,7 @@ public interface WeishiService {
* @param orderNum 订单号
* @param orderNum 订单号
* @return 数据
* @return 数据
*/
*/
IssueResponse
insure
Detail
(
String
token
,
String
orderNum
);
IssueResponse
insure
Issue
(
String
token
,
String
orderNum
);
/**
/**
* 订单撤单接口
* 订单撤单接口
...
...
ruoyi-common/ruoyi-common-51weishi/src/main/java/org/dromara/common/weishi/service/impl/WeishiServiceImpl.java
浏览文件 @
1c352dd5
...
@@ -47,45 +47,61 @@ public class WeishiServiceImpl implements WeishiService {
...
@@ -47,45 +47,61 @@ public class WeishiServiceImpl implements WeishiService {
}
}
@Override
@Override
public
A
pplyResponse
insureApply
(
String
token
,
Apply
Request
request
)
{
public
A
uthResponse
authorize
(
Auth
Request
request
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AuthApiEnum
.
AUTHORIZE
.
getUrl
(),
null
,
JSON
.
toJSONString
(
request
));
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
WeishiException
(
res
.
getResultMsg
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
AuthResponse
.
class
);
}
@Override
public
ApplyResponse
insureApply
(
String
token
,
ApplyRequest
request
)
{
ApplyResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
DomainEnum
.
TEST
.
getDomain
(),
InsureApiEnum
.
APPLY
.
getUrl
(),
InsureApiEnum
.
APPLY
.
getUrl
(),
token
,
token
,
JSON
.
toJSONString
(
request
));
JSON
.
toJSONString
(
request
),
ApplyResponse
.
class
);
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
WeishiException
(
res
.
getResultMsg
());
throw
new
WeishiException
(
res
.
getResultMsg
());
}
}
return
JSON
.
parseObject
(
res
.
getData
(),
ApplyResponse
.
class
)
;
return
res
;
}
}
@Override
@Override
public
ProposalResponse
insureProposal
(
String
token
,
ProposalRequest
request
)
{
public
ProposalResponse
insureProposal
(
String
token
,
ProposalRequest
request
)
{
ApiHttp
Response
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
Proposal
Response
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
DomainEnum
.
TEST
.
getDomain
(),
InsureApiEnum
.
PROPOSAL
.
getUrl
(),
InsureApiEnum
.
PROPOSAL
.
getUrl
(),
token
,
token
,
JSON
.
toJSONString
(
request
));
JSON
.
toJSONString
(
request
),
ProposalResponse
.
class
);
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
WeishiException
(
res
.
getResultMsg
());
throw
new
WeishiException
(
res
.
getResultMsg
());
}
}
return
JSON
.
parseObject
(
res
.
getData
(),
ProposalResponse
.
class
)
;
return
res
;
}
}
@Override
@Override
public
IssueResponse
insure
Detail
(
String
token
,
String
orderNum
)
{
public
IssueResponse
insure
Issue
(
String
token
,
String
orderNum
)
{
Map
<
String
,
Object
>
map
=
MapUtil
.<
String
,
Object
>
builder
()
Map
<
String
,
Object
>
map
=
MapUtil
.<
String
,
Object
>
builder
()
.
put
(
"OrderNum"
,
orderNum
)
.
put
(
"OrderNum"
,
orderNum
)
.
build
();
.
build
();
ApiHttp
Response
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
Issue
Response
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
DomainEnum
.
TEST
.
getDomain
(),
StrUtil
.
format
(
InsureApiEnum
.
ISSUE
.
getUrl
(),
map
),
StrUtil
.
format
(
InsureApiEnum
.
ISSUE
.
getUrl
(),
map
),
token
,
token
,
null
);
null
,
IssueResponse
.
class
);
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
if
(!
Objects
.
equals
(
res
.
getResultTp
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
WeishiException
(
res
.
getResultMsg
());
throw
new
WeishiException
(
res
.
getResultMsg
());
}
}
return
JSON
.
parseObject
(
res
.
getData
(),
IssueResponse
.
class
)
;
return
res
;
}
}
@Override
@Override
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/AccountController.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.domain.R
;
import
org.dromara.common.core.validate.EditGroup
;
import
org.dromara.common.idempotent.annotation.RepeatSubmit
;
import
org.dromara.common.log.annotation.Log
;
import
org.dromara.common.log.enums.BusinessType
;
import
org.dromara.common.web.core.BaseController
;
import
org.dromara.mall.controller.weishi.admin.bo.AccountBo
;
import
org.dromara.mall.controller.weishi.admin.vo.AccountVo
;
import
org.dromara.mall.service.weishi.IAccountService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
/**
* 保险账号
* 前端访问路由地址为:/mall/account
*
* @author hzh
* @date 2025-05-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping
(
"/account"
)
public
class
AccountController
extends
BaseController
{
private
final
IAccountService
accountService
;
/**
* 获取保险账号详细信息
*
* @param deptId 主键
*/
@GetMapping
(
"/{deptId}"
)
public
R
<
AccountVo
>
getInfo
(
@NotNull
(
message
=
"部门id不能为空"
)
@PathVariable
Long
deptId
)
{
return
R
.
ok
(
accountService
.
getOne
(
new
AccountBo
().
setDeptId
(
deptId
)));
}
/**
* 修改保险账号
*/
@Log
(
title
=
"保险账号"
,
businessType
=
BusinessType
.
UPDATE
)
@RepeatSubmit
()
@PutMapping
()
public
R
<
Void
>
edit
(
@Validated
(
EditGroup
.
class
)
@RequestBody
AccountBo
bo
)
{
return
toAjax
(
accountService
.
update
(
bo
));
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/bo/AccountBo.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
jakarta.validation.constraints.NotBlank
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.mall.domain.weishi.Account
;
/**
* 保险账号业务对象 weishi_account
*
* @author hzh
* @date 2025-05-15
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@AutoMapper
(
target
=
Account
.
class
,
reverseConvertGenerate
=
false
)
public
class
AccountBo
extends
BaseEntity
{
/**
* id
*/
private
Long
id
;
/**
* 部门id
*/
@NotNull
(
message
=
"部门id不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
deptId
;
/**
* 账号
*/
@NotBlank
(
message
=
"账号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
username
;
/**
* 密码
*/
@NotBlank
(
message
=
"密码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
password
;
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/bo/InsureBo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
import
lombok.experimental.Accessors
;
import
org.dromara.mall.domain.weishi.Insure
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
jakarta.validation.constraints.*
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.mall.domain.weishi.Insure
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -25,148 +22,132 @@ import java.util.Date;
...
@@ -25,148 +22,132 @@ import java.util.Date;
@AutoMapper
(
target
=
Insure
.
class
,
reverseConvertGenerate
=
false
)
@AutoMapper
(
target
=
Insure
.
class
,
reverseConvertGenerate
=
false
)
public
class
InsureBo
extends
BaseEntity
{
public
class
InsureBo
extends
BaseEntity
{
/**
* id
*/
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
EditGroup
.
class
})
private
Long
id
;
private
Long
id
;
/**
/**
* 用户id
* 用户id
*/
*/
@NotNull
(
message
=
"用户id不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
userId
;
private
Long
userId
;
/**
/**
* 会员id
* 会员id
*/
*/
@NotNull
(
message
=
"会员id不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Long
memberId
;
private
Long
memberId
;
/**
/**
* 请求参数
* 请求参数
*/
*/
@NotBlank
(
message
=
"请求参数不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
reqJson
;
private
String
reqJson
;
/**
/**
* 响应参数
* 响应参数
*/
*/
@NotBlank
(
message
=
"响应参数不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
resJson
;
private
String
resJson
;
/**
/**
* 产品信息
* 产品信息
*/
*/
@NotBlank
(
message
=
"产品信息不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
productJson
;
private
String
productJson
;
/**
/**
* 产品列表信息
* 产品列表信息
*/
*/
@NotBlank
(
message
=
"产品列表信息不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
productListJson
;
private
String
productListJson
;
/**
/**
* 渠道类型
* 渠道类型
*/
*/
@NotBlank
(
message
=
"渠道类型不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
channelTp
;
private
String
channelTp
;
/**
/**
* 流水号,幂等且唯一不能重复
* 流水号,幂等且唯一不能重复
*/
*/
@NotBlank
(
message
=
"流水号,幂等且唯一不能重复不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
batchNum
;
private
String
batchNum
;
/**
/**
* 产品计划代码,需联系客户经理提供
* 产品计划代码,需联系客户经理提供
*/
*/
@NotBlank
(
message
=
"产品计划代码,需联系客户经理提供不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
productNum
;
private
String
productNum
;
/**
/**
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@NotNull
(
message
=
"保单生效时间,格式为YYYY-MM-DD HH:MM:SS不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Date
beginDate
;
private
Date
beginDate
;
/**
/**
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@NotNull
(
message
=
"保单终止时间,格式为YYYY-MM-DD HH:MM:SS不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Date
endDate
;
private
Date
endDate
;
/**
/**
* 旅行目的地
* 旅行目的地
*/
*/
@NotBlank
(
message
=
"旅行目的地不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
tourDest
;
private
String
tourDest
;
/**
/**
* 旅行团编号/航班号
* 旅行团编号/航班号
*/
*/
@NotBlank
(
message
=
"旅行团编号/航班号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
tourNum
;
private
String
tourNum
;
/**
/**
* 标准保费合计,是Units中所有标准保费的总和
* 标准保费合计,是Units中所有标准保费的总和
*/
*/
@NotNull
(
message
=
"标准保费合计,是Units中所有标准保费的总和不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
stdPremium
;
private
BigDecimal
stdPremium
;
/**
/**
* 实收保费合计,是Units中所有实收保费的总和
* 实收保费合计,是Units中所有实收保费的总和
*/
*/
@NotNull
(
message
=
"实收保费合计,是Units中所有实收保费的总和不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
actPremium
;
private
BigDecimal
actPremium
;
/**
/**
* 付款链接
* 付款链接
*/
*/
@NotBlank
(
message
=
"付款链接不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
paymentUrl
;
private
String
paymentUrl
;
/**
/**
* 付款单号
* 付款单号
*/
*/
@NotBlank
(
message
=
"付款单号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
paymentNum
;
private
String
paymentNum
;
/**
/**
* 付款金额
* 付款金额
*/
*/
@NotNull
(
message
=
"付款金额不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
paymentAmt
;
private
BigDecimal
paymentAmt
;
/**
/**
* 投保数据格式( P:图片, D - 数据)
* 投保数据格式( P:图片, D - 数据)
*/
*/
@NotBlank
(
message
=
"投保数据格式( P:图片, D - 数据)不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
dataTp
;
private
String
dataTp
;
/**
/**
* 返回代码
* 计划ID
*/
private
Integer
planId
;
/**
* 下单日期
*/
*/
@NotNull
(
message
=
"返回代码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Date
orderTime
;
private
Integer
resultTp
;
/**
/**
*
提示文本
*
订单id
*/
*/
@NotBlank
(
message
=
"提示文本不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
Integer
orderId
;
private
String
resultMsg
;
/**
/**
*
计划ID
*
订单编码
*/
*/
private
Integer
planId
;
private
String
orderNum
;
/**
/**
*
下单日期
*
订单url
*/
*/
@NotNull
(
message
=
"下单日期不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
orderUrl
;
private
Date
orderTime
;
/**
* 状态
*/
private
String
status
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/bo/InsureInsuredsBo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
import
org.dromara.mall.domain.weishi.InsureInsureds
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
jakarta.validation.constraints.*
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.mall.domain.weishi.InsureInsureds
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
/**
/**
...
@@ -24,86 +22,77 @@ public class InsureInsuredsBo extends BaseEntity {
...
@@ -24,86 +22,77 @@ public class InsureInsuredsBo extends BaseEntity {
/**
/**
* id
* id
*/
*/
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
EditGroup
.
class
})
private
Long
id
;
private
Long
id
;
/**
/**
* 订单编号
* 订单编号
*/
*/
@NotBlank
(
message
=
"订单编号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
orderNum
;
private
String
orderNum
;
/**
/**
* 保单号
* 保单号
*/
*/
@NotBlank
(
message
=
"保单号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
policyNum
;
private
String
policyNum
;
/**
/**
* 姓名
* 姓名
*/
*/
@NotBlank
(
message
=
"姓名不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
name
;
private
String
name
;
/**
/**
* 性别
* 性别
*/
*/
@NotBlank
(
message
=
"性别不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
gender
;
private
String
gender
;
/**
/**
* 证件类型
* 证件类型
*/
*/
@NotBlank
(
message
=
"证件类型不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
idTp
;
private
String
idTp
;
/**
/**
* 证件代码
* 证件代码
*/
*/
@NotBlank
(
message
=
"证件代码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
idNum
;
private
String
idNum
;
/**
/**
* 出生日期
* 出生日期
*/
*/
@NotBlank
(
message
=
"出生日期不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
birthday
;
private
String
birthday
;
/**
/**
* 手机号码
* 手机号码
*/
*/
@NotBlank
(
message
=
"手机号码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
mobile
;
private
String
mobile
;
/**
/**
* 与投保人关系
* 与投保人关系
*/
*/
@NotBlank
(
message
=
"与投保人关系不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
relationTp
;
private
String
relationTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
@NotNull
(
message
=
"标准保费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
stdPremium
;
private
BigDecimal
stdPremium
;
/**
/**
* 实收保费
* 实收保费
*/
*/
@NotNull
(
message
=
"实收保费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
actPremium
;
private
BigDecimal
actPremium
;
/**
/**
* 标准退费
* 标准退费
*/
*/
@NotNull
(
message
=
"标准退费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
stdRefund
;
private
BigDecimal
stdRefund
;
/**
/**
* 实收退费
* 实收退费
*/
*/
@NotNull
(
message
=
"实收退费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
actRefund
;
private
BigDecimal
actRefund
;
/**
* 状态
*/
private
String
status
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/bo/InsureUnitBo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
bo
;
import
org.dromara.mall.domain.weishi.InsureUnit
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.common.core.validate.AddGroup
;
import
org.dromara.common.core.validate.EditGroup
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
jakarta.validation.constraints.*
;
import
org.dromara.common.mybatis.core.domain.BaseEntity
;
import
org.dromara.mall.domain.weishi.InsureUnit
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
/**
/**
...
@@ -24,50 +22,47 @@ public class InsureUnitBo extends BaseEntity {
...
@@ -24,50 +22,47 @@ public class InsureUnitBo extends BaseEntity {
/**
/**
* id
* id
*/
*/
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
EditGroup
.
class
})
private
Long
id
;
private
Long
id
;
/**
/**
* 订单编号
* 订单编号
*/
*/
@NotBlank
(
message
=
"订单编号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
orderNum
;
private
String
orderNum
;
/**
/**
* 标准保费
* 标准保费
*/
*/
@NotNull
(
message
=
"标准保费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
stdPremium
;
private
BigDecimal
stdPremium
;
/**
/**
* 实收保费
* 实收保费
*/
*/
@NotNull
(
message
=
"实收保费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
actPremium
;
private
BigDecimal
actPremium
;
/**
/**
* 标准退费
* 标准退费
*/
*/
@NotNull
(
message
=
"标准退费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
stdRefund
;
private
BigDecimal
stdRefund
;
/**
/**
* 实收退费
* 实收退费
*/
*/
@NotNull
(
message
=
"实收退费不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
BigDecimal
actRefund
;
private
BigDecimal
actRefund
;
/**
/**
* 保单号
* 保单号
*/
*/
@NotBlank
(
message
=
"保单号不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
policyNum
;
private
String
policyNum
;
/**
/**
* 返回代码
* 保单url
*/
private
String
policyUrl
;
/**
* 状态
*/
*/
@NotNull
(
message
=
"返回代码不能为空"
,
groups
=
{
AddGroup
.
class
,
EditGroup
.
class
})
private
String
status
;
private
Integer
resultNum
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/vo/AccountVo.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
import
org.dromara.mall.domain.weishi.Account
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
java.io.Serial
;
import
java.io.Serializable
;
/**
* 保险账号视图对象 weishi_account
*
* @author hzh
* @date 2025-05-15
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper
(
target
=
Account
.
class
)
public
class
AccountVo
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@ExcelProperty
(
value
=
"id"
)
private
Long
id
;
/**
* 部门id
*/
@ExcelProperty
(
value
=
"部门id"
)
private
Long
deptId
;
/**
* 账号
*/
@ExcelProperty
(
value
=
"账号"
)
private
String
username
;
/**
* 密码
*/
@ExcelProperty
(
value
=
"密码"
)
private
String
password
;
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/vo/InsureInsuredsVo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
import
java.math.BigDecimal
;
import
org.dromara.mall.domain.weishi.InsureInsureds
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
org.dromara.mall.domain.weishi.InsureInsureds
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
/**
...
@@ -28,86 +27,76 @@ public class InsureInsuredsVo implements Serializable {
...
@@ -28,86 +27,76 @@ public class InsureInsuredsVo implements Serializable {
/**
/**
* id
* id
*/
*/
@ExcelProperty
(
value
=
"id"
)
private
Long
id
;
private
Long
id
;
/**
/**
* 订单编号
* 订单编号
*/
*/
@ExcelProperty
(
value
=
"订单编号"
)
private
String
orderNum
;
private
String
orderNum
;
/**
/**
* 保单号
* 保单号
*/
*/
@ExcelProperty
(
value
=
"保单号"
)
private
String
policyNum
;
private
String
policyNum
;
/**
/**
* 姓名
* 姓名
*/
*/
@ExcelProperty
(
value
=
"姓名"
)
private
String
name
;
private
String
name
;
/**
/**
* 性别
* 性别
*/
*/
@ExcelProperty
(
value
=
"性别"
)
private
String
gender
;
private
String
gender
;
/**
/**
* 证件类型
* 证件类型
*/
*/
@ExcelProperty
(
value
=
"证件类型"
)
private
String
idTp
;
private
String
idTp
;
/**
/**
* 证件代码
* 证件代码
*/
*/
@ExcelProperty
(
value
=
"证件代码"
)
private
String
idNum
;
private
String
idNum
;
/**
/**
* 出生日期
* 出生日期
*/
*/
@ExcelProperty
(
value
=
"出生日期"
)
private
String
birthday
;
private
String
birthday
;
/**
/**
* 手机号码
* 手机号码
*/
*/
@ExcelProperty
(
value
=
"手机号码"
)
private
String
mobile
;
private
String
mobile
;
/**
/**
* 与投保人关系
* 与投保人关系
*/
*/
@ExcelProperty
(
value
=
"与投保人关系"
)
private
String
relationTp
;
private
String
relationTp
;
/**
/**
* 标准保费
* 标准保费
*/
*/
@ExcelProperty
(
value
=
"标准保费"
)
private
BigDecimal
stdPremium
;
private
BigDecimal
stdPremium
;
/**
/**
* 实收保费
* 实收保费
*/
*/
@ExcelProperty
(
value
=
"实收保费"
)
private
BigDecimal
actPremium
;
private
BigDecimal
actPremium
;
/**
/**
* 标准退费
* 标准退费
*/
*/
@ExcelProperty
(
value
=
"标准退费"
)
private
BigDecimal
stdRefund
;
private
BigDecimal
stdRefund
;
/**
/**
* 实收退费
* 实收退费
*/
*/
@ExcelProperty
(
value
=
"实收退费"
)
private
BigDecimal
actRefund
;
private
BigDecimal
actRefund
;
/**
* 状态
*/
private
String
status
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/vo/InsureUnitVo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
org.dromara.mall.domain.weishi.InsureUnit
;
import
org.dromara.mall.domain.weishi.InsureUnit
;
...
@@ -28,50 +27,47 @@ public class InsureUnitVo implements Serializable {
...
@@ -28,50 +27,47 @@ public class InsureUnitVo implements Serializable {
/**
/**
* id
* id
*/
*/
@ExcelProperty
(
value
=
"id"
)
private
Long
id
;
private
Long
id
;
/**
/**
* 订单编号
* 订单编号
*/
*/
@ExcelProperty
(
value
=
"订单编号"
)
private
String
orderNum
;
private
String
orderNum
;
/**
/**
* 标准保费
* 标准保费
*/
*/
@ExcelProperty
(
value
=
"标准保费"
)
private
BigDecimal
stdPremium
;
private
BigDecimal
stdPremium
;
/**
/**
* 实收保费
* 实收保费
*/
*/
@ExcelProperty
(
value
=
"实收保费"
)
private
BigDecimal
actPremium
;
private
BigDecimal
actPremium
;
/**
/**
* 标准退费
* 标准退费
*/
*/
@ExcelProperty
(
value
=
"标准退费"
)
private
BigDecimal
stdRefund
;
private
BigDecimal
stdRefund
;
/**
/**
* 实收退费
* 实收退费
*/
*/
@ExcelProperty
(
value
=
"实收退费"
)
private
BigDecimal
actRefund
;
private
BigDecimal
actRefund
;
/**
/**
* 保单号
* 保单号
*/
*/
@ExcelProperty
(
value
=
"保单号"
)
private
String
policyNum
;
private
String
policyNum
;
/**
/**
*
返回代码
*
保单url
*/
*/
@ExcelProperty
(
value
=
"返回代码"
)
private
String
policyUrl
;
private
Integer
resultNum
;
/**
* 状态
*/
private
String
status
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/admin/vo/InsureVo.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
package
org
.
dromara
.
mall
.
controller
.
weishi
.
admin
.
vo
;
import
java.util.Date
;
import
org.dromara.mall.domain.weishi.Insure
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
io.github.linpeilie.annotations.AutoMapper
;
import
lombok.Data
;
import
lombok.Data
;
import
org.dromara.mall.domain.weishi.Insure
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
/**
...
@@ -26,143 +25,132 @@ public class InsureVo implements Serializable {
...
@@ -26,143 +25,132 @@ public class InsureVo implements Serializable {
@Serial
@Serial
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@ExcelProperty
(
value
=
"id"
)
private
Long
id
;
private
Long
id
;
/**
/**
* 用户id
* 用户id
*/
*/
@ExcelProperty
(
value
=
"用户id"
)
private
Long
userId
;
private
Long
userId
;
/**
/**
* 会员id
* 会员id
*/
*/
@ExcelProperty
(
value
=
"会员id"
)
private
Long
memberId
;
private
Long
memberId
;
/**
/**
* 请求参数
* 请求参数
*/
*/
@ExcelProperty
(
value
=
"请求参数"
)
private
String
reqJson
;
private
String
reqJson
;
/**
/**
* 响应参数
* 响应参数
*/
*/
@ExcelProperty
(
value
=
"响应参数"
)
private
String
resJson
;
private
String
resJson
;
/**
/**
* 产品信息
* 产品信息
*/
*/
@ExcelProperty
(
value
=
"产品信息"
)
private
String
productJson
;
private
String
productJson
;
/**
/**
* 产品列表信息
* 产品列表信息
*/
*/
@ExcelProperty
(
value
=
"产品列表信息"
)
private
String
productListJson
;
private
String
productListJson
;
/**
/**
* 渠道类型
* 渠道类型
*/
*/
@ExcelProperty
(
value
=
"渠道类型"
)
private
String
channelTp
;
private
String
channelTp
;
/**
/**
* 流水号,幂等且唯一不能重复
* 流水号,幂等且唯一不能重复
*/
*/
@ExcelProperty
(
value
=
"流水号,幂等且唯一不能重复"
)
private
String
batchNum
;
private
String
batchNum
;
/**
/**
* 产品计划代码,需联系客户经理提供
* 产品计划代码,需联系客户经理提供
*/
*/
@ExcelProperty
(
value
=
"产品计划代码,需联系客户经理提供"
)
private
String
productNum
;
private
String
productNum
;
/**
/**
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
* 保单生效时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@ExcelProperty
(
value
=
"保单生效时间,格式为YYYY-MM-DD HH:MM:SS"
)
private
Date
beginDate
;
private
Date
beginDate
;
/**
/**
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
* 保单终止时间,格式为YYYY-MM-DD HH:MM:SS
*/
*/
@ExcelProperty
(
value
=
"保单终止时间,格式为YYYY-MM-DD HH:MM:SS"
)
private
Date
endDate
;
private
Date
endDate
;
/**
/**
* 旅行目的地
* 旅行目的地
*/
*/
@ExcelProperty
(
value
=
"旅行目的地"
)
private
String
tourDest
;
private
String
tourDest
;
/**
/**
* 旅行团编号/航班号
* 旅行团编号/航班号
*/
*/
@ExcelProperty
(
value
=
"旅行团编号/航班号"
)
private
String
tourNum
;
private
String
tourNum
;
/**
/**
* 标准保费合计,是Units中所有标准保费的总和
* 标准保费合计,是Units中所有标准保费的总和
*/
*/
@ExcelProperty
(
value
=
"标准保费合计,是Units中所有标准保费的总和"
)
private
BigDecimal
stdPremium
;
private
Long
stdPremium
;
/**
/**
* 实收保费合计,是Units中所有实收保费的总和
* 实收保费合计,是Units中所有实收保费的总和
*/
*/
@ExcelProperty
(
value
=
"实收保费合计,是Units中所有实收保费的总和"
)
private
BigDecimal
actPremium
;
private
Long
actPremium
;
/**
/**
* 付款链接
* 付款链接
*/
*/
@ExcelProperty
(
value
=
"付款链接"
)
private
String
paymentUrl
;
private
String
paymentUrl
;
/**
/**
* 付款单号
* 付款单号
*/
*/
@ExcelProperty
(
value
=
"付款单号"
)
private
String
paymentNum
;
private
String
paymentNum
;
/**
/**
* 付款金额
* 付款金额
*/
*/
@ExcelProperty
(
value
=
"付款金额"
)
private
BigDecimal
paymentAmt
;
private
Long
paymentAmt
;
/**
/**
* 投保数据格式( P:图片, D - 数据)
* 投保数据格式( P:图片, D - 数据)
*/
*/
@ExcelProperty
(
value
=
"投保数据格式( P:图片, D - 数据)"
)
private
String
dataTp
;
private
String
dataTp
;
/**
/**
*
返回代码
*
计划ID
*/
*/
@ExcelProperty
(
value
=
"返回代码"
)
private
Integer
planId
;
private
Long
resultTp
;
/**
/**
*
提示文本
*
下单日期
*/
*/
@ExcelProperty
(
value
=
"提示文本"
)
private
Date
orderTime
;
private
String
resultMsg
;
/**
/**
*
下单日期
*
订单id
*/
*/
@ExcelProperty
(
value
=
"下单日期"
)
private
Integer
orderId
;
private
Date
orderTime
;
/**
* 订单编码
*/
private
String
orderNum
;
/**
* 订单url
*/
private
String
orderUrl
;
/**
* 状态
*/
private
String
status
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/weishi/app/WeishiController.java
浏览文件 @
1c352dd5
...
@@ -93,14 +93,16 @@ public class WeishiController {
...
@@ -93,14 +93,16 @@ public class WeishiController {
/**
/**
*
保单详情
*
签单接口
*
*
* @param orderNum 订单号
* @param orderNum 订单号
* @return
保单详情
* @return
签单数据
*/
*/
@GetMapping
(
"/insureDetail"
)
@PostMapping
(
"/insureIssue/{orderNum}"
)
public
R
<
IssueResponse
>
insureDetail
(
@RequestParam
String
orderNum
)
{
public
R
<
IssueResponse
>
insureIssue
(
@PathVariable
String
orderNum
)
{
return
R
.
ok
(
weishiService
.
insureDetail
(
getToken
(),
orderNum
));
IssueResponse
res
=
weishiService
.
insureIssue
(
getToken
(),
orderNum
);
insureService
.
insureIssue
(
orderNum
);
return
R
.
ok
(
res
);
}
}
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/Account.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
domain
.
weishi
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serial
;
/**
* 保险账号对象 weishi_account
*
* @author hzh
* @date 2025-05-15
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
"weishi_account"
)
public
class
Account
extends
TenantEntity
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@TableId
(
value
=
"id"
)
private
Long
id
;
/**
* 部门id
*/
private
Long
deptId
;
/**
* 账号
*/
private
String
username
;
/**
* 密码
*/
private
String
password
;
/**
* 删除标志(0代表存在 2代表删除)
*/
@TableLogic
private
String
delFlag
;
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/Insure.java
浏览文件 @
1c352dd5
...
@@ -129,24 +129,34 @@ public class Insure extends TenantEntity {
...
@@ -129,24 +129,34 @@ public class Insure extends TenantEntity {
private
String
dataTp
;
private
String
dataTp
;
/**
/**
*
返回代码
*
计划ID
*/
*/
private
Integer
resultTp
;
private
Integer
planId
;
/**
/**
*
计划ID
*
下单日期
*/
*/
private
Integer
planId
;
private
Date
orderTime
;
/**
/**
*
提示文本
*
订单id
*/
*/
private
String
resultMsg
;
private
Integer
orderId
;
/**
/**
*
下单日期
*
订单编码
*/
*/
private
Date
orderTime
;
private
String
orderNum
;
/**
* 订单url
*/
private
String
orderUrl
;
/**
* 状态
*/
private
String
status
;
/**
/**
* 删除标志(0代表存在 2代表删除)
* 删除标志(0代表存在 2代表删除)
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/InsureInsureds.java
浏览文件 @
1c352dd5
...
@@ -95,6 +95,11 @@ public class InsureInsureds extends TenantEntity {
...
@@ -95,6 +95,11 @@ public class InsureInsureds extends TenantEntity {
*/
*/
private
BigDecimal
actRefund
;
private
BigDecimal
actRefund
;
/**
* 状态
*/
private
String
status
;
/**
/**
* 删除标志(0代表存在 2代表删除)
* 删除标志(0代表存在 2代表删除)
*/
*/
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/domain/weishi/InsureUnit.java
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
domain
.
weishi
;
package
org
.
dromara
.
mall
.
domain
.
weishi
;
import
lombok.experimental.Accessors
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.
*
;
import
com.baomidou.mybatisplus.annotation.
TableName
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
import
lombok.experimental.Accessors
;
import
org.dromara.common.tenant.core.TenantEntity
;
import
java.io.Serial
;
import
java.io.Serial
;
import
java.math.BigDecimal
;
/**
/**
* 保险订单-投保单元对象 weishi_insure_unit
* 保险订单-投保单元对象 weishi_insure_unit
...
@@ -61,9 +63,14 @@ public class InsureUnit extends TenantEntity {
...
@@ -61,9 +63,14 @@ public class InsureUnit extends TenantEntity {
private
String
policyNum
;
private
String
policyNum
;
/**
/**
* 返回代码
* 保单url
*/
private
String
policyUrl
;
/**
* 状态
*/
*/
private
Integer
resultNum
;
private
String
status
;
/**
/**
* 删除标志(0代表存在 2代表删除)
* 删除标志(0代表存在 2代表删除)
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/mapper/AccountMapper.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
mapper
;
import
org.dromara.mall.domain.weishi.Account
;
import
org.dromara.mall.controller.weishi.admin.vo.AccountVo
;
import
org.dromara.common.mybatis.core.mapper.BaseMapperPlus
;
/**
* 保险账号Mapper接口
*
* @author hzh
* @date 2025-05-15
*/
public
interface
AccountMapper
extends
BaseMapperPlus
<
Account
,
AccountVo
>
{
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/IAccountService.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
service
.
weishi
;
import
org.dromara.common.mybatis.service.IBaseService
;
import
org.dromara.mall.domain.weishi.Account
;
import
org.dromara.mall.controller.weishi.admin.bo.AccountBo
;
import
org.dromara.mall.controller.weishi.admin.vo.AccountVo
;
/**
* 保险账号Service接口
*
* @author hzh
* @date 2025-05-15
*/
public
interface
IAccountService
extends
IBaseService
<
AccountVo
,
AccountBo
,
Account
>
{
/**
* 跟新
*
* @param bo bo
* @return 是否成功
*/
int
update
(
AccountBo
bo
);
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/IInsureService.java
浏览文件 @
1c352dd5
...
@@ -37,6 +37,13 @@ public interface IInsureService extends IBaseService<InsureVo, InsureBo, Insure>
...
@@ -37,6 +37,13 @@ public interface IInsureService extends IBaseService<InsureVo, InsureBo, Insure>
*/
*/
void
insureCancel
(
String
orderNum
);
void
insureCancel
(
String
orderNum
);
/**
* 签单
*
* @param orderNum 订单编码
*/
void
insureIssue
(
String
orderNum
);
/**
/**
* 保单取消
* 保单取消
*
*
...
...
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/IThirdWeishiService.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
service
.
weishi
;
/**
* @author wenhe
*/
public
interface
IThirdWeishiService
{
/**
* 获取token
*
* @param deptId 部门id
* @return token
*/
String
getToken
(
Long
deptId
);
/**
* 更新部门token
*
* @param deptId 部门id
*/
void
updateToken
(
Long
deptId
);
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/impl/AccountServiceImpl.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
service
.
weishi
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.utils.StringUtils
;
import
org.dromara.common.mybatis.core.mapper.BaseMapperPlus
;
import
org.dromara.common.mybatis.service.AbstractBaseService
;
import
org.dromara.mall.domain.weishi.Account
;
import
org.dromara.mall.controller.weishi.admin.bo.AccountBo
;
import
org.dromara.mall.controller.weishi.admin.vo.AccountVo
;
import
org.dromara.mall.mapper.AccountMapper
;
import
org.dromara.mall.service.weishi.IAccountService
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
/**
* 保险账号Service业务层处理
*
* @author hzh
* @date 2025-05-15
*/
@RequiredArgsConstructor
@Service
public
class
AccountServiceImpl
extends
AbstractBaseService
<
AccountVo
,
AccountBo
,
Account
>
implements
IAccountService
{
private
final
AccountMapper
baseMapper
;
@Override
public
BaseMapperPlus
<
Account
,
AccountVo
>
mapper
()
{
return
baseMapper
;
}
@Override
public
LambdaQueryWrapper
<
Account
>
buildQueryWrapper
(
AccountBo
bo
)
{
Map
<
String
,
Object
>
params
=
bo
.
getParams
();
LambdaQueryWrapper
<
Account
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
bo
.
getDeptId
()
!=
null
,
Account:
:
getDeptId
,
bo
.
getDeptId
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getUsername
()),
Account:
:
getUsername
,
bo
.
getUsername
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPassword
()),
Account:
:
getPassword
,
bo
.
getPassword
());
return
lqw
;
}
@Override
public
int
update
(
AccountBo
bo
)
{
return
0
;
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/impl/InsureServiceImpl.java
浏览文件 @
1c352dd5
...
@@ -11,10 +11,10 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
...
@@ -11,10 +11,10 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import
org.dromara.common.mybatis.service.AbstractBaseService
;
import
org.dromara.common.mybatis.service.AbstractBaseService
;
import
org.dromara.common.redis.utils.RedisUtils
;
import
org.dromara.common.redis.utils.RedisUtils
;
import
org.dromara.common.satoken.utils.LoginHelper
;
import
org.dromara.common.satoken.utils.LoginHelper
;
import
org.dromara.common.weishi.constant.OrderStatus
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.req.ApplyRequest
;
import
org.dromara.common.weishi.model.res.ApplyResponse
;
import
org.dromara.common.weishi.model.res.ApplyResponse
;
import
org.dromara.common.weishi.model.res.AuthResponse
;
import
org.dromara.common.weishi.model.res.AuthResponse
;
import
org.dromara.common.weishi.model.res.IssueResponse
;
import
org.dromara.common.weishi.model.res.ProductsResponse
;
import
org.dromara.common.weishi.model.res.ProductsResponse
;
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.bo.InsureBo
;
...
@@ -77,8 +77,6 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -77,8 +77,6 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPaymentNum
()),
Insure:
:
getPaymentNum
,
bo
.
getPaymentNum
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getPaymentNum
()),
Insure:
:
getPaymentNum
,
bo
.
getPaymentNum
());
lqw
.
eq
(
bo
.
getPaymentAmt
()
!=
null
,
Insure:
:
getPaymentAmt
,
bo
.
getPaymentAmt
());
lqw
.
eq
(
bo
.
getPaymentAmt
()
!=
null
,
Insure:
:
getPaymentAmt
,
bo
.
getPaymentAmt
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getDataTp
()),
Insure:
:
getDataTp
,
bo
.
getDataTp
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getDataTp
()),
Insure:
:
getDataTp
,
bo
.
getDataTp
());
lqw
.
eq
(
bo
.
getResultTp
()
!=
null
,
Insure:
:
getResultTp
,
bo
.
getResultTp
());
lqw
.
eq
(
StringUtils
.
isNotBlank
(
bo
.
getResultMsg
()),
Insure:
:
getResultMsg
,
bo
.
getResultMsg
());
lqw
.
eq
(
bo
.
getOrderTime
()
!=
null
,
Insure:
:
getOrderTime
,
bo
.
getOrderTime
());
lqw
.
eq
(
bo
.
getOrderTime
()
!=
null
,
Insure:
:
getOrderTime
,
bo
.
getOrderTime
());
return
lqw
;
return
lqw
;
}
}
...
@@ -102,21 +100,10 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -102,21 +100,10 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
String
token
=
getToken
();
String
token
=
getToken
();
//获取产品列表
//获取产品列表
List
<
ProductsResponse
>
productList
=
weishiService
.
productList
(
token
);
List
<
ProductsResponse
>
productList
=
weishiService
.
productList
(
token
);
//获取订单详情
IssueResponse
issueRes
=
weishiService
.
insureDetail
(
token
,
res
.
getOrderNum
());
//设置参数
//设置参数
Insure
insure
=
new
Insure
();
Insure
insure
=
new
Insure
();
BeanUtil
.
copyProperties
(
res
,
insure
,
true
);
BeanUtil
.
copyProperties
(
req
,
insure
,
true
);
insure
.
setUserId
(
LoginHelper
.
getUserId
())
insure
.
setUserId
(
LoginHelper
.
getUserId
()).
setMemberId
(
LoginHelper
.
getMemberId
()).
setReqJson
(
JSONUtil
.
toJsonStr
(
req
)).
setResJson
(
JSONUtil
.
toJsonStr
(
res
)).
setProductJson
(
JSONUtil
.
toJsonStr
(
weishiService
.
productDetail
(
token
,
req
.
getProductId
()))).
setProductListJson
(
JSONUtil
.
toJsonStr
(
StreamUtils
.
findFirst
(
productList
,
p
->
Objects
.
equals
(
p
.
getProductID
(),
req
.
getProductId
())))).
setOrderNum
(
res
.
getOrderNum
()).
setOrderUrl
(
res
.
getOrderUrl
()).
setOrderId
(
res
.
getOrderID
()).
setStatus
(
OrderStatus
.
P
.
getKey
())
.
setMemberId
(
LoginHelper
.
getMemberId
())
.
setReqJson
(
JSONUtil
.
toJsonStr
(
req
))
.
setResJson
(
JSONUtil
.
toJsonStr
(
res
))
.
setProductJson
(
JSONUtil
.
toJsonStr
(
weishiService
.
productDetail
(
token
,
req
.
getProductId
())))
.
setProductListJson
(
JSONUtil
.
toJsonStr
(
StreamUtils
.
findFirst
(
productList
,
p
->
Objects
.
equals
(
p
.
getProductID
(),
req
.
getProductId
()))))
.
setChannelTp
(
issueRes
.
getChannelTp
())
.
setPaymentUrl
(
issueRes
.
getPaymentUrl
())
.
setPaymentNum
(
issueRes
.
getPaymentNum
())
.
setPaymentAmt
(
issueRes
.
getPaymentAmt
())
.
setOrderTime
(
new
Date
());
.
setOrderTime
(
new
Date
());
insure
.
setCreateDept
(
LoginHelper
.
getDeptId
());
insure
.
setCreateDept
(
LoginHelper
.
getDeptId
());
baseMapper
.
insert
(
insure
);
baseMapper
.
insert
(
insure
);
...
@@ -130,34 +117,24 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -130,34 +117,24 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
}
}
//保存投保单元
//保存投保单元
List
<
ApplyResponse
.
Unit
>
units
=
res
.
getUnits
();
List
<
ApplyResponse
.
Unit
>
units
=
res
.
getUnits
();
List
<
IssueResponse
.
Unit
>
irUnits
=
issueRes
.
getUnits
();
List
<
ApplyRequest
.
InsureUnit
>
reqUnits
=
req
.
getUnits
();
for
(
ApplyResponse
.
Unit
unit
:
units
)
{
for
(
int
i
=
0
;
i
<
units
.
size
();
i
++)
{
ApplyResponse
.
Unit
unit
=
units
.
get
(
i
);
InsureUnit
iu
=
new
InsureUnit
();
InsureUnit
iu
=
new
InsureUnit
();
BeanUtil
.
copyProperties
(
unit
,
iu
,
true
);
BeanUtil
.
copyProperties
(
unit
,
iu
,
true
);
IssueResponse
.
Unit
irUnit
=
StreamUtils
.
findFirst
(
irUnits
,
i
->
StringUtils
.
equals
(
i
.
getPolicyNum
(),
unit
.
getPolicyNum
()));
iu
.
setOrderNum
(
res
.
getOrderNum
());
assert
irUnit
!=
null
;
iu
.
setOrderNum
(
res
.
getOrderNum
())
.
setStdRefund
(
irUnit
.
getStdRefund
())
.
setActRefund
(
irUnit
.
getActRefund
());
unitMapper
.
insert
(
iu
);
unitMapper
.
insert
(
iu
);
//保存投保人信息
//保存投保人信息
ApplyRe
sponse
.
PolicyHolder
ph
=
unit
.
getPolicyHolder
();
ApplyRe
quest
.
PolicyHolder
ph
=
reqUnits
.
get
(
i
)
.
getPolicyHolder
();
InsurePolicyHolder
iph
=
BeanUtil
.
copyProperties
(
ph
,
InsurePolicyHolder
.
class
);
InsurePolicyHolder
iph
=
BeanUtil
.
copyProperties
(
ph
,
InsurePolicyHolder
.
class
);
iph
.
setOrderNum
(
res
.
getOrderNum
())
iph
.
setOrderNum
(
res
.
getOrderNum
()).
setPolicyNum
(
unit
.
getPolicyNum
());
.
setPolicyNum
(
unit
.
getPolicyNum
());
policyHolderMapper
.
insert
(
iph
);
policyHolderMapper
.
insert
(
iph
);
//保存被保人信息
//保存被保人信息
List
<
ApplyResponse
.
Insured
>
insureds
=
unit
.
getInsureds
();
List
<
ApplyRequest
.
Insurant
>
insureds
=
reqUnits
.
get
(
i
).
getInsureds
();
List
<
IssueResponse
.
Insured
>
arInsureds
=
irUnit
.
getInsureds
();
for
(
ApplyRequest
.
Insurant
insured
:
insureds
)
{
for
(
ApplyResponse
.
Insured
insured
:
insureds
)
{
InsureInsureds
ins
=
new
InsureInsureds
();
InsureInsureds
ins
=
new
InsureInsureds
();
BeanUtil
.
copyProperties
(
insured
,
ins
,
true
);
BeanUtil
.
copyProperties
(
insured
,
ins
,
true
);
IssueResponse
.
Insured
iri
=
StreamUtils
.
findFirst
(
arInsureds
,
a
->
StringUtils
.
equals
(
a
.
getIDNum
(),
insured
.
getIDNum
()));
ins
.
setOrderNum
(
res
.
getOrderNum
()).
setPolicyNum
(
unit
.
getPolicyNum
());
assert
iri
!=
null
;
ins
.
setOrderNum
(
res
.
getOrderNum
())
.
setPolicyNum
(
unit
.
getPolicyNum
())
.
setActRefund
(
iri
.
getActRefund
())
.
setStdRefund
(
iri
.
getStdRefund
());
insuredsMapper
.
insert
(
ins
);
insuredsMapper
.
insert
(
ins
);
}
}
}
}
...
@@ -166,54 +143,38 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
...
@@ -166,54 +143,38 @@ public class InsureServiceImpl extends AbstractBaseService<InsureVo, InsureBo, I
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
void
insureCancel
(
String
orderNum
)
{
public
void
insureCancel
(
String
orderNum
)
{
//获取订单详情
updateStatus
(
orderNum
,
OrderStatus
.
W
.
getKey
());
IssueResponse
issueRes
=
weishiService
.
insureDetail
(
getToken
(),
orderNum
);
}
@Override
public
void
insureIssue
(
String
orderNum
)
{
updateStatus
(
orderNum
,
OrderStatus
.
E
.
getKey
());
}
private
void
updateStatus
(
String
orderNum
,
String
orderStatus
)
{
Insure
insure
=
baseMapper
.
selectOne
(
Insure:
:
getOrderNum
,
orderNum
);
insure
.
setStatus
(
orderStatus
);
baseMapper
.
updateById
(
insure
);
//获取投保单位
//获取投保单位
List
<
InsureUnit
>
unitList
=
unitMapper
.
selectList
(
InsureUnit:
:
getOrderNum
,
orderNum
);
List
<
InsureUnit
>
unitList
=
unitMapper
.
selectList
(
InsureUnit:
:
getOrderNum
,
orderNum
);
//获取被保人信息
//获取被保人信息
List
<
InsureInsureds
>
insuredList
=
insuredsMapper
.
selectList
(
InsureInsureds:
:
getOrderNum
,
orderNum
);
List
<
InsureInsureds
>
insuredList
=
insuredsMapper
.
selectList
(
InsureInsureds:
:
getOrderNum
,
orderNum
);
//跟新退款信息
//跟新投保单位
updateRefundInfo
(
issueRes
,
unitList
,
insuredList
);
unitList
.
forEach
(
unit
->
{
unit
.
setStatus
(
orderStatus
);
unitMapper
.
updateById
(
unit
);
});
//跟新被保人信息
insuredList
.
forEach
(
i
->
{
i
.
setStatus
(
orderStatus
);
insuredsMapper
.
updateById
(
i
);
});
}
}
@Override
@Override
public
void
policyCancel
(
String
policyNum
)
{
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
);
}
}
}
}
}
}
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/service/weishi/impl/ThirdWeishiServiceImpl.java
0 → 100644
浏览文件 @
1c352dd5
package
org
.
dromara
.
mall
.
service
.
weishi
.
impl
;
import
lombok.RequiredArgsConstructor
;
import
org.dromara.common.core.utils.StringUtils
;
import
org.dromara.common.redis.utils.RedisUtils
;
import
org.dromara.common.weishi.model.req.AuthRequest
;
import
org.dromara.common.weishi.model.res.AuthResponse
;
import
org.dromara.common.weishi.service.WeishiService
;
import
org.dromara.mall.domain.weishi.Account
;
import
org.dromara.mall.mapper.AccountMapper
;
import
org.dromara.mall.service.weishi.IThirdWeishiService
;
import
org.springframework.stereotype.Service
;
import
java.time.Duration
;
import
java.util.Objects
;
/**
* @author hzh
* @date 2025-05-15
**/
@Service
@RequiredArgsConstructor
public
class
ThirdWeishiServiceImpl
implements
IThirdWeishiService
{
private
final
WeishiService
weishiService
;
private
final
AccountMapper
accountMapper
;
String
WEISHI_TOKEN
=
"mall:third:weishi:token:{}:{}"
;
@Override
public
String
getToken
(
Long
deptId
)
{
if
(
Objects
.
isNull
(
deptId
))
{
throw
new
RuntimeException
(
"该账号无部门,请先配置部门在使用旅游产品接口"
);
}
Account
account
=
accountMapper
.
selectOne
(
Account:
:
getDeptId
,
deptId
);
if
(
Objects
.
isNull
(
account
))
{
throw
new
RuntimeException
(
"该部门没有配置"
);
}
String
key
=
StringUtils
.
format
(
WEISHI_TOKEN
,
account
.
getTenantId
(),
account
.
getDeptId
());
String
token
=
RedisUtils
.
getCacheObject
(
key
);
if
(
StringUtils
.
isEmpty
(
token
))
{
AuthResponse
res
=
weishiService
.
authorize
(
new
AuthRequest
(
account
.
getUsername
(),
account
.
getPassword
()));
RedisUtils
.
setCacheObject
(
key
,
res
.
getAccess_token
(),
Duration
.
ofSeconds
(
res
.
getExpires_in
().
longValue
()));
token
=
res
.
getAccess_token
();
}
return
token
;
}
@Override
public
void
updateToken
(
Long
deptId
)
{
}
}
ruoyi-modules/ruoyi-mall/src/main/resources/mapper/mall/AccountMapper.xml
0 → 100644
浏览文件 @
1c352dd5
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.dromara.mall.mapper.AccountMapper"
>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论