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
8eb340bf
Commit
8eb340bf
authored
Jun 13, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业信息添加设置标签操作
parent
c170dd05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
242 additions
and
192 deletions
+242
-192
TzBaseEnterpriseInfoDto.java
...amos/boot/module/tzs/api/dto/TzBaseEnterpriseInfoDto.java
+2
-1
TzBaseEnterpriseInfo.java
...amos/boot/module/tzs/api/entity/TzBaseEnterpriseInfo.java
+3
-0
ITzBaseEnterpriseInfoService.java
.../module/tzs/api/service/ITzBaseEnterpriseInfoService.java
+2
-0
TzBaseEnterpriseInfoController.java
...le/tzs/biz/controller/TzBaseEnterpriseInfoController.java
+208
-191
TzBaseEnterpriseInfoServiceImpl.java
...tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+27
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/TzBaseEnterpriseInfoDto.java
View file @
8eb340bf
...
...
@@ -299,5 +299,6 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
private
RegUnitInfoDto
regUnitInfoDto
;
@ApiModelProperty
(
value
=
"企业标签信息"
)
private
String
regulatoryLabels
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/TzBaseEnterpriseInfo.java
View file @
8eb340bf
...
...
@@ -181,4 +181,7 @@ public class TzBaseEnterpriseInfo extends BaseEntity {
@ApiModelProperty
(
value
=
"行业主管部门"
)
private
String
industrySupervisor
;
@ApiModelProperty
(
value
=
"企业标签信息"
)
private
String
regulatoryLabels
;
}
amos-boot-system-tzs/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/ITzBaseEnterpriseInfoService.java
View file @
8eb340bf
...
...
@@ -42,4 +42,6 @@ public interface ITzBaseEnterpriseInfoService extends IService<TzBaseEnterpriseI
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
);
TzBaseEnterpriseInfoDto
getInfoByUseCode
(
String
useCode
);
String
setLabel
(
List
<
Long
>
enterpriseIds
,
List
<
String
>
enterpriseLabels
);
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzBaseEnterpriseInfoController.java
View file @
8eb340bf
...
...
@@ -27,6 +27,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,195 +43,211 @@ import java.util.Map;
@RequestMapping
(
value
=
"/baseEnterprise"
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
class
TzBaseEnterpriseInfoController
{
@Autowired
ITzBaseEnterpriseInfoService
iTzBaseEnterpriseInfoService
;
@Autowired
RedisUtils
redisUtils
;
/**
* 新增企业数据信息
*
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增企业数据信息"
,
notes
=
"新增企业数据信息"
)
public
boolean
saveTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
return
iTzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id删除
*
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iTzBaseEnterpriseInfoService
.
removeById
(
id
);
}
/**
* 修改企业数据信息
*
* @return
*/
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改企业数据信息"
,
notes
=
"修改企业数据信息"
)
public
boolean
updateByIdTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
return
iTzBaseEnterpriseInfoService
.
updateById
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id查询
*
* @param id
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
detail
(
id
));
}
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfo
>>
listPage
(
String
pageNum
,
String
pageSize
,
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
Page
<
TzBaseEnterpriseInfo
>
pageBean
;
QueryWrapper
<
TzBaseEnterpriseInfo
>
tzBaseEnterpriseInfoQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
TzBaseEnterpriseInfo
>
aClass
=
tzBaseEnterpriseInfo
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
tzBaseEnterpriseInfo
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
TzBaseEnterpriseInfo
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Integer
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iTzBaseEnterpriseInfoService
.
page
(
pageBean
,
tzBaseEnterpriseInfoQueryWrapper
);
return
ResponseHelper
.
buildResponse
(
page
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getEquInfo/{sequenceNbr}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过企业id查询设备"
,
notes
=
"通过企业id查询设备"
)
public
ResponseModel
<
List
<
EquEnterDto
>>
getInfo
(
@PathVariable
(
value
=
"sequenceNbr"
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfo
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getEquInfoByUseUnit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过企业名称查询设备"
,
notes
=
"通过企业名称查询设备"
)
public
ResponseModel
<
List
<
EquEnterDto
>>
getInfoByUseUnit
(
String
useUnit
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfoByUseUnit
(
useUnit
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
page
(
PageParam
pageParam
,
TzBaseEnterpriseInfoDto
tzBaseEnterpriseInfoDto
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
page
(
pageParam
,
tzBaseEnterpriseInfoDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/info"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询企业端当前登录人所在企业详情"
,
notes
=
"查询企业端当前登录人所在企业详情"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
pageInfo
(
PageParam
pageParam
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
)){
return
null
;
}
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
page
(
pageParam
,
reginParams
.
getCompany
().
getCompanyName
()));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfoByUseCode"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据统一信用代码查询企业详情"
,
notes
=
"根据统一信用代码查询企业详情"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
getInfoByUseCode
(
String
useCode
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfoByUseCode
(
useCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyInfoUpdate"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
companyInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
companyInfoUpdate
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/adminInfoUpdate"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
public
ResponseModel
<
Object
>
adminInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
Map
<
String
,
Object
>
result
=
iTzBaseEnterpriseInfoService
.
adminInfoUpdate
(
map
);
if
(
result
.
containsKey
(
"fail"
))
{
ResponseModel
responseModel
=
new
ResponseModel
();
responseModel
.
setStatus
(
500
);
responseModel
.
setDevMessage
(
result
.
get
(
"fail"
).
toString
());
return
responseModel
;
}
else
{
return
ResponseHelper
.
buildResponse
(
result
.
get
(
"success"
));
}
}
/**
* 根据企业名称查询企业详情
*
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfo"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据企业名称查询"
,
notes
=
"根据企业名称查询"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
selectByUseUnit
(
HttpServletRequest
request
,
String
useUnit
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
selectByUseUnit
(
useUnit
));
}
/**
* 将监管系统全量用户导入 业务企业表 和 平台企业表
* @return OK
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/syncUnitData"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"同步企业信息"
,
notes
=
"同步企业信息"
)
public
ResponseModel
<
String
>
syncUnitData
(){
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
syncEnterpriseInfo
());
}
@Autowired
ITzBaseEnterpriseInfoService
iTzBaseEnterpriseInfoService
;
@Autowired
RedisUtils
redisUtils
;
/**
* 新增企业数据信息
*
* @return
*/
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增企业数据信息"
,
notes
=
"新增企业数据信息"
)
public
boolean
saveTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
return
iTzBaseEnterpriseInfoService
.
save
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id删除
*
* @param id
* @return
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
boolean
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
iTzBaseEnterpriseInfoService
.
removeById
(
id
);
}
/**
* 修改企业数据信息
*
* @return
*/
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改企业数据信息"
,
notes
=
"修改企业数据信息"
)
public
boolean
updateByIdTzBaseEnterpriseInfo
(
HttpServletRequest
request
,
@RequestBody
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
return
iTzBaseEnterpriseInfoService
.
updateById
(
tzBaseEnterpriseInfo
);
}
/**
* 根据id查询
*
* @param id
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
detail
(
id
));
}
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表分页查询"
,
notes
=
"列表分页查询"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfo
>>
listPage
(
String
pageNum
,
String
pageSize
,
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
Page
<
TzBaseEnterpriseInfo
>
pageBean
;
QueryWrapper
<
TzBaseEnterpriseInfo
>
tzBaseEnterpriseInfoQueryWrapper
=
new
QueryWrapper
<>();
Class
<?
extends
TzBaseEnterpriseInfo
>
aClass
=
tzBaseEnterpriseInfo
.
getClass
();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
tzBaseEnterpriseInfo
);
if
(
o
!=
null
)
{
Class
<?>
type
=
field
.
getType
();
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
if
(
type
.
equals
(
Integer
.
class
))
{
Integer
fileValue
=
(
Integer
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
Long
fileValue
=
(
Long
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
else
{
String
fileValue
=
(
String
)
field
.
get
(
tzBaseEnterpriseInfo
);
tzBaseEnterpriseInfoQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
});
IPage
<
TzBaseEnterpriseInfo
>
page
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Integer
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
page
=
iTzBaseEnterpriseInfoService
.
page
(
pageBean
,
tzBaseEnterpriseInfoQueryWrapper
);
return
ResponseHelper
.
buildResponse
(
page
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getEquInfo/{sequenceNbr}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过企业id查询设备"
,
notes
=
"通过企业id查询设备"
)
public
ResponseModel
<
List
<
EquEnterDto
>>
getInfo
(
@PathVariable
(
value
=
"sequenceNbr"
)
String
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfo
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getEquInfoByUseUnit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过企业名称查询设备"
,
notes
=
"通过企业名称查询设备"
)
public
ResponseModel
<
List
<
EquEnterDto
>>
getInfoByUseUnit
(
String
useUnit
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfoByUseUnit
(
useUnit
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id查询"
,
notes
=
"根据id查询"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
page
(
PageParam
pageParam
,
TzBaseEnterpriseInfoDto
tzBaseEnterpriseInfoDto
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
page
(
pageParam
,
tzBaseEnterpriseInfoDto
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/info"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询企业端当前登录人所在企业详情"
,
notes
=
"查询企业端当前登录人所在企业详情"
)
public
ResponseModel
<
IPage
<
TzBaseEnterpriseInfoDto
>>
pageInfo
(
PageParam
pageParam
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
if
(
ObjectUtils
.
isEmpty
(
reginParams
))
{
return
null
;
}
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
page
(
pageParam
,
reginParams
.
getCompany
().
getCompanyName
()));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfoByUseCode"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据统一信用代码查询企业详情"
,
notes
=
"根据统一信用代码查询企业详情"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
getInfoByUseCode
(
String
useCode
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
getInfoByUseCode
(
useCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyInfoUpdate"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
companyInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
companyInfoUpdate
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/adminInfoUpdate"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改企业信息"
,
notes
=
"修改企业信息"
)
public
ResponseModel
<
Object
>
adminInfoUpdate
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
Map
<
String
,
Object
>
result
=
iTzBaseEnterpriseInfoService
.
adminInfoUpdate
(
map
);
if
(
result
.
containsKey
(
"fail"
))
{
ResponseModel
responseModel
=
new
ResponseModel
();
responseModel
.
setStatus
(
500
);
responseModel
.
setDevMessage
(
result
.
get
(
"fail"
).
toString
());
return
responseModel
;
}
else
{
return
ResponseHelper
.
buildResponse
(
result
.
get
(
"success"
));
}
}
/**
* 根据企业名称查询企业详情
*
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/getInfo"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据企业名称查询"
,
notes
=
"根据企业名称查询"
)
public
ResponseModel
<
TzBaseEnterpriseInfoDto
>
selectByUseUnit
(
HttpServletRequest
request
,
String
useUnit
)
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
selectByUseUnit
(
useUnit
));
}
/**
* 将监管系统全量用户导入 业务企业表 和 平台企业表
*
* @return OK
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/syncUnitData"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"同步企业信息"
,
notes
=
"同步企业信息"
)
public
ResponseModel
<
String
>
syncUnitData
()
{
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
syncEnterpriseInfo
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/setLabel"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设置企业标签"
,
notes
=
"设置企业标签"
)
public
ResponseModel
<
Object
>
setLabel
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
ArrayList
<
String
>
enterpriseLabel
=
new
ArrayList
<>();
ArrayList
<
Long
>
enterpriseIds
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
map
)
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"enterpriseLabel"
))
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"enterpriseIds"
)))
{
enterpriseLabel
=
(
ArrayList
)
map
.
get
(
"enterpriseLabel"
);
enterpriseIds
=
(
ArrayList
)
map
.
get
(
"enterpriseIds"
);
}
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
setLabel
(
enterpriseIds
,
enterpriseLabel
));
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
8eb340bf
...
...
@@ -46,6 +46,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 企业数据信息 服务实现类
...
...
@@ -475,6 +476,32 @@ public class TzBaseEnterpriseInfoServiceImpl
}
@Override
public
String
setLabel
(
List
<
Long
>
enterpriseIds
,
List
<
String
>
enterpriseLabels
)
{
List
<
TzBaseEnterpriseInfo
>
tzBaseEnterpriseInfos
=
tzBaseEnterpriseInfoMapper
.
selectBatchIds
(
enterpriseIds
);
for
(
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
:
tzBaseEnterpriseInfos
)
{
// 标签递增逻辑
// if (!ObjectUtils.isEmpty(tzBaseEnterpriseInfo.getRegulatoryLabels())) {
// String result = checkLabel(enterpriseLabels, tzBaseEnterpriseInfo.getRegulatoryLabels());
// tzBaseEnterpriseInfo.setRegulatoryLabels(result);
// } else {
// String labels = String.join(",", enterpriseLabels);
// tzBaseEnterpriseInfo.setRegulatoryLabels(labels);
// }
String
labels
=
String
.
join
(
","
,
enterpriseLabels
);
tzBaseEnterpriseInfo
.
setRegulatoryLabels
(
labels
);
}
this
.
updateBatchById
(
tzBaseEnterpriseInfos
);
return
"success"
;
}
private
String
checkLabel
(
List
<
String
>
enterpriseLabels
,
String
result
)
{
List
<
String
>
strings
=
Arrays
.
asList
(
result
.
split
(
","
));
ArrayList
<
String
>
res
=
new
ArrayList
<>(
strings
);
List
<
String
>
collect
=
enterpriseLabels
.
stream
().
filter
(
item
->
!
strings
.
contains
(
item
)).
collect
(
Collectors
.
toList
());
res
.
addAll
(
collect
);
return
String
.
join
(
","
,
res
);
}
public
Map
<
String
,
Object
>
adminInfoUpdate
(
Map
<
String
,
Object
>
map
)
{
//每一个企业只有一个管理员,所以当前登录用户即管理员用户
...
...
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