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
7c732a99
Commit
7c732a99
authored
Nov 28, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 批量生成收款单;优化创建,更新收款单
parent
f8ee4809
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
267 additions
and
271 deletions
+267
-271
ReceiptDO.java
...yudao/module/wealth/dal/dataobject/receipt/ReceiptDO.java
+5
-0
GeneratePathEnum.java
...n/iocoder/yudao/module/wealth/enums/GeneratePathEnum.java
+48
-0
ReceiptService.java
...r/yudao/module/wealth/service/receipt/ReceiptService.java
+4
-21
ReceiptServiceImpl.java
...dao/module/wealth/service/receipt/ReceiptServiceImpl.java
+154
-202
ReceiptItemService.java
...module/wealth/service/receiptItem/ReceiptItemService.java
+3
-1
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+34
-0
ReceiptItemBatchCreateReqVO.java
...wealth/vo/receiptAccount/ReceiptItemBatchCreateReqVO.java
+1
-1
ReceiptItemBatchRespVO.java
...dule/wealth/vo/receiptAccount/ReceiptItemBatchRespVO.java
+1
-1
ReceiptController.java
...le/wealth/controller/admin/receipt/ReceiptController.java
+0
-45
ReceiptItemController.java
...h/controller/admin/receiptItem/ReceiptItemController.java
+17
-0
No files found.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/dataobject/receipt/ReceiptDO.java
View file @
7c732a99
...
@@ -236,4 +236,9 @@ public class ReceiptDO extends BaseDO {
...
@@ -236,4 +236,9 @@ public class ReceiptDO extends BaseDO {
* 开票资料状态
* 开票资料状态
*/
*/
private
Integer
invoiceDataStatus
;
private
Integer
invoiceDataStatus
;
/**
* 生成路径
*/
private
Integer
generatePath
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/enums/GeneratePathEnum.java
0 → 100644
View file @
7c732a99
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
enums
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.iocoder.yudao.framework.common.util.json.core.IntArrayValuable
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.Arrays
;
@AllArgsConstructor
@Getter
public
enum
GeneratePathEnum
implements
IntArrayValuable
{
/**
* 单个生成
*/
SINGLE
(
0
,
"单个生成"
,
"SINGLE"
),
/**
* 批量生成
*/
BATCH
(
1
,
"批量生成"
,
"BATCH"
);
public
static
final
int
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
mapToInt
(
GeneratePathEnum:
:
getValue
).
toArray
();
/**
* 状态
*/
private
final
Integer
value
;
/**
* 状态中文
*/
private
final
String
nameZh
;
/**
* 状态英语
*/
private
final
String
nameEn
;
public
static
GeneratePathEnum
valueOf
(
Integer
value
)
{
return
ArrayUtil
.
firstMatch
(
orderStatus
->
orderStatus
.
getValue
().
equals
(
value
),
GeneratePathEnum
.
values
());
}
@Override
public
int
[]
array
()
{
return
ARRAYS
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receipt/ReceiptService.java
View file @
7c732a99
...
@@ -6,8 +6,6 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
...
@@ -6,8 +6,6 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptLinkEnum
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptLinkEnum
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchRespVO
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -35,21 +33,6 @@ public interface ReceiptService extends IService<ReceiptDO> {
...
@@ -35,21 +33,6 @@ public interface ReceiptService extends IService<ReceiptDO> {
*/
*/
void
updateReceipt
(
@Valid
ReceiptUpdateReqVO
updateReqVO
);
void
updateReceipt
(
@Valid
ReceiptUpdateReqVO
updateReqVO
);
///**
// * 获取开票信息
// *
// * @param receiptId 付款单ID
// */
//ReceiptBackVO getInvoicingInfo(Long receiptId);
//
///**
// * 更新发票信息
// *
// * @param invoicingUpdateVO 更新信息
// */
//void updateInvoicingInfo(@Valid InvoicingUpdateVO invoicingUpdateVO);
/**
/**
* 删除收款单
* 删除收款单
*
*
...
@@ -173,7 +156,7 @@ public interface ReceiptService extends IService<ReceiptDO> {
...
@@ -173,7 +156,7 @@ public interface ReceiptService extends IService<ReceiptDO> {
Boolean
setBankWriteoffRange
(
ReceiptBankWriteoffRangeVO
range
);
Boolean
setBankWriteoffRange
(
ReceiptBankWriteoffRangeVO
range
);
/**
/**
* 批量
生成
收款单
* 批量
创建
收款单
*
*
* @param createReqVOList
* @param createReqVOList
* @return
* @return
...
@@ -181,12 +164,12 @@ public interface ReceiptService extends IService<ReceiptDO> {
...
@@ -181,12 +164,12 @@ public interface ReceiptService extends IService<ReceiptDO> {
List
<
ReceiptBatchGenRespVO
>
batchGenReceipt
(
List
<
ReceiptCreateReqVO
>
createReqVOList
);
List
<
ReceiptBatchGenRespVO
>
batchGenReceipt
(
List
<
ReceiptCreateReqVO
>
createReqVOList
);
/**
/**
*
批量导入收款信息
*
生成收款单相关数据
*
*
* @param
list
* @param
createReqVO
* @return
* @return
*/
*/
L
ist
<
ReceiptAccountBatchRespVO
>
receiptAccountImport
(
List
<
ReceiptAccountBatchCreateReqVO
>
list
);
L
ong
generateReceiptRelevantData
(
ReceiptCreateReqVO
createReqVO
);
/**
/**
* 更新收款明细状态
* 更新收款明细状态
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receipt/ReceiptServiceImpl.java
View file @
7c732a99
...
@@ -47,8 +47,6 @@ import cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalSer
...
@@ -47,8 +47,6 @@ import cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalSer
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.util.WealthGenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.util.WealthGenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptInvoice.ReceiptInvoiceCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableUpdateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableUpdateReqVO
;
...
@@ -114,94 +112,123 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -114,94 +112,123 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createReceipt
(
ReceiptCreateReqVO
createReqVO
)
{
public
Long
createReceipt
(
ReceiptCreateReqVO
createReqVO
)
{
// TODO 一个收款单是否可以关联多个订单的应收明细,校验明细的规则是什么?
validateCreateVO
(
createReqVO
);
if
(
createReqVO
.
getOrderId
()
==
0
)
{
throw
exception
(
ORDER_ID_NULL
);
}
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
=
createReqVO
.
getReceivableVOList
();
if
(
CollectionUtil
.
isEmpty
(
receivableUpdateReqVOList
))
{
throw
exception
(
RECEIVABLE_NOT_NULL
);
}
// 收款账户信息(对应收款信息/账单信息)
List
<
ReceiptAccountCreateReqVO
>
receiptAccountCreateReqVOList
=
createReqVO
.
getReceiptAccountList
();
if
(
CollectionUtil
.
isEmpty
(
receiptAccountCreateReqVOList
))
{
throw
exception
(
RECEIPT_ACCOUNT_NOT_EXISTS
);
}
// 校验应收明细
validateSameCustomerReceivable
(
receivableUpdateReqVOList
);
ReceiptDO
receipt
=
ReceiptConvert
.
INSTANCE
.
convert
(
createReqVO
);
ReceiptService
currentProxy
=
(
ReceiptService
)
AopContext
.
currentProxy
();
generateReceiptNo
(
receipt
);
receipt
.
setReceiptItemStatus
(
ReceiptItemStatusInReceiptEnum
.
NO_INPUT
.
getValue
());
return
currentProxy
.
generateReceiptRelevantData
(
createReqVO
);
// 应收明细关联收款单
List
<
ReceivableDO
>
receivableDOList
=
receivableUpdateReqVOList
.
stream
().
filter
(
re
->
null
!=
re
.
getId
()).
map
(
re
->
{
ReceivableDO
receivableDO
=
ReceivableConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setState
(
1
);
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receivableService
.
updateBatchById
(
receivableDOList
);
// 生成收款账户信息
List
<
ReceiptAccountDO
>
receiptAccountDOList
=
receiptAccountCreateReqVOList
.
stream
().
map
(
re
->
{
ReceiptAccountDO
receivableDO
=
ReceiptAccountConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setUpdateTime
(
new
Date
());
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receiptAccountService
.
saveBatch
(
receiptAccountDOList
);
// 需要开票时生成开票信息
if
(
createReqVO
.
getOpenInvoice
().
equals
(
1
))
{
ReceiptInvoiceCreateReqVO
receiptInvoiceCreateReqVO
=
createReqVO
.
getReceiptInvoice
();
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convert
(
receiptInvoiceCreateReqVO
);
receiptInvoiceDO
.
setInvoiceNo
(
wealthGenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setReceiptId
(
receipt
.
getId
());
receiptInvoiceDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receiptInvoiceDO
.
setOrderId
(
createReqVO
.
getOrderId
());
receiptInvoiceDO
.
setOrderNo
(
createReqVO
.
getOrderNo
());
receiptInvoiceMapper
.
insert
(
receiptInvoiceDO
);
receipt
.
setInvoiceId
(
receiptInvoiceDO
.
getId
());
receipt
.
setInvoicingStatus
(
InvoicingStatusEnum
.
WAIT
.
getValue
());
}
receipt
.
setInvoicingStatus
(
InvoicingStatusEnum
.
NO_INVOICE
.
getValue
());
// 是草稿
if
(
StringUtils
.
equals
(
createReqVO
.
getAddType
(),
"1"
))
{
receipt
.
setState
(
ReceiptStatusEnum
.
DRAFT
.
getValue
());
receiptMapper
.
insert
(
receipt
);
}
}
// 不是草稿创建收款单并发起审核流程
else
if
(
StringUtils
.
equals
(
createReqVO
.
getAddType
(),
"0"
))
{
//validateReceiptBmpStatus(receipt.getId());
/**
* 发起审批流程
*
* @param reason
* @param copyUserList
* @param receipt
*/
private
void
initApproval
(
String
reason
,
String
[]
copyUserList
,
ReceiptDO
receipt
)
{
ReceiptApprovalDO
approvalDO
=
new
ReceiptApprovalDO
();
ReceiptApprovalDO
approvalDO
=
new
ReceiptApprovalDO
();
approvalDO
.
setReceiptId
(
receipt
.
getId
());
approvalDO
.
setReceiptId
(
receipt
.
getId
());
approvalDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
approvalDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
approvalDO
.
setBmpKey
(
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
());
approvalDO
.
setBmpKey
(
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
());
approvalDO
.
setStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
approvalDO
.
setStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
approvalDO
.
setReason
(
createReqVO
.
getReason
()
);
approvalDO
.
setReason
(
reason
);
receiptApprovalService
.
save
(
approvalDO
);
receiptApprovalService
.
save
(
approvalDO
);
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
String
bpmId
=
bpmCreateServiceFactory
.
createBmp
(
userId
,
approvalDO
.
getId
(),
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
(),
receipt
.
getReceiptNo
(),
createReqVO
.
getCopyUserList
()
);
String
bpmId
=
bpmCreateServiceFactory
.
createBmp
(
userId
,
approvalDO
.
getId
(),
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
(),
receipt
.
getReceiptNo
(),
copyUserList
);
approvalDO
.
setBmpId
(
bpmId
);
approvalDO
.
setBmpId
(
bpmId
);
receiptApprovalService
.
updateById
(
approvalDO
);
receiptApprovalService
.
updateById
(
approvalDO
);
receipt
.
setBmpStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
receipt
.
setBmpStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
receipt
.
setState
(
ReceiptStatusEnum
.
APPROVE_ING
.
getValue
());
receipt
.
setState
(
ReceiptStatusEnum
.
APPROVE_ING
.
getValue
());
receipt
.
setBmpId
(
bpmId
);
receipt
.
setBmpId
(
bpmId
);
receiptMapper
.
insert
(
receipt
);
}
}
recordLog
(
receipt
.
getId
(),
ReceiptLinkEnum
.
CREATE_RECEIPT
,
receipt
.
getRemark
(),
receipt
.
getBmpId
());
return
receipt
.
getId
();
/**
* 创建发票
*
* @param receiptInvoiceCreateReqVO
* @param receipt
*/
private
void
createInvoice
(
ReceiptInvoiceCreateReqVO
receiptInvoiceCreateReqVO
,
ReceiptDO
receipt
)
{
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convert
(
receiptInvoiceCreateReqVO
);
receiptInvoiceDO
.
setInvoiceNo
(
wealthGenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setReceiptId
(
receipt
.
getId
());
receiptInvoiceDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receiptInvoiceDO
.
setOrderId
(
receipt
.
getOrderId
());
receiptInvoiceDO
.
setOrderNo
(
receipt
.
getOrderNo
());
receiptInvoiceMapper
.
insert
(
receiptInvoiceDO
);
receipt
.
setInvoiceId
(
receiptInvoiceDO
.
getId
());
receipt
.
setInvoicingStatus
(
InvoicingStatusEnum
.
WAIT
.
getValue
());
}
/**
* 生成收款账户信息
*
* @param receiptAccountCreateReqVOList
* @param receipt
*/
private
void
genReceiptAccount
(
List
<
ReceiptAccountCreateReqVO
>
receiptAccountCreateReqVOList
,
ReceiptDO
receipt
)
{
List
<
ReceiptAccountDO
>
receiptAccountDOList
=
receiptAccountCreateReqVOList
.
stream
().
map
(
re
->
{
ReceiptAccountDO
receivableDO
=
ReceiptAccountConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setUpdateTime
(
new
Date
());
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receiptAccountService
.
saveBatch
(
receiptAccountDOList
);
}
/**
* 应收明细关联收款单
*
* @param receivableUpdateReqVOList
* @param receipt
*/
private
void
receivableAssocReceipt
(
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
,
ReceiptDO
receipt
)
{
List
<
ReceivableDO
>
receivableDOList
=
receivableUpdateReqVOList
.
stream
().
filter
(
re
->
null
!=
re
.
getId
()).
map
(
re
->
{
ReceivableDO
receivableDO
=
ReceivableConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setState
(
1
);
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receivableService
.
updateBatchById
(
receivableDOList
);
}
/**
* 校验创建收款单
*
* @param createReqVO
*/
private
void
validateCreateVO
(
ReceiptCreateReqVO
createReqVO
)
{
if
(
createReqVO
.
getOrderId
()
==
0
)
{
throw
exception
(
ORDER_ID_NULL
);
}
// 收款账户信息(对应收款信息/账单信息)
if
(
CollectionUtil
.
isEmpty
(
createReqVO
.
getReceiptAccountList
()))
{
throw
exception
(
RECEIPT_ACCOUNT_NOT_EXISTS
);
}
// 校验应收明细
validateSameCustomerReceivable
(
createReqVO
.
getReceivableVOList
());
}
}
@Override
@Override
public
List
<
ReceiptBatchGenRespVO
>
batchGenReceipt
(
List
<
ReceiptCreateReqVO
>
createReqVOList
)
{
public
List
<
ReceiptBatchGenRespVO
>
batchGenReceipt
(
List
<
ReceiptCreateReqVO
>
createReqVOList
)
{
// TODO 区分批量和单个创建,添加新字段
ArrayList
<
ReceiptBatchGenRespVO
>
respVOS
=
new
ArrayList
<>();
ArrayList
<
ReceiptBatchGenRespVO
>
respVOS
=
new
ArrayList
<>();
createReqVOList
.
forEach
(
createReqVO
->
{
try
{
validateCreateVO
(
createReqVO
);
}
catch
(
Exception
e
)
{
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
createReqVO
.
getOrderNo
(),
createReqVO
.
getCustomerName
(),
e
.
getMessage
()));
}
});
if
(!
respVOS
.
isEmpty
())
{
return
respVOS
;
}
ReceiptService
currentProxy
=
(
ReceiptService
)
AopContext
.
currentProxy
();
ReceiptService
currentProxy
=
(
ReceiptService
)
AopContext
.
currentProxy
();
for
(
ReceiptCreateReqVO
receiptCreateReqVO
:
createReqVOList
)
{
for
(
ReceiptCreateReqVO
receiptCreateReqVO
:
createReqVOList
)
{
try
{
try
{
currentProxy
.
createReceipt
(
receiptCreateReqVO
);
currentProxy
.
generateReceiptRelevantData
(
receiptCreateReqVO
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
receiptCreateReqVO
.
getOrderNo
(),
receiptCreateReqVO
.
getCustomerName
(),
e
.
getMessage
()));
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
receiptCreateReqVO
.
getOrderNo
(),
receiptCreateReqVO
.
getCustomerName
(),
e
.
getMessage
()));
}
}
...
@@ -209,36 +236,39 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -209,36 +236,39 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
return
respVOS
;
return
respVOS
;
}
}
/**
* 生成收款单相关数据
*
* @param createReqVO 创建信息
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
List
<
ReceiptAccountBatchRespVO
>
receiptAccountImport
(
List
<
ReceiptAccountBatchCreateReqVO
>
list
)
{
public
Long
generateReceiptRelevantData
(
ReceiptCreateReqVO
createReqVO
)
{
// TODO 逻辑待完善
ReceiptDO
receipt
=
ReceiptConvert
.
INSTANCE
.
convert
(
createReqVO
);
// 校验收款账户信息
generateReceiptNo
(
receipt
);
List
<
ReceiptAccountBatchRespVO
>
respVOS
=
validateBatchReceiptAccount
(
list
);
receipt
.
setReceiptItemStatus
(
ReceiptItemStatusInReceiptEnum
.
NO_INPUT
.
getValue
());
// 插入数据
// 校验收款明细自动审核
// 更新收款单
return
respVOS
;
}
private
List
<
ReceiptAccountBatchRespVO
>
validateBatchReceiptAccount
(
List
<
ReceiptAccountBatchCreateReqVO
>
list
)
{
// 根据订单号或提单号是否能查到订单
// 根据订单号或提单号匹配状态≠已核销/草稿状态的收款单是否存在,存在多条匹配创建时间最晚的一条
// 根据上条校验,一个收款单存在一条或多条收款数据弹提示
// 收款账号是否存在,是否匹配
// 校验收款金额
// 校验实收金额币种
// 结算币种需为收款单所在目的国结算币种
// 校验当前收款单汇率是否过期,过期则更新为导入的汇率
receivableAssocReceipt
(
createReqVO
.
getReceivableVOList
(),
receipt
);
genReceiptAccount
(
createReqVO
.
getReceiptAccountList
(),
receipt
);
// 需要开票时生成开票信息
if
(
createReqVO
.
getOpenInvoice
().
equals
(
1
))
{
createInvoice
(
createReqVO
.
getReceiptInvoice
(),
receipt
);
}
else
{
receipt
.
setInvoicingStatus
(
InvoicingStatusEnum
.
NO_INVOICE
.
getValue
());
}
return
null
;
if
(
StringUtils
.
equals
(
createReqVO
.
getAddType
(),
"1"
))
{
receipt
.
setState
(
ReceiptStatusEnum
.
DRAFT
.
getValue
());
receiptMapper
.
insert
(
receipt
);
}
// 不是草稿创建收款单并发起审核流程
else
if
(
StringUtils
.
equals
(
createReqVO
.
getAddType
(),
"0"
))
{
initApproval
(
createReqVO
.
getReason
(),
createReqVO
.
getCopyUserList
(),
receipt
);
receiptMapper
.
insert
(
receipt
);
}
recordLog
(
receipt
.
getId
(),
ReceiptLinkEnum
.
CREATE_RECEIPT
,
receipt
.
getRemark
(),
receipt
.
getBmpId
());
return
receipt
.
getId
();
}
}
/**
/**
...
@@ -266,6 +296,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -266,6 +296,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
* @param receivableUpdateReqVOList 收款明细
* @param receivableUpdateReqVOList 收款明细
*/
*/
public
void
validateSameCustomerReceivable
(
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
)
{
public
void
validateSameCustomerReceivable
(
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
)
{
if
(
CollectionUtil
.
isEmpty
(
receivableUpdateReqVOList
))
{
throw
exception
(
RECEIVABLE_NOT_NULL
);
}
Long
tempCustomerId
=
null
;
Long
tempCustomerId
=
null
;
String
tempGuojia
=
""
;
String
tempGuojia
=
""
;
String
tempNum
=
""
;
String
tempNum
=
""
;
...
@@ -319,54 +352,25 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -319,54 +352,25 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateReceipt
(
ReceiptUpdateReqVO
updateReqVO
)
{
public
void
updateReceipt
(
ReceiptUpdateReqVO
updateReqVO
)
{
// 校验流程是不是正在审核中
validateUpdateVO
(
updateReqVO
);
validateReceiptBmpStatus
(
updateReqVO
.
getId
());
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
=
updateReqVO
.
getReceivableVOList
();
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
=
updateReqVO
.
getReceivableVOList
();
if
(
CollectionUtil
.
isEmpty
(
receivableUpdateReqVOList
))
{
throw
exception
(
RECEIVABLE_NOT_NULL
);
}
List
<
ReceiptAccountCreateReqVO
>
receiptAccountCreateReqVOList
=
updateReqVO
.
getReceiptAccountList
();
List
<
ReceiptAccountCreateReqVO
>
receiptAccountCreateReqVOList
=
updateReqVO
.
getReceiptAccountList
();
if
(
CollectionUtil
.
isEmpty
(
receiptAccountCreateReqVOList
))
{
throw
exception
(
RECEIPT_ACCOUNT_NOT_EXISTS
);
}
// 校验存在
this
.
validateReceiptExists
(
updateReqVO
.
getId
());
validateSameCustomerReceivable
(
updateReqVO
.
getReceivableVOList
());
ReceiptDO
updateObj
=
ReceiptConvert
.
INSTANCE
.
convert
(
updateReqVO
);
ReceiptDO
updateObj
=
ReceiptConvert
.
INSTANCE
.
convert
(
updateReqVO
);
// TODO 逻辑不对,待确认非草稿状态能否改成草稿
// TODO 逻辑不对,待确认非草稿状态能否改成草稿
if
(
StringUtils
.
equals
(
updateReqVO
.
getUpdateType
(),
"0"
))
{
if
(
StringUtils
.
equals
(
updateReqVO
.
getUpdateType
(),
"0"
))
{
updateReqVO
.
setState
(
ReceiptStatusEnum
.
DRAFT
.
getValue
());
updateReqVO
.
setState
(
ReceiptStatusEnum
.
DRAFT
.
getValue
());
receiptMapper
.
updateById
(
updateObj
);
receiptMapper
.
updateById
(
updateObj
);
}
else
if
(
StringUtils
.
equals
(
updateReqVO
.
getUpdateType
(),
"1"
))
{
}
else
if
(
StringUtils
.
equals
(
updateReqVO
.
getUpdateType
(),
"1"
))
{
//更新收款单并发起审核流程
//更新收款单并发起审核流程
ReceiptApprovalDO
approvalDO
=
new
ReceiptApprovalDO
();
initApproval
(
updateReqVO
.
getReason
(),
updateReqVO
.
getCopyUserList
(),
updateObj
);
approvalDO
.
setReceiptId
(
updateReqVO
.
getId
());
approvalDO
.
setReceiptNo
(
updateReqVO
.
getReceiptNo
());
approvalDO
.
setBmpKey
(
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
());
approvalDO
.
setStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
approvalDO
.
setReason
(
updateReqVO
.
getReason
());
receiptApprovalService
.
save
(
approvalDO
);
Long
userId
=
SecurityFrameworkUtils
.
getLoginUserId
();
String
bpmId
=
bpmCreateServiceFactory
.
createBmp
(
userId
,
approvalDO
.
getId
(),
WorkFlowEmus
.
FINANCE_RECEIPT_APPROVE
.
getKey
(),
updateReqVO
.
getReceiptNo
(),
updateReqVO
.
getCopyUserList
());
approvalDO
.
setBmpId
(
bpmId
);
receiptApprovalService
.
updateById
(
approvalDO
);
updateObj
.
setId
(
updateReqVO
.
getId
());
updateObj
.
setBmpStatus
(
BpmProcessInstanceResultEnum
.
PROCESS
.
getResult
());
updateObj
.
setState
(
ReceiptStatusEnum
.
APPROVE_ING
.
getValue
());
updateObj
.
setBmpId
(
bpmId
);
receiptMapper
.
updateById
(
updateObj
);
receiptMapper
.
updateById
(
updateObj
);
}
}
// 删除的应收明细取消关联收款单
// 删除的应收明细取消关联收款单
LambdaQueryWrapper
<
ReceivableDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
ReceivableDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
ReceivableDO:
:
getReceiptId
,
updateReqVO
.
getId
());
lambdaQueryWrapper
.
eq
(
ReceivableDO:
:
getReceiptId
,
updateReqVO
.
getId
());
List
<
ReceivableDO
>
allReceivable
=
receivableService
.
list
(
lambdaQueryWrapper
);
List
<
ReceivableDO
>
allReceivable
=
receivableService
.
list
(
lambdaQueryWrapper
);
for
(
ReceivableDO
receivableDO
:
allReceivable
)
{
for
(
ReceivableDO
receivableDO
:
allReceivable
)
{
if
(
!
receivableUpdateReqVOList
.
stream
().
filter
(
w
->
w
.
getId
()
==
receivableDO
.
getId
()).
findAny
().
isPresent
(
))
{
if
(
receivableUpdateReqVOList
.
stream
().
noneMatch
(
w
->
Objects
.
equals
(
w
.
getId
(),
receivableDO
.
getId
())
))
{
LambdaUpdateWrapper
<
ReceivableDO
>
update
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
ReceivableDO
>
update
=
new
LambdaUpdateWrapper
<>();
update
.
set
(
ReceivableDO:
:
getReceiptId
,
null
);
update
.
set
(
ReceivableDO:
:
getReceiptId
,
null
);
update
.
set
(
ReceivableDO:
:
getReceiptNo
,
null
);
update
.
set
(
ReceivableDO:
:
getReceiptNo
,
null
);
...
@@ -374,81 +378,29 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -374,81 +378,29 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
receivableService
.
update
(
update
);
receivableService
.
update
(
update
);
}
}
}
}
List
<
ReceivableDO
>
receivableDOList
=
receivableUpdateReqVOList
.
stream
().
filter
(
re
->
null
!=
re
.
getId
()).
map
(
re
->
{
receivableAssocReceipt
(
receivableUpdateReqVOList
,
updateObj
);
ReceivableDO
receivableDO
=
ReceivableConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptNo
(
updateObj
.
getReceiptNo
());
receivableDO
.
setReceiptId
(
updateObj
.
getId
());
receivableDO
.
setState
(
1
);
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receivableService
.
updateBatchById
(
receivableDOList
);
// 删除旧的收款账户信息,保存新的收款账户信息
// 删除旧的收款账户信息,保存新的收款账户信息
LambdaQueryWrapper
<
ReceiptAccountDO
>
removeLambdaWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
ReceiptAccountDO
>
removeLambdaWrapper
=
new
LambdaQueryWrapper
();
removeLambdaWrapper
.
eq
(
ReceiptAccountDO:
:
getReceiptId
,
updateObj
.
getId
());
removeLambdaWrapper
.
eq
(
ReceiptAccountDO:
:
getReceiptId
,
updateObj
.
getId
());
receiptAccountService
.
remove
(
removeLambdaWrapper
);
receiptAccountService
.
remove
(
removeLambdaWrapper
);
genReceiptAccount
(
receiptAccountCreateReqVOList
,
updateObj
);
List
<
ReceiptAccountDO
>
receiptAccountDOList
=
receiptAccountCreateReqVOList
.
stream
().
map
(
re
->
{
ReceiptAccountDO
receivableDO
=
ReceiptAccountConvert
.
INSTANCE
.
convert
(
re
);
receivableDO
.
setReceiptId
(
updateObj
.
getId
());
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
receiptAccountService
.
saveBatch
(
receiptAccountDOList
);
recordLog
(
updateObj
.
getId
(),
ReceiptLinkEnum
.
EDIT_RECEIPT
,
updateObj
.
getRemark
(),
updateObj
.
getBmpId
());
recordLog
(
updateObj
.
getId
(),
ReceiptLinkEnum
.
EDIT_RECEIPT
,
updateObj
.
getRemark
(),
updateObj
.
getBmpId
());
}
}
// TODO 拆分到开票管理
private
void
validateUpdateVO
(
ReceiptUpdateReqVO
updateReqVO
)
{
//@Override
// 校验流程是不是正在审核中
//public ReceiptBackVO getInvoicingInfo(Long receiptId) {
validateReceiptBmpStatus
(
updateReqVO
.
getId
());
// ReceiptBackVO receiptBackVO = receiptMapper.getInvoicingInfo(receiptId);
if
(
CollectionUtil
.
isEmpty
(
updateReqVO
.
getReceivableVOList
()))
{
// if (Objects.isNull(receiptBackVO)) {
throw
exception
(
RECEIVABLE_NOT_NULL
);
// throw exception(RECEIPT_NOT_EXISTS);
}
// }
if
(
CollectionUtil
.
isEmpty
(
updateReqVO
.
getReceiptAccountList
()))
{
// /* if (receiptBackVO.getState() != 5) {
throw
exception
(
RECEIPT_ACCOUNT_NOT_EXISTS
);
// throw exception(THIS_RECEIPT_NOT_STAY_INVOICE_STATE);
}
// }
validateSameCustomerReceivable
(
updateReqVO
.
getReceivableVOList
());
// if (StringUtils.isBlank(receiptBackVO.getAccountBank()) || StringUtils.isBlank(receiptBackVO.getAccountName()) || StringUtils.isBlank(receiptBackVO.getInvoice()) || StringUtils.isBlank(receiptBackVO.getAddressPhone()) || StringUtils.isBlank(receiptBackVO.getTaxpayer())) {
}
// throw exception(BILLING_INFO_NOT_COMPLETE);
// }*/
// //receiptMapper.updateById(ReceiptConvert.INSTANCE.convert(receiptBackVO));
// // 根据客户ID获取用户信息
/// * List<ReceivableDO> receivableDOList = receivableService.list(new LambdaQueryWrapper<ReceivableDO>()
// .eq(ReceivableDO::getReceiptId, receiptId)
// .eq(ReceivableDO::getDeleted, 0)
// .orderByDesc(ReceivableDO::getId));
// receiptBackVO.setReceivableList(ReceivableConvert.INSTANCE.convertList(receivableDOList));*/
// return receiptBackVO;
//}
// TODO 拆分到开票管理
//@Override
//public void updateInvoicingInfo(@Valid InvoicingUpdateVO invoicingUpdateVO) {
// ReceiptDO receiptDO = receiptMapper.selectById(invoicingUpdateVO.getId());
// if (Objects.isNull(receiptDO)) {
// throw exception(RECEIPT_NOT_EXISTS);
// }
// if (receiptDO.getState() != 5) {
// throw exception(THIS_RECEIPT_NOT_STAY_INVOICE_STATE);
// }
// receiptDO.setInvoicingAt(new Date());
// receiptDO.setInvoiceNumber(invoicingUpdateVO.getInvoiceNumber());
// receiptDO.setInvoicingType(invoicingUpdateVO.getInvoicingType());
// receiptDO.setInvoicingRemark(invoicingUpdateVO.getInvoicingRemark());
// receiptDO.setInvoicingTypeId(invoicingUpdateVO.getInvoicingTypeId());
// receiptDO.setTaxRate(invoicingUpdateVO.getTaxRate());
// receiptDO.setProjectName(invoicingUpdateVO.getProjectName());
//
// receiptDO.setInvoice(invoicingUpdateVO.getInvoice());
// receiptDO.setTaxpayer(invoicingUpdateVO.getTaxpayer());
// receiptDO.setAccountBank(invoicingUpdateVO.getAccountBank());
// receiptDO.setAccountName(invoicingUpdateVO.getAccountName());
//
// receiptDO.setAddressPhone(invoicingUpdateVO.getAddressPhone());
//
// receiptDO.setState(ReceiptStatusEnum.OPEN_BILL.getValue());
// receiptMapper.updateById(receiptDO);
//}
@Override
@Override
@Transactional
@Transactional
public
void
deleteReceipt
(
Long
id
)
{
public
void
deleteReceipt
(
Long
id
)
{
...
@@ -628,12 +580,12 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -628,12 +580,12 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
return
sR
;
return
sR
;
}
}
/*
/*
*
计算收款单明细状态
*
计算收款单明细状态
收款单主表
*
收款单主表
SELECT * from ecw_receipt where receipt_no='SKD00006547'
*
SELECT * from ecw_receipt where receipt_no='SKD00006547'
收款单明细表
*
收款单明细表
SELECT * from ecw_receipt_item where receipt_id=6554
*
SELECT * from ecw_receipt_item where receipt_id=6554
*/
*/
private
ReceiptItemStatusInReceiptEnum
getReceiptMxStatus
(
List
<
ReceiptItemDO
>
listItem
,
long
ReceiptId
)
{
private
ReceiptItemStatusInReceiptEnum
getReceiptMxStatus
(
List
<
ReceiptItemDO
>
listItem
,
long
ReceiptId
)
{
//未录入 收款单下无收款明细 OK
//未录入 收款单下无收款明细 OK
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemService.java
View file @
7c732a99
...
@@ -4,9 +4,10 @@ import cn.iocoder.yudao.framework.mybatis.core.service.IService;
...
@@ -4,9 +4,10 @@ import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
import
org.apache.ibatis.annotations.Param
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -121,4 +122,5 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
...
@@ -121,4 +122,5 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
);
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
);
List
<
ReceiptItemBatchRespVO
>
receiptItemImport
(
List
<
ReceiptItemBatchCreateReqVO
>
list
);
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
7c732a99
...
@@ -23,6 +23,8 @@ import cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService;
...
@@ -23,6 +23,8 @@ import cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService;
import
cn.iocoder.yudao.module.wealth.util.WealthGenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.util.WealthGenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -545,4 +547,36 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
...
@@ -545,4 +547,36 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
public
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
)
{
public
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
)
{
return
receiptItemMapper
.
getWriteOffAmountByReceiptId
(
receiptId
);
return
receiptItemMapper
.
getWriteOffAmountByReceiptId
(
receiptId
);
}
}
@Override
public
List
<
ReceiptItemBatchRespVO
>
receiptItemImport
(
List
<
ReceiptItemBatchCreateReqVO
>
list
)
{
// TODO 逻辑待完善
// 校验收款账户信息
List
<
ReceiptItemBatchRespVO
>
respVOS
=
validateBatchReceiptAccount
(
list
);
// 插入数据
// 校验收款明细自动审核
// 更新收款单
return
respVOS
;
}
private
List
<
ReceiptItemBatchRespVO
>
validateBatchReceiptAccount
(
List
<
ReceiptItemBatchCreateReqVO
>
list
)
{
// 根据订单号或提单号是否能查到订单
// 根据订单号或提单号匹配状态≠已核销/草稿状态的收款单是否存在,存在多条匹配创建时间最晚的一条
// 根据上条校验,一个收款单存在一条或多条收款数据弹提示
// 收款账号是否存在,是否匹配
// 校验收款金额
// 校验实收金额币种
// 结算币种需为收款单所在目的国结算币种
// 校验当前收款单汇率是否过期,过期则更新为导入的汇率
return
null
;
}
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptAccount/Receipt
Account
BatchCreateReqVO.java
→
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptAccount/Receipt
Item
BatchCreateReqVO.java
View file @
7c732a99
...
@@ -7,7 +7,7 @@ import lombok.Data;
...
@@ -7,7 +7,7 @@ import lombok.Data;
@Data
@Data
@ApiModel
(
"管理后台 - 批量收款信息创建 Request VO"
)
@ApiModel
(
"管理后台 - 批量收款信息创建 Request VO"
)
public
class
Receipt
Account
BatchCreateReqVO
{
public
class
Receipt
Item
BatchCreateReqVO
{
@ApiModelProperty
(
value
=
"订单号/提单号"
)
@ApiModelProperty
(
value
=
"订单号/提单号"
)
@ExcelProperty
(
"订单号/提单号"
)
@ExcelProperty
(
"订单号/提单号"
)
private
String
orderNo
;
private
String
orderNo
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptAccount/Receipt
Account
BatchRespVO.java
→
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptAccount/Receipt
Item
BatchRespVO.java
View file @
7c732a99
...
@@ -6,7 +6,7 @@ import lombok.Data;
...
@@ -6,7 +6,7 @@ import lombok.Data;
@Data
@Data
@ApiModel
(
"管理后台 - 批量导入收款信息结果 VO"
)
@ApiModel
(
"管理后台 - 批量导入收款信息结果 VO"
)
public
class
Receipt
Account
BatchRespVO
{
public
class
Receipt
Item
BatchRespVO
{
@ApiModelProperty
(
value
=
"订单号/提单号"
)
@ApiModelProperty
(
value
=
"订单号/提单号"
)
private
String
orderNo
;
private
String
orderNo
;
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receipt/ReceiptController.java
View file @
7c732a99
...
@@ -10,7 +10,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
...
@@ -10,7 +10,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
cn.iocoder.yudao.framework.common.util.date.DateUtils
;
import
cn.iocoder.yudao.framework.common.util.date.DateUtils
;
import
cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils
;
import
cn.iocoder.yudao.framework.excel.util.ExcelUtils
;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
...
@@ -30,15 +29,12 @@ import cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalSer
...
@@ -30,15 +29,12 @@ import cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalSer
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.*
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptAccountBatchRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptApproval.ReceiptApprovalBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptApproval.ReceiptApprovalBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableQueryVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableQueryVO
;
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
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -48,16 +44,13 @@ import org.apache.poi.xssf.usermodel.XSSFDrawing;
...
@@ -48,16 +44,13 @@ import org.apache.poi.xssf.usermodel.XSSFDrawing;
import
org.apache.poi.xssf.usermodel.XSSFPicture
;
import
org.apache.poi.xssf.usermodel.XSSFPicture
;
import
org.apache.poi.xssf.usermodel.XSSFShape
;
import
org.apache.poi.xssf.usermodel.XSSFShape
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -296,34 +289,6 @@ public class ReceiptController {
...
@@ -296,34 +289,6 @@ public class ReceiptController {
return
success
(
ReceiptAccountConvert
.
INSTANCE
.
convertList
(
list
));
return
success
(
ReceiptAccountConvert
.
INSTANCE
.
convertList
(
list
));
}
}
// TODO 拆分到开票管理
//@GetMapping("/invoicing/info/{id}")
//@ApiOperation("获得收款单开票信息")
//@ApiImplicitParam(name = "id", value = "收款单ID", required = true, example = "1024", dataTypeClass = Long.class)
////@PreAuthorize("@ss.hasPermission('ecw:receipt:query')")
//public CommonResult<ReceiptBackVO> getInvoicingInfo(@PathVariable("id") Long id) {
// ReceiptBackVO receiptBackVO = receiptService.getInvoicingInfo(id);
// return success(receiptBackVO);
//}
/* @GetMapping("/getInvoicingItem")
@ApiOperation("根据收款单ID获取应收明细")
@ApiImplicitParam(name = "id", value = "收款单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<ReceivableBackVO>> getInvoicingItem(@RequestParam("id") Long id) {
LambdaQueryWrapper<ReceivableDO> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(ReceivableDO::getReceiptId, id);
return success(ReceivableConvert.INSTANCE.convertList(receivableService.list(lambdaQueryWrapper)));
}*/
// TODO 拆分到开票管理
//@PutMapping("/invoicing/info")
//@ApiOperation("更新收款单开票信息")
////@PreAuthorize("@ss.hasPermission('ecw:receipt:update')")
//public CommonResult<Boolean> updateInvoicingInfo(@Valid @RequestBody InvoicingUpdateVO invoicingUpdateVO) {
// receiptService.updateInvoicingInfo(invoicingUpdateVO);
// return success(true);
//}
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得收款单列表"
)
@ApiOperation
(
"获得收款单列表"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"编号列表"
,
required
=
true
,
example
=
"1024,2048"
,
dataTypeClass
=
List
.
class
)
...
@@ -361,16 +326,6 @@ public class ReceiptController {
...
@@ -361,16 +326,6 @@ public class ReceiptController {
return
success
(
receiptService
.
batchGenReceipt
(
createReqVOList
));
return
success
(
receiptService
.
batchGenReceipt
(
createReqVOList
));
}
}
@PostMapping
(
value
=
"receipt-account/import"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@ApiOperation
(
"批量银行收款信息导入"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"Excel 文件"
,
required
=
true
,
dataTypeClass
=
MultipartFile
.
class
)
})
public
CommonResult
<
List
<
ReceiptAccountBatchRespVO
>>
receiptAccountImport
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
IOException
{
List
<
ReceiptAccountBatchCreateReqVO
>
list
=
ExcelUtils
.
read
(
file
,
ReceiptAccountBatchCreateReqVO
.
class
);
return
success
(
receiptService
.
receiptAccountImport
(
list
));
}
@GetMapping
(
"/export-excel"
)
@GetMapping
(
"/export-excel"
)
@ApiOperation
(
"导出收款单 Excel"
)
@ApiOperation
(
"导出收款单 Excel"
)
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/ReceiptItemController.java
View file @
7c732a99
...
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.wealth.controller.admin.receiptItem;
...
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.wealth.controller.admin.receiptItem;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.util.collectors.CollectorsUtil
;
import
cn.iocoder.yudao.framework.common.util.collectors.CollectorsUtil
;
import
cn.iocoder.yudao.framework.excel.util.ExcelUtils
;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi
;
import
cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi
;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO
;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO
;
...
@@ -18,18 +19,24 @@ import cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper;
...
@@ -18,18 +19,24 @@ import cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper;
import
cn.iocoder.yudao.module.wealth.service.receiptItem.ReceiptItemService
;
import
cn.iocoder.yudao.module.wealth.service.receiptItem.ReceiptItemService
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemUpdateReqVO
;
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
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.http.MediaType
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -270,4 +277,14 @@ public class ReceiptItemController {
...
@@ -270,4 +277,14 @@ public class ReceiptItemController {
return
success
(
true
);
return
success
(
true
);
}
}
@PostMapping
(
value
=
"/import"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@ApiOperation
(
"批量银行收款信息导入"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"file"
,
value
=
"Excel 文件"
,
required
=
true
,
dataTypeClass
=
MultipartFile
.
class
)
})
public
CommonResult
<
List
<
ReceiptItemBatchRespVO
>>
receiptAccountImport
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
IOException
{
List
<
ReceiptItemBatchCreateReqVO
>
list
=
ExcelUtils
.
read
(
file
,
ReceiptItemBatchCreateReqVO
.
class
);
return
success
(
receiptItemService
.
receiptItemImport
(
list
));
}
}
}
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