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
ab3caa06
Commit
ab3caa06
authored
Jul 12, 2024
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):车用气瓶历史平台登记功能开发
parent
7ec4bc02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
22 deletions
+72
-22
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+72
-22
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
View file @
ab3caa06
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.CodeGenerateDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipInfoCylinderExcelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.EquipInfoCylinderExcelDto
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum
;
...
@@ -28,15 +29,14 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
...
@@ -28,15 +29,14 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
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.service.*
;
import
com.yeejoin.amos.boot.module.jg.biz.service.*
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.CodeUtil
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
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.mapper.CategoryOtherInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
@@ -68,7 +68,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
...
@@ -68,7 +68,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -77,9 +76,10 @@ import java.time.ZoneId;
...
@@ -77,9 +76,10 @@ import java.time.ZoneId;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
CylinderTypeEnum
.
SPECIAL_CYLINDER
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
CylinderTypeEnum
.
SPECIAL_CYLINDER
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XIAN_YANG
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
.
VehicleApanageEnum
.
XI_XIAN
;
/**
/**
...
@@ -213,7 +213,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -213,7 +213,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
private
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
@Value
(
"${add.equip.dict.code.suffix:CATEGORY_LIST_ADD}"
)
@Value
(
"${add.equip.dict.code.suffix:CATEGORY_LIST_ADD}"
)
private
String
equipAddDictCodeSuffix
;
private
String
equipAddDictCodeSuffix
;
@Autowired
@Autowired
private
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
private
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
@Autowired
@Autowired
...
@@ -226,6 +225,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -226,6 +225,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private
IdxBizJgInspectionDetectionInfoServiceImpl
idxBizJgInspectionDetectionInfoService
;
private
IdxBizJgInspectionDetectionInfoServiceImpl
idxBizJgInspectionDetectionInfoService
;
@Autowired
@Autowired
private
IIdxBizJgOtherInfoService
idxBizJgOtherInfoService
;
private
IIdxBizJgOtherInfoService
idxBizJgOtherInfoService
;
@Autowired
private
CodeUtil
codeUtil
;
@Autowired
private
TzsServiceFeignClient
tzsServiceFeignClient
;
/**
/**
* 将对象的属性由驼峰转为纯大写下划线格式
* 将对象的属性由驼峰转为纯大写下划线格式
...
@@ -2068,16 +2071,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2068,16 +2071,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
}
}
}).
headRowNumber
(
4
).
sheet
().
doRead
();
}).
headRowNumber
(
4
).
sheet
().
doRead
();
// 如果存在错误信息,则抛出 BadRequest 异常
if
(
resultError
.
stream
().
anyMatch
(
input
->
!
input
.
isEmpty
()))
{
if
(!
resultError
.
removeIf
(
String:
:
isEmpty
))
{
throw
new
BadRequest
(
"上传失败!"
);
throw
new
BadRequest
(
"校验失败"
);
}
else
{
return
aircraftList
;
}
}
return
aircraftList
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
Exception
(
resultError
.
stream
()
throw
new
Exception
(
resultError
.
stream
()
.
filter
(
s
->
!
s
.
isEmpty
())
.
filter
(
s
->
!
s
.
isEmpty
())
.
collect
(
Collectors
.
joining
(
"
\n
"
)));
.
collect
(
Collectors
.
joining
(
"
<br/>
"
)));
}
}
}
}
...
@@ -2112,18 +2113,20 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2112,18 +2113,20 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(
paramMap
==
null
)
{
if
(
paramMap
==
null
)
{
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
throw
new
IllegalArgumentException
(
"参数Map不能为空"
);
}
}
LinkedHashMap
equipment
ClassForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_CLASS
_FORM_ID
));
LinkedHashMap
equipment
InfoForm
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
EQUIP_INFO
_FORM_ID
));
LinkedHashMap
attachmentUpload
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
ATTACHMENT_UPLOAD
));
LinkedHashMap
attachmentUpload
=
(
LinkedHashMap
)
checkAndCast
(
paramMap
.
get
(
ATTACHMENT_UPLOAD
));
String
equListCode
=
(
String
)
equipmentClassForm
.
get
(
"EQU_LIST"
);
String
equListCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_LIST"
);
String
equCategoryCode
=
(
String
)
equipmentClassForm
.
get
(
"EQU_CATEGORY"
);
String
equCategoryCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_CATEGORY"
);
String
equDefineCode
=
(
String
)
equipmentClassForm
.
get
(
"EQU_DEFINE"
);
String
equDefineCode
=
(
String
)
equipmentInfoForm
.
get
(
"EQU_DEFINE"
);
String
dataSource
=
(
String
)
equipmentClassForm
.
get
(
"DATA_SOURCE"
);
String
dataSource
=
(
String
)
equipmentInfoForm
.
get
(
"DATA_SOURCE"
);
String
useOrgCode
=
(
String
)
equipmentInfoForm
.
get
(
"USE_ORG_CODE"
);
String
receiveOrgCode
=
(
String
)
equipmentInfoForm
.
get
(
"RECEIVE_ORG_CODE"
);
String
possession
=
(
String
)
equipmentInfoForm
.
get
(
"VEHICLE_APANAGE"
);
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
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
record
=
UUID
.
randomUUID
().
toString
();
equipInfoCylinderExcelDtoList
.
forEach
(
data
->{
equipInfoCylinderExcelDtoList
.
forEach
(
data
->{
String
record
=
UUID
.
randomUUID
().
toString
();
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"
);
...
@@ -2140,9 +2143,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2140,9 +2143,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BeanUtils
.
copyProperties
(
data
,
useInfo
);
BeanUtils
.
copyProperties
(
data
,
useInfo
);
useInfo
.
setRecord
(
record
);
useInfo
.
setRecord
(
record
);
useInfo
.
setRecDate
(
date
);
useInfo
.
setRecDate
(
date
);
useInfo
.
setDataSource
(
dataSource
!=
null
?
dataSource
:
"jg"
);
//区分历史设备和新增设备
useInfo
.
setDataSource
(
dataSource
.
equals
(
"his"
)?
"jg_his"
:
"jg"
);
//区分历史设备和新增设备
useInfo
.
setEquState
(
null
);
useInfo
.
setEquState
(
null
);
useInfo
.
setIsIntoManagement
(
dataSource
!=
null
);
//历史气瓶导入为已纳管设备
useInfo
.
setIsIntoManagement
(
dataSource
.
equals
(
"his"
)
);
//历史气瓶导入为已纳管设备
// 使用单位信息
// 使用单位信息
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
())){
if
(
"个人主体"
.
equals
(
company
.
getCompanyType
())){
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
useInfo
.
setUseUnitCreditCode
(
company
.
getCompanyCode
().
split
(
"_"
)[
1
]);
...
@@ -2192,6 +2195,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2192,6 +2195,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
registerInfo
.
setRegisterState
(
idxBizJgRegisterInfoService
.
getRegCode
());
registerInfo
.
setRegisterState
(
idxBizJgRegisterInfoService
.
getRegCode
());
registerInfo
.
setProductPhoto
(
productPhoto
);
registerInfo
.
setProductPhoto
(
productPhoto
);
registerInfo
.
setOtherAccessoriesReg
(
otherAccessoriesReg
);
registerInfo
.
setOtherAccessoriesReg
(
otherAccessoriesReg
);
registerInfo
.
setUseOrgCode
(
useOrgCode
);
if
(
dataSource
.
equals
(
"his"
)){
registerInfo
.
setEquCode
(
this
.
getEquCode
(
registerInfo
,
factoryInfo
,
receiveOrgCode
));
}
registerInfoList
.
add
(
registerInfo
);
registerInfoList
.
add
(
registerInfo
);
//检验检测
//检验检测
...
@@ -2216,6 +2223,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2216,6 +2223,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
BeanUtils
.
copyProperties
(
data
,
otherInfo
);
BeanUtils
.
copyProperties
(
data
,
otherInfo
);
otherInfo
.
setRecord
(
record
);
otherInfo
.
setRecord
(
record
);
otherInfo
.
setRecDate
(
date
);
otherInfo
.
setRecDate
(
date
);
if
(
dataSource
.
equals
(
"his"
)){
otherInfo
.
setSupervisoryCode
(
this
.
getSupervisoryCode
(
possession
,
registerInfo
));
otherInfo
.
setClaimStatus
(
"已认领"
);
}
otherInfoList
.
add
(
otherInfo
);
otherInfoList
.
add
(
otherInfo
);
//技术参数
//技术参数
...
@@ -2238,6 +2249,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2238,6 +2249,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
dto
.
setFACTORY_NUM
(
factoryInfo
.
getFactoryNum
());
dto
.
setFACTORY_NUM
(
factoryInfo
.
getFactoryNum
());
dto
.
setUSE_INNER_CODE
(
useInfo
.
getUseInnerCode
());
dto
.
setUSE_INNER_CODE
(
useInfo
.
getUseInnerCode
());
dto
.
setEQU_CATEGORY_CODE
(
equCategoryCode
);
dto
.
setEQU_CATEGORY_CODE
(
equCategoryCode
);
dto
.
setUSE_ORG_CODE
(
useOrgCode
);
dto
.
setIS_INTO_MANAGEMENT
(
dataSource
.
equals
(
"his"
));
if
(
dataSource
.
equals
(
"his"
)){
dto
.
setEQU_CODE
(
registerInfo
.
getEquCode
());
}
if
(
CollectionUtils
.
isNotEmpty
(
equCategory
))
{
if
(
CollectionUtils
.
isNotEmpty
(
equCategory
))
{
dto
.
setEQU_CATEGORY
(
equCategory
.
get
(
0
).
getName
());
dto
.
setEQU_CATEGORY
(
equCategory
.
get
(
0
).
getName
());
}
}
...
@@ -2379,6 +2395,40 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
...
@@ -2379,6 +2395,40 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
}
}
/**
* 生成设备代码
* @param registerInfo registerInfo
* @param factoryInfo factoryInfo
* @param receiveCompanyCode 接收机构
* @return 设备代码
*/
private
String
getEquCode
(
IdxBizJgRegisterInfo
registerInfo
,
IdxBizJgFactoryInfo
factoryInfo
,
String
receiveCompanyCode
)
{
CodeGenerateDto
codeGenerateDto
=
new
CodeGenerateDto
();
codeGenerateDto
.
setEquList
(
registerInfo
.
getEquList
());
codeGenerateDto
.
setEquCategory
(
registerInfo
.
getEquCategory
());
codeGenerateDto
.
setEquDefine
(
registerInfo
.
getEquDefine
());
codeGenerateDto
.
setProduceDate
(
factoryInfo
.
getProduceDate
());
codeGenerateDto
.
setReceiveCompanyCode
(
receiveCompanyCode
);
return
codeUtil
.
generateEquipmentCode
(
codeGenerateDto
);
}
/**
* 生成监管码
*/
private
String
getSupervisoryCode
(
String
possession
,
IdxBizJgRegisterInfo
registerInfo
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
boolean
isXiXian
=
XI_XIAN
.
getCode
().
equals
(
possession
);
String
cityOrCountyCode
=
isXiXian
?
XIAN_YANG
.
getCode
()
:
possession
;
map
.
put
(
"cityCode"
,
cityOrCountyCode
);
map
.
put
(
"isXiXian"
,
isXiXian
?
1
:
0
);
map
.
put
(
"equCategory"
,
registerInfo
.
getEquCategory
());
map
.
put
(
"countyCode"
,
cityOrCountyCode
);
return
Optional
.
ofNullable
(
tzsServiceFeignClient
.
createCode
(
map
).
getResult
())
.
filter
(
res
->
!
res
.
isEmpty
())
.
map
(
res
->
String
.
valueOf
(
res
.
get
(
"superviseCode"
)))
.
orElse
(
""
);
}
// 注入依赖
// 注入依赖
private
void
injectDependencies
(
PressureVesselListener
listener
,
Map
<
String
,
Object
>
paramMap
)
{
private
void
injectDependencies
(
PressureVesselListener
listener
,
Map
<
String
,
Object
>
paramMap
)
{
listener
.
setIdxBizJgRegisterInfoService
(
idxBizJgRegisterInfoService
);
listener
.
setIdxBizJgRegisterInfoService
(
idxBizJgRegisterInfoService
);
...
...
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