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
44d7f643
Commit
44d7f643
authored
Jan 07, 2025
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 银行收支明细(未联调)
parent
ece88681
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
162 additions
and
66 deletions
+162
-66
BankReceiptDetailsMapper.java
...ealth/dal/mysql/receiptItem/BankReceiptDetailsMapper.java
+6
-5
BankReceiptDetailsImpl.java
...le/wealth/service/receiptItem/BankReceiptDetailsImpl.java
+9
-8
BankReceiptDetailsService.java
...wealth/service/receiptItem/BankReceiptDetailsService.java
+2
-5
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+3
-0
BankIncomeItemResp.java
...udao/module/wealth/vo/receiptItem/BankIncomeItemResp.java
+7
-25
BankIncomePageResult.java
...ao/module/wealth/vo/receiptItem/BankIncomePageResult.java
+83
-0
ReceiptItemBackVO.java
...yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
+3
-0
BankReceiptDetailsControl.java
...ntroller/admin/receiptItem/BankReceiptDetailsControl.java
+4
-9
BankReceiptDetailsMapper.xml
...resources/mapper/ReceiptItem/BankReceiptDetailsMapper.xml
+45
-14
No files found.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/mysql/receiptItem/BankReceiptDetailsMapper.java
View file @
44d7f643
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
dal
.
mysql
.
receiptItem
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemResp
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.*
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -17,7 +14,11 @@ public interface BankReceiptDetailsMapper {
long
GetCount
(
ReceiptItemReq
req
);
void
getBankIncomeItemPage
(
IPage
<
BankIncomeItemResp
>
page
,
@Param
(
"req"
)
BankIncomeItemReq
req
);
IPage
<
BankIncomeItemResp
>
getBankIncomeItemPage
(
IPage
<
BankIncomeItemResp
>
page
,
@Param
(
"req"
)
BankIncomeItemReq
req
);
BigDecimal
calculateAccountBalance
(
String
accountNo
);
List
<
ReceiptItemActualAmount
>
calculateCurrentAmount
(
@Param
(
"req"
)
BankIncomeItemReq
req
);
List
<
ReceiptItemActualAmount
>
calculateTotalAmount
();
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/BankReceiptDetailsImpl.java
View file @
44d7f643
...
...
@@ -8,10 +8,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.BankReceiptDetailsMapper
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemResp
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.*
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -72,11 +69,11 @@ public class BankReceiptDetailsImpl implements BankReceiptDetailsService {
}
@Override
public
PageResult
<
BankIncomeItemResp
>
getBankIncomeItemPage
(
BankIncomeItemReq
req
)
{
public
BankIncome
PageResult
<
BankIncomeItemResp
>
getBankIncomeItemPage
(
BankIncomeItemReq
req
)
{
IPage
<
BankIncomeItemResp
>
mpPage
=
MyBatisUtils
.
buildPage
(
req
);
bankReceiptDetailsMapper
.
getBankIncomeItemPage
(
mpPage
,
req
);
if
(
mpPage
.
getTotal
()
==
0
)
{
return
PageResult
.
empty
();
return
BankIncome
PageResult
.
empty
();
}
// 计算账号余额
List
<
BankIncomeItemResp
>
records
=
mpPage
.
getRecords
();
...
...
@@ -88,10 +85,14 @@ public class BankReceiptDetailsImpl implements BankReceiptDetailsService {
record
.
setAccountBalance
(
bankReceiptDetailsMapper
.
calculateAccountBalance
(
record
.
getAccountNo
()));
accountBalanceMap
.
put
(
record
.
getAccountNo
(),
record
.
getAccountBalance
());
}
List
<
ReceiptRelationOrderInfoVO
>
orderInfoByReceiptId
=
receiptMapper
.
getOrderInfoByReceiptId
(
Long
.
parseLong
(
record
.
getReceiptId
()));
record
.
setOrderInfoList
(
orderInfoByReceiptId
);
}
// 汇总不同币种总额
//bankReceiptDetailsMapper.
return
PageResult
.
of
(
mpPage
);
BankIncomePageResult
<
BankIncomeItemResp
>
result
=
BankIncomePageResult
.
of
(
mpPage
);
result
.
setCurrentAmount
(
bankReceiptDetailsMapper
.
calculateCurrentAmount
(
req
));
result
.
setTotalAmount
(
bankReceiptDetailsMapper
.
calculateTotalAmount
());
return
result
;
}
/*
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/BankReceiptDetailsService.java
View file @
44d7f643
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
service
.
receiptItem
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemResp
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.*
;
public
interface
BankReceiptDetailsService
{
PageResult
<
ReceiptItemRespVO
>
getBankReceiptDetailsList
(
ReceiptItemReq
req
);
PageResult
<
BankIncomeItemResp
>
getBankIncomeItemPage
(
BankIncomeItemReq
req
);
BankIncome
PageResult
<
BankIncomeItemResp
>
getBankIncomeItemPage
(
BankIncomeItemReq
req
);
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
44d7f643
...
...
@@ -21,6 +21,7 @@ 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.system.api.dict.DictDataApi
;
import
cn.iocoder.yudao.module.system.api.user.AdminUserApi
;
import
cn.iocoder.yudao.module.wealth.convert.receipt.ReceiptConvert
;
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.ReceiptBankWriteoffRangeDO
;
...
...
@@ -734,6 +735,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
throw
exception
(
RECEIPT_ITEM_NOT_FOUND
);
}
ReceiptItemBackVO
itemBackVO
=
ReceiptItemConvert
.
INSTANCE
.
convert
(
receiptItemDO
);
ReceiptDO
receiptDO
=
receiptMapper
.
selectById
(
receiptItemDO
.
getReceiptId
());
itemBackVO
.
setReceiptNo
(
receiptDO
.
getReceiptNo
());
List
<
ReceivableInItemVO
>
listForCreateReceiptItem
=
receivableService
.
getListForCreateReceiptItem
(
receiptItemDO
.
getReceiptId
());
itemBackVO
.
setReceivableList
(
listForCreateReceiptItem
);
return
itemBackVO
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/BankIncomeItemResp.java
View file @
44d7f643
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptItem
;
import
cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO
;
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_HOUR_MINUTE_SECOND
;
@Data
...
...
@@ -22,21 +23,8 @@ public class BankIncomeItemResp {
@ApiModelProperty
(
value
=
"收款账号"
)
private
String
accountNo
;
/**
* 当次实收金额不含税
*/
private
java
.
math
.
BigDecimal
amount
;
/**
* 税点
*/
private
java
.
math
.
BigDecimal
taxPoint
;
/**
* 当次实收金额含税
*/
private
java
.
math
.
BigDecimal
taxAmount
;
/**
* 收款账号名称
*/
@ApiModelProperty
(
value
=
"收款账号名称"
)
private
String
accountName
;
@ApiModelProperty
(
value
=
"收款账号银行名称"
)
...
...
@@ -52,15 +40,9 @@ public class BankIncomeItemResp {
@ApiModelProperty
(
value
=
"收款单编号"
)
private
String
receiptNo
;
@ApiModelProperty
(
value
=
"订单ID"
)
private
long
orderId
;
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
orderNo
;
@ApiModelProperty
(
value
=
"提单编号"
)
private
String
tidanNo
;
@ApiModelProperty
(
value
=
"账号余额"
)
private
java
.
math
.
BigDecimal
accountBalance
;
@ApiModelProperty
(
value
=
"相关订单信息列表"
)
private
List
<
ReceiptRelationOrderInfoVO
>
orderInfoList
;
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/BankIncomePageResult.java
0 → 100644
View file @
44d7f643
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptItem
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.github.pagehelper.PageInfo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
@Data
@ApiModel
(
"分页结果"
)
public
final
class
BankIncomePageResult
<
T
>
implements
Serializable
{
@ApiModelProperty
(
value
=
"数据"
,
required
=
true
)
private
List
<
T
>
list
;
@ApiModelProperty
(
value
=
"总量"
,
required
=
true
,
example
=
"0"
)
private
Long
total
=
0L
;
@ApiModelProperty
(
value
=
"每页记录数"
,
required
=
true
,
example
=
"10"
)
private
Long
rows
=
10L
;
@ApiModelProperty
(
value
=
"当前页数"
,
required
=
true
,
example
=
"1"
)
private
Long
page
=
1L
;
@ApiModelProperty
(
value
=
"总页数"
,
required
=
true
,
example
=
"0"
)
private
Long
pages
=
0L
;
@ApiModelProperty
(
value
=
"当前搜索条件汇总"
)
List
<
ReceiptItemActualAmount
>
currentAmount
;
@ApiModelProperty
(
value
=
"总合计"
)
List
<
ReceiptItemActualAmount
>
totalAmount
;
public
BankIncomePageResult
()
{}
public
BankIncomePageResult
(
List
<
T
>
list
,
long
total
)
{
this
.
list
=
list
;
this
.
total
=
total
;
}
public
BankIncomePageResult
(
List
<
T
>
list
,
long
total
,
long
rows
,
long
page
,
long
pages
)
{
this
.
list
=
list
;
this
.
rows
=
rows
;
this
.
page
=
page
;
this
.
pages
=
pages
;
this
.
total
=
total
;
}
public
BankIncomePageResult
(
long
total
)
{
this
.
list
=
new
ArrayList
<>();
this
.
total
=
total
;
}
public
static
<
T
>
BankIncomePageResult
<
T
>
empty
()
{
return
new
BankIncomePageResult
<>();
}
public
static
<
T
>
BankIncomePageResult
<
T
>
empty
(
long
total
)
{
return
new
BankIncomePageResult
<>(
total
);
}
/****
* 分页转换
* @param pager
* @return
*/
public
static
<
T
>
BankIncomePageResult
<
T
>
of
(
IPage
<
T
>
pager
){
return
new
BankIncomePageResult
<>(
pager
.
getRecords
(),
pager
.
getTotal
(),
pager
.
getSize
(),
pager
.
getCurrent
(),
pager
.
getPages
());
}
/****
* 分页转换
* @param pager
* @return
*/
public
static
<
T
>
BankIncomePageResult
<
T
>
of
(
PageInfo
<
T
>
pager
){
return
new
BankIncomePageResult
<>(
pager
.
getList
(),
pager
.
getTotal
(),
pager
.
getPageSize
(),
pager
.
getPageNum
(),
pager
.
getPages
());
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
View file @
44d7f643
...
...
@@ -33,6 +33,9 @@ public class ReceiptItemBackVO {
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
@ApiModelProperty
(
value
=
"收款单号"
)
private
String
receiptNo
;
@ExcelProperty
(
"收款账号"
)
@ApiModelProperty
(
value
=
"收款账号"
)
private
String
accountNo
;
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/BankReceiptDetailsControl.java
View file @
44d7f643
...
...
@@ -4,17 +4,12 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper
;
import
cn.iocoder.yudao.module.wealth.service.receiptItem.BankReceiptDetailsService
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemResp
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemRespVO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
...
...
@@ -38,9 +33,9 @@ public class BankReceiptDetailsControl {
return
success
(
bankReceiptDetailsService
.
getBankReceiptDetailsList
(
req
));
}
@
Ge
tMapping
(
"/income/page"
)
@
Pos
tMapping
(
"/income/page"
)
@ApiOperation
(
"银行账号收支明细列表"
)
public
CommonResult
<
PageResult
<
BankIncomeItemResp
>>
getBankIncomeItemPage
(
BankIncomeItemReq
req
)
{
public
CommonResult
<
BankIncomePageResult
<
BankIncomeItemResp
>>
getBankIncomeItemPage
(
@RequestBody
BankIncomeItemReq
req
)
{
return
success
(
bankReceiptDetailsService
.
getBankIncomeItemPage
(
req
));
}
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/ReceiptItem/BankReceiptDetailsMapper.xml
View file @
44d7f643
...
...
@@ -85,7 +85,7 @@
<include
refid=
"WherePage"
/>
ORDER BY p.receipt_id desc,p.create_time
</select>
<select
id=
"getBankIncomeItemPage"
>
<select
id=
"getBankIncomeItemPage"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receiptItem.BankIncomeItemResp"
>
SELECT
eri.id,
eri.receipt_id,
...
...
@@ -95,15 +95,27 @@
eri.amount,
eri.currency_id,
er.receipt_no,
eo.tidan_no,
eo.order_no,
eri.amount_date,
eri.remark
FROM ecw_receipt_item eri
LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id
LEFT JOIN ecw_order eo ON eo.order_id = er.order_id
INNER JOIN (SELECT receipt_id, order_id FROM ecw_receivable GROUP BY receipt_id, order_id) rb
ON rb.receipt_id = er.id
LEFT JOIN ecw_order eo ON eo.order_id = rb.order_id
LEFT JOIN ecw_receipt_account era ON era.receipt_id = eri.receipt_id
WHERE eri.status = 1
<include
refid=
"incomePageCondition"
/>
GROUP BY eri.id
<!-- <if test="req.isAsc != null">-->
<!-- <if test="req.isAsc">-->
<!-- ORDER BY eri.amount_date-->
<!-- </if>-->
<!-- <if test="!req.isAsc">-->
<!-- ORDER BY eri.amount_date DESC-->
<!-- </if>-->
<!-- </if>-->
</select>
<sql
id=
"incomePageCondition"
>
<if
test=
"req.relationNo != null and req.relationNo != ''"
>
AND (er.receipt_no LIKE concat('%',#{req.receiptNo},'%') OR eo.order_no LIKE
concat('%',#{req.relationNo},'%') OR eo.tidan_no = #{req.relationNo})
...
...
@@ -129,20 +141,39 @@
<if
test=
"req.amountDateStart != null and req.amountDateEnd != null"
>
AND eri.amount_date BETWEEN #{req.amountDateStart} AND #{req.amountDateEnd}
</if>
<if
test=
"req.isAsc != null"
>
<if
test=
"req.isAsc"
>
ORDER BY eri.amount_date
</if>
<if
test=
"!req.isAsc"
>
ORDER BY eri.amount_date DESC
</if>
</if>
</select>
</sql>
<select
id=
"calculateAccountBalance"
resultType=
"java.math.BigDecimal"
>
SELECT SUM(amount)
FROM ecw_receipt_item
WHERE
account_no = #{accountNo} AND status = 1
</select>
<select
id=
"calculateCurrentAmount"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemActualAmount"
>
SELECT
SUM(t.amount) AS amount,
t.currency_id AS currencyId
FROM (
SELECT eri.amount,
eri.currency_id
FROM ecw_receipt_item eri
LEFT JOIN ecw_receipt er ON eri.receipt_id = er.id
INNER JOIN (SELECT receipt_id, order_id FROM ecw_receivable GROUP BY receipt_id, order_id) rb
ON rb.receipt_id = er.id
LEFT JOIN ecw_order eo ON eo.order_id = rb.order_id
LEFT JOIN ecw_receipt_account era ON era.receipt_id = eri.receipt_id
WHERE eri.status = 1
<include
refid=
"incomePageCondition"
/>
GROUP BY eri.id) AS t
GROUP BY t.currency_id
</select>
<select
id=
"calculateTotalAmount"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemActualAmount"
>
SELECT
SUM(amount) AS amount,
currency_id AS currencyId
FROM ecw_receipt_item
WHERE status = 1
GROUP BY currency_id
</select>
</mapper>
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