Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
9701c5f6
Commit
9701c5f6
authored
Sep 06, 2024
by
huyf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提货箱数、提货率、提货状态回填
parent
c6246785
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
OrderPickupServiceImpl.java
...ule/order/service/orderPickup/OrderPickupServiceImpl.java
+15
-16
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderPickup/OrderPickupServiceImpl.java
View file @
9701c5f6
...
...
@@ -124,7 +124,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup
.
setOrderStatus
(
orderDO
.
getStatus
());
}
orderPickupMapper
.
insert
(
orderPickup
);
orderService
.
updateStatus
(
null
,
createReqVO
.
getOrderId
(),
OrderStatusEnum
.
PICKED_UP
.
getValue
(),
null
,
null
,
null
,
null
,
null
,
createReqVO
.
getPickTime
(),
false
);
//
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级
updateCustomerLevelUp
(
orderDO
);
...
...
@@ -190,7 +190,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
0
,
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
// 返回
return
orderPickup
.
getId
();
}
...
...
@@ -207,14 +207,13 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
return
orderDO
.
getSumNum
()
-
allPickNum
;
}
private
void
dealDeliveryRate
(
String
orderNo
,
Integer
pickNum
,
Integer
sumNum
,
Integer
pickState
)
{
private
void
dealDeliveryRate
(
String
orderNo
,
Integer
sumNum
,
Integer
pickState
)
{
List
<
OrderPickupDO
>
orderPickupDOS
=
orderPickupMapper
.
selectList
(
OrderPickupDO:
:
getOrderId
,
orderNo
);
int
pickedSum
=
orderPickupDOS
.
stream
().
mapToInt
(
OrderPickupDO:
:
getPickNum
).
sum
();
int
allPickNum
=
pickedSum
+
pickNum
;
BigDecimal
pickRatio
=
new
BigDecimal
((
double
)
(
allPickNum
/
sumNum
)
*
100
);
BigDecimal
pickRatio
=
new
BigDecimal
((
double
)
pickedSum
/
sumNum
*
100
);
pickRatio
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
orderService
.
update
(
new
LambdaUpdateWrapper
<
OrderDO
>()
.
set
(
OrderDO:
:
getPickNum
,
allPickN
um
)
.
set
(
OrderDO:
:
getPickNum
,
pickedS
um
)
.
set
(
OrderDO:
:
getPickRatio
,
pickRatio
)
.
set
(
OrderDO:
:
getPickState
,
pickState
)
.
eq
(
OrderDO:
:
getOrderNo
,
orderNo
)
...
...
@@ -334,14 +333,14 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
// 获取未撤销的提货记录
List
<
OrderPickupDO
>
pickupDOList
=
orderPickupMapper
.
selectList
(
new
LambdaQueryWrapper
<
OrderPickupDO
>().
eq
(
OrderPickupDO:
:
getOrderId
,
orderPickupDO
.
getOrderId
()).
orderByDesc
(
OrderPickupDO:
:
getPickTime
));
if
(
CollectionUtil
.
isNotEmpty
(
pickupDOList
)
&&
pickupDOList
.
size
()
>
0
)
{
orderService
.
updateStatus
(
one
.
getOrderId
(),
null
,
OrderStatusEnum
.
PART_PICKED_UP
.
getValue
(),
null
,
null
,
null
,
null
,
null
);
dealDeliveryRate
(
one
.
getOrderNo
(),
-
orderPickupDO
.
getPickNum
(),
one
.
getSumNum
(),
PickStateEnum
.
partPick
.
getPickState
());
//
orderService.updateStatus(one.getOrderId(), null, OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null);
dealDeliveryRate
(
one
.
getOrderNo
(),
one
.
getSumNum
(),
PickStateEnum
.
partPick
.
getPickState
());
}
else
{
// 找到已删除 订单状态大于0的数据来恢复订单状态
OrderPickupDO
delOrderPickupDO
=
orderPickupMapper
.
selectDeletedPickup
(
orderPickupDO
.
getOrderId
());
// 这里需要考虑到老数据的空指针异常
orderService
.
updateStatus
(
one
.
getOrderId
(),
null
,
Objects
.
nonNull
(
delOrderPickupDO
)
?
delOrderPickupDO
.
getOrderStatus
()
:
16
,
null
,
null
,
null
,
null
,
null
);
dealDeliveryRate
(
one
.
getOrderNo
(),
-
orderPickupDO
.
getPickNum
(),
one
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
//
orderService.updateStatus(one.getOrderId(), null, Objects.nonNull(delOrderPickupDO) ? delOrderPickupDO.getOrderStatus() : 16, null, null, null, null, null);
dealDeliveryRate
(
one
.
getOrderNo
(),
one
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
}
if
(
Objects
.
equals
(
one
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_FREIGHT_LINE
.
getValue
()))
{
...
...
@@ -492,7 +491,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup
.
setOrderStatus
(
orderDO
.
getStatus
());
}
orderPickupMapper
.
insert
(
orderPickup
);
orderService
.
updateStatus
(
null
,
orderDO
.
getOrderNo
(),
OrderStatusEnum
.
PICKED_UP
.
getValue
(),
null
,
null
,
null
,
null
,
null
,
createReqVO
.
getPickTime
(),
false
);
//
orderService.updateStatus(null, orderDO.getOrderNo(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级
updateCustomerLevelUp
(
orderDO
);
...
...
@@ -535,7 +534,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
0
,
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
}
}
}
...
...
@@ -650,7 +649,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup
.
setOrderStatus
(
orderDO
.
getStatus
());
}
orderPickupMapper
.
insert
(
orderPickup
);
orderService
.
updateStatus
(
null
,
createReqVO
.
getOrderId
(),
OrderStatusEnum
.
PART_PICKED_UP
.
getValue
(),
null
,
null
,
null
,
null
,
null
,
createReqVO
.
getPickTime
(),
false
);
//
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信
sendMsg
(
orderDO
.
getOrderNo
(),
orderDO
.
getMarks
(),
String
.
valueOf
(
orderPickup
.
getPickNum
()),
DateUtils
.
formatDate
(
orderPickup
.
getPickTime
()),
Long
.
valueOf
(
orderPickup
.
getCreator
()));
...
...
@@ -658,7 +657,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
OrderDO
orderDO1
=
new
OrderDO
();
BeanUtils
.
copyProperties
(
orderDO
,
orderDO1
);
insertCustomLevelAndCreditLevelLog
(
orderPickup
,
orderDO1
,
false
);
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
0
,
orderDO
.
getSumNum
(),
PickStateEnum
.
partPick
.
getPickState
());
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
partPick
.
getPickState
());
}
else
if
(
num
<
0
)
{
//如果分批提的数量加上已分批提的数量超过了总量 则重新计算成剩余的量
throw
exception
(
PICK_UP_TOO_MORE
);
...
...
@@ -673,7 +672,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup
.
setOrderStatus
(
orderDO
.
getStatus
());
}
orderPickupMapper
.
insert
(
orderPickup
);
orderService
.
updateStatus
(
null
,
createReqVO
.
getOrderId
(),
OrderStatusEnum
.
PICKED_UP
.
getValue
(),
null
,
null
,
null
,
null
,
null
,
createReqVO
.
getPickTime
(),
false
);
//
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信
sendMsg
(
orderDO
.
getOrderNo
(),
orderDO
.
getMarks
(),
String
.
valueOf
(
orderPickup
.
getPickNum
()),
DateUtils
.
formatDate
(
orderPickup
.
getPickTime
()),
Long
.
valueOf
(
orderPickup
.
getCreator
()));
...
...
@@ -683,7 +682,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
BeanUtils
.
copyProperties
(
orderDO
,
orderDO1
);
insertCustomLevelAndCreditLevelLog
(
orderPickup
,
orderDO1
,
true
);
updateCustomerLevelUp
(
orderDO1
);
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
0
,
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
}
orderBusinessService
.
addOrderOperateLog
(
orderDO
.
getOrderId
(),
""
,
"分批提货"
,
""
);
if
(
Objects
.
equals
(
orderDO
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_FREIGHT_LINE
.
getValue
()))
{
...
...
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