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
946c650d
Commit
946c650d
authored
Mar 06, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增设备设备种类增加约束
http://113.142.68.105:5080/zentao/task-view-22896.html
parent
bbfb36e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
20 deletions
+66
-20
IdxBizJqEquipmentRegisterController.java
...g/biz/controller/IdxBizJqEquipmentRegisterController.java
+24
-20
IIdxBizJgRegisterInfoService.java
...t/module/jg/biz/service/IIdxBizJgRegisterInfoService.java
+4
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+38
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/IdxBizJqEquipmentRegisterController.java
View file @
946c650d
...
...
@@ -4,19 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService
;
import
com.yeejoin.amos.
boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto
;
import
com.yeejoin.amos.
feign.systemctl.model.DictionarieValueModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -33,20 +25,21 @@ import java.util.Map;
* @date 2023/12/13 14:37
*/
@RestController
@Api
(
tags
=
"设备注册Api"
)
@RequestMapping
(
value
=
"/equipment-register"
)
@Api
(
tags
=
"设备注册Api"
)
@RequestMapping
(
value
=
"/equipment-register"
)
public
class
IdxBizJqEquipmentRegisterController
extends
BaseController
{
@Autowired
IIdxBizJgRegisterInfoService
idxBizJgRegisterInfoService
;
/**
* 设备注册和更新信息
*
* @param paramMap
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/submit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备注册和更新信息"
,
notes
=
"设备注册和更新信息"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/submit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备注册和更新信息"
,
notes
=
"设备注册和更新信息"
)
public
ResponseModel
<
Object
>
submit
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
equipmentRegisterSubmit
(
paramMap
));
}
...
...
@@ -60,17 +53,18 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/deleteBatch"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除设备注册信息"
,
notes
=
"批量删除设备注册信息"
)
public
ResponseModel
<
Boolean
>
deleteByRecordList
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Boolean
>
deleteByRecordList
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
batchDeleteByRecord
(
map
));
}
/**
* 查询设备注册信息详情
*
* @param record
* @return 返回由页签的key包裹详情对象
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{record}"
)
@GetMapping
(
value
=
"/{record}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据record查询设备注册信息详情"
,
notes
=
"根据record查询设备注册信息详情"
)
public
ResponseModel
<
Object
>
selectOne
(
@PathVariable
String
record
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
getEquipmentRegisterByRecord
(
record
));
...
...
@@ -79,18 +73,19 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
/**
* 查询设备注册信息详情
*
* @param record
* @return 只返回详情对象
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/detail"
)
@GetMapping
(
value
=
"/detail"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据record查询设备注册信息详情"
,
notes
=
"根据record查询设备注册信息详情"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetail
(
@RequestParam
String
record
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
getDetailByRecord
(
record
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/detailFieldCamelCase"
)
@GetMapping
(
value
=
"/detailFieldCamelCase"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据record查询设备注册信息详情,返回字段驼峰命名"
,
notes
=
"根据record查询设备注册信息详情,返回字段驼峰命名"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getDetailFieldCamelCase
(
@RequestParam
String
record
)
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
getDetailFieldCamelCaseByRecord
(
record
));
...
...
@@ -98,15 +93,24 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
/**
* 查询设备注册列表
*
* @param map
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备注册信息分页查询"
,
notes
=
"设备注册信息分页查询"
)
public
ResponseModel
<
Page
<
JSONObject
>>
queryForPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Page
<
JSONObject
>>
queryForPage
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
JSONObject
jsonObject
=
new
JSONObject
(
map
);
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
queryForEquipmentRegisterPage
(
jsonObject
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/category/list"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询不同单位类型可新增的设备种类列表"
,
notes
=
"查询不同单位类型可新增的设备种类列表"
)
public
ResponseModel
<
List
<
DictionarieValueModel
>>
equCategoryListByCompanyType
()
{
return
ResponseHelper
.
buildResponse
(
idxBizJgRegisterInfoService
.
equCategoryListByCompanyType
(
getSelectedOrgInfo
()));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/IIdxBizJgRegisterInfoService.java
View file @
946c650d
...
...
@@ -3,7 +3,9 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.List
;
...
...
@@ -28,4 +30,6 @@ public interface IIdxBizJgRegisterInfoService {
Map
<
String
,
Object
>
getDetailByRecord
(
String
record
);
Map
<
String
,
Object
>
getDetailFieldCamelCaseByRecord
(
String
record
);
List
<
DictionarieValueModel
>
equCategoryListByCompanyType
(
ReginParams
selectedOrgInfo
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
946c650d
...
...
@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import
com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest
;
import
com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.ymt.api.common.StringUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
...
...
@@ -28,8 +29,11 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
...
...
@@ -41,6 +45,7 @@ import org.elasticsearch.index.query.QueryBuilders;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.elasticsearch.search.sort.SortOrder
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -151,6 +156,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
@Autowired
private
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
public
final
static
String
USE_TYPE_NAME
=
"使用单位"
;
public
final
static
String
MAINTENANCE_TYPE_NAME
=
"安装改造维修单位"
;
@Value
(
"${add.equip.dict.code.suffix:CATEGORY_LIST_ADD}"
)
private
String
equipAddDictCodeSuffix
;
/**
* 设备注册信息
*
...
...
@@ -308,6 +321,31 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
resultMap
;
}
@Override
public
List
<
DictionarieValueModel
>
equCategoryListByCompanyType
(
ReginParams
selectedOrgInfo
)
{
String
companyType
=
selectedOrgInfo
.
getCompany
().
getCompanyType
();
String
dictCodePrefix
=
getDictCodePrefix
(
companyType
);
if
(
StringUtils
.
isEmpty
(
dictCodePrefix
)){
return
new
ArrayList
<>();
}
String
dictCode
=
String
.
format
(
"%s_%s"
,
dictCodePrefix
,
equipAddDictCodeSuffix
);
return
FeignUtil
.
remoteCall
(()->
Systemctl
.
dictionarieClient
.
dictValues
(
dictCode
));
}
private
String
getDictCodePrefix
(
String
companyType
)
{
String
dictCodePrefix
=
""
;
if
(
companyType
.
contains
(
USE_TYPE_NAME
)
&&
!
companyType
.
contains
(
MAINTENANCE_TYPE_NAME
))
{
// 使用单位
dictCodePrefix
=
"USE"
;
}
if
(
companyType
.
contains
(
MAINTENANCE_TYPE_NAME
)
&&
!
companyType
.
contains
(
USE_TYPE_NAME
))
{
// 安改维单位
dictCodePrefix
=
"MAINTENANCE"
;
}
if
(
companyType
.
contains
(
MAINTENANCE_TYPE_NAME
)
&&
companyType
.
contains
(
USE_TYPE_NAME
))
{
// 所有单位
dictCodePrefix
=
"ALL"
;
}
return
dictCodePrefix
;
}
/**
* 查询设备种类信息
...
...
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