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
02679082
Commit
02679082
authored
Nov 12, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量审批业务调整,并兼容批量批量修改后的批量审批提交
parent
0658f899
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
25 deletions
+78
-25
OrderFeeApplicationService.java
...odule/order/service/order/OrderFeeApplicationService.java
+1
-1
OrderFeeApplicationServiceImpl.java
...er/service/order/impl/OrderFeeApplicationServiceImpl.java
+49
-17
OrderFeeBatchApplicationCreateReqVO.java
...erFeeApplication/OrderFeeBatchApplicationCreateReqVO.java
+2
-2
OrderFeeBatchApplicationUpdateReqVO.java
...erFeeApplication/OrderFeeBatchApplicationUpdateReqVO.java
+24
-0
OrderFeeApplicationController.java
...in/orderFeeApplication/OrderFeeApplicationController.java
+2
-5
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/OrderFeeApplicationService.java
View file @
02679082
...
@@ -31,7 +31,7 @@ public interface OrderFeeApplicationService extends IService<OrderFeeApplication
...
@@ -31,7 +31,7 @@ public interface OrderFeeApplicationService extends IService<OrderFeeApplication
* @param createReqVO 创建信息
* @param createReqVO 创建信息
* @return 编号
* @return 编号
*/
*/
void
createFeeBatchApplication
(
@Valid
OrderFeeBatchApplication
CreateReqVO
cre
ateReqVO
)
throws
Exception
;
void
createFeeBatchApplication
(
@Valid
OrderFeeBatchApplication
UpdateReqVO
upd
ateReqVO
)
throws
Exception
;
/**
/**
* 更新订单费用申请
* 更新订单费用申请
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderFeeApplicationServiceImpl.java
View file @
02679082
...
@@ -151,7 +151,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -151,7 +151,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createFeeBatchApplication
(
OrderFeeBatchApplication
Cre
ateReqVO
createReqVO
)
{
public
void
createFeeBatchApplication
(
OrderFeeBatchApplication
Upd
ateReqVO
createReqVO
)
{
// OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
// OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
// if (orderDO.getAuditType() != 0) {
// if (orderDO.getAuditType() != 0) {
// throw exception(ORDER_HAS_PROCESSING_APPROVAL, orderDO.getOrderNo());
// throw exception(ORDER_HAS_PROCESSING_APPROVAL, orderDO.getOrderNo());
...
@@ -168,14 +168,18 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -168,14 +168,18 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
if
(
approvalTypeCheckEvent
.
getResult
())
{
if
(
approvalTypeCheckEvent
.
getResult
())
{
throw
exception
(
ORDER_IS_APPROVAL_IN_PROCESS
);
throw
exception
(
ORDER_IS_APPROVAL_IN_PROCESS
);
}
}
//查询订单信息
// 批量插入费用
OrderDO
orderDO
=
orderService
.
getById
(
createReqVO
.
getOrderId
());
List
<
OrderFeeApplicationCreateReqVO
>
baseVOList
=
createReqVO
.
getOrderFeeApplicationCreateReqVOList
();
// 批量转换费用
List
<
OrderFeeApplicationUpdateReqVO
>
baseVOList
=
createReqVO
.
getOrderFeeApplicationCreateReqVOList
();
List
<
OrderFeeApplicationDO
>
batchFeeList
=
new
ArrayList
<>();
List
<
OrderFeeApplicationDO
>
batchFeeList
=
new
ArrayList
<>();
for
(
OrderFeeApplication
Cre
ateReqVO
vo
:
baseVOList
)
{
for
(
OrderFeeApplication
Upd
ateReqVO
vo
:
baseVOList
)
{
OrderFeeApplicationDO
feeApplication
=
OrderFeeApplicationConvert
.
INSTANCE
.
convert
(
vo
);
OrderFeeApplicationDO
feeApplication
=
OrderFeeApplicationConvert
.
INSTANCE
.
convert
(
vo
);
feeApplicationMapper
.
insert
(
feeApplication
);
// if (Objects.isNull(feeApplication.getId())) {
// feeApplicationMapper.insert(feeApplication);
// }
batchFeeList
.
add
(
feeApplication
);
batchFeeList
.
add
(
feeApplication
);
}
}
...
@@ -186,19 +190,29 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -186,19 +190,29 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
//批量费用申请
//批量费用申请
orderApprovalDO
.
setType
(
expense_apply_BATCH
.
getValue
());
orderApprovalDO
.
setType
(
expense_apply_BATCH
.
getValue
());
orderApprovalDO
.
setStatus
(
ApprovalResultStatusEnum
.
processing
.
getValue
());
orderApprovalDO
.
setStatus
(
ApprovalResultStatusEnum
.
processing
.
getValue
());
Long
bpmProcessId
=
orderApprovalService
.
applyAndCreate
(
orderApprovalDO
,
WorkFlowEmus
.
ORDER_BATCH_FREE_APPLY
,
createReqVO
.
getCopyUserId
());
orderApprovalDO
.
setStatus
(
ApprovalResultStatusEnum
.
processing
.
getValue
());
//创建审批流
OrderDO
orderDO
=
orderService
.
selectOne
(
OrderDO:
:
getOrderId
,
createReqVO
.
getOrderId
());
order
Service
.
updateStatus
(
orderDO
.
getOrderId
(),
null
,
null
,
null
,
null
,
null
,
OrderApprovalTypeResultEnum
.
expense_apply_batch_processing
.
getType
(),
OrderApprovalTypeResultEnum
.
expense_apply_batch_processing
.
getDesc
()
);
order
ApprovalService
.
save
(
orderApprovalDO
);
//发起流程
String
formId
=
bpmCreateServiceFactory
.
createBmp
(
SecurityFrameworkUtils
.
getLoginUserId
(),
orderApprovalDO
.
getOrderApprovalId
(),
WorkFlowEmus
.
ORDER_BATCH_FREE_APPLY
.
getKey
(),
orderDO
.
getOrderNo
(),
createReqVO
.
getCopyUserId
());
orderApprovalDO
.
setFormId
(
formId
);
//更新费用列表对应的流程申请ID
//更新费用列表对应的流程申请ID
for
(
OrderFeeApplicationDO
feeApplication
:
batchFeeList
)
{
for
(
OrderFeeApplicationDO
feeApplication
:
batchFeeList
)
{
feeApplication
.
setBatchBpmBusinessId
(
String
.
valueOf
(
bpmProcessId
)
);
feeApplication
.
setBatchBpmBusinessId
(
formId
);
feeApplication
.
setStatus
(
ApprovalResultStatusEnum
.
processing
.
getValue
());
feeApplication
.
setStatus
(
ApprovalResultStatusEnum
.
processing
.
getValue
());
feeApplicationMapper
.
updateById
(
feeApplication
);
}
}
orderApprovalDO
.
setDetails
(
JSONObject
.
toJSONString
(
batchFeeList
));
orderApprovalService
.
updateById
(
orderApprovalDO
);
// Long bpmProcessId = orderApprovalService.applyAndCreate(orderApprovalDO, WorkFlowEmus.ORDER_BATCH_FREE_APPLY, createReqVO.getCopyUserId());
//创建审批流
// OrderDO orderDO = orderService.selectOne(OrderDO::getOrderId, createReqVO.getOrderId());
orderService
.
updateStatus
(
orderDO
.
getOrderId
(),
null
,
null
,
null
,
null
,
null
,
OrderApprovalTypeResultEnum
.
expense_apply_batch_processing
.
getType
(),
OrderApprovalTypeResultEnum
.
expense_apply_batch_processing
.
getDesc
());
}
}
@Override
@Override
...
@@ -455,11 +469,22 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -455,11 +469,22 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
if
(
result
==
ApprovalResultStatusEnum
.
pass
.
getValue
())
{
if
(
result
==
ApprovalResultStatusEnum
.
pass
.
getValue
())
{
List
<
FeeDto
>
feeDtos
=
new
ArrayList
<>();
List
<
FeeDto
>
feeDtos
=
new
ArrayList
<>();
OrderBackVO
order
=
orderQueryService
.
getOrder
(
orderApprovalDO
.
getOrderId
());
OrderBackVO
order
=
orderQueryService
.
getOrder
(
orderApprovalDO
.
getOrderId
());
List
<
OrderFeeApplicationDO
>
batchFeeList
=
null
;
if
(
Objects
.
nonNull
(
orderApprovalDO
.
getDetails
())){
batchFeeList
=
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
orderApprovalDO
.
getDetails
()),
OrderFeeApplicationDO
.
class
);
}
else
{
LambdaQueryWrapper
<
OrderFeeApplicationDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
OrderFeeApplicationDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
OrderFeeApplicationDO:
:
getOrderId
,
orderApprovalDO
.
getOrderId
());
lambdaQueryWrapper
.
eq
(
OrderFeeApplicationDO:
:
getOrderId
,
orderApprovalDO
.
getOrderId
());
lambdaQueryWrapper
.
eq
(
OrderFeeApplicationDO:
:
getBatchBpmBusinessId
,
orderApprovalDO
.
getOrderApprovalId
());
lambdaQueryWrapper
.
eq
(
OrderFeeApplicationDO:
:
getBatchBpmBusinessId
,
orderApprovalDO
.
getOrderApprovalId
());
List
<
OrderFeeApplicationDO
>
batchFeeList
=
this
.
list
(
lambdaQueryWrapper
);
batchFeeList
=
this
.
list
(
lambdaQueryWrapper
);
}
for
(
OrderFeeApplicationDO
feeApplicationDO
:
batchFeeList
)
{
for
(
OrderFeeApplicationDO
feeApplicationDO
:
batchFeeList
)
{
feeApplicationDO
.
setStatus
(
result
);
if
(
Objects
.
nonNull
(
feeApplicationDO
.
getId
())){
feeApplicationMapper
.
updateById
(
feeApplicationDO
);
}
else
{
feeApplicationMapper
.
insert
(
feeApplicationDO
);
}
//生成应收
//生成应收
DictDataRespDTO
dictDto
=
DictFrameworkUtils
.
getDictDataFromCache
(
"receivable_fee_type"
,
String
.
valueOf
(
feeApplicationDO
.
getFeeType
()));
DictDataRespDTO
dictDto
=
DictFrameworkUtils
.
getDictDataFromCache
(
"receivable_fee_type"
,
String
.
valueOf
(
feeApplicationDO
.
getFeeType
()));
if
(
feeApplicationDO
.
getReceivableId
()
!=
null
&&
feeApplicationDO
.
getReceivableId
()
>
0
)
{
if
(
feeApplicationDO
.
getReceivableId
()
!=
null
&&
feeApplicationDO
.
getReceivableId
()
>
0
)
{
...
@@ -538,6 +563,14 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -538,6 +563,14 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
@Override
@Override
public
List
<
OrderFeeApplicationDO
>
getFeeApplicationListByOrderId
(
Long
orderId
)
{
public
List
<
OrderFeeApplicationDO
>
getFeeApplicationListByOrderId
(
Long
orderId
)
{
OrderApprovalDO
approvalDO
=
orderApprovalService
.
getOne
(
new
LambdaQueryWrapper
<
OrderApprovalDO
>()
.
eq
(
OrderApprovalDO:
:
getOrderId
,
orderId
)
.
eq
(
OrderApprovalDO:
:
getStatus
,
1
)
.
orderByDesc
(
OrderApprovalDO:
:
getOrderApprovalId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
approvalDO
)
&&
approvalDO
.
getType
()
==
41
&&
Objects
.
nonNull
(
approvalDO
.
getDetails
()))
{
// 对于批量审批中的费用申请,直接返回审批中数据即可
return
JSONObject
.
parseArray
(
JSONObject
.
toJSONString
(
approvalDO
.
getDetails
()),
OrderFeeApplicationDO
.
class
);
}
List
<
OrderFeeApplicationDO
>
feeApplicationList
=
feeApplicationMapper
.
getFeeApplicationListByOrderId
(
orderId
);
List
<
OrderFeeApplicationDO
>
feeApplicationList
=
feeApplicationMapper
.
getFeeApplicationListByOrderId
(
orderId
);
feeApplicationList
.
stream
().
forEach
(
item
->
{
feeApplicationList
.
stream
().
forEach
(
item
->
{
item
.
setApplicationAuthor
(
adminUserService
.
getUser
(
Long
.
valueOf
(
item
.
getCreator
())).
getUsername
());
item
.
setApplicationAuthor
(
adminUserService
.
getUser
(
Long
.
valueOf
(
item
.
getCreator
())).
getUsername
());
...
@@ -552,7 +585,6 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
...
@@ -552,7 +585,6 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
item
.
setReceiveFlag
(
0
);
item
.
setReceiveFlag
(
0
);
}
}
if
(
item
.
getStatus
()
==
1
&&
StringUtils
.
isNotBlank
(
item
.
getBpmProcessId
())){
if
(
item
.
getStatus
()
==
1
&&
StringUtils
.
isNotBlank
(
item
.
getBpmProcessId
())){
OrderApprovalDO
approvalDO
=
orderApprovalService
.
getApproval
(
Long
.
valueOf
(
item
.
getBpmProcessId
()));
if
(
Objects
.
nonNull
(
approvalDO
)
&&
Objects
.
nonNull
(
approvalDO
.
getDetails
())){
if
(
Objects
.
nonNull
(
approvalDO
)
&&
Objects
.
nonNull
(
approvalDO
.
getDetails
())){
OrderFeeApplicationDO
feeApplicationDO
=
JSONObject
.
parseObject
(
approvalDO
.
getDetails
(),
OrderFeeApplicationDO
.
class
);
OrderFeeApplicationDO
feeApplicationDO
=
JSONObject
.
parseObject
(
approvalDO
.
getDetails
(),
OrderFeeApplicationDO
.
class
);
BeanUtils
.
copyProperties
(
feeApplicationDO
,
item
);
BeanUtils
.
copyProperties
(
feeApplicationDO
,
item
);
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderFeeApplication/OrderFeeBatchApplicationCreateReqVO.java
View file @
02679082
...
@@ -11,7 +11,7 @@ import java.util.List;
...
@@ -11,7 +11,7 @@ import java.util.List;
@Data
@Data
@ToString
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
@ApiModel
(
"管理后台 - 批量费用申请创建 Request VO"
)
@ApiModel
(
"管理后台 - 批量费用申请创建
或更新
Request VO"
)
public
class
OrderFeeBatchApplicationCreateReqVO
{
public
class
OrderFeeBatchApplicationCreateReqVO
{
@ApiModelProperty
(
value
=
"订单id"
,
required
=
true
)
@ApiModelProperty
(
value
=
"订单id"
,
required
=
true
)
@NotNull
(
message
=
"订单id不能为空"
)
@NotNull
(
message
=
"订单id不能为空"
)
...
@@ -20,5 +20,5 @@ public class OrderFeeBatchApplicationCreateReqVO {
...
@@ -20,5 +20,5 @@ public class OrderFeeBatchApplicationCreateReqVO {
String
[]
copyUserId
;
String
[]
copyUserId
;
@ApiModelProperty
(
value
=
"批量费用"
)
@ApiModelProperty
(
value
=
"批量费用"
)
@NotEmpty
(
message
=
"费用列表不能为空"
)
@NotEmpty
(
message
=
"费用列表不能为空"
)
List
<
OrderFeeApplication
Cre
ateReqVO
>
orderFeeApplicationCreateReqVOList
;
List
<
OrderFeeApplication
Upd
ateReqVO
>
orderFeeApplicationCreateReqVOList
;
}
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderFeeApplication/OrderFeeBatchApplicationUpdateReqVO.java
0 → 100644
View file @
02679082
package
cn
.
iocoder
.
yudao
.
module
.
order
.
vo
.
orderFeeApplication
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Data
@ToString
(
callSuper
=
true
)
@ApiModel
(
"管理后台 - 批量费用申请创建 Request VO"
)
public
class
OrderFeeBatchApplicationUpdateReqVO
{
@ApiModelProperty
(
value
=
"订单id"
,
required
=
true
)
@NotNull
(
message
=
"订单id不能为空"
)
private
Long
orderId
;
@ApiModelProperty
(
value
=
"抄送人userId"
)
String
[]
copyUserId
;
@ApiModelProperty
(
value
=
"批量费用"
)
@NotEmpty
(
message
=
"费用列表不能为空"
)
List
<
OrderFeeApplicationUpdateReqVO
>
orderFeeApplicationCreateReqVOList
;
}
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/orderFeeApplication/OrderFeeApplicationController.java
View file @
02679082
...
@@ -15,10 +15,7 @@ import cn.iocoder.yudao.module.order.enums.ApprovalResultStatusEnum;
...
@@ -15,10 +15,7 @@ import cn.iocoder.yudao.module.order.enums.ApprovalResultStatusEnum;
import
cn.iocoder.yudao.module.order.service.approval.OrderApprovalService
;
import
cn.iocoder.yudao.module.order.service.approval.OrderApprovalService
;
import
cn.iocoder.yudao.module.order.service.order.OrderFeeApplicationService
;
import
cn.iocoder.yudao.module.order.service.order.OrderFeeApplicationService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.service.order.OrderService
;
import
cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationBackVO
;
import
cn.iocoder.yudao.module.order.vo.orderFeeApplication.*
;
import
cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationQueryVO
;
import
cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeApplicationUpdateReqVO
;
import
cn.iocoder.yudao.module.order.vo.orderFeeApplication.OrderFeeBatchApplicationCreateReqVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -85,7 +82,7 @@ public class OrderFeeApplicationController {
...
@@ -85,7 +82,7 @@ public class OrderFeeApplicationController {
@PostMapping
(
"/create/batch"
)
@PostMapping
(
"/create/batch"
)
@ApiOperation
(
"批量创建订单费用申请"
)
@ApiOperation
(
"批量创建订单费用申请"
)
@Idempotent
(
timeout
=
10
)
@Idempotent
(
timeout
=
10
)
public
CommonResult
<
Boolean
>
createFeeBatchApplication
(
@Valid
@RequestBody
OrderFeeBatchApplication
Cre
ateReqVO
createReqVO
)
throws
Exception
{
public
CommonResult
<
Boolean
>
createFeeBatchApplication
(
@Valid
@RequestBody
OrderFeeBatchApplication
Upd
ateReqVO
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
);
if
(
count
>
1
){
if
(
count
>
1
){
...
...
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