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
5b5678a2
Commit
5b5678a2
authored
Jan 03, 2025
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 收款单,银行收款明细
parent
24d94c20
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
266 additions
and
109 deletions
+266
-109
update_old_data.sql
sql/v2.2财务/update_old_data.sql
+21
-2
ReceivableConvert.java
...o/module/wealth/convert/receivable/ReceivableConvert.java
+2
-0
ReceiptItemDO.java
...dule/wealth/dal/dataobject/receiptItem/ReceiptItemDO.java
+4
-0
ReceiptItemWriteOffListener.java
...o/module/wealth/listener/ReceiptItemWriteOffListener.java
+1
-1
ReceiptItemWriteOffEvent.java
...odule/wealth/listener/event/ReceiptItemWriteOffEvent.java
+4
-0
FinanceReceiptApproveService.java
...o/module/wealth/service/FinanceReceiptApproveService.java
+35
-35
ReceiptServiceImpl.java
...dao/module/wealth/service/receipt/ReceiptServiceImpl.java
+7
-5
ReceiptInvoiceServiceImpl.java
...lth/service/receiptInvoice/ReceiptInvoiceServiceImpl.java
+1
-1
ReceiptItemService.java
...module/wealth/service/receiptItem/ReceiptItemService.java
+5
-2
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+71
-45
ReceivableService.java
...o/module/wealth/service/receivable/ReceivableService.java
+3
-0
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+15
-4
ReceiptLogBackVO.java
...oder/yudao/module/wealth/vo/receipt/ReceiptLogBackVO.java
+4
-0
InvoiceInReceiptRespVO.java
...dule/wealth/vo/receiptInvoice/InvoiceInReceiptRespVO.java
+9
-0
ReceiptItemBackVO.java
...yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
+14
-5
ReceiptItemBaseVO.java
...yudao/module/wealth/vo/receiptItem/ReceiptItemBaseVO.java
+2
-0
ReceivableInItemVO.java
...yudao/module/wealth/vo/receivable/ReceivableInItemVO.java
+63
-0
ReceiptItemController.java
...h/controller/admin/receiptItem/ReceiptItemController.java
+5
-9
No files found.
sql/v2.2财务/update_old_data.sql
View file @
5b5678a2
...
@@ -29,4 +29,24 @@ SET approval_time = update_time
...
@@ -29,4 +29,24 @@ SET approval_time = update_time
WHERE
approval_time
IS
NULL
AND
`status`
=
1
;
WHERE
approval_time
IS
NULL
AND
`status`
=
1
;
#
刷新银行明细审核核销币种
#
刷新银行明细审核核销币种
UPDATE
ecw_receipt_item
SET
write_off_currency_id
=
1
WHERE
write_off_currency_id
IS
NULL
UPDATE
ecw_receipt_item
SET
write_off_currency_id
=
1
WHERE
write_off_currency_id
IS
NULL
;
\ No newline at end of file
UPDATE
ecw_receipt
SET
generate_path
=
0
;
#
刷新应收款优惠金额
UPDATE
ecw_receivable
er
SET
er
.
discount_total
=
0
WHERE
er
.
discount_total
IS
NULL
;
#
刷新应收款汇率
UPDATE
ecw_receivable
er
SET
er
.
exchange_rate
=
(
SELECT
eer
.
currency_rate
FROM
ecw_exchange_rate
eer
WHERE
eer
.
source_currency_id
=
er
.
currency_id
AND
eer
.
target_currency_id
=
er
.
base_currency_id
)
WHERE
er
.
exchange_rate
IS
NULL
AND
er
.
receipt_id
IS
NOT
NULL
;
UPDATE
ecw_receivable
er
SET
er
.
exchange_rate
=
1
WHERE
er
.
exchange_rate
IS
NULL
AND
er
.
receipt_id
IS
NOT
NULL
;
#
刷新应收款基准金额
UPDATE
ecw_receivable
er
SET
er
.
base_amount
=
er
.
exchange_rate
*
(
er
.
tax_amount
-
er
.
discount_total
)
WHERE
er
.
base_amount
IS
NULL
AND
er
.
receipt_id
IS
NOT
NULL
AND
er
.
exchange_rate
IS
NOT
NULL
;
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/convert/receivable/ReceivableConvert.java
View file @
5b5678a2
...
@@ -50,4 +50,6 @@ public interface ReceivableConvert {
...
@@ -50,4 +50,6 @@ public interface ReceivableConvert {
* @return
* @return
*/
*/
PageResult
<
ReceivableBackVO
>
convertPage
(
PageResult
<
ReceivableDO
>
page
);
PageResult
<
ReceivableBackVO
>
convertPage
(
PageResult
<
ReceivableDO
>
page
);
List
<
ReceivableInItemVO
>
convertToItemVOList
(
List
<
ReceivableDO
>
receivableDOS
);
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/dataobject/receiptItem/ReceiptItemDO.java
View file @
5b5678a2
...
@@ -104,4 +104,8 @@ public class ReceiptItemDO extends BaseDO {
...
@@ -104,4 +104,8 @@ public class ReceiptItemDO extends BaseDO {
* 审核通过时间
* 审核通过时间
*/
*/
private
Date
approvalTime
;
private
Date
approvalTime
;
/**
* 备注
*/
private
String
remark
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/listener/ReceiptItemWriteOffListener.java
View file @
5b5678a2
...
@@ -19,6 +19,6 @@ public class ReceiptItemWriteOffListener {
...
@@ -19,6 +19,6 @@ public class ReceiptItemWriteOffListener {
*/
*/
@EventListener
(
ReceiptItemWriteOffEvent
.
class
)
@EventListener
(
ReceiptItemWriteOffEvent
.
class
)
public
void
onReceiptItemWriteOff
(
ReceiptItemWriteOffEvent
event
)
{
public
void
onReceiptItemWriteOff
(
ReceiptItemWriteOffEvent
event
)
{
receiptItemService
.
verification
(
event
.
getId
());
receiptItemService
.
verification
(
event
.
getId
()
,
event
.
getBpmResult
()
);
}
}
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/listener/event/ReceiptItemWriteOffEvent.java
View file @
5b5678a2
...
@@ -14,4 +14,8 @@ public class ReceiptItemWriteOffEvent {
...
@@ -14,4 +14,8 @@ public class ReceiptItemWriteOffEvent {
* 主键
* 主键
*/
*/
private
Long
id
;
private
Long
id
;
/**
* 审核结果
*/
private
Integer
bpmResult
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/FinanceReceiptApproveService.java
View file @
5b5678a2
...
@@ -226,41 +226,41 @@ public class FinanceReceiptApproveService {
...
@@ -226,41 +226,41 @@ public class FinanceReceiptApproveService {
receiptMapper
.
updateById
(
updateReceipt
);
receiptMapper
.
updateById
(
updateReceipt
);
}
else
if
(
StrUtil
.
equals
(
WorkFlowEmus
.
FINANCE_RECEIPT_ITEM_WRITE_OFF
.
getKey
(),
bmpKey
))
{
}
else
if
(
StrUtil
.
equals
(
WorkFlowEmus
.
FINANCE_RECEIPT_ITEM_WRITE_OFF
.
getKey
(),
bmpKey
))
{
//收款单明细核销审核
//收款单明细核销审核
if
(
null
==
receiptApprovalDO
.
getReceiptItemId
())
{
//
if (null == receiptApprovalDO.getReceiptItemId()) {
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
//
throw exception(RECEIPT_ITEM_NOT_FOUND);
}
//
}
ReceiptItemDO
receiptItemDO
=
receiptItemMapper
.
selectById
(
receiptApprovalDO
.
getReceiptItemId
());
//
ReceiptItemDO receiptItemDO = receiptItemMapper.selectById(receiptApprovalDO.getReceiptItemId());
if
(
null
==
receiptItemDO
)
{
//
if (null == receiptItemDO) {
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
//
throw exception(RECEIPT_ITEM_NOT_FOUND);
}
//
}
ReceiptItemDO
updateReceiptItem
=
new
ReceiptItemDO
();
//
ReceiptItemDO updateReceiptItem = new ReceiptItemDO();
updateReceiptItem
.
setId
(
receiptItemDO
.
getId
());
//
updateReceiptItem.setId(receiptItemDO.getId());
updateReceiptItem
.
setBmpStatus
(
result
);
//
updateReceiptItem.setBmpStatus(result);
if
(
result
==
BpmProcessInstanceResultEnum
.
APPROVE
.
getResult
())
{
//
if (result == BpmProcessInstanceResultEnum.APPROVE.getResult()) {
updateReceiptItem
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF
.
getValue
());
//
updateReceiptItem.setStatus(ReceiptItemStatusEnum.WRITE_OFF.getValue());
updateReceiptItem
.
setApprovalTime
(
new
Date
());
//
updateReceiptItem.setApprovalTime(new Date());
//判断收款单状态如果是待核销状态-变成部分核销状态,其它 状态不变
//
//判断收款单状态如果是待核销状态-变成部分核销状态,其它 状态不变
ReceiptDO
receiptDO
=
receiptMapper
.
selectById
(
receiptItemDO
.
getReceiptId
());
//
ReceiptDO receiptDO = receiptMapper.selectById(receiptItemDO.getReceiptId());
if
(
null
!=
receiptDO
&&
receiptDO
.
getState
().
equals
(
ReceiptStatusEnum
.
WRITE_OFF_WAITING
.
getValue
()))
{
//
if (null != receiptDO && receiptDO.getState().equals(ReceiptStatusEnum.WRITE_OFF_WAITING.getValue())) {
ReceiptDO
updateReceipt
=
new
ReceiptDO
();
//
ReceiptDO updateReceipt = new ReceiptDO();
updateReceipt
.
setId
(
receiptDO
.
getId
());
//
updateReceipt.setId(receiptDO.getId());
updateReceipt
.
setState
(
ReceiptStatusEnum
.
WRITE_OFF_PART_ING
.
getValue
());
//
updateReceipt.setState(ReceiptStatusEnum.WRITE_OFF_PART_ING.getValue());
receiptMapper
.
updateById
(
updateReceipt
);
//
receiptMapper.updateById(updateReceipt);
//
//更新收该收款单下的应收为收款中状态
//
//更新收该收款单下的应收为收款中状态
LambdaUpdateWrapper
<
ReceivableDO
>
lambdaUpdateWrapper
=
new
LambdaUpdateWrapper
();
//
LambdaUpdateWrapper<ReceivableDO> lambdaUpdateWrapper = new LambdaUpdateWrapper();
lambdaUpdateWrapper
.
eq
(
ReceivableDO:
:
getReceiptId
,
receiptDO
.
getId
());
//
lambdaUpdateWrapper.eq(ReceivableDO::getReceiptId, receiptDO.getId());
lambdaUpdateWrapper
.
set
(
ReceivableDO:
:
getState
,
1
);
//
lambdaUpdateWrapper.set(ReceivableDO::getState, 1);
receivableService
.
update
(
lambdaUpdateWrapper
);
//
receivableService.update(lambdaUpdateWrapper);
}
//
}
receiptService
.
updateReceiptItemStatus
(
receiptItemDO
.
getReceiptId
());
//
receiptService.updateReceiptItemStatus(receiptItemDO.getReceiptId());
}
else
if
(
result
==
BpmProcessInstanceResultEnum
.
REJECT
.
getResult
())
{
//
} else if (result == BpmProcessInstanceResultEnum.REJECT.getResult()) {
updateReceiptItem
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF_APPROVE_REJECT
.
getValue
());
//
updateReceiptItem.setStatus(ReceiptItemStatusEnum.WRITE_OFF_APPROVE_REJECT.getValue());
}
else
if
(
result
==
BpmProcessInstanceResultEnum
.
CANCEL
.
getResult
())
{
//
} else if (result == BpmProcessInstanceResultEnum.CANCEL.getResult()) {
updateReceiptItem
.
setStatus
(
ReceiptItemStatusEnum
.
DRAFT
.
getValue
());
//
updateReceiptItem.setStatus(ReceiptItemStatusEnum.DRAFT.getValue());
}
//
}
receiptItemMapper
.
updateById
(
updateReceiptItem
);
//
receiptItemMapper.updateById(updateReceiptItem);
applicationContext
.
publishEvent
(
new
ReceiptItemWriteOffEvent
(
updateReceiptItem
.
getId
()
));
applicationContext
.
publishEvent
(
new
ReceiptItemWriteOffEvent
(
receiptApprovalDO
.
getId
(),
result
));
}
else
if
(
StrUtil
.
equals
(
WorkFlowEmus
.
FINANCE_RECEIPT_ITEM_WRITE_OFF_NO
.
getKey
(),
bmpKey
))
{
}
else
if
(
StrUtil
.
equals
(
WorkFlowEmus
.
FINANCE_RECEIPT_ITEM_WRITE_OFF_NO
.
getKey
(),
bmpKey
))
{
//收款单明细核销反审核
//收款单明细核销反审核
if
(
null
==
receiptApprovalDO
.
getReceiptItemId
())
{
if
(
null
==
receiptApprovalDO
.
getReceiptItemId
())
{
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receipt/ReceiptServiceImpl.java
View file @
5b5678a2
...
@@ -153,7 +153,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -153,7 +153,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
*/
*/
private
void
createInvoice
(
ReceiptInvoiceCreateReqVO
receiptInvoiceCreateReqVO
,
ReceiptDO
receipt
)
{
private
void
createInvoice
(
ReceiptInvoiceCreateReqVO
receiptInvoiceCreateReqVO
,
ReceiptDO
receipt
)
{
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convertInvoiceCreateReqVO
(
receiptInvoiceCreateReqVO
);
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convertInvoiceCreateReqVO
(
receiptInvoiceCreateReqVO
);
receiptInvoiceDO
.
setApplyUserId
(
SecurityFrameworkUtils
.
getLoginUserId
());
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
receiptInvoiceDO
.
setApplyUserId
(
loginUser
.
getId
());
receiptInvoiceDO
.
setApplyUserName
(
loginUser
.
getUsername
());
receiptInvoiceDO
.
setInvoiceHeader
(
receiptInvoiceCreateReqVO
.
getInvoice
());
receiptInvoiceDO
.
setInvoiceHeader
(
receiptInvoiceCreateReqVO
.
getInvoice
());
receiptInvoiceDO
.
setInvoiceAddress
(
receiptInvoiceCreateReqVO
.
getAddressPhone
());
receiptInvoiceDO
.
setInvoiceAddress
(
receiptInvoiceCreateReqVO
.
getAddressPhone
());
receiptInvoiceDO
.
setInvoiceItem
(
receiptInvoiceCreateReqVO
.
getProjectName
());
receiptInvoiceDO
.
setInvoiceItem
(
receiptInvoiceCreateReqVO
.
getProjectName
());
...
@@ -194,10 +196,6 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -194,10 +196,6 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
receivableDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receivableDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setReceiptId
(
receipt
.
getId
());
receivableDO
.
setState
(
1
);
receivableDO
.
setState
(
1
);
ExchangeRateRespDTO
currencyRate
=
currencyApi
.
getCurrencyRate
(
receipt
.
getCurrencyId
(),
receivableDO
.
getBaseCurrencyId
());
receivableDO
.
setExchangeRate
(
currencyRate
.
getCurrencyRate
());
BigDecimal
actualAmount
=
receivableDO
.
getTaxAmount
().
subtract
(
receivableDO
.
getDiscountTotal
()
==
null
?
BigDecimal
.
ZERO
:
receivableDO
.
getDiscountTotal
());
receivableDO
.
setBaseAmount
(
actualAmount
.
multiply
(
currencyRate
.
getCurrencyRate
()));
return
receivableDO
;
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
receivableService
.
updateBatchById
(
receivableDOList
);
receivableService
.
updateBatchById
(
receivableDOList
);
...
@@ -366,6 +364,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -366,6 +364,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
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
);
// TODO 校验删除的应收明细是否已收款
for
(
ReceivableDO
receivableDO
:
allReceivable
)
{
for
(
ReceivableDO
receivableDO
:
allReceivable
)
{
if
(
receivableUpdateReqVOList
.
stream
().
noneMatch
(
w
->
Objects
.
equals
(
w
.
getId
(),
receivableDO
.
getId
())))
{
if
(
receivableUpdateReqVOList
.
stream
().
noneMatch
(
w
->
Objects
.
equals
(
w
.
getId
(),
receivableDO
.
getId
())))
{
LambdaUpdateWrapper
<
ReceivableDO
>
update
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
ReceivableDO
>
update
=
new
LambdaUpdateWrapper
<>();
...
@@ -1027,6 +1026,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
...
@@ -1027,6 +1026,9 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
if
(
receiptDO
.
getInvoiceId
()
!=
null
)
{
if
(
receiptDO
.
getInvoiceId
()
!=
null
)
{
ReceiptInvoiceDO
receiptInvoiceDO
=
receiptInvoiceMapper
.
selectById
(
receiptDO
.
getInvoiceId
());
ReceiptInvoiceDO
receiptInvoiceDO
=
receiptInvoiceMapper
.
selectById
(
receiptDO
.
getInvoiceId
());
InvoiceInReceiptRespVO
invoiceInReceiptRespVO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convertRespVO
(
receiptInvoiceDO
);
InvoiceInReceiptRespVO
invoiceInReceiptRespVO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convertRespVO
(
receiptInvoiceDO
);
if
(
receiptInvoiceDO
.
getInvoicerId
()
!=
null
)
{
invoiceInReceiptRespVO
.
setInvoicerName
(
adminUserApi
.
getUserName
(
receiptInvoiceDO
.
getInvoicerId
().
toString
()));
}
invoiceInReceiptRespVO
.
setInvoice
(
receiptInvoiceDO
.
getInvoiceHeader
());
invoiceInReceiptRespVO
.
setInvoice
(
receiptInvoiceDO
.
getInvoiceHeader
());
invoiceInReceiptRespVO
.
setAddressPhone
(
receiptInvoiceDO
.
getInvoiceAddress
());
invoiceInReceiptRespVO
.
setAddressPhone
(
receiptInvoiceDO
.
getInvoiceAddress
());
invoiceInReceiptRespVO
.
setProjectName
(
receiptInvoiceDO
.
getInvoiceItem
());
invoiceInReceiptRespVO
.
setProjectName
(
receiptInvoiceDO
.
getInvoiceItem
());
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptInvoice/ReceiptInvoiceServiceImpl.java
View file @
5b5678a2
...
@@ -273,7 +273,7 @@ public class ReceiptInvoiceServiceImpl extends AbstractService<ReceiptInvoiceMap
...
@@ -273,7 +273,7 @@ public class ReceiptInvoiceServiceImpl extends AbstractService<ReceiptInvoiceMap
receiptDO
.
setInvoicingStatus
(
CANCELLED
.
getValue
());
receiptDO
.
setInvoicingStatus
(
CANCELLED
.
getValue
());
receiptMapper
.
updateById
(
receiptDO
);
receiptMapper
.
updateById
(
receiptDO
);
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
receiptInvoiceDO
.
set
Apply
UserId
(
loginUser
.
getId
());
receiptInvoiceDO
.
set
Cancel
UserId
(
loginUser
.
getId
());
receiptInvoiceDO
.
setCancelTime
(
new
Date
());
receiptInvoiceDO
.
setCancelTime
(
new
Date
());
receiptInvoiceMapper
.
updateById
(
receiptInvoiceDO
);
receiptInvoiceMapper
.
updateById
(
receiptInvoiceDO
);
recordLog
(
receiptInvoiceDO
.
getId
(),
InvoicingLinkEnum
.
CANCEL_INVOICE
,
reqVO
.
getRemark
(),
null
);
recordLog
(
receiptInvoiceDO
.
getId
(),
InvoicingLinkEnum
.
CANCEL_INVOICE
,
reqVO
.
getRemark
(),
null
);
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemService.java
View file @
5b5678a2
...
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo;
...
@@ -6,6 +6,7 @@ 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.ReceiptItemBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchRespVO
;
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.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
;
...
@@ -62,11 +63,11 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
...
@@ -62,11 +63,11 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
/**
/**
*
核销
*
处理审批结果
*
*
* @param id
* @param id
*/
*/
void
verification
(
Long
id
);
void
verification
(
Long
id
,
Integer
bpmResult
);
/**
/**
* 批量核销
* 批量核销
...
@@ -123,4 +124,6 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
...
@@ -123,4 +124,6 @@ public interface ReceiptItemService extends IService<ReceiptItemDO> {
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
);
BigDecimal
getWriteOffAmountByReceiptId
(
Long
receiptId
);
List
<
ReceiptItemBatchRespVO
>
receiptItemImport
(
List
<
ReceiptItemBatchCreateReqVO
>
list
,
Boolean
ignoreItem
);
List
<
ReceiptItemBatchRespVO
>
receiptItemImport
(
List
<
ReceiptItemBatchCreateReqVO
>
list
,
Boolean
ignoreItem
);
ReceiptItemBackVO
getReceiptItemDetail
(
Long
id
);
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
5b5678a2
...
@@ -16,10 +16,13 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
...
@@ -16,10 +16,13 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO
;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO
;
import
cn.iocoder.yudao.module.system.api.dict.DictDataApi
;
import
cn.iocoder.yudao.module.system.api.dict.DictDataApi
;
import
cn.iocoder.yudao.module.wealth.convert.receiptItem.ReceiptItemConvert
;
import
cn.iocoder.yudao.module.wealth.convert.receiptItem.ReceiptItemConvert
;
import
cn.iocoder.yudao.module.wealth.convert.receivable.ReceivableConvert
;
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.dal.dataobject.receiptApproval.ReceiptApprovalDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptApproval.ReceiptApprovalDO
;
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.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableWriteOffRecord
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusEnum
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusEnum
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptLinkEnum
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptLinkEnum
;
...
@@ -32,8 +35,10 @@ import cn.iocoder.yudao.module.wealth.vo.receipt.FinanceReceiptItemCancelVo;
...
@@ -32,8 +35,10 @@ 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.ReceiptItemBatchCreateReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptAccount.ReceiptItemBatchRespVO
;
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.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
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableInItemVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableWriteOffReqVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableWriteOffReqVO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
@@ -71,6 +76,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
...
@@ -71,6 +76,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
@Resource
@Resource
private
ReceiptService
receiptService
;
private
ReceiptService
receiptService
;
@Resource
@Resource
private
ReceiptMapper
receiptMapper
;
@Resource
private
ReceivableService
receivableService
;
private
ReceivableService
receivableService
;
@Resource
@Resource
private
DictDataApi
dictDataApi
;
private
DictDataApi
dictDataApi
;
...
@@ -199,58 +206,57 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
...
@@ -199,58 +206,57 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
verification
(
Long
id
)
{
public
void
verification
(
Long
id
,
Integer
bpmResult
)
{
ReceiptItemDO
receiptItemDO
=
this
.
getReceiptItem
(
id
);
//收款单明细核销审核
if
(
receiptItemDO
==
null
)
{
if
(
null
==
id
)
{
throw
exception
(
RECEIPTITEM_NOT_EXISTS
);
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
}
ReceiptItemDO
receiptItemDO
=
receiptItemMapper
.
selectById
(
id
);
if
(
null
==
receiptItemDO
)
{
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
}
}
if
(
receiptItemDO
.
getStatus
()
!=
0
)
{
if
(
receiptItemDO
.
getStatus
()
!=
0
)
{
throw
exception
(
RECEIPTITEM_VERIFICATION
);
throw
exception
(
RECEIPTITEM_VERIFICATION
);
}
}
receiptItemDO
.
setBmpStatus
(
bpmResult
);
// 核销通过
if
(
Objects
.
equals
(
bpmResult
,
BpmProcessInstanceResultEnum
.
APPROVE
.
getResult
()))
{
receiptItemDO
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF
.
getValue
());
receiptItemDO
.
setApprovalTime
(
new
Date
());
ReceiptItemDO
updateReceiptItemDO
=
new
ReceiptItemDO
();
// 更新收款单
updateReceiptItemDO
.
setId
(
receiptItemDO
.
getId
());
ReceiptDO
receiptDO
=
receiptMapper
.
selectById
(
receiptItemDO
.
getReceiptId
());
updateReceiptItemDO
.
setStatus
(
1
);
//判断收款单状态如果是待核销状态-变成部分核销状态,其它 状态不变
this
.
updateById
(
updateReceiptItemDO
);
if
(
null
!=
receiptDO
&&
receiptDO
.
getState
().
equals
(
ReceiptStatusEnum
.
WRITE_OFF_WAITING
.
getValue
()))
{
receiptDO
.
setState
(
ReceiptStatusEnum
.
WRITE_OFF_PART_ING
.
getValue
());
if
(
null
==
receiptItemDO
.
getReceiptId
())
{
throw
exception
(
RECEIPT_NOT_EXISTS
);
}
}
// TODO 是否更新核销金额,核销比例
ReceiptDO
receiptDO
=
receiptService
.
getById
(
receiptItemDO
.
getReceip
tId
());
BigDecimal
writeOffAmount
=
receiptItemMapper
.
getWriteOffAmountByReceiptId
(
receiptDO
.
ge
tId
());
if
(
null
==
receiptDO
)
{
if
(
null
!=
receiptDO
.
getReceivableTotalAmount
()
&&
receiptDO
.
getReceivableTotalAmount
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
throw
exception
(
RECEIPT_NOT_EXISTS
);
receiptDO
.
setWriteOffProportion
(
writeOffAmount
.
divide
(
receiptDO
.
getReceivableTotalAmount
(),
8
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
6
,
BigDecimal
.
ROUND_HALF_UP
)
);
}
}
receiptService
.
updateById
(
receiptDO
);
if
(
receiptDO
.
getState
()
==
0
)
{
//更新应收明细
throw
exception
(
RECEIPT_STATUS_NOT_WRITE_OFF
);
List
<
ReceivableDO
>
receivableDOS
=
receivableService
.
selectList
(
"receipt_id"
,
receiptItemDO
.
getReceiptId
());
for
(
ReceivableDO
receivableDO
:
receivableDOS
)
{
receivableDO
.
setState
(
1
);
ReceivableWriteOffRecord
receivableWriteOffRecord
=
receivableService
.
getReceivableWriteOffRecord
(
receivableDO
.
getId
(),
receiptItemDO
.
getId
());
if
(
null
!=
receivableWriteOffRecord
)
{
receivableDO
.
setWriteOffAmount
(
receivableDO
.
getWriteOffAmount
().
add
(
receivableWriteOffRecord
.
getWriteOffAmount
()));
}
}
//设置应收明细为收款中
LambdaUpdateWrapper
<
ReceivableDO
>
lambdaReceivableUpdateWrapper
=
new
LambdaUpdateWrapper
();
lambdaReceivableUpdateWrapper
.
set
(
ReceivableDO:
:
getState
,
1
);
lambdaReceivableUpdateWrapper
.
eq
(
ReceivableDO:
:
getReceiptId
,
receiptDO
.
getId
());
lambdaReceivableUpdateWrapper
.
eq
(
ReceivableDO:
:
getState
,
0
);
receivableService
.
update
(
lambdaReceivableUpdateWrapper
);
//需要计算出核销比例
BigDecimal
writeOffAmount
=
receiptItemMapper
.
getWriteOffAmountByReceiptId
(
receiptDO
.
getId
());
ReceiptDO
updateReceiptDO
=
new
ReceiptDO
();
updateReceiptDO
.
setId
(
receiptDO
.
getId
());
//需要计算出核销比例
if
(
receiptDO
.
getState
()
==
2
)
{
updateReceiptDO
.
setState
(
3
);
}
}
receivableService
.
updateBatchById
(
receivableDOS
);
if
(
null
!=
receiptDO
.
getReceivableTotalAmount
()
&&
receiptDO
.
getReceivableTotalAmount
().
compareTo
(
BigDecimal
.
ZERO
)
==
1
)
{
receiptService
.
updateReceiptItemStatus
(
receiptItemDO
.
getReceiptId
());
updateReceiptDO
.
setWriteOffProportion
(
writeOffAmount
.
divide
(
receiptDO
.
getReceivableTotalAmount
(),
8
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
)).
setScale
(
6
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
// 审核拒绝
receiptService
.
updateById
(
updateReceiptDO
);
else
if
(
Objects
.
equals
(
bpmResult
,
BpmProcessInstanceResultEnum
.
REJECT
.
getResult
()))
{
receiptItemDO
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF_APPROVE_REJECT
.
getValue
());
}
// 取消审核
else
if
(
Objects
.
equals
(
bpmResult
,
BpmProcessInstanceResultEnum
.
CANCEL
.
getResult
()))
{
receiptItemDO
.
setStatus
(
ReceiptItemStatusEnum
.
DRAFT
.
getValue
());
}
receiptItemMapper
.
updateById
(
receiptItemDO
);
}
}
@Override
@Override
...
@@ -590,6 +596,26 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
...
@@ -590,6 +596,26 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
return
respVOS
;
return
respVOS
;
}
}
@Override
public
ReceiptItemBackVO
getReceiptItemDetail
(
Long
id
)
{
ReceiptItemDO
receiptItemDO
=
receiptItemMapper
.
selectById
(
id
);
if
(
null
==
receiptItemDO
)
{
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
}
ReceiptItemBackVO
itemBackVO
=
ReceiptItemConvert
.
INSTANCE
.
convert
(
receiptItemDO
);
List
<
ReceivableDO
>
receivableDOS
=
receivableService
.
selectList
(
"receipt_id"
,
itemBackVO
.
getReceiptId
());
List
<
ReceivableInItemVO
>
receivableInItemVOS
=
ReceivableConvert
.
INSTANCE
.
convertToItemVOList
(
receivableDOS
);
for
(
ReceivableInItemVO
receivableInItemVO
:
receivableInItemVOS
)
{
ReceivableWriteOffRecord
receivableWriteOffRecord
=
receivableService
.
getReceivableWriteOffRecord
(
receivableInItemVO
.
getId
(),
id
);
if
(
null
==
receivableWriteOffRecord
)
{
receivableInItemVO
.
setWriteOffInCurrentItem
(
BigDecimal
.
ZERO
);
}
receivableInItemVO
.
setWriteOffInCurrentItem
(
receivableWriteOffRecord
.
getWriteOffAmount
());
}
itemBackVO
.
setReceivableList
(
receivableInItemVOS
);
return
itemBackVO
;
}
private
ReceiptItemBatchRespVO
validateBatchReceiptItem
(
ReceiptItemBatchCreateReqVO
batchCreateReqVO
,
Boolean
ignoreItem
,
ArrayList
<
ReceiptItemCreateReqVO
>
receiptItemCreateReqVOS
)
{
private
ReceiptItemBatchRespVO
validateBatchReceiptItem
(
ReceiptItemBatchCreateReqVO
batchCreateReqVO
,
Boolean
ignoreItem
,
ArrayList
<
ReceiptItemCreateReqVO
>
receiptItemCreateReqVOS
)
{
// 校验单个字段合法性
// 校验单个字段合法性
ReceiptItemBatchRespVO
commonFieldRes
=
validateBatchReceiptItemCommonField
(
batchCreateReqVO
);
ReceiptItemBatchRespVO
commonFieldRes
=
validateBatchReceiptItemCommonField
(
batchCreateReqVO
);
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableService.java
View file @
5b5678a2
...
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.service.IService;
...
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
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.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableWriteOffRecord
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.*
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.*
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
...
@@ -271,4 +272,6 @@ public interface ReceivableService extends IService<ReceivableDO> {
...
@@ -271,4 +272,6 @@ public interface ReceivableService extends IService<ReceivableDO> {
Long
getDestCountryCurrencyId
(
Long
orderId
);
Long
getDestCountryCurrencyId
(
Long
orderId
);
void
createWriteOffRecord
(
ReceivableWriteOffReqVO
receivableWriteOffReqVO
,
ReceiptItemDO
receiptItem
);
void
createWriteOffRecord
(
ReceivableWriteOffReqVO
receivableWriteOffReqVO
,
ReceiptItemDO
receiptItem
);
ReceivableWriteOffRecord
getReceivableWriteOffRecord
(
Long
receivableId
,
Long
receiptItemId
);
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
5b5678a2
...
@@ -313,10 +313,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
...
@@ -313,10 +313,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivableBackVO
.
setWriteOffAmount
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setWriteOffAmount
(
BigDecimal
.
ZERO
);
}
}
receivableBackVO
.
setNotWriteOffAmount
(
receivableBackVO
.
getActualAmount
().
subtract
(
receivableBackVO
.
getWriteOffAmount
()));
receivableBackVO
.
setNotWriteOffAmount
(
receivableBackVO
.
getActualAmount
().
subtract
(
receivableBackVO
.
getWriteOffAmount
()));
// TODO 核销/未核销美元暂时默认为0,待计算
if
(
receivableBackVO
.
getExchangeRate
()
!=
null
)
{
receivableBackVO
.
setWriteOffAmountUsd
(
receivableBackVO
.
getWriteOffAmount
().
multiply
(
receivableBackVO
.
getExchangeRate
()));
receivableBackVO
.
setNotWriteOffAmountUsd
(
receivableBackVO
.
getNotWriteOffAmount
().
multiply
(
receivableBackVO
.
getExchangeRate
()));
}
else
{
receivableBackVO
.
setWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setNotWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setNotWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
}
if
(
receivableBackVO
.
getBaseAmount
()
==
null
)
{
receivableBackVO
.
setBaseAmount
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setBaseAmount
(
BigDecimal
.
ZERO
);
}
// 核销比例 = 已核销金额 / 实际金额,保留两位小数字符串
// 核销比例 = 已核销金额 / 实际金额,保留两位小数字符串
receivableBackVO
.
setWriteOffProportion
(
receivableBackVO
.
getWriteOffAmount
().
divide
(
receivableBackVO
.
getActualAmount
(),
2
,
RoundingMode
.
HALF_UP
).
toString
());
receivableBackVO
.
setWriteOffProportion
(
receivableBackVO
.
getWriteOffAmount
().
divide
(
receivableBackVO
.
getActualAmount
(),
2
,
RoundingMode
.
HALF_UP
).
toString
());
});
});
...
@@ -584,4 +590,9 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
...
@@ -584,4 +590,9 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
.
build
();
.
build
();
receivableWriteOffRecordMapper
.
insert
(
writeOffRecord
);
receivableWriteOffRecordMapper
.
insert
(
writeOffRecord
);
}
}
@Override
public
ReceivableWriteOffRecord
getReceivableWriteOffRecord
(
Long
receivableId
,
Long
receiptItemId
)
{
return
receivableWriteOffRecordMapper
.
selectOne
(
"receivable_id"
,
receivableId
,
"receipt_item_id"
,
receiptItemId
);
}
}
}
\ No newline at end of file
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receipt/ReceiptLogBackVO.java
View file @
5b5678a2
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receipt
;
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receipt
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
...
@@ -8,6 +9,8 @@ import lombok.NoArgsConstructor;
...
@@ -8,6 +9,8 @@ import lombok.NoArgsConstructor;
import
java.util.Date
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Data
@Data
@Builder
@Builder
@NoArgsConstructor
@NoArgsConstructor
...
@@ -33,6 +36,7 @@ public class ReceiptLogBackVO {
...
@@ -33,6 +36,7 @@ public class ReceiptLogBackVO {
private
String
bpmStatus
;
private
String
bpmStatus
;
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
createTime
;
private
Date
createTime
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptInvoice/InvoiceInReceiptRespVO.java
View file @
5b5678a2
...
@@ -23,6 +23,12 @@ public class InvoiceInReceiptRespVO {
...
@@ -23,6 +23,12 @@ public class InvoiceInReceiptRespVO {
@ApiModelProperty
(
value
=
"纳税人识别号"
)
@ApiModelProperty
(
value
=
"纳税人识别号"
)
private
String
taxpayer
;
private
String
taxpayer
;
@ApiModelProperty
(
value
=
"开户行"
)
private
String
accountBank
;
@ApiModelProperty
(
value
=
"开户账号"
)
private
String
accountName
;
@ApiModelProperty
(
value
=
"税率"
)
@ApiModelProperty
(
value
=
"税率"
)
private
java
.
math
.
BigDecimal
taxRate
;
private
java
.
math
.
BigDecimal
taxRate
;
...
@@ -50,6 +56,9 @@ public class InvoiceInReceiptRespVO {
...
@@ -50,6 +56,9 @@ public class InvoiceInReceiptRespVO {
@ApiModelProperty
(
value
=
"开发票人id"
)
@ApiModelProperty
(
value
=
"开发票人id"
)
private
Long
invoicerId
;
private
Long
invoicerId
;
@ApiModelProperty
(
value
=
"开发票人"
)
private
String
invoicerName
;
@ApiModelProperty
(
value
=
"开票时间"
)
@ApiModelProperty
(
value
=
"开票时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
invoiceTime
;
private
Date
invoiceTime
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
View file @
5b5678a2
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptItem
;
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptItem
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableInItemVO
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.annotations.*
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
@@ -123,4 +126,10 @@ public class ReceiptItemBackVO {
...
@@ -123,4 +126,10 @@ public class ReceiptItemBackVO {
@ApiModelProperty
(
value
=
"审核通过时间"
)
@ApiModelProperty
(
value
=
"审核通过时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
approvalTime
;
private
Date
approvalTime
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"收款明细列表"
)
private
List
<
ReceivableInItemVO
>
receivableList
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemBaseVO.java
View file @
5b5678a2
...
@@ -67,4 +67,6 @@ public class ReceiptItemBaseVO {
...
@@ -67,4 +67,6 @@ public class ReceiptItemBaseVO {
@ApiModelProperty
(
value
=
"核销金额"
)
@ApiModelProperty
(
value
=
"核销金额"
)
private
java
.
math
.
BigDecimal
writeOffAmount
;
private
java
.
math
.
BigDecimal
writeOffAmount
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableInItemVO.java
0 → 100644
View file @
5b5678a2
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receivable
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* 银行收款明细中的应收明细 Response VO
*/
@Data
@ApiModel
(
"管理后台 - 银行收款明细中的应收明细 Response VO"
)
public
class
ReceivableInItemVO
{
@ApiModelProperty
(
value
=
"主键"
,
required
=
true
)
private
Long
id
;
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
@ApiModelProperty
(
value
=
"费用类型(字典 receivable_fee_type)"
)
private
Integer
feeType
;
@ApiModelProperty
(
value
=
"汇率"
)
private
BigDecimal
exchangeRate
;
@ApiModelProperty
(
value
=
"货币id"
)
private
Long
currencyId
;
@ApiModelProperty
(
value
=
"总金额"
)
private
BigDecimal
totalAmount
;
@ApiModelProperty
(
value
=
"收款状态(0未收款,1收款中,2已收款)"
)
private
Integer
state
;
@ApiModelProperty
(
value
=
"费用来源:1 订单计算 2 费用申请 3 特需费用"
)
private
Integer
feeSource
;
@ApiModelProperty
(
value
=
"未核销金额"
)
private
BigDecimal
notWriteOffAmount
;
@ApiModelProperty
(
value
=
"核销比例"
)
private
String
writeOffProportion
;
@ApiModelProperty
(
value
=
"基准金额"
)
private
BigDecimal
baseAmount
;
@ApiModelProperty
(
value
=
"实际金额"
)
private
BigDecimal
actualAmount
;
@ApiModelProperty
(
value
=
"核销金额"
)
private
BigDecimal
writeOffAmountUsd
;
@ApiModelProperty
(
value
=
"未核销金额"
)
private
BigDecimal
notWriteOffAmountUsd
;
@ApiModelProperty
(
value
=
"基准币种id"
)
private
Long
baseCurrencyId
;
@ApiModelProperty
(
value
=
"本次核销金额"
)
private
BigDecimal
writeOffInCurrentItem
;
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/ReceiptItemController.java
View file @
5b5678a2
...
@@ -95,15 +95,11 @@ public class ReceiptItemController {
...
@@ -95,15 +95,11 @@ public class ReceiptItemController {
@GetMapping
(
"/get"
)
@GetMapping
(
"/get"
)
@ApiOperation
(
"获得收款明细详情"
)
@ApiOperation
(
"获得收款明细详情"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
ReceiptItemBackVO
>
getReceiptItem
(
@RequestParam
(
"id"
)
Long
id
)
{
public
CommonResult
<
ReceiptItemBackVO
>
getReceiptItemDetail
(
@RequestParam
(
"id"
)
Long
id
)
{
ReceiptItemDO
receiptItem
=
receiptItemService
.
getReceiptItem
(
id
);
ReceiptItemBackVO
receiptItemVO
=
receiptItemService
.
getReceiptItemDetail
(
id
);
ReceiptItemBackVO
v
=
ReceiptItemConvert
.
INSTANCE
.
convert
(
receiptItem
);
getSY
(
receiptItemVO
,
receiptItemVO
.
getReceiptId
());
//计算剩余金额
SetData
(
receiptItemVO
);
//BigDecimal p = receiptItemService.getWriteOffAmountByReceiptId(id);
return
success
(
receiptItemVO
);
//BigDecimal t = receiptAccountMapper.getWriteOffAmountByReceiptId(id);
getSY
(
v
,
v
.
getReceiptId
());
SetData
(
v
);
return
success
(
v
);
}
}
private
void
SetData
(
ReceiptItemBackVO
v
)
{
private
void
SetData
(
ReceiptItemBackVO
v
)
{
...
...
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