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
e5c84ce7
Commit
e5c84ce7
authored
Oct 30, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
到仓业务补充
parent
c8815893
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
123 additions
and
27 deletions
+123
-27
20241027.sql
sql/v2.1/20241027.sql
+9
-0
OrderItemDO.java
...ao/module/order/dal/dataobject/orderItem/OrderItemDO.java
+12
-0
OrderBusinessService.java
...udao/module/order/service/order/OrderBusinessService.java
+4
-5
OrderBusinessServiceImpl.java
...le/order/service/order/impl/OrderBusinessServiceImpl.java
+32
-10
OrderWarehouseCheckServiceImpl.java
...e/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
+20
-12
OrderItemBackVO.java
...oder/yudao/module/order/vo/orderItem/OrderItemBackVO.java
+12
-0
OrderItemBaseVO.java
...oder/yudao/module/order/vo/orderItem/OrderItemBaseVO.java
+12
-0
CheckItemSumVO.java
...o/module/order/vo/orderWarehouseCheck/CheckItemSumVO.java
+22
-0
No files found.
sql/v2.1/20241027.sql
View file @
e5c84ce7
...
...
@@ -8,5 +8,14 @@ alter table ecw_order
alter
table
ecw_order
add
COLUMN
`check_weight`
decimal
(
10
,
2
)
DEFAULT
'0.00'
COMMENT
'到仓重量'
;
alter
table
ecw_order_item
add
COLUMN
`check_num`
int
DEFAULT
'0'
COMMENT
'到仓件数'
;
alter
table
ecw_order_item
add
COLUMN
`check_volume`
decimal
(
10
,
2
)
DEFAULT
'0.00'
COMMENT
'到仓体积'
;
alter
table
ecw_order_item
add
COLUMN
`check_quantity`
int
DEFAULT
'0'
COMMENT
'到仓数量'
;
alter
table
ecw_order_item
add
COLUMN
`check_weight`
decimal
(
10
,
2
)
DEFAULT
'0.00'
COMMENT
'到仓重量'
;
-- 跟进记录菜单
INSERT
INTO
`system_menu`
(
`name`
,
`permission`
,
`menu_type`
,
`sort`
,
`parent_id`
,
`path`
,
`icon`
,
`component`
,
`status`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
,
`is_show_in_menu_bar`
,
`name_en`
,
`keepalive`
,
`redirect`
,
`badge_field`
)
VALUES
(
'跟进记录'
,
''
,
2
,
1
,
1417
,
'offer/logList'
,
'log'
,
'ecw/offer/logList'
,
0
,
'2702'
,
'2024-10-27 12:02:57'
,
'2702'
,
'2024-10-27 12:04:30'
,
b
'0'
,
b
'1'
,
'followLog'
,
b
'0'
,
NULL
,
NULL
);
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/dataobject/orderItem/OrderItemDO.java
View file @
e5c84ce7
...
...
@@ -416,6 +416,18 @@ public class OrderItemDO extends BaseDO {
@ApiModelProperty
(
value
=
"是否处理了渠道特性异常"
)
private
Boolean
handlerChannelAttrException
;
@ApiModelProperty
(
value
=
"到仓件数"
)
private
Integer
checkNum
;
@ApiModelProperty
(
value
=
"到仓数量"
)
private
Integer
checkQuantity
;
@ApiModelProperty
(
value
=
"到仓体积"
)
private
BigDecimal
checkVolume
;
@ApiModelProperty
(
value
=
"到仓重量"
)
private
BigDecimal
checkWeight
;
/**
* 1-未设置商品清关费, 2-区间未匹配上
*/
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/OrderBusinessService.java
View file @
e5c84ce7
...
...
@@ -12,12 +12,14 @@ import cn.iocoder.yudao.module.order.enums.OrderSeaTimeEnum;
import
cn.iocoder.yudao.module.order.param.OrderChangePriceParam
;
import
cn.iocoder.yudao.module.order.param.OrderControlLogParam
;
import
cn.iocoder.yudao.module.order.vo.order.*
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.CheckItemSumVO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductPriceDO
;
import
java.math.BigDecimal
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 订单 Service 接口
...
...
@@ -404,12 +406,9 @@ public interface OrderBusinessService extends IService<OrderDO> {
* 订单到仓更新
*
* @param orderId 订单ID
* @param checkNum 到仓箱数
* @param checkQuantity 到仓数量
* @param checkVolume 到仓体积
* @param checkWeight 到仓重量
* @param itemSumMap 到仓商品项
*/
void
orderToWarehouse
(
Long
orderId
,
Integer
checkNum
,
Integer
checkQuantity
,
BigDecimal
checkVolume
,
BigDecimal
checkWeight
);
void
orderToWarehouse
(
Long
orderId
,
Map
<
Long
,
CheckItemSumVO
>
itemSumMap
);
/**
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
View file @
e5c84ce7
...
...
@@ -66,6 +66,7 @@ import cn.iocoder.yudao.module.order.vo.orderControlLog.OrderControlLogCreateReq
import
cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionCreateReqVO
;
import
cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionDescVO
;
import
cn.iocoder.yudao.module.order.vo.orderOperateLog.OrderOperateLogCreateReqVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.CheckItemSumVO
;
import
cn.iocoder.yudao.module.product.component.ProdCostCalculation
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductAttrDO
;
import
cn.iocoder.yudao.module.product.dal.dataobject.product.ProductDO
;
...
...
@@ -86,6 +87,7 @@ import cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableCreateReqVO;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -4041,9 +4043,29 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemMapper
.
updateById
(
orderItemDO
);
}
@Override
public
void
orderToWarehouse
(
Long
orderId
,
Integer
checkNum
,
Integer
checkQuantity
,
BigDecimal
checkVolume
,
BigDecimal
checkWeight
)
{
public
void
orderToWarehouse
(
Long
orderId
,
Map
<
Long
,
CheckItemSumVO
>
itemSumMap
)
{
Integer
sumCheckNum
=
0
;
Integer
sumCheckQuantity
=
0
;
BigDecimal
sumCheckVolume
=
BigDecimal
.
ZERO
;
BigDecimal
sumCheckWeight
=
BigDecimal
.
ZERO
;
List
<
OrderItemDO
>
orderItemDOList
=
orderItemMapper
.
selectList
(
new
LambdaQueryWrapper
<
OrderItemDO
>().
eq
(
OrderItemDO:
:
getOrderId
,
orderId
));
for
(
OrderItemDO
orderItemDO
:
orderItemDOList
)
{
if
(
itemSumMap
.
containsKey
(
orderItemDO
.
getOrderItemId
())){
CheckItemSumVO
itemSum
=
itemSumMap
.
get
(
orderItemDO
.
getOrderItemId
());
orderItemDO
.
setCheckNum
(
itemSum
.
getCartons
());
orderItemDO
.
setCheckQuantity
(
itemSum
.
getQuantity
());
orderItemDO
.
setCheckVolume
(
itemSum
.
getVolume
());
orderItemDO
.
setCheckWeight
(
itemSum
.
getWeight
());
}
sumCheckNum
+=
orderItemDO
.
getCheckNum
();
sumCheckQuantity
+=
orderItemDO
.
getCheckQuantity
();
sumCheckVolume
=
sumCheckVolume
.
add
(
orderItemDO
.
getCheckVolume
());
sumCheckWeight
=
sumCheckWeight
.
add
(
orderItemDO
.
getCheckWeight
());
}
// 更新订单项的到仓信息
orderItemMapper
.
insertBatch
(
orderItemDOList
);
OrderDO
orderDO
=
orderMapper
.
getOrderById
(
orderId
);
Integer
orgCheckNum
=
orderDO
.
getCheckNum
();
Integer
orgCheckQuantity
=
orderDO
.
getCheckQuantity
();
...
...
@@ -4052,10 +4074,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 更新订单到仓数据
orderMapper
.
update
(
null
,
new
LambdaUpdateWrapper
<
OrderDO
>()
.
set
(
OrderDO:
:
getCheckNum
,
c
heckNum
)
.
set
(
OrderDO:
:
getCheckQuantity
,
c
heckQuantity
)
.
set
(
OrderDO:
:
getCheckVolume
,
c
heckVolume
)
.
set
(
OrderDO:
:
getCheckWeight
,
c
heckWeight
)
.
set
(
OrderDO:
:
getCheckNum
,
sumC
heckNum
)
.
set
(
OrderDO:
:
getCheckQuantity
,
sumC
heckQuantity
)
.
set
(
OrderDO:
:
getCheckVolume
,
sumC
heckVolume
)
.
set
(
OrderDO:
:
getCheckWeight
,
sumC
heckWeight
)
.
eq
(
OrderDO:
:
getOrderId
,
orderId
)
);
// 添加订单到仓操作日志
...
...
@@ -4063,22 +4085,22 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
ApplyInfoVO
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓箱数"
);
applyInfoVO
.
setOrgValue
(
orgCheckNum
+
"箱"
);
applyInfoVO
.
setNewValue
(
c
heckNum
+
"箱"
);
applyInfoVO
.
setNewValue
(
sumC
heckNum
+
"箱"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓数量"
);
applyInfoVO
.
setOrgValue
(
orgCheckQuantity
+
"个"
);
applyInfoVO
.
setNewValue
(
c
heckQuantity
+
"个"
);
applyInfoVO
.
setNewValue
(
sumC
heckQuantity
+
"个"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓体积"
);
applyInfoVO
.
setOrgValue
(
orgCheckVolume
+
"m³"
);
applyInfoVO
.
setNewValue
(
c
heckVolume
+
"m³"
);
applyInfoVO
.
setNewValue
(
sumC
heckVolume
+
"m³"
);
list
.
add
(
applyInfoVO
);
applyInfoVO
=
new
ApplyInfoVO
();
applyInfoVO
.
setName
(
"卸柜/到仓重量"
);
applyInfoVO
.
setOrgValue
(
orgCheckWeight
+
"kg"
);
applyInfoVO
.
setNewValue
(
c
heckWeight
+
"kg"
);
applyInfoVO
.
setNewValue
(
sumC
heckWeight
+
"kg"
);
list
.
add
(
applyInfoVO
);
this
.
addOrderOperateLog
(
orderId
,
"订单操作"
,
"订单卸柜/到仓数据更新"
,
list
);
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
View file @
e5c84ce7
...
...
@@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.order.dal.mysql.orderWarehouseCheck.OrderWarehous
import
cn.iocoder.yudao.module.order.enums.ErrorCodeConstants
;
import
cn.iocoder.yudao.module.order.service.order.OrderBusinessService
;
import
cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.CheckItemSumVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateItemVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
...
...
@@ -19,9 +20,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.validation.annotation.Validated
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -44,25 +43,34 @@ public class OrderWarehouseCheckServiceImpl
// 到仓信息统计
private
class
Sum
{
int
cartons
=
0
;
// 到仓总箱数
int
quantity
=
0
;
// 到仓总数量
BigDecimal
volume
=
BigDecimal
.
ZERO
;
// 到仓总体积
BigDecimal
weight
=
BigDecimal
.
ZERO
;
// 到仓总重量
Map
<
Long
,
CheckItemSumVO
>
itemSumMap
=
new
HashMap
<>();
// 将到仓信息累加
void
add
(
OrderWarehouseCheckDO
checkDo
)
{
cartons
+=
checkDo
.
getCheckCartonsNum
();
quantity
+=
checkDo
.
getCheckQuantityAll
();
volume
=
volume
.
add
(
checkDo
.
getCheckVolume
());
weight
=
weight
.
add
(
checkDo
.
getCheckWeight
());
if
(
itemSumMap
.
containsKey
(
checkDo
.
getOrderItemId
()))
{
CheckItemSumVO
itemSum
=
itemSumMap
.
get
(
checkDo
.
getOrderItemId
());
itemSum
.
add
(
checkDo
.
getCheckCartonsNum
(),
checkDo
.
getCheckQuantityAll
(),
checkDo
.
getCheckVolume
(),
checkDo
.
getCheckWeight
());
itemSumMap
.
put
(
checkDo
.
getOrderItemId
(),
itemSum
);
}
else
{
CheckItemSumVO
itemSum
=
new
CheckItemSumVO
();
itemSum
.
add
(
checkDo
.
getCheckCartonsNum
(),
checkDo
.
getCheckQuantityAll
(),
checkDo
.
getCheckVolume
(),
checkDo
.
getCheckWeight
());
itemSumMap
.
put
(
checkDo
.
getOrderItemId
(),
itemSum
);
}
}
// 将统计数据更新到订单中
void
done
(
long
orderId
)
{
orderBusinessService
.
orderToWarehouse
(
orderId
,
cartons
,
quantity
,
volume
,
weight
);
orderBusinessService
.
orderToWarehouse
(
orderId
,
itemSumMap
);
}
}
private
static
class
ItemSum
{
int
cartons
=
0
;
// 到仓总箱数
int
quantity
=
0
;
// 到仓总数量
BigDecimal
volume
=
BigDecimal
.
ZERO
;
// 到仓总体积
BigDecimal
weight
=
BigDecimal
.
ZERO
;
// 到仓总重量
}
// 重置到仓数据为入仓数据
private
void
reset
(
OrderWarehouseCheckDO
checkDo
)
{
checkDo
.
setCheckVolume
(
checkDo
.
getVolume
());
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderItem/OrderItemBackVO.java
View file @
e5c84ce7
...
...
@@ -437,6 +437,18 @@ public class OrderItemBackVO {
@ApiModelProperty
(
value
=
"入仓记录备注,多个用逗号分隔"
)
private
String
warehouseRecordRemark
;
@ApiModelProperty
(
value
=
"到仓件数"
)
private
Integer
checkNum
;
@ApiModelProperty
(
value
=
"到仓数量"
)
private
Integer
checkQuantity
;
@ApiModelProperty
(
value
=
"到仓体积"
)
private
BigDecimal
checkVolume
;
@ApiModelProperty
(
value
=
"到仓重量"
)
private
BigDecimal
checkWeight
;
public
void
setCouponInfo
(
String
couponInfo
)
{
this
.
couponInfo
=
couponInfo
;
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderItem/OrderItemBaseVO.java
View file @
e5c84ce7
...
...
@@ -290,6 +290,18 @@ public class OrderItemBaseVO {
@ApiModelProperty
(
value
=
"是否处理了渠道特性异常"
)
private
Boolean
handlerChannelAttrException
;
@ApiModelProperty
(
value
=
"到仓件数"
)
private
Integer
checkNum
;
@ApiModelProperty
(
value
=
"到仓数量"
)
private
Integer
checkQuantity
;
@ApiModelProperty
(
value
=
"到仓体积"
)
private
BigDecimal
checkVolume
;
@ApiModelProperty
(
value
=
"到仓重量"
)
private
BigDecimal
checkWeight
;
public
void
setWarehouseInInfo
(
String
warehouseInInfo
)
{
this
.
warehouseInInfo
=
warehouseInInfo
;
this
.
warehouseInInfoVO
=
JSONObject
.
parseObject
(
warehouseInInfo
,
WarehouseInInfoVO
.
class
);
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderWarehouseCheck/CheckItemSumVO.java
0 → 100644
View file @
e5c84ce7
package
cn
.
iocoder
.
yudao
.
module
.
order
.
vo
.
orderWarehouseCheck
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
CheckItemSumVO
{
int
cartons
=
0
;
// 到仓总箱数
int
quantity
=
0
;
// 到仓总数量
BigDecimal
volume
=
BigDecimal
.
ZERO
;
// 到仓总体积
BigDecimal
weight
=
BigDecimal
.
ZERO
;
// 到仓总重量
public
void
add
(
Integer
checkNum
,
Integer
checkQuantity
,
BigDecimal
checkVolume
,
BigDecimal
checkWeight
)
{
this
.
cartons
+=
checkNum
;
this
.
quantity
+=
checkQuantity
;
this
.
volume
=
this
.
volume
.
add
(
checkVolume
);
this
.
weight
=
this
.
weight
.
add
(
checkWeight
);
}
}
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