Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
platform
hg-smart
Commits
47381568
Commit
47381568
authored
Jul 08, 2024
by
13420
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购收票bug处理
parent
dcc48924
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
14 deletions
+61
-14
ServiceHGCW012.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
+8
-13
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+53
-1
No files found.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
View file @
47381568
...
...
@@ -254,7 +254,7 @@ public class ServiceHGCW012 extends ServiceBase {
mainId
=
queryRows
.
get
(
0
).
get
(
"mainId"
).
toString
();
}
//获取相应的数据
List
<
HGCW013
>
hgcw013List
=
HGCWTools
.
HgCw013
.
mapToList
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
List
<
HGCW013
>
hgcw013List
=
HGCWTools
.
HgCw013
.
mapTo
e
List
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
if
(
CollectionUtils
.
isNotEmpty
(
hgcw013List
))
{
if
(
StringUtils
.
isEmpty
(
mainId
))
{
...
...
@@ -273,8 +273,8 @@ public class ServiceHGCW012 extends ServiceBase {
settlementNumber
.
append
(
hgcw013
.
getSettlementNumber
()).
append
(
","
);
}
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlementNumber
"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
String
c
=
m
.
get
(
"
receiveNo
"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"this
Settlement
Amount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
remainingAmount
);
}
...
...
@@ -283,7 +283,6 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setTaxPoints
(
hgcw013List
.
get
(
0
).
getTaxPoints
());
hgcw012
.
setThisSettlementTax
(
hgcw013List
.
get
(
0
).
getThisSettlementTax
());
hgcw012
.
setThisSettlementAmount
(
hgcw013List
.
get
(
0
).
getThisSettlementAmount
());
hgcw012
.
setBillNumber
(
hgcw013List
.
get
(
0
).
getBillNumber
());
hgcw012
.
setSettlementNumber
(
settlementNumber
.
toString
().
substring
(
0
,
settlementNumber
.
length
()
-
1
));
hgcw012
.
setRemainingAmount
(
new
BigDecimal
(
decimalFormat
.
format
(
totalContractPriceIncluding
)));
this
.
add
(
hgcw012
);
...
...
@@ -292,17 +291,14 @@ public class ServiceHGCW012 extends ServiceBase {
for
(
HGCW013
hgcw013
:
hgcw013List
)
{
hgcw013
.
setMainId
(
hgcw012
.
getId
());
hgcw013
.
setId
(
null
);
// 反写金额
HGCWTools
.
HgCw008
.
deductionAmount
(
hgcw013
.
getSettlementNumber
(),
rowMap
.
get
(
hgcw013
.
getSettlementNumber
()));
DaoUtils
.
insert
(
HGCW013
.
INSERT
,
hgcw013
);
}
}
else
{
HGCW012
hgcw012
=
HGCWTools
.
HgCw012
.
getId
(
mainId
);
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlementNumber
"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
String
c
=
m
.
get
(
"
receiveNo
"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"this
Settlement
Amount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
}
// 生成明细表
...
...
@@ -323,7 +319,6 @@ public class ServiceHGCW012 extends ServiceBase {
hgcw012
.
setTaxPoints
(
hgcw013List
.
get
(
0
).
getTaxPoints
());
hgcw012
.
setThisSettlementTax
(
hgcw013List
.
get
(
0
).
getThisSettlementTax
());
hgcw012
.
setThisSettlementAmount
(
hgcw013List
.
get
(
0
).
getThisSettlementAmount
());
hgcw012
.
setBillNumber
(
hgcw013List
.
get
(
0
).
getBillNumber
());
hgcw012
.
setSettlementNumber
(
settlementNumber
.
toString
().
substring
(
0
,
settlementNumber
.
length
()
-
1
));
this
.
modify
(
hgcw012
);
...
...
@@ -346,7 +341,7 @@ public class ServiceHGCW012 extends ServiceBase {
mainId
=
queryRows
.
get
(
0
).
get
(
"mainId"
).
toString
();
}
//获取相应的数据
List
<
HGCW013
>
hgcw013List
=
HGCWTools
.
HgCw013
.
mapToList
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
List
<
HGCW013
>
hgcw013List
=
HGCWTools
.
HgCw013
.
mapTo
f
List
(
resultRows
,
NumberUtils
.
toLong
(
mainId
));
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
if
(
CollectionUtils
.
isNotEmpty
(
hgcw013List
))
{
if
(
StringUtils
.
isEmpty
(
mainId
))
{
...
...
@@ -365,7 +360,7 @@ public class ServiceHGCW012 extends ServiceBase {
settlementNumber
.
append
(
hgcw013
.
getSettlementNumber
()).
append
(
","
);
}
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlemen
tNumber"
).
toString
();
String
c
=
m
.
get
(
"
contrac
tNumber"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
remainingAmount
);
...
...
@@ -390,7 +385,7 @@ public class ServiceHGCW012 extends ServiceBase {
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlemen
tNumber"
).
toString
();
String
c
=
m
.
get
(
"
contrac
tNumber"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
}
...
...
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
47381568
...
...
@@ -508,7 +508,31 @@ public class HGCWTools {
});
return
results
.
get
(
0
);
}
public
static
List
<
HGCW013
>
mapTofList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
HGCW013
=
new
HGCW013
();
HGCW013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"contractNumber"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
row
.
get
(
"taxPoints"
).
toString
());
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW013
.
setSettlementNumber
(
settlementNumber
);
HGCW013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
HGCW013
.
setMainId
(
mainId
);
}
HGCW013List
.
add
(
HGCW013
);
});
}
return
HGCW013List
;
}
public
static
List
<
HGCW013
>
mapToList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
...
...
@@ -535,6 +559,34 @@ public class HGCWTools {
return
HGCW013List
;
}
public
static
List
<
HGCW013
>
mapToeList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
HGCW013
=
new
HGCW013
();
HGCW013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"receiveNo"
).
toString
();
String
partA
=
row
.
get
(
"supName"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisSettlementAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
"13"
);
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisSettlementAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW013
.
setPartyA
(
partA
);
HGCW013
.
setTaxPoints
(
new
Integer
(
String
.
valueOf
(
taxPoints
)));
HGCW013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW013
.
setSettlementNumber
(
settlementNumber
);
HGCW013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
HGCW013
.
setMainId
(
mainId
);
}
HGCW013List
.
add
(
HGCW013
);
});
}
return
HGCW013List
;
}
public
static
List
<
HGCW013
>
getMainId
(
Long
mainId
)
{
AssertUtils
.
isNull
(
mainId
,
"主表ID不能为空!"
);
List
<
HGCW013
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW013
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
...
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