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
44fb5774
Commit
44fb5774
authored
Sep 04, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.需求3005开发
parent
cbb8844b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
131 additions
and
8 deletions
+131
-8
InformationSituationConverter.java
...odule/jg/api/converter/InformationSituationConverter.java
+54
-0
EquipInfoCylinderExcelDto.java
...mos/boot/module/jg/api/dto/EquipInfoCylinderExcelDto.java
+14
-1
PressureVesselListener.java
...mos/boot/module/jg/biz/config/PressureVesselListener.java
+1
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+1
-1
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+23
-5
压力容器设备导入模版.xlsx
...odule-jg-biz/src/main/resources/templates/压力容器设备导入模版.xlsx
+0
-0
IdxBizJgOtherInfo.java
...in/amos/boot/module/ymt/api/entity/IdxBizJgOtherInfo.java
+19
-0
OtherInfo.java
...om/yeejoin/amos/boot/module/ymt/api/entity/OtherInfo.java
+19
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/converter/InformationSituationConverter.java
0 → 100644
View file @
44fb5774
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
converter
;
import
com.alibaba.excel.converters.Converter
;
import
com.alibaba.excel.enums.CellDataTypeEnum
;
import
com.alibaba.excel.metadata.CellData
;
import
com.alibaba.excel.metadata.GlobalConfiguration
;
import
com.alibaba.excel.metadata.property.ExcelContentProperty
;
public
class
InformationSituationConverter
implements
Converter
<
String
>
{
private
static
final
String
TYPE_QR_CODE
=
"二维码"
;
private
static
final
String
TYPE_STAMP
=
"电子标签"
;
private
static
final
String
TYPE_NO
=
"无"
;
@Override
public
Class
<?>
supportJavaTypeKey
()
{
// 实体类中对象属性类型
return
String
.
class
;
}
@Override
public
CellDataTypeEnum
supportExcelTypeKey
()
{
return
CellDataTypeEnum
.
STRING
;
}
@Override
public
String
convertToJavaData
(
CellData
cellData
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
{
// 从Cell中读取数据
String
cellValue
=
cellData
.
getStringValue
();
// 判断Excel中的值,将其转换为预期的数值
if
(
TYPE_QR_CODE
.
equals
(
cellValue
))
{
return
"1"
;
}
else
if
(
TYPE_STAMP
.
equals
(
cellValue
))
{
return
"2"
;
}
return
"99"
;
}
@Override
public
CellData
convertToExcelData
(
String
o
,
ExcelContentProperty
excelContentProperty
,
GlobalConfiguration
globalConfiguration
)
throws
Exception
{
// 判断实体类中获取的值,转换为Excel预期的值,并封装为CellData对象
if
(
o
==
null
)
{
return
new
CellData
(
""
);
}
else
if
(
o
.
equals
(
"1"
))
{
return
new
CellData
(
TYPE_QR_CODE
);
}
else
if
(
o
.
equals
(
"2"
))
{
return
new
CellData
(
TYPE_STAMP
);
}
return
new
CellData
(
TYPE_NO
);
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/EquipInfoCylinderExcelDto.java
View file @
44fb5774
...
...
@@ -269,6 +269,18 @@ public class EquipInfoCylinderExcelDto extends BaseDto {
@ApiModelProperty
(
value
=
"热处理温度(℃)"
)
private
String
qpHeatTreatmentTemperature
;
/**
* 信息化管理字段-信息化管理情况
*/
@ExcelProperty
(
value
=
"信息化管理情况"
,
index
=
53
,
converter
=
InformationSituationConverter
.
class
)
private
String
informationSituation
;
/**
* 信息化管理字段-二维码或者电子标签编号
*/
@ExcelProperty
(
value
=
"二维码或者电子标签编号"
,
index
=
54
)
private
String
informationManageCode
;
@ExcelIgnore
private
List
fileData
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/config/PressureVesselListener.java
View file @
44fb5774
...
...
@@ -177,7 +177,7 @@ public class PressureVesselListener extends AnalysisEventListener<EquipInfoCylin
}
private
void
checkInspectOrg
(
String
inspectOrgCode
){
List
<
Map
<
String
,
Object
>>
InspectOrgList
=
commonService
.
getAllInspectionInfo
(
"
inspection
"
);
List
<
Map
<
String
,
Object
>>
InspectOrgList
=
commonService
.
getAllInspectionInfo
(
"
检验检测机构
"
);
if
(
findUseCode
(
InspectOrgList
,
inspectOrgCode
)
==
null
)
{
result
.
append
(
"未查询到该检验机构"
);
}
...
...
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/CommonServiceImpl.java
View file @
44fb5774
...
...
@@ -791,7 +791,7 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
List
<
Map
<
String
,
Object
>>
getAllInspectionInfo
(
String
type
)
{
List
<
Map
<
String
,
Object
>>
unitList
=
new
ArrayList
<>();
if
(
"
inspection
"
.
equals
(
type
))
{
if
(
"
检验检测机构
"
.
equals
(
type
))
{
Systemctl
.
dictionarieClient
.
dictValues
(
"OLD_INSPECTION_TESTING_UNIT"
).
getResult
()
.
forEach
(
x
->
convertAndAddToUnitList
(
x
,
unitList
));
}
...
...
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 @
44fb5774
...
...
@@ -499,7 +499,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
equipInfoMap
.
put
(
"EQU_CODE_TYPE"
,
"1"
);
equipInfoMap
.
put
(
"SUPERVISORY_CODE"
,
null
);
equipInfoMap
.
put
(
"CAR_NUMBER"
,
null
);
equIpClassMap
.
put
(
"CAR_NUMBER"
,
null
);
// 气瓶的部分信息赋空
equipInfoMap
.
put
(
"INFORMATION_SITUATION"
,
null
);
equipInfoMap
.
put
(
"INFORMATION_MANAGE_CODE"
,
null
);
equipInfoMap
.
put
(
"CYLINDER_STAMP_ATTACHMENT"
,
null
);
}
return
resultMap
;
}
...
...
@@ -984,9 +987,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
ValidationUtil
.
isEmpty
(
fieldType
))
{
otherInfoMap
=
Bean
.
BeantoMap
(
otherInfo
);
otherInfoMap
.
put
(
"otherinfoSeq"
,
otherInfo
.
getSequenceNbr
());
otherInfoMap
.
put
(
"cylinderStampAttachment"
,
JSON
.
parse
(
otherInfo
.
getCylinderStampAttachment
()));
}
else
{
otherInfoMap
=
convertCamelToUnderscore
(
otherInfo
,
null
);
otherInfoMap
.
put
(
"OTHERINFO_SEQ"
,
otherInfo
.
getSequenceNbr
());
otherInfoMap
.
put
(
"CYLINDER_STAMP_ATTACHMENT"
,
JSON
.
parse
(
otherInfo
.
getCylinderStampAttachment
()));
}
if
(!
otherInfoMap
.
isEmpty
())
{
Map
<
String
,
Object
>
filterMap
=
otherInfoMap
.
entrySet
()
...
...
@@ -2368,6 +2373,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 96333码和监管码置空
otherInfo
.
setCode96333
(
null
);
otherInfo
.
setSupervisoryCode
(
null
);
otherInfo
.
setCylinderStampAttachment
(
null
);
otherInfo
.
setInformationSituation
(
null
);
otherInfo
.
setInformationManageCode
(
null
);
}
iIdxBizJgOtherInfoService
.
saveOrUpdateData
(
otherInfo
);
...
...
@@ -2678,9 +2686,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
factoryNumList
.
clear
();
try
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
// 每读取一行就调用该方法
@Override
public
void
invoke
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
// 每读取一行就调用该方法
@Override
public
void
invoke
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
EquipInfoCylinderExcelDto
fireExperts
=
new
EquipInfoCylinderExcelDto
();
BeanUtils
.
copyProperties
(
data
,
fireExperts
);
resultError
.
add
(
checkExcelData
(
data
,
context
).
toString
());
...
...
@@ -3082,6 +3090,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
checkNotBlank
(
data
.
getSingleBottleVolume
(),
"单瓶容积不能为空;"
,
result
);
checkNotBlank
(
data
.
getChargingMedium
(),
"充装介质不能为空;"
,
result
);
checkNotBlank
(
data
.
getNominalWorkingPressure
(),
"公称工作压力不能为空;"
,
result
);
checkNotBlank
(
data
.
getInformationSituation
(),
"信息化管理情况(二维码、电子标签、无)不能为空;"
,
result
);
// 信息化管理情况校验
checkInformatManageInfo
(
data
,
result
);
// 如果存在错误信息,则抛出 BadRequest 异常
if
(
result
.
length
()
>
0
)
{
result
.
insert
(
0
,
"Excel第["
+
rowIndex
+
"]行 -> "
);
...
...
@@ -3094,6 +3105,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
result
;
}
private
void
checkInformatManageInfo
(
EquipInfoCylinderExcelDto
data
,
StringBuilder
result
)
{
// 非车用气瓶时(0)时且信息化管理情况非无时检验二维码编号/电子标签编号必填
if
(
data
.
getInformationSituation
()
!=
null
&&
!
"99"
.
equals
(
data
.
getInformationSituation
())
&&
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
())){
checkNotBlank
(
data
.
getInformationManageCode
(),
"二维码编号/电子标签编号不能为空;"
,
result
);
}
}
private
void
checkEquCodeUniqueness
(
String
equCode
,
StringBuilder
result
)
{
// 根据设备代码检查唯一性
LambdaQueryWrapper
<
RegistrationInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -3112,7 +3130,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
private
void
checkInspectOrg
(
String
inspectOrgCode
,
StringBuilder
result
)
{
List
<
Map
<
String
,
Object
>>
InspectOrgList
=
commonService
.
getAllInspectionInfo
(
"
inspection
"
);
List
<
Map
<
String
,
Object
>>
InspectOrgList
=
commonService
.
getAllInspectionInfo
(
"
检验检测机构
"
);
if
(
findUseCode
(
InspectOrgList
,
inspectOrgCode
)
==
null
)
{
result
.
append
(
"未查询到该检验机构;"
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/压力容器设备导入模版.xlsx
View file @
44fb5774
No preview for this file type
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/IdxBizJgOtherInfo.java
View file @
44fb5774
...
...
@@ -111,4 +111,23 @@ public class IdxBizJgOtherInfo extends TzsBaseEntity {
@TableField
(
"\"EDIT_STATUS\""
)
private
String
editStatus
;
/**
* 信息化管理情况:1-二维码;2-电子标签;99-无
*/
@TableField
(
value
=
"\"INFORMATION_SITUATION\""
)
private
String
informationSituation
;
/**
* 信息化管理二维码或者电子标签编号
*/
@TableField
(
value
=
"\"INFORMATION_MANAGE_CODE\""
)
private
String
informationManageCode
;
/**
* 气瓶钢印标识
*/
@TableField
(
value
=
"\"CYLINDER_STAMP_ATTACHMENT\""
)
private
String
cylinderStampAttachment
;
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/entity/OtherInfo.java
View file @
44fb5774
...
...
@@ -64,5 +64,24 @@ public class OtherInfo extends AbstractEquipBaseEntity {
@TableField
(
value
=
"\"SUPERVISORY_CODE\""
)
private
String
supervisoryCode
;
/**
* 信息化管理情况:1-二维码;2-电子标签;99-无
*/
@TableField
(
value
=
"\"INFORMATION_SITUATION\""
)
private
String
informationSituation
;
/**
* 信息化管理二维码或者电子标签编号
*/
@TableField
(
value
=
"\"INFORMATION_MANAGE_CODE\""
)
private
String
informationManageCode
;
/**
* 气瓶钢印标识
*/
@TableField
(
value
=
"\"CYLINDER_STAMP_ATTACHMENT\""
)
private
String
cylinderStampAttachment
;
}
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