Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
c639ac78
Commit
c639ac78
authored
Dec 02, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改保险
parent
ea0b9ff9
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
399 additions
and
20 deletions
+399
-20
CommonBaseController.java
...ub/wxiaoqi/security/common/rest/CommonBaseController.java
+61
-0
UserRestInterface.java
.../wxiaoqi/security/admin/feign/rest/UserRestInterface.java
+10
-0
pom.xml
xx-activity/xx-activity-server/pom.xml
+5
-0
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+6
-0
InsureUser.java
.../main/java/com/xxfc/platform/order/entity/InsureUser.java
+7
-2
OrderPersonInsurance.java
.../com/xxfc/platform/order/entity/OrderPersonInsurance.java
+26
-1
AddRentVehicleDTO.java
...xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
+2
-1
BgPageDTO.java
...m/xxfc/platform/order/pojo/personinsurance/BgPageDTO.java
+14
-0
BgPageVO.java
...om/xxfc/platform/order/pojo/personinsurance/BgPageVO.java
+14
-0
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+29
-5
OrderPersonInsuranceBiz.java
.../com/xxfc/platform/order/biz/OrderPersonInsuranceBiz.java
+21
-0
OrderRentVehicleBiz.java
...java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
+36
-1
OrderPersonInsuranceMapper.java
...xfc/platform/order/mapper/OrderPersonInsuranceMapper.java
+7
-1
InsureUserController.java
...va/com/xxfc/platform/order/rest/InsureUserController.java
+1
-1
OrderRentVehicleController.java
.../xxfc/platform/order/rest/OrderRentVehicleController.java
+2
-2
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+1
-1
SpecialRentController.java
...a/com/xxfc/platform/order/rest/SpecialRentController.java
+1
-1
BgShuntApplyController.java
...latform/order/rest/background/BgShuntApplyController.java
+2
-2
PgOrderPersonInsuranceController.java
...der/rest/background/PgOrderPersonInsuranceController.java
+109
-0
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+4
-2
OrderPersonInsuranceMapper.xml
.../src/main/resources/mapper/OrderPersonInsuranceMapper.xml
+41
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/CommonBaseController.java
View file @
c639ac78
package
com
.
github
.
wxiaoqi
.
security
.
common
.
rest
;
package
com
.
github
.
wxiaoqi
.
security
.
common
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.net.URLEncoder
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Supplier
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -28,6 +38,13 @@ public class CommonBaseController {
...
@@ -28,6 +38,13 @@ public class CommonBaseController {
return
request
;
return
request
;
}
}
@Autowired
public
HttpServletResponse
response
;
public
HttpServletResponse
getResponse
()
{
return
response
;
}
public
String
getCurrentUserName
(){
public
String
getCurrentUserName
(){
return
BaseContextHandler
.
getUsername
();
return
BaseContextHandler
.
getUsername
();
}
}
...
@@ -44,4 +61,48 @@ public class CommonBaseController {
...
@@ -44,4 +61,48 @@ public class CommonBaseController {
}
}
}
}
public
void
export
(
Logger
log
,
Map
<
String
,
Object
>
headerAlias
,
Supplier
<
List
<
Map
>>
function
,
String
title
)
throws
Exception
{
HttpServletResponse
httpServletResponse
=
getResponse
();
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
if
(
StrUtil
.
isBlank
(
title
))
{
title
=
System
.
currentTimeMillis
()+
""
;
}
try
{
//封装表头
headerAlias
.
keySet
().
forEach
(
key
->
{
writer
.
addHeaderAlias
(
key
,
headerAlias
.
get
(
key
).
toString
());
});
log
.
info
(
"======export==== "
);
//处理数据
List
<
Map
>
list
=
function
.
get
();
if
(
list
.
size
()
==
0
)
{
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
headerAlias
.
keySet
().
forEach
(
key
->
{
writer
.
addHeaderAlias
(
key
,
""
);
});
list
.
add
(
map
);
}
log
.
info
(
"list: {} "
,
JSONUtil
.
toJsonStr
(
list
));
writer
.
write
(
list
);
httpServletResponse
.
setContentType
(
"application/octet-stream;charset=utf-8"
);
httpServletResponse
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
title
+
".xlsx"
,
"utf-8"
));
writer
.
flush
(
httpServletResponse
.
getOutputStream
());
}
catch
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
(),
ex
);
throw
ex
;
}
finally
{
writer
.
close
();
}
}
public
<
T
>
void
exportBean
(
Logger
log
,
T
headerAlias
,
Supplier
<
List
<
Map
>>
function
,
String
title
)
throws
Exception
{
export
(
log
,
BeanUtil
.
beanToMap
(
headerAlias
),
()->
function
.
get
()
,
title
);
}
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/rest/UserRestInterface.java
View file @
c639ac78
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
feign
.
rest
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
feign
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
...
@@ -10,12 +15,17 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -10,12 +15,17 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.DataInter
;
import
com.github.wxiaoqi.security.common.vo.DataInter
;
import
com.github.wxiaoqi.security.common.vo.DataInterBean
;
import
com.github.wxiaoqi.security.common.vo.DataInterBean
;
import
org.slf4j.Logger
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Supplier
;
public
interface
UserRestInterface
{
public
interface
UserRestInterface
{
public
UserFeign
getUserFeign
();
public
UserFeign
getUserFeign
();
...
...
xx-activity/xx-activity-server/pom.xml
View file @
c639ac78
...
@@ -23,6 +23,11 @@
...
@@ -23,6 +23,11 @@
<version>
2.0-SNAPSHOT
</version>
<version>
2.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.redisson
</groupId>
<artifactId>
redisson-spring-boot-starter
</artifactId>
<version>
3.11.0
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
c639ac78
...
@@ -366,4 +366,10 @@ public class BaseOrder implements Serializable {
...
@@ -366,4 +366,10 @@ public class BaseOrder implements Serializable {
@Column
(
name
=
"is_appraise"
)
@Column
(
name
=
"is_appraise"
)
private
Integer
isAppraise
;
private
Integer
isAppraise
;
@Column
(
name
=
"insure_pic"
)
private
String
insurePic
;
@Column
(
name
=
"insure_status"
)
private
Integer
insureStatus
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/InsureUser.java
View file @
c639ac78
...
@@ -47,8 +47,13 @@ public class InsureUser implements Serializable {
...
@@ -47,8 +47,13 @@ public class InsureUser implements Serializable {
@Column
(
name
=
"id_card"
)
@Column
(
name
=
"id_card"
)
@ApiModelProperty
(
value
=
"身份证"
)
@ApiModelProperty
(
value
=
"身份证"
)
private
String
idCard
;
private
String
idCard
;
/**
//手机号
@Column
(
name
=
"phone"
)
@ApiModelProperty
(
value
=
"手机号"
)
private
String
phone
;
/**
* 创建时间
* 创建时间
*/
*/
@Column
(
name
=
"crt_time"
)
@Column
(
name
=
"crt_time"
)
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderPersonInsurance.java
View file @
c639ac78
...
@@ -38,7 +38,18 @@ public class OrderPersonInsurance implements Serializable {
...
@@ -38,7 +38,18 @@ public class OrderPersonInsurance implements Serializable {
@Column
(
name
=
"order_id"
)
@Column
(
name
=
"order_id"
)
@ApiModelProperty
(
value
=
"基础订单id"
)
@ApiModelProperty
(
value
=
"基础订单id"
)
private
Integer
orderId
;
private
Integer
orderId
;
public
void
setOrderId
(
Integer
orderId
)
{
this
.
orderId
=
orderId
;
}
/**
* 基础订单编号
*/
@Column
(
name
=
"order_no"
)
@ApiModelProperty
(
value
=
"基础订单编号"
)
private
String
orderNo
;
/**
/**
* 姓名
* 姓名
*/
*/
...
@@ -87,6 +98,20 @@ public class OrderPersonInsurance implements Serializable {
...
@@ -87,6 +98,20 @@ public class OrderPersonInsurance implements Serializable {
@Column
(
name
=
"end_time"
)
@Column
(
name
=
"end_time"
)
@ApiModelProperty
(
value
=
"结束时间"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Long
endTime
;
private
Long
endTime
;
/**
* 支付时间
*/
@Column
(
name
=
"pay_time"
)
@ApiModelProperty
(
value
=
"支付时间"
)
private
Long
paytime
;
/**
* 退款时间
*/
@Column
(
name
=
"refund_time"
)
@ApiModelProperty
(
value
=
"退款时间"
)
private
Long
refundTime
;
/**
/**
* 订单的天数
* 订单的天数
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/add/AddRentVehicleDTO.java
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
pojo
.
order
.
add
;
package
com
.
xxfc
.
platform
.
order
.
pojo
.
order
.
add
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.pojo.OrderAccompanyDTO
;
import
com.xxfc.platform.order.pojo.OrderAccompanyDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -139,7 +140,7 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
...
@@ -139,7 +140,7 @@ public class AddRentVehicleDTO extends AddOrderCommonDTO{
private
Integer
needPersonInsurance
=
SYS_FALSE
;
private
Integer
needPersonInsurance
=
SYS_FALSE
;
private
String
insureUserIds
;
private
String
insureUserIds
;
private
List
<
OrderPersonInsurance
>
insurances
;
private
AppUserDTO
appUserDTO
;
public
void
setStartTime
(
Long
startTime
)
{
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
this
.
startTime
=
startTime
;
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/personinsurance/BgPageDTO.java
0 → 100644
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
pojo
.
personinsurance
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
BgPageDTO
extends
PageParam
{
private
String
no
;
private
String
insurePic
;
private
List
<
OrderPersonInsurance
>
insuranceList
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/personinsurance/BgPageVO.java
0 → 100644
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
pojo
.
personinsurance
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
java.util.List
;
@Data
public
class
BgPageVO
{
private
String
no
;
private
String
insurePic
;
private
List
<
OrderPersonInsurance
>
insuranceList
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
c639ac78
...
@@ -2,6 +2,9 @@ package com.xxfc.platform.order.biz;
...
@@ -2,6 +2,9 @@ package com.xxfc.platform.order.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
@@ -32,6 +35,7 @@ import com.xxfc.platform.order.pojo.price.CostDetailExtend;
...
@@ -32,6 +35,7 @@ import com.xxfc.platform.order.pojo.price.CostDetailExtend;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
//import com.xxfc.platform.universal.utils.DateUtil;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -344,12 +348,21 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -344,12 +348,21 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
return
deductGoodsAmount
;
return
deductGoodsAmount
;
}
}
public
void
calculatePersonInsurance
(
Long
timeLag
,
OrderPersonInsurance
opi
)
{
public
void
calculatePersonInsurance
(
Long
startLong
,
Long
endLong
,
OrderPersonInsurance
opi
)
{
DateTime
startDateBegin
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
(
startLong
));
DateTime
endDateEnd
=
DateUtil
.
endOfDay
(
DateUtil
.
date
(
endLong
));
opi
.
setAmount
(
BigDecimal
.
ZERO
);
opi
.
setAmount
(
BigDecimal
.
ZERO
);
opi
.
setStatus
(-
1
);
opi
.
setStatus
(-
1
);
//获取天
//获取天
Integer
remainder
=
Long
.
valueOf
(
timeLag
%(
1000L
*
60L
*
60L
*
24L
)).
intValue
();
// Integer remainder = Long.valueOf(timeLag%(1000L * 60L * 60L * 24L)).intValue();
Integer
dayLag
=
Long
.
valueOf
(
timeLag
/(
1000L
*
60L
*
60L
*
24L
)).
intValue
()
+
remainder
>
0
?
1
:
0
;
// Integer dayLag = Long.valueOf(timeLag/(1000L * 60L * 60L * 24L)).intValue() + remainder > 0? 1: 0;
Long
dayLag
=
DateUtil
.
between
(
startDateBegin
,
endDateEnd
,
DateUnit
.
DAY
);
if
(!
DateUtil
.
beginOfDay
(
DateUtil
.
date
()).
equals
(
startDateBegin
))
{
dayLag
+=
1L
;
}
else
{
startDateBegin
=
DateUtil
.
offsetDay
(
startDateBegin
,
1
);
}
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
Set
<
Dictionary
>
personInsurances
=
dictionaryMap
.
get
(
DictionaryKey
.
APP_ORDER
+
"_"
+
RENT_PERSON_INSURANCE
).
getChildrens
();
Set
<
Dictionary
>
personInsurances
=
dictionaryMap
.
get
(
DictionaryKey
.
APP_ORDER
+
"_"
+
RENT_PERSON_INSURANCE
).
getChildrens
();
...
@@ -369,6 +382,8 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -369,6 +382,8 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
opi
.
setAmount
(
new
BigDecimal
(
dic
.
getDetail
()));
opi
.
setAmount
(
new
BigDecimal
(
dic
.
getDetail
()));
opi
.
setStatus
(
STATUS_TOPAY
);
opi
.
setStatus
(
STATUS_TOPAY
);
opi
.
setInsuranceDay
(
Integer
.
valueOf
(
names
[
1
]));
opi
.
setInsuranceDay
(
Integer
.
valueOf
(
names
[
1
]));
opi
.
setStartTime
(
startDateBegin
.
getTime
());
opi
.
setEndTime
(
endDateEnd
.
getTime
());
break
;
break
;
}
}
}
}
...
@@ -894,7 +909,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -894,7 +909,16 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
IntervalUtil
.
staticIsInTheInterval
(
"1"
,
"[1,2]"
);
// IntervalUtil.staticIsInTheInterval("1", "[1,2]");
System
.
out
.
println
(
"123"
);
// System.out.println("123");
String
dateStr1
=
"2017-03-01 22:33:23"
;
Date
date1
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
dateStr1
));
String
dateStr2
=
"2017-04-01 23:33:23"
;
Date
date2
=
DateUtil
.
endOfDay
(
DateUtil
.
parse
(
dateStr2
));
//相差一个月,31天
long
betweenDay
=
DateUtil
.
between
(
date1
,
date2
,
DateUnit
.
DAY
);
System
.
out
.
println
(
betweenDay
);
}
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderPersonInsuranceBiz.java
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
biz
;
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageDTO
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.mapper.OrderPersonInsuranceMapper
;
import
com.xxfc.platform.order.mapper.OrderPersonInsuranceMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.util.List
;
/**
/**
* 订单人身保险
* 订单人身保险
*
*
...
@@ -15,4 +20,20 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -15,4 +20,20 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/
*/
@Service
@Service
public
class
OrderPersonInsuranceBiz
extends
BaseBiz
<
OrderPersonInsuranceMapper
,
OrderPersonInsurance
>
{
public
class
OrderPersonInsuranceBiz
extends
BaseBiz
<
OrderPersonInsuranceMapper
,
OrderPersonInsurance
>
{
public
PageDataVO
<
BgPageVO
>
selectOrderInfo
(
BgPageDTO
dto
)
{
PageDataVO
<
BgPageVO
>
pageList
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()->
mapper
.
selectOrderInfo
(
dto
));
pageList
.
getData
().
forEach
(
vo
->
{
vo
.
setInsuranceList
(
selectList
(
new
OrderPersonInsurance
(){{
setOrderNo
(
vo
.
getNo
());
}}));
});
return
pageList
;
}
public
List
<
OrderPersonInsurance
>
selectInsuranceInfo
(
BgPageDTO
dto
)
{
return
mapper
.
selectInsuranceInfo
(
dto
);
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRentVehicleBiz.java
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
biz
;
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
...
@@ -16,6 +17,8 @@ import com.xxfc.platform.order.pojo.order.OrderFullDTO;
...
@@ -16,6 +17,8 @@ import com.xxfc.platform.order.pojo.order.OrderFullDTO;
import
com.xxfc.platform.order.pojo.order.OrderFullVO
;
import
com.xxfc.platform.order.pojo.order.OrderFullVO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.universal.entity.IdInformation
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
...
@@ -29,6 +32,9 @@ import tk.mybatis.mapper.entity.Example;
...
@@ -29,6 +32,9 @@ import tk.mybatis.mapper.entity.Example;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
/**
/**
* 租车订单详情
* 租车订单详情
*
*
...
@@ -44,6 +50,8 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
...
@@ -44,6 +50,8 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
BaseOrderBiz
baseOrderBiz
;
BaseOrderBiz
baseOrderBiz
;
@Autowired
@Autowired
VehicleFeign
vehicleFeign
;
VehicleFeign
vehicleFeign
;
@Autowired
ThirdFeign
thirdFeign
;
@Autowired
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
OrderCalculateBiz
orderCalculateBiz
;
...
@@ -149,13 +157,40 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
...
@@ -149,13 +157,40 @@ public class OrderRentVehicleBiz extends BaseBiz<OrderRentVehicleDetailMapper, O
bo
.
setTickerNo
(
StrUtil
.
isNotBlank
(
vo
.
getTickerNos
())?
bo
.
setTickerNo
(
StrUtil
.
isNotBlank
(
vo
.
getTickerNos
())?
StrUtil
.
splitTrim
(
vo
.
getTickerNos
(),
","
):
null
);
StrUtil
.
splitTrim
(
vo
.
getTickerNos
(),
","
):
null
);
bo
.
setAccompanyItems
(
vo
.
getAccompanyItems
());
bo
.
setAccompanyItems
(
vo
.
getAccompanyItems
());
if
(
StrUtil
.
isNotBlank
(
vo
.
getInsureUserIds
())){
if
(
SYS_TRUE
==
vo
.
getNeedPersonInsurance
()
&&
StrUtil
.
isNotBlank
(
vo
.
getInsureUserIds
())){
String
buyInsureIdCard
=
""
;
String
buyInsureName
=
""
;
IdInformation
idInformation
=
thirdFeign
.
getOneByUserId
(
vo
.
getAppUserDTO
().
getUserid
());
if
(
null
==
idInformation
)
{
List
<
InsureUser
>
insureUsers
=
insureUserBiz
.
selectList
(
new
InsureUser
(){{
setUserid
(
vo
.
getAppUserDTO
().
getUserid
());
setPhone
(
vo
.
getAppUserDTO
().
getUsername
());
setIsdel
(
SYS_FALSE
);
}});
if
(
CollUtil
.
isEmpty
(
insureUsers
))
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"无法获取投保人信息"
));
}
else
{
buyInsureIdCard
=
insureUsers
.
get
(
0
).
getIdCard
();
buyInsureName
=
insureUsers
.
get
(
0
).
getName
();
}
}
else
{
buyInsureIdCard
=
idInformation
.
getIdNumber
();
buyInsureName
=
idInformation
.
getName
();
}
for
(
String
insureUserId:
vo
.
getInsureUserIds
().
split
(
","
))
{
for
(
String
insureUserId:
vo
.
getInsureUserIds
().
split
(
","
))
{
InsureUser
insureUser
=
insureUserBiz
.
selectById
(
Integer
.
valueOf
(
insureUserId
));
InsureUser
insureUser
=
insureUserBiz
.
selectById
(
Integer
.
valueOf
(
insureUserId
));
if
(
null
==
insureUser
)
{
if
(
null
==
insureUser
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"保险人不存在"
));
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
,
Sets
.
newSet
(
"保险人不存在"
));
}
else
{
}
else
{
String
finalBuyInsureIdCard
=
buyInsureIdCard
;
String
finalBuyInsureName
=
buyInsureName
;
bo
.
getInsurances
().
add
(
new
OrderPersonInsurance
(){{
bo
.
getInsurances
().
add
(
new
OrderPersonInsurance
(){{
setBuyInsureIdCard
(
finalBuyInsureIdCard
);
setBuyInsureName
(
finalBuyInsureName
);
setBuyInsurePhone
(
vo
.
getAppUserDTO
().
getUsername
());
setIdCard
(
insureUser
.
getIdCard
());
setIdCard
(
insureUser
.
getIdCard
());
setName
(
insureUser
.
getName
());
setName
(
insureUser
.
getName
());
}});
}});
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderPersonInsuranceMapper.java
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
mapper
;
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageDTO
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageVO
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
/**
* 订单人身保险
* 订单人身保险
*
*
...
@@ -11,5 +15,7 @@ import tk.mybatis.mapper.common.Mapper;
...
@@ -11,5 +15,7 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2020-11-26 18:56:21
* @date 2020-11-26 18:56:21
*/
*/
public
interface
OrderPersonInsuranceMapper
extends
Mapper
<
OrderPersonInsurance
>
{
public
interface
OrderPersonInsuranceMapper
extends
Mapper
<
OrderPersonInsurance
>
{
public
List
<
BgPageVO
>
selectOrderInfo
(
BgPageDTO
dto
);
public
List
<
OrderPersonInsurance
>
selectInsuranceInfo
(
BgPageDTO
dto
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/InsureUserController.java
View file @
c639ac78
...
@@ -56,7 +56,7 @@ public class InsureUserController extends BaseController<InsureUserBiz, InsureUs
...
@@ -56,7 +56,7 @@ public class InsureUserController extends BaseController<InsureUserBiz, InsureUs
insureUser1
.
setIsdel
(
0
);
insureUser1
.
setIsdel
(
0
);
insureUser1
=
baseBiz
.
selectOne
(
insureUser1
);
insureUser1
=
baseBiz
.
selectOne
(
insureUser1
);
if
(
insureUser1
!=
null
){
if
(
insureUser1
!=
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"保险人证件号一样"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"保险人证件号一样"
);
}
}
insureUser
.
setUserid
(
userid
);
insureUser
.
setUserid
(
userid
);
insureUser
.
setCrtTime
(
System
.
currentTimeMillis
());
insureUser
.
setCrtTime
(
System
.
currentTimeMillis
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRentVehicleController.java
View file @
c639ac78
...
@@ -70,9 +70,9 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -70,9 +70,9 @@ public class OrderRentVehicleController extends CommonBaseController {
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"确认租车订单"
)
@ApiOperation
(
value
=
"确认租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
public
ObjectRestResponse
<
BaseOrder
>
add
(
@RequestBody
AddRentVehicleDTO
vo
){
vo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
vo
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
vo
);
// vo.setDayNum(orderCalculateBiz.getIncludeDays(vo.getStartTime(), vo.getEndTime()));
// vo.setDayNum(orderCalculateBiz.getIncludeDays(vo.getStartTime(), vo.getEndTime()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
createOrder
(
bo
);
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
// return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "系统维护,请联系客服线下租车: 4000-369-369!");
// return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "系统维护,请联系客服线下租车: 4000-369-369!");
...
@@ -82,9 +82,9 @@ public class OrderRentVehicleController extends CommonBaseController {
...
@@ -82,9 +82,9 @@ public class OrderRentVehicleController extends CommonBaseController {
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"后台人员为客户下租车订单"
)
@ApiOperation
(
value
=
"后台人员为客户下租车订单"
)
public
ObjectRestResponse
<
BaseOrder
>
backStagedd
(
@RequestBody
BgAddRentDTO
dto
){
public
ObjectRestResponse
<
BaseOrder
>
backStagedd
(
@RequestBody
BgAddRentDTO
dto
){
dto
.
setAppUserDTO
(
userFeign
.
userDetailById
(
dto
.
getAppUserId
()).
getData
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
// bo.setDayNum(orderCalculateBiz.getIncludeDays(dto.getStartTime(), dto.getEndTime()));
// bo.setDayNum(orderCalculateBiz.getIncludeDays(dto.getStartTime(), dto.getEndTime()));
bo
.
setAppUserDTO
(
userFeign
.
userDetailById
(
dto
.
getAppUserId
()).
getData
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
bo
.
setCrtUser
(
"-1"
+
BaseContextHandler
.
getUserID
());
//设置-1表示查询所有的车
//设置-1表示查询所有的车
//bo.setUseType(-1);
//bo.setUseType(-1);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
c639ac78
...
@@ -221,10 +221,10 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -221,10 +221,10 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
dto
.
setEndTime
(
shuntApply
.
getEndTime
());
dto
.
setEndTime
(
shuntApply
.
getEndTime
());
dto
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
dto
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
dto
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
dto
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
dto
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_APPLY
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_APPLY
);
bo
.
setBookRecordId
(
shuntApply
.
getBookRecordId
());
bo
.
setBookRecordId
(
shuntApply
.
getBookRecordId
());
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
applyCreateOrder
(
bo
,
shuntApply
.
getOrderNo
());
orderRentVehicleService
.
applyCreateOrder
(
bo
,
shuntApply
.
getOrderNo
());
baseBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
baseBiz
.
updateSelectiveById
(
new
ShuntApply
(){{
setId
(
shuntApply
.
getId
());
setId
(
shuntApply
.
getId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/SpecialRentController.java
View file @
c639ac78
...
@@ -198,9 +198,9 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
...
@@ -198,9 +198,9 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
dto
.
setVehicleId
(
specialRent
.
getVehicleId
());
dto
.
setVehicleId
(
specialRent
.
getVehicleId
());
dto
.
setStartCompanyId
(
specialRent
.
getStartCompanyId
());
dto
.
setStartCompanyId
(
specialRent
.
getStartCompanyId
());
dto
.
setEndCompanyId
(
specialRent
.
getEndCompanyId
());
dto
.
setEndCompanyId
(
specialRent
.
getEndCompanyId
());
dto
.
setAppUserDTO
(
getAppUser
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_SPECIAL
);
bo
.
setOrderSign
(
BaseOrder
.
ORDER_SIGN_SPECIAL
);
bo
.
setAppUserDTO
(
getAppUser
());
bo
.
setSpecialUnitPrice
(
specialRent
.
getUnitPrice
());
bo
.
setSpecialUnitPrice
(
specialRent
.
getUnitPrice
());
bo
.
setBookRecordId
(
specialRent
.
getBookRecordId
());
bo
.
setBookRecordId
(
specialRent
.
getBookRecordId
());
orderRentVehicleService
.
specialCreateOrder
(
bo
,
specialRent
.
getOrderNo
());
orderRentVehicleService
.
specialCreateOrder
(
bo
,
specialRent
.
getOrderNo
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/BgShuntApplyController.java
View file @
c639ac78
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
// @RequestMapping(value = "/steward/myApplyList", method = RequestMethod.GET)
// @RequestMapping(value = "/steward/myApplyList", method = RequestMethod.GET)
// @ResponseBody
// @ResponseBody
// @ApiOperation(value = "我的申请")
// @ApiOperation(value = "我的申请")
// public ObjectRestResponse myApplyList(PageDTO dto) {
// public ObjectRestResponse myApplyList(
Bg
PageDTO dto) {
// UserDTO userDTO = getAdminUserInfo();
// UserDTO userDTO = getAdminUserInfo();
// PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
// PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
// w.andEqualTo(ShuntApply::getConfirmUserId, userDTO.getId());
// w.andEqualTo(ShuntApply::getConfirmUserId, userDTO.getId());
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
// }
// }
//
//
// @Data
// @Data
// public static class PageDTO extends PageParam {
// public static class
Bg
PageDTO extends PageParam {
// String multiStatus;
// String multiStatus;
// }
// }
//
//
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/PgOrderPersonInsuranceController.java
0 → 100755
View file @
c639ac78
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderPersonInsuranceBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderPersonInsurance
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageDTO
;
import
com.xxfc.platform.order.pojo.personinsurance.BgPageVO
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
zipkin2.Call
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"/background/orderPersonInsurance"
)
@Slf4j
public
class
PgOrderPersonInsuranceController
extends
BaseController
<
OrderPersonInsuranceBiz
,
OrderPersonInsurance
>
{
@Autowired
BaseOrderBiz
baseOrderBiz
;
@ApiOperation
(
"查询分页"
)
@RequestMapping
(
value
=
"/pageList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ObjectRestResponse
<
PageDataVO
<
BgPageVO
>>
pageList
(
BgPageDTO
dto
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectOrderInfo
(
dto
));
}
@ApiOperation
(
"修改图片"
)
@RequestMapping
(
value
=
"/editPic"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ObjectRestResponse
editPic
(
BgPageDTO
dto
){
baseOrderBiz
.
updateByWeekendSelective
(
new
BaseOrder
(){{
setInsurePic
(
dto
.
getInsurePic
());
}},
w
->
{
w
.
andEqualTo
(
BaseOrder:
:
getNo
,
dto
.
getNo
());
return
w
;
});
return
ObjectRestResponse
.
succ
();
}
@RequestMapping
(
value
=
"/bg/pageExport"
,
method
=
RequestMethod
.
GET
)
public
void
bgPageExport
(
BgPageDTO
dto
)
throws
Exception
{
PageExportDTO
head
=
new
PageExportDTO
(){{
setOrderNo
(
"订单编号"
);
setName
(
"姓名"
);
setIdCard
(
"身份证号"
);
setRentDateStr
(
"租期"
);
setAmountStr
(
"保险档次"
);
setPayTimeStr
(
"下单时间"
);
setRefundTimeStr
(
"退保时间"
);
setStatusStr
(
"状态"
);
}};
exportBean
(
log
,
head
,
()
->
{
List
<
OrderPersonInsurance
>
bgList
=
baseBiz
.
selectInsuranceInfo
(
dto
);
List
<
Map
>
list
=
CollUtil
.
newArrayList
();
bgList
.
forEach
(
vo
->
{
PageExportDTO
ped
=
BeanUtil
.
toBean
(
vo
,
PageExportDTO
.
class
);
switch
(
vo
.
getStatus
())
{
case
OrderPersonInsurance
.
STATUS_PAY
:
ped
.
setStatusStr
(
"已购买"
);
ped
.
setRefundTimeStr
(
""
);
break
;
case
OrderPersonInsurance
.
STATUS_CNL
:
ped
.
setStatusStr
(
"已退保"
);
ped
.
setRefundTimeStr
(
DateUtil
.
date
(
vo
.
getRefundTime
()).
toString
());
default
:
ped
.
setStatusStr
(
""
);
ped
.
setRefundTimeStr
(
""
);
break
;
}
ped
.
setAmountStr
(
vo
.
getAmount
()+
"元"
);
String
startStr
=
DateUtil
.
date
(
vo
.
getStartTime
()).
toDateStr
();
String
endStr
=
DateUtil
.
date
(
vo
.
getEndTime
()).
toDateStr
();
ped
.
setRentDateStr
(
startStr
+
"-"
+
endStr
);
ped
.
setPayTimeStr
(
DateUtil
.
date
(
vo
.
getPaytime
()).
toString
());
list
.
add
(
BeanUtil
.
beanToMap
(
ped
,
false
,
true
));
});
return
list
;
},
"保险导出"
);
}
@Data
static
class
PageExportDTO
{
private
String
orderNo
;
private
String
name
;
private
String
idCard
;
private
String
rentDateStr
;
private
String
amountStr
;
private
String
payTimeStr
;
private
String
refundTimeStr
;
private
String
statusStr
;
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
c639ac78
...
@@ -335,8 +335,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -335,8 +335,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
//插入人身保险列表
//插入人身保险列表
if
(
SYS_TRUE
==
bo
.
getNeedPersonInsurance
()){
if
(
SYS_TRUE
==
bo
.
getNeedPersonInsurance
()){
bo
.
getOrder
().
setInsureStatus
(
SYS_TRUE
);
for
(
OrderPersonInsurance
opi
:
bo
.
getConfirmInsurances
())
{
for
(
OrderPersonInsurance
opi
:
bo
.
getConfirmInsurances
())
{
opi
.
setOrderId
(
bo
.
getOrder
().
getId
());
opi
.
setOrderId
(
bo
.
getOrder
().
getId
());
opi
.
setOrderNo
(
bo
.
getOrder
().
getNo
());
orderPersonInsuranceBiz
.
insertSelective
(
opi
);
orderPersonInsuranceBiz
.
insertSelective
(
opi
);
}
}
}
}
...
@@ -563,7 +565,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -563,7 +565,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
opi
.
setOrderDay
(
detail
.
getDayNum
());
opi
.
setOrderDay
(
detail
.
getDayNum
());
//计算天数
//计算天数
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
get
EndTime
()
-
detail
.
getStart
Time
(),
opi
);
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
get
StartTime
(),
detail
.
getEnd
Time
(),
opi
);
if
(
STATUS_TOPAY
==
opi
.
getStatus
())
{
if
(
STATUS_TOPAY
==
opi
.
getStatus
())
{
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
...
@@ -740,7 +742,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -740,7 +742,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
for
(
OrderPersonInsurance
opi
:
detail
.
getInsurances
())
{
opi
.
setOrderDay
(
detail
.
getDayNum
());
opi
.
setOrderDay
(
detail
.
getDayNum
());
//计算天数
//计算天数
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
get
EndTime
()
-
detail
.
getStart
Time
(),
opi
);
orderAccountBiz
.
calculatePersonInsurance
(
detail
.
get
StartTime
(),
detail
.
getEnd
Time
(),
opi
);
if
(
STATUS_TOPAY
==
opi
.
getStatus
())
{
if
(
STATUS_TOPAY
==
opi
.
getStatus
())
{
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
detail
.
getConfirmInsurances
().
add
(
BeanUtil
.
toBean
(
opi
,
OrderPersonInsurance
.
class
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
OrderItem
personInsuranceOrderItem
=
orderItemBiz
.
initOrderItem
(
opi
.
getAmount
(),
1
,
"人身保险"
,
null
,
ItemTypeEnum
.
PERSON_INSURANCE
,
JSONUtil
.
toJsonStr
(
opi
));
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderPersonInsuranceMapper.xml
View file @
c639ac78
...
@@ -19,4 +19,45 @@
...
@@ -19,4 +19,45 @@
<result
property=
"updUser"
column=
"upd_user"
/>
<result
property=
"updUser"
column=
"upd_user"
/>
</resultMap>
</resultMap>
<select
id=
"selectOrderInfo"
resultType=
"com.xxfc.platform.order.pojo.personinsurance.BgPageVO"
>
select distinct ob.no, ob.insure_pic
<include
refid=
"commonFromWhere"
></include>
</select>
<select
id=
"selectInsuranceInfo"
resultType=
"com.xxfc.platform.order.entity.OrderPersonInsurance"
>
select opi.*
<include
refid=
"commonFromWhere"
></include>
</select>
<sql
id=
"commonFromWhere"
>
from order_person_insurance opi
left join order_base ob on opi.id = ob.order_id
<where>
and ob.has_pay = 1
<if
test=
"keyWord != null"
>
and (
ob.no like concat('%',#{keyWord},'%') or opi.name like concat('%',#{keyWord},'%')
)
</if>
<if
test=
"price != null"
>
and opi.amount = #{price}
</if>
<if
test=
"status != null"
>
and opi.status = #{status}
</if>
<if
test=
"orderStartTime != null"
>
and opi.pay_time
>
= #{orderStartTime}
</if>
<if
test=
"orderEndTime != null"
>
and ob.pay_time
<
= #{orderEndTime}
</if>
<if
test=
"refundStartTime != null"
>
and opi.refund_time
>
= #{refundStartTime}
</if>
<if
test=
"refundEndTime != null"
>
and ob.refund_time
<
= #{refundEndTime}
</if>
</where>
</sql>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment