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
44c6d1a6
Commit
44c6d1a6
authored
Nov 26, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 银行收款明细
parent
16fe8194
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
163 additions
and
143 deletions
+163
-143
ReceiptItemDO.java
...dule/wealth/dal/dataobject/receiptItem/ReceiptItemDO.java
+4
-0
BankReceiptDetailsMapper.java
...ealth/dal/mysql/receiptItem/BankReceiptDetailsMapper.java
+0
-6
ReceiptItemMapper.java
...odule/wealth/dal/mysql/receiptItem/ReceiptItemMapper.java
+5
-0
ReceiptServiceImpl.java
...dao/module/wealth/service/receipt/ReceiptServiceImpl.java
+4
-3
ReceiptInvoiceServiceImpl.java
...lth/service/receiptInvoice/ReceiptInvoiceServiceImpl.java
+3
-3
BankReceiptDetailsImpl.java
...le/wealth/service/receiptItem/BankReceiptDetailsImpl.java
+0
-8
BankReceiptDetailsService.java
...wealth/service/receiptItem/BankReceiptDetailsService.java
+0
-5
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+23
-27
ReceivableService.java
...o/module/wealth/service/receivable/ReceivableService.java
+2
-0
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+17
-0
WealthGenCodeUtils.java
.../iocoder/yudao/module/wealth/util/WealthGenCodeUtils.java
+41
-1
ReceiptBaseVO.java
...iocoder/yudao/module/wealth/vo/receipt/ReceiptBaseVO.java
+26
-27
ReceiptItemBackVO.java
...yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
+4
-0
ReceiptItemBaseVO.java
...yudao/module/wealth/vo/receiptItem/ReceiptItemBaseVO.java
+3
-0
ReceiptItemQueryVO.java
...udao/module/wealth/vo/receiptItem/ReceiptItemQueryVO.java
+3
-0
ReceiptItemReq.java
...er/yudao/module/wealth/vo/receiptItem/ReceiptItemReq.java
+17
-46
ReceiptItemResp.java
...r/yudao/module/wealth/vo/receiptItem/ReceiptItemResp.java
+4
-0
BankReceiptDetailsControl.java
...ntroller/admin/receiptItem/BankReceiptDetailsControl.java
+1
-3
ReceiptItemController.java
...h/controller/admin/receiptItem/ReceiptItemController.java
+3
-14
BankReceiptDetailsMapper.xml
...resources/mapper/ReceiptItem/BankReceiptDetailsMapper.xml
+3
-0
No files found.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/dataobject/receiptItem/ReceiptItemDO.java
View file @
44c6d1a6
...
...
@@ -26,6 +26,10 @@ public class ReceiptItemDO extends BaseDO {
*/
@TableId
private
Long
id
;
/**
* 流水号
*/
private
String
serialNumber
;
/**
* 收款单id
*/
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/mysql/receiptItem/BankReceiptDetailsMapper.java
View file @
44c6d1a6
...
...
@@ -6,15 +6,9 @@ import org.apache.ibatis.annotations.Mapper;
import
java.util.List
;
/*
*/
@Mapper
public
interface
BankReceiptDetailsMapper
{
List
<
ReceiptItemResp
>
getBankReceiptDetailsList
(
ReceiptItemReq
req
);
/*
获取记录总数
*/
long
GetCount
(
ReceiptItemReq
req
);
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/mysql/receiptItem/ReceiptItemMapper.java
View file @
44c6d1a6
...
...
@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.ResultType
;
import
org.apache.ibatis.annotations.Select
;
import
tk.mybatis.mapper.code.ORDER
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
@@ -83,4 +84,8 @@ public interface ReceiptItemMapper extends AbstractMapper<ReceiptItemDO> {
"</script>"
})
BigDecimal
getWriteOffAmountByReceiptId
(
@Param
(
"receiptId"
)
Long
receiptId
);
@ResultType
(
String
.
class
)
@Select
({
"select serial_number from ecw_receipt_item order by serial_number desc limit 1"
})
String
getCurrentMaxReceiptItemCode
();
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receipt/ReceiptServiceImpl.java
View file @
44c6d1a6
...
...
@@ -42,7 +42,7 @@ import cn.iocoder.yudao.module.wealth.enums.*;
import
cn.iocoder.yudao.module.wealth.service.receiptAccount.ReceiptAccountService
;
import
cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalService
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.util.
Invoice
GenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.util.
Wealth
GenCodeUtils
;
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
;
...
...
@@ -102,7 +102,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Resource
private
ReceiptInvoiceMapper
receiptInvoiceMapper
;
@Resource
private
InvoiceGenCodeUtils
invoice
GenCodeUtils
;
private
WealthGenCodeUtils
wealth
GenCodeUtils
;
@Resource
private
ReceiptLogMapper
receiptLogMapper
;
...
...
@@ -111,6 +111,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createReceipt
(
ReceiptCreateReqVO
createReqVO
)
{
// TODO 一个收款单是否可以关联多个订单的应收明细,校验明细的规则是什么?
if
(
createReqVO
.
getOrderId
()
==
0
)
{
throw
exception
(
ORDER_ID_NULL
);
}
...
...
@@ -150,7 +151,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
if
(
createReqVO
.
getOpenInvoice
().
equals
(
1
))
{
ReceiptInvoiceCreateReqVO
receiptInvoiceCreateReqVO
=
createReqVO
.
getReceiptInvoice
();
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convert
(
receiptInvoiceCreateReqVO
);
receiptInvoiceDO
.
setInvoiceNo
(
invoice
GenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setInvoiceNo
(
wealth
GenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setReceiptId
(
receipt
.
getId
());
receiptInvoiceDO
.
setReceiptNo
(
receipt
.
getReceiptNo
());
receiptInvoiceDO
.
setOrderId
(
createReqVO
.
getOrderId
());
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptInvoice/ReceiptInvoiceServiceImpl.java
View file @
44c6d1a6
...
...
@@ -21,7 +21,7 @@ import cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoiceLog.ReceiptInvoice
import
cn.iocoder.yudao.module.wealth.enums.InvoicingLinkEnum
;
import
cn.iocoder.yudao.module.wealth.enums.InvoicingStatusEnum
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
cn.iocoder.yudao.module.wealth.util.
Invoice
GenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.util.
Wealth
GenCodeUtils
;
import
cn.iocoder.yudao.module.wealth.vo.receiptInvoice.*
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.ReceivableBackVO
;
import
cn.iocoder.yudao.module.wealth.vo.receivable.WealthMoneyAmountVO
;
...
...
@@ -63,7 +63,7 @@ public class ReceiptInvoiceServiceImpl extends AbstractService<ReceiptInvoiceMap
@Resource
private
ReceivableService
receivableService
;
@Resource
private
InvoiceGenCodeUtils
invoice
GenCodeUtils
;
private
WealthGenCodeUtils
wealth
GenCodeUtils
;
@Resource
private
CurrencyApi
currencyApi
;
...
...
@@ -79,7 +79,7 @@ public class ReceiptInvoiceServiceImpl extends AbstractService<ReceiptInvoiceMap
checkReceiptForCreateInvoice
(
receiptDO
);
// 创建开票资料
ReceiptInvoiceDO
receiptInvoiceDO
=
ReceiptInvoiceConvert
.
INSTANCE
.
convert
(
createReqVO
);
receiptInvoiceDO
.
setInvoiceNo
(
invoice
GenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setInvoiceNo
(
wealth
GenCodeUtils
.
generateInvoiceCode
());
receiptInvoiceDO
.
setReceiptId
(
receiptDO
.
getId
());
receiptInvoiceDO
.
setReceiptNo
(
receiptDO
.
getReceiptNo
());
receiptInvoiceDO
.
setOrderId
(
receiptDO
.
getOrderId
());
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/BankReceiptDetailsImpl.java
View file @
44c6d1a6
...
...
@@ -20,9 +20,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/*
银行收款明细列表
*/
@Service
@Validated
@Slf4j
...
...
@@ -31,14 +28,9 @@ public class BankReceiptDetailsImpl implements BankReceiptDetailsService {
@Resource
private
BankReceiptDetailsMapper
bankReceiptDetailsMapper
;
/*
*/
@Autowired
private
AdminUserService
adminUserService
;
/*
获取分页数据
*/
public
PageResult
<
ReceiptItemResp
>
getBankReceiptDetailsList
(
ReceiptItemReq
req
)
{
IPage
<
ReceiptItemResp
>
mpPage
=
MyBatisUtils
.
buildPage
(
req
);
long
total
=
bankReceiptDetailsMapper
.
GetCount
(
req
);
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/BankReceiptDetailsService.java
View file @
44c6d1a6
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
service
.
receiptItem
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemReq
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemResp
;
import
java.util.List
;
/*
*/
public
interface
BankReceiptDetailsService
{
PageResult
<
ReceiptItemResp
>
getBankReceiptDetailsList
(
ReceiptItemReq
req
);
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
44c6d1a6
...
...
@@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.wealth.enums.ReceiptStatusEnum;
import
cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService
;
import
cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalService
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
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.FinanceReceiptItemVo
;
import
cn.iocoder.yudao.module.wealth.vo.receiptItem.ReceiptItemCreateReqVO
;
...
...
@@ -27,7 +28,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -54,28 +54,27 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
@Resource
private
ReceiptItemMapper
receiptItemMapper
;
@Resource
ReceiptService
receiptService
;
private
ReceiptService
receiptService
;
@Resource
ReceivableService
receivableService
;
private
ReceivableService
receivableService
;
@Resource
DictDataApi
dictDataApi
;
@Autowired
BpmCreateServiceFactory
bpmCreateServiceFactory
;
@
Autowired
ReceiptApprovalService
receiptApprovalService
;
private
DictDataApi
dictDataApi
;
@Resource
private
BpmCreateServiceFactory
bpmCreateServiceFactory
;
@Resource
private
ReceiptApprovalService
receiptApprovalService
;
@
Resource
private
WealthGenCodeUtils
wealthGenCodeUtils
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createReceiptItem
(
ReceiptItemCreateReqVO
createReqVO
)
{
// 插入
// 插入
收款明细
ReceiptItemDO
receiptItem
=
ReceiptItemConvert
.
INSTANCE
.
convert
(
createReqVO
);
receiptItem
.
setSerialNumber
(
wealthGenCodeUtils
.
generateReceiptItemCode
());
receiptItemMapper
.
insert
(
receiptItem
);
//创建收款明细的时候要判断收款单状态进行更新
//
创建收款明细的时候要判断收款单状态进行更新
if
(
null
!=
createReqVO
.
getReceiptId
())
{
ReceiptDO
receiptDO
=
receiptService
.
getReceipt
(
createReqVO
.
getReceiptId
());
if
(
null
!=
receiptDO
)
{
...
...
@@ -97,7 +96,9 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
}
else
{
throw
exception
(
RECEIPT_NOT_EXISTS
);
}
// TODO 更新收款明细核销金额
// TODO 更新收款明细核销金额在创建环节还是审批环节
// receivableService.writeOffByReceiptItem(createReqVO.getReceivableWriteOffList());
// 返回
return
receiptItem
.
getId
();
}
...
...
@@ -108,6 +109,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
this
.
validateReceiptItemExists
(
updateReqVO
.
getId
());
// 更新
ReceiptItemDO
updateObj
=
ReceiptItemConvert
.
INSTANCE
.
convert
(
updateReqVO
);
// TODO 是否更新明细?
receiptItemMapper
.
updateById
(
updateObj
);
}
...
...
@@ -118,9 +120,7 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
@Override
public
void
deleteReceiptItem
(
Long
id
)
{
// 校验存在
ReceiptItemDO
receiptItemDO
=
receiptItemMapper
.
selectById
(
id
);
ReceiptItemDO
receiptItemDO
=
receiptItemMapper
.
selectById
(
id
);
if
(
null
==
receiptItemDO
)
{
throw
exception
(
RECEIPT_ITEM_NOT_EXISTS
);
}
...
...
@@ -128,10 +128,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
receiptItemMapper
.
deleteById
(
id
);
//判断当前收款单下还有没有收款明细
if
(
null
!=
receiptItemDO
.
getReceiptId
())
{
LambdaQueryWrapper
<
ReceiptItemDO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ReceiptItemDO:
:
getReceiptId
,
receiptItemDO
.
getReceiptId
());
LambdaQueryWrapper
<
ReceiptItemDO
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ReceiptItemDO:
:
getReceiptId
,
receiptItemDO
.
getReceiptId
());
long
count
=
this
.
count
(
queryWrapper
);
if
(
count
==
0
)
{
ReceivableDO
updateReceivableDO
=
new
ReceivableDO
();
...
...
@@ -413,12 +411,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
if
(
receiptItemDO
.
getStatus
()
==
1
)
{
throw
exception
(
RECEIPT_ITEM_STATE_WRITE_OFF_SUCCESS_NOT_APPROVE
);
}
//校验收款单是否在在全部核销中
//校验收款单是否核销中
validateReceipt
(
receiptItemDO
.
getReceiptId
());
//创建收款单明细核销流程
ReceiptApprovalDO
approvalDO
=
new
ReceiptApprovalDO
();
approvalDO
.
setReceiptId
(
financeReceiptItemVo
.
getReceiptId
());
...
...
@@ -439,6 +433,8 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
update
.
setStatus
(
ReceiptItemStatusEnum
.
WRITE_OFF_APPROVE_ING
.
getValue
());
update
.
setBmpId
(
bpmId
);
this
.
updateById
(
update
);
// TODO 判断是否符合自动审批条件
}
@Override
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableService.java
View file @
44c6d1a6
...
...
@@ -266,4 +266,6 @@ public interface ReceivableService extends IService<ReceivableDO> {
* @return
*/
PageResult
<
BatchGenReceiptPageVO
>
batchGenReceiptPage
(
@Valid
BatchGenReceiptPageQueryVO
query
,
PageVO
page
);
void
writeOffByReceiptItem
(
List
<
ReceivableWriteOffReqVO
>
receivableWriteOffList
);
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
44c6d1a6
...
...
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.wealth.service.receivable;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.Order.OrderOperateLogEvent
;
import
cn.iocoder.yudao.framework.apollo.core.vo.ApplyInfoVO
;
import
cn.iocoder.yudao.framework.common.exception.ServiceException
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.i18n.core.I18nMessage
;
import
cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO
;
...
...
@@ -541,4 +542,20 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
});
return
new
PageResult
<>(
batchGenReceiptPageVOS
,
total
,
page
.
getRows
(),
page
.
getPage
(),
(
total
+
page
.
getRows
()
-
1
)
/
page
.
getRows
());
}
@Override
public
void
writeOffByReceiptItem
(
List
<
ReceivableWriteOffReqVO
>
receivableWriteOffList
)
{
if
(
CollectionUtil
.
isEmpty
(
receivableWriteOffList
))
{
throw
new
ServiceException
();
}
for
(
ReceivableWriteOffReqVO
receivableWriteOffReqVO
:
receivableWriteOffList
)
{
ReceivableDO
receivableDO
=
receivableMapper
.
selectById
(
receivableWriteOffReqVO
.
getId
());
if
(
receivableDO
==
null
)
{
// 找不到对应的应收收款报错
}
receivableDO
.
setWriteOffAmount
(
receivableWriteOffReqVO
.
getWriteOffAmount
().
add
(
receivableDO
.
getWriteOffAmount
()));
// TODO:是否更新汇率?是否每次更新基准金额,汇率变动时如何处理
receivableMapper
.
updateById
(
receivableDO
);
}
}
}
\ No newline at end of file
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/util/
Invoice
GenCodeUtils.java
→
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/util/
Wealth
GenCodeUtils.java
View file @
44c6d1a6
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.wealth.util;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receiptInvoice.ReceiptInvoiceMapper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receiptItem.ReceiptItemMapper
;
import
com.alibaba.excel.util.DateUtils
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
...
...
@@ -18,7 +19,7 @@ import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.GET_LOCK_FA
* 根据规则生成各种code
*/
@Component
public
class
Invoice
GenCodeUtils
{
public
class
Wealth
GenCodeUtils
{
@Resource
private
RedisHelper
redisHelper
;
...
...
@@ -26,6 +27,8 @@ public class InvoiceGenCodeUtils {
private
RedissonClient
redissonClient
;
@Resource
private
ReceiptInvoiceMapper
receiptInvoiceMapper
;
@Resource
private
ReceiptItemMapper
receiptItemMapper
;
/**
* 生成发票编号
...
...
@@ -64,4 +67,41 @@ public class InvoiceGenCodeUtils {
code
.
append
(
String
.
format
(
"%04d"
,
codeNum
));
return
code
.
toString
();
}
/**
* 生成银行收款明细流水号
*/
public
String
generateReceiptItemCode
()
{
// YHMX+年月日+5位流水号
String
key
=
"receiptItem:max:number"
;
StringBuilder
code
=
new
StringBuilder
();
code
.
append
(
"YHMX"
);
code
.
append
(
DateUtils
.
format
(
new
Date
(),
"yyMMdd"
));
Long
codeNum
;
if
(
redisHelper
.
hasKey
(
key
))
{
codeNum
=
redisHelper
.
incrBy
(
key
,
1
);
}
else
{
RLock
lock
=
redissonClient
.
getLock
(
"next:receiptItem:code:lock"
);
try
{
boolean
lockSuccess
=
lock
.
tryLock
(
2
,
2
,
TimeUnit
.
SECONDS
);
if
(!
lockSuccess
)
{
throw
exception
(
GET_LOCK_FAILED
);
}
String
currentMaxInvoiceCode
=
receiptItemMapper
.
getCurrentMaxReceiptItemCode
();
if
(
currentMaxInvoiceCode
==
null
){
codeNum
=
1L
;
}
else
{
codeNum
=
Long
.
parseLong
(
currentMaxInvoiceCode
.
substring
(
9
))
+
1
;
}
redisHelper
.
set
(
key
,
String
.
valueOf
(
codeNum
),
10
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
e
)
{
throw
exception
(
GET_LOCK_FAILED
);
}
finally
{
lock
.
unlock
();
}
}
// 获得5位序列号,不足位前面补0
codeNum
=
codeNum
%
100000
;
code
.
append
(
String
.
format
(
"%05d"
,
codeNum
));
return
code
.
toString
();
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receipt/ReceiptBaseVO.java
View file @
44c6d1a6
...
...
@@ -88,17 +88,17 @@ public class ReceiptBaseVO {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
payedAt
;
@ApiModelProperty
(
value
=
"发票号码"
)
private
String
invoiceNumber
;
@ApiModelProperty
(
value
=
"开票类型(字典表 invoicing_type)"
)
private
Integer
invoicingTypeId
;
@ApiModelProperty
(
value
=
"开票类型名称"
)
private
String
invoicingType
;
@ApiModelProperty
(
value
=
"开票备注"
)
private
String
invoicingRemark
;
//
@ApiModelProperty(value = "发票号码")
//
private String invoiceNumber;
//
//
@ApiModelProperty(value = "开票类型(字典表 invoicing_type)")
//
private Integer invoicingTypeId;
//
//
@ApiModelProperty(value = "开票类型名称")
//
private String invoicingType;
//
//
@ApiModelProperty(value = "开票备注")
//
private String invoicingRemark;
@ApiModelProperty
(
value
=
"通知人id"
)
private
Long
noticeAdminId
;
...
...
@@ -106,23 +106,23 @@ public class ReceiptBaseVO {
@ApiModelProperty
(
value
=
"通知人名称"
)
private
String
noticeAdminName
;
@ApiModelProperty
(
value
=
"收款人id"
)
private
Long
payeeId
;
@ApiModelProperty
(
value
=
"收款人名称"
)
private
String
payeeName
;
//
@ApiModelProperty(value = "收款人id")
//
private Long payeeId;
//
//
@ApiModelProperty(value = "收款人名称")
//
private String payeeName;
//
@ApiModelProperty
(
value
=
"核销人id"
)
private
Long
writeOffId
;
@ApiModelProperty
(
value
=
"核销人名称"
)
private
String
writeOffName
;
@ApiModelProperty
(
value
=
"开票人id"
)
private
Long
issuerId
;
@ApiModelProperty
(
value
=
"开票人名称"
)
private
String
issuerName
;
//
//
@ApiModelProperty(value = "开票人id")
//
private Long issuerId;
//
//
@ApiModelProperty(value = "开票人名称")
//
private String issuerName;
@ApiModelProperty
(
value
=
"状态: 0:草稿, 1待收款, 2待核销,3已部分核销,4已核销,5已核销待开票,6已开票"
)
private
Integer
state
;
...
...
@@ -131,9 +131,9 @@ public class ReceiptBaseVO {
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
writeOffAt
;
@ApiModelProperty
(
value
=
"开票时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
Date
invoicingAt
;
//
@ApiModelProperty(value = "开票时间")
//
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
//
private Date invoicingAt;
@ApiModelProperty
(
value
=
"数据来源(pc端,mobile端)"
)
private
String
source
;
...
...
@@ -142,7 +142,6 @@ public class ReceiptBaseVO {
private
Integer
openInvoice
;
@ApiModelProperty
(
value
=
"汇率有效期"
)
private
Date
rateValidateDate
;
@ApiModelProperty
(
value
=
"税点"
)
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemBackVO.java
View file @
44c6d1a6
...
...
@@ -22,6 +22,10 @@ public class ReceiptItemBackVO {
@ApiModelProperty
(
value
=
"主键"
,
required
=
true
)
private
Long
id
;
@ExcelProperty
(
"流水号"
)
@ApiModelProperty
(
value
=
"流水号"
)
private
String
serialNumber
;
@ExcelProperty
(
"收款单id"
)
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemBaseVO.java
View file @
44c6d1a6
...
...
@@ -17,6 +17,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@Data
public
class
ReceiptItemBaseVO
{
@ApiModelProperty
(
value
=
"流水号"
)
private
String
serialNumber
;
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemQueryVO.java
View file @
44c6d1a6
...
...
@@ -16,6 +16,9 @@ public class ReceiptItemQueryVO {
@ApiModelProperty
(
value
=
"收款单id"
)
private
Long
receiptId
;
@ApiModelProperty
(
value
=
"流水号"
)
private
String
serialNumber
;
@ApiModelProperty
(
value
=
"收款账号"
)
private
String
accountNo
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemReq.java
View file @
44c6d1a6
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receiptItem
;
import
cn.iocoder.yudao.framework.common.pojo.PageParam
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY
;
/*
*/
@Data
@ApiModel
(
"管理后台 - 银行收款单明细列表"
)
public
class
ReceiptItemReq
extends
PageParam
{
private
int
start
;
/*
主表中的收款单编号
*/
@ApiModelProperty
(
value
=
"收款单编号"
)
private
String
receiptNo
;
/*
订单编号
*/
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
orderNo
;
/*
提单编号
*/
@ApiModelProperty
(
value
=
"提单编号"
)
private
String
tidanNo
;
/*
创建日期
*/
@ApiModelProperty
(
value
=
"创建日期开始"
)
private
String
sDate1
;
@ApiModelProperty
(
value
=
"创建日期结束"
)
private
String
eDate1
;
/*
提交审批日期
*/
@ApiModelProperty
(
value
=
"提交审批日期开始"
)
private
String
sDate2
;
@ApiModelProperty
(
value
=
"提交审批日期结束"
)
private
String
eDate2
;
/*
审批通过日期
*/
@ApiModelProperty
(
value
=
"审批通过日期开始"
)
private
String
sDate3
;
@ApiModelProperty
(
value
=
"审批通过日期结束"
)
private
String
eDate3
;
/*
实收日期
*/
@ApiModelProperty
(
value
=
"实收日期开始"
)
private
String
sDate4
;
@ApiModelProperty
(
value
=
"实收日期结束"
)
private
String
eDate4
;
/*
创建人
*/
@ApiModelProperty
(
value
=
"创建人"
)
private
String
creator
;
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
private
Date
createTime
;
private
String
updater
;
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
private
Date
updateTime
;
/*
收款账户
*/
@ApiModelProperty
(
value
=
"收款账户"
)
private
String
accountNo
;
/*
审批状态
*/
@ApiModelProperty
(
value
=
"审批状态"
)
private
String
status
;
@ApiModelProperty
(
value
=
"流水号"
)
private
String
serialNumber
;
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receiptItem/ReceiptItemResp.java
View file @
44c6d1a6
...
...
@@ -24,6 +24,10 @@ public class ReceiptItemResp {
*/
@TableId
private
Long
id
;
/**
* 流水号
*/
private
String
serialNumber
;
/**
* 收款单id
*/
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/BankReceiptDetailsControl.java
View file @
44c6d1a6
...
...
@@ -41,9 +41,7 @@ public class BankReceiptDetailsControl {
@GetMapping
(
"/list"
)
@ApiOperation
(
"收款明细列表"
)
public
CommonResult
<
PageResult
<
ReceiptItemResp
>>
getBankReceiptDetailsList
(
ReceiptItemReq
req
)
{
public
CommonResult
<
PageResult
<
ReceiptItemResp
>>
getBankReceiptDetailsList
(
ReceiptItemReq
req
)
{
return
success
(
bankReceiptDetailsService
.
getBankReceiptDetailsList
(
req
));
}
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receiptItem/ReceiptItemController.java
View file @
44c6d1a6
...
...
@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.wealth.controller.admin.receiptItem;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.common.pojo.CommonResult
;
import
cn.iocoder.yudao.framework.common.util.collectors.CollectorsUtil
;
import
cn.iocoder.yudao.framework.common.util.io.FileModel
;
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.dto.CurrencyRespDTO
;
...
...
@@ -26,14 +25,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -55,19 +52,12 @@ public class ReceiptItemController {
@Resource
private
ReceiptItemMapper
receiptItemMapper
;
/*
币种
*/
@Resource
CurrencyApi
currencyApi
;
/*
private
CurrencyApi
currencyApi
;
*/
@Autowired
@Resource
private
AdminUserService
adminUserService
;
//审批信息
@Resource
private
ReceiptApprovalMapper
receiptApprovalMapper
;
...
...
@@ -220,8 +210,7 @@ public class ReceiptItemController {
@PostMapping
(
"/financeReceiptItemWriteOff"
)
@ApiOperation
(
"收款明细核销"
)
@Idempotent
(
timeout
=
5
)
public
CommonResult
<
Boolean
>
createFinanceReceiptItemWriteOff
(
@RequestBody
FinanceReceiptItemVo
financeReceiptVo
)
{
public
CommonResult
<
Boolean
>
createFinanceReceiptItemWriteOff
(
@RequestBody
FinanceReceiptItemVo
financeReceiptVo
)
{
receiptItemService
.
createFinanceReceiptItemWriteOff
(
financeReceiptVo
);
return
success
(
true
);
}
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/ReceiptItem/BankReceiptDetailsMapper.xml
View file @
44c6d1a6
...
...
@@ -61,6 +61,9 @@
AND p.creator in (SELECT id from system_user
where username like concat('%',#{creator},'%'))
</if>
<if
test=
"serialNumber != null and serialNumber != ''"
>
AND p.serial_number = #{serialNumber}
</if>
</where>
</sql>
...
...
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