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
076b357b
Commit
076b357b
authored
Dec 27, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 收款单,应收明细查询
parent
094ad590
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
163 additions
and
88 deletions
+163
-88
20241227.sql
sql/v2.2财务/20241227.sql
+0
-0
update_old_data.sql
sql/v2.2财务/update_old_data.sql
+7
-0
update_sys_data.sql
sql/v2.2财务/update_sys_data.sql
+0
-0
OrderApiImpl.java
.../java/cn/iocoder/yudao/module/order/api/OrderApiImpl.java
+2
-4
ReceiptMapper.java
.../yudao/module/wealth/dal/mysql/receipt/ReceiptMapper.java
+4
-1
UpdateReceiptNewFieldTask.java
...er/yudao/module/wealth/job/UpdateReceiptNewFieldTask.java
+23
-8
ReceiptServiceImpl.java
...dao/module/wealth/service/receipt/ReceiptServiceImpl.java
+13
-15
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+13
-4
ReceiptBackVO.java
...iocoder/yudao/module/wealth/vo/receipt/ReceiptBackVO.java
+0
-9
ReceiptBaseVO.java
...iocoder/yudao/module/wealth/vo/receipt/ReceiptBaseVO.java
+0
-7
ReceiptQueryVO.java
...ocoder/yudao/module/wealth/vo/receipt/ReceiptQueryVO.java
+5
-3
ReceivableBaseVO.java
...r/yudao/module/wealth/vo/receivable/ReceivableBaseVO.java
+3
-1
ReceiptController.java
...le/wealth/controller/admin/receipt/ReceiptController.java
+7
-15
ReceiptMapper.xml
...-rest/src/main/resources/mapper/receipt/ReceiptMapper.xml
+86
-21
No files found.
sql/v2.2财务/20241227.sql
0 → 100644
View file @
076b357b
This diff is collapsed.
Click to expand it.
sql/v2.2财务/update_old_data.sql
0 → 100644
View file @
076b357b
UPDATE
ecw_receivable
er
SET
base_currency_id
=
(
SELECT
er
.
import_currency5
FROM
ecw_region
er
WHERE
er
.
id
=
(
SELECT
eoo
.
objective_country_id
FROM
ecw_order_objective
eoo
WHERE
eoo
.
order_id
=
er
.
order_id
));
\ No newline at end of file
sql/v2.2财务/update_sys_data.sql
0 → 100644
View file @
076b357b
This diff is collapsed.
Click to expand it.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/api/OrderApiImpl.java
View file @
076b357b
...
...
@@ -38,8 +38,6 @@ public class OrderApiImpl implements OrderApi {
@Resource
private
OrderService
orderService
;
@Resource
private
OrderMapper
orderMapper
;
@Resource
private
OrderBusinessService
orderBusinessService
;
@Resource
private
CustomerService
customerService
;
...
...
@@ -198,7 +196,7 @@ public class OrderApiImpl implements OrderApi {
@Override
public
Long
getDestCountryByOrderId
(
Long
orderId
)
{
String
destCountryByOrderId
=
orderMapper
.
getDestCountry
ByOrderId
(
orderId
);
return
destCountryByOrderId
==
null
?
null
:
Long
.
valueOf
(
destCountryByOrderId
);
OrderObjectiveDO
orderObjectiveDO
=
objectiveService
.
get
ByOrderId
(
orderId
);
return
orderObjectiveDO
==
null
?
null
:
orderObjectiveDO
.
getObjectiveCountryId
(
);
}
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/mysql/receipt/ReceiptMapper.java
View file @
076b357b
...
...
@@ -85,8 +85,11 @@ public interface ReceiptMapper extends AbstractMapper<ReceiptDO> {
ReceiptExportDto
getReceiptExportByOrderId
(
@Param
(
"orderId"
)
Long
orderId
);
IPage
<
ReceiptBackVO
>
getReceiptBackPage
(
@Param
(
"mpPage"
)
IPage
<
ReceiptBackVO
>
mpPag
e
,
@Param
(
"query"
)
ReceiptQueryVO
query
);
List
<
ReceiptBackVO
>
getReceiptBackPage
(
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
siz
e
,
@Param
(
"query"
)
ReceiptQueryVO
query
);
int
countReceiptBackPage
(
@Param
(
"query"
)
ReceiptQueryVO
query
);
List
<
ReceiptRelationOrderInfoVO
>
getOrderInfoByReceiptId
(
Long
id
);
void
updateReceiptNewFieldBatch
(
List
<
ReceiptDO
>
receiptDOS
);
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/job/UpdateReceiptNewF
ei
ldTask.java
→
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/job/UpdateReceiptNewF
ie
ldTask.java
View file @
076b357b
...
...
@@ -5,10 +5,11 @@ import cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptItem.ReceiptItemDO
;
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.InvoiceDataStatusEnum
;
import
cn.iocoder.yudao.module.wealth.enums.InvoicingStatusEnum
;
import
cn.iocoder.yudao.module.wealth.enums.ReceiptItemStatusInReceiptEnum
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -17,7 +18,7 @@ import java.util.stream.Collectors;
@Component
@Slf4j
public
class
UpdateReceiptNewF
ei
ldTask
implements
JobHandler
{
public
class
UpdateReceiptNewF
ie
ldTask
implements
JobHandler
{
@Resource
private
ReceiptItemMapper
receiptItemMapper
;
@Resource
...
...
@@ -28,23 +29,37 @@ public class UpdateReceiptNewFeildTask implements JobHandler {
*/
@Override
public
String
execute
(
String
param
)
throws
Exception
{
log
.
info
(
"更新收款单新字段:应收明细状态"
);
long
l
=
System
.
currentTimeMillis
();
LambdaQueryWrapper
<
ReceiptDO
>
receiptDOLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
receiptDOLambdaQueryWrapper
.
select
(
ReceiptDO:
:
getId
)
receiptDOLambdaQueryWrapper
.
select
(
ReceiptDO:
:
getId
,
ReceiptDO:
:
getOpenInvoice
)
.
eq
(
ReceiptDO:
:
getDeleted
,
false
);
List
<
ReceiptDO
>
receiptDOS
=
receiptMapper
.
selectList
(
receiptDOLambdaQueryWrapper
);
List
<
Long
>
idList
=
receiptDOS
.
stream
().
map
(
ReceiptDO:
:
getId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
ReceiptItemDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
in
(
ReceiptItemDO:
:
getReceiptId
,
idList
)
.
select
(
ReceiptItemDO:
:
getReceiptId
,
ReceiptItemDO:
:
getStatus
);
List
<
ReceiptItemDO
>
listItem
=
receiptItemMapper
.
selectList
(
lambdaQueryWrapper
);
for
(
ReceiptDO
receiptDO
:
receiptDOS
)
{
LambdaQueryWrapper
<
ReceiptItemDO
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
ReceiptItemDO:
:
getReceiptId
,
receiptDO
.
getId
())
.
select
(
ReceiptItemDO:
:
getReceiptId
,
ReceiptItemDO:
:
getStatus
);
List
<
ReceiptItemDO
>
listItem
=
receiptItemMapper
.
selectList
(
lambdaQueryWrapper
);
if
(!
listItem
.
isEmpty
())
{
ReceiptItemStatusInReceiptEnum
sMxStatus
=
getReceiptMxStatus
(
listItem
,
receiptDO
.
getId
());
receiptDO
.
setReceiptItemStatus
(
sMxStatus
.
getValue
());
}
else
{
receiptDO
.
setReceiptItemStatus
(
ReceiptItemStatusInReceiptEnum
.
NO_INPUT
.
getValue
());
}
if
(
receiptDO
.
getOpenInvoice
().
equals
(
1
))
{
receiptDO
.
setInvoiceDataStatus
(
InvoiceDataStatusEnum
.
SUBMIT
.
getValue
());
receiptDO
.
setInvoicingStatus
(
InvoicingStatusEnum
.
WAIT
.
getValue
());
}
else
if
(
receiptDO
.
getOpenInvoice
().
equals
(
0
))
{
receiptDO
.
setInvoiceDataStatus
(
InvoiceDataStatusEnum
.
NO_AUDIT
.
getValue
());
receiptDO
.
setInvoicingStatus
(
InvoicingStatusEnum
.
NO_INVOICE
.
getValue
());
}
}
List
<
List
<
ReceiptDO
>>
receiptDOSList
=
receiptDOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
item
->
receiptDOS
.
indexOf
(
item
)
/
500
)).
values
().
stream
().
map
(
list
->
list
.
stream
().
limit
(
1000
).
collect
(
Collectors
.
toList
())).
collect
(
Collectors
.
toList
());
for
(
List
<
ReceiptDO
>
dos
:
receiptDOSList
)
{
receiptMapper
.
updateReceiptNewFieldBatch
(
dos
);
}
receiptMapper
.
updateBatch
(
receiptDOS
);
log
.
info
(
"更新收款单新字段:应收明细状态,耗时:{}"
,
System
.
currentTimeMillis
()
-
l
);
return
"success"
;
}
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receipt/ReceiptServiceImpl.java
View file @
076b357b
...
...
@@ -192,7 +192,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
receivableDO
.
setBaseCurrencyId
(
destCountryCurrencyId
);
ExchangeRateRespDTO
currencyRate
=
currencyApi
.
getCurrencyRate
(
receipt
.
getCurrencyId
(),
destCountryCurrencyId
);
receivableDO
.
setExchangeRate
(
currencyRate
.
getCurrencyRate
());
BigDecimal
actualAmount
=
receivableDO
.
getTaxAmount
().
subtract
(
receivableDO
.
getDiscountTotal
());
BigDecimal
actualAmount
=
receivableDO
.
getTaxAmount
().
subtract
(
receivableDO
.
getDiscountTotal
()
==
null
?
BigDecimal
.
ZERO
:
receivableDO
.
getDiscountTotal
()
);
receivableDO
.
setBaseAmount
(
actualAmount
.
multiply
(
currencyRate
.
getCurrencyRate
()));
return
receivableDO
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -220,7 +220,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
try
{
validateCreateVO
(
createReqVO
);
}
catch
(
Exception
e
)
{
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
createReqVO
.
getOrderNo
()
,
createReqVO
.
getCustomerName
(),
e
.
getMessage
()));
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
null
,
createReqVO
.
getCustomerName
(),
e
.
getMessage
()));
}
});
if
(!
respVOS
.
isEmpty
())
{
...
...
@@ -231,7 +231,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
try
{
currentProxy
.
generateReceiptRelevantData
(
receiptCreateReqVO
);
}
catch
(
Exception
e
)
{
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
receiptCreateReqVO
.
getOrderNo
()
,
receiptCreateReqVO
.
getCustomerName
(),
e
.
getMessage
()));
respVOS
.
add
(
new
ReceiptBatchGenRespVO
(
null
,
receiptCreateReqVO
.
getCustomerName
(),
e
.
getMessage
()));
}
}
return
respVOS
;
...
...
@@ -297,7 +297,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
*
* @param receivableUpdateReqVOList 收款明细
*/
p
ublic
void
validateSameCustomerReceivable
(
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
)
{
p
rivate
void
validateSameCustomerReceivable
(
List
<
ReceivableUpdateReqVO
>
receivableUpdateReqVOList
)
{
if
(
CollectionUtil
.
isEmpty
(
receivableUpdateReqVOList
))
{
throw
exception
(
RECEIVABLE_NOT_NULL
);
}
...
...
@@ -436,21 +436,19 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
@Override
public
PageResult
<
ReceiptBackVO
>
getReceiptPage
(
ReceiptQueryVO
query
,
PageVO
page
)
{
page
.
setField
(
"er.id"
);
IPage
<
ReceiptBackVO
>
mpPage
=
MyBatisUtils
.
buildPage
(
page
);
receiptMapper
.
getReceiptBackPage
(
mpPag
e
,
query
);
if
(
mpPage
.
getTotal
()
==
0
)
{
int
start
=
(
page
.
getPage
()
-
1
)
*
page
.
getRows
(
);
int
size
=
page
.
getRows
(
);
List
<
ReceiptBackVO
>
receiptBackPage
=
receiptMapper
.
getReceiptBackPage
(
start
,
siz
e
,
query
);
if
(
receiptBackPage
.
isEmpty
()
)
{
return
PageResult
.
empty
();
}
mpPage
.
getRecords
().
forEach
(
receiptBackVO
->
{
int
total
=
receiptMapper
.
countReceiptBackPage
(
query
);
receiptBackPage
.
forEach
(
receiptBackVO
->
{
// 根据收款单id获取关联订单信息
List
<
ReceiptRelationOrderInfoVO
>
orderInfoList
=
receiptMapper
.
getOrderInfoByReceiptId
(
receiptBackVO
.
getId
());
receiptBackVO
.
setOrderInfoList
(
orderInfoList
);
});
//添加明细状态计算列表
//MxStatus
//获取List指定字段的List
List
<
Long
>
idList
=
mpPage
.
getRecords
().
stream
().
map
(
ReceiptBackVO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
idList
=
receiptBackPage
.
stream
().
map
(
ReceiptBackVO:
:
getId
).
collect
(
Collectors
.
toList
());
//一定要判空,不然会报错
if
(
CollectionUtil
.
isNotEmpty
(
idList
))
{
//根据List获取本页中所有的明细信息
...
...
@@ -465,7 +463,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
Map
<
Integer
,
CurrencyRespDTO
>
currencyMap
=
currencyApi
.
getAllCurrency
();
for
(
ReceiptBackVO
r
:
mpPage
.
getRecords
()
)
{
for
(
ReceiptBackVO
r
:
receiptBackPage
)
{
String
sR
=
getReceiptMxStatus
(
listItem
,
r
.
getId
()).
getNameZh
();
r
.
setMxStatus
(
sR
);
...
...
@@ -480,7 +478,7 @@ public class ReceiptServiceImpl extends AbstractService<ReceiptMapper, ReceiptDO
r
.
setHxBiLi
(
getHxBili
(
ReceiptAccountList
,
listItem
,
r
.
getId
()));
}
}
return
PageResult
.
of
(
mpPage
);
return
new
PageResult
<>(
receiptBackPage
,
total
);
}
private
String
getPercentage
(
BigDecimal
part
,
BigDecimal
total
)
{
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
076b357b
...
...
@@ -103,6 +103,8 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivable
.
setCreator
(
creator
);
receivable
.
setUpdateTime
(
new
Date
());
receivable
.
setUpdater
(
creator
);
// 设置基准币种
receivable
.
setBaseCurrencyId
(
getDestCountryCurrencyId
(
createReqVO
.
getOrderId
()));
this
.
save
(
receivable
);
// 返回
return
receivable
.
getId
();
...
...
@@ -246,6 +248,16 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
page
.
setField
(
"r.id"
);
IPage
<
ReceivableBackVO
>
mpPage
=
MyBatisUtils
.
buildPage
(
page
);
receivableMapper
.
receivablePage
(
mpPage
,
query
);
mpPage
.
getRecords
().
forEach
(
receivableBackVO
->
{
if
(
receivableBackVO
.
getDiscountTotal
()
==
null
)
{
receivableBackVO
.
setDiscountTotal
(
BigDecimal
.
ZERO
);
}
receivableBackVO
.
setNotIncludedTaxAmount
(
receivableBackVO
.
getTotalAmount
());
receivableBackVO
.
setActualAmount
(
receivableBackVO
.
getTaxAmount
().
subtract
(
receivableBackVO
.
getDiscountTotal
()));
ExchangeRateRespDTO
currencyRate
=
currencyApi
.
getCurrencyRate
(
receivableBackVO
.
getCurrencyId
(),
receivableBackVO
.
getBaseCurrencyId
());
receivableBackVO
.
setExchangeRate
(
currencyRate
.
getCurrencyRate
());
receivableBackVO
.
setBaseAmount
(
receivableBackVO
.
getActualAmount
().
multiply
(
currencyRate
.
getCurrencyRate
()));
});
return
PageResult
.
of
(
mpPage
);
}
...
...
@@ -263,15 +275,13 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
@Override
public
List
<
ReceivableBackVO
>
getReceivableByOrderId
(
Long
orderId
)
{
List
<
ReceivableBackVO
>
receivableBackVOList
=
receivableMapper
.
getReceivableByOrderId
(
orderId
);
Long
destCountryCurrencyId
=
getDestCountryCurrencyId
(
orderId
);
receivableBackVOList
.
forEach
(
receivableBackVO
->
{
if
(
receivableBackVO
.
getDiscountTotal
()
==
null
)
{
receivableBackVO
.
setDiscountTotal
(
BigDecimal
.
ZERO
);
}
receivableBackVO
.
setNotIncludedTaxAmount
(
receivableBackVO
.
getTotalAmount
());
receivableBackVO
.
setActualAmount
(
receivableBackVO
.
getTaxAmount
().
subtract
(
receivableBackVO
.
getDiscountTotal
()));
receivableBackVO
.
setBaseCurrencyId
(
destCountryCurrencyId
);
ExchangeRateRespDTO
currencyRate
=
currencyApi
.
getCurrencyRate
(
receivableBackVO
.
getCurrencyId
(),
destCountryCurrencyId
);
ExchangeRateRespDTO
currencyRate
=
currencyApi
.
getCurrencyRate
(
receivableBackVO
.
getCurrencyId
(),
receivableBackVO
.
getBaseCurrencyId
());
receivableBackVO
.
setExchangeRate
(
currencyRate
.
getCurrencyRate
());
receivableBackVO
.
setBaseAmount
(
receivableBackVO
.
getActualAmount
().
multiply
(
currencyRate
.
getCurrencyRate
()));
});
...
...
@@ -312,7 +322,6 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivableBackVO
.
setWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setNotWriteOffAmountUsd
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setBaseAmount
(
BigDecimal
.
ZERO
);
receivableBackVO
.
setBaseCurrencyId
(
1L
);
// 核销比例 = 已核销金额 / 实际金额,保留两位小数字符串
receivableBackVO
.
setWriteOffProportion
(
receivableBackVO
.
getWriteOffAmount
().
divide
(
receivableBackVO
.
getActualAmount
(),
2
,
RoundingMode
.
HALF_UP
).
toString
());
});
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receipt/ReceiptBackVO.java
View file @
076b357b
...
...
@@ -201,15 +201,6 @@ public class ReceiptBackVO {
@ApiModelProperty
(
value
=
"明细状态"
)
private
String
mxStatus
;
@ApiModelProperty
(
value
=
"订单号"
)
private
String
orderNo
;
@ApiModelProperty
(
value
=
"订单ID"
)
private
Long
orderId
;
@ApiModelProperty
(
value
=
"提单号"
)
private
String
tidanNo
;
@ApiModelProperty
(
value
=
"应收金额"
)
private
String
ysShow
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receipt/ReceiptBaseVO.java
View file @
076b357b
...
...
@@ -149,11 +149,4 @@ public class ReceiptBaseVO {
@ApiModelProperty
(
value
=
"财务备注"
)
private
String
financeRemark
;
@ApiModelProperty
(
value
=
"订单ID"
)
private
String
orderId
;
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
orderNo
;
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receipt/ReceiptQueryVO.java
View file @
076b357b
...
...
@@ -5,7 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
...
@@ -142,11 +144,11 @@ public class ReceiptQueryVO {
private
String
numberNo
;
@ApiModelProperty
(
value
=
"明细状态"
)
private
Integer
receiptItemStatus
;
private
List
<
Integer
>
receiptItemStatus
;
@ApiModelProperty
(
value
=
"开票状态"
)
private
Integer
invoicingStatus
;
private
List
<
Integer
>
invoicingStatus
;
@ApiModelProperty
(
value
=
"开票资料状态"
)
private
Integer
invoiceDataStatus
;
private
List
<
Integer
>
invoiceDataStatus
;
}
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableBaseVO.java
View file @
076b357b
...
...
@@ -108,7 +108,9 @@ public class ReceivableBaseVO {
@ApiModelProperty
(
value
=
"基准金额"
)
private
BigDecimal
baseAmount
;
@ApiModelProperty
(
value
=
"基准币种"
)
private
Long
baseCurrencyId
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/receipt/ReceiptController.java
View file @
076b357b
...
...
@@ -16,14 +16,13 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import
cn.iocoder.yudao.module.ecw.api.currency.CurrencyApi
;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.CurrencyRespDTO
;
import
cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO
;
import
cn.iocoder.yudao.module.ecw.service.bankAccount.BankAccountService
;
import
cn.iocoder.yudao.module.wealth.convert.receipt.ReceiptConvert
;
import
cn.iocoder.yudao.module.wealth.convert.receiptAccount.ReceiptAccountConvert
;
import
cn.iocoder.yudao.module.wealth.convert.receiptApproval.ReceiptApprovalConvert
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receipt.ReceiptDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptAccount.ReceiptAccountDO
;
import
cn.iocoder.yudao.module.wealth.dal.dataobject.receiptApproval.ReceiptApprovalDO
;
import
cn.iocoder.yudao.module.wealth.job.UpdateReceiptNewF
ei
ldTask
;
import
cn.iocoder.yudao.module.wealth.job.UpdateReceiptNewF
ie
ldTask
;
import
cn.iocoder.yudao.module.wealth.service.receipt.ReceiptService
;
import
cn.iocoder.yudao.module.wealth.service.receiptAccount.ReceiptAccountService
;
import
cn.iocoder.yudao.module.wealth.service.receiptApproval.ReceiptApprovalService
;
...
...
@@ -71,29 +70,22 @@ import static cn.iocoder.yudao.module.wealth.enums.ErrorCodeConstants.PAYMENT_NO
public
class
ReceiptController
{
@Resource
private
ReceiptService
receiptService
;
@Resource
private
ReceivableService
receivableService
;
@Resource
private
ReceiptAccountService
receiptAccountService
;
@Resource
private
CurrencyApi
currencyApi
;
@Resource
private
BankAccountService
bankAccountService
;
@Resource
private
ReceiptApprovalService
receiptApprovalService
;
@Resource
private
UpdateReceiptNewF
eildTask
updateReceiptNewFei
ldTask
;
private
UpdateReceiptNewF
ieldTask
updateReceiptNewFie
ldTask
;
@
Ge
tMapping
(
"/page"
)
@
Pos
tMapping
(
"/page"
)
@ApiOperation
(
"获得收款单分页"
)
//@PreAuthorize("@ss.hasPermission('ecw:receipt:query')")
public
CommonResult
<
PageResult
<
ReceiptBackVO
>>
getReceiptPage
(
@Valid
ReceiptQueryVO
query
,
PageVO
page
)
{
public
CommonResult
<
PageResult
<
ReceiptBackVO
>>
getReceiptPage
(
@
RequestBody
@
Valid
ReceiptQueryVO
query
,
PageVO
page
)
{
//添加收款单明细状态计算功能
//添加订单号和提单号的关联展示
PageResult
<
ReceiptBackVO
>
pageResult
=
receiptService
.
getReceiptPage
(
query
,
page
);
...
...
@@ -112,7 +104,6 @@ public class ReceiptController {
@ApiOperation
(
"创建收款单"
)
@Idempotent
(
timeout
=
5
)
public
CommonResult
<
Long
>
createReceipt
(
@Valid
@RequestBody
ReceiptCreateReqVO
createReqVO
)
{
//
return
success
(
receiptService
.
createReceipt
(
createReqVO
));
}
...
...
@@ -714,9 +705,10 @@ public class ReceiptController {
return
"¥"
;
}
}
@GetMapping
(
"/updateReceiptNewFeild"
)
@ApiOperation
(
"更新应收明细"
)
public
CommonResult
<
String
>
updateReceiptNewF
ei
ld
()
throws
Exception
{
return
success
(
updateReceiptNewF
ei
ldTask
.
execute
(
""
));
public
CommonResult
<
String
>
updateReceiptNewF
ie
ld
()
throws
Exception
{
return
success
(
updateReceiptNewF
ie
ldTask
.
execute
(
""
));
}
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/receipt/ReceiptMapper.xml
View file @
076b357b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.iocoder.yudao.module.wealth.dal.mysql.receipt.ReceiptMapper"
>
<update
id=
"updateReceiptNewFieldBatch"
>
UPDATE ecw_receipt
<trim
prefix=
"set"
suffixOverrides=
","
>
<trim
prefix=
"receipt_item_status=case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when id=#{i.id} then #{i.receiptItemStatus}
</foreach>
</trim>
<trim
prefix=
"invoicing_status=case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when id=#{i.id} then #{i.invoicingStatus}
</foreach>
</trim>
<trim
prefix=
"invoice_data_status=case"
suffix=
"end,"
>
<foreach
collection=
"list"
item=
"i"
index=
"index"
>
when id=#{i.id} then #{i.invoiceDataStatus}
</foreach>
</trim>
</trim>
where
<foreach
collection=
"list"
separator=
"or"
item=
"i"
index=
"index"
>
id = #{i.id}
</foreach>
</update>
<select
id=
"getReceiptBackPage"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptBackVO"
>
<!--添加关联订单和应收款表的关联-->
SELECT
er.*,
er.*
FROM ecw_receipt er
<if
test=
"query.numberNo != null and query.numberNo != ''"
>
INNER JOIN (SELECT receipt_id,order_id FROM ecw_receivable GROUP BY receipt_id, order_id ) AS rb ON rb.receipt_id = er.id
LEFT JOIN ecw_order o ON o.order_id=rb.order_id AND o.deleted=0
</if>
WHERE er.deleted = 0
<include
refid=
"pageCondition"
/>
<if
test=
"query.numberNo != null and query.numberNo != ''"
>
GROUP BY er.receipt_no
</if>
LIMIT #{start}, #{size}
</select>
<select
id=
"getOrderInfoByReceiptId"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO"
>
SELECT
o.order_no AS orderNo,
o.tidan_no AS tidanNo,
o.order_id AS orderId
FROM ecw_receivable er
LEFT JOIN ecw_order o ON o.order_id=er.order_id
WHERE er.deleted= 0 AND er.receipt_id = #{id}
GROUP BY o.order_id
</select>
<select
id=
"countReceiptBackPage"
resultType=
"java.lang.Integer"
>
SELECT count(1)
FROM ecw_receipt er
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 o ON o.order_id=rb.order_id AND o.deleted=0
<if
test=
"query.numberNo != null and query.numberNo != ''"
>
INNER JOIN (SELECT receipt_id,order_id FROM ecw_receivable GROUP BY receipt_id, order_id ) AS rb ON rb.receipt_id = er.id
LEFT JOIN ecw_order o ON o.order_id=rb.order_id AND o.deleted=0
</if>
WHERE er.deleted = 0
<include
refid=
"pageCondition"
/>
<if
test=
"query.numberNo != null and query.numberNo != ''"
>
GROUP BY er.receipt_no
</if>
</select>
<sql
id=
"pageCondition"
>
<if
test=
"query.receiptItemStatus != null"
>
AND er.`detail_status` = #{query.receiptItemStatus}
<if
test=
"query.receiptItemStatus.size() == 1"
>
AND er.`receipt_item_status` = #{query.receiptItemStatus[0]}
</if>
<if
test=
"query.receiptItemStatus.size() > 1"
>
AND er.`receipt_item_status` IN
<foreach
collection=
"query.receiptItemStatus"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
<if
test=
"query.invoicingStatus != null"
>
AND er.`invoicing_status` = #{query.invoicingStatus}
<if
test=
"query.invoicingStatus.size() == 1"
>
AND er.`invoicing_status` = #{query.invoicingStatus[0]}
</if>
<if
test=
"query.invoicingStatus.size() > 1"
>
AND er.`invoicing_status` IN
<foreach
collection=
"query.invoicingStatus"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
<if
test=
"query.invoiceDataStatus != null"
>
AND er.`invoice_data_status` = #{query.invoiceDataStatus}
<if
test=
"query.invoiceDataStatus.size() == 1"
>
AND er.`invoice_data_status` = #{query.invoiceDataStatus[0]}
</if>
<if
test=
"query.invoiceDataStatus.size() > 1"
>
AND er.`invoice_data_status` IN
<foreach
collection=
"query.invoiceDataStatus"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
<if
test=
"query.receiptNo != null"
>
AND er.`receipt_no` = #{query.receiptNo}
...
...
@@ -45,20 +123,7 @@
AND er.`create_time` between #{query.beginCreateTime} and #{query.endCreateTime}
</if>
<if
test=
"query.numberNo != null and query.numberNo != '' "
>
AND (o.order_no = #{query.numberNo} OR o.tidan_no = #{query.numberNo} OR o.container_number =
#{query.numberNo}))
AND (o.order_no = #{query.numberNo} OR o.tidan_no = #{query.numberNo} OR o.container_number = #{query.numberNo})
</if>
GROUP BY er.receipt_no
</select>
<select
id=
"getOrderInfoByReceiptId"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receipt.ReceiptRelationOrderInfoVO"
>
SELECT
o.order_no AS orderNo,
o.tidan_no AS tidanNo,
o.order_id AS orderId
FROM ecw_receivable er
LEFT JOIN ecw_order o ON o.order_id=er.order_id
WHERE er.deleted= 0 AND er.receipt_id = #{id}
GROUP BY o.order_id
</select>
</sql>
</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