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
902f9ec1
Commit
902f9ec1
authored
Sep 05, 2024
by
huyf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提货箱数、提货率、提货状态回填
parent
f5ee152b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
9 deletions
+52
-9
OrderDO.java
...oder/yudao/module/order/dal/dataobject/order/OrderDO.java
+1
-1
OrderBackInfoDto.java
...a/cn/iocoder/yudao/module/order/dto/OrderBackInfoDto.java
+1
-1
PickStateEnum.java
...va/cn/iocoder/yudao/module/order/enums/PickStateEnum.java
+21
-0
OrderPickupServiceImpl.java
...ule/order/service/orderPickup/OrderPickupServiceImpl.java
+22
-0
OrderBackPageVO.java
.../iocoder/yudao/module/order/vo/order/OrderBackPageVO.java
+1
-1
OrderBackVO.java
...a/cn/iocoder/yudao/module/order/vo/order/OrderBackVO.java
+1
-1
OrderBaseVO.java
...a/cn/iocoder/yudao/module/order/vo/order/OrderBaseVO.java
+1
-1
OrderQueryVO.java
.../cn/iocoder/yudao/module/order/vo/order/OrderQueryVO.java
+4
-4
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/dataobject/order/OrderDO.java
View file @
902f9ec1
...
...
@@ -538,7 +538,7 @@ public class OrderDO extends BaseDO {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
String
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dto/OrderBackInfoDto.java
View file @
902f9ec1
...
...
@@ -534,7 +534,7 @@ public class OrderBackInfoDto {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
Integer
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/enums/PickStateEnum.java
0 → 100644
View file @
902f9ec1
package
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@AllArgsConstructor
@Getter
public
enum
PickStateEnum
{
unpick
(
0
,
"待提货"
),
picking
(
1
,
"提货中"
),
partPick
(
2
,
"部分提货"
),
picked
(
3
,
"已提货"
);
private
Integer
pickState
;
private
String
pickStateStr
;
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderPickup/OrderPickupServiceImpl.java
View file @
902f9ec1
...
...
@@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.order.vo.orderPickup.*;
import
cn.iocoder.yudao.module.order.vo.orderTime.OrderTimeQueryVO
;
import
cn.iocoder.yudao.module.system.service.user.AdminUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -38,6 +39,7 @@ import org.springframework.validation.annotation.Validated;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -188,6 +190,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
createReqVO
.
getPickNum
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
// 返回
return
orderPickup
.
getId
();
}
...
...
@@ -204,6 +207,20 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
return
orderDO
.
getSumNum
()
-
allPickNum
;
}
private
void
dealDeliveryRate
(
String
orderNo
,
Integer
pickNum
,
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
(
allPickNum
/
sumNum
);
pickRatio
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
orderService
.
update
(
new
LambdaUpdateWrapper
<
OrderDO
>()
.
set
(
OrderDO:
:
getPickNum
,
allPickNum
)
.
set
(
OrderDO:
:
getPickRatio
,
pickRatio
)
.
set
(
OrderDO:
:
getPickState
,
pickState
)
.
eq
(
OrderDO:
:
getOrderNo
,
orderNo
)
);
}
private
void
deleteCustomLevelAndCreditLevelLog
(
OrderPickupDO
orderPickupDO
)
{
OrderBackInfoDto
info
=
orderQueryService
.
info
(
orderService
.
selectOne
(
OrderDO:
:
getOrderNo
,
orderPickupDO
.
getOrderId
()).
getOrderId
());
if
(
info
.
getSumNum
()
!=
0
)
{
...
...
@@ -318,11 +335,13 @@ 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
());
}
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
());
}
if
(
Objects
.
equals
(
one
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_FREIGHT_LINE
.
getValue
()))
{
...
...
@@ -516,6 +535,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
}
}
}
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
createReqVO
.
getPickNum
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
}
}
}
...
...
@@ -638,6 +658,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
OrderDO
orderDO1
=
new
OrderDO
();
BeanUtils
.
copyProperties
(
orderDO
,
orderDO1
);
insertCustomLevelAndCreditLevelLog
(
orderPickup
,
orderDO1
,
false
);
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
createReqVO
.
getPickNum
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
partPick
.
getPickState
());
}
else
if
(
num
<
0
)
{
//如果分批提的数量加上已分批提的数量超过了总量 则重新计算成剩余的量
throw
exception
(
PICK_UP_TOO_MORE
);
...
...
@@ -662,6 +683,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
BeanUtils
.
copyProperties
(
orderDO
,
orderDO1
);
insertCustomLevelAndCreditLevelLog
(
orderPickup
,
orderDO1
,
true
);
updateCustomerLevelUp
(
orderDO1
);
dealDeliveryRate
(
createReqVO
.
getOrderId
(),
createReqVO
.
getPickNum
(),
orderDO
.
getSumNum
(),
PickStateEnum
.
picked
.
getPickState
());
}
orderBusinessService
.
addOrderOperateLog
(
orderDO
.
getOrderId
(),
""
,
"分批提货"
,
""
);
if
(
Objects
.
equals
(
orderDO
.
getTransportId
(),
TransportTypeShortEnum
.
AIR_FREIGHT_LINE
.
getValue
()))
{
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/order/OrderBackPageVO.java
View file @
902f9ec1
...
...
@@ -375,7 +375,7 @@ public class OrderBackPageVO {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
Integer
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/order/OrderBackVO.java
View file @
902f9ec1
...
...
@@ -631,7 +631,7 @@ public class OrderBackVO {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
Integer
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/order/OrderBaseVO.java
View file @
902f9ec1
...
...
@@ -359,7 +359,7 @@ public class OrderBaseVO {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
Integer
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/order/OrderQueryVO.java
View file @
902f9ec1
...
...
@@ -542,16 +542,16 @@ public class OrderQueryVO {
private
Integer
pickState
;
@ApiModelProperty
(
value
=
"'提货率'"
)
private
Integer
pickRatio
;
private
BigDecimal
pickRatio
;
@ApiModelProperty
(
value
=
"小于等于提货率"
)
private
String
lePickRatio
;
private
BigDecimal
lePickRatio
;
@ApiModelProperty
(
value
=
"等于提货率"
)
private
String
eqPickRatio
;
private
BigDecimal
eqPickRatio
;
@ApiModelProperty
(
value
=
"大于等于提货率"
)
private
String
gePickRatio
;
private
BigDecimal
gePickRatio
;
@ApiModelProperty
(
value
=
"'提货箱数'"
)
private
Integer
pickNum
;
...
...
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