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
a6c96af0
Commit
a6c96af0
authored
Jul 17, 2024
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
21080 添加设备时,设备品种可以为空进行提交,导致设备原本有品种提交了无品种数据的设备。
parent
4b823c1b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
41 deletions
+45
-41
EquipmentCategoryController.java
...odule/ymt/biz/controller/EquipmentCategoryController.java
+45
-41
No files found.
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/controller/EquipmentCategoryController.java
View file @
a6c96af0
...
...
@@ -12,11 +12,7 @@ import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipExportDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentMessageDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgConstructionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMaintenanceRecordInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ImageSizeEnums
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgOtherInfoMapper
;
...
...
@@ -32,15 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.util.ObjectUtils
;
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.RequestBody
;
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.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -77,7 +65,7 @@ public class EquipmentCategoryController extends BaseController {
@Value
(
"${regulatory_code_prefix}"
)
String
REGULATORY_CODE_PREFIX
;
String
REGULATORY_CODE_PREFIX
;
@Autowired
...
...
@@ -162,8 +150,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"装备分类列表全部数据查询"
,
notes
=
"装备分类列表全部数据查询"
)
@GetMapping
(
value
=
"/tree"
)
public
ResponseModel
<
Object
>
tree
(
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
throws
Exception
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
public
ResponseModel
<
Object
>
tree
(
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
throws
Exception
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
return
ResponseHelper
.
buildResponse
(
new
ArrayList
<>());
}
EquipmentCategory
root
=
equipmentCategoryServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
EquipmentCategory
>().
eq
(
EquipmentCategory:
:
getCode
,
code
));
...
...
@@ -180,6 +168,24 @@ public class EquipmentCategoryController extends BaseController {
}
/**
* 设备类别下是否有设备品种。有返回数量,没有返回0
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备类别下是否有设备品种"
,
notes
=
"设备类别下是否有设备品种"
)
@GetMapping
(
value
=
"/haveTree"
)
public
ResponseModel
<
String
>
haveTree
(
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
return
ResponseHelper
.
buildResponse
(
"0"
);
}
QueryWrapper
<
EquipmentCategory
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
likeRight
(
"code"
,
code
.
replaceAll
(
"0+$"
,
""
));
int
count
=
equipmentCategoryServiceImpl
.
count
(
queryWrapper
);
return
ResponseHelper
.
buildResponse
(
count
+
""
);
}
/**
* 返回设备品种树第一个节点
*
* @return
...
...
@@ -188,8 +194,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"装备分类列表全部数据查询"
,
notes
=
"装备分类列表全部数据查询"
)
@GetMapping
(
value
=
"/firstNode"
)
public
ResponseModel
<
Object
>
firstNode
(
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
throws
Exception
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
public
ResponseModel
<
Object
>
firstNode
(
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
)
throws
Exception
{
if
(
ObjectUtils
.
isEmpty
(
code
))
{
return
ResponseHelper
.
buildResponse
(
new
ArrayList
<>());
}
EquipmentCategory
root
=
equipmentCategoryServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
EquipmentCategory
>().
eq
(
EquipmentCategory:
:
getCode
,
code
));
...
...
@@ -212,7 +218,7 @@ public class EquipmentCategoryController extends BaseController {
public
ResponseModel
<
JSONArray
>
selectClassify
()
{
List
<
EquipmentCategoryDto
>
equipmentCategoryDtos
=
equipmentCategoryServiceImpl
.
selectClassify
();
JSONArray
jsonArray
=
new
JSONArray
();
equipmentCategoryDtos
.
forEach
(
e
->
{
equipmentCategoryDtos
.
forEach
(
e
->
{
jsonArray
.
add
(
e
.
getName
());
}
);
...
...
@@ -227,8 +233,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备八大类列表树"
,
notes
=
"设备八大类列表树"
)
@GetMapping
(
value
=
"/equipTree"
)
public
ResponseModel
<
Object
>
equipTree
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
equipTree
(
type
));
public
ResponseModel
<
Object
>
equipTree
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
String
type
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
equipTree
(
type
));
}
/**
...
...
@@ -251,18 +257,19 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/createSupervisorCode"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"生成监管码和96333码"
,
notes
=
"生成监管码和96333码"
)
public
ResponseModel
<
Object
>
createSupervisorCode
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
createSupervisorCode
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
createSupervisorCode
(
map
));
}
/**
* 修改数据状态是否显示编辑按钮
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateOtherInfo"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"修改数据状态"
,
notes
=
"修改数据状态"
)
public
ResponseModel
<
Object
>
updateOtherInfo
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
updateOtherInfo
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
updateOtherInfo
(
map
));
}
...
...
@@ -281,9 +288,9 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/checkCode"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"校验使用登记证编号、设备代码、96333码重复"
,
notes
=
"校验使用登记证编号、设备代码、96333码重复"
)
public
ResponseModel
<
Object
>
checkCode
(
@RequestBody
Map
<
String
,
Object
>
obj
)
{
public
ResponseModel
<
Object
>
checkCode
(
@RequestBody
Map
<
String
,
Object
>
obj
)
{
String
message
=
equipmentCategoryService
.
checkCode
(
obj
);
if
(
ObjectUtils
.
isEmpty
(
message
))
{
if
(
ObjectUtils
.
isEmpty
(
message
))
{
return
ResponseHelper
.
buildResponse
(
true
);
}
else
{
ResponseModel
<
Object
>
response
=
new
ResponseModel
();
...
...
@@ -316,7 +323,7 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/deleteBatch"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除一码通数据"
,
notes
=
"批量删除一码通数据"
)
public
ResponseModel
<
Object
>
deleteBatch
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Object
>
deleteBatch
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
deleteBatch
(
map
));
}
...
...
@@ -339,7 +346,7 @@ public class EquipmentCategoryController extends BaseController {
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/creatXiXian"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"西咸存量数据处理功能"
,
notes
=
"西咸存量数据处理功能"
)
public
ResponseModel
<
Object
>
creatXiXian
(
@RequestParam
String
type
)
{
...
...
@@ -348,11 +355,10 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getTable"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备认领和设备管理通用接口"
,
notes
=
"设备认领和设备管理通用接口"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTable
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getTable
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryServiceImpl
.
getTable
(
map
));
}
...
...
@@ -370,16 +376,14 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/scalp"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备筛选下拉"
,
notes
=
"设备筛选下拉"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
scalp
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
scalp
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryServiceImpl
.
scalp
(
map
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/getChildren"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过设备种类code获取设备类别"
,
notes
=
"通过设备种类code获取设备类别"
)
...
...
@@ -388,7 +392,6 @@ public class EquipmentCategoryController extends BaseController {
}
/**
* 获取行政区划
*
...
...
@@ -399,7 +402,7 @@ public class EquipmentCategoryController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取行政区划"
,
notes
=
"获取行政区划"
)
public
ResponseModel
<
Object
>
getRegion
(
@RequestParam
(
value
=
"level"
,
required
=
false
)
String
level
,
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
getRegion
(
level
,
parentId
));
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
getRegion
(
level
,
parentId
));
}
...
...
@@ -415,7 +418,7 @@ public class EquipmentCategoryController extends BaseController {
return
ResponseHelper
.
buildResponse
(
equipmentCategoryService
.
getCategoryAndDefineByRecord
(
rowId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"saveEquipmentCategoryToEs"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"一码通数据初始化至es"
,
notes
=
"一码通数据初始化至es"
)
public
ResponseModel
<
String
>
saveEquipmentCategoryToEs
()
{
...
...
@@ -424,11 +427,10 @@ public class EquipmentCategoryController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/viewJgAll"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"viewJgAll"
,
notes
=
"viewJgAll"
)
public
ResponseModel
<
Page
<
JSONObject
>>
viewJgAll
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
public
ResponseModel
<
Page
<
JSONObject
>>
viewJgAll
(
@RequestParam
Map
<
String
,
Object
>
map
)
{
JSONObject
jsonObject
=
new
JSONObject
(
map
);
return
ResponseHelper
.
buildResponse
(
equipmentCategoryServiceImpl
.
queryByKeys
(
jsonObject
));
}
...
...
@@ -444,7 +446,7 @@ public class EquipmentCategoryController extends BaseController {
}
private
Boolean
repeat
(
String
code
,
String
elevatorCode
)
{
private
Boolean
repeat
(
String
code
,
String
elevatorCode
)
{
boolean
flag
=
true
;
if
(!
ObjectUtils
.
isEmpty
(
code
))
{
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgOtherInfo
>().
lambda
();
...
...
@@ -522,7 +524,7 @@ public class EquipmentCategoryController extends BaseController {
zipFile
.
delete
();
}
List
<
Object
>
code96333
=
equipExportData
.
stream
().
filter
(
item
->
!
ObjectUtils
.
isEmpty
(
item
.
get
(
"CODE96333"
))).
map
(
item
->
item
.
get
(
"CODE96333"
)).
collect
(
Collectors
.
toList
());
if
(
ObjectUtils
.
isEmpty
(
code96333
)
&&
ImageSizeEnums
.
DT
.
getCode
().
equals
(
type
))
{
if
(
ObjectUtils
.
isEmpty
(
code96333
)
&&
ImageSizeEnums
.
DT
.
getCode
().
equals
(
type
))
{
throw
new
FileDownLoadException
(
"96333码为空!"
);
}
if
(!
ObjectUtils
.
isEmpty
(
code96333
))
{
...
...
@@ -536,7 +538,7 @@ public class EquipmentCategoryController extends BaseController {
// if (!ObjectUtils.isEmpty(strings) && strings.size() != strings1.size()){
// throw new FileDownLoadException("96333码存在重复数据,请联系管理员!");
// }
if
(
code96333
.
size
()!=
strings1
.
size
()
||
idxBizJgOtherInfos
.
size
()
!=
code96333
.
size
())
{
if
(
code96333
.
size
()
!=
strings1
.
size
()
||
idxBizJgOtherInfos
.
size
()
!=
code96333
.
size
())
{
throw
new
FileDownLoadException
(
"96333码存在重复数据,请联系管理员!"
);
}
}
...
...
@@ -592,12 +594,14 @@ public class EquipmentCategoryController extends BaseController {
public
ResponseModel
<
Boolean
>
saveConstructionInfoData
(
@RequestBody
IdxBizJgConstructionInfo
data
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryServiceImpl
.
saveConstructionInfoData
(
data
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveMaintenanceRecordInfoData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管设备维保数据保存"
,
notes
=
"监管设备维保数据保存"
)
public
ResponseModel
<
Boolean
>
saveMaintenanceRecordInfoData
(
@RequestBody
IdxBizJgMaintenanceRecordInfo
data
)
{
return
ResponseHelper
.
buildResponse
(
equipmentCategoryServiceImpl
.
saveMaintenanceRecordInfoData
(
data
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/saveDetectionInfoData"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"监管设备检验检测数据保存"
,
notes
=
"监管设备检验检测数据保存"
)
...
...
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