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
9982361d
Commit
9982361d
authored
Jan 08, 2025
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(wealth): 费用明细优化
parent
020eaa82
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
17 deletions
+50
-17
ReceiptItemServiceImpl.java
...le/wealth/service/receiptItem/ReceiptItemServiceImpl.java
+2
-2
ReceivableServiceImpl.java
...dule/wealth/service/receivable/ReceivableServiceImpl.java
+15
-9
CostDetailPageQueryVO.java
...ao/module/wealth/vo/receivable/CostDetailPageQueryVO.java
+1
-1
CostDetailPageVO.java
...r/yudao/module/wealth/vo/receivable/CostDetailPageVO.java
+13
-0
ReceiptInvoiceMapper.xml
.../resources/mapper/receiptInvoice/ReceiptInvoiceMapper.xml
+1
-1
ReceivableMapper.xml
...src/main/resources/mapper/receivable/ReceivableMapper.xml
+18
-4
No files found.
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receiptItem/ReceiptItemServiceImpl.java
View file @
9982361d
...
...
@@ -130,9 +130,9 @@ public class ReceiptItemServiceImpl extends AbstractService<ReceiptItemMapper, R
receivableService
.
createWriteOffRecord
(
receivableWriteOffReqVO
,
receiptItem
);
}
// TODO 校验当前收款单汇率是否过期,过期则更新为导入的汇率 没过期不更新?更新汇率后有效期是啥?
if
(
receiptDO
.
getRateValidateDate
().
before
(
new
Date
()))
{
//
if (receiptDO.getRateValidateDate().before(new Date())) {
// 更新收款单汇率,且更新应收金额
}
//
}
// 创建收款明细的时候要判断收款单状态进行更新
if
(
receiptDO
.
getState
()
==
1
)
{
ReceiptDO
update
=
new
ReceiptDO
();
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/service/receivable/ReceivableServiceImpl.java
View file @
9982361d
...
...
@@ -328,7 +328,11 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
receivableBackVO
.
setBaseAmount
(
BigDecimal
.
ZERO
);
}
// 核销比例 = 已核销金额 / 实际金额,保留两位小数字符串
receivableBackVO
.
setWriteOffProportion
(
receivableBackVO
.
getWriteOffAmount
().
divide
(
receivableBackVO
.
getActualAmount
(),
2
,
RoundingMode
.
HALF_UP
).
toString
());
if
(
receivableBackVO
.
getWriteOffAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
||
receivableBackVO
.
getActualAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
receivableBackVO
.
setWriteOffProportion
(
"0.00%"
);
}
else
{
receivableBackVO
.
setWriteOffProportion
(
receivableBackVO
.
getWriteOffAmount
().
divide
(
receivableBackVO
.
getActualAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
)).
toString
());
}
});
return
receivableBackVOList
;
}
...
...
@@ -507,15 +511,17 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
if
(
vo
.
getWriteOffAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
||
vo
.
getReceivableTotalAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
vo
.
setWriteOffProportion
(
"0.00%"
);
}
else
{
vo
.
setWriteOffProportion
(
vo
.
getWriteOffAmount
().
divide
(
vo
.
getReceivableTotalAmount
(),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
))
+
"%"
);
vo
.
setWriteOffProportion
(
vo
.
getWriteOffAmount
().
divide
(
vo
.
getReceivableTotalAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
new
BigDecimal
(
"100"
))
+
"%"
);
}
// 存在应收明细关联的定单不存在的情况
if
(
vo
.
getDestinationCity
()
!=
null
&&
vo
.
getDestinationCountry
()
!=
null
)
{
RegionDTO
regionCity
=
regionApi
.
getRegionById
(
vo
.
getDestinationCity
().
longValue
());
vo
.
setDestinationCityZh
(
regionCity
.
getTitleZh
());
vo
.
setDestinationCityEn
(
regionCity
.
getTitleEn
());
RegionDTO
regionCountry
=
regionApi
.
getRegionById
(
vo
.
getDestinationCountry
().
longValue
());
vo
.
setDestinationCountryZh
(
regionCountry
.
getTitleZh
());
vo
.
setDestinationCountryEn
(
regionCountry
.
getTitleEn
());
}
RegionDTO
regionCity
=
regionApi
.
getRegionById
(
vo
.
getDestinationCity
().
longValue
());
vo
.
setDestinationCityZh
(
regionCity
.
getTitleZh
());
vo
.
setDestinationCityEn
(
regionCity
.
getTitleEn
());
RegionDTO
regionCountry
=
regionApi
.
getRegionById
(
vo
.
getDestinationCountry
().
longValue
());
vo
.
setDestinationCountryZh
(
regionCountry
.
getTitleZh
());
vo
.
setDestinationCountryEn
(
regionCountry
.
getTitleEn
());
});
return
voBuilder
.
list
(
records
)
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/CostDetailPageQueryVO.java
View file @
9982361d
...
...
@@ -14,7 +14,7 @@ public class CostDetailPageQueryVO {
private
String
orderNo
;
@ApiModelProperty
(
value
=
"运输方式id"
)
private
Integer
transportId
;
private
List
<
Integer
>
transportId
;
@ApiModelProperty
(
value
=
"出货渠道(多选)"
)
private
List
<
Integer
>
shipmentChannel
;
...
...
yudao-module-wealth/yudao-module-wealth-core/src/main/java/cn/iocoder/yudao/module/wealth/vo/receivable/CostDetailPageVO.java
View file @
9982361d
package
cn
.
iocoder
.
yudao
.
module
.
wealth
.
vo
.
receivable
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -8,6 +9,9 @@ import lombok.Data;
import
java.math.BigDecimal
;
import
java.util.Date
;
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
@ApiModel
(
"管理后台 - 费用明细分页 Response VO"
)
public
class
CostDetailPageVO
{
...
...
@@ -165,8 +169,17 @@ public class CostDetailPageVO {
private
String
writeOffProportion
;
@ApiModelProperty
(
value
=
"更新时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
private
Date
updateTime
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updater
;
@ApiModelProperty
(
value
=
"创建时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
private
Date
createTime
;
@ApiModelProperty
(
value
=
"审批人"
)
private
String
approver
;
@ApiModelProperty
(
value
=
"审批时间"
)
@JsonFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
private
Date
approverTime
;
}
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/receiptInvoice/ReceiptInvoiceMapper.xml
View file @
9982361d
...
...
@@ -17,7 +17,7 @@
LEFT JOIN system_dept sd ON su.dept_id = sd.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 o ON o.order_id=rb.order_id
WHERE eri.deleted = 0 AND er.
bmp_status = 2
WHERE eri.deleted = 0 AND er.
state NOT IN (0, 7, 8) AND er.state IS NOT NULL
<if
test=
"query.receiptNo != null and query.receiptNo != '' "
>
AND eri.`receipt_no` LIKE CONCAT('%',#{query.receiptNo},'%')
</if>
...
...
yudao-module-wealth/yudao-module-wealth-rest/src/main/resources/mapper/receivable/ReceivableMapper.xml
View file @
9982361d
...
...
@@ -4,7 +4,6 @@
<select
id=
"getCostDetailPage"
resultType=
"cn.iocoder.yudao.module.wealth.vo.receivable.CostDetailPageVO"
>
SELECT
r.*,
o.order_no,
o.transport_id,
o.channel_id,
...
...
@@ -16,13 +15,20 @@
obw.title_zh objective_warehouse_zh,
obw.title_en objective_warehouse_en,
obw.guojia destination_country,
obw.shi destination_city
obw.shi destination_city,
usu.username AS updater,
asu.username AS approver,
ra.update_time AS approverTime,
r.*
FROM ecw_receivable r
LEFT JOIN ecw_order o ON o.order_id = r.order_id
LEFT JOIN ecw_order_departure de ON de.order_id = o.order_id
LEFT JOIN ecw_order_objective ob ON ob.order_id = o.order_id
LEFT JOIN ecw_warehouse dew ON de.departure_warehouse_id = dew.id
LEFT JOIN ecw_warehouse obw ON ob.objective_warehouse_id = obw.id
LEFT JOIN ecw_receipt_approval ra ON ra.receipt_id = r.receipt_id
LEFT JOIN system_user usu ON usu.id = r.updater
LEFT JOIN system_user asu ON asu.id = ra.updater
WHERE
r.deleted = 0
<include
refid=
"costDetailPageCondition"
/>
...
...
@@ -36,7 +42,7 @@
SUM(r.discount_total) AS discount_total,
SUM(r.write_off_amount) AS write_off_amount
FROM ecw_receivable r
<if
test=
"
query.transportId != null
or query.shipmentChannel != null or query.status != null"
>
<if
test=
"
(query.transportId != null and query.transportId.size() != 0)
or query.shipmentChannel != null or query.status != null"
>
LEFT JOIN ecw_order o ON o.order_id = r.order_id
</if>
<if
test=
"query.departureWareHouseId != null"
>
...
...
@@ -56,7 +62,15 @@
AND r.order_no = #{query.orderNo}
</if>
<if
test=
"query.transportId != null"
>
AND o.transport_id = #{query.transportId}
<if
test=
"query.transportId.size() == 1"
>
AND o.transport_id = #{query.transportId[0]}
</if>
<if
test=
"query.transportId.size() > 1"
>
AND o.transport_id IN
<foreach
collection=
"query.transportId"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</if>
<if
test=
"query.shipmentChannel != null"
>
<if
test=
"query.shipmentChannel.size() == 1"
>
...
...
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