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
ecb7b3fa
Commit
ecb7b3fa
authored
Oct 25, 2024
by
yanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task: #230 出货-入仓信息新增/修改
parent
0e9ab1d2
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
934 additions
and
205 deletions
+934
-205
OrderWarehouseInDO.java
...r/dal/dataobject/orderWarehouseIn/OrderWarehouseInDO.java
+7
-0
ErrorCodeConstants.java
.../iocoder/yudao/module/order/enums/ErrorCodeConstants.java
+11
-0
OrderWarehouseInService.java
...der/service/orderWarehouseIn/OrderWarehouseInService.java
+17
-1
OrderWarehouseInServiceImpl.java
...service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
+788
-189
OrderWarehouseInCreateReqVO.java
...rder/vo/orderWarehouseIn/OrderWarehouseInCreateReqVO.java
+14
-0
OrderWarehouseInUpdateApplyReqVO.java
...vo/orderWarehouseIn/OrderWarehouseInUpdateApplyReqVO.java
+31
-0
OrderWarehouseInController.java
...er/admin/orderWarehouseIn/OrderWarehouseInController.java
+35
-1
messages.properties
yudao-server/src/main/resources/i18n/messages.properties
+10
-0
messages_en.properties
yudao-server/src/main/resources/i18n/messages_en.properties
+4
-0
messages_zh.properties
yudao-server/src/main/resources/i18n/messages_zh.properties
+17
-14
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/dataobject/orderWarehouseIn/OrderWarehouseInDO.java
View file @
ecb7b3fa
...
...
@@ -105,6 +105,13 @@ public class OrderWarehouseInDO extends BaseDO {
*/
private
String
remark
;
/**
* 出货后新添加的商品
*/
private
Boolean
isShipmentNewIn
=
false
;
/**
* 入仓纪录明细VO
*/
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/enums/ErrorCodeConstants.java
View file @
ecb7b3fa
...
...
@@ -431,4 +431,15 @@ public interface ErrorCodeConstants {
ErrorCode
ORDER_APPROVAL_IS_NOT_EXISTS
=
new
ErrorCode
(
1004001171
,
"order.approval.is.not.exists"
);
ErrorCode
FEE_APPLICATION_NOT_IS_ZERO
=
new
ErrorCode
(
1004001172
,
"fee.application.not.is.zero"
);
ErrorCode
GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS
=
new
ErrorCode
(
1004001173
,
"guan.lian.order.is.approval.in.process"
);
//订单不是已装柜/已出货,不可操作
ErrorCode
WAREHOUSE_IN_UPDATE_NOT_SHIPMENT
=
new
ErrorCode
(
1004001181
,
"warehouse.in.update.not.shipment"
);
//订单已放货,无法修改
ErrorCode
CARGO_CONTROL_ORDER_ALREADY_PICKED
=
new
ErrorCode
(
1004001182
,
"cargo.control.order.already.picked"
);
//订单已提货,无法修改
ErrorCode
CARGO_UNCONTROL_ORDER_ALREADY_PICKED
=
new
ErrorCode
(
1004001183
,
"cargo.uncontrol.order.already.picked"
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseIn/OrderWarehouseInService.java
View file @
ecb7b3fa
...
...
@@ -7,7 +7,6 @@ import cn.iocoder.yudao.module.customer.vo.zhongPao.ZhongPaoBestVO;
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.orderWarehouseIn.OrderWarehouseInDO
;
import
cn.iocoder.yudao.module.order.vo.order.OrderWarehouseInCommonAttrVO
;
import
cn.iocoder.yudao.module.order.vo.order.OrderWarehouseInWithAttrVO
;
import
cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO
;
import
cn.iocoder.yudao.module.order.vo.orderItem.OrderItemBackVO
;
...
...
@@ -151,6 +150,23 @@ public interface OrderWarehouseInService extends IService<OrderWarehouseInDO> {
String
updateOrUpdateApply
(
@Valid
OrderWarehouseInUpdateApplyReqVO
updateReqVO
);
/**
* 出货阶段-追加申请
*
* @param createReqVO 创建信息
* @return 编号
*/
boolean
appendApplyWhenShipment
(
@Valid
OrderWarehouseInCreateReqVO
createReqVO
);
/**
* 出货阶段-入仓修改申请
* @param updateReqVO
* @return
*/
String
updateApplyWhenShipment
(
@Valid
OrderWarehouseInUpdateApplyReqVO
updateReqVO
);
/**
* 入仓修改回调
*
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
View file @
ecb7b3fa
...
...
@@ -116,6 +116,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
...
...
@@ -133,7 +134,8 @@ import java.util.stream.Collectors;
import
static
cn
.
iocoder
.
yudao
.
framework
.
apollo
.
core
.
constants
.
Constants
.
NOT_ACCEPTED_PROD_CODE
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderApprovalTypeEnum
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderApprovalTypeEnum
.
WAREHOUSE_ROLLBACK
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
OrderApprovalTypeEnum
.
WAREHOUSE_UPDATE
;
import
static
cn
.
iocoder
.
yudao
.
module
.
wealth
.
enums
.
ErrorCodeConstants
.
RECEIVABLE_WRITE_OFF_ING_NO_NEED_TO_PACK
;
/**
...
...
@@ -1327,23 +1329,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 保存箱号
if
(
finishReqVO
.
getUpdateLabel
())
{
List
<
OrderLabelDto
>
labelDtoList
=
finishReqVO
.
getLabelList
();
if
(
CollectionUtil
.
isEmpty
(
labelDtoList
))
{
// 若没有标签号列表参数,则说明不是更新的,就查一下是否有1~sum的标签号,若有,就不需要再重新生成了。
List
<
OrderLabelBackVO
>
orderLabelBackVOS
=
orderLabelService
.
getLabelListByOrder
(
orderId
);
if
(
CollectionUtil
.
isNotEmpty
(
orderLabelBackVOS
)
&&
orderLabelBackVOS
.
size
()
==
1
&&
orderLabelBackVOS
.
get
(
0
).
getEnd
()
==
numSum2
)
{
// do nothing
labelDtoList
=
new
ArrayList
<>();
}
else
{
labelDtoList
=
CollectionUtil
.
newArrayList
(
new
OrderLabelDto
(
null
,
1
,
numSum2
));
}
}
if
(
CollectionUtil
.
isNotEmpty
(
labelDtoList
))
{
orderLabelService
.
saveOrUpdateLabel
(
SaveOrUpdateOrderLabelDto
.
builder
().
orderId
(
orderId
).
orderLabelDtoList
(
labelDtoList
).
isAddLog
(
false
).
build
());
}
saveOrUpdateLabel
(
orderId
,
numSum2
,
labelDtoList
);
}
// 针对未处理的异常,判断异常的orderItemId不在订单的orderItemList中的,
...
...
@@ -1478,6 +1464,32 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
return
exceptionNum
>
0
;
}
/**
* 保存标签号
* @param orderId 订单id
* @param numSum 总数量
* @param labelDtoList 编号集合,若不为空则直接更新。若为空,则更新为1~sum
*/
private
void
saveOrUpdateLabel
(
Long
orderId
,
int
numSum
,
List
<
OrderLabelDto
>
labelDtoList
)
{
if
(
CollectionUtil
.
isEmpty
(
labelDtoList
))
{
// 若没有标签号列表参数,则说明不是更新的,就查一下是否有1~sum的标签号,若有,就不需要再重新生成了。
List
<
OrderLabelBackVO
>
orderLabelBackVOS
=
orderLabelService
.
getLabelListByOrder
(
orderId
);
if
(
CollectionUtil
.
isNotEmpty
(
orderLabelBackVOS
)
&&
orderLabelBackVOS
.
size
()
==
1
&&
orderLabelBackVOS
.
get
(
0
).
getEnd
()
==
numSum
)
{
// do nothing
labelDtoList
=
new
ArrayList
<>();
}
else
{
labelDtoList
=
CollectionUtil
.
newArrayList
(
new
OrderLabelDto
(
null
,
1
,
numSum
));
}
}
if
(
CollectionUtil
.
isNotEmpty
(
labelDtoList
))
{
orderLabelService
.
saveOrUpdateLabel
(
SaveOrUpdateOrderLabelDto
.
builder
().
orderId
(
orderId
).
orderLabelDtoList
(
labelDtoList
).
isAddLog
(
false
).
build
());
}
}
private
void
processOrderPayException
(
Long
orderId
,
OrderDO
orderDO
,
Integer
result
)
{
if
(
result
==
1
)
{
List
<
OrderItemDO
>
payAdanceOrderItemList
=
orderItemService
.
getOrderItemsByOrderId
(
Arrays
.
asList
(
orderId
)).
stream
()
...
...
@@ -3413,151 +3425,670 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
void
updateApplyCallback
(
String
bizId
,
Integer
result
)
{
// OrderWarehouseApprovalDO orderWarehouseApprovalDO = orderWarehouseApprovalService.selectOne(OrderWarehouseApprovalTypeEnum.WAREHOUSE_IN_UPDATE.getValue(), Long.parseLong(bizId));
OrderWarehouseApprovalDO
orderWarehouseApprovalDO
=
orderWarehouseApprovalService
.
getById
(
bizId
);
private
void
compareOrderItemFieldAppend
(
OrderWarehouseInCreateReqVO
createReqVO
,
OrderItemDO
orderItemOld
,
List
<
ApplyInfoVO
>
applyInfoList
)
{
String
prodName
=
String
.
format
(
"商品:%s - "
,
orderItemOld
.
getProdTitleZh
());
// 更新审批单状态
orderWarehouseApprovalService
.
callbackUpdate
(
orderWarehouseApprovalDO
,
result
);
Boolean
isNew
=
createReqVO
.
getIsAppend
();
if
(
isNew
)
{
prodName
=
String
.
format
(
"出货追加新商品:%s - "
,
orderItemOld
.
getProdTitleZh
());
}
long
orderId
=
Long
.
parseLong
(
orderWarehouseApprovalDO
.
getOrderIds
());
String
processingResults
=
orderWarehouseApprovalDO
.
getProcessingResults
();
// 通过
if
(
ApprovalResultStatusEnum
.
pass
.
getValue
().
equals
(
result
))
{
// 将老的信息更新成新的信息
Long
orderItemId
=
orderWarehouseApprovalDO
.
getOrderItemId
();
OrderItemDO
orderItemDO
=
orderItemService
.
getById
(
orderItemId
);
OrderDO
orderDO
=
orderService
.
getById
(
orderId
);
BigDecimal
sumVolumeBeforeUpdate
=
orderDO
.
getSumVolume
();
BigDecimal
sumWeightBeforeUpdate
=
orderDO
.
getSumWeight
();
ApplyInfoVO
infoVO
;
if
(
isNew
||
!
Objects
.
equals
(
orderItemOld
.
getProdId
(),
createReqVO
.
getProdId
()))
{
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
isNew
?
"新增商品"
:
"商品"
);
Long
prodId
=
createReqVO
.
getProdId
();
ProductDO
productDONew
=
productService
.
getProduct
(
prodId
);
infoVO
.
setNewValue
(
productDONew
==
null
?
"空"
:
(
I18nMessage
.
getLang
()
==
0
?
productDONew
.
getTitleZh
()
:
productDONew
.
getTitleEn
()));
applyInfoList
.
add
(
infoVO
);
}
// 验证是否不可接受货物
this
.
validateProdAttrAccess
(
orderItemDO
.
getProdId
(),
orderDO
.
getOrderNo
());
if
(
isNew
||
!
Objects
.
equals
(
orderItemOld
.
getBrand
(),
createReqVO
.
getBrand
()))
{
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"品牌"
);
if
(
isNew
)
{
infoVO
.
setOrgValue
(
"空"
);
}
else
{
ProductBrankDO
productBrankDOOld
=
productBrankMapper
.
selectById
(
orderItemOld
.
getBrand
());
infoVO
.
setOrgValue
(
productBrankDOOld
==
null
?
"无"
:
(
I18nMessage
.
getLang
()
==
0
?
productBrankDOOld
.
getTitleZh
()
:
productBrankDOOld
.
getTitleEn
()));
}
ProductBrankDO
productBrankDONew
=
productBrankMapper
.
selectById
(
createReqVO
.
getBrand
());
infoVO
.
setNewValue
(
productBrankDONew
==
null
?
"无"
:
(
I18nMessage
.
getLang
()
==
0
?
productBrankDONew
.
getTitleZh
()
:
productBrankDONew
.
getTitleEn
()));
applyInfoList
.
add
(
infoVO
);
}
// Integer brandTypeOld = orderItemOld.getBrandType();
// Integer brandTypeNew = updateReqVO.getBrandType();
// if (!Objects.equals(brandTypeOld, brandTypeNew)) {
// infoVO = new ApplyInfoVO();
// infoVO.setName(prodName + "是否备案");
// infoVO.setOrgValue(brandTypeOld.equals(0) ? "无备案" : (brandTypeOld.equals(1) ? "有备案" : "中性"));
// infoVO.setNewValue(brandTypeNew.equals(0) ? "无备案" : (brandTypeNew.equals(1) ? "有备案" : "中性"));
// applyInfoList.add(infoVO);
// }
if
(
isNew
||
!
Objects
.
equals
(
orderItemOld
.
getFeeType
(),
createReqVO
.
getFeeType
()))
{
// 通过orderItemId查询db中的 orderWarehouseInDO
List
<
OrderWarehouseInDO
>
orderWarehouseInListOld
=
orderWarehouseInMapper
.
selectList
(
new
LambdaQueryWrapperX
<
OrderWarehouseInDO
>().
eq
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
)
.
eq
(
OrderWarehouseInDO:
:
getOrderItemId
,
orderItemId
));
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"收费模式"
);
if
(
isNew
)
{
infoVO
.
setOrgValue
(
"空"
);
}
else
{
infoVO
.
setOrgValue
(
orderItemOld
.
getFeeType
().
equals
(
0
)
?
"无牌价"
:
(
orderItemOld
.
getFeeType
().
equals
(
1
)
?
"有牌价"
:
"中性品牌价"
));
}
infoVO
.
setNewValue
(
createReqVO
.
getFeeType
().
equals
(
0
)
?
"无牌价"
:
(
createReqVO
.
getFeeType
().
equals
(
1
)
?
"有牌价"
:
"中性品牌价"
));
applyInfoList
.
add
(
infoVO
);
}
String
details
=
orderWarehouseApprovalDO
.
getDetails
();
if
(
StringUtils
.
isNotEmpty
(
details
))
{
OrderWarehouseInUpdateApplyReqVO
updateReqVO
=
JSON
.
parseObject
(
details
,
OrderWarehouseInUpdateApplyReqVO
.
class
);
// 先更新入仓
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDtoListNew
=
updateReqVO
.
getOrderWarehouseInUpdateItemDoList
();
// 统计总入仓数量,体积,重量
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDoList
=
createReqVO
.
getOrderWarehouseInItemDoList
();
Integer
totalNum
=
orderWarehouseInItemDoList
.
stream
().
map
(
OrderWarehouseInItemDto:
:
getCartonsNum
).
reduce
(
0
,
Integer:
:
sum
);
BigDecimal
totalVolume
=
orderWarehouseInItemDoList
.
stream
().
map
(
OrderWarehouseInItemDto:
:
getVolume
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
BigDecimal
totalWeight
=
orderWarehouseInItemDoList
.
stream
().
map
(
OrderWarehouseInItemDto:
:
getWeight
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
ZhongPaoBestVO
zhongPaoBest
=
getZhongPaoBest
(
orderDO
);
BigDecimal
zhongEdge
=
zhongPaoBest
!=
null
?
zhongPaoBest
.
getZhongEdge
()
:
null
;
BigDecimal
paoEdge
=
zhongPaoBest
!=
null
?
zhongPaoBest
.
getPaoEdge
()
:
null
;
Integer
numOld
=
0
;
BigDecimal
volumeOld
=
BigDecimal
.
ZERO
;
BigDecimal
weightOld
=
BigDecimal
.
ZERO
;
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListNew
))
{
if
(!
isNew
)
{
// 统计原来的入仓数理,体积,重量
WarehouseInInfoVO
warehouseInInfoVO
=
orderItemOld
.
getWarehouseInInfoVO
();
numOld
=
warehouseInInfoVO
==
null
?
0
:
warehouseInInfoVO
.
getCartonsNum
();
// 体积
volumeOld
=
warehouseInInfoVO
==
null
?
BigDecimal
.
ZERO
:
warehouseInInfoVO
.
getVolume
();
// 重量
weightOld
=
warehouseInInfoVO
==
null
?
BigDecimal
.
ZERO
:
warehouseInInfoVO
.
getWeight
();
}
// 2023-04-20 1.入仓修改可以添加入仓记录,添加审核通过后,入仓时间为提交入仓的系统时间,无需选择入仓时间。
Date
inTime
=
orderWarehouseApprovalDO
.
getCreateTime
();
// 1、新增 (只有新增的可能有储位,修改储位是直接调用修改接口的。)
List
<
OrderWarehouseInItemDto
>
addList
=
orderWarehouseInItemDtoListNew
.
stream
().
filter
(
t
->
t
.
getId
()
==
null
).
collect
(
Collectors
.
toList
()
);
if
(
CollectionUtil
.
isNotEmpty
(
addList
))
{
for
(
OrderWarehouseInItemDto
orderWarehouseInItemDto
:
addList
)
{
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"填单数量"
);
infoVO
.
setOrgValue
(
numOld
!=
null
?
numOld
.
toString
()
:
"0"
);
infoVO
.
setNewValue
(
totalNum
!=
null
?
totalNum
.
toString
()
:
"0"
);
applyInfoList
.
add
(
infoVO
);
OrderWarehouseInDO
orderWarehouseInDO
=
convertOrderWarehouseInItemDo
(
orderDO
,
orderItemId
,
zhongPaoBest
,
zhongEdge
,
paoEdge
,
orderWarehouseInItemDto
,
inTime
);
orderWarehouseInMapper
.
insert
(
orderWarehouseInDO
);
// 体积
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"填单体积"
);
infoVO
.
setOrgValue
(
volumeOld
!=
null
?
volumeOld
.
toPlainString
()
:
"0"
);
infoVO
.
setNewValue
(
totalVolume
.
toPlainString
());
applyInfoList
.
add
(
infoVO
);
// 保存储位
List
<
OrderLocationCreateReqVO
>
orderLocationCreateReqVOList
=
orderWarehouseInItemDto
.
getOrderLocationCreateReqVOList
();
if
(
CollectionUtil
.
isNotEmpty
(
orderLocationCreateReqVOList
))
{
for
(
OrderLocationCreateReqVO
orderLocationCreateReqVO
:
orderLocationCreateReqVOList
)
{
// 设置入仓纪录id
orderLocationCreateReqVO
.
setWarehouseInId
(
orderWarehouseInDO
.
getId
());
orderLocationService
.
createOrderLocation
(
orderLocationCreateReqVO
);
}
// 重量
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"填单重量"
);
infoVO
.
setOrgValue
(
weightOld
!=
null
?
weightOld
.
toPlainString
()
:
"0"
);
infoVO
.
setNewValue
(
totalWeight
.
toPlainString
());
applyInfoList
.
add
(
infoVO
);
if
(!
Objects
.
equals
(
orderItemOld
.
getMaterial
(),
createReqVO
.
getMaterial
()))
{
String
materialOld
=
orderItemOld
.
getMaterial
();
String
materialNew
=
createReqVO
.
getMaterial
();
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"材质"
);
if
(!
isNew
&&
StringUtils
.
isNotEmpty
(
materialOld
))
{
DictDataRespDTO
material
=
DictFrameworkUtils
.
getDictDataFromCache
(
"product_material"
,
materialOld
);
String
labelEn
=
material
!=
null
?
material
.
getLabelEn
()
:
materialOld
;
String
label
=
material
!=
null
?
material
.
getLabel
()
:
materialOld
;
infoVO
.
setOrgValue
(
I18nMessage
.
getLang
()
==
0
?
label
:
labelEn
);
}
else
{
infoVO
.
setOrgValue
(
"空"
);
}
if
(
StringUtils
.
isNotEmpty
(
materialNew
))
{
DictDataRespDTO
material
=
DictFrameworkUtils
.
getDictDataFromCache
(
"product_material"
,
materialNew
);
String
labelEn
=
material
!=
null
?
material
.
getLabelEn
()
:
materialNew
;
String
label
=
material
!=
null
?
material
.
getLabel
()
:
materialNew
;
infoVO
.
setNewValue
(
I18nMessage
.
getLang
()
==
0
?
label
:
labelEn
);
}
else
{
infoVO
.
setNewValue
(
"空"
);
}
applyInfoList
.
add
(
infoVO
);
}
// 2、更新 //2023-04-20 入仓修改若修改已有入仓记录,
// 有改动(储位或其他信息修改)修改入仓记录的最新操作时间,
// 不修改入仓时间,不修改未发生变化的入仓记录的入仓时间和最新操作时间。
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListNew
))
{
//更新的
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDtoListUpdate
=
orderWarehouseInItemDtoListNew
.
stream
().
filter
(
t
->
t
.
getId
()
!=
null
&&
orderWarehouseInListOld
.
stream
().
anyMatch
(
old
->
old
.
getId
().
equals
(
t
.
getId
()))).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListUpdate
))
{
String
warehouseInProdAttrIdsNew
=
createReqVO
.
getWarehouseInProdAttrIds
();
String
warehouseInProdAttrIdsOld
=
isNew
==
null
?
""
:
StringUtils
.
isNotEmpty
(
orderItemOld
.
getWarehouseInProdAttrIds
())
?
orderItemOld
.
getWarehouseInProdAttrIds
()
:
orderItemOld
.
getProdAttrIds
();
String
prodAttrIdsSortOld
=
isNew
==
null
?
""
:
StringUtils
.
isNotEmpty
(
warehouseInProdAttrIdsOld
)
?
Arrays
.
stream
(
warehouseInProdAttrIdsOld
.
split
(
","
)).
filter
(
Objects:
:
nonNull
).
sorted
(
Comparator
.
comparingInt
(
Integer:
:
parseInt
)).
collect
(
Collectors
.
joining
(
","
))
:
""
;
for
(
OrderWarehouseInItemDto
itemDtoNew
:
orderWarehouseInItemDtoListUpdate
)
{
String
prodAttrIdsSortNew
=
StringUtils
.
isNotEmpty
(
warehouseInProdAttrIdsNew
)
?
Arrays
.
stream
(
warehouseInProdAttrIdsNew
.
split
(
","
)).
filter
(
Objects:
:
nonNull
).
sorted
(
Comparator
.
comparingInt
(
Integer:
:
parseInt
)).
collect
(
Collectors
.
joining
(
","
))
:
""
;
OrderWarehouseInDO
orderWarehouseInDONew
=
convertOrderWarehouseInItemDo
(
orderDO
,
orderItemId
,
zhongPaoBest
,
zhongEdge
,
paoEdge
,
itemDtoNew
,
inTime
);
if
(!
Objects
.
equals
(
prodAttrIdsSortOld
,
prodAttrIdsSortNew
))
{
// 判断有无变化
OrderWarehouseInDO
old
=
orderWarehouseInMapper
.
selectById
(
itemDtoNew
.
getId
());
List
<
ApplyInfoVO
>
applyInfoVOListTmp
=
new
ArrayList
<>();
compareOrderWarehouseInField
(
""
,
Arrays
.
asList
(
old
),
Arrays
.
asList
(
itemDtoNew
),
applyInfoVOListTmp
);
// 有变化才更新
if
(
CollectionUtil
.
isNotEmpty
(
applyInfoVOListTmp
))
{
orderWarehouseInMapper
.
updateById
(
orderWarehouseInDONew
);
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"入仓商品特性"
);
applyInfoVOListTmp
.
clear
();
if
(
StringUtils
.
isNotEmpty
(
warehouseInProdAttrIdsOld
))
{
List
<
ProductAttrDO
>
productAttrDOS
=
productAttrMapper
.
selectBatchIds
(
Arrays
.
asList
(
warehouseInProdAttrIdsOld
.
split
(
StrUtil
.
COMMA
)));
if
(
CollectionUtil
.
isNotEmpty
(
productAttrDOS
))
{
infoVO
.
setOrgValue
(
I18nMessage
.
getLang
()
==
0
?
productAttrDOS
.
stream
().
map
(
ProductAttrDO:
:
getAttrName
).
collect
(
Collectors
.
joining
(
","
))
:
productAttrDOS
.
stream
().
map
(
ProductAttrDO:
:
getAttrNameEn
).
collect
(
Collectors
.
joining
(
","
)));
}
else
{
//20230821 fix: #4304 订单完成入仓后修改商品名称未更新最后入仓时间
Long
warehouseInId
=
orderWarehouseInDONew
.
getId
();
this
.
update
(
new
LambdaUpdateWrapper
<
OrderWarehouseInDO
>()
.
set
(
OrderWarehouseInDO:
:
getUpdater
,
WebFrameworkUtils
.
getLoginUserId
()
+
""
)
.
set
(
OrderWarehouseInDO:
:
getUpdateTime
,
new
Date
())
.
eq
(
OrderWarehouseInDO:
:
getId
,
warehouseInId
));
}
infoVO
.
setOrgValue
(
"空"
);
}
}
else
{
infoVO
.
setOrgValue
(
"空"
);
}
// 3、删除
List
<
Long
>
deleteIds
=
orderWarehouseInListOld
.
stream
()
.
filter
(
old
->
orderWarehouseInItemDtoListNew
.
stream
().
noneMatch
(
n
->
old
.
getId
().
equals
(
n
.
getId
()))).
map
(
OrderWarehouseInDO:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
deleteIds
))
{
orderWarehouseInMapper
.
deleteBatchIds
(
deleteIds
);
if
(
StringUtils
.
isNotEmpty
(
warehouseInProdAttrIdsNew
))
{
List
<
ProductAttrDO
>
productAttrDOS
=
productAttrMapper
.
selectBatchIds
(
Arrays
.
asList
(
warehouseInProdAttrIdsNew
.
split
(
StrUtil
.
COMMA
)));
if
(
CollectionUtil
.
isNotEmpty
(
productAttrDOS
))
{
infoVO
.
setNewValue
(
I18nMessage
.
getLang
()
==
0
?
productAttrDOS
.
stream
().
map
(
ProductAttrDO:
:
getAttrName
).
collect
(
Collectors
.
joining
(
","
))
:
productAttrDOS
.
stream
().
map
(
ProductAttrDO:
:
getAttrNameEn
).
collect
(
Collectors
.
joining
(
","
)));
}
else
{
infoVO
.
setNewValue
(
"空"
);
}
}
else
{
infoVO
.
setNewValue
(
"空"
);
}
applyInfoList
.
add
(
infoVO
);
}
// 3、删除
else
{
List
<
Long
>
deleteIds
=
orderWarehouseInListOld
.
stream
().
map
(
OrderWarehouseInDO:
:
getId
).
collect
(
Collectors
.
toList
());
orderWarehouseInMapper
.
deleteBatchIds
(
deleteIds
);
//根据订单ID删除储位
orderLocationService
.
deleteIfPresent
(
orderId
,
null
,
null
);
// 入仓影像
List
<
String
>
pictureUrls
=
CollectionUtil
.
isNotEmpty
(
createReqVO
.
getPictureUrls
())
?
createReqVO
.
getPictureUrls
()
:
new
ArrayList
<>();
List
<
String
>
pictureUrlsOld
=
isNew
?
new
ArrayList
<>()
:
orderWarehousePictureService
.
getWarehousePictureUrlList
(
5
,
orderItemOld
.
getOrderItemId
());
if
(
pictureUrlsOld
.
size
()
!=
pictureUrls
.
size
()
||
pictureUrlsOld
.
containsAll
(
pictureUrls
))
{
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"入仓影像"
);
infoVO
.
setOrgValue
((
CollectionUtil
.
isEmpty
(
pictureUrlsOld
)
?
0
:
pictureUrlsOld
.
size
())
+
"个"
);
infoVO
.
setNewValue
((
CollectionUtil
.
isEmpty
(
pictureUrls
)
?
0
:
pictureUrls
.
size
())
+
"个"
);
applyInfoList
.
add
(
infoVO
);
}
orderItemDO
.
setNum
(
updateReqVO
.
getNum
());
orderItemDO
.
setVolume
(
updateReqVO
.
getVolume
());
orderItemDO
.
setWeight
(
updateReqVO
.
getWeight
());
orderItemDO
.
setMaterial
(
updateReqVO
.
getMaterial
());
orderItemDO
.
setWarehouseInProdAttrIds
(
updateReqVO
.
getWarehouseInProdAttrIds
());
orderItemDO
.
setBrand
(
Objects
.
isNull
(
updateReqVO
.
getBrand
())
?
0L
:
updateReqVO
.
getBrand
());
// 使用的跟新方法不会将null值更新到数据库,所以给默认值0
orderItemDO
.
setProdType
(
updateReqVO
.
getProdType
());
orderItemDO
.
setProdTitleZh
(
updateReqVO
.
getProdTitleZh
());
orderItemDO
.
setProdTitleEn
(
updateReqVO
.
getProdTitleEn
());
orderItemDO
.
setUsageIds
(
StringUtils
.
isEmpty
(
updateReqVO
.
getUsageIds
())
?
""
:
updateReqVO
.
getUsageIds
());
// 入仓商品用途
String
usageIdsNew
=
createReqVO
.
getUsageIds
();
String
usageIdsOld
=
isNew
?
null
:
orderItemOld
.
getUsageIds
();
String
usageIdsSortOld
=
StringUtils
.
isNotEmpty
(
usageIdsOld
)
?
Arrays
.
stream
(
usageIdsOld
.
split
(
","
)).
filter
(
Objects:
:
nonNull
).
sorted
(
Comparator
.
comparingInt
(
Integer:
:
parseInt
)).
collect
(
Collectors
.
joining
(
","
))
:
null
;
String
usageIdsSortNew
=
StringUtils
.
isNotEmpty
(
usageIdsNew
)
?
Arrays
.
stream
(
usageIdsNew
.
split
(
","
)).
filter
(
Objects:
:
nonNull
).
sorted
(
Comparator
.
comparingInt
(
Integer:
:
parseInt
)).
collect
(
Collectors
.
joining
(
","
))
:
null
;
Long
prodIdNew
=
updateReqVO
.
getProdId
();
if
(!
Objects
.
equals
(
usageIdsSortOld
,
usageIdsSortNew
))
{
infoVO
=
new
ApplyInfoVO
();
infoVO
.
setName
(
prodName
+
"入仓商品用途"
);
if
(
StringUtils
.
isNotEmpty
(
usageIdsOld
))
{
StringJoiner
labelEnJoiner
=
new
StringJoiner
(
","
);
StringJoiner
labelJoiner
=
new
StringJoiner
(
","
);
for
(
String
usageId
:
usageIdsOld
.
split
(
","
))
{
DictDataRespDTO
usageValue
=
DictFrameworkUtils
.
getDictDataFromCache
(
"order_item_usage"
,
usageId
);
if
(
usageValue
!=
null
)
{
labelEnJoiner
.
add
(
usageValue
.
getLabelEn
());
labelJoiner
.
add
(
usageValue
.
getLabel
());
}
}
infoVO
.
setOrgValue
(
I18nMessage
.
getLang
()
==
0
?
labelJoiner
.
toString
()
:
labelEnJoiner
.
toString
());
}
else
{
infoVO
.
setOrgValue
(
"空"
);
}
if
(
StringUtils
.
isNotEmpty
(
usageIdsNew
))
{
StringJoiner
labelEnJoiner
=
new
StringJoiner
(
","
);
StringJoiner
labelJoiner
=
new
StringJoiner
(
","
);
for
(
String
usageId
:
usageIdsNew
.
split
(
","
))
{
DictDataRespDTO
usageValue
=
DictFrameworkUtils
.
getDictDataFromCache
(
"order_item_usage"
,
usageId
);
if
(
usageValue
!=
null
)
{
labelEnJoiner
.
add
(
usageValue
.
getLabelEn
());
labelJoiner
.
add
(
usageValue
.
getLabel
());
}
}
infoVO
.
setNewValue
(
I18nMessage
.
getLang
()
==
0
?
labelJoiner
.
toString
()
:
labelEnJoiner
.
toString
());
}
else
{
infoVO
.
setNewValue
(
"空"
);
}
applyInfoList
.
add
(
infoVO
);
}
}
@Override
public
boolean
appendApplyWhenShipment
(
OrderWarehouseInCreateReqVO
createReqVO
)
{
Long
orderId
=
createReqVO
.
getOrderId
();
Long
brand
=
createReqVO
.
getBrand
();
Long
orderItemId
=
createReqVO
.
getOrderItemId
();
Long
prodId
=
createReqVO
.
getProdId
();
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDoList
=
createReqVO
.
getOrderWarehouseInItemDoList
();
// 非下单货物,请求中包含
String
prodTitleZh
=
createReqVO
.
getProdTitleZh
();
String
prodTitleEn
=
createReqVO
.
getProdTitleEn
();
OrderItemDO
orderItemDO
=
null
;
// 下单货物,
if
(
orderItemId
!=
null
)
{
orderItemDO
=
orderItemService
.
selectOne
(
OrderItemDO:
:
getOrderItemId
,
orderItemId
);
prodTitleZh
=
orderItemDO
.
getProdTitleZh
();
prodTitleEn
=
orderItemDO
.
getProdTitleEn
();
}
OrderDO
orderDO
=
orderService
.
getById
(
orderId
);
if
(
orderDO
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_NOT_EXISTS
);
}
if
(
OrderStatusEnum
.
DRAFT
.
getValue
().
equals
(
orderDO
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_DRAFT_STATUS_NOT_ALLOWED_WAREHOUSE_IN
);
}
if
(
OrderStatusEnum
.
WAREHOUSE_ADJUSTMENT
.
getValue
().
equals
(
orderDO
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_WAREHOUSE_ADJUSTMENT_STATUS_NOT_ALLOWED_WAREHOUSE_IN
);
}
// 校验是否有已核销的应收单,如果有,则不能再次入仓修改
receivableService
.
verificationReceivableIsWriteOff
(
orderId
,
null
);
// 入仓追加必须处于已装货柜或者出货阶段
if
(!(
orderDO
.
getShipmentState
()
>
0
&&
orderDO
.
getInWarehouseState
()
==
0
))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
WAREHOUSE_IN_UPDATE_NOT_SHIPMENT
);
}
// 订单有提货记录或放货记录,弹出提示“**订单已放货/提货,无法修改**”,不允许提交
if
(
Objects
.
equals
(
OrderStatusEnum
.
PICKED_UP
.
getValue
(),
orderDO
.
getStatus
())
||
Objects
.
equals
(
OrderStatusEnum
.
PART_PICKED_UP
.
getValue
(),
orderDO
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
CARGO_UNCONTROL_ORDER_ALREADY_PICKED
);
}
// 控货订单->部分控货和已放完货的订单不支持入仓修改
if
(
orderDO
.
getIsCargoControl
()
&&
orderDO
.
getCargoControlStatus
()
>
0
)
{
throw
exception
(
CARGO_CONTROL_ORDER_ALREADY_PICKED
);
}
// 判断是否有未处理的审核单
orderQueryService
.
throwProcessingApproval
(
orderId
,
WAREHOUSE_UPDATE
);
this
.
validateProdAttrAccess
(
createReqVO
.
getProdId
(),
orderDO
.
getOrderNo
());
validateWarehouseInItem
(
orderDO
,
brand
,
orderWarehouseInItemDoList
,
prodTitleZh
,
prodTitleEn
);
// 若已经存在入仓纪录,则就是追加。
List
<
OrderWarehouseInDO
>
orderWarehouseInDOS
=
orderWarehouseInMapper
.
selectList
(
new
LambdaQueryWrapperX
<
OrderWarehouseInDO
>()
.
eq
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
).
eq
(
OrderWarehouseInDO:
:
getOrderItemId
,
orderItemId
));
boolean
isAppend
=
CollectionUtil
.
isNotEmpty
(
orderWarehouseInDOS
);
createReqVO
.
setIsAppend
(
isAppend
);
List
<
ApplyInfoVO
>
applyInfoList
=
new
ArrayList
<>();
compareOrderItemFieldAppend
(
createReqVO
,
orderItemDO
,
applyInfoList
);
// 设置差异对象
createReqVO
.
setApplyInfoVOList
(
applyInfoList
);
// 将createReqVo转换为 updateApplyReqVo
OrderWarehouseInUpdateApplyReqVO
updateApplyReqVO
=
new
OrderWarehouseInUpdateApplyReqVO
();
BeanUtils
.
copyProperties
(
createReqVO
,
updateApplyReqVO
);
updateApplyReqVO
.
setOrderWarehouseInUpdateItemDoList
(
createReqVO
.
getOrderWarehouseInItemDoList
());
updateApplyReqVO
.
setIsShipmentAppend
(
true
);
String
details
=
JSON
.
toJSONString
(
updateApplyReqVO
);
log
.
info
(
"出货后入仓追加json = {}"
,
details
);
OrderWarehouseApprovalDO
orderWarehouseApprovalDO
=
OrderWarehouseApprovalDO
.
builder
()
.
orderIds
(
orderId
.
toString
())
.
orderItemId
(
createReqVO
.
getOrderItemId
())
.
type
(
OrderWarehouseApprovalTypeEnum
.
WAREHOUSE_IN_UPDATE
.
getValue
())
.
followUpAdminId
(
WebFrameworkUtils
.
getLoginUserId
())
.
details
(
details
).
build
();
// 创建审核单,发起审批流程
orderWarehouseApprovalService
.
applyAndCreate
(
orderWarehouseApprovalDO
,
WorkFlowEmus
.
ORDER_WAREHOUSING_MODIFICATION
,
createReqVO
.
getCopyUserId
());
// 更新订单状态
Integer
auditType
=
OrderApprovalTypeResultEnum
.
warehouse_update_processing
.
getType
();
orderService
.
updateStatus
(
orderId
,
null
,
null
,
null
,
null
,
null
,
auditType
,
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
auditType
,
1
).
getDesc
(),
false
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"航运中-追加-"
+
(
isAppend
?
"添加新品名"
:
"入仓"
),
applyInfoList
);
// 返回
return
true
;
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
String
updateApplyWhenShipment
(
@Valid
OrderWarehouseInUpdateApplyReqVO
updateReqVO
)
{
// 处理删除记录失效的问题
Long
orderId
=
updateReqVO
.
getOrderId
();
Long
orderItemId
=
updateReqVO
.
getOrderItemId
();
Long
prodId
=
updateReqVO
.
getProdId
();
Long
brand
=
updateReqVO
.
getBrand
();
// 设置是否备案和收费模式
GetFeeTypeProductBrandEmpowerRespVO
feeTypeByOrder
=
getGetFeeTypeProductBrandEmpowerRespVO
(
orderId
,
prodId
,
brand
);
if
(
feeTypeByOrder
!=
null
)
{
// //当订单项的brandType为null时才设置。(说明是新品入仓)
// if (StringUtils.isNotEmpty(feeTypeByOrder.getRecordMode())) {
// updateReqVO.setBrandType(Integer.parseInt(feeTypeByOrder.getRecordMode()));
// }
if
(
StringUtils
.
isNotEmpty
(
feeTypeByOrder
.
getFeeType
()))
{
updateReqVO
.
setFeeType
(
Integer
.
parseInt
(
feeTypeByOrder
.
getFeeType
()));
}
}
//如仓记录项
List
<
OrderWarehouseInItemDto
>
orderWarehouseInUpdateItemDoList
=
updateReqVO
.
getOrderWarehouseInUpdateItemDoList
();
ProductDO
productDO
=
productService
.
getProduct
(
prodId
);
if
(
productDO
==
null
)
{
throw
exception
(
PROD_NOT_EXISTS
);
}
OrderDO
orderDO
=
orderService
.
getById
(
orderId
);
if
(
orderDO
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_NOT_EXISTS
);
}
if
(
OrderStatusEnum
.
WAREHOUSE_ADJUSTMENT
.
getValue
().
equals
(
orderDO
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
ORDER_WAREHOUSE_ADJUSTMENT_STATUS_NOT_ALLOWED_WAREHOUSE_IN
);
}
this
.
validateProdAttrAccess
(
prodId
,
orderDO
.
getOrderNo
());
String
prodTitleZh
=
productDO
.
getTitleZh
();
String
prodTitleEn
=
productDO
.
getTitleEn
();
// 校验是否有已核销的应收单,如果有,则不能再次入仓修改
receivableService
.
verificationReceivableIsWriteOff
(
orderId
,
null
);
// 入仓修改必须处于已装货柜或者出货阶段
if
(!(
orderDO
.
getShipmentState
()
>
0
&&
orderDO
.
getInWarehouseState
()
==
0
))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
WAREHOUSE_IN_UPDATE_NOT_SHIPMENT
);
}
// 订单有提货记录或放货记录,弹出提示“**订单已放货/提货,无法修改**”,不允许提交
if
(
Objects
.
equals
(
OrderStatusEnum
.
PICKED_UP
.
getValue
(),
orderDO
.
getStatus
())
||
Objects
.
equals
(
OrderStatusEnum
.
PART_PICKED_UP
.
getValue
(),
orderDO
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ErrorCodeConstants
.
CARGO_UNCONTROL_ORDER_ALREADY_PICKED
);
}
// 控货订单->部分控货和已放完货的订单不支持入仓修改
if
(
orderDO
.
getIsCargoControl
()
&&
orderDO
.
getCargoControlStatus
()
>
0
)
{
throw
exception
(
CARGO_CONTROL_ORDER_ALREADY_PICKED
);
}
validateWarehouseInItem
(
orderDO
,
brand
,
orderWarehouseInUpdateItemDoList
,
prodTitleZh
,
prodTitleEn
);
if
(
CollectionUtil
.
isEmpty
(
updateReqVO
.
getPictureUrls
()))
{
throw
exception
(
ErrorCodeConstants
.
ORDER_WAREHOUSE_IN_PICTURE_NOT_NULL
);
}
// 添加订单仓库操作日志
OrderItemDO
orderItemOld
=
orderItemService
.
selectOne
(
OrderItemDO:
:
getOrderItemId
,
orderItemId
);
// 通过orderItemId查询db中的 orderWarehouseInDO
List
<
OrderWarehouseInDO
>
orderWarehouseInListOld
=
orderWarehouseInMapper
.
selectList
(
new
LambdaQueryWrapperX
<
OrderWarehouseInDO
>().
eq
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
)
.
eq
(
OrderWarehouseInDO:
:
getOrderItemId
,
orderItemId
));
// 需要提交审批,则不能有其他任何审批
orderQueryService
.
throwProcessingApproval
(
orderId
,
WAREHOUSE_UPDATE
);
List
<
ApplyInfoVO
>
applyInfoList
=
new
ArrayList
<>();
// 处理每一个属性
compareOrderItemField
(
updateReqVO
,
orderItemOld
,
applyInfoList
);
// 开始处理入仓纪录
compareOrderWarehouseInField
(
orderItemOld
.
getProdTitleZh
(),
orderWarehouseInListOld
,
orderWarehouseInUpdateItemDoList
,
applyInfoList
);
if
(
CollectionUtil
.
isNotEmpty
(
applyInfoList
))
{
// 仅有入仓明细直接更新,不提交审批
if
(
applyInfoList
.
size
()
==
1
&&
applyInfoList
.
get
(
0
).
getName
().
endsWith
(
"入仓明细"
))
{
updateOrderWarehouseInDetails
(
orderItemId
,
orderWarehouseInUpdateItemDoList
,
orderWarehouseInListOld
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓明细单独修改"
,
""
);
return
I18nMessage
.
getMessage
(
"order.warehousein.details.update.finished"
);
}
// 仅有入仓影像直接更新,不提交审批
else
if
(
applyInfoList
.
size
()
==
1
&&
applyInfoList
.
get
(
0
).
getName
().
endsWith
(
"入仓影像"
))
{
// 影像
orderWarehousePictureService
.
createWarehousePictureBatch
(
updateReqVO
.
getPictureUrls
(),
5
,
orderItemId
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓影像单独修改"
,
applyInfoList
);
return
I18nMessage
.
getMessage
(
"order.warehousein.image.update.finished"
);
}
// 仅有入仓明细和入仓影像直接更新,不提交审批
else
if
(
applyInfoList
.
size
()
==
2
&&
applyInfoList
.
get
(
0
).
getName
().
endsWith
(
"入仓影像"
)
&&
applyInfoList
.
get
(
1
).
getName
().
endsWith
(
"入仓明细"
))
{
// 影像
orderWarehousePictureService
.
createWarehousePictureBatch
(
updateReqVO
.
getPictureUrls
(),
5
,
orderItemId
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓影像修改"
,
applyInfoList
);
// 入仓明细更新
updateOrderWarehouseInDetails
(
orderItemId
,
orderWarehouseInUpdateItemDoList
,
orderWarehouseInListOld
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓明细修改"
,
""
);
return
I18nMessage
.
getMessage
(
"order.warehousein.image.and.details.update.finished"
);
}
// 包含其他更新 发起审核流程
else
{
// 删除入仓明细的比较,因为纪录的值会很长,没意义。
applyInfoList
.
removeIf
(
t
->
t
.
getName
().
endsWith
(
"入仓明细"
));
// 设置差异对象
updateReqVO
.
setApplyInfoVOList
(
applyInfoList
);
String
details
=
JSON
.
toJSONString
(
updateReqVO
);
log
.
info
(
"出货后入仓修改json = {}"
,
details
);
OrderWarehouseApprovalDO
orderWarehouseApprovalDO
=
OrderWarehouseApprovalDO
.
builder
()
.
orderIds
(
orderId
.
toString
())
.
orderItemId
(
updateReqVO
.
getOrderItemId
())
.
type
(
OrderWarehouseApprovalTypeEnum
.
WAREHOUSE_IN_UPDATE
.
getValue
())
.
followUpAdminId
(
WebFrameworkUtils
.
getLoginUserId
())
.
details
(
details
).
build
();
// 创建审核单,发起审批流程
orderWarehouseApprovalService
.
applyAndCreate
(
orderWarehouseApprovalDO
,
WorkFlowEmus
.
ORDER_WAREHOUSING_MODIFICATION
,
updateReqVO
.
getCopyUserId
());
// 更新订单状态
Integer
auditType
=
OrderApprovalTypeResultEnum
.
warehouse_update_processing
.
getType
();
orderService
.
updateStatus
(
orderId
,
null
,
null
,
null
,
null
,
null
,
auditType
,
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
auditType
,
1
).
getDesc
(),
false
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"航运中-提交货物入仓修改"
,
applyInfoList
);
}
return
I18nMessage
.
getMessage
(
"order.warehousein.update.apply.success"
);
}
else
{
return
I18nMessage
.
getMessage
(
"order.warehousein.update.nothing"
);
}
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
})
public
void
updateApplyCallback
(
String
bizId
,
Integer
result
)
{
// OrderWarehouseApprovalDO orderWarehouseApprovalDO = orderWarehouseApprovalService.selectOne(OrderWarehouseApprovalTypeEnum.WAREHOUSE_IN_UPDATE.getValue(), Long.parseLong(bizId));
OrderWarehouseApprovalDO
orderWarehouseApprovalDO
=
orderWarehouseApprovalService
.
getById
(
bizId
);
// 更新审批单状态
orderWarehouseApprovalService
.
callbackUpdate
(
orderWarehouseApprovalDO
,
result
);
long
orderId
=
Long
.
parseLong
(
orderWarehouseApprovalDO
.
getOrderIds
());
String
processingResults
=
orderWarehouseApprovalDO
.
getProcessingResults
();
// 通过
if
(
ApprovalResultStatusEnum
.
pass
.
getValue
().
equals
(
result
))
{
String
details
=
orderWarehouseApprovalDO
.
getDetails
();
if
(
StringUtils
.
isNotEmpty
(
details
))
{
OrderWarehouseInUpdateApplyReqVO
updateReqVO
=
JSON
.
parseObject
(
details
,
OrderWarehouseInUpdateApplyReqVO
.
class
);
Boolean
isShipmentUpdate
=
updateReqVO
.
getIsShipmentUpdate
();
Boolean
isShipmentAppend
=
updateReqVO
.
getIsShipmentAppend
();
OrderDO
orderDO
=
orderService
.
getById
(
orderId
);
// 不是出货阶段追加入仓的情况: 1。入仓修改 2。出货入仓修改
if
(!
isShipmentAppend
)
{
// 将老的信息更新成新的信息
Long
orderItemId
=
orderWarehouseApprovalDO
.
getOrderItemId
();
OrderItemDO
orderItemDO
=
orderItemService
.
getById
(
orderItemId
);
BigDecimal
sumVolumeBeforeUpdate
=
orderDO
.
getSumVolume
();
BigDecimal
sumWeightBeforeUpdate
=
orderDO
.
getSumWeight
();
// 验证是否不可接受货物
this
.
validateProdAttrAccess
(
orderItemDO
.
getProdId
(),
orderDO
.
getOrderNo
());
// 通过orderItemId查询db中的 orderWarehouseInDO
List
<
OrderWarehouseInDO
>
orderWarehouseInListOld
=
orderWarehouseInMapper
.
selectList
(
new
LambdaQueryWrapperX
<
OrderWarehouseInDO
>().
eq
(
OrderWarehouseInDO:
:
getOrderId
,
orderId
)
.
eq
(
OrderWarehouseInDO:
:
getOrderItemId
,
orderItemId
));
// 先更新入仓
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDtoListNew
=
updateReqVO
.
getOrderWarehouseInUpdateItemDoList
();
ZhongPaoBestVO
zhongPaoBest
=
getZhongPaoBest
(
orderDO
);
BigDecimal
zhongEdge
=
zhongPaoBest
!=
null
?
zhongPaoBest
.
getZhongEdge
()
:
null
;
BigDecimal
paoEdge
=
zhongPaoBest
!=
null
?
zhongPaoBest
.
getPaoEdge
()
:
null
;
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListNew
))
{
// 2023-04-20 1.入仓修改可以添加入仓记录,添加审核通过后,入仓时间为提交入仓的系统时间,无需选择入仓时间。
Date
inTime
=
orderWarehouseApprovalDO
.
getCreateTime
();
// 1、新增 (只有新增的可能有储位,修改储位是直接调用修改接口的。)
List
<
OrderWarehouseInItemDto
>
addList
=
orderWarehouseInItemDtoListNew
.
stream
().
filter
(
t
->
t
.
getId
()
==
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
addList
))
{
for
(
OrderWarehouseInItemDto
orderWarehouseInItemDto
:
addList
)
{
OrderWarehouseInDO
orderWarehouseInDO
=
convertOrderWarehouseInItemDo
(
orderDO
,
orderItemId
,
zhongPaoBest
,
zhongEdge
,
paoEdge
,
orderWarehouseInItemDto
,
inTime
);
orderWarehouseInMapper
.
insert
(
orderWarehouseInDO
);
// 保存储位
List
<
OrderLocationCreateReqVO
>
orderLocationCreateReqVOList
=
orderWarehouseInItemDto
.
getOrderLocationCreateReqVOList
();
if
(
CollectionUtil
.
isNotEmpty
(
orderLocationCreateReqVOList
))
{
for
(
OrderLocationCreateReqVO
orderLocationCreateReqVO
:
orderLocationCreateReqVOList
)
{
// 设置入仓纪录id
orderLocationCreateReqVO
.
setWarehouseInId
(
orderWarehouseInDO
.
getId
());
orderLocationService
.
createOrderLocation
(
orderLocationCreateReqVO
);
}
}
}
}
// 2、更新 //2023-04-20 入仓修改若修改已有入仓记录,
// 有改动(储位或其他信息修改)修改入仓记录的最新操作时间,
// 不修改入仓时间,不修改未发生变化的入仓记录的入仓时间和最新操作时间。
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListNew
))
{
//更新的
List
<
OrderWarehouseInItemDto
>
orderWarehouseInItemDtoListUpdate
=
orderWarehouseInItemDtoListNew
.
stream
().
filter
(
t
->
t
.
getId
()
!=
null
&&
orderWarehouseInListOld
.
stream
().
anyMatch
(
old
->
old
.
getId
().
equals
(
t
.
getId
()))).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
orderWarehouseInItemDtoListUpdate
))
{
for
(
OrderWarehouseInItemDto
itemDtoNew
:
orderWarehouseInItemDtoListUpdate
)
{
OrderWarehouseInDO
orderWarehouseInDONew
=
convertOrderWarehouseInItemDo
(
orderDO
,
orderItemId
,
zhongPaoBest
,
zhongEdge
,
paoEdge
,
itemDtoNew
,
inTime
);
// 判断有无变化
OrderWarehouseInDO
old
=
orderWarehouseInMapper
.
selectById
(
itemDtoNew
.
getId
());
List
<
ApplyInfoVO
>
applyInfoVOListTmp
=
new
ArrayList
<>();
compareOrderWarehouseInField
(
""
,
Arrays
.
asList
(
old
),
Arrays
.
asList
(
itemDtoNew
),
applyInfoVOListTmp
);
// 有变化才更新
if
(
CollectionUtil
.
isNotEmpty
(
applyInfoVOListTmp
))
{
orderWarehouseInMapper
.
updateById
(
orderWarehouseInDONew
);
applyInfoVOListTmp
.
clear
();
}
else
{
//20230821 fix: #4304 订单完成入仓后修改商品名称未更新最后入仓时间
Long
warehouseInId
=
orderWarehouseInDONew
.
getId
();
this
.
update
(
new
LambdaUpdateWrapper
<
OrderWarehouseInDO
>()
.
set
(
OrderWarehouseInDO:
:
getUpdater
,
WebFrameworkUtils
.
getLoginUserId
()
+
""
)
.
set
(
OrderWarehouseInDO:
:
getUpdateTime
,
new
Date
())
.
eq
(
OrderWarehouseInDO:
:
getId
,
warehouseInId
));
}
}
}
// 3、删除
List
<
Long
>
deleteIds
=
orderWarehouseInListOld
.
stream
()
.
filter
(
old
->
orderWarehouseInItemDtoListNew
.
stream
().
noneMatch
(
n
->
old
.
getId
().
equals
(
n
.
getId
()))).
map
(
OrderWarehouseInDO:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
deleteIds
))
{
orderWarehouseInMapper
.
deleteBatchIds
(
deleteIds
);
}
}
}
// 3、删除
else
{
List
<
Long
>
deleteIds
=
orderWarehouseInListOld
.
stream
().
map
(
OrderWarehouseInDO:
:
getId
).
collect
(
Collectors
.
toList
());
orderWarehouseInMapper
.
deleteBatchIds
(
deleteIds
);
//根据订单ID删除储位
orderLocationService
.
deleteIfPresent
(
orderId
,
null
,
null
);
}
orderItemDO
.
setNum
(
updateReqVO
.
getNum
());
orderItemDO
.
setVolume
(
updateReqVO
.
getVolume
());
orderItemDO
.
setWeight
(
updateReqVO
.
getWeight
());
orderItemDO
.
setMaterial
(
updateReqVO
.
getMaterial
());
orderItemDO
.
setWarehouseInProdAttrIds
(
updateReqVO
.
getWarehouseInProdAttrIds
());
orderItemDO
.
setBrand
(
Objects
.
isNull
(
updateReqVO
.
getBrand
())
?
0L
:
updateReqVO
.
getBrand
());
// 使用的跟新方法不会将null值更新到数据库,所以给默认值0
orderItemDO
.
setProdType
(
updateReqVO
.
getProdType
());
orderItemDO
.
setProdTitleZh
(
updateReqVO
.
getProdTitleZh
());
orderItemDO
.
setProdTitleEn
(
updateReqVO
.
getProdTitleEn
());
orderItemDO
.
setUsageIds
(
StringUtils
.
isEmpty
(
updateReqVO
.
getUsageIds
())
?
""
:
updateReqVO
.
getUsageIds
());
Long
prodIdNew
=
updateReqVO
.
getProdId
();
// 更新订单的和订单项的入仓信息
updateOrderAndOrderItemWarehouseIn
(
orderId
,
orderItemDO
.
getProdId
(),
prodIdNew
,
CollectionUtil
.
newArrayList
(
orderItemDO
),
zhongPaoBest
);
...
...
@@ -3600,9 +4131,10 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
Integer
inWarehouseState
=
null
;
//非清关和出货的入仓修改,执行正常入仓修改流程
if
(!
Objects
.
equals
(
OrderStatusEnum
.
CLEARED
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
INSTALLED_CABINET
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
SHIPMENT
.
getValue
(),
orderDO
.
getStatus
()))
{
// if (!Objects.equals(OrderStatusEnum.CLEARED.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.INSTALLED_CABINET.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.SHIPMENT.getValue(), orderDO.getStatus())) {
if
(!
isShipmentUpdate
)
{
inWarehouseState
=
OrderWarehouseInStatusEnum
.
warehouse_finished
.
getValue
();
orderService
.
updateStatus
(
orderId
,
null
,
null
,
null
,
...
...
@@ -3633,15 +4165,70 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
log
.
error
(
"入仓修改通过后重新入仓发生异常"
,
e
);
}
// 添加仓库操作日志
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓修改已通过"
,
updateReqVO
.
getApplyInfoVOList
());
}
else
{
// 处理标签号
saveOrUpdateLabel
(
orderId
,
numSum
,
null
);
//清关和出货的入仓修改,只需要更新审核状态,不更新订单主状态
orderService
.
updateStatus
(
orderId
,
null
,
null
,
null
,
null
,
null
,
0
,
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
auditType
,
result
).
getDesc
(),
false
);
// 更新计价
OrderWarehouseInVO
orderWarehouseInVO
=
new
OrderWarehouseInVO
();
orderWarehouseInVO
.
setOrderId
(
orderId
);
orderService
.
shipmentOrderInWarehouse
(
orderWarehouseInVO
);
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"航运中修改"
,
updateReqVO
.
getApplyInfoVOList
());
}
}
// 出货阶段 入仓追加 (有可能orderItemId为null)
else
{
// copy
OrderWarehouseInCreateReqVO
createReqVO
=
new
OrderWarehouseInCreateReqVO
();
BeanUtils
.
copyProperties
(
updateReqVO
,
createReqVO
);
createReqVO
.
setOrderWarehouseInItemDoList
(
updateReqVO
.
getOrderWarehouseInUpdateItemDoList
());
Long
orderItemId
=
createReqVO
.
getOrderItemId
();
// 执行入仓
orderItemId
=
this
.
doSaveOrUpdateOrderWarehouseInDo
(
createReqVO
,
orderId
,
orderItemId
,
orderDO
,
createReqVO
.
getPictureUrls
(),
false
,
true
);
// 更新计价
OrderWarehouseInVO
orderWarehouseInVO
=
new
OrderWarehouseInVO
();
orderWarehouseInVO
.
setOrderId
(
orderId
);
orderService
.
shipmentOrderInWarehouse
(
orderWarehouseInVO
);
// 空运更新订单项打包状态
if
(
orderDO
.
getTransportId
()
==
3
||
orderDO
.
getTransportId
()
==
4
)
{
// 添加新品标识
boolean
isAddNewOrderItem
=
createReqVO
.
getType
()
!=
0
;
// 备货时添加新品,纪录个空的打包历史。因为在入仓后才会产生orderItemId,所以才在这里纪录。
if
(
isAddNewOrderItem
)
{
saveNewOrderItemPackLog
(
orderId
,
orderItemId
);
}
// 设置打包状态`
OrderItemDO
orderItemDO
=
orderItemService
.
getOrderItem
(
orderItemId
);
orderItemDO
.
setPackStatus
(
OrderItemPackStatusEnum
.
PACKED
.
getValue
());
// 更新订单项
orderItemService
.
updateById
(
orderItemDO
);
}
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"航运中追加"
,
updateReqVO
.
getApplyInfoVOList
());
}
// 添加仓库操作日志
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓修改已通过"
,
updateReqVO
.
getApplyInfoVOList
());
}
}
else
if
(
ApprovalResultStatusEnum
.
reject
.
getValue
().
equals
(
result
))
{
...
...
@@ -3651,11 +4238,15 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
OrderDO
orderDO
=
orderQueryService
.
getOrderById
(
orderId
);
Integer
inWarehouseState
=
null
;
//清关和出货的入仓修改,只需要更新审核状态,不更新订单主状态。 其他更新为完成入仓状态
if
(!
Objects
.
equals
(
OrderStatusEnum
.
CLEARED
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
INSTALLED_CABINET
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
SHIPMENT
.
getValue
(),
orderDO
.
getStatus
()))
{
// if (!Objects.equals(OrderStatusEnum.CLEARED.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.INSTALLED_CABINET.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.SHIPMENT.getValue(), orderDO.getStatus())) {
// inWarehouseState = OrderWarehouseInStatusEnum.warehouse_finished.getValue();
// }
if
(!(
orderDO
.
getShipmentState
()
>
0
&&
orderDO
.
getInWarehouseState
()
==
0
))
{
inWarehouseState
=
OrderWarehouseInStatusEnum
.
warehouse_finished
.
getValue
();
}
orderService
.
updateStatus
(
orderId
,
null
,
null
,
null
,
inWarehouseState
,
null
,
0
,
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
auditType
,
result
).
getDesc
(),
false
);
...
...
@@ -3672,9 +4263,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
OrderDO
orderDO
=
orderQueryService
.
getOrderById
(
orderId
);
Integer
inWarehouseState
=
null
;
if
(!
Objects
.
equals
(
OrderStatusEnum
.
CLEARED
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
INSTALLED_CABINET
.
getValue
(),
orderDO
.
getStatus
())
&&
!
Objects
.
equals
(
OrderStatusEnum
.
SHIPMENT
.
getValue
(),
orderDO
.
getStatus
()))
{
// if (!Objects.equals(OrderStatusEnum.CLEARED.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.INSTALLED_CABINET.getValue(), orderDO.getStatus())
// && !Objects.equals(OrderStatusEnum.SHIPMENT.getValue(), orderDO.getStatus())) {
// inWarehouseState = OrderWarehouseInStatusEnum.warehouse_finished.getValue();
// }
if
(!(
orderDO
.
getShipmentState
()
>
0
&&
orderDO
.
getInWarehouseState
()
==
0
))
{
inWarehouseState
=
OrderWarehouseInStatusEnum
.
warehouse_finished
.
getValue
();
}
//清关和出货的入仓修改,只需要更新审核状态,不更新订单主状态。 其他更新为完成入仓状态
...
...
@@ -3684,8 +4278,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
String
details
=
orderWarehouseApprovalDO
.
getDetails
();
if
(
StringUtils
.
isNotEmpty
(
details
))
{
OrderWarehouseInUpdateApplyReqVO
updateReqVO
=
JSON
.
parseObject
(
details
,
OrderWarehouseInUpdateApplyReqVO
.
class
);
String
prefixStr
=
""
;
if
(
updateReqVO
.
getIsShipmentAppend
()
||
updateReqVO
.
getIsShipmentUpdate
())
{
prefixStr
=
"航运中-"
;
}
// 添加仓库操作日志
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
"货物入仓修改申请已取消"
,
updateReqVO
.
getApplyInfoVOList
());
orderBusinessService
.
addOrderOperateLog
(
orderId
,
"仓库操作"
,
prefixStr
+
"货物入仓修改申请已取消"
,
updateReqVO
.
getApplyInfoVOList
());
}
}
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderWarehouseIn/OrderWarehouseInCreateReqVO.java
View file @
ecb7b3fa
package
cn
.
iocoder
.
yudao
.
module
.
order
.
vo
.
orderWarehouseIn
;
import
cn.iocoder.yudao.module.order.vo.order.ApplyInfoVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -112,4 +113,17 @@ public class OrderWarehouseInCreateReqVO {
private
Boolean
isProcessPicture
=
true
;
// ---------------- 下面属性是给出货阶段 追加入仓申请 使用的 ----------------
@ApiModelProperty
(
value
=
"抄送人userId"
)
private
String
[]
copyUserId
;
@ApiModelProperty
(
value
=
"修改的信息,返回给前端拼装使用"
)
private
List
<
ApplyInfoVO
>
applyInfoVOList
;
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderWarehouseIn/OrderWarehouseInUpdateApplyReqVO.java
View file @
ecb7b3fa
...
...
@@ -8,12 +8,16 @@ import lombok.EqualsAndHashCode;
import
lombok.ToString
;
import
lombok.experimental.Accessors
;
import
org.hibernate.validator.constraints.Length
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.Valid
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@ApiModel
(
"管理后台 - 入仓货物详情更新 发起请求 Request VO"
)
@Data
@EqualsAndHashCode
...
...
@@ -109,4 +113,31 @@ public class OrderWarehouseInUpdateApplyReqVO {
@ApiModelProperty
(
value
=
"修改的信息,返回给前端拼装使用"
)
private
List
<
ApplyInfoVO
>
applyInfoVOList
;
// ---------------- 下面属性是给出货阶段 追加入仓申请 使用的 ----------------
@ApiModelProperty
(
value
=
"订单项-入仓时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
inTime
;
@ApiModelProperty
(
value
=
"入仓货物-0下单货物;1非下单货物"
)
private
Integer
type
=
0
;
/**
* 入仓来源 字典order_warehouse_in_source 1-始发港入仓、2-调拨入仓、3-目的港入仓、4-退场入仓 5-拆单后入仓
*/
@ApiModelProperty
(
value
=
"入仓来源 字典order_warehouse_in_source 1-始发港入仓、2-调拨入仓、3-目的港入仓、4-退场入仓 5-拆单后入仓"
)
private
Integer
source
=
1
;
// 出货阶段 追加,到仓
private
Boolean
isShipmentAppend
=
false
;
// 出货阶段 修改
private
Boolean
isShipmentUpdate
=
false
;
}
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/orderWarehouseIn/OrderWarehouseInController.java
View file @
ecb7b3fa
...
...
@@ -13,7 +13,6 @@ import cn.iocoder.yudao.module.order.service.orderLabel.OrderLabelService;
import
cn.iocoder.yudao.module.order.service.orderWarehouseAdjust.OrderWarehouseAdjustService
;
import
cn.iocoder.yudao.module.order.service.orderWarehouseApproval.OrderWarehouseApprovalService
;
import
cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService
;
import
cn.iocoder.yudao.module.order.vo.order.OrderWarehouseInCommonAttrVO
;
import
cn.iocoder.yudao.module.order.vo.order.OrderWarehouseInWithAttrVO
;
import
cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO
;
import
cn.iocoder.yudao.module.order.vo.orderLabel.OrderLabelBackVO
;
...
...
@@ -158,6 +157,41 @@ public class OrderWarehouseInController {
}
/**
* 出货阶段 - 追加
*
* @param createReqVO
* @return
*/
@PostMapping
(
"/append-apply-when-shipment"
)
@ApiOperation
(
"出货阶段 - 入仓/追加申请"
)
@Idempotent
(
timeout
=
8
)
public
CommonResult
<
Boolean
>
appendApplyWhenShipment
(
@Valid
@RequestBody
OrderWarehouseInCreateReqVO
createReqVO
)
{
return
success
(
orderWarehouseInService
.
appendApplyWhenShipment
(
createReqVO
));
}
/*
* 出货阶段-入仓修改申请
*/
@PutMapping
(
"/update-apply-when-shipment"
)
@ApiOperation
(
"出货阶段 - 入仓修改申请"
)
public
CommonResult
<
Boolean
>
updateApplyWhenShipment
(
@Valid
@RequestBody
OrderWarehouseInUpdateApplyReqVO
updateReqVO
)
{
// 校验存在
String
msg
=
orderWarehouseInService
.
updateApplyWhenShipment
(
updateReqVO
);
CommonResult
<
Boolean
>
success
=
success
(
true
);
success
.
setMsg
(
msg
);
return
success
;
}
@GetMapping
(
"/update-callback-when-shipment"
)
@ApiOperation
(
"出货阶段-入仓修改回调"
)
public
CommonResult
<
Boolean
>
updateCallbackWhenShipment
(
String
formId
,
Integer
result
)
{
orderWarehouseInService
.
updateApplyCallback
(
formId
,
result
);
return
success
(
true
);
}
@PostMapping
(
"/save-or-update-order-location"
)
@ApiOperation
(
"新增/更新入仓储位"
)
@Idempotent
(
timeout
=
5
)
...
...
yudao-server/src/main/resources/i18n/messages.properties
View file @
ecb7b3fa
...
...
@@ -305,6 +305,16 @@ order.not.is.overseas.warehouse.order=
area.code.not.null
=
currency.id.not.null
=
warehouse.in.update.not.shipment
=
air.port.dest.customer.customs.clear.and.single.shipment.method
=
air.delivery.way.not.null
=
air.port.dest.customs.clear.not.null
=
app.message.update.control.password.title
=
consignee.limit.update.cancel
=
score.rule.orderentry.error
=
orderv.score.rule.error
=
cargo.control.order.already.picked
=
cargo.uncontrol.order.already.picked
=
order.approval.is.not.exists
=
fee.application.not.is.zero
=
...
...
yudao-server/src/main/resources/i18n/messages_en.properties
View file @
ecb7b3fa
...
...
@@ -1119,6 +1119,10 @@ order.not.is.overseas.warehouse.order=This order is already a non overseas wareh
area.code.not.null
=
The national mobile phone area code cannot be empty
currency.id.not.null
=
The country ID cannot be empty
warehouse.in.update.not.shipment
=
Warehouse update is only allowed after the shipment has been loaded into the container by sea or shipped by air.
cargo.control.order.already.picked
=
cargo control order already picked
cargo.uncontrol.order.already.picked
=
cargo uncontrol order already picked
order.approval.is.not.exists
=
Order approval type does not exist
fee.application.not.is.zero
=
The expense application amount is not 0, and cannot be directly deleted
...
...
yudao-server/src/main/resources/i18n/messages_zh.properties
View file @
ecb7b3fa
...
...
@@ -126,9 +126,9 @@ not.find.currency=\u672A\u627E\u5230\u53EF\u7528\u8D27\u5E01\u5355\u4F4D
order.warehouse.in.not.exists
=
\u5165\u
4ED3
\u
8D27
\u7269\u
8BE6
\u
60C5
\u
4E0D
\u
5B58
\u5728
order.warehouse.in.update.not.exists
=
\u
6CA1
\u6709\u8981\u
4FEE
\u6539\u7684\u5165\u
4ED3
\u6570\u
636E
order.warehouse.approval.not.exists
=
\u5165\u
4ED3
\u5355\u
5BA1
\u6838\u
4E0D
\u
5B58
\u5728
order.warehouse.check.not.exists
=
\u5230\u
4
ed3
\u
8d27
\u7269\u
8be6
\u
60c5
\u
4e0d
\u
5b
58
\u5728
order.warehouse.check.bad.volume
=
\u5230\u
4
ed3
\u
8d27
\u7269\u
4f53
\u
79ef
\u
8d85
\u
51fa
order.warehouse.check.bad.weight
=
\u5230\u
4
ed3
\u
8d27
\u7269\u
91cd
\u
91cf
\u
8d85
\u
51fa
order.warehouse.check.not.exists
=
\u5230\u
4
ED3
\u
8D27
\u7269\u
8BE6
\u
60C5
\u
4E0D
\u
5B
58
\u5728
order.warehouse.check.bad.volume
=
\u5230\u
4
ED3
\u
8D27
\u7269\u
4F53
\u
79EF
\u
8D85
\u
51FA
order.warehouse.check.bad.weight
=
\u5230\u
4
ED3
\u
8D27
\u7269\u
91CD
\u
91CF
\u
8D85
\u
51FA
warehouse.adjust.not.exists
=
\u
8C03
\u
4ED3
\u
8BB0
\u
5F55
\u
4E0D
\u
5B58
\u5728
shipment.not.exists
=
\u
51FA
\u
8D27
\u
4E0D
\u
5B58
\u5728
shipment.order.exit.not.exists
=
\u
8BA2
\u5355\u9000\u
573A
\u
4FE1
\u
606F
\u
4E0D
\u
5B58
\u5728
...
...
@@ -303,7 +303,7 @@ order.label.overlap=\u6807\u7B7E\u53F7\u672C\u8EAB\u5B58\u5728\u91CD\u53E0
transfer.goods.order.not.null
=
\u
8C03
\u
8D27
\u
8BA2
\u5355\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
file.format.is.excel
=
\u6587\u
4EF6
\u
683C
\u
5F0F
\u
53EA
\u
652F
\u6301
excel
prod.volume.beyond.day.upper.limit
=
\u5546\u
54C1{}
\u
65B9
\u6570\u
8D85
\u
51FA
\u
4ED3
\u
5E93
\u
5F53
\u
65E5
\u
63A5
\u
53D7
\u
4E0A
\u9650
prod.weight.beyond.day.upper.limit
=
\u5546\u
54
c1{}
\u
91cd
\u
91cf
\u
8d85
\u
51fa
\u
4ed3
\u
5e93
\u
5f53
\u
65e5
\u
63a5
\u
53d7
\u
4e0a
\u9650
prod.weight.beyond.day.upper.limit
=
\u5546\u
54
C1{}
\u
91CD
\u
91CF
\u
8D85
\u
51FA
\u
4ED3
\u
5E93
\u
5F53
\u
65E5
\u
63A5
\u
53D7
\u
4E0A
\u9650
coupon.full.reduce.value.gt.payment.value
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u
6EE1
\u
51CF
\u
503C
\u
4E0D
\u
80FD
\u5927\u
4E8E
\u
539F
\u
503C
coupon.full.net.value.gt.payment.value
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u7684\u
6EE1
\u6536\u
4EF7
\u
4E0D
\u
80FD
\u5927\u
4E8E
\u
539F
\u
4EF7
coupon.currency.or.unit.not.null
=
\u
4F18
\u
60E0
\u
6D3B
\u
52A8
\u6761\u
4EF6
\u
8D27
\u
5E01
\u5355\u
4F4D
\u6216\u
8BA1
\u
91CF
\u5355\u
4F4D
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
...
...
@@ -654,9 +654,9 @@ order.cargo.control.cancel.pick.reject=\u63A7\u8D27\u8BA2\u5355\u5DF2\u653E\u8D2
order.cargo.control.cancel.pick.cancel
=
\u
63A7
\u
8D27
\u
8BA2
\u5355\u
5DF2
\u
653E
\u
8D27
\u
8BB0
\u
5F55
\u
8C03
\u
8D27
\u
5BA1
\u6279\u
53D6
\u
6D88
warehouse.in.item.quantity.required
=
\u5165\u
4ED3
\u9879\u6570\u
91CF
\u
5FC5
\u
586B
order.line.not.exist
=
\u
8BA2
\u5355\u
7EBF
\u
8DEF
\u
4E0D
\u
5B58
\u5728
line.not.exist
=
\u
7
ebf
\u
8def
\u
4e0d
\u
5b
58
\u5728
line.not.exist
=
\u
7
EBF
\u
8DEF
\u
4E0D
\u
5B
58
\u5728
order.departure.objective.and.line.not.agreement
=
\u
8BA2
\u5355\u
59CB
\u
53D1
\u5730\u
76EE
\u7684\u5730\u
4E0E
\u
7EBF
\u
8DEF
\u
4E0D
\u
4E00
\u
81F4
offer.departure.objective.and.line.not.agreement
=
\u
62
a5
\u
4ef7
\u5355\u
59cb
\u
53d1
\u5730\u
76ee
\u7684\u5730\u
4e0e
\u
7ebf
\u
8def
\u
4e0d
\u
4e00
\u
81f
4
offer.departure.objective.and.line.not.agreement
=
\u
62
A5
\u
4EF7
\u5355\u
59CB
\u
53D1
\u5730\u
76EE
\u7684\u5730\u
4E0E
\u
7EBF
\u
8DEF
\u
4E0D
\u
4E00
\u
81F
4
transport.and.line.not.agreement
=
\u
8BA2
\u5355\u
8FD0
\u
8F93
\u
65B9
\u
5F0F
\u
4E0E
\u
7EBF
\u
8DEF
\u
4FE1
\u
606F
\u
4E0D
\u5339\u
914D
\u
FF0C
\u
8BF7
\u
91CD
\u
65B0
\u9009\u
62E9
\u
7EBF
\u
8DEF
\u
4FE1
\u
606F
prod.brand.not.null
=
\u
54C1
\u
724C
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
\u6216
0
preload.not.exist
=
\u
51FA
\u
8D27
\u5355\u
672A
\u9884\u
88C5
\u
8D27
\u7269
...
...
@@ -1112,14 +1112,17 @@ customer.approval.in.processing=\u975E\u4E3B\u5BA2\u6237\u5BA1\u6279\u6B63\u5728
order.overseas.warehouse.update.is.or.no
=
\u
8
bf7
\u9009\u
62e9
\u
8ba2
\u5355\u
6d77
\u5916\u
4ed3
\u
4fee
\u6539\u
662f
\u6216\u5426
order.is.overseas.warehouse.order
=
\u
8
be5
\u
8ba2
\u5355\u
5df2
\u
7ecf
\u
662f
\u
6d77
\u5916\u
4ed3
\u
8ba
2
\u5355
order.not.is.overseas.warehouse.order
=
\u
8
be5
\u
8ba2
\u5355\u
5df2
\u
7ecf
\u
662f
\u
975e
\u
6d77
\u5916\u
4ed3
\u
8ba
2
\u5355
order.overseas.warehouse.update.is.or.no
=
\u
8
BF7
\u9009\u
62E9
\u
8BA2
\u5355\u
6D77
\u5916\u
4ED3
\u
4FEE
\u6539\u
662F
\u6216\u5426
order.is.overseas.warehouse.order
=
\u
8
BE5
\u
8BA2
\u5355\u
5DF2
\u
7ECF
\u
662F
\u
6D77
\u5916\u
4ED3
\u
8BA
2
\u5355
order.not.is.overseas.warehouse.order
=
\u
8
BE5
\u
8BA2
\u5355\u
5DF2
\u
7ECF
\u
662F
\u
975E
\u
6D77
\u5916\u
4ED3
\u
8BA
2
\u5355
area.code.not.null
=
\u
56fd
\u
5bb6
\u
624b
\u
673a
\u
533a
\u
53f7
\u
4e0d
\u
80fd
\u
4e3a
\u
7a7a
currency.id.not.null
=
\u
56fd
\u
5bb6id
\u
4e0d
\u
80fd
\u
4e3a
\u
7a7a
area.code.not.null
=
\u
56FD
\u
5BB6
\u
624B
\u
673A
\u
533A
\u
53F7
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
currency.id.not.null
=
\u
56FD
\u
5BB6id
\u
4E0D
\u
80FD
\u
4E3A
\u
7A7A
warehouse.in.update.not.shipment
=
\u
8BA2
\u5355\u
4E0D
\u
662F
\u
5DF2
\u
88C5
\u
67DC/
\u
5DF2
\u
51FA
\u
8D27
\u
FF0C
\u
4E0D
\u
53EF
\u
64CD
\u
4F5C
cargo.control.order.already.picked
=
\u
8BA2
\u5355\u
5DF2
\u
653E
\u
8D27
\u
FF0C
\u
65E0
\u
6CD5
\u
4FEE
\u6539
cargo.uncontrol.order.already.picked
=
\u
8BA2
\u5355\u
5DF2
\u
63D0
\u
8D27
\u
FF0C
\u
65E0
\u
6CD5
\u
4FEE
\u6539
order.approval.is.not.exists
=
\u
8
ba2
\u5355\u
5ba1
\u6279\u
7c7b
\u
578b
\u
4e0d
\u
5b
58
\u5728
fee.application.not.is.zero
=
\u
8
d39
\u7528\u7533\u
8bf7
\u
91d1
\u
989d
\u
4e0d
\u
4e3a0
\u
ff0c
\u
4e0d
\u
80fd
\u
8fdb
\u
884c
\u
76f4
\u
63a
5
\u5220\u9664
guan.lian.order.is.approval.in.process
=
\u5173\u8054\u
8
ba2
\u5355\u3010
{}
\u3011\u6709\u
5ba1
\u6279\u
6b63
\u5728\u
8fdb
\u
884c
\u
4e2d
order.approval.is.not.exists
=
\u
8
BA2
\u5355\u
5BA1
\u6279\u
7C7B
\u
578B
\u
4E0D
\u
5B
58
\u5728
fee.application.not.is.zero
=
\u
8
D39
\u7528\u7533\u
8BF7
\u
91D1
\u
989D
\u
4E0D
\u
4E3A0
\u
FF0C
\u
4E0D
\u
80FD
\u
8FDB
\u
884C
\u
76F4
\u
63A
5
\u5220\u9664
guan.lian.order.is.approval.in.process
=
\u5173\u8054\u
8
BA2
\u5355\u3010
{}
\u3011\u6709\u
5BA1
\u6279\u
6B63
\u5728\u
8FDB
\u
884C
\u
4E2D
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