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
d2d7af27
Commit
d2d7af27
authored
May 28, 2019
by
季圣华
Browse files
增加根据id查询明细的接口
parent
90b09cf7
Changes
29
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/controller/ResourceController.java
View file @
d2d7af27
...
...
@@ -32,6 +32,20 @@ public class ResourceController {
return
JsonUtils
.
ok
();
}
@GetMapping
(
value
=
"/{apiName}/info"
)
public
String
getList
(
@PathVariable
(
"apiName"
)
String
apiName
,
@RequestParam
(
"id"
)
Long
id
,
HttpServletRequest
request
)
throws
Exception
{
Object
obj
=
configResourceManager
.
selectOne
(
apiName
,
id
);
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<
String
,
Object
>();
if
(
obj
!=
null
)
{
objectMap
.
put
(
"info"
,
obj
);
return
returnJson
(
objectMap
,
ErpInfo
.
OK
.
name
,
ErpInfo
.
OK
.
code
);
}
else
{
return
returnJson
(
objectMap
,
ErpInfo
.
ERROR
.
name
,
ErpInfo
.
ERROR
.
code
);
}
}
@GetMapping
(
value
=
"/{apiName}/list"
)
public
String
getList
(
@PathVariable
(
"apiName"
)
String
apiName
,
@RequestParam
(
value
=
Constants
.
PAGE_SIZE
,
required
=
false
)
Integer
pageSize
,
...
...
src/main/java/com/jsh/erp/service/CommonQueryManager.java
View file @
d2d7af27
...
...
@@ -30,8 +30,8 @@ public class CommonQueryManager {
* @param apiName 接口名称
* @param id ID
*/
public
Object
selectOne
(
String
apiName
,
Stri
ng
id
)
throws
Exception
{
if
(
StringUtil
.
isNotEmpty
(
apiName
)
&&
StringUtil
.
isNotEmpty
(
id
)
)
{
public
Object
selectOne
(
String
apiName
,
Lo
ng
id
)
throws
Exception
{
if
(
StringUtil
.
isNotEmpty
(
apiName
)
&&
id
!=
null
)
{
return
container
.
getCommonQuery
(
apiName
).
selectOne
(
id
);
}
return
null
;
...
...
src/main/java/com/jsh/erp/service/ICommonQuery.java
View file @
d2d7af27
...
...
@@ -13,12 +13,12 @@ import java.util.Map;
*/
public
interface
ICommonQuery
{
/**
*
查询:解析JSON,查询资源
。
*
根据id查询明细
。
*
* @param
condition
资源id
* @param
id
资源id
* @return 资源
*/
Object
selectOne
(
String
condition
)
throws
Exception
;
Object
selectOne
(
Long
id
)
throws
Exception
;
/**
* 自定义查询
...
...
src/main/java/com/jsh/erp/service/account/AccountComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class AccountComponent implements ICommonQuery {
private
AccountService
accountService
;
@Override
public
Object
selectOne
(
String
condi
tion
)
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Excep
tion
{
return
accountService
.
getAccount
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/account/AccountService.java
View file @
d2d7af27
...
...
@@ -58,7 +58,7 @@ public class AccountService {
@Resource
private
UserService
userService
;
public
Account
getAccount
(
long
id
)
{
public
Account
getAccount
(
long
id
)
throws
Exception
{
return
accountMapper
.
selectByPrimaryKey
(
id
);
}
...
...
src/main/java/com/jsh/erp/service/accountHead/AccountHeadComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class AccountHeadComponent implements ICommonQuery {
private
AccountHeadService
accountHeadService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
accountHeadService
.
getAccountHead
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/accountItem/AccountItemComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class AccountItemComponent implements ICommonQuery {
private
AccountItemService
accountItemService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
accountItemService
.
getAccountItem
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/app/AppComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class AppComponent implements ICommonQuery {
private
AppService
appService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
appService
.
getApp
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/depot/DepotComponent.java
View file @
d2d7af27
...
...
@@ -20,8 +20,8 @@ public class DepotComponent implements ICommonQuery {
private
DepotService
depotService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
depotService
.
getDepot
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/depotHead/DepotHeadComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class DepotHeadComponent implements ICommonQuery {
private
DepotHeadService
depotHeadService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
depotHeadService
.
getDepotHead
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/depotItem/DepotItemComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class DepotItemComponent implements ICommonQuery {
private
DepotItemService
depotItemService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
depotItemService
.
getDepotItem
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/functions/FunctionsComponent.java
View file @
d2d7af27
...
...
@@ -21,8 +21,8 @@ public class FunctionsComponent implements ICommonQuery {
private
FunctionsService
functionsService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
functionsService
.
getFunctions
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/inOutItem/InOutItemComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class InOutItemComponent implements ICommonQuery {
private
InOutItemService
inOutItemService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
inOutItemService
.
getInOutItem
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/log/LogComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class LogComponent implements ICommonQuery {
private
LogService
logService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
logService
.
getLog
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/material/MaterialComponent.java
View file @
d2d7af27
...
...
@@ -21,8 +21,8 @@ public class MaterialComponent implements ICommonQuery {
private
MaterialService
materialService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
materialService
.
getMaterial
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryComponent.java
View file @
d2d7af27
...
...
@@ -21,8 +21,8 @@ public class MaterialCategoryComponent implements ICommonQuery {
private
MaterialCategoryService
materialCategoryService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
materialCategoryService
.
getMaterialCategory
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/materialProperty/MaterialPropertyComponent.java
View file @
d2d7af27
...
...
@@ -19,8 +19,8 @@ public class MaterialPropertyComponent implements ICommonQuery {
private
MaterialPropertyService
materialPropertyService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
materialPropertyService
.
getMaterialProperty
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelComponent.java
View file @
d2d7af27
...
...
@@ -21,9 +21,10 @@ import java.util.Map;
public
class
OrgaUserRelComponent
implements
ICommonQuery
{
@Resource
private
OrgaUserRelService
orgaUserRelService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
orgaUserRelService
.
getOrgaUserRel
(
id
)
;
}
@Override
...
...
src/main/java/com/jsh/erp/service/orgaUserRel/OrgaUserRelService.java
View file @
d2d7af27
...
...
@@ -41,6 +41,11 @@ public class OrgaUserRelService {
private
UserService
userService
;
@Resource
private
LogService
logService
;
public
OrgaUserRel
getOrgaUserRel
(
long
id
)
throws
Exception
{
return
orgaUserRelMapper
.
selectByPrimaryKey
(
id
);
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
int
insertOrgaUserRel
(
String
beanJson
,
HttpServletRequest
request
)
throws
Exception
{
OrgaUserRel
orgaUserRel
=
JSONObject
.
parseObject
(
beanJson
,
OrgaUserRel
.
class
);
...
...
src/main/java/com/jsh/erp/service/organization/OrganizationComponent.java
View file @
d2d7af27
...
...
@@ -22,9 +22,10 @@ import java.util.Map;
public
class
OrganizationComponent
implements
ICommonQuery
{
@Resource
private
OrganizationService
organizationService
;
@Override
public
Object
selectOne
(
String
condition
)
throws
Exception
{
return
null
;
public
Object
selectOne
(
Long
id
)
throws
Exception
{
return
organizationService
.
getOrganization
(
id
)
;
}
@Override
...
...
Prev
1
2
Next
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