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
9b93ec70
Commit
9b93ec70
authored
Jun 26, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):气瓶导入必填校验修改
parent
93c6fb44
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
40 deletions
+88
-40
DictParamsConverter.java
...mos/boot/module/jg/api/converter/DictParamsConverter.java
+3
-0
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+9
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+14
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+62
-40
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/DictParamsConverter.java
View file @
9b93ec70
...
...
@@ -67,7 +67,10 @@ public class DictParamsConverter implements Converter<String> {
dictMap
.
put
(
"D级"
,
"5960"
);
dictMap
.
put
(
"GC1"
,
"6002"
);
dictMap
.
put
(
"GC2"
,
"6003"
);
dictMap
.
put
(
"GC3"
,
"6005"
);
dictMap
.
put
(
"GCD"
,
"6004"
);
dictMap
.
put
(
"GD1"
,
"6006"
);
dictMap
.
put
(
"GD2"
,
"6007"
);
dictMap
.
put
(
"压缩天然气"
,
"COMPRESSED_NATURAL_GAS"
);
dictMap
.
put
(
"液化天然气"
,
"LIQUEFIED_NATURAL_GAS"
);
dictMap
.
put
(
"液化石油气"
,
"LIQUEFIED_PETROLEUM_GAS"
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
View file @
9b93ec70
...
...
@@ -146,6 +146,15 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
@Param
(
"produceUnitCreditCode"
)
String
produceUnitCreditCode
);
/**
* 查询出厂编码是否重复
*
* @param factoryNum 出厂编码
* @return Integer
*/
List
<
Map
<
String
,
Object
>>
checkFactoryNumUniqueWithUseName
(
@Param
(
"factoryNum"
)
String
factoryNum
,
@Param
(
"produceUnitCreditCode"
)
String
produceUnitCreditCode
);
/**
* 使用登记证编号全库唯一校验
*
* @param useRegistrationCode
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
9b93ec70
...
...
@@ -991,6 +991,20 @@
AND ibjfi."RECORD"
<![CDATA[ <> ]]>
#{record}
</if>
</select>
<select
id=
"checkFactoryNumUniqueWithUseName"
resultType=
"java.util.Map"
>
SELECT
ibjui.USE_UNIT_NAME as useUnitName,
COUNT(1)
FROM idx_biz_jg_factory_info ibjfi
LEFT JOIN idx_biz_jg_register_info ibjri ON ibjfi."RECORD" = ibjri."RECORD"
LEFT JOIN idx_biz_jg_other_info joi ON joi."RECORD" = ibjfi."RECORD"
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjui."RECORD" = ibjri."RECORD"
WHERE ibjri.EQU_LIST = '2000'
AND ibjri.EQU_CATEGORY = '2300'
AND ibjfi.FACTORY_NUM = #{factoryNum}
AND ibjfi.PRODUCE_UNIT_CREDIT_CODE = #{produceUnitCreditCode}
AND joi.CLAIM_STATUS = '已认领'
</select>
<select
id=
"useRegistrationCertificateAccountUnique"
resultType=
"java.lang.Integer"
>
SELECT COUNT( 1 )
...
...
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 @
9b93ec70
...
...
@@ -1001,10 +1001,23 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private
void
checkFactoryNumUnique
(
String
factoryNum
,
String
produceUnitCreditCode
,
StringBuilder
result
)
{
private
void
checkFactoryNumUnique
(
String
factoryNum
,
String
produceUnitCreditCode
,
String
produceUnitName
,
StringBuilder
result
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
if
(
commonMapper
.
checkFactoryNumUnique
(
factoryNum
,
null
,
produceUnitCreditCode
)
>
0
)
{
result
.
append
(
"出厂编号/产品编码在该企业中已存在!"
);
List
<
Map
<
String
,
Object
>>
unitList
=
commonMapper
.
checkFactoryNumUniqueWithUseName
(
factoryNum
,
produceUnitCreditCode
);
String
duplicateUnits
=
unitList
.
stream
()
.
filter
(
m
->
{
Object
count
=
m
.
get
(
"count"
);
return
count
!=
null
&&
Integer
.
parseInt
(
String
.
valueOf
(
count
))
>
0
;
})
.
map
(
m
->
String
.
valueOf
(
m
.
get
(
"useUnitName"
)))
.
filter
(
Objects:
:
nonNull
)
.
distinct
()
.
collect
(
Collectors
.
joining
(
","
));
if
(!
duplicateUnits
.
isEmpty
())
{
result
.
append
(
String
.
format
(
"制造单位[%s]生产的出厂编号为[%s]的气瓶,已被[%s]录入系统,请核实!"
,
produceUnitName
,
factoryNum
,
duplicateUnits
));
}
}
...
...
@@ -3932,7 +3945,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
useInfo
.
setRecord
(
record
);
useInfo
.
setRecDate
(
new
Date
());
useInfo
.
setCreateDate
(
new
Date
());
useInfo
.
setDataSource
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
())
?
"jg_his"
:
"jg"
);
// 区分历史设备和新增设备
String
source
=
equipInfoDto
.
getDataSource
();
useInfo
.
setDataSource
(
"his"
.
equals
(
source
)
?
"jg_his"
:
"black"
.
equals
(
source
)
?
"jg_his_black"
:
"jg"
);
// 区分历史设备和新增设备
useInfo
.
setEquState
(
null
);
useInfo
.
setIsIntoManagement
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()));
// 历史气瓶导入为已纳管设备
// 历史气瓶导入设备状态为在用
...
...
@@ -3970,7 +3984,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
factoryInfo
.
setInsUseMaintainExplain
(
insUseMaintainExplain
);
factoryInfo
.
setOtherAccessoriesFact
(
otherAccessoriesFact
);
factoryInfo
.
setFactSupervisionInspectionReport
(
factSupervisionInspectionReport
);
factoryInfo
.
setProduceDate
(
DateUtil
.
parse
(
data
.
getProduceDate
(),
"yyyy-MM-dd"
));
Optional
.
ofNullable
(
data
.
getProduceDate
())
.
filter
(
s
->
!
s
.
trim
().
isEmpty
())
.
map
(
d
->
DateUtil
.
parse
(
d
,
"yyyy-MM-dd"
))
.
ifPresent
(
factoryInfo:
:
setProduceDate
);
factoryInfo
.
setImported
(
Optional
.
ofNullable
(
data
.
getImported
()).
orElse
(
"0"
));
factoryInfoList
.
add
(
factoryInfo
);
...
...
@@ -4002,13 +4019,17 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
inspectionDetectionInfo
.
setRecDate
(
new
Date
());
inspectionDetectionInfo
.
setInspectType
(
"ZZJDJY"
);
inspectionDetectionInfo
.
setInspectConclusion
(
"6040"
);
// 默认合格
inspectionDetectionInfo
.
setInspectDate
(
DateUtil
.
parse
(
data
.
getInspectDate
(),
"yyyy-MM-dd"
));
// 根据条件确定增加的年数
inspectionDetectionInfo
.
setNextInspectDate
(
Date
.
from
(
LocalDate
.
parse
(
data
.
getInspectDate
(),
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
))
.
plusYears
(
SPECIAL_CYLINDER
.
getCode
().
equals
(
equipInfoDto
.
getEquDefineCode
())
?
3
:
4
)
.
atStartOfDay
(
ZoneId
.
systemDefault
())
.
toInstant
()));
Optional
.
ofNullable
(
data
.
getInspectDate
())
.
filter
(
s
->
!
s
.
trim
().
isEmpty
())
.
map
(
dateStr
->
LocalDate
.
parse
(
dateStr
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
.
ifPresent
(
inspectDate
->
{
inspectionDetectionInfo
.
setInspectDate
(
Date
.
from
(
inspectDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
// 计算下次检测日期(加 3 年或 4 年)
int
plusYears
=
SPECIAL_CYLINDER
.
getCode
().
equals
(
equipInfoDto
.
getEquDefineCode
())
?
3
:
4
;
LocalDate
nextInspectDate
=
inspectDate
.
plusYears
(
plusYears
);
inspectionDetectionInfo
.
setNextInspectDate
(
Date
.
from
(
nextInspectDate
.
atStartOfDay
(
ZoneId
.
systemDefault
()).
toInstant
()));
});
inspectionDetectionInfoList
.
add
(
inspectionDetectionInfo
);
// 其他信息
...
...
@@ -4080,8 +4101,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
changeRecordEq
.
setProductCode
(
factoryInfo
.
getFactoryNum
());
// 产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
}
String
nextInspectDateStr
=
Optional
.
ofNullable
(
inspectionDetectionInfo
.
getNextInspectDate
())
.
map
(
date
->
date
.
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
()
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
.
orElse
(
null
);
Map
<
String
,
Object
>
equipMap
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"equDefineName"
,
equipInfoDto
.
getEquDefine
())
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
())
.
put
(
"chargingMedium"
,
data
.
getChargingMedium
())
.
put
(
"productName"
,
data
.
getProductName
())
...
...
@@ -4089,20 +4115,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
put
(
"produceDate"
,
esEquipmentDto
.
getPRODUCE_DATE
())
.
put
(
"nominalWorkingPressure"
,
data
.
getNominalWorkingPressure
())
.
put
(
"singleBottleVolume"
,
data
.
getSingleBottleVolume
())
.
put
(
"singleBottleVolume"
,
data
.
getSingleBottleVolume
())
.
put
(
"inspectDate"
,
data
.
getInspectDate
())
.
put
(
"equList"
,
equipInfoDto
.
getEquListCode
())
.
put
(
"equListName"
,
equipInfoDto
.
getEquList
())
.
put
(
"equCategory"
,
equipInfoDto
.
getEquCategoryCode
())
.
put
(
"equCategoryName"
,
equipInfoDto
.
getEquCategory
())
.
put
(
"equDefine"
,
equipInfoDto
.
getEquDefineCode
())
.
put
(
"equDefineName"
,
equipInfoDto
.
getEquDefine
())
.
put
(
"equCategoryName"
,
equipInfoDto
.
getEquCategory
())
.
put
(
"manageType"
,
"unit"
)
.
put
(
"equCategory"
,
equipInfoDto
.
getEquCategoryCode
())
.
put
(
"record"
,
esEquipmentDto
.
getSEQUENCE_NBR
())
.
put
(
"nextInspectDate"
,
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
()
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
.
put
(
"nextInspectDate"
,
nextInspectDateStr
)
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
())
.
put
(
"informationSituation"
,
data
.
getInformationSituation
())
.
build
();
...
...
@@ -4475,12 +4497,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
log
.
info
(
"解析第{}行数据:{}"
,
rowIndex
,
JSON
.
toJSONString
(
data
));
// 检查各字段是否为空,如果为空则追加错误信息
checkNotBlank
(
data
.
getProductName
(),
"设备名称不能为空;"
,
result
);
checkNotBlank
(
data
.
getBrandName
(),
"品牌名称不能为空;"
,
result
);
checkNotBlank
(
data
.
getEquType
(),
"设备型号不能为空;"
,
result
);
checkNotBlank
(
data
.
getUseInnerCode
(),
"单位内部编号不能为空;"
,
result
);
if
(
useInnerCodeList
.
contains
(
data
.
getUseInnerCode
()))
{
result
.
append
(
"单位内部编号不能重复;"
);
}
//
checkNotBlank(data.getBrandName(), "品牌名称不能为空;", result);
//
checkNotBlank(data.getEquType(), "设备型号不能为空;", result);
//
checkNotBlank(data.getUseInnerCode(), "单位内部编号不能为空;", result);
//
if (useInnerCodeList.contains(data.getUseInnerCode())) {
//
result.append("单位内部编号不能重复;");
//
}
checkNotBlank
(
data
.
getWhetherVehicleCylinder
(),
"是否车用气瓶不能为空;"
,
result
);
checkNotBlank
(
data
.
getEquCodeType
(),
"是否有设备代码不能为空;"
,
result
);
if
(
"1"
.
equals
(
data
.
getEquCodeType
()))
{
...
...
@@ -4501,35 +4523,35 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
else
{
data
.
setEquCode
(
""
);
}
checkNotBlank
(
data
.
getDesignUnitCreditCode
(),
"设计单位统一社会信用代码不能为空;"
,
result
);
checkNotBlank
(
data
.
getDesignUnitName
(),
"设计单位名称不能为空;"
,
result
);
//
checkNotBlank(data.getDesignUnitCreditCode(), "设计单位统一社会信用代码不能为空;", result);
//
checkNotBlank(data.getDesignUnitName(), "设计单位名称不能为空;", result);
Optional
.
ofNullable
(
data
.
getDesignDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"设计日期格式不正确;"
,
result
));
Optional
.
ofNullable
(
data
.
getAppraisalDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"设计文件鉴定日期格式不正确;"
,
result
));
checkNotBlank
(
data
.
getProduceUnitCreditCode
(),
"制造单位统一社会信用代码不能为空;"
,
result
);
checkNotBlank
(
data
.
getProduceUnitName
(),
"制造单位名称不能为空;"
,
result
);
checkNotBlank
(
data
.
getProduceLicenseNum
(),
"制造许可编号不能为空;"
,
result
);
//
checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", result);
checkNotBlank
(
data
.
getFactoryNum
(),
"出厂编号/产品编码不能为空;"
,
result
);
if
(
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
checkNotBlank
(
data
.
getCylinderCategory
(),
"气瓶分类不能为空;"
,
result
);
checkFactoryNumUnique
(
data
.
getFactoryNum
(),
data
.
getProduceUnitCreditCode
(),
result
);
checkFactoryNumUnique
(
data
.
getFactoryNum
(),
data
.
getProduceUnitCreditCode
(),
data
.
getProduceUnitName
(),
result
);
}
else
{
checkFactoryNumUniquenessForVehicleCylinder
(
data
.
getFactoryNum
(),
result
);
}
checkNotBlank
(
data
.
getProduceDate
(),
"制造日期不能为空;"
,
result
);
//
checkNotBlank(data.getProduceDate(), "制造日期不能为空;", result);
Optional
.
ofNullable
(
data
.
getProduceDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"制造日期格式不正确;"
,
result
));
checkNotBlank
(
data
.
getInspectOrgName
(),
"检测机构名称不能为空;"
,
result
);
checkNotBlank
(
data
.
getInspectOrgCode
(),
"检测机构代码不能为空;"
,
result
);
//
checkNotBlank(data.getInspectOrgName(), "检测机构名称不能为空;", result);
//
checkNotBlank(data.getInspectOrgCode(), "检测机构代码不能为空;", result);
//checkInspectOrg(data.getInspectOrgCode(), result);//查询检验检测机构
checkNotBlank
(
data
.
getInspectStaff
(),
"检测人员名称不能为空;"
,
result
);
checkNotBlank
(
data
.
getInspectDate
(),
"检测日期不能为空;"
,
result
);
checkNotBlank
(
data
.
getInspectReportNo
(),
"检验报告编号不能为空;"
,
result
);
//
checkNotBlank(data.getInspectStaff(), "检测人员名称不能为空;", result);
//
checkNotBlank(data.getInspectDate(), "检测日期不能为空;", result);
//
checkNotBlank(data.getInspectReportNo(), "检验报告编号不能为空;", result);
Optional
.
ofNullable
(
data
.
getInspectDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"检测日期格式不正确;"
,
result
));
checkNotBlank
(
data
.
getSingleBottleVolume
(),
"单瓶容积不能为空;"
,
result
);
checkNotBlank
(
data
.
getChargingMedium
(),
"充装介质不能为空;"
,
result
);
checkNotBlank
(
data
.
getNominalWorkingPressure
(),
"公称工作压力不能为空;"
,
result
);
checkNotBlank
(
data
.
getInformationSituation
(),
"信息化管理情况(二维码、电子标签、无)不能为空;"
,
result
);
//
checkNotBlank(data.getSingleBottleVolume(), "单瓶容积不能为空;", result);
//
checkNotBlank(data.getChargingMedium(), "充装介质不能为空;", result);
//
checkNotBlank(data.getNominalWorkingPressure(), "公称工作压力不能为空;", result);
//
checkNotBlank(data.getInformationSituation(), "信息化管理情况(二维码、电子标签、无)不能为空;", result);
// 信息化管理情况校验
checkInformatManageInfo
(
data
,
result
);
//
checkInformatManageInfo(data, result);
// 如果存在错误信息,则抛出 BadRequest 异常
if
(
result
.
length
()
>
0
)
{
result
.
insert
(
0
,
"Excel第["
+
rowIndex
+
"]行 -> "
);
...
...
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