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
d4fd0a03
Commit
d4fd0a03
authored
Nov 07, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单审批类型更新bug修复
parent
5a147911
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
30 deletions
+17
-30
OrderFeeApplicationServiceImpl.java
...er/service/order/impl/OrderFeeApplicationServiceImpl.java
+3
-2
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+12
-27
OrderFeeApplicationController.java
...in/orderFeeApplication/OrderFeeApplicationController.java
+2
-1
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderFeeApplicationServiceImpl.java
View file @
d4fd0a03
...
@@ -101,7 +101,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -101,7 +101,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
@Resource
@Resource
private
ApplicationContext
applicationContext
;
private
ApplicationContext
applicationContext
;
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
Long
createFeeApplication
(
OrderFeeApplicationCreateReqVO
createReqVO
)
throws
Exception
{
public
Long
createFeeApplication
(
OrderFeeApplicationCreateReqVO
createReqVO
)
throws
Exception
{
//该订单是否有待处理异常或待处理审核则抛出异常
//该订单是否有待处理异常或待处理审核则抛出异常
...
@@ -150,7 +150,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -150,7 +150,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
}
}
@Override
@Override
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createFeeBatchApplication
(
OrderFeeBatchApplicationCreateReqVO
createReqVO
)
{
public
void
createFeeBatchApplication
(
OrderFeeBatchApplicationCreateReqVO
createReqVO
)
{
// OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
// OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
// if (orderDO.getAuditType() != 0) {
// if (orderDO.getAuditType() != 0) {
...
@@ -202,6 +202,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -202,6 +202,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
}
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateFeeApplication
(
OrderFeeApplicationUpdateReqVO
updateReqVO
)
{
public
void
updateFeeApplication
(
OrderFeeApplicationUpdateReqVO
updateReqVO
)
{
OrderDO
orderDO
=
orderService
.
getById
(
updateReqVO
.
getOrderId
());
OrderDO
orderDO
=
orderService
.
getById
(
updateReqVO
.
getOrderId
());
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
d4fd0a03
...
@@ -4327,16 +4327,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -4327,16 +4327,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if
(
Objects
.
nonNull
(
auditType
))
{
if
(
Objects
.
nonNull
(
auditType
))
{
// TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务
// TODO 这里可能出现并行的审批任务,当结束一个审批任务变更为0时,需要同步查询当前正在进行的其他审批任务
currentOrderDO
.
setAuditType
(
auditType
);
currentOrderDO
.
setAuditResult
(
auditResult
);
if
(
StringUtils
.
isNotBlank
(
auditResult
))
{
// 获取固定中文说明描述
msg
=
I18nMessage
.
getZhMessage
(
auditResult
);
}
if
(
auditType
==
0
)
{
if
(
auditType
==
0
)
{
this
.
checkOrderProcessingApprovalType
(
orderId
,
currentOrderDO
,
auditType
,
auditResult
);
this
.
checkOrderProcessingApprovalType
(
currentOrderDO
,
auditType
,
auditResult
);
msg
=
currentOrderDO
.
getMsg
();
}
else
{
currentOrderDO
.
setAuditType
(
auditType
);
currentOrderDO
.
setAuditResult
(
auditResult
);
if
(
StringUtils
.
isNotBlank
(
auditResult
))
{
// 获取固定中文说明描述
msg
=
I18nMessage
.
getZhMessage
(
auditResult
);
}
}
}
}
}
if
(
currentOrderDO
.
getAuditType
()
==
0
&&
StringUtils
.
isBlank
(
currentOrderDO
.
getAuditResult
()))
{
if
(
currentOrderDO
.
getAuditType
()
==
0
&&
StringUtils
.
isBlank
(
currentOrderDO
.
getAuditResult
()))
{
...
@@ -4391,29 +4389,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -4391,29 +4389,24 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
/**
/**
* 订单审批更新
* 订单审批更新
*
*
* @param orderId 订单id
* @param orderDO 订单信息
* @param containerNumber 自编号
* @param auditType 审批类型
* @param auditType 审批类型
* @param auditResult 审批结果
* @param auditResult 审批结果
*/
*/
private
void
checkOrderProcessingApprovalType
(
Long
orderId
,
OrderDO
orderDO
,
Integer
auditType
,
String
auditResult
)
{
private
void
checkOrderProcessingApprovalType
(
OrderDO
orderDO
,
Integer
auditType
,
String
auditResult
)
{
// 出货审批更新
// 出货审批更新
if
(
StringUtils
.
isNotBlank
(
orderDO
.
getContainerNumber
())){
if
(
StringUtils
.
isNotBlank
(
orderDO
.
getContainerNumber
())){
BoxCheckOrderApprovalEvent
boxCheckOrderApprovalEvent
=
new
BoxCheckOrderApprovalEvent
(
order
Id
,
orderDO
.
getContainerNumber
(),
auditType
,
auditResult
,
false
);
BoxCheckOrderApprovalEvent
boxCheckOrderApprovalEvent
=
new
BoxCheckOrderApprovalEvent
(
order
DO
.
getOrderId
()
,
orderDO
.
getContainerNumber
(),
auditType
,
auditResult
,
false
);
applicationContext
.
publishEvent
(
boxCheckOrderApprovalEvent
);
applicationContext
.
publishEvent
(
boxCheckOrderApprovalEvent
);
if
(
boxCheckOrderApprovalEvent
.
getIsExists
())
{
if
(
boxCheckOrderApprovalEvent
.
getIsExists
())
{
orderDO
.
setAuditType
(
auditType
);
orderDO
.
setAuditType
(
auditType
);
orderDO
.
setAuditResult
(
auditResult
);
orderDO
.
setAuditResult
(
auditResult
);
if
(
StringUtils
.
isNotBlank
(
auditResult
))
{
// 获取固定中文说明描述
orderDO
.
setMsg
(
I18nMessage
.
getZhMessage
(
auditResult
));
}
return
;
return
;
}
}
}
}
// 入仓审批更新
// 入仓审批更新
OrderWarehouseApprovalDO
warehouseApprovalDO
=
orderWarehouseApprovalService
.
getOne
(
new
LambdaQueryWrapper
<
OrderWarehouseApprovalDO
>()
OrderWarehouseApprovalDO
warehouseApprovalDO
=
orderWarehouseApprovalService
.
getOne
(
new
LambdaQueryWrapper
<
OrderWarehouseApprovalDO
>()
.
eq
(
OrderWarehouseApprovalDO:
:
getOrderIds
,
order
Id
)
.
eq
(
OrderWarehouseApprovalDO:
:
getOrderIds
,
order
DO
.
getOrderId
()
)
.
eq
(
OrderWarehouseApprovalDO:
:
getStatus
,
1
)
.
eq
(
OrderWarehouseApprovalDO:
:
getStatus
,
1
)
.
orderByDesc
(
OrderWarehouseApprovalDO:
:
getId
)
.
orderByDesc
(
OrderWarehouseApprovalDO:
:
getId
)
.
last
(
"limit 1"
));
.
last
(
"limit 1"
));
...
@@ -4423,28 +4416,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -4423,28 +4416,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 入仓修改
// 入仓修改
orderDO
.
setAuditType
(
warehouse_update_processing
.
getType
());
orderDO
.
setAuditType
(
warehouse_update_processing
.
getType
());
orderDO
.
setAuditResult
(
warehouse_update_processing
.
getDesc
());
orderDO
.
setAuditResult
(
warehouse_update_processing
.
getDesc
());
// 获取固定中文说明描述
orderDO
.
setMsg
(
I18nMessage
.
getZhMessage
(
warehouse_update_processing
.
getDesc
()));
return
;
return
;
case
2
:
case
2
:
// 调仓
// 调仓
orderDO
.
setAuditType
(
warehouse_adjust_processing
.
getType
());
orderDO
.
setAuditType
(
warehouse_adjust_processing
.
getType
());
orderDO
.
setAuditResult
(
warehouse_adjust_processing
.
getDesc
());
orderDO
.
setAuditResult
(
warehouse_adjust_processing
.
getDesc
());
// 获取固定中文说明描述
orderDO
.
setMsg
(
I18nMessage
.
getZhMessage
(
warehouse_update_processing
.
getDesc
()));
return
;
return
;
case
3
:
case
3
:
// 退仓
// 退仓
orderDO
.
setAuditType
(
warehouse_rollback_processing
.
getType
());
orderDO
.
setAuditType
(
warehouse_rollback_processing
.
getType
());
orderDO
.
setAuditResult
(
warehouse_rollback_processing
.
getDesc
());
orderDO
.
setAuditResult
(
warehouse_rollback_processing
.
getDesc
());
// 获取固定中文说明描述
orderDO
.
setMsg
(
I18nMessage
.
getZhMessage
(
warehouse_rollback_processing
.
getDesc
()));
return
;
return
;
}
}
}
}
// 订单审批更新
// 订单审批更新
OrderApprovalDO
approvalDO
=
orderApprovalService
.
getOne
(
new
LambdaQueryWrapper
<
OrderApprovalDO
>()
OrderApprovalDO
approvalDO
=
orderApprovalService
.
getOne
(
new
LambdaQueryWrapper
<
OrderApprovalDO
>()
.
eq
(
OrderApprovalDO:
:
getOrderId
,
order
Id
)
.
eq
(
OrderApprovalDO:
:
getOrderId
,
order
DO
.
getOrderId
()
)
.
eq
(
OrderApprovalDO:
:
getStatus
,
1
)
.
eq
(
OrderApprovalDO:
:
getStatus
,
1
)
.
orderByDesc
(
OrderApprovalDO:
:
getOrderApprovalId
)
.
orderByDesc
(
OrderApprovalDO:
:
getOrderApprovalId
)
.
last
(
"limit 1"
));
.
last
(
"limit 1"
));
...
@@ -4452,8 +4439,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
...
@@ -4452,8 +4439,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderApprovalTypeResultEnum
resultEnum
=
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
approvalDO
.
getType
(),
approvalDO
.
getStatus
());
OrderApprovalTypeResultEnum
resultEnum
=
OrderApprovalTypeResultEnum
.
typeAndResultOf
(
approvalDO
.
getType
(),
approvalDO
.
getStatus
());
orderDO
.
setAuditType
(
resultEnum
.
getType
());
orderDO
.
setAuditType
(
resultEnum
.
getType
());
orderDO
.
setAuditResult
(
resultEnum
.
getDesc
());
orderDO
.
setAuditResult
(
resultEnum
.
getDesc
());
// 获取固定中文说明描述
orderDO
.
setMsg
(
I18nMessage
.
getZhMessage
(
resultEnum
.
getDesc
()));
}
}
}
}
...
...
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/orderFeeApplication/OrderFeeApplicationController.java
View file @
d4fd0a03
...
@@ -84,7 +84,7 @@ public class OrderFeeApplicationController {
...
@@ -84,7 +84,7 @@ public class OrderFeeApplicationController {
@PostMapping
(
"/create/batch"
)
@PostMapping
(
"/create/batch"
)
@ApiOperation
(
"批量创建订单费用申请"
)
@ApiOperation
(
"批量创建订单费用申请"
)
@Idempotent
(
timeout
=
5
)
@Idempotent
(
timeout
=
10
)
public
CommonResult
<
Boolean
>
createFeeBatchApplication
(
@Valid
@RequestBody
OrderFeeBatchApplicationCreateReqVO
createReqVO
)
throws
Exception
{
public
CommonResult
<
Boolean
>
createFeeBatchApplication
(
@Valid
@RequestBody
OrderFeeBatchApplicationCreateReqVO
createReqVO
)
throws
Exception
{
String
redisKey
=
MessageFormat
.
format
(
ORDER_FEE_APPLICATION_KEY
,
createReqVO
.
getOrderId
().
toString
());
String
redisKey
=
MessageFormat
.
format
(
ORDER_FEE_APPLICATION_KEY
,
createReqVO
.
getOrderId
().
toString
());
Long
count
=
redisHelper
.
incrBy
(
redisKey
,
1
);
Long
count
=
redisHelper
.
incrBy
(
redisKey
,
1
);
...
@@ -118,6 +118,7 @@ public class OrderFeeApplicationController {
...
@@ -118,6 +118,7 @@ public class OrderFeeApplicationController {
@PutMapping
(
"/update"
)
@PutMapping
(
"/update"
)
@ApiOperation
(
"更新订单费用申请"
)
@ApiOperation
(
"更新订单费用申请"
)
@Idempotent
(
timeout
=
10
)
public
CommonResult
<
Boolean
>
updateFeeApplication
(
@Valid
@RequestBody
OrderFeeApplicationUpdateReqVO
updateReqVO
)
{
public
CommonResult
<
Boolean
>
updateFeeApplication
(
@Valid
@RequestBody
OrderFeeApplicationUpdateReqVO
updateReqVO
)
{
String
redisKey
=
MessageFormat
.
format
(
ORDER_FEE_APPLICATION_KEY
,
updateReqVO
.
getOrderId
().
toString
());
String
redisKey
=
MessageFormat
.
format
(
ORDER_FEE_APPLICATION_KEY
,
updateReqVO
.
getOrderId
().
toString
());
...
...
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