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
e6cb3890
Commit
e6cb3890
authored
Nov 11, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
强制到仓业务调整
parent
a77a583d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
12 deletions
+148
-12
BoxOrderForceWarehouseCheckEvent.java
...ollo/core/event/box/BoxOrderForceWarehouseCheckEvent.java
+36
-0
OrderWarehouseCheckService.java
...rvice/orderWarehouseCheck/OrderWarehouseCheckService.java
+4
-3
OrderWarehouseCheckServiceImpl.java
...e/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
+20
-6
OrderForceCheck.java
.../module/order/vo/orderWarehouseCheck/OrderForceCheck.java
+22
-0
OrderWarehouseCheckController.java
...in/orderWarehouseCheck/OrderWarehouseCheckController.java
+4
-3
BoxOrderForceWarehouseCheckListener.java
...hipment/listener/BoxOrderForceWarehouseCheckListener.java
+62
-0
No files found.
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/event/box/BoxOrderForceWarehouseCheckEvent.java
0 → 100644
View file @
e6cb3890
package
cn
.
iocoder
.
yudao
.
framework
.
apollo
.
core
.
event
.
box
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
java.util.Date
;
/**
* 审批校验 Event
*
* @author zhengYi
*/
@Data
@AllArgsConstructor
public
class
BoxOrderForceWarehouseCheckEvent
{
/**
* 订单ID
*/
private
Long
orderId
;
/**
* 自编号
*/
private
String
selfNo
;
/**
* 自编号
*/
private
Date
unloadTime
;
/**
* 运输方式id
*/
private
Integer
transportId
;
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseCheck/OrderWarehouseCheckService.java
View file @
e6cb3890
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.order.service.orderWarehouseCheck;
import
cn.iocoder.yudao.framework.mybatis.core.service.IService
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderForceCheck
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateItemVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO
;
...
...
@@ -30,11 +31,11 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck
void
check
(
long
orderId
);
/**
* 强制到仓.
箱数=入仓箱数
* 强制到仓.
订单修改为已卸柜/到仓 箱数=入仓箱数(注意:这里对/卸柜到仓箱标号不做处理)
*
* @param order
Id 订单编号
* @param order
ForceCheck 强制到仓信息
*/
void
force
(
long
orderId
);
void
force
(
OrderForceCheck
orderForceCheck
);
/**
* 撤销到仓. 修改订单状态为已清关,清空到仓时间箱数以及详情
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseCheck/OrderWarehouseCheckServiceImpl.java
View file @
e6cb3890
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.order.service.orderWarehouseCheck;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.box.BoxOrderForceWarehouseCheckEvent
;
import
cn.iocoder.yudao.framework.common.exception.ServiceException
;
import
cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
...
...
@@ -11,6 +12,7 @@ import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseArea
import
cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO
;
import
cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaMapper
;
import
cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaPositionMapper
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseIn.OrderWarehouseInDO
;
...
...
@@ -29,6 +31,7 @@ import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO;
import
cn.iocoder.yudao.module.order.vo.orderLocation.OrderLocationBackVO
;
import
cn.iocoder.yudao.module.order.vo.orderLocation.OrderLocationMergeVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.CheckItemSumVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderForceCheck
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateItemVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO
;
import
com.alibaba.fastjson.JSON
;
...
...
@@ -41,6 +44,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -51,6 +55,8 @@ import java.util.*;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
@Slf4j
@Service
@Validated
...
...
@@ -62,7 +68,8 @@ public class OrderWarehouseCheckServiceImpl
@Autowired
private
OrderMapper
orderMapper
;
@Autowired
private
ApplicationContext
applicationContext
;
@Autowired
private
OrderWarehouseInService
orderWarehouseInService
;
@Autowired
...
...
@@ -172,8 +179,15 @@ public class OrderWarehouseCheckServiceImpl
}
@Override
public
void
force
(
long
orderId
)
{
check
(
orderId
);
public
void
force
(
OrderForceCheck
orderForceCheck
)
{
// 修改订单卸柜/到仓状态
OrderDO
orderDO
=
orderMapper
.
selectById
(
orderForceCheck
.
getOrderId
());
if
(
Objects
.
isNull
(
orderDO
))
{
throw
exception
(
ErrorCodeConstants
.
ORDER_NOT_EXISTS
);
}
applicationContext
.
publishEvent
(
new
BoxOrderForceWarehouseCheckEvent
(
orderDO
.
getOrderId
(),
orderDO
.
getContainerNumber
(),
orderForceCheck
.
getUnloadTime
(),
orderDO
.
getTransportId
()));
// 同步到仓数据
check
(
orderForceCheck
.
getOrderId
());
}
@Override
...
...
@@ -196,7 +210,7 @@ public class OrderWarehouseCheckServiceImpl
public
void
update
(
OrderWarehouseCheckUpdateReqVO
checkUpdateReqVO
)
{
Map
<
Long
,
OrderWarehouseCheckDO
>
mappings
=
listByOrderItemId
(
checkUpdateReqVO
.
getOrderItemId
()).
stream
()
.
collect
(
Collectors
.
toMap
(
OrderWarehouseCheckDO:
:
getId
,
Function
.
identity
()));
ServiceException
exception
=
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_WAREHOUSE_CHECK_NOT_EXISTS
);
ServiceException
exception
=
exception
(
ErrorCodeConstants
.
ORDER_WAREHOUSE_CHECK_NOT_EXISTS
);
List
<
OrderWarehouseCheckDO
>
newWarehouseCheckDOList
=
new
ArrayList
<>();
Date
now
=
DateUtil
.
date
();
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
...
...
@@ -275,11 +289,11 @@ public class OrderWarehouseCheckServiceImpl
checkTime
=
orderWarehouseCheckDOListExist
.
stream
().
map
(
OrderWarehouseCheckDO:
:
getCheckTime
).
filter
(
Objects:
:
nonNull
).
sorted
().
findFirst
().
orElse
(
null
);
boxGauge
=
orderWarehouseCheckDOListExist
.
stream
().
map
(
OrderWarehouseCheckDO:
:
getBoxGauge
).
filter
(
Objects:
:
nonNull
).
sorted
().
findFirst
().
orElse
(
null
);
if
(
StringUtils
.
isBlank
(
boxGauge
))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
BOX_GAUGE_FORMAT_ERROR
);
throw
exception
(
ErrorCodeConstants
.
BOX_GAUGE_FORMAT_ERROR
);
}
String
[]
gauge
=
boxGauge
.
split
(
"\\*"
);
if
(
gauge
.
length
!=
3
)
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
BOX_GAUGE_FORMAT_ERROR
);
throw
exception
(
ErrorCodeConstants
.
BOX_GAUGE_FORMAT_ERROR
);
}
mixStatus
=
orderWarehouseCheckDOListExist
.
stream
().
anyMatch
(
t
->
CollectionUtil
.
isNotEmpty
(
t
.
getOrderWarehouseInDetailsVOList
()))
?
1
:
0
;
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderWarehouseCheck/OrderForceCheck.java
0 → 100644
View file @
e6cb3890
package
cn
.
iocoder
.
yudao
.
module
.
order
.
vo
.
orderWarehouseCheck
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
@Data
public
class
OrderForceCheck
{
@ApiModelProperty
(
"订单ID"
)
@NotNull
(
message
=
"请选择订单"
)
private
Long
orderId
;
@ApiModelProperty
(
"卸柜/到仓时间"
)
@NotNull
(
message
=
"请输入卸柜/到仓时间"
)
private
Date
unloadTime
;
}
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/orderWarehouseCheck/OrderWarehouseCheckController.java
View file @
e6cb3890
...
...
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWar
import
cn.iocoder.yudao.module.order.service.order.OrderQueryService
;
import
cn.iocoder.yudao.module.order.service.orderWarehouseCheck.OrderWarehouseCheckService
;
import
cn.iocoder.yudao.module.order.vo.order.OrderQueryVO
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderForceCheck
;
import
cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -38,11 +39,11 @@ public class OrderWarehouseCheckController {
return
success
(
service
.
listByOrderItemId
(
orderItemId
));
}
@PostMapping
(
"/force
/{orderId}
"
)
@PostMapping
(
"/force"
)
@ApiOperation
(
"强制到仓"
)
@ApiImplicitParam
(
name
=
"orderId"
,
value
=
"订单id"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
Boolean
>
force
(
@
PathVariable
(
"orderId"
)
Long
orderId
)
{
service
.
force
(
order
Id
);
public
CommonResult
<
Boolean
>
force
(
@
Valid
@RequestBody
OrderForceCheck
orderForceCheck
)
{
service
.
force
(
order
ForceCheck
);
return
success
(
true
);
}
...
...
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/listener/BoxOrderForceWarehouseCheckListener.java
0 → 100644
View file @
e6cb3890
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
listener
;
import
cn.iocoder.yudao.framework.apollo.core.event.box.BoxCheckOrderApprovalEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.box.BoxOrderForceWarehouseCheckEvent
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxApprovalDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO
;
import
cn.iocoder.yudao.module.shipment.enums.BoxApprovalTypeEnum
;
import
cn.iocoder.yudao.module.shipment.service.box.BoxService
;
import
cn.iocoder.yudao.module.shipment.service.boxApproval.BoxApprovalService
;
import
cn.iocoder.yudao.module.shipment.service.boxLoadInfo.BoxLoadInfoService
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.event.EventListener
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Objects
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
WAREHOUSE_IN_BOX_EXCEPTION
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderApprovalTypeResultEnum
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
enums
.
ErrorCodeConstants
.
BOX_NOT_EXISTS
;
/**
* 订单强制到仓业务执行
*
* @author zhengYi
*/
@Component
(
"BoxOrderForceWarehouseCheckListener"
)
@AllArgsConstructor
@Slf4j
public
class
BoxOrderForceWarehouseCheckListener
{
private
final
BoxLoadInfoService
boxLoadInfoService
;
private
final
BoxService
boxService
;
/**
* 订单强制到仓业务执行
*
* @param event 订单信息
*/
@EventListener
(
BoxOrderForceWarehouseCheckEvent
.
class
)
public
void
orderForceWarehouseCheck
(
BoxOrderForceWarehouseCheckEvent
event
)
{
BoxDO
boxDO
=
boxService
.
getOne
(
new
LambdaQueryWrapper
<
BoxDO
>().
eq
(
BoxDO:
:
getSelfNo
,
event
.
getSelfNo
()));
if
(
boxDO
==
null
)
{
throw
exception
(
BOX_NOT_EXISTS
);
}
if
(
event
.
getTransportId
()
==
1
){
// 海运
boxLoadInfoService
.
updateOrderStatus
(
Arrays
.
asList
(
event
.
getOrderId
()),
event
.
getUnloadTime
(),
boxDO
);
}
else
{
// 空运
boxLoadInfoService
.
updateOrderStatusAir
(
Arrays
.
asList
(
event
.
getOrderId
()),
event
.
getUnloadTime
(),
boxDO
);
}
}
}
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