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
3cc6964e
Commit
3cc6964e
authored
Sep 12, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):监管业务系统,历史设备登记,普通气瓶批量导入时选择已存在的使用登记证进行增补时,使用登记证下依然只有原来的设备
parent
515cce39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
319 additions
and
166 deletions
+319
-166
JgUseRegistrationEqMapper.java
.../boot/module/jg/api/mapper/JgUseRegistrationEqMapper.java
+5
-0
JgUseRegistrationEqMapper.xml
...i/src/main/resources/mapper/JgUseRegistrationEqMapper.xml
+7
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+307
-166
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/mapper/JgUseRegistrationEqMapper.java
View file @
3cc6964e
...
@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
...
@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
org.apache.ibatis.annotations.Update
;
import
java.util.List
;
/**
/**
* 使用登记设备关系表 Mapper 接口
* 使用登记设备关系表 Mapper 接口
...
@@ -14,4 +15,8 @@ import org.apache.ibatis.annotations.Update;
...
@@ -14,4 +15,8 @@ import org.apache.ibatis.annotations.Update;
public
interface
JgUseRegistrationEqMapper
extends
BaseMapper
<
JgUseRegistrationEq
>
{
public
interface
JgUseRegistrationEqMapper
extends
BaseMapper
<
JgUseRegistrationEq
>
{
@Update
(
"update tzs_jg_use_registration_eq set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} "
)
@Update
(
"update tzs_jg_use_registration_eq set is_invalid = 1 where equ_id = #{equipId} and equip_transfer_id != #{currentDocumentId} "
)
void
updateEquipIsVaildByEquipIdAndCurrentDocumentId
(
@Param
(
"equipId"
)
String
equipId
,
@Param
(
"currentDocumentId"
)
String
currentDocumentId
);
void
updateEquipIsVaildByEquipIdAndCurrentDocumentId
(
@Param
(
"equipId"
)
String
equipId
,
@Param
(
"currentDocumentId"
)
String
currentDocumentId
);
void
batchInsert
(
@Param
(
"equipTransferId"
)
String
equipTransferId
,
@Param
(
"jgRelationEquipList"
)
List
<
JgUseRegistrationEq
>
jgRelationEquipList
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationEqMapper.xml
View file @
3cc6964e
...
@@ -2,4 +2,11 @@
...
@@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper"
>
<insert
id=
"batchInsert"
>
INSERT INTO tzs_jg_use_registration_eq (sequence_nbr,equip_transfer_id, equ_id)
VALUES
<foreach
collection=
"jgRelationEquipList"
item=
"item"
separator=
","
>
(#{item.sequenceNbr},#{equipTransferId}, #{item.equId})
</foreach>
</insert>
</mapper>
</mapper>
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 @
3cc6964e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.alibaba.excel.event.AnalysisEventListener
;
...
@@ -29,10 +31,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipInfoCylinderExcelDto;
...
@@ -29,10 +31,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipInfoCylinderExcelDto;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipmentInfoDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipmentInfoDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgVehicleInformationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.SafetyProblemTracingMapper
;
import
com.yeejoin.amos.boot.module.jg.biz.config.PressureVesselListener
;
import
com.yeejoin.amos.boot.module.jg.biz.config.PressureVesselListener
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
...
@@ -43,10 +42,12 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
...
@@ -43,10 +42,12 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.*;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
...
@@ -62,6 +63,8 @@ import org.elasticsearch.search.sort.SortOrder;
...
@@ -62,6 +63,8 @@ import org.elasticsearch.search.sort.SortOrder;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.ValueOperations
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -105,6 +108,33 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -105,6 +108,33 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
public
final
static
String
USE_TYPE_NAME
=
"使用单位"
;
public
final
static
String
USE_TYPE_NAME
=
"使用单位"
;
public
final
static
String
INDIVIDUAL_TYPE_NAME
=
"个人主体"
;
public
final
static
String
INDIVIDUAL_TYPE_NAME
=
"个人主体"
;
public
final
static
String
MAINTENANCE_TYPE_NAME
=
"安装改造维修单位"
;
public
final
static
String
MAINTENANCE_TYPE_NAME
=
"安装改造维修单位"
;
// 设备种类
public
static
final
String
EQU_LIST
=
"EQU_LIST"
;
// 模版上传集合
public
static
final
String
EQU_LISTS
=
"equLists"
;
// 设备类别
public
static
final
String
EQU_CATEGORY
=
"EQU_CATEGORY"
;
// 设备品种
public
static
final
String
EQU_DEFINE
=
"EQU_DEFINE"
;
// 是否车用气瓶
public
static
final
String
WHETHER_VEHICLE_CYLINDER
=
"WHETHER_VEHICLE_CYLINDER"
;
// 是否撬装式压力容器
public
static
final
String
WHETHER_SKID_MOUNTED_PRESSURE_VESSEL
=
"WHETHER_SKID_MOUNTED_PRESSURE_VESSEL"
;
// 检验检测机构
public
static
final
String
INSPECTION_AND_TESTING_INSTITUTIONS
=
"检验检测机构"
;
// 设备纳管 纳管:true 未纳管:false
public
static
final
String
IS_INTO_MANAGEMENT
=
"IS_INTO_MANAGEMENT"
;
// 设备来源 jg:新设备录入 jg_his:历史数据录入
public
static
final
String
DATA_SOURCE
=
"DATA_SOURCE"
;
// 设备来源名称 jg:新设备 jg_his:历史数据
public
static
final
String
DATA_SOURCE_NAME
=
"DATA_SOURCE_NAME"
;
public
static
final
String
USE_PLACE_CODE
=
"USE_PLACE_CODE"
;
public
static
final
String
EQU_CATEGORY_CODE
=
"EQU_CATEGORY_CODE"
;
public
static
final
String
PROJECT_CONTRAPTION
=
"PROJECT_CONTRAPTION"
;
// 工程装置名称
/**
* 业务类型 0:单个新增 1:批量导入
*/
public
static
final
String
BUSINESS_SCENARIOS
=
"businessScenarios"
;
// 设备分类表单id
// 设备分类表单id
private
static
final
String
EQUIP_CLASS_FORM_ID
=
"equipClass"
;
private
static
final
String
EQUIP_CLASS_FORM_ID
=
"equipClass"
;
// 设备基本信息表单id
// 设备基本信息表单id
...
@@ -133,43 +163,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -133,43 +163,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
static
final
String
FACTORY_NUM
=
"FACTORY_NUM"
;
private
static
final
String
FACTORY_NUM
=
"FACTORY_NUM"
;
// 新增设备是否复制而来
// 新增设备是否复制而来
private
static
final
String
IS_COPY
=
"isCopy"
;
private
static
final
String
IS_COPY
=
"isCopy"
;
// 设备种类
public
static
final
String
EQU_LIST
=
"EQU_LIST"
;
// 模版上传集合
public
static
final
String
EQU_LISTS
=
"equLists"
;
// 设备类别
public
static
final
String
EQU_CATEGORY
=
"EQU_CATEGORY"
;
// 设备品种
public
static
final
String
EQU_DEFINE
=
"EQU_DEFINE"
;
// 是否车用气瓶
public
static
final
String
WHETHER_VEHICLE_CYLINDER
=
"WHETHER_VEHICLE_CYLINDER"
;
// 是否撬装式压力容器
public
static
final
String
WHETHER_SKID_MOUNTED_PRESSURE_VESSEL
=
"WHETHER_SKID_MOUNTED_PRESSURE_VESSEL"
;
// 检验检测机构
public
static
final
String
INSPECTION_AND_TESTING_INSTITUTIONS
=
"检验检测机构"
;
// 设备纳管 纳管:true 未纳管:false
public
static
final
String
IS_INTO_MANAGEMENT
=
"IS_INTO_MANAGEMENT"
;
// 设备来源 jg:新设备录入 jg_his:历史数据录入
public
static
final
String
DATA_SOURCE
=
"DATA_SOURCE"
;
// 设备来源名称 jg:新设备 jg_his:历史数据
public
static
final
String
DATA_SOURCE_NAME
=
"DATA_SOURCE_NAME"
;
private
static
final
String
ATTACHMENT_UPLOAD
=
"attachmentUpload"
;
private
static
final
String
ATTACHMENT_UPLOAD
=
"attachmentUpload"
;
public
static
final
String
USE_PLACE_CODE
=
"USE_PLACE_CODE"
;
private
static
final
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
public
static
final
String
EQU_CATEGORY_CODE
=
"EQU_CATEGORY_CODE"
;
// 需要转化成jsonObject的附件字段
public
static
final
String
PROJECT_CONTRAPTION
=
"PROJECT_CONTRAPTION"
;
// 工程装置名称
public
static
String
[]
jsonFields
=
{
"insOtherAccessories"
,
"installContractAttachment"
,
"installProxyStatementAttachment"
};
private
final
List
<
String
>
resultError
=
new
ArrayList
<>();
private
final
List
<
String
>
resultError
=
new
ArrayList
<>();
List
<
String
>
useInnerCodeList
=
new
ArrayList
<>();
// 单位内部编号集合
List
<
String
>
useInnerCodeList
=
new
ArrayList
<>();
// 单位内部编号集合
List
<
String
>
equCodeList
=
new
ArrayList
<>();
// 设备代码集合
List
<
String
>
equCodeList
=
new
ArrayList
<>();
// 设备代码集合
List
<
String
>
factoryNumList
=
new
ArrayList
<>();
// 出厂编码集合
List
<
String
>
factoryNumList
=
new
ArrayList
<>();
// 出厂编码集合
private
static
final
Map
<
String
,
String
>
regionCodeOrgCodeMap
=
new
ConcurrentHashMap
<>();
/**
* 业务类型 0:单个新增 1:批量导入
*/
public
static
final
String
BUSINESS_SCENARIOS
=
"businessScenarios"
;
// 需要转化成jsonObject的附件字段
public
static
String
[]
jsonFields
=
{
"insOtherAccessories"
,
"installContractAttachment"
,
"installProxyStatementAttachment"
};
@Autowired
@Autowired
RestHighLevelClient
restHighLevelClient
;
RestHighLevelClient
restHighLevelClient
;
@Autowired
@Autowired
...
@@ -258,6 +259,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -258,6 +259,16 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
Sequence
sequence
;
private
Sequence
sequence
;
@Autowired
@Autowired
private
JgCertificateChangeRecordEqServiceImpl
certificateChangeRecordEqService
;
private
JgCertificateChangeRecordEqServiceImpl
certificateChangeRecordEqService
;
@Autowired
private
JgUseRegistrationServiceImpl
jgUseRegistrationService
;
@Autowired
private
JgUseRegistrationEqMapper
jgRelationEquipMapper
;
@Autowired
private
JgRegistrationHistoryServiceImpl
jgRegistrationHistoryService
;
@Autowired
private
SafetyProblemTracingMapper
safetyProblemTracingMapper
;
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
/**
/**
* 将对象的属性由驼峰转为纯大写下划线格式
* 将对象的属性由驼峰转为纯大写下划线格式
...
@@ -291,6 +302,59 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -291,6 +302,59 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
/**
/**
* 将List<Map<String, Object>>中的字段名从大写转换为驼峰格式
*
* @param originalList 源List<Map<String, Object>>对象
* @return 转换后的List<Map < String, Object>>对象
*/
public
static
List
<
Map
<
String
,
Object
>>
convertKeysToCamelCase
(
List
<
Map
<
String
,
Object
>>
originalList
)
{
List
<
Map
<
String
,
Object
>>
camelCaseList
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
originalMap
:
originalList
)
{
Map
<
String
,
Object
>
camelCaseMap
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
originalMap
.
entrySet
())
{
String
camelCaseKey
=
toCamelCase
(
entry
.
getKey
());
camelCaseMap
.
put
(
camelCaseKey
,
entry
.
getValue
());
}
camelCaseList
.
add
(
camelCaseMap
);
}
return
camelCaseList
;
}
/**
* 将大写加下划线的字符串转换为驼峰命名法
*
* @param input 需要转换的字符串
* @return 驼峰格式的字符串
*/
public
static
String
toCamelCase
(
String
input
)
{
if
(
input
==
null
||
input
.
isEmpty
())
{
return
input
;
}
StringBuilder
result
=
new
StringBuilder
();
boolean
toUpperCase
=
false
;
for
(
int
i
=
0
;
i
<
input
.
length
();
i
++)
{
char
c
=
input
.
charAt
(
i
);
if
(
c
==
'_'
)
{
toUpperCase
=
true
;
}
else
if
(
toUpperCase
)
{
result
.
append
(
Character
.
toUpperCase
(
c
));
toUpperCase
=
false
;
}
else
{
result
.
append
(
Character
.
toLowerCase
(
c
));
}
}
return
result
.
toString
();
}
/**
* 设备注册信息
* 设备注册信息
*
*
* @param paramMap
* @param paramMap
...
@@ -328,7 +392,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -328,7 +392,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 操作类型
// 操作类型
try
{
try
{
// 保存数据
// 保存数据
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
);
record
=
batchSubmitOrUpdate
(
equipmentClassForm
,
equipmentInfoForm
,
equipmentParamsForm
,
submitType
);
// 保存Es数据
// 保存Es数据
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
if
(!
ObjectUtils
.
isEmpty
(
record
))
{
checkEsData
(
record
);
checkEsData
(
record
);
...
@@ -356,8 +420,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -356,8 +420,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw
new
BadRequest
(
"设备代码已存在,请重新输入!"
);
throw
new
BadRequest
(
"设备代码已存在,请重新输入!"
);
}
}
}
}
private
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
private
void
check96333Code
(
LinkedHashMap
equipmentInfoForm
)
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentInfoForm
.
get
(
CODE96333
)))
{
if
(!
ObjectUtils
.
isEmpty
(
equipmentInfoForm
.
get
(
CODE96333
)))
{
// 根据96333码检查唯一性
// 根据96333码检查唯一性
LambdaQueryWrapper
<
OtherInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OtherInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OtherInfo:
:
getCode96333
,
equipmentInfoForm
.
get
(
CODE96333
));
wrapper
.
eq
(
OtherInfo:
:
getCode96333
,
equipmentInfoForm
.
get
(
CODE96333
));
...
@@ -675,9 +740,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -675,9 +740,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
objMap
;
return
objMap
;
}
}
@Autowired
private
SafetyProblemTracingMapper
safetyProblemTracingMapper
;
/**
/**
* 查询设备基本信息
* 查询设备基本信息
*
*
...
@@ -797,7 +859,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -797,7 +859,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// }
// }
// ]
// ]
boolean
isYmtData
=
!
String
.
valueOf
(
useInfoMap
.
get
(
DATA_SOURCE
)).
startsWith
(
"jg"
);
boolean
isYmtData
=
!
String
.
valueOf
(
useInfoMap
.
get
(
DATA_SOURCE
)).
startsWith
(
"jg"
);
if
(
isYmtData
)
{
if
(
isYmtData
)
{
useInfoMap
.
remove
(
DATA_SOURCE
);
useInfoMap
.
remove
(
DATA_SOURCE
);
}
}
}
}
...
@@ -1293,6 +1355,44 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -1293,6 +1355,44 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
resultListMap
;
return
resultListMap
;
}
}
// private void setRepeatUsedCheckFilterByType(BoolQueryBuilder boolMust, String companyCode, String queryType) {
// if ("AZ".equals(queryType)) {// 安装告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice");
// } else if ("GZ_GZ".equals(queryType)) {// 改造告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "renovationNoticeNew");
// } else if ("GZ_WX".equals(queryType)) {// 维修告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintainInfo");
// } else if ("GZ_YZ".equals(queryType)) {// 移装告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "transferNotice");
// } else if ("SY".equals(queryType)) {// 使用登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
// } else if ("DJ_GZ".equals(queryType)) {// 改造变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistration");
// } else if ("DJ_YZ".equals(queryType)) {// 移装变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistrationTransfer");
// } else if ("DJ_DW".equals(queryType)) {// 单位变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "unitChange");
// } else if ("DJ_GM".equals(queryType)) {// 更名变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeName");
// } else if ("BF_YZ".equals(queryType)) {// 注销
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("BF_ZX".equals(queryType)) {// 报废
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("SB_QY".equals(queryType)) {// 启用
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("SB_TY".equals(queryType)) {// 停用
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("WB_BA".equals(queryType)) {// 维保备案
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintenanceFiling");
// } else if ("SB_YJ".equals(queryType)) {// 设备移交
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "equipmentHandover");
// } else if ("QP_BG".equals(queryType)) {// 车用气瓶变更
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleGasCylinderChange");
// } else if ("QP_DJ".equals(queryType)) {// 车用气瓶登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleInformation");
// }
// }
/**
/**
* 查询指定设备的安全附件【一对多,查出多条数据】
* 查询指定设备的安全附件【一对多,查出多条数据】
*
*
...
@@ -1737,44 +1837,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -1737,44 +1837,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
result
;
return
result
;
}
}
// private void setRepeatUsedCheckFilterByType(BoolQueryBuilder boolMust, String companyCode, String queryType) {
// if ("AZ".equals(queryType)) {// 安装告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "installNotice");
// } else if ("GZ_GZ".equals(queryType)) {// 改造告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "renovationNoticeNew");
// } else if ("GZ_WX".equals(queryType)) {// 维修告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintainInfo");
// } else if ("GZ_YZ".equals(queryType)) {// 移装告知
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "transferNotice");
// } else if ("SY".equals(queryType)) {// 使用登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "useRegistration");
// } else if ("DJ_GZ".equals(queryType)) {// 改造变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistration");
// } else if ("DJ_YZ".equals(queryType)) {// 移装变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeRegistrationTransfer");
// } else if ("DJ_DW".equals(queryType)) {// 单位变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "unitChange");
// } else if ("DJ_GM".equals(queryType)) {// 更名变更登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "changeName");
// } else if ("BF_YZ".equals(queryType)) {// 注销
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("BF_ZX".equals(queryType)) {// 报废
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("SB_QY".equals(queryType)) {// 启用
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("SB_TY".equals(queryType)) {// 停用
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "");
// } else if ("WB_BA".equals(queryType)) {// 维保备案
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "maintenanceFiling");
// } else if ("SB_YJ".equals(queryType)) {// 设备移交
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "equipmentHandover");
// } else if ("QP_BG".equals(queryType)) {// 车用气瓶变更
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleGasCylinderChange");
// } else if ("QP_DJ".equals(queryType)) {// 车用气瓶登记
// this.setRepeatUsedCheckFilterParam(boolMust, companyCode, "vehicleInformation");
// }
// }
/**
/**
* 设备注册信息分页查询
* 设备注册信息分页查询
*
*
...
@@ -2042,7 +2104,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2042,7 +2104,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 转化施工类型
// 转化施工类型
String
constructionType
=
dto2
.
get
(
CONSTRUCTIONTYPE
).
toString
();
String
constructionType
=
dto2
.
get
(
CONSTRUCTIONTYPE
).
toString
();
if
(!
ValidationUtil
.
isEmpty
(
constructionType
))
{
if
(!
ValidationUtil
.
isEmpty
(
constructionType
))
{
List
<
String
>
constructionTypeList
=
Arrays
.
asList
(
constructionType
.
split
(
","
)
);
String
[]
constructionTypeList
=
constructionType
.
split
(
","
);
List
<
String
>
statusList
=
new
ArrayList
<>();
List
<
String
>
statusList
=
new
ArrayList
<>();
for
(
String
cType
:
constructionTypeList
)
{
for
(
String
cType
:
constructionTypeList
)
{
Integer
integer
=
Integer
.
valueOf
(
cType
);
Integer
integer
=
Integer
.
valueOf
(
cType
);
...
@@ -2171,7 +2233,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2171,7 +2233,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
""
;
return
""
;
}
}
private
String
batchSubmitOrUpdate
(
LinkedHashMap
equipmentClassForm
,
LinkedHashMap
equipmentInfoForm
,
LinkedHashMap
equipmentParamsForm
,
String
submitType
)
{
private
String
batchSubmitOrUpdate
(
LinkedHashMap
equipmentClassForm
,
LinkedHashMap
equipmentInfoForm
,
LinkedHashMap
equipmentParamsForm
,
String
submitType
)
{
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
record
=
null
;
String
record
=
null
;
...
@@ -2231,7 +2293,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2231,7 +2293,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 其他信息
// 其他信息
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgOtherInfo
.
class
);
IdxBizJgOtherInfo
otherInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgOtherInfo
.
class
);
// 检验检测 【新增时】 固定式压力容器(2100)和 气瓶(2300)可以添加检验检测信息
// 检验检测 【新增时】 固定式压力容器(2100)和 气瓶(2300)可以添加检验检测信息
if
(
"add"
.
equals
(
submitType
)){
if
(
"add"
.
equals
(
submitType
))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
)
||
"2100"
.
equals
(
equCategory
))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
)
||
"2100"
.
equals
(
equCategory
))
{
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgInspectionDetectionInfo
.
class
);
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgInspectionDetectionInfo
.
class
);
List
<
Map
<
String
,
Object
>>
inspectionAndTestingInstitutions
=
commonService
.
getUnitListByType
(
"inspection"
,
"gasCylindersForCars"
);
List
<
Map
<
String
,
Object
>>
inspectionAndTestingInstitutions
=
commonService
.
getUnitListByType
(
"inspection"
,
"gasCylindersForCars"
);
...
@@ -2240,13 +2302,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2240,13 +2302,13 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
inspectionDetectionInfo
.
setInspectOrgName
((
String
)
mapOrDefault
.
getOrDefault
(
"useUnit"
,
inspectionDetectionInfo
.
getInspectOrgName
()));
inspectionDetectionInfo
.
setInspectOrgName
((
String
)
mapOrDefault
.
getOrDefault
(
"useUnit"
,
inspectionDetectionInfo
.
getInspectOrgName
()));
inspectionDetectionInfo
.
setRecord
(
record
);
inspectionDetectionInfo
.
setRecord
(
record
);
inspectionDetectionInfo
.
setRecDate
(
date
);
inspectionDetectionInfo
.
setRecDate
(
date
);
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
}
inspectionDetectionInfo
.
setSequenceNbr
(
OPERATESAVE
.
equals
(
operateType
)
?
null
:
String
.
valueOf
(
equipmentInfoForm
.
get
(
"INSPECTIONDETECTIONINFO_SEQ"
)));
inspectionDetectionInfo
.
setSequenceNbr
(
OPERATESAVE
.
equals
(
operateType
)
?
null
:
String
.
valueOf
(
equipmentInfoForm
.
get
(
"INSPECTIONDETECTIONINFO_SEQ"
)));
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateData
(
inspectionDetectionInfo
);
iIdxBizJgInspectionDetectionInfoService
.
saveOrUpdateData
(
inspectionDetectionInfo
);
}
}
}
else
{
//更新时 固定式压力容器(2100)和 气瓶(2300)工业管道(8300) 可以更新检验检测信息
}
else
{
//更新时 固定式压力容器(2100)和 气瓶(2300)工业管道(8300) 可以更新检验检测信息
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
)
||
"2100"
.
equals
(
equCategory
)
||
"8300"
.
equals
(
equCategory
))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
)
||
"2100"
.
equals
(
equCategory
)
||
"8300"
.
equals
(
equCategory
))
{
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgInspectionDetectionInfo
.
class
);
IdxBizJgInspectionDetectionInfo
inspectionDetectionInfo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
equipmentInfoForm
),
IdxBizJgInspectionDetectionInfo
.
class
);
List
<
Map
<
String
,
Object
>>
inspectionAndTestingInstitutions
=
commonService
.
getUnitListByType
(
"inspection"
,
"gasCylindersForCars"
);
List
<
Map
<
String
,
Object
>>
inspectionAndTestingInstitutions
=
commonService
.
getUnitListByType
(
"inspection"
,
"gasCylindersForCars"
);
...
@@ -2258,7 +2320,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2258,7 +2320,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
"1"
.
equals
(
equipmentInfoForm
.
get
(
WHETHER_VEHICLE_CYLINDER
)))
{
// 老旧车用气瓶有些制造监督检验已过期,可放开选择定期检验
if
(!
"1"
.
equals
(
equipmentInfoForm
.
get
(
WHETHER_VEHICLE_CYLINDER
)))
{
// 老旧车用气瓶有些制造监督检验已过期,可放开选择定期检验
inspectionDetectionInfo
.
setInspectType
(
"8300"
.
equals
(
equCategory
)
?
"AZJDJY"
:
"ZZJDJY"
);
inspectionDetectionInfo
.
setInspectType
(
"8300"
.
equals
(
equCategory
)
?
"AZJDJY"
:
"ZZJDJY"
);
}
}
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
}
inspectionDetectionInfo
.
setSequenceNbr
(
OPERATESAVE
.
equals
(
operateType
)
?
null
:
String
.
valueOf
(
equipmentInfoForm
.
get
(
"INSPECTIONDETECTIONINFO_SEQ"
)));
inspectionDetectionInfo
.
setSequenceNbr
(
OPERATESAVE
.
equals
(
operateType
)
?
null
:
String
.
valueOf
(
equipmentInfoForm
.
get
(
"INSPECTIONDETECTIONINFO_SEQ"
)));
...
@@ -2294,7 +2356,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2294,7 +2356,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
}
}
}
}
if
(
"8300"
.
equals
(
equCategory
))
{
if
(
"8300"
.
equals
(
equCategory
))
{
useInfo
.
setProjectContraption
(((
String
)
equipmentInfoForm
.
get
(
"PROJECT_CONTRAPTION"
)).
trim
());
useInfo
.
setProjectContraption
(((
String
)
equipmentInfoForm
.
get
(
"PROJECT_CONTRAPTION"
)).
trim
());
}
}
idxBizJgUseInfoService
.
saveOrUpdateData
(
useInfo
);
idxBizJgUseInfoService
.
saveOrUpdateData
(
useInfo
);
...
@@ -2533,12 +2595,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2533,12 +2595,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 需要安装的设备 安装告知审批通过 清除设备的USC_UNIT_CREDIT_CODE安装单位信息
// 需要安装的设备 安装告知审批通过 清除设备的USC_UNIT_CREDIT_CODE安装单位信息
// 使用单位编辑 防止更新设备时将安改维单位信息更新到es中
// 使用单位编辑 防止更新设备时将安改维单位信息更新到es中
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
CompanyBo
company
=
getSelectedOrgInfo
().
getCompany
();
if
(
CompanyTypeEnum
.
USE
.
getName
().
equals
(
company
.
getCompanyType
()))
{
if
(
CompanyTypeEnum
.
USE
.
getName
().
equals
(
company
.
getCompanyType
()))
{
dto
.
setUSC_UNIT_CREDIT_CODE
(
null
);
dto
.
setUSC_UNIT_CREDIT_CODE
(
null
);
dto
.
setUSC_UNIT_NAME
(
null
);
dto
.
setUSC_UNIT_NAME
(
null
);
}
}
if
(
map
.
get
(
"NEXT_INSPECT_DATE"
)
!=
null
)
{
if
(
map
.
get
(
"NEXT_INSPECT_DATE"
)
!=
null
)
{
Date
nextInspectDate
=
(
Date
)
map
.
get
(
"NEXT_INSPECT_DATE"
);
Date
nextInspectDate
=
(
Date
)
map
.
get
(
"NEXT_INSPECT_DATE"
);
dto
.
setNEXT_INSPECT_DATE
(
DateUtil
.
parse
(
DateUtil
.
format
(
nextInspectDate
,
DatePattern
.
NORM_DATE_PATTERN
)).
getTime
());
dto
.
setNEXT_INSPECT_DATE
(
DateUtil
.
parse
(
DateUtil
.
format
(
nextInspectDate
,
DatePattern
.
NORM_DATE_PATTERN
)).
getTime
());
}
}
esEquipmentCategory
.
save
(
dto
);
esEquipmentCategory
.
save
(
dto
);
...
@@ -2599,12 +2661,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2599,12 +2661,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
throw
new
BadRequest
(
"请先选择工程装置后,再选择设备信息!"
);
throw
new
BadRequest
(
"请先选择工程装置后,再选择设备信息!"
);
}
}
if
(!
jgUseRegistrationMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
if
(!
jgUseRegistrationMapper
.
selectList
(
new
LambdaQueryWrapper
<
JgUseRegistration
>()
.
eq
(
JgUseRegistration:
:
getIsDelete
,
false
)
.
eq
(
JgUseRegistration:
:
getIsDelete
,
false
)
.
eq
(
JgUseRegistration:
:
getProjectContraption
,
jsonObject
.
get
(
"projectContraption"
))
.
eq
(
JgUseRegistration:
:
getProjectContraption
,
jsonObject
.
get
(
"projectContraption"
))
.
eq
(
JgUseRegistration:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
eq
(
JgUseRegistration:
:
getUseUnitCreditCode
,
useUnitCreditCode
)
.
eq
(
JgUseRegistration:
:
getIsAddEquip
,
"0"
)
.
eq
(
JgUseRegistration:
:
getIsAddEquip
,
"0"
)
.
eq
(
JgUseRegistration:
:
getStatus
,
"已完成"
)
.
eq
(
JgUseRegistration:
:
getStatus
,
"已完成"
)
.
ne
(
JgUseRegistration:
:
getStatus
,
"已作废"
)).
isEmpty
()
&&
"0"
.
equals
(
jsonObject
.
get
(
"isAddEquip"
)))
{
.
ne
(
JgUseRegistration:
:
getStatus
,
"已作废"
)).
isEmpty
()
&&
"0"
.
equals
(
jsonObject
.
get
(
"isAddEquip"
)))
{
throw
new
BadRequest
(
"该工程装置已做过使用登记,再选择增补功能进行登记!"
);
throw
new
BadRequest
(
"该工程装置已做过使用登记,再选择增补功能进行登记!"
);
}
}
return
jgUseRegistrationMapper
.
queryForUnitPipelineEquipmentPage
(
page
,
jsonObject
,
records
);
return
jgUseRegistrationMapper
.
queryForUnitPipelineEquipmentPage
(
page
,
jsonObject
,
records
);
...
@@ -2684,9 +2746,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2684,9 +2746,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
factoryNumList
.
clear
();
factoryNumList
.
clear
();
try
{
try
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
EquipInfoCylinderExcelDto
.
class
,
new
AnalysisEventListener
<
EquipInfoCylinderExcelDto
>()
{
// 每读取一行就调用该方法
// 每读取一行就调用该方法
@Override
@Override
public
void
invoke
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
public
void
invoke
(
EquipInfoCylinderExcelDto
data
,
AnalysisContext
context
)
{
EquipInfoCylinderExcelDto
fireExperts
=
new
EquipInfoCylinderExcelDto
();
EquipInfoCylinderExcelDto
fireExperts
=
new
EquipInfoCylinderExcelDto
();
BeanUtils
.
copyProperties
(
data
,
fireExperts
);
BeanUtils
.
copyProperties
(
data
,
fireExperts
);
resultError
.
add
(
checkExcelData
(
data
,
context
).
toString
());
resultError
.
add
(
checkExcelData
(
data
,
context
).
toString
());
...
@@ -2695,6 +2757,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2695,6 +2757,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
equCodeList
.
add
(
data
.
getEquCode
());
equCodeList
.
add
(
data
.
getEquCode
());
factoryNumList
.
add
(
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
())
?
data
.
getFactoryNum
()
:
null
);
factoryNumList
.
add
(
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
())
?
data
.
getFactoryNum
()
:
null
);
}
}
// 全部读取完成就调用该方法
// 全部读取完成就调用该方法
@Override
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
...
@@ -2729,6 +2792,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2729,6 +2792,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
@Override
@Override
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
Object
savePressureVesselData
(
Map
<
String
,
Object
>
paramMap
)
{
public
Object
savePressureVesselData
(
Map
<
String
,
Object
>
paramMap
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
CompanyBo
company
=
reginParams
.
getCompany
();
CompanyBo
company
=
reginParams
.
getCompany
();
...
@@ -2740,6 +2804,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2740,6 +2804,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
List
<
IdxBizJgTechParamsVessel
>
paramsVesselList
=
new
ArrayList
<>();
List
<
IdxBizJgTechParamsVessel
>
paramsVesselList
=
new
ArrayList
<>();
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
new
ArrayList
<>();
List
<
IdxBizJgInspectionDetectionInfo
>
inspectionDetectionInfoList
=
new
ArrayList
<>();
List
<
ESEquipmentCategoryDto
>
esEquipmentCategoryList
=
new
ArrayList
<>();
List
<
ESEquipmentCategoryDto
>
esEquipmentCategoryList
=
new
ArrayList
<>();
List
<
JgUseRegistrationEq
>
jgRelationEquipList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
equipmentLists
=
new
ArrayList
<>();
if
(
paramMap
==
null
)
{
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
...
@@ -2751,13 +2817,45 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2751,13 +2817,45 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Long
changeRecordId
=
sequence
.
nextId
();
Long
changeRecordId
=
sequence
.
nextId
();
List
<
EquipInfoCylinderExcelDto
>
equipInfoCylinderExcelDtoList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
attachmentUpload
.
get
(
EQU_LISTS
)),
EquipInfoCylinderExcelDto
.
class
);
List
<
EquipInfoCylinderExcelDto
>
equipInfoCylinderExcelDtoList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
attachmentUpload
.
get
(
EQU_LISTS
)),
EquipInfoCylinderExcelDto
.
class
);
equipInfoCylinderExcelDtoList
.
forEach
(
data
->
{
equipInfoCylinderExcelDtoList
.
forEach
(
data
->
{
JgUseRegistrationEq
jgRelationEquip
=
new
JgUseRegistrationEq
();
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
())
&&
"1"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
())
&&
"1"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
throw
new
BadRequest
(
"车用气瓶历史设备不能批量导入!"
);
throw
new
BadRequest
(
"车用气瓶历史设备不能批量导入!"
);
}
}
if
(
"1"
.
equals
(
data
.
getWhetherVehicleCylinder
())
&&
!
SPECIAL_CYLINDER
.
getCode
().
equals
(
equipInfoDto
.
getEquDefineCode
())){
if
(
"1"
.
equals
(
data
.
getWhetherVehicleCylinder
())
&&
!
SPECIAL_CYLINDER
.
getCode
().
equals
(
equipInfoDto
.
getEquDefineCode
()))
{
throw
new
BadRequest
(
"车用气瓶只能选择特种气瓶进行导入!"
);
throw
new
BadRequest
(
"车用气瓶只能选择特种气瓶进行导入!"
);
}
}
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()))
{
String
useRegistrationCode
=
equipInfoDto
.
getUseOrgCode
();
String
key
=
useRegistrationCode
.
substring
(
0
,
5
);
if
(
redisUtils
.
hasKey
(
key
)){
String
extractedValue
=
useRegistrationCode
.
substring
(
5
,
10
);
String
extractedYearStr
=
useRegistrationCode
.
substring
(
useRegistrationCode
.
indexOf
(
'('
)
+
1
,
useRegistrationCode
.
indexOf
(
')'
));
int
currentYearLastTwoDigits
=
LocalDate
.
now
().
getYear
()
%
100
;
try
{
int
extractedNumber
=
Integer
.
parseInt
(
extractedValue
);
ValueOperations
<
String
,
String
>
valueOps
=
redisTemplate
.
opsForValue
();
String
currentSequenceStr
=
valueOps
.
get
(
key
);
assert
currentSequenceStr
!=
null
;
int
redisNumber
=
Integer
.
parseInt
(
currentSequenceStr
);
int
extractedYear
=
Integer
.
parseInt
(
extractedYearStr
);
if
(
extractedNumber
>
redisNumber
&&
currentYearLastTwoDigits
==
extractedYear
)
{
throw
new
BadRequest
(
"登记证编号不能使用系统还未生成编号!"
);
}
}
catch
(
NumberFormatException
e
)
{
throw
new
BadRequest
(
"数据格式错误"
);
}
}
}
String
record
=
UUID
.
randomUUID
().
toString
();
String
record
=
UUID
.
randomUUID
().
toString
();
jgRelationEquip
.
setEquId
(
record
);
jgRelationEquip
.
setSequenceNbr
(
sequence
.
nextId
());
jgRelationEquipList
.
add
(
jgRelationEquip
);
List
<
Map
<
String
,
Object
>>
fileDataList
=
(
List
<
Map
<
String
,
Object
>>)
(
data
.
getFileData
());
List
<
Map
<
String
,
Object
>>
fileDataList
=
(
List
<
Map
<
String
,
Object
>>)
(
data
.
getFileData
());
String
productPhoto
=
getUrlByKey
(
fileDataList
,
"PRODUCT_PHOTO"
);
String
productPhoto
=
getUrlByKey
(
fileDataList
,
"PRODUCT_PHOTO"
);
String
otherAccessoriesReg
=
getUrlByKey
(
fileDataList
,
"OTHER_ACCESSORIES_REG"
);
String
otherAccessoriesReg
=
getUrlByKey
(
fileDataList
,
"OTHER_ACCESSORIES_REG"
);
...
@@ -2828,6 +2926,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2828,6 +2926,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo
.
setUseOrgCode
(
equipInfoDto
.
getUseOrgCode
());
registerInfo
.
setUseOrgCode
(
equipInfoDto
.
getUseOrgCode
());
registerInfo
.
setCylinderCategory
(
data
.
getCylinderCategory
());
registerInfo
.
setCylinderCategory
(
data
.
getCylinderCategory
());
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()))
{
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()))
{
registerInfo
.
setStatus
(
"在用"
);
registerInfo
.
setEquCode
(
this
.
getEquCode
(
registerInfo
,
factoryInfo
,
equipInfoDto
.
getReceiveOrgCode
()));
registerInfo
.
setEquCode
(
this
.
getEquCode
(
registerInfo
,
factoryInfo
,
equipInfoDto
.
getReceiveOrgCode
()));
}
}
registerInfoList
.
add
(
registerInfo
);
registerInfoList
.
add
(
registerInfo
);
...
@@ -2875,7 +2974,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2875,7 +2974,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
ESEquipmentCategoryDto
esEquipmentDto
=
JSON
.
parseObject
(
toJSONString
(
data
),
ESEquipmentCategoryDto
.
class
);
ESEquipmentCategoryDto
esEquipmentDto
=
JSON
.
parseObject
(
toJSONString
(
data
),
ESEquipmentCategoryDto
.
class
);
esEquipmentDto
.
setDATA_SOURCE
(
useInfo
.
getDataSource
());
esEquipmentDto
.
setDATA_SOURCE
(
useInfo
.
getDataSource
());
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
esEquipmentDto
.
setNEXT_INSPECT_DATE
(
inspectionDetectionInfo
.
getNextInspectDate
().
getTime
());
esEquipmentDto
.
setNEXT_INSPECT_DATE
(
inspectionDetectionInfo
.
getNextInspectDate
().
getTime
());
}
}
esEquipmentDto
.
setREC_DATE
(
System
.
currentTimeMillis
());
esEquipmentDto
.
setREC_DATE
(
System
.
currentTimeMillis
());
...
@@ -2892,7 +2991,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2892,7 +2991,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
esEquipmentDto
.
setEQU_LIST_CODE
(
equipInfoDto
.
getEquListCode
());
esEquipmentDto
.
setEQU_LIST_CODE
(
equipInfoDto
.
getEquListCode
());
esEquipmentDto
.
setEQU_LIST
(
equipInfoDto
.
getEquList
());
esEquipmentDto
.
setEQU_LIST
(
equipInfoDto
.
getEquList
());
esEquipmentDto
.
setEQU_DEFINE_CODE
(
equipInfoDto
.
getEquDefineCode
());
esEquipmentDto
.
setEQU_DEFINE_CODE
(
equipInfoDto
.
getEquDefineCode
());
esEquipmentDto
.
setSUPERVISORY_CODE
(
otherInfo
.
getSupervisoryCode
());
esEquipmentDto
.
setEQU_DEFINE
(
equipInfoDto
.
getEquDefine
());
esEquipmentDto
.
setEQU_DEFINE
(
equipInfoDto
.
getEquDefine
());
esEquipmentDto
.
setSTATUS
(
"已认领"
);
// 使用单位信息
// 使用单位信息
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
()))
{
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
()))
{
...
@@ -2911,7 +3012,81 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2911,7 +3012,81 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
changeRecordEq
.
setProductCode
(
factoryInfo
.
getFactoryNum
());
// 产品编号
changeRecordEq
.
setProductCode
(
factoryInfo
.
getFactoryNum
());
// 产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
}
}
Map
<
String
,
Object
>
equipMap
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"equDefineName"
,
equipInfoDto
.
getEquDefine
())
.
put
(
"factoryNum"
,
factoryInfo
.
getFactoryNum
())
.
put
(
"chargingMedium"
,
data
.
getChargingMedium
())
.
put
(
"produceUnitName"
,
factoryInfo
.
getProduceUnitName
())
.
put
(
"produceDate"
,
esEquipmentDto
.
getPRODUCE_DATE
())
.
put
(
"nominalWorkingPressure"
,
data
.
getNominalWorkingPressure
())
.
put
(
"singleBottleVolume"
,
data
.
getSingleBottleVolume
())
.
put
(
"inspectDate"
,
data
.
getInspectDate
())
.
put
(
"record"
,
esEquipmentDto
.
getSEQUENCE_NBR
())
.
put
(
"nextInspectDate"
,
inspectionDetectionInfo
.
getNextInspectDate
().
toInstant
()
.
atZone
(
ZoneId
.
systemDefault
())
.
toLocalDate
()
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
.
put
(
"useInnerCode"
,
useInfo
.
getUseInnerCode
())
.
put
(
"informationSituation"
,
data
.
getInformationSituation
())
.
build
();
equipmentLists
.
add
(
equipMap
);
});
});
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()))
{
// 生成证书管理表记录
LambdaQueryWrapper
<
JgUseRegistrationManage
>
queryWrapper
=
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
equipInfoDto
.
getUseOrgCode
())
.
eq
(
JgUseRegistrationManage:
:
getIsDelete
,
0
)
.
eq
(
JgUseRegistrationManage:
:
getCertificateStatus
,
"已登记"
);
JgUseRegistrationManage
jgUseRegistrationManage
=
jgUseRegistrationManageService
.
getBaseMapper
().
selectOne
(
queryWrapper
);
//历史增补
if
(!
ValidationUtil
.
isEmpty
(
jgUseRegistrationManage
))
{
if
(
jgUseRegistrationManage
.
getUseUnitCreditCode
().
equals
(
company
.
getCompanyCode
()))
{
jgUseRegistrationManage
.
setUseUnitName
(
company
.
getCompanyName
());
jgUseRegistrationManage
.
setReceiveOrgName
(
equipInfoDto
.
getReceiveOrgName
());
jgUseRegistrationManage
.
setAuditPassDate
(
new
Date
());
jgUseRegistrationManage
.
setRegDate
(
new
Date
());
jgUseRegistrationManage
.
setUseUnitCreditCode
(
company
.
getCompanyCode
());
jgUseRegistrationManage
.
setReceiveCompanyCode
(
equipInfoDto
.
getReceiveOrgCode
());
jgUseRegistrationManageService
.
updateById
(
jgUseRegistrationManage
);
}
else
{
throw
new
BadRequest
(
"该使用登记证编号系统已存在,请核对使用登记证编号后,重新上传!"
);
}
}
else
{
jgUseRegistrationManage
=
this
.
saveRegistrationManage
(
equipInfoDto
,
company
);
}
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgUseRegistrationManage
,
changeRecordId
);
// 使用登记信息
JgUseRegistration
jgUseRegistration
=
new
JgUseRegistration
();
jgUseRegistration
.
setRegDate
(
new
Date
());
jgUseRegistration
.
setReceiveCompanyCode
(
equipInfoDto
.
getReceiveOrgCode
());
jgUseRegistration
.
setReceiveOrgName
(
equipInfoDto
.
getReceiveOrgName
());
jgUseRegistration
.
setReceiveCompanyOrgCode
(
commonService
.
getOneCompany
(
jgUseRegistration
.
getReceiveCompanyCode
()).
getOrgCode
());
//使用单位提交
jgUseRegistration
.
setUseUnitName
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyName
().
split
(
"_"
)[
1
]
:
company
.
getCompanyName
());
jgUseRegistration
.
setUseUnitCreditCode
(
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
());
jgUseRegistration
.
setCreateUserId
(
reginParams
.
getUserModel
().
getUserId
());
jgUseRegistration
.
setCreateUserName
(
reginParams
.
getUserModel
().
getUserName
());
jgUseRegistration
.
setApplyNo
(
jgUseRegistrationManage
.
getApplyNo
());
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
jgUseRegistration
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgUseRegistration
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
jgUseRegistration
.
setUseRegistrationCode
(
jgUseRegistrationManage
.
getUseRegistrationCode
());
jgUseRegistration
.
setRegType
(
"1"
);
//历史登记
jgUseRegistrationService
.
save
(
jgUseRegistration
);
jgRelationEquipMapper
.
batchInsert
(
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()),
jgRelationEquipList
);
JSONObject
objectHashMap
=
new
JSONObject
();
BeanUtil
.
beanToMap
(
jgUseRegistration
,
objectHashMap
,
false
,
false
);
objectHashMap
.
put
(
"equipmentLists"
,
equipmentLists
);
updateHistory
(
objectHashMap
,
String
.
valueOf
(
jgUseRegistration
.
getSequenceNbr
()));
}
Optional
.
of
(
useInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgUseInfoService:
:
saveBatch
);
Optional
.
of
(
useInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgUseInfoService:
:
saveBatch
);
Optional
.
of
(
designInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgDesignInfoService:
:
saveBatch
);
Optional
.
of
(
designInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgDesignInfoService:
:
saveBatch
);
Optional
.
of
(
registerInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgRegisterInfoService:
:
saveBatch
);
Optional
.
of
(
registerInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgRegisterInfoService:
:
saveBatch
);
...
@@ -2920,16 +3095,31 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2920,16 +3095,31 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
Optional
.
of
(
paramsVesselList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgTechParamsVesselService:
:
saveBatch
);
Optional
.
of
(
paramsVesselList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgTechParamsVesselService:
:
saveBatch
);
Optional
.
of
(
inspectionDetectionInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgInspectionDetectionInfoService:
:
saveBatch
);
Optional
.
of
(
inspectionDetectionInfoList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
idxBizJgInspectionDetectionInfoService:
:
saveBatch
);
Optional
.
of
(
esEquipmentCategoryList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
esEquipmentCategory:
:
saveAll
);
Optional
.
of
(
esEquipmentCategoryList
).
filter
(
list
->
!
list
.
isEmpty
()).
ifPresent
(
esEquipmentCategory:
:
saveAll
);
if
(
"his"
.
equals
(
equipInfoDto
.
getDataSource
()))
{
// 生成证书管理表记录
JgUseRegistrationManage
registrationManage
=
this
.
saveRegistrationManage
(
equipInfoDto
,
company
);
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
registrationManage
,
changeRecordId
);
}
return
String
.
format
(
"导入完成,成功导入: %d 条数据!"
,
useInfoList
.
size
());
return
String
.
format
(
"导入完成,成功导入: %d 条数据!"
,
useInfoList
.
size
());
}
}
private
EquipmentInfoDto
createEquipmentInfoDto
(
Map
<
String
,
Object
>
equipmentInfoForm
,
JgVehicleInformationMapper
jgVehicleInformationMapper
)
{
public
void
updateHistory
(
JSONObject
map
,
String
currentDocumentId
)
{
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
LambdaQueryWrapper
<
JgRegistrationHistory
>
lambda
=
new
QueryWrapper
<
JgRegistrationHistory
>().
lambda
();
// lambda.eq(JgRegistrationHistory::getEquId, equipId);
lambda
.
eq
(
JgRegistrationHistory:
:
getCurrentDocumentId
,
currentDocumentId
);
lambda
.
eq
(
JgRegistrationHistory:
:
getRegistrationClass
,
"使用登记"
);
Integer
integer
=
jgRegistrationHistoryService
.
getBaseMapper
().
selectCount
(
lambda
);
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
map
));
if
(
integer
>
0
)
{
jgRegistrationHistoryService
.
update
(
jgRegistrationHistory
,
lambda
);
}
else
{
jgRegistrationHistory
.
setStatus
(
"new"
);
jgRegistrationHistory
.
setRegistrationClass
(
"使用登记"
);
//jgRegistrationHistory.setSupervisoryCode(supervisoryCode);
//jgRegistrationHistory.setEquId(equipId);
jgRegistrationHistory
.
setCurrentDocumentId
(
currentDocumentId
);
jgRegistrationHistoryService
.
save
(
jgRegistrationHistory
);
}
}
private
EquipmentInfoDto
createEquipmentInfoDto
(
Map
<
String
,
Object
>
equipmentInfoForm
,
JgVehicleInformationMapper
jgVehicleInformationMapper
)
{
EquipmentInfoDto
dto
=
new
EquipmentInfoDto
();
EquipmentInfoDto
dto
=
new
EquipmentInfoDto
();
String
equListCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_LIST"
);
String
equListCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_LIST"
);
String
equCategoryCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_CATEGORY"
);
String
equCategoryCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_CATEGORY"
);
...
@@ -3112,14 +3302,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3112,14 +3302,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
void
checkInformatManageInfo
(
EquipInfoCylinderExcelDto
data
,
StringBuilder
result
)
{
private
void
checkInformatManageInfo
(
EquipInfoCylinderExcelDto
data
,
StringBuilder
result
)
{
// 非车用气瓶时(0)时且信息化管理情况非无时检验二维码编号/电子标签编号必填
// 非车用气瓶时(0)时且信息化管理情况非无时检验二维码编号/电子标签编号必填
if
(
data
.
getInformationSituation
()
!=
null
&&
!
"99"
.
equals
(
data
.
getInformationSituation
())
&&
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
if
(
data
.
getInformationSituation
()
!=
null
&&
!
"99"
.
equals
(
data
.
getInformationSituation
())
&&
"0"
.
equals
(
data
.
getWhetherVehicleCylinder
()))
{
checkNotBlank
(
data
.
getInformationManageCode
(),
"二维码编号/电子标签编号不能为空;"
,
result
);
checkNotBlank
(
data
.
getInformationManageCode
(),
"二维码编号/电子标签编号不能为空;"
,
result
);
}
}
}
}
private
void
checkEquCodeUniqueness
(
String
equCode
,
StringBuilder
result
)
{
private
void
checkEquCodeUniqueness
(
String
equCode
,
StringBuilder
result
)
{
// 根据设备代码检查唯一性
// 根据设备代码检查唯一性
Integer
count
=
idxBizJgRegisterInfoMapper
.
selectByEquCodeAndClaimStatus
(
equCode
,
""
);
Integer
count
=
idxBizJgRegisterInfoMapper
.
selectByEquCodeAndClaimStatus
(
equCode
,
""
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
result
.
append
(
"设备代码系统中已存在;"
);
result
.
append
(
"设备代码系统中已存在;"
);
}
}
...
@@ -3161,7 +3351,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3161,7 +3351,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* @param receiveCompanyCode 接收机构
* @param receiveCompanyCode 接收机构
* @return 设备代码
* @return 设备代码
*/
*/
private
String
getEquCode
(
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
factoryInfo
,
String
receiveCompanyCode
)
{
private
String
getEquCode
(
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
factoryInfo
,
String
receiveCompanyCode
)
{
CodeGenerateDto
codeGenerateDto
=
new
CodeGenerateDto
();
CodeGenerateDto
codeGenerateDto
=
new
CodeGenerateDto
();
codeGenerateDto
.
setEquList
(
registerInfo
.
getEquList
());
codeGenerateDto
.
setEquList
(
registerInfo
.
getEquList
());
codeGenerateDto
.
setEquCategory
(
registerInfo
.
getEquCategory
());
codeGenerateDto
.
setEquCategory
(
registerInfo
.
getEquCategory
());
...
@@ -3243,7 +3434,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3243,7 +3434,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
getElevatorInfo
(
String
equCode
,
Date
startTime
,
Date
endTime
,
PageParam
pageParam
)
{
public
Page
<
Map
<
String
,
Object
>>
getElevatorInfo
(
String
equCode
,
Date
startTime
,
Date
endTime
,
PageParam
pageParam
)
{
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
SearchRequest
request
=
new
SearchRequest
();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
"idx_biz_view_jg_all"
);
...
@@ -3311,7 +3503,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3311,7 +3503,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
@Override
@Override
public
IPage
<
Map
<
String
,
Object
>>
getCylinderInfo
(
String
equCode
,
Date
startTime
,
Date
endTime
,
PageParam
pageParam
)
{
public
IPage
<
Map
<
String
,
Object
>>
getCylinderInfo
(
String
equCode
,
Date
startTime
,
Date
endTime
,
PageParam
pageParam
)
{
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
Page
<
Map
<
String
,
Object
>>
result
=
new
Page
<>(
pageParam
.
getCurrent
(),
pageParam
.
getSize
());
SearchRequest
request
=
new
SearchRequest
();
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
"idx_biz_view_jg_all"
);
request
.
indices
(
"idx_biz_view_jg_all"
);
...
@@ -3364,7 +3557,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3364,7 +3557,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
getResult
()
.
getResult
()
.
stream
()
.
stream
()
.
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
.
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataValue
));
cylinderInfoList
.
forEach
(
i
->
i
.
computeIfPresent
(
"chargingMedium"
,
(
key
,
value
)
->
fillingMediumMap
.
get
(
value
)));
cylinderInfoList
.
forEach
(
i
->
i
.
computeIfPresent
(
"chargingMedium"
,
(
key
,
value
)
->
fillingMediumMap
.
get
(
value
)));
}
}
result
.
setRecords
(
convertKeysToCamelCase
(
cylinderInfoList
));
result
.
setRecords
(
convertKeysToCamelCase
(
cylinderInfoList
));
result
.
setTotal
(
response
.
getHits
().
getTotalHits
().
value
);
result
.
setTotal
(
response
.
getHits
().
getTotalHits
().
value
);
...
@@ -3374,58 +3567,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -3374,58 +3567,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return
result
;
return
result
;
}
}
/**
* 将List<Map<String, Object>>中的字段名从大写转换为驼峰格式
* @param originalList 源List<Map<String, Object>>对象
* @return 转换后的List<Map<String, Object>>对象
*/
public
static
List
<
Map
<
String
,
Object
>>
convertKeysToCamelCase
(
List
<
Map
<
String
,
Object
>>
originalList
)
{
List
<
Map
<
String
,
Object
>>
camelCaseList
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
originalMap
:
originalList
)
{
Map
<
String
,
Object
>
camelCaseMap
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
originalMap
.
entrySet
())
{
String
camelCaseKey
=
toCamelCase
(
entry
.
getKey
());
camelCaseMap
.
put
(
camelCaseKey
,
entry
.
getValue
());
}
camelCaseList
.
add
(
camelCaseMap
);
}
return
camelCaseList
;
}
/**
* 将大写加下划线的字符串转换为驼峰命名法
* @param input 需要转换的字符串
* @return 驼峰格式的字符串
*/
public
static
String
toCamelCase
(
String
input
)
{
if
(
input
==
null
||
input
.
isEmpty
())
{
return
input
;
}
StringBuilder
result
=
new
StringBuilder
();
boolean
toUpperCase
=
false
;
for
(
int
i
=
0
;
i
<
input
.
length
();
i
++)
{
char
c
=
input
.
charAt
(
i
);
if
(
c
==
'_'
)
{
toUpperCase
=
true
;
}
else
if
(
toUpperCase
)
{
result
.
append
(
Character
.
toUpperCase
(
c
));
toUpperCase
=
false
;
}
else
{
result
.
append
(
Character
.
toLowerCase
(
c
));
}
}
return
result
.
toString
();
}
public
String
getAndSetOrgCode
(
String
cityCode
)
{
public
String
getAndSetOrgCode
(
String
cityCode
)
{
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
cityCode
);
String
orgCode
=
regionCodeOrgCodeMap
.
get
(
cityCode
);
if
(
orgCode
==
null
)
{
if
(
orgCode
==
null
)
{
...
...
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