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
f9445154
Commit
f9445154
authored
Jan 07, 2025
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 创建/批量创建银行收款明细
parent
7cf76af0
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
32 deletions
+102
-32
20250106.sql
sql/v2.2财务/20250106.sql
+4
-4
ReceivableDO.java
...module/wealth/dal/dataobject/receivable/ReceivableDO.java
+5
-0
ErrorCodeConstants.java
...iocoder/yudao/module/wealth/enums/ErrorCodeConstants.java
+2
-0
FinanceReceiptApproveService.java
...o/module/wealth/service/FinanceReceiptApproveService.java
+14
-0
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+50
-22
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+7
-0
ReceiptItemBatchCreateReqVO.java
...wealth/vo/receiptAccount/ReceiptItemBatchCreateReqVO.java
+15
-0
ReceivableInItemVO.java
...yudao/module/wealth/vo/receivable/ReceivableInItemVO.java
+3
-0
ReceiptItemController.java
...h/controller/admin/receiptItem/ReceiptItemController.java
+2
-6
No files found.
sql/v2.2财务/20250106.sql
View file @
f9445154
...
...
@@ -120,13 +120,13 @@ CREATE TABLE `jiedao`.`ecw_receipt_log` (
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
COMMENT
=
'收款单日志'
ROW_FORMAT
=
DYNAMIC
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
COLUMN
`write_off_amount`
decimal
(
10
,
2
)
NOT
NULL
COMMENT
'核销金额'
AFTER
`remark`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
COLUMN
`base_amount`
decimal
(
10
,
2
)
NULL
DEFAULT
NULL
COMMENT
'基准金额'
AFTER
`write_off_amount`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
COLUMN
`base_amount`
decimal
(
15
,
2
)
NULL
DEFAULT
NULL
COMMENT
'基准金额'
AFTER
`remark`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
COLUMN
`base_currency_id`
int
NULL
DEFAULT
NULL
COMMENT
'基准币种'
AFTER
`base_amount`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
MODIFY
COLUMN
`exchange_rate`
decimal
(
10
,
6
)
NULL
DEFAULT
NULL
COMMENT
'汇率'
AFTER
`fee_type`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
COLUMN
`write_off_amount`
decimal
(
15
,
2
)
NOT
NULL
DEFAULT
0
.
00
COMMENT
'核销金额'
AFTER
`base_currency_id`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
MODIFY
COLUMN
`exchange_rate`
decimal
(
15
,
6
)
NULL
DEFAULT
NULL
COMMENT
'汇率'
AFTER
`fee_type`
;
ALTER
TABLE
`jiedao`
.
`ecw_receivable`
ADD
INDEX
`key_receipt_id`
(
`deleted`
ASC
,
`receipt_id`
ASC
)
USING
BTREE
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/dataobject/receivable/ReceivableDO.java
View file @
f9445154
...
...
@@ -160,6 +160,11 @@ public class ReceivableDO extends BaseDO {
* 核销金额
*/
private
BigDecimal
writeOffAmount
;
/**
* 基准核销金额
*/
@TableField
(
exist
=
false
)
private
BigDecimal
writeOffBaseAmount
;
/**
* 基准金额
*/
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/enums/ErrorCodeConstants.java
View file @
f9445154
...
...
@@ -111,4 +111,6 @@ public interface ErrorCodeConstants {
ErrorCode
RECEIVABLE_WRITE_OFF_ING_NO_NEED_TO_PACK
=
new
ErrorCode
(
1004520038
,
"wealth.receivable_write_off_ing_no_need_to_pack"
);
ErrorCode
RECEIPT_ITEM_RECEIVABLE_WRITE_OFF_LIST_EMPTY
=
new
ErrorCode
(
1004520041
,
"收款明细对应的应收明细核销记录为空"
);
ErrorCode
RECEIPT_ITEM_BATCH_ERROR
=
new
ErrorCode
(
1004520042
,
"批量导入收款明细存在错误"
);
ErrorCode
RECEIPT_ITEM_BATCH_WARN
=
new
ErrorCode
(
1004520043
,
"批量导入收款明细存在警告"
);
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/FinanceReceiptApproveService.java
View file @
f9445154
...
...
@@ -9,6 +9,7 @@ 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.receiptItem.ReceiptItemDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableWriteOffRecordDO
;
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.enums.ReceiptItemStatusEnum
;
...
...
@@ -288,6 +289,19 @@ public class FinanceReceiptApproveService {
updateReceipt
.
setState
(
ReceiptStatusEnum
.
WRITE_OFF_PART_ING
.
getValue
());
}
receiptMapper
.
updateById
(
updateReceipt
);
// 将应收明细的核销状态和核销金额重置
List
<
ReceivableDO
>
receivableDOS
=
receivableService
.
selectList
(
"receipt_id"
,
receiptItemDO
.
getReceiptId
());
for
(
ReceivableDO
receivableDO
:
receivableDOS
)
{
ReceivableWriteOffRecordDO
receivableWriteOffRecordDO
=
receivableService
.
getReceivableWriteOffRecord
(
receivableDO
.
getId
(),
receiptItemDO
.
getId
());
if
(
null
!=
receivableWriteOffRecordDO
)
{
BigDecimal
writeOffCurrent
=
receivableWriteOffRecordDO
.
getWriteOffAmount
().
divide
(
receivableDO
.
getExchangeRate
());
receivableDO
.
setWriteOffAmount
(
receivableDO
.
getWriteOffAmount
().
subtract
(
writeOffCurrent
));
}
if
(
receivableDO
.
getWriteOffAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
receivableDO
.
setState
(
0
);
}
}
receivableService
.
updateBatchById
(
receivableDOS
);
receiptService
.
updateReceiptItemStatus
(
receiptItemDO
.
getReceiptId
());
}
else
if
(
result
==
BpmProcessInstanceResultEnum
.
REJECT
.
getResult
())
{
updateReceiptItem
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF
.
getValue
());
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
f9445154
This diff is collapsed.
Click to expand it.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
f9445154
...
...
@@ -630,6 +630,13 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
}
else
{
receivableInItemVO
.
setWriteOffAmount
(
receivableWriteOffRecordDO
.
getWriteOffAmount
());
}
BigDecimal
totalWriteOffAmount
=
receivableWriteOffRecordMapper
.
getTotalAmountForReceivable
(
receivableInItemVO
.
getId
());
if
(
totalWriteOffAmount
==
null
)
{
receivableInItemVO
.
setWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
}
else
{
receivableInItemVO
.
setWriteOffAmountUsd
(
totalWriteOffAmount
.
subtract
(
receivableInItemVO
.
getWriteOffAmount
()));
}
receivableInItemVO
.
setNotWriteOffAmountUsd
(
receivableInItemVO
.
getBaseAmount
().
subtract
(
receivableInItemVO
.
getWriteOffAmountUsd
()));
}
return
receivableInItemVOS
;
}
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptAccount/ReceiptItemBatchCreateReqVO.java
View file @
f9445154
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptAccount
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
@Data
@Builder
@ApiModel
(
"管理后台 - 批量收款信息创建 Request VO"
)
@NoArgsConstructor
@AllArgsConstructor
@Accessors
(
chain
=
false
)
public
class
ReceiptItemBatchCreateReqVO
{
@ApiModelProperty
(
value
=
"订单号/提单号"
)
@ExcelProperty
(
"订单号/提单号"
)
...
...
@@ -53,4 +60,12 @@ public class ReceiptItemBatchCreateReqVO {
@ApiModelProperty
(
value
=
"备注"
)
@ExcelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"收款账号名称"
)
@ExcelIgnore
private
String
accountName
;
@ApiModelProperty
(
value
=
"收款账号银行名称"
)
@ExcelIgnore
private
String
accountBankName
;
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableInItemVO.java
View file @
f9445154
...
...
@@ -16,6 +16,9 @@ public class ReceivableInItemVO {
@ApiModelProperty
(
value
=
"主键"
,
required
=
true
)
private
Long
id
;
@ApiModelProperty
(
value
=
"流水号"
)
private
String
serialNumber
;
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/ReceiptItemController.java
View file @
f9445154
...
...
@@ -299,17 +299,13 @@ public class ReceiptItemController {
.
remark
(
"非必填"
)
.
build
());
// 输出
ExcelUtils
.
write
(
response
,
"批量银行收款信息导入模板.xls"
,
"银行收款信息"
,
ReceiptItemBatchCreateReqVO
.
class
,
list
);
ExcelUtils
.
write
(
response
,
"批量银行收款信息导入模板.xls
x
"
,
"银行收款信息"
,
ReceiptItemBatchCreateReqVO
.
class
,
list
);
}
@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
,
@RequestParam
(
value
=
"ignoreItem"
)
Boolean
ignoreItem
)
throws
IOException
{
public
CommonResult
<
List
<
ReceiptItemBatchRespVO
>>
receiptAccountImport
(
@RequestPart
(
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"ignoreItem"
)
Boolean
ignoreItem
)
throws
IOException
{
List
<
ReceiptItemBatchCreateReqVO
>
list
=
ExcelUtils
.
read
(
file
,
ReceiptItemBatchCreateReqVO
.
class
);
return
success
(
receiptItemService
.
receiptItemImport
(
list
,
ignoreItem
));
}
}
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