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
ab680f9f
Commit
ab680f9f
authored
Jan 07, 2021
by
季圣华
Browse files
解决账户报表统计的bug
parent
2b0d8d7d
Changes
5
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/reports/account_report.html
View file @
ab680f9f
...
...
@@ -196,6 +196,10 @@
type
:
"
get
"
,
url
:
"
/account/getStatistics
"
,
dataType
:
"
json
"
,
data
:
({
name
:
name
,
serialNo
:
serialNo
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
)
{
...
...
src/main/java/com/jsh/erp/controller/AccountController.java
View file @
ab680f9f
...
...
@@ -179,10 +179,12 @@ public class AccountController {
* @return
*/
@GetMapping
(
value
=
"/getStatistics"
)
public
BaseResponseInfo
getStatistics
(
HttpServletRequest
request
)
throws
Exception
{
public
BaseResponseInfo
getStatistics
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"serialNo"
)
String
serialNo
,
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
Map
<
String
,
Object
>
map
=
accountService
.
getStatistics
();
Map
<
String
,
Object
>
map
=
accountService
.
getStatistics
(
name
,
serialNo
);
res
.
code
=
200
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
...
...
src/main/java/com/jsh/erp/datasource/mappers/AccountMapperEx.java
View file @
ab680f9f
...
...
@@ -11,6 +11,10 @@ import java.util.List;
public
interface
AccountMapperEx
{
List
<
Account
>
getAccountByParam
(
@Param
(
"name"
)
String
name
,
@Param
(
"serialNo"
)
String
serialNo
);
List
<
AccountVo4List
>
selectByConditionAccount
(
@Param
(
"name"
)
String
name
,
@Param
(
"serialNo"
)
String
serialNo
,
...
...
@@ -32,4 +36,5 @@ public interface AccountMapperEx {
@Param
(
"accountId"
)
Long
accountId
);
int
batchDeleteAccountByIds
(
@Param
(
"updateTime"
)
Date
updateTime
,
@Param
(
"updater"
)
Long
updater
,
@Param
(
"ids"
)
String
ids
[]);
}
\ No newline at end of file
src/main/java/com/jsh/erp/service/account/AccountService.java
View file @
ab680f9f
...
...
@@ -84,7 +84,16 @@ public class AccountService {
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
List
<
Account
>
getAccountByParam
(
String
name
,
String
serialNo
)
throws
Exception
{
List
<
Account
>
list
=
null
;
try
{
list
=
accountMapperEx
.
getAccountByParam
(
name
,
serialNo
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
List
<
AccountVo4List
>
select
(
String
name
,
String
serialNo
,
String
remark
,
int
offset
,
int
rows
)
throws
Exception
{
...
...
@@ -547,10 +556,10 @@ public class AccountService {
}
public
Map
<
String
,
Object
>
getStatistics
()
{
public
Map
<
String
,
Object
>
getStatistics
(
String
name
,
String
serialNo
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
try
{
List
<
Account
>
list
=
getAccount
(
);
List
<
Account
>
list
=
getAccount
ByParam
(
name
,
serialNo
);
String
timeStr
=
Tools
.
getCurrentMonth
();
BigDecimal
allMonthAmount
=
BigDecimal
.
ZERO
;
BigDecimal
allCurrentAmount
=
BigDecimal
.
ZERO
;
...
...
src/main/resources/mapper_xml/AccountMapperEx.xml
View file @
ab680f9f
...
...
@@ -15,6 +15,20 @@
<result
column=
"AMList"
jdbcType=
"VARCHAR"
property=
"amList"
/>
</resultMap>
<select
id=
"getAccountByParam"
resultType=
"com.jsh.erp.datasource.entities.Account"
>
select *
FROM jsh_account
where 1=1
<if
test=
"name != null and name !=''"
>
<bind
name=
"bindName"
value=
"'%'+name+'%'"
/>
and name like #{bindName}
</if>
<if
test=
"serialNo != null and serialNo !=''"
>
<bind
name=
"bindSerialNo"
value=
"'%'+serialNo+'%'"
/>
and serial_no like #{bindSerialNo}
</if>
</select>
<select
id=
"selectByConditionAccount"
parameterType=
"com.jsh.erp.datasource.entities.AccountExample"
resultMap=
"ResultListMap"
>
select *
FROM jsh_account
...
...
@@ -173,6 +187,7 @@
and ifnull(dh.delete_flag,'0') !='1'
) cc
</select>
<update
id=
"batchDeleteAccountByIds"
>
update jsh_account
set delete_flag='1'
...
...
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