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
1353f7b0
Commit
1353f7b0
authored
May 22, 2019
by
qiankunpingtai
Browse files
去掉项目中使用的getMaxId逻辑
parent
3a78eb51
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/controller/AccountHeadController.java
View file @
1353f7b0
...
...
@@ -35,27 +35,6 @@ public class AccountHeadController {
@Resource
private
AccountHeadService
accountHeadService
;
/**
* 获取最大的id
* @param request
* @return
*/
@GetMapping
(
value
=
"/getMaxId"
)
public
BaseResponseInfo
getMaxId
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
Long
maxId
=
accountHeadService
.
getMaxId
();
map
.
put
(
"maxId"
,
maxId
);
res
.
code
=
200
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
/**
* 查询单位的累计应收和累计应付,收预付款不计入此处
...
...
src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
1353f7b0
...
...
@@ -87,27 +87,6 @@ public class DepotHeadController {
return
res
;
}
/**
* 获取最大的id
* @param request
* @return
*/
@GetMapping
(
value
=
"/getMaxId"
)
public
BaseResponseInfo
getMaxId
(
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
Long
maxId
=
depotHeadService
.
getMaxId
();
map
.
put
(
"maxId"
,
maxId
);
res
.
code
=
200
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
/**
* 查找单据_根据月份(报表)
...
...
src/main/java/com/jsh/erp/datasource/mappers/AccountHeadMapperEx.java
View file @
1353f7b0
...
...
@@ -25,7 +25,6 @@ public interface AccountHeadMapperEx {
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
);
Long
getMaxId
();
BigDecimal
findAllMoney
(
@Param
(
"supplierId"
)
Integer
supplierId
,
...
...
src/main/java/com/jsh/erp/datasource/mappers/DepotHeadMapperEx.java
View file @
1353f7b0
...
...
@@ -36,7 +36,6 @@ public interface DepotHeadMapperEx {
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"dhIds"
)
String
dhIds
);
Long
getMaxId
();
String
findMaterialsListByHeaderId
(
@Param
(
"id"
)
Long
id
);
...
...
src/main/java/com/jsh/erp/service/accountHead/AccountHeadService.java
View file @
1353f7b0
...
...
@@ -188,18 +188,6 @@ public class AccountHeadService {
return
list
==
null
?
0
:
list
.
size
();
}
public
Long
getMaxId
()
throws
Exception
{
Long
result
=
null
;
try
{
result
=
accountHeadMapperEx
.
getMaxId
();
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
result
;
}
public
BigDecimal
findAllMoney
(
Integer
supplierId
,
String
type
,
String
mode
,
String
endTime
)
{
String
modeName
=
""
;
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
1353f7b0
...
...
@@ -287,18 +287,6 @@ public class DepotHeadService {
}
}
public
Long
getMaxId
()
throws
Exception
{
Long
result
=
null
;
try
{
result
=
depotHeadMapperEx
.
getMaxId
();
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
return
result
;
}
public
String
findMaterialsListByHeaderId
(
Long
id
)
throws
Exception
{
String
result
=
null
;
...
...
src/main/resources/mapper_xml/AccountHeadMapperEx.xml
View file @
1353f7b0
...
...
@@ -57,9 +57,6 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select
id=
"getMaxId"
resultType=
"java.lang.Long"
>
select max(Id) as Id from jsh_accounthead
</select>
<select
id=
"findAllMoney"
resultType=
"java.math.BigDecimal"
>
select sum(#{modeName}) as allMoney from jsh_accounthead
...
...
src/main/resources/mapper_xml/DepotHeadMapperEx.xml
View file @
1353f7b0
...
...
@@ -108,9 +108,6 @@
and ifnull(delete_Flag,'0') !='1'
</select>
<select
id=
"getMaxId"
resultType=
"java.lang.Long"
>
select max(Id) as Id from jsh_depothead
</select>
<select
id=
"findMaterialsListByHeaderId"
resultType=
"java.lang.String"
>
select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName
...
...
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