Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
eb942485
Commit
eb942485
authored
Jun 22, 2020
by
季圣华
Browse files
优化供应商对账
parent
e3837616
Changes
7
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/reports/customer_account.html
View file @
eb942485
...
...
@@ -104,7 +104,7 @@
},
{
title
:
'
类型
'
,
field
:
'
type
'
,
width
:
100
},
{
title
:
'
单位名称
'
,
field
:
'
supplierName
'
,
width
:
200
},
{
title
:
'
单据金额
'
,
field
:
'
discountLast
Money
'
,
width
:
80
},
{
title
:
'
单据金额
'
,
field
:
'
bill
Money
'
,
width
:
80
},
{
title
:
'
实际支付
'
,
field
:
'
changeAmount
'
,
width
:
80
},
{
title
:
'
本期变化
'
,
field
:
'
allPrice
'
,
width
:
80
},
{
title
:
'
单据日期
'
,
field
:
'
oTime
'
,
width
:
160
}
...
...
erp_web/pages/reports/vendor_account.html
View file @
eb942485
...
...
@@ -103,7 +103,7 @@
},
{
title
:
'
类型
'
,
field
:
'
type
'
,
width
:
100
},
{
title
:
'
单位名称
'
,
field
:
'
supplierName
'
,
width
:
200
},
{
title
:
'
单据金额
'
,
field
:
'
discountLast
Money
'
,
width
:
80
},
{
title
:
'
单据金额
'
,
field
:
'
bill
Money
'
,
width
:
80
},
{
title
:
'
实际支付
'
,
field
:
'
changeAmount
'
,
width
:
80
},
{
title
:
'
本期变化
'
,
field
:
'
allPrice
'
,
width
:
80
},
{
title
:
'
单据日期
'
,
field
:
'
oTime
'
,
width
:
160
}
...
...
src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
eb942485
...
...
@@ -253,32 +253,35 @@ public class DepotHeadController {
if
((
p1
.
compareTo
(
BigDecimal
.
ZERO
))==-
1
)
{
p1
=
p1
.
abs
();
}
if
(
dha
.
getOtherMoney
()!=
null
)
{
p1
=
p1
.
add
(
dha
.
getOtherMoney
());
//与其它费用相加
}
if
((
p2
.
compareTo
(
BigDecimal
.
ZERO
))==-
1
)
{
p2
=
p2
.
abs
();
}
if
(
type
.
equals
(
"采购入库"
))
{
allPrice
=
p2
.
subtract
(
p1
);
allPrice
=
p2
.
subtract
(
p1
);
}
else
if
(
type
.
equals
(
"销售退货入库"
))
{
allPrice
=
p2
.
subtract
(
p1
);
allPrice
=
p2
.
subtract
(
p1
);
}
else
if
(
type
.
equals
(
"销售出库"
))
{
allPrice
=
p1
.
subtract
(
p2
);
allPrice
=
p1
.
subtract
(
p2
);
}
else
if
(
type
.
equals
(
"采购退货出库"
))
{
allPrice
=
p1
.
subtract
(
p2
);
allPrice
=
p1
.
subtract
(
p2
);
}
else
if
(
type
.
equals
(
"付款"
))
{
allPrice
=
p1
.
add
(
p2
);
}
else
if
(
type
.
equals
(
"收款"
))
{
allPrice
=
BigDecimal
.
ZERO
.
subtract
(
p1
.
add
(
p2
));
}
else
if
(
type
.
equals
(
"收入"
))
{
allPrice
=
p1
.
subtract
(
p2
);
allPrice
=
p1
.
subtract
(
p2
);
}
else
if
(
type
.
equals
(
"支出"
))
{
allPrice
=
p2
.
subtract
(
p1
);
allPrice
=
p2
.
subtract
(
p1
);
}
dha
.
set
DiscountLast
Money
(
p1
);
//金额
dha
.
setChangeAmount
(
p2
);
//
金额
dha
.
set
Bill
Money
(
p1
);
//
单据
金额
dha
.
setChangeAmount
(
p2
);
//
实际支付
DecimalFormat
df
=
new
DecimalFormat
(
".##"
);
dha
.
setAllPrice
(
new
BigDecimal
(
df
.
format
(
allPrice
.
multiply
(
new
BigDecimal
(
j
)))));
//
计算后的金额
dha
.
setSupplierName
(
dha
.
getSupplierName
());
//
供应商
dha
.
setoTime
(
dha
.
getoTime
());
//
入库出库
日期
dha
.
setAllPrice
(
new
BigDecimal
(
df
.
format
(
allPrice
.
multiply
(
new
BigDecimal
(
j
)))));
//
本期变化
dha
.
setSupplierName
(
dha
.
getSupplierName
());
//
单位名称
dha
.
setoTime
(
dha
.
getoTime
());
//
单据
日期
resList
.
add
(
dha
);
}
}
...
...
src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java
View file @
eb942485
...
...
@@ -100,6 +100,12 @@ public interface DepotHeadMapperEx {
@Param
(
"modeName"
)
String
modeName
,
@Param
(
"endTime"
)
String
endTime
);
BigDecimal
findAllOtherMoney
(
@Param
(
"supplierId"
)
Integer
supplierId
,
@Param
(
"type"
)
String
type
,
@Param
(
"subType"
)
String
subType
,
@Param
(
"endTime"
)
String
endTime
);
List
<
DepotHeadVo4List
>
getDetailByNumber
(
@Param
(
"number"
)
String
number
);
...
...
src/main/java/com/jsh/erp/datasource/vo/DepotHeadVo4StatementAccount.java
View file @
eb942485
...
...
@@ -11,6 +11,10 @@ public class DepotHeadVo4StatementAccount {
private
BigDecimal
discountLastMoney
;
private
BigDecimal
otherMoney
;
private
BigDecimal
billMoney
;
private
BigDecimal
changeAmount
;
private
BigDecimal
allPrice
;
...
...
@@ -45,6 +49,22 @@ public class DepotHeadVo4StatementAccount {
this
.
discountLastMoney
=
discountLastMoney
;
}
public
BigDecimal
getOtherMoney
()
{
return
otherMoney
;
}
public
void
setOtherMoney
(
BigDecimal
otherMoney
)
{
this
.
otherMoney
=
otherMoney
;
}
public
BigDecimal
getBillMoney
()
{
return
billMoney
;
}
public
void
setBillMoney
(
BigDecimal
billMoney
)
{
this
.
billMoney
=
billMoney
;
}
public
BigDecimal
getChangeAmount
()
{
return
changeAmount
;
}
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
eb942485
...
...
@@ -343,10 +343,12 @@ public class DepotHeadService {
public
BigDecimal
findAllMoney
(
Integer
supplierId
,
String
type
,
String
subType
,
String
mode
,
String
endTime
)
throws
Exception
{
String
modeName
=
""
;
BigDecimal
allOtherMoney
=
BigDecimal
.
ZERO
;
if
(
mode
.
equals
(
"实际"
))
{
modeName
=
"ChangeAmount"
;
}
else
if
(
mode
.
equals
(
"合计"
))
{
modeName
=
"DiscountLastMoney"
;
allOtherMoney
=
depotHeadMapperEx
.
findAllOtherMoney
(
supplierId
,
type
,
subType
,
endTime
);
}
BigDecimal
result
=
null
;
try
{
...
...
@@ -354,6 +356,9 @@ public class DepotHeadService {
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
if
(
allOtherMoney
!=
null
)
{
result
=
result
.
add
(
allOtherMoney
);
}
return
result
;
}
...
...
src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
eb942485
...
...
@@ -34,6 +34,7 @@
<result
column=
"Number"
jdbcType=
"VARCHAR"
property=
"number"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"DiscountLastMoney"
jdbcType=
"DECIMAL"
property=
"discountLastMoney"
/>
<result
column=
"OtherMoney"
jdbcType=
"DECIMAL"
property=
"otherMoney"
/>
<result
column=
"ChangeAmount"
jdbcType=
"DECIMAL"
property=
"changeAmount"
/>
<result
column=
"supplierName"
jdbcType=
"VARCHAR"
property=
"supplierName"
/>
<result
column=
"oTime"
jdbcType=
"VARCHAR"
property=
"oTime"
/>
...
...
@@ -251,7 +252,7 @@
</select>
<select
id=
"findStatementAccount"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultStatementAccount"
>
select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier supplierName,
select dh.Number,concat(dh.SubType,dh.Type) as type,dh.DiscountLastMoney,dh.
OtherMoney,dh.
ChangeAmount,s.supplier supplierName,
date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh
inner join jsh_supplier s on s.id=dh.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}' and (dh.SubType!='其它' and dh.SubType!='采购订单' and dh.SubType!='销售订单')
...
...
@@ -261,7 +262,7 @@
</if>
and ifnull(dh.delete_Flag,'0') !='1'
UNION ALL
select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,ah.ChangeAmount,s.supplier supplierName,
select ah.BillNo Number,ah.Type as newType,ah.TotalPrice DiscountLastMoney,
0 OtherMoney,
ah.ChangeAmount,s.supplier supplierName,
date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah
inner join jsh_supplier s on s.id=ah.OrganId and ifnull(s.delete_Flag,'0') !='1'
where s.type='${supType}'
...
...
@@ -305,6 +306,12 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select
id=
"findAllOtherMoney"
resultType=
"java.math.BigDecimal"
>
select sum(OtherMoney) as allOtherMoney from jsh_depothead where Type='${type}' and SubType = '${subType}'
and OrganId =${supplierId} and OperTime
<
='${endTime}'
and ifnull(delete_Flag,'0') !='1'
</select>
<select
id=
"getDetailByNumber"
parameterType=
"com.jsh.erp.datasource.entities.DepotHeadExample"
resultMap=
"ResultMapEx"
>
select dh.*, s.supplier OrganName, p.name HandsPersonName, a.name AccountName
from jsh_depothead dh
...
...
Write
Preview
Supports
Markdown
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