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
a054de2f
Commit
a054de2f
authored
Nov 23, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_chw_publish' into dev-chw
parents
73b6f57c
9a207876
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
234 additions
and
4 deletions
+234
-4
ReceiveVo.java
...ain/java/com/xxfc/platform/vehicle/pojo/vo/ReceiveVo.java
+66
-0
VehiclePublishReceiveBiz.java
...m/xxfc/platform/vehicle/biz/VehiclePublishReceiveBiz.java
+88
-4
VehiclePublishReceiveMapper.java
.../platform/vehicle/mapper/VehiclePublishReceiveMapper.java
+6
-0
AppVehiclePublishReceiveController.java
...form/vehicle/rest/AppVehiclePublishReceiveController.java
+21
-0
VehiclePublishReceiveMapper.xml
...src/main/resources/mapper/VehiclePublishReceiveMapper.xml
+53
-0
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/ReceiveVo.java
0 → 100644
View file @
a054de2f
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishReceive
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
public
class
ReceiveVo
extends
VehiclePublishReceive
{
@ApiModelProperty
(
"总数"
)
Long
number
;
@ApiModelProperty
(
"待确认数量"
)
Long
waitNumber
;
@ApiModelProperty
(
"确认数量"
)
Long
confirmNumber
;
@ApiModelProperty
(
"拒绝数量"
)
Long
refusedNumber
;
@ApiModelProperty
(
"按钮状态:1-待确认;2-已确认;3-已完成;4-已取消"
)
private
Integer
buttonState
;
@ApiModelProperty
(
"发布公司"
)
BranchCompany
publishCompany
;
@ApiModelProperty
(
"需求id"
)
private
Integer
publishId
;
@ApiModelProperty
(
"类型:1-我要车;2-我有车"
)
private
Integer
type
;
@ApiModelProperty
(
"开始时间"
)
private
Long
startTime
;
@ApiModelProperty
(
"结束时间"
)
private
Long
endTime
;
@ApiModelProperty
(
"状态str"
)
private
String
statusStr
;
@ApiModelProperty
(
"接单ids"
)
private
String
ids
;
private
List
<
VehiclePublishGoodsVo
>
publishGoodsVos
;
private
List
<
VehiclePublishReceiveVo
>
publishReceiveVos
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishReceiveBiz.java
View file @
a054de2f
...
...
@@ -3,10 +3,13 @@ package com.xxfc.platform.vehicle.biz;
import
cn.hutool.json.JSONUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.feign.OrderFeign
;
import
com.xxfc.platform.order.pojo.order.PulishReceiveBO
;
...
...
@@ -17,8 +20,10 @@ import com.xxfc.platform.vehicle.mapper.VehiclePublishReceiveMapper;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleReceiveRefundDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.ReceiveVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -68,6 +73,9 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
@Autowired
VehicleCategoryBiz
categoryBiz
;
@Autowired
BranchCompanyBiz
branchCompanyBiz
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -115,8 +123,8 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
}
publishReceiveDTO
.
setVehiclePublish
(
vehiclePublish
);
Integer
type
=
vehiclePublish
.
getType
()
==
null
?
0
:
vehiclePublish
.
getType
();
setVehiclePublishReceive
(
publishReceiveDTO
,
receiveIdStr
);
List
<
VehiclePublishReceiveVo
>
receives
=
publishReceiveDTO
.
getReceiveVos
();
setVehiclePublishReceive
(
receives
,
receiveIdStr
);
if
(
CollectionUtils
.
isNotEmpty
(
receives
)){
for
(
VehiclePublishReceiveVo
vehiclePublishReceive
:
receives
){
Integer
id
=
vehiclePublishReceive
.
getId
()
==
null
?
0
:
vehiclePublishReceive
.
getId
();
...
...
@@ -169,17 +177,19 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
return
publishReceiveDTO
;
}
public
void
setVehiclePublishReceive
(
List
<
VehiclePublishReceiveVo
>
receives
,
String
receiveIds
){
if
(
receives
==
null
||
receives
.
size
()
==
0
){
receives
=
new
ArrayList
<>();
public
void
setVehiclePublishReceive
(
VehiclePublishReceiveDTO
publishReceiveDTO
,
String
receiveIds
){
if
(
CollectionUtils
.
isEmpty
(
publishReceiveDTO
.
getReceiveVos
())){
if
(
StringUtils
.
isNotBlank
(
receiveIds
)){
List
<
VehiclePublishReceiveVo
>
receives
=
new
ArrayList
<>();
List
<
Integer
>
receiveIdList
=
Arrays
.
asList
(
receiveIds
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
for
(
Integer
id
:
receiveIdList
){
VehiclePublishReceiveVo
vehiclePublishReceive
=
new
VehiclePublishReceiveVo
();
vehiclePublishReceive
.
setId
(
id
);
receives
.
add
(
vehiclePublishReceive
);
}
publishReceiveDTO
.
setReceiveVos
(
receives
);
}
}
}
...
...
@@ -390,5 +400,79 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
public
List
<
ReceiveVo
>
getListByReceive
(
VehiclePublishFindDTO
publishFindDTO
){
return
mapper
.
selectListByReceive
(
publishFindDTO
);
}
public
PageDataVO
<
ReceiveVo
>
selectList
(
VehiclePublishFindDTO
publishFindDTO
)
{
Integer
page
=
publishFindDTO
.
getPage
()
==
null
?
1
:
publishFindDTO
.
getPage
();
Integer
limit
=
publishFindDTO
.
getLimit
()
==
null
?
10
:
publishFindDTO
.
getLimit
();
PageHelper
.
startPage
(
page
,
limit
);
PageInfo
<
ReceiveVo
>
pageInfo
=
new
PageInfo
<>(
getListByReceive
(
publishFindDTO
));
PageDataVO
<
ReceiveVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
pageInfo
);
List
<
ReceiveVo
>
list
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
ReceiveVo
receiveVo
:
list
)
{
String
statusStr
=
receiveVo
.
getStatusStr
();
if
(
StringUtils
.
isNotBlank
(
statusStr
))
{
List
<
Integer
>
statusIds
=
Arrays
.
asList
(
statusStr
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
Long
waitNumber
=
statusIds
.
stream
().
filter
(
x
->
x
==
1
).
count
();
waitNumber
=
waitNumber
==
null
?
0L
:
waitNumber
;
Long
refusedNumber
=
statusIds
.
stream
().
filter
(
x
->
x
==
2
).
count
();
refusedNumber
=
refusedNumber
==
null
?
0L
:
refusedNumber
;
Long
confirmNumber
=
statusIds
.
stream
().
filter
(
x
->
x
==
3
).
count
();
confirmNumber
=
confirmNumber
==
null
?
0L
:
confirmNumber
;
receiveVo
.
setWaitNumber
(
waitNumber
);
receiveVo
.
setRefusedNumber
(
refusedNumber
);
receiveVo
.
setConfirmNumber
(
confirmNumber
);
Integer
buttonState
;
if
(
waitNumber
>
0L
)
{
if
(
confirmNumber
>
0L
)
{
buttonState
=
2
;
}
else
{
buttonState
=
1
;
}
}
else
{
if
(
confirmNumber
>
0L
){
buttonState
=
3
;
receiveVo
.
setPublishCompany
(
branchCompanyBiz
.
selectById
(
receiveVo
.
getPublishCompanyId
()));
}
else
{
buttonState
=
4
;
}
}
receiveVo
.
setButtonState
(
buttonState
);
receiveVo
.
setPublishGoodsVos
(
mapper
.
getListByNumber
(
receiveVo
.
getReceiveOrderNo
()));
}
}
}
return
pageDataVO
;
}
public
ReceiveVo
getInfo
(
String
orderNo
){
VehiclePublishFindDTO
publishFindDTO
=
new
VehiclePublishFindDTO
();
publishFindDTO
.
setOrderNo
(
publishFindDTO
.
getOrderNo
());
List
<
ReceiveVo
>
list
=
getListByReceive
(
publishFindDTO
);
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
ReceiveVo
receiveVo
=
list
.
get
(
0
);
String
ids
=
receiveVo
.
getIds
();
if
(
StringUtils
.
isNotBlank
(
ids
)){
List
<
Integer
>
idList
=
Arrays
.
asList
(
ids
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
VehiclePublishReceiveDTO
receiveDTO
=
new
VehiclePublishReceiveDTO
();
receiveDTO
.
setIds
(
idList
);
receiveVo
.
setPublishReceiveVos
(
getListByIds
(
receiveDTO
));
}
return
receiveVo
;
}
return
null
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehiclePublishReceiveMapper.java
View file @
a054de2f
...
...
@@ -4,6 +4,8 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.VehiclePublishReceive
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.ReceiveVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo
;
import
com.xxfc.platform.vehicle.pojo.vo.VehiclePublishReceiveVo
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
...
...
@@ -22,4 +24,8 @@ public interface VehiclePublishReceiveMapper extends Mapper<VehiclePublishReceiv
List
<
VehiclePublishReceiveVo
>
getListByUserId
(
VehiclePublishFindDTO
publishFindDTO
);
List
<
ReceiveVo
>
selectListByReceive
(
VehiclePublishFindDTO
publishFindDTO
);
List
<
VehiclePublishGoodsVo
>
getListByNumber
(
@Param
(
"receiveOrderNo"
)
String
receiveOrderNo
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/AppVehiclePublishReceiveController.java
View file @
a054de2f
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.rest;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehiclePublishReceiveBiz
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -63,6 +64,26 @@ public class AppVehiclePublishReceiveController extends BaseController<VehiclePu
}
@GetMapping
(
"selectList"
)
@ApiModelProperty
(
"我的接单"
)
public
ObjectRestResponse
selectListByCompany
(
VehiclePublishFindDTO
publishFindDTO
)
{
if
(
publishFindDTO
.
getCompanyId
()
==
null
||
publishFindDTO
.
getCompanyId
()
==
0
){
List
<
Integer
>
companyIds
=
getBusinessUserCompanyIds
();
if
(
companyIds
!=
null
&&
companyIds
.
size
()
>
0
){
publishFindDTO
.
setCompanyId
(
companyIds
.
get
(
0
));
}
}
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
publishFindDTO
));
}
@GetMapping
(
"detail"
)
@ApiModelProperty
(
"我的接单详情"
)
public
ObjectRestResponse
detail
(
VehiclePublishFindDTO
publishFindDTO
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getInfo
(
publishFindDTO
.
getOrderNo
()));
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehiclePublishReceiveMapper.xml
View file @
a054de2f
...
...
@@ -90,4 +90,57 @@
GROUP BY r.receive_user_id
</select>
<select
id=
"selectListByReceive"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.ReceiveVo"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePublishReceiveDTO"
>
SELECT
r.receive_order_no as receiveOrderNo,
COUNT(r.id) as number,
r.receive_company_id as receiveCompanyId,
r.crt_time as crtTime,
p.start_time as startTime,
p.end_time as endTime,
p.id as publishId,
p.type,
GROUP_CONCAT(r.`status`) statusStr,
GROUP_CONCAT(r.`id`) ids,
r.cover,
r.publish_company_id as publishCompanyId
FROM vehicle_publish_receive r
LEFT JOIN vehicle_publish_goods g ON r.publish_goods_id = g.id
LEFT JOIN vehicle_publish p ON g.publish_id = p.id
<where>
r.is_del = 0
<if
test=
"companyId != null and companyId > 0"
>
AND r.receive_company_id= #{companyId}
</if>
<if
test=
"orderNo != null and orderNo != '' "
>
AND r.receive_order_no= #{orderNo}
</if>
</where>
GROUP BY r.receive_order_no
ORDER BY r.crt_time DESC
</select>
<select
id=
"getListByNumber"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehiclePublishGoodsVo"
>
SELECT
COUNT(r.id)as goodsNumber,
g.publish_id as publishId,
IFNULL(b1.cn_name,b.cn_name) as brandName,
IFNULL(c1.`name`,c.`name`) as categoryName
FROM vehicle_publish_receive r
LEFT JOIN vehicle_publish_goods g ON r.publish_goods_id = g.id
LEFT JOIN vehicle v ON g.vehicle_id=v.id
LEFT JOIN vehicle_brand b1 ON v.brand_id=b1.id
LEFT JOIN vehicle_category c1 ON v.category_id=c1.id
LEFT JOIN vehicle_brand b ON g.brand_id=b.id
LEFT JOIN vehicle_category c ON g.category_id=c.id
<where>
r.is_del = 0 and r.receive_order_no=#{receiveOrderNo}
</where>
GROUP BY r.publish_goods_id
ORDER BY goodsNumber DESC
</select>
</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