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
7a45cf5a
Commit
7a45cf5a
authored
Nov 25, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_chw_publish' into dev-chw
parents
4993877d
f9bd1bfd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
2 deletions
+55
-2
VehiclePublishBiz.java
...java/com/xxfc/platform/vehicle/biz/VehiclePublishBiz.java
+30
-0
VehiclePublishGoodsBiz.java
...com/xxfc/platform/vehicle/biz/VehiclePublishGoodsBiz.java
+4
-0
VehiclePublishReceiveBiz.java
...m/xxfc/platform/vehicle/biz/VehiclePublishReceiveBiz.java
+8
-2
VehiclePublishGoodsMapper.java
...fc/platform/vehicle/mapper/VehiclePublishGoodsMapper.java
+7
-0
VehiclePublishReceiveMapper.java
.../platform/vehicle/mapper/VehiclePublishReceiveMapper.java
+6
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishBiz.java
View file @
7a45cf5a
...
...
@@ -11,13 +11,16 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.feign.ConfigFeign
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehiclePublish
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishGoods
;
import
com.xxfc.platform.vehicle.entity.VehiclePublishReceive
;
import
com.xxfc.platform.vehicle.mapper.VehiclePublishMapper
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePublishFindDTO
;
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
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -37,6 +40,12 @@ public class VehiclePublishBiz extends BaseBiz<VehiclePublishMapper, VehiclePubl
@Autowired
ConfigFeign
configFeign
;
@Autowired
VehicleBiz
vehicleBiz
;
@Autowired
VehiclePublishReceiveBiz
publishReceiveBiz
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -50,6 +59,10 @@ public class VehiclePublishBiz extends BaseBiz<VehiclePublishMapper, VehiclePubl
Integer
id
=
vehiclePublish
.
getId
();
JSONObject
config
=
getConfig
();
for
(
VehiclePublishGoods
publishGoods
:
goodsList
){
String
vehicleId
=
publishGoods
.
getVehicleId
();
if
(
StringUtils
.
isNotBlank
(
vehicleId
)){
checkVehiclePublish
(
vehicleId
);
}
publishGoods
.
setId
(
null
);
publishGoods
.
setPublishId
(
id
);
publishGoods
.
setGoodsType
(
vehiclePublish
.
getGoodsType
());
...
...
@@ -60,6 +73,23 @@ public class VehiclePublishBiz extends BaseBiz<VehiclePublishMapper, VehiclePubl
}
public
void
checkVehiclePublish
(
String
vehicleId
){
Vehicle
vehicle
=
vehicleBiz
.
selectById
(
vehicleId
);
if
(
vehicle
==
null
){
throw
new
BaseException
(
vehicle
.
getName
()+
"不存在"
,
ResultCode
.
FAILED_CODE
);
}
VehiclePublishGoods
vehiclePublishGoods
=
publishGoodsBiz
.
getGoods
(
vehicleId
);
if
(
vehiclePublishGoods
!=
null
){
throw
new
BaseException
(
vehicle
.
getName
()+
"已存在无法发布"
,
ResultCode
.
FAILED_CODE
);
}
VehiclePublishReceive
publishReceive
=
publishReceiveBiz
.
getReceivByVehicleId
(
vehicleId
);
if
(
publishReceive
!=
null
){
throw
new
BaseException
(
vehicle
.
getName
()+
"已接单无法发布"
,
ResultCode
.
FAILED_CODE
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishGoodsBiz.java
View file @
7a45cf5a
...
...
@@ -139,6 +139,10 @@ public class VehiclePublishGoodsBiz extends BaseBiz<VehiclePublishGoodsMapper, V
}
}
public
VehiclePublishGoods
getGoods
(
String
vehicleId
){
return
mapper
.
getGoodsByVehicleId
(
vehicleId
);
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePublishReceiveBiz.java
View file @
7a45cf5a
...
...
@@ -107,7 +107,9 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
publishReceiveDTO
.
setStatus
(
VehiclePublishReceiveDTO
.
REFUSE
);
updOrderReceive
(
publishReceiveDTO
);
}
return
null
;
BaseOrder
baseOrder
=
new
BaseOrder
();
baseOrder
.
setRealAmount
(
BigDecimal
.
ZERO
);
return
baseOrder
;
}
}
...
...
@@ -288,7 +290,7 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
receiveIdList
.
addAll
(
receiveList
);
}
if
(
StringUtils
.
isNotBlank
(
refuseReceiveIds
)){
List
<
Integer
>
refuseList
=
Arrays
.
asList
(
receiveIds
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
List
<
Integer
>
refuseList
=
Arrays
.
asList
(
re
fuseRe
ceiveIds
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
receiveIdList
.
addAll
(
refuseList
);
}
if
(
receiveIdList
.
size
()
==
0
)
...
...
@@ -495,6 +497,10 @@ public class VehiclePublishReceiveBiz extends BaseBiz<VehiclePublishReceiveMappe
}
public
VehiclePublishReceive
getReceivByVehicleId
(
String
vehicleId
){
return
mapper
.
getReceivByVehicleId
(
vehicleId
);
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehiclePublishGoodsMapper.java
View file @
7a45cf5a
...
...
@@ -28,4 +28,11 @@ public interface VehiclePublishGoodsMapper extends Mapper<VehiclePublishGoods>,
"GROUP BY r.publish_goods_id"
)
List
<
VehiclePublishGoods
>
groupGoodsIdList
(
@Param
(
"publishId"
)
Integer
publishId
);
@Select
(
"SELECT g.* FROM vehicle_publish_goods g\n"
+
"\n"
+
"LEFT JOIN vehicle_publish p ON g.publish_id=p.id\n"
+
"\n"
+
"WHERE g.vehicle_id = #{vehicleId} and p.`status` in (0,2)"
)
VehiclePublishGoods
getGoodsByVehicleId
(
@Param
(
"vehicleId"
)
String
vehicleId
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehiclePublishReceiveMapper.java
View file @
7a45cf5a
...
...
@@ -8,6 +8,7 @@ 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
org.apache.ibatis.annotations.Select
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
...
@@ -28,4 +29,9 @@ public interface VehiclePublishReceiveMapper extends Mapper<VehiclePublishReceiv
List
<
VehiclePublishGoodsVo
>
getListByNumber
(
@Param
(
"receiveOrderNo"
)
String
receiveOrderNo
);
@Select
(
"SELECT * FROM vehicle_publish_receive \n"
+
"WHERE vehicle_id = #{vehicleId} and `status` in (0,1,3)"
)
VehiclePublishReceive
getReceivByVehicleId
(
@Param
(
"vehicleId"
)
String
vehicleId
);
}
\ 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