Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
b1c70315
Commit
b1c70315
authored
Mar 15, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备认领或设备管理列表接口
parent
bd135c67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
4 deletions
+93
-4
IdxFeignService.java
...n/amos/boot/module/tzs/flc/api/feign/IdxFeignService.java
+9
-4
PrivilegeFeginService.java
.../boot/module/tzs/flc/api/feign/PrivilegeFeginService.java
+16
-0
EquipmentCategoryController.java
...odule/tzs/biz/controller/EquipmentCategoryController.java
+9
-0
EquipmentCategoryServiceImpl.java
...le/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
+59
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/feign/IdxFeignService.java
View file @
b1c70315
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.Claim
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.IdxTable
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
...
...
@@ -25,4 +25,9 @@ public interface IdxFeignService {
*/
@RequestMapping
(
value
=
"/table/{tableId}"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
JSONObject
>
queryByTableId
(
@PathVariable
String
tableId
);
/**
* */
@RequestMapping
(
value
=
"/table/getPage"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getPage
(
@RequestParam
Map
map
);
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/feign/PrivilegeFeginService.java
0 → 100644
View file @
b1c70315
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
flc
.
api
.
feign
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@FeignClient
(
value
=
"AMOS-API-PRIVILEGE"
,
path
=
"privilege"
)
public
interface
PrivilegeFeginService
{
@RequestMapping
(
value
=
"/v1/agencyuser/me"
,
method
=
RequestMethod
.
GET
)
ResponseModel
<
AgencyUserModel
>
getMe
();
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/EquipmentCategoryController.java
View file @
b1c70315
...
...
@@ -201,4 +201,13 @@ public class EquipmentCategoryController extends BaseController {
public
ResponseModel
<
Object
>
creatTree
()
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
creatTree
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTable"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备认领和设备管理通用接口"
,
notes
=
"设备认领和设备管理通用接口"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTable
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
equipmentCategoryServiceImpl
.
getTable
(
map
);
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
b1c70315
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EquipmentCategoryDto
;
...
...
@@ -12,7 +13,11 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.EquipmentCategoryMapper;
import
com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService
;
import
com.yeejoin.amos.boot.module.tzs.biz.fegin.PrivilegeFeign
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.JsonUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.IdxFeignService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.feign.PrivilegeFeginService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
...
...
@@ -20,6 +25,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
...
...
@@ -47,6 +53,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
@Autowired
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
@Autowired
PrivilegeFeginService
privilegeFeginService
;
@Autowired
IdxFeignService
idxFeignService
;
/**
* 分页查询
*/
...
...
@@ -242,4 +254,50 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return
resultMap
;
}
/**
* 获取当前登录人单位类型
*
*
* @return
*/
public
JSONObject
getCompanyType
()
{
ResponseModel
<
AgencyUserModel
>
me
=
privilegeFeginService
.
getMe
();
CompanyModel
companyModel
=
(
me
.
getResult
().
getCompanys
()).
get
(
0
);
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"leve"
,
companyModel
.
getLevel
());
object
.
put
(
"companyCode"
,
companyModel
.
getCompanyCode
());
return
object
;
}
/**
* levlel=company,是企业,如果不是都是监管单位,
* * 在接口中查询当前登录人所属单位是监管单位还是企业。
* * 如果为监管单位添加监管机构查询参数(ORG_BRANCH_CODE);
* * 如果为企业添加使用单位查询参数(USE_UNIT_CREDIT_CODE)
*/
private
static
final
String
LEVEL
=
"company"
;
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTable
(
Map
<
String
,
Object
>
map
)
{
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
model
=
new
ResponseModel
<>();
JSONObject
object
=
getCompanyType
();
String
leve
=
object
.
getString
(
"leve"
);
String
code
=
object
.
getString
(
"companyCode"
);
if
(!
ValidationUtil
.
isEmpty
(
leve
))
{
if
(
LEVEL
.
equals
(
leve
))
{
//企业
map
.
put
(
"USE_UNIT_CREDIT_CODE"
,
code
);
model
=
idxFeignService
.
getPage
(
map
);
}
else
{
//监管单位
map
.
put
(
"ORG_BRANCH_CODE"
,
code
);
model
=
idxFeignService
.
getPage
(
map
);
}
}
return
model
;
}
}
\ No newline at end of file
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