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
e5366a29
Commit
e5366a29
authored
Jan 19, 2025
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 优化
parent
661c044a
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
118 additions
and
45 deletions
+118
-45
ReceivableMapper.java
.../module/wealth/dal/mysql/receivable/ReceivableMapper.java
+2
-0
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+79
-37
ReceivableBoxReportQueryVO.java
...dule/wealth/vo/receivable/ReceivableBoxReportQueryVO.java
+2
-0
ReceivableCurrencyAmount.java
...module/wealth/vo/receivable/ReceivableCurrencyAmount.java
+7
-2
ReceivableIncomeBelong.java
...o/module/wealth/vo/receivable/ReceivableIncomeBelong.java
+1
-0
BoxReportCacheRefreshJob.java
...wealth/controller/admin/job/BoxReportCacheRefreshJob.java
+6
-5
ReceiptItemMapper.xml
...c/main/resources/mapper/ReceiptItem/ReceiptItemMapper.xml
+2
-1
ReceivableMapper.xml
...src/main/resources/mapper/receivable/ReceivableMapper.xml
+19
-0
No files found.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/dal/mysql/receivable/ReceivableMapper.java
View file @
e5366a29
...
...
@@ -437,4 +437,6 @@ public interface ReceivableMapper extends AbstractMapper<ReceivableDO> {
List
<
ReceivableDO
>
selectBoxReceivablesByOrderIds
(
@Param
(
"orderIds"
)
Set
<
Long
>
orderIds
);
List
<
Long
>
getAllBoxId
();
List
<
Long
>
getDestWarehouseIdListByDestCity
(
@Param
(
"destCity"
)
List
<
Long
>
destCity
);
}
\ No newline at end of file
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
e5366a29
This diff is collapsed.
Click to expand it.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableBoxReportQueryVO.java
View file @
e5366a29
...
...
@@ -83,6 +83,8 @@ public class ReceivableBoxReportQueryVO {
private
Boolean
forceUpdateCache
=
false
;
private
List
<
String
>
selfNoList
;
public
Boolean
isEmpty
()
{
return
StringUtils
.
isBlank
(
selfNo
)
&&
(
CollectionUtil
.
isEmpty
(
startWarehouseIdList
))
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableCurrencyAmount.java
View file @
e5366a29
...
...
@@ -15,7 +15,7 @@ public class ReceivableCurrencyAmount {
public
ReceivableCurrencyAmount
(
Long
currencyId
,
BigDecimal
amount
)
{
this
.
currencyId
=
currencyId
;
this
.
amount
=
amount
;
this
.
amount
=
amount
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
;
}
@Override
...
...
@@ -32,6 +32,11 @@ public class ReceivableCurrencyAmount {
}
public
void
addAmount
(
BigDecimal
amount
)
{
this
.
amount
=
this
.
amount
.
add
(
amount
);
this
.
amount
=
this
.
amount
.
add
(
amount
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
@Override
public
ReceivableCurrencyAmount
clone
()
{
return
new
ReceivableCurrencyAmount
(
this
.
currencyId
,
this
.
amount
);
}
}
\ No newline at end of file
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/ReceivableIncomeBelong.java
View file @
e5366a29
...
...
@@ -12,4 +12,5 @@ public class ReceivableIncomeBelong {
*/
private
Integer
incomeBelong
;
private
BigDecimal
writeOffAmount
;
private
BigDecimal
writeOffBaseAmount
;
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/job/BoxReportCache
Loader
.java
→
yudao-module-wealth/yudao-module-wealth-rest/src/main/java/cn/iocoder/yudao/module/wealth/controller/admin/job/BoxReportCache
RefreshJob
.java
View file @
e5366a29
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
controller
.
admin
.
job
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.quartz.core.handler.JobHandler
;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
cn.iocoder.yudao.module.wealth.dal.mysql.receivable.ReceivableMapper
;
import
cn.iocoder.yudao.module.wealth.service.receivable.ReceivableService
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
...
...
@@ -19,12 +18,13 @@ import static cn.iocoder.yudao.module.wealth.enums.BoxReportConstant.BOX_AMOUNT_
@Component
@Slf4j
@AllArgsConstructor
public
class
BoxReportCache
Loader
implements
ApplicationRunn
er
{
public
class
BoxReportCache
RefreshJob
implements
JobHandl
er
{
private
final
ReceivableService
receivableService
;
private
final
ReceivableMapper
receivableMapper
;
private
final
RedisHelper
redisHelper
;
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
public
String
execute
(
String
param
)
{
log
.
info
(
"初始化应收报表缓存"
);
try
{
List
<
Long
>
boxIds
=
receivableMapper
.
getAllBoxId
();
...
...
@@ -33,10 +33,11 @@ public class BoxReportCacheLoader implements ApplicationRunner {
List
<
Long
>
cacheBoxIds
=
keys
.
stream
().
map
(
key
->
Long
.
parseLong
(
key
.
replace
(
BOX_AMOUNT_CACHE
,
""
))).
collect
(
Collectors
.
toList
());
boxIds
=
boxIds
.
stream
().
filter
(
boxId
->
!
cacheBoxIds
.
contains
(
boxId
)).
collect
(
Collectors
.
toList
());
}
receivableService
.
updateBoxAmountCache
(
boxIds
,
fals
e
);
receivableService
.
updateBoxAmountCache
(
boxIds
,
tru
e
);
}
catch
(
Exception
e
)
{
log
.
error
(
"初始化应收报表缓存失败"
,
e
);
}
log
.
info
(
"初始化应收报表缓存完成"
);
return
""
;
}
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/ReceiptItem/ReceiptItemMapper.xml
View file @
e5366a29
...
...
@@ -108,7 +108,8 @@
SELECT
erwor.receivable_id,
erwor.income_belong,
SUM(erwor.receivable_write_off_amount) AS write_off_amount
IFNULL(SUM(erwor.receivable_write_off_amount), 0) AS write_off_amount
IFNULL(SUM(erwor.write_off_amount), 0) AS write_off_base_amount
FROM ecw_receivable_write_off_record erwor
LEFT JOIN ecw_receipt_item eri ON erwor.receipt_item_id = eri.id
WHERE
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/receivable/ReceivableMapper.xml
View file @
e5366a29
...
...
@@ -486,12 +486,24 @@
<if
test=
"query.selfNo != null and query.selfNo != '' "
>
AND box.self_no LIKE concat('%',#{query.selfNo},'%')
</if>
<if
test=
"query.selfNoList != null and query.selfNoList.size() > 0"
>
AND box.self_no IN
<foreach
collection=
"query.selfNoList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"query.startWarehouseIdList != null and query.startWarehouseIdList.size() > 0"
>
AND box.start_warehouse_id IN
<foreach
collection=
"query.startWarehouseIdList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"query.destCountryId != null and query.destCountryId.size() > 0"
>
AND box.dest_country_id IN
<foreach
collection=
"query.destCountryId"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"query.destWarehouseIdList != null and query.destWarehouseIdList.size() > 0"
>
AND box.dest_warehouse_id IN
<foreach
collection=
"query.destWarehouseIdList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
...
...
@@ -569,4 +581,11 @@
<select
id=
"getAllBoxId"
resultType=
"java.lang.Long"
>
SELECT id FROM ecw_box WHERE deleted = 0 AND pr_status
>
21 AND dest_country_id > 0
</select>
<select
id=
"getDestWarehouseIdListByDestCity"
resultType=
"java.lang.Long"
>
SELECT id FROM ecw_warehouse WHERE deleted = 0
AND shi IN
<foreach
collection=
"query.destCity"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</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