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
38cc221c
Commit
38cc221c
authored
Dec 03, 2024
by
hekaiwen
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
e57318da
978c2e9a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
719 additions
and
143 deletions
+719
-143
XiAnDataDockServiceImpl.java
...oin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
+5
-4
AppCommonMapper.java
...join/amos/boot/module/app/api/mapper/AppCommonMapper.java
+2
-0
AppCommonMapper.xml
...ule-app-api/src/main/resources/mapper/AppCommonMapper.xml
+10
-1
TzsAppController.java
...amos/boot/module/app/biz/controller/TzsAppController.java
+15
-1
CertDetailServiceImpl.java
...ot/module/app/biz/service/impl/CertDetailServiceImpl.java
+13
-0
VehicleSearchDetailDetailHandlerImpl.java
...iz/service/impl/VehicleSearchDetailDetailHandlerImpl.java
+5
-2
ShCarEquDto.java
.../com/yeejoin/amos/boot/module/jg/api/dto/ShCarEquDto.java
+1
-1
ShCarEqu.java
.../com/yeejoin/amos/boot/module/jg/api/entity/ShCarEqu.java
+1
-1
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+8
-0
IShCarService.java
...eejoin/amos/boot/module/jg/api/service/IShCarService.java
+1
-1
ShCarEquVo.java
...va/com/yeejoin/amos/boot/module/jg/api/vo/ShCarEquVo.java
+14
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+82
-13
JgChangeVehicleRegistrationUnitController.java
...controller/JgChangeVehicleRegistrationUnitController.java
+4
-1
ShCarController.java
...n/amos/boot/module/jg/biz/controller/ShCarController.java
+17
-16
ShCarEquController.java
...mos/boot/module/jg/biz/controller/ShCarEquController.java
+4
-2
ICommonService.java
...ejoin/amos/boot/module/jg/biz/service/ICommonService.java
+9
-0
BaseUseRegisterResultData.java
...module/jg/biz/service/impl/BaseUseRegisterResultData.java
+18
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+5
-1
DefaultUseRegisterResult.java
.../module/jg/biz/service/impl/DefaultUseRegisterResult.java
+30
-0
FillingEditPermForCurrentUser.java
...le/jg/biz/service/impl/FillingEditPermForCurrentUser.java
+43
-0
FillingUseRegisterResult.java
.../module/jg/biz/service/impl/FillingUseRegisterResult.java
+65
-0
IdxBizJgRegisterInfoServiceImpl.java
.../jg/biz/service/impl/IdxBizJgRegisterInfoServiceImpl.java
+28
-9
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+8
-7
JgChangeVehicleRegistrationUnitServiceImpl.java
...vice/impl/JgChangeVehicleRegistrationUnitServiceImpl.java
+1
-1
JgEquipTransferServiceImpl.java
...odule/jg/biz/service/impl/JgEquipTransferServiceImpl.java
+15
-8
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+11
-22
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+35
-7
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+19
-1
ShCarEquServiceImpl.java
.../boot/module/jg/biz/service/impl/ShCarEquServiceImpl.java
+90
-13
ShCarServiceImpl.java
...mos/boot/module/jg/biz/service/impl/ShCarServiceImpl.java
+0
-0
SingleDataChangeProcessStrategy.java
.../jg/biz/service/impl/SingleDataChangeProcessStrategy.java
+8
-0
JyjcInspectionApplicationMapper.xml
...main/resources/mapper/JyjcInspectionApplicationMapper.xml
+1
-1
JyjcOpeningApplicationServiceImpl.java
...c/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
+1
-1
AlertUseUnitStatisticsMapper.java
...e/statistics/api/mapper/AlertUseUnitStatisticsMapper.java
+2
-0
AlertUseUnitStatisticsMapper.xml
...rc/main/resources/mapper/AlertUseUnitStatisticsMapper.xml
+42
-0
YJDPStatisticsController.java
...le/statistcs/biz/controller/YJDPStatisticsController.java
+1
-1
AQZSDPStatisticsServiceImpl.java
...atistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
+1
-0
EnterpriseBizByTCMServiceImpl.java
...istcs/biz/service/impl/EnterpriseBizByTCMServiceImpl.java
+19
-1
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+5
-1
YJDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
+29
-3
YwblpjsxtjServiceImpl.java
...stcs/biz/service/impl/ZBGLImpl/YwblpjsxtjServiceImpl.java
+26
-1
TzBaseEnterpriseInfoServiceImpl.java
...tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
+18
-17
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+7
-5
No files found.
amos-boot-data/amos-boot-data-openapi/src/main/java/com/yeejoin/amos/api/openapi/service/XiAnDataDockServiceImpl.java
View file @
38cc221c
...
...
@@ -77,6 +77,7 @@ public class XiAnDataDockServiceImpl {
* @param equipInfoExcelDtos
*/
public
void
batchSaveEquipmentData
(
List
<
XiAnEquipInfoExcelDto
>
equipInfoExcelDtos
)
{
log
.
info
(
"解析成功,准备上传数据,条数:{}"
,
equipInfoExcelDtos
.
size
());
int
batchSize
=
1000
;
int
totalSize
=
equipInfoExcelDtos
.
size
();
// 主线程中获取登录信息传递到异步线程中
...
...
@@ -183,7 +184,7 @@ public class XiAnDataDockServiceImpl {
ReadRowHolder
readRowHolder
=
context
.
readRowHolder
();
int
rowIndex
=
readRowHolder
.
getRowIndex
()
+
1
;
StringBuilder
rowError
=
new
StringBuilder
();
log
.
info
(
"开始解析数据,第{}条数据"
,
rowIndex
);
// 是否起重机械
boolean
isQZJX
=
!
ValidationUtil
.
isEmpty
(
data
.
getEquList
())
&&
"4000"
.
equals
(
data
.
getEquList
());
// 是否场内机动车辆
...
...
@@ -371,7 +372,7 @@ public class XiAnDataDockServiceImpl {
Optional
.
ofNullable
(
data
.
getAppraisalDate
()).
ifPresent
(
v
->
checkDateFormatCorrect
(
v
,
"设计文件鉴定日期格式不正确;"
,
rowError
));
// 制造信息
//checkNotBlank(data.getProduceUnitCreditCode(), "制造单位统一社会信用代码不能为空;", rowError);
Optional
.
ofNullable
(
data
.
getProduceUnitCreditCode
()).
ifPresent
(
v
->
checkCreditCode
(
v
,
"制造单位统一社会信用代码格式不正确;"
,
rowError
));
//
Optional.ofNullable(data.getProduceUnitCreditCode()).ifPresent(v -> checkCreditCode(v, "制造单位统一社会信用代码格式不正确;", rowError));
//checkNotBlank(data.getProduceUnitName(), "制造单位名称不能为空;", rowError);
//checkNotBlank(data.getProduceLicenseNum(), "制造许可编号不能为空;", rowError);
//checkNotBlank(data.getFactoryNum(), "出厂编号/产品编码不能为空;", rowError);
...
...
@@ -491,10 +492,10 @@ public class XiAnDataDockServiceImpl {
*/
private
void
YLGDTechnicalParamsCheck
(
XiAnEquipInfoExcelDto
data
,
StringBuilder
rowError
)
{
//checkNotBlank(data.getWallThickness_YLGD(), "公称壁厚不能为空;", rowError);
checkNotBlank
(
data
.
getNominalDiameter
(),
"公称直径不能为空;"
,
rowError
);
//
checkNotBlank(data.getNominalDiameter(), "公称直径不能为空;", rowError);
checkNotBlank
(
data
.
getPipeLength
(),
"管道长度不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getPressure
(),
"压力不能为空;"
,
rowError
);
checkNotBlank
(
data
.
getMedium_YLGD
(),
"介质不能为空;"
,
rowError
);
//
checkNotBlank(data.getMedium_YLGD(), "介质不能为空;", rowError);
//checkNotBlank(data.getTemperature_YLGD(), "温度不能为空;", rowError);
//checkNotBlank(data.getPipelineNumber(), "管道编号不能为空;", rowError);
//checkNotBlank(data.getDeviceLevel_YLGD(), "管道级别不能为空;", rowError);
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/mapper/AppCommonMapper.java
View file @
38cc221c
...
...
@@ -34,4 +34,6 @@ public interface AppCommonMapper {
VehicleInfoForWX
queryVehicleBaseInfo
(
Long
seq
);
JgUseRegistrationManageDto
selectOneCert
(
String
certOrApplyNo
);
JgUseRegistrationManageDto
searchOneCertByParam
(
String
certNo
);
}
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/resources/mapper/AppCommonMapper.xml
View file @
38cc221c
...
...
@@ -102,5 +102,14 @@
and (apply_no = #{certOrApplyNo} or certificate_no = #{certOrApplyNo})
ORDER BY rec_date desc limit 1
</select>
<select
id=
"searchOneCertByParam"
resultType=
"com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto"
>
SELECT
*
FROM
tzs_jg_use_registration_manage
WHERE
is_delete = false
and use_registration_code = #{certNo}
ORDER BY rec_date desc limit 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/controller/TzsAppController.java
View file @
38cc221c
...
...
@@ -340,7 +340,6 @@ public class TzsAppController {
return
ResponseHelper
.
buildResponse
(
tree
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/page"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"企业列表"
,
notes
=
"企业列表"
)
...
...
@@ -349,4 +348,19 @@ public class TzsAppController {
return
ResponseHelper
.
buildResponse
(
iTzBaseEnterpriseInfoService
.
page
(
pageParam
,
tzBaseEnterpriseInfoDto
));
}
/**
* 小程序获取证详情-根据登记证编号查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/certInfo/certNo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"小程序获取登记证或者使用标志详情"
,
notes
=
"小程序获取登记证或者使用标志详情"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getCertInfoByCertNoForWX
(
@Validated
@RequestBody
CertInfoRequestParam
requestParam
,
BindingResult
result
)
{
List
<
FieldError
>
fieldErrors
=
result
.
getFieldErrors
();
if
(!
fieldErrors
.
isEmpty
())
{
throw
new
BadRequest
(
fieldErrors
.
get
(
0
).
getDefaultMessage
());
}
return
ResponseHelper
.
buildResponse
(
certDetailService
.
getCertInfoByCertNoForWX
(
requestParam
));
}
}
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/CertDetailServiceImpl.java
View file @
38cc221c
...
...
@@ -118,4 +118,17 @@ public class CertDetailServiceImpl {
}
return
jgUseRegistrationManage
.
getManageType
()
==
null
?
"set"
:
jgUseRegistrationManage
.
getManageType
();
}
public
Map
<
String
,
Object
>
getCertInfoByCertNoForWX
(
CertInfoRequestParam
requestParam
)
{
JgUseRegistrationManageDto
jgUseRegistrationManage
=
this
.
searchCertByParam
(
requestParam
.
getCertNo
());
return
SearchDetailStrategyContext
.
getHandler
(
this
.
getManageType
(
jgUseRegistrationManage
)).
handler
(
jgUseRegistrationManage
,
"useCert"
);
}
private
JgUseRegistrationManageDto
searchCertByParam
(
String
certNo
)
{
JgUseRegistrationManageDto
jgUseRegistrationManage
=
commonMapper
.
searchOneCertByParam
(
certNo
);
if
(
jgUseRegistrationManage
==
null
)
{
throw
new
AuthException
(
"无此证信息!"
);
}
return
jgUseRegistrationManage
;
}
}
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/VehicleSearchDetailDetailHandlerImpl.java
View file @
38cc221c
...
...
@@ -41,10 +41,10 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
@Override
public
Map
<
String
,
Object
>
handler
(
JgUseRegistrationManageDto
manageDto
,
String
certType
)
{
return
this
.
getQueryCarCylinderInfo
(
manageDto
);
return
this
.
getQueryCarCylinderInfo
(
manageDto
,
certType
);
}
private
Map
<
String
,
Object
>
getQueryCarCylinderInfo
(
JgUseRegistrationManageDto
manageDto
)
{
private
Map
<
String
,
Object
>
getQueryCarCylinderInfo
(
JgUseRegistrationManageDto
manageDto
,
String
certType
)
{
VehicleInfoForWX
baseInfo
=
appCommonMapper
.
queryVehicleBaseInfo
(
manageDto
.
getSequenceNbr
());
// 最好改成查询es record再传入进去
List
<
CylinderInfoForWX
>
cylinderInfos
=
appCommonMapper
.
queryCylinderIfoOfVehicle
(
manageDto
.
getApplyNo
());
...
...
@@ -55,6 +55,9 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
buildOneItemTypeMap
(
baseInfo
,
tabs
);
buildManyItemTypeTab
(
cylinderInfos
,
tabs
);
result
.
put
(
"tab"
,
tabs
);
result
.
put
(
"certNo"
,
manageDto
.
getCertificateNo
());
result
.
put
(
"certType"
,
certType
);
result
.
put
(
"version"
,
manageDto
.
getVersion
());
return
result
;
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/ShCarEquDto.java
View file @
38cc221c
...
...
@@ -33,7 +33,7 @@ public class ShCarEquDto {
@TableField
(
"CAR_ID"
)
private
String
carId
;
@ApiModelProperty
(
value
=
"设备
编
号"
)
@ApiModelProperty
(
value
=
"设备
型
号"
)
@TableField
(
"SEQUENCE_CODE"
)
private
String
sequenceCode
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/ShCarEqu.java
View file @
38cc221c
...
...
@@ -41,7 +41,7 @@ public class ShCarEqu {
private
String
carId
;
/**
* 设备
编
号
* 设备
型
号
*/
@TableField
(
value
=
"\"SEQUENCE_CODE\""
)
private
String
sequenceCode
;
...
...
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 @
38cc221c
...
...
@@ -195,5 +195,13 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
*/
List
<
String
>
findEquipInUseService
(
@Param
(
"record"
)
String
record
);
/**
* 查询指定设备,使用登记后,后续业务的数据
* @param record 设备标识
* @return 后续业务数量
*/
Integer
countBizNumAfterUseReg
(
@Param
(
"record"
)
String
record
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IShCarService.java
View file @
38cc221c
...
...
@@ -16,7 +16,7 @@ public interface IShCarService {
Page
<
ShCarDto
>
queryForShCarPage
(
Page
<
ShCarDto
>
page
,
ShCarDto
dto
);
Boolean
claim
(
Map
<
String
,
Object
>
paramMap
);
Boolean
claim
(
String
claimOneself
,
Map
<
String
,
Object
>
paramMap
);
ShCar
searchForSanHan
(
Map
<?,
?>
map
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/vo/ShCarEquVo.java
View file @
38cc221c
...
...
@@ -32,6 +32,11 @@ public class ShCarEquVo {
private
String
equCode
;
/**
* 设备型号
*/
private
String
equType
;
/**
* 制造日期
*/
private
Date
produceDate
;
...
...
@@ -108,6 +113,15 @@ public class ShCarEquVo {
private
String
produceUnitName
;
private
String
equList
;
private
String
equCategory
;
private
String
equDefine
;
/**
* 是否车用气瓶
*/
private
String
whetherVehicleCylinder
;
public
ShCarEquVo
(
ShCarEqu
shCarEqu
)
{
this
.
setSequenceNbr
(
shCarEqu
.
getSequenceNbr
());
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
38cc221c
...
...
@@ -294,7 +294,7 @@
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and a.is_delete = 0
and ( a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and ( a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -304,7 +304,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and ( a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -314,7 +314,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -324,7 +324,7 @@
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -334,7 +334,7 @@
where
a.sequence_nbr = b.enable_disable_apply_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.audit_status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.audit_status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -344,7 +344,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -354,7 +354,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -364,7 +364,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -374,7 +374,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -384,7 +384,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.audit_status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -394,7 +394,7 @@
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
or
a.notice_status
<![CDATA[ <> ]]>
'6616')
and (a.notice_status
<![CDATA[ <> ]]>
'6617'
AND
a.notice_status
<![CDATA[ <> ]]>
'6616')
UNION
select
apply_no
...
...
@@ -404,7 +404,7 @@
where
a.sequence_nbr = b.vehicle_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废'
OR
a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废'
AND
a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
...
...
@@ -414,7 +414,17 @@
where
a.sequence_nbr = b.unit_change_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'已作废' OR a.status
<![CDATA[ <> ]]>
'已完成')
and (a.status
<![CDATA[ <> ]]>
'已作废' AND a.status
<![CDATA[ <> ]]>
'已完成')
UNION
select
apply_no
from
tzs_jg_equip_transfer a,
tzs_jg_equip_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.apply_status
<![CDATA[ <> ]]>
'6617' AND a.apply_status
<![CDATA[ <> ]]>
'6616')
)
</select>
...
...
@@ -2447,4 +2457,63 @@
where record = #{record}
</if>
</update>
<select
id=
"countBizNumAfterUseReg"
resultType=
"java.lang.Integer"
>
select
sum(inUseNumber)
from (
select
count(1) as inUseNumber
from
tzs_jg_change_registration_reform a,
tzs_jg_change_registration_reform_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_change_registration_transfer a,
tzs_jg_change_registration_transfer_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_change_registration_unit a,
tzs_jg_change_registration_unit_eq b
where
a.sequence_nbr = b.unit_change_registration_id
and b.equ_id = #{record}
and (a.status
<![CDATA[ <> ]]>
'使用单位待提交' and a.status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
count(1) as inUseNumber
from
tzs_jg_scrap_cancel a,
tzs_jg_scrap_cancel_eq b
where
a.sequence_nbr = b.equip_transfer_id
and b.equ_id = #{record}
and (a.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and a.audit_status
<![CDATA[ <> ]]>
'已作废')
UNION all
select
count(1) as inUseNumber
from
(SELECT
json_array_elements(e.equip_info)->>'SEQUENCE_NBR' AS record
FROM
tzs_jg_change_registration_name_eq e,
tzs_jg_change_registration_name n
where
n.sequence_nbr = e.name_change_registration_id
and n.audit_status
<![CDATA[ <> ]]>
'使用单位待提交' and n.audit_status
<![CDATA[ <> ]]>
'已作废') ne
where
ne.record = #{record}
)
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeVehicleRegistrationUnitController.java
View file @
38cc221c
...
...
@@ -17,6 +17,7 @@ import org.typroject.tyboot.component.event.RestEventTrigger;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -124,10 +125,12 @@ public class JgChangeVehicleRegistrationUnitController extends BaseController {
public
ResponseModel
<
Page
<
JgUseRegistrationManageDto
>>
getUseRegistrationCodeData
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"useUnitCreditCode"
)
String
useUnitCreditCode
,
@RequestParam
(
value
=
"useUnitCreditCode"
,
required
=
false
)
String
useUnitCreditCode
,
@RequestParam
(
value
=
"whetherVehicleCylinder"
)
String
whetherVehicleCylinder
,
@RequestParam
(
value
=
"certificateStatus"
)
String
certificateStatus
,
@RequestParam
(
value
=
"useRegistrationCode"
,
required
=
false
)
String
useRegistrationCode
)
{
if
(
ValidationUtil
.
isEmpty
(
useUnitCreditCode
))
throw
new
BadRequest
(
"请先选择原使用单位"
);
JgUseRegistrationManageDto
dto
=
new
JgUseRegistrationManageDto
();
Page
<
JgUseRegistrationManageDto
>
page
=
new
Page
<
JgUseRegistrationManageDto
>();
page
.
setCurrent
(
current
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/ShCarController.java
View file @
38cc221c
...
...
@@ -121,21 +121,21 @@ public class ShCarController extends BaseController {
public
ResponseModel
<
Page
<
ShCarDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
ShCarDto
dto
)
{
Page
<
ShCarDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
Page
<
ShCarDto
>
page
=
new
Page
<>(
current
,
size
);
Page
<
ShCarDto
>
shCarDtoPage
=
iShCarService
.
queryForShCarPage
(
page
,
dto
);
shCarDtoPage
.
getRecords
().
forEach
(
record
->
{
if
(
"1"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"是"
);
// 填充 证管理表的seq,用与认领后跳转证详情页
JgUseRegistrationManage
manage
=
jgUseRegistrationManageServiceImpl
.
getBaseMapper
().
selectOne
(
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
record
.
getUseRegistrationCode
()));
record
.
setCertificateSeq
(
String
.
valueOf
(
manage
.
getSequenceNbr
()));
}
else
if
(
"0"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"否"
);
}
});
Optional
.
ofNullable
(
shCarDtoPage
.
getRecords
()).
ifPresent
(
records
->
records
.
forEach
(
record
->
{
if
(
"1"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"是"
);
JgUseRegistrationManage
manage
=
jgUseRegistrationManageServiceImpl
.
getBaseMapper
()
.
selectOne
(
new
LambdaQueryWrapper
<
JgUseRegistrationManage
>()
.
eq
(
JgUseRegistrationManage:
:
getUseRegistrationCode
,
record
.
getUseRegistrationCode
()));
record
.
setCertificateSeq
(
manage
!=
null
?
String
.
valueOf
(
manage
.
getSequenceNbr
())
:
null
);
}
else
if
(
"0"
.
equals
(
record
.
getClaimedFlag
()))
{
record
.
setClaimedFlag
(
"否"
);
}
})
);
return
ResponseHelper
.
buildResponse
(
shCarDtoPage
);
}
...
...
@@ -206,7 +206,8 @@ public class ShCarController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"认领三环系统数据"
,
notes
=
"认领三环系统数据"
)
@PostMapping
(
value
=
"/claim"
)
public
ResponseModel
<
Boolean
>
claim
(
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
claim
(
paramMap
));
public
ResponseModel
<
Boolean
>
claim
(
@RequestParam
(
value
=
"claimOneself"
,
defaultValue
=
"true"
)
String
claimOneself
,
@RequestBody
Map
<
String
,
Object
>
paramMap
)
{
return
ResponseHelper
.
buildResponse
(
shCarServiceImpl
.
claim
(
claimOneself
,
paramMap
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/ShCarEquController.java
View file @
38cc221c
...
...
@@ -19,6 +19,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
java.util.List
;
import
java.util.Map
;
/**
*
...
...
@@ -120,8 +121,9 @@ public class ShCarEquController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"汽车详细信息列表"
,
notes
=
"汽车详细信息列表"
)
@GetMapping
(
value
=
"/selectByCarId"
)
public
ResponseModel
<
CarAndEquVo
>
selectByCarId
(
@RequestParam
String
carId
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
selectByCarId
(
@RequestParam
(
value
=
"carId"
)
String
carId
,
@RequestParam
(
value
=
"claimOneself"
)
String
claimOneself
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryByCarId
(
carId
,
reginParams
));
return
ResponseHelper
.
buildResponse
(
shCarEquServiceImpl
.
queryByCarId
(
carId
,
claimOneself
,
reginParams
));
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/ICommonService.java
View file @
38cc221c
...
...
@@ -228,4 +228,13 @@ public interface ICommonService {
* @return
*/
Boolean
checkEquCodeUniqueness
(
String
equCode
);
/**
* 检查使用登记证号全局唯一
*
* @param useRegistrationCode 使用登记证号
* @param equipId 设备record
* @return
*/
Boolean
useRegistrationCertificateAccountUnique
(
String
useRegistrationCode
,
String
equipId
);
}
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/BaseUseRegisterResultData.java
0 → 100644
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
public
class
BaseUseRegisterResultData
{
public
static
final
String
HAPPEN_AFTER_BIZ
=
"happenAfterBiz"
;
private
final
JSONObject
data
;
public
BaseUseRegisterResultData
(
JSONObject
data
)
{
this
.
data
=
data
;
}
public
JSONObject
getData
()
{
return
data
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.codec.Base64Decoder
;
import
cn.hutool.core.codec.Base64Encoder
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DatePattern
;
...
...
@@ -788,6 +787,11 @@ public class CommonServiceImpl implements ICommonService {
List
<
DictionarieValueModel
>
result
=
Systemctl
.
dictionarieClient
.
dictValues
(
"OLD_INSTALLATION_UNIT"
).
getResult
();
result
.
forEach
(
x
->
convertAndAddToUnitList
(
x
,
unitList
));
}
// 使用单位追加 三环认领的(业主可能未注册系统,别人帮忙认领的,帮忙认领后会保存一份原使用单位的数据到字典)
if
(
"使用单位"
.
equals
(
type
))
{
List
<
DictionarieValueModel
>
result
=
Systemctl
.
dictionarieClient
.
dictValues
(
"OLD_USE_UNIT"
).
getResult
();
result
.
forEach
(
x
->
convertAndAddToUnitList
(
x
,
unitList
));
}
List
<
Map
<
String
,
Object
>>
unitListByType
=
commonMapper
.
getUnitListByType
(
type
);
unitList
.
addAll
(
unitListByType
);
return
unitList
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/DefaultUseRegisterResult.java
0 → 100644
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.slf4j.Slf4j
;
/**
* 默认处理器
*/
@Slf4j
public
class
DefaultUseRegisterResult
extends
BaseUseRegisterResultData
{
public
DefaultUseRegisterResult
(
JSONObject
data
)
{
super
(
data
);
}
@Override
public
JSONObject
getData
()
{
JSONObject
data
=
super
.
getData
();
fillingEditPermission
(
data
);
return
data
;
}
/**
* 新增时默认不可编辑
* @param jsonObject 原始数据
*/
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
true
);
}
}
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/FillingEditPermForCurrentUser.java
0 → 100644
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.List
;
@Slf4j
public
class
FillingEditPermForCurrentUser
extends
BaseUseRegisterResultData
{
public
FillingEditPermForCurrentUser
(
JSONObject
data
)
{
super
(
data
);
}
@Override
public
JSONObject
getData
()
{
JSONObject
data
=
super
.
getData
();
fillingEditPermission
(
data
);
return
data
;
}
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
String
HAS_PERMISSION
=
"hasPermission"
;
jsonObject
.
put
(
HAS_PERMISSION
,
false
);
// 当前登录人所在用户组
List
<
GroupModel
>
groupModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
groupClient
.
queryByUserId
(
RequestContext
.
getExeUserId
()));
// 有权限编辑设备的用户组(value为用户组名称)
List
<
DictionarieValueModel
>
hasPermGroup
=
FeignUtil
.
remoteCall
(()
->
Systemctl
.
dictionarieClient
.
dictValues
(
"USE_REG_PERMISSION_GROUP"
));
if
(
groupModels
.
stream
().
anyMatch
(
g
->
hasPermGroup
.
stream
().
anyMatch
(
h
->
h
.
getDictDataValue
().
equals
(
g
.
getGroupName
()))))
{
jsonObject
.
put
(
HAS_PERMISSION
,
true
);
}
}
}
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/FillingUseRegisterResult.java
0 → 100644
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.ApplicationContext
;
import
java.util.List
;
@Slf4j
public
class
FillingUseRegisterResult
extends
BaseUseRegisterResultData
{
private
final
ApplicationContext
applicationContext
;
/**
* 使用登记主键
*/
private
final
Long
userRegisterId
;
public
FillingUseRegisterResult
(
Long
sequenceNbr
,
JSONObject
data
,
ApplicationContext
applicationContext
)
{
super
(
data
);
this
.
applicationContext
=
applicationContext
;
this
.
userRegisterId
=
sequenceNbr
;
}
@Override
public
JSONObject
getData
()
{
JSONObject
data
=
super
.
getData
();
fillingEditPermission
(
data
);
return
data
;
}
/**
* 判断设备在做过后续业务:移转变更、改造变更、更名变更、单位变更【使用单位未提交、已作废不包括统计内】
*
* @param jsonObject 返回的数据
*/
private
void
fillingEditPermission
(
JSONObject
jsonObject
)
{
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
false
);
List
<
JgUseRegistrationEq
>
useRegistrationEqs
=
getJgUseRegistrationEqService
().
list
(
new
LambdaQueryWrapper
<
JgUseRegistrationEq
>()
.
eq
(
JgUseRegistrationEq:
:
getEquipTransferId
,
userRegisterId
)
.
select
(
JgUseRegistrationEq:
:
getEquId
,
BaseEntity:
:
getSequenceNbr
));
for
(
JgUseRegistrationEq
useRegistrationEq
:
useRegistrationEqs
)
{
Integer
useTimes
=
getCommonMapper
().
countBizNumAfterUseReg
(
useRegistrationEq
.
getEquId
());
if
(
useTimes
>
0
)
{
log
.
warn
(
"设备:{}做过后续业务, 此使用登记:{}不可再变更设备信息"
,
useRegistrationEq
.
getEquId
(),
userRegisterId
);
jsonObject
.
put
(
HAPPEN_AFTER_BIZ
,
true
);
break
;
}
}
}
private
JgUseRegistrationEqServiceImpl
getJgUseRegistrationEqService
()
{
return
applicationContext
.
getBean
(
JgUseRegistrationEqServiceImpl
.
class
);
}
private
CommonMapper
getCommonMapper
()
{
return
applicationContext
.
getBean
(
CommonMapper
.
class
);
}
}
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 @
38cc221c
...
...
@@ -398,8 +398,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
check96333Code
(
equipmentInfoForm
);
// 气瓶 校验制造单位统一信用代码与出场编码唯一
checkFactoryNumUniqueWithGasCylinder
(
equipmentInfoForm
,
record
);
// 历史(车用气瓶)设备校验使用登记证编号全库唯一
hisEquCheckUseRegistrationCodeUniqueness
(
equipmentInfoForm
);
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
checkIsSanHanData
(
equipmentInfoForm
);
//
checkIsSanHanData(equipmentInfoForm);
}
catch
(
Exception
e
)
{
handleError
(
e
,
null
);
}
...
...
@@ -510,6 +512,19 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private
void
hisEquCheckUseRegistrationCodeUniqueness
(
LinkedHashMap
<?,
?>
equipmentInfoForm
)
{
// 历史(车用气瓶)设备校验使用登记证编号全库唯一
String
dataSource
=
(
String
)
equipmentInfoForm
.
get
(
DATA_SOURCE
);
String
record
=
(
String
)
equipmentInfoForm
.
get
(
RECORD
);
String
useRegistrationCode
=
(
String
)
equipmentInfoForm
.
get
(
"useRegistrationCode"
);
if
(!
ValidationUtil
.
isEmpty
(
dataSource
)
&&
dataSource
.
contains
(
"his"
)
&&
!
ValidationUtil
.
isEmpty
(
useRegistrationCode
))
{
Boolean
unique
=
commonService
.
useRegistrationCertificateAccountUnique
(
useRegistrationCode
,
ValidationUtil
.
isEmpty
(
record
)
?
null
:
record
);
if
(
unique
)
{
throw
new
BadRequest
(
"使用登记证编号已存在,请重新输入!"
);
}
}
}
private
void
checkFactoryNumUnique
(
String
factoryNum
,
String
produceUnitCreditCode
,
StringBuilder
result
)
{
// 车用气瓶业务里面的 出厂编号/产品编码 校验唯一性(产品编号在车用气瓶范围内全局唯一)
if
(
commonMapper
.
checkFactoryNumUnique
(
factoryNum
,
null
,
produceUnitCreditCode
)
>
0
)
{
...
...
@@ -615,9 +630,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
ValidationUtil
.
isEmpty
(
equIpClassMap
))
{
resultMap
.
put
(
EQUIP_CLASS_FORM_ID
,
equIpClassMap
);
}
if
(!
ValidationUtil
.
isEmpty
(
equipInfoMap
))
{
resultMap
.
put
(
EQUIP_INFO_FORM_ID
,
equipInfoMap
);
}
// 设备参数
if
(
equIpClassMap
.
containsKey
(
EQU_LIST
)
&&
!
ValidationUtil
.
isEmpty
(
equIpClassMap
.
get
(
EQU_LIST
).
toString
()))
{
Map
<
String
,
Object
>
equipParamsMap
=
this
.
getEquipParamsMap
(
record
,
""
,
equIpClassMap
.
get
(
EQU_LIST
).
toString
());
...
...
@@ -629,6 +641,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
equipParamsMap
.
put
(
EQU_DEFINE
,
String
.
valueOf
(
equIpClassMap
.
get
(
EQU_DEFINE
)));
resultMap
.
put
(
EQUIP_PARAMS_FORM_ID
,
equipParamsMap
);
}
equipInfoMap
.
put
(
"identificationCode"
,
equipParamsMap
.
get
(
"VIN"
));
}
if
(!
ValidationUtil
.
isEmpty
(
equipInfoMap
))
{
resultMap
.
put
(
EQUIP_INFO_FORM_ID
,
equipInfoMap
);
}
// 处理复制设备信息
...
...
@@ -1072,6 +1089,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.
collect
(
Collectors
.
toMap
(
Map
.
Entry
::
getKey
,
Map
.
Entry
::
getValue
));
objMap
.
putAll
(
filterMap
);
}
objMap
.
put
(
"useRegistrationCode"
,
registerInfo
.
getUseOrgCode
());
}
// 维保备案【一对多,暂时只取最新一条数据】
IdxBizJgMaintenanceRecordInfo
maintenanceRecordInfo
=
iIdxBizJgMaintenanceRecordInfoService
.
queryNewestDetailByRecord
(
record
);
...
...
@@ -1376,7 +1394,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
liftingMap
=
Bean
.
BeantoMap
(
lifting
);
liftingMap
.
put
(
"liftingSeq"
,
lifting
.
getSequenceNbr
());
}
else
{
liftingMap
=
convertCamelToUnderscore
(
lifting
,
null
);
String
[]
fields
=
{
"EXPLOSIONPROOF_SIGN_COMPLETE"
};
liftingMap
=
convertCamelToUnderscore
(
lifting
,
fields
);
liftingMap
.
put
(
"LIFTING_SEQ"
,
lifting
.
getSequenceNbr
());
}
if
(!
liftingMap
.
isEmpty
())
{
...
...
@@ -2406,9 +2425,6 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
inspectionDetectionInfo
.
setInspectOrgName
((
String
)
mapOrDefault
.
getOrDefault
(
"useUnit"
,
inspectionDetectionInfo
.
getInspectOrgName
()));
inspectionDetectionInfo
.
setRecord
(
record
);
inspectionDetectionInfo
.
setRecDate
(
date
);
if
(!
"1"
.
equals
(
equipmentInfoForm
.
get
(
WHETHER_VEHICLE_CYLINDER
)))
{
// 老旧车用气瓶有些制造监督检验已过期,可放开选择定期检验
inspectionDetectionInfo
.
setInspectType
(
"8300"
.
equals
(
equCategory
)
?
"AZJDJY"
:
"ZZJDJY"
);
}
if
(
inspectionDetectionInfo
.
getNextInspectDate
()
!=
null
)
{
inspectionDetectionInfo
.
setNextInspectDate
(
DateUtil
.
parse
(
DateUtil
.
format
(
inspectionDetectionInfo
.
getNextInspectDate
(),
DatePattern
.
NORM_DATE_PATTERN
)));
}
...
...
@@ -2498,7 +2514,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
// 补丁:saveOrUpdate在update数据时不会更新字段为null的字段,但是编辑设备的代码时,从有改成无,equCode解析成null,但是此时需要将equcode删掉
registerInfo
.
setEquCode
(
ObjectUtils
.
isEmpty
(
registerInfo
.
getEquCode
())
?
""
:
registerInfo
.
getEquCode
());
// copy设备 =》 使用登记证号置空
registerInfo
.
setUseOrgCode
(
isCopy
?
""
:
registerInfo
.
getUseOrgCode
());
String
useOrgCode
=
ValidationUtil
.
isEmpty
(
equipmentInfoForm
.
get
(
"useRegistrationCode"
))
?
""
:
String
.
valueOf
(
equipmentInfoForm
.
get
(
"useRegistrationCode"
));
registerInfo
.
setUseOrgCode
(
isCopy
?
""
:
useOrgCode
);
this
.
saveOrUpdate
(
registerInfo
);
// 监督管理
...
...
@@ -2607,6 +2624,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if
(!
ValidationUtil
.
isEmpty
(
vessel
))
{
vessel
.
setRecord
(
record
);
vessel
.
setRecDate
(
date
);
String
VIN
=
ValidationUtil
.
isEmpty
(
equipmentInfoForm
.
get
(
"identificationCode"
))
?
""
:
(
String
)
equipmentInfoForm
.
get
(
"identificationCode"
);
vessel
.
setVin
(
VIN
);
vessel
.
setSequenceNbr
(
OPERATESAVE
.
equals
(
operateType
)
?
null
:
String
.
valueOf
(
equipmentParamsForm
.
get
(
"VESSEL_SEQ"
)));
iIdxBizJgTechParamsVesselService
.
saveOrUpdateData
(
vessel
);
}
...
...
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/JgChangeRegistrationTransferServiceImpl.java
View file @
38cc221c
...
...
@@ -822,7 +822,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
this
.
getBaseMapper
().
updateById
(
jgChangeRegistrationTransfer
);
}
private
Map
<
String
,
String
>
create
SupervisoryCode
(
JgRegistrationHistory
historyData
)
{
private
Map
<
String
,
String
>
create
96333Code
(
JgRegistrationHistory
historyData
,
String
record
)
{
Map
<
String
,
Object
>
changeData
=
JSON
.
parseObject
(
historyData
.
getChangeData
(),
Map
.
class
);
List
<
JSONObject
>
registrationList
=
(
List
<
JSONObject
>)
changeData
.
get
(
"registrationList"
);
String
equCategoryCode
=
Optional
.
ofNullable
(
registrationList
)
...
...
@@ -838,20 +838,21 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
.
map
(
s
->
s
.
split
(
"_"
)[
0
])
.
orElse
(
""
);
String
isXiXian
=
"0"
.
equals
(
changeData
.
get
(
"transferIsXixian"
))
?
"null"
:
"1"
;
// 移转不需要重新生成监管码,只需要新生成96333码,接口上送superviseCode则不再生成监管码
IdxBizJgOtherInfo
otherInfo
=
otherInfoService
.
getOneData
(
record
);
String
superviseCode
=
otherInfo
.
getSupervisoryCode
();
ImmutableMap
<
String
,
Object
>
map
=
ImmutableMap
.<
String
,
Object
>
builder
()
.
put
(
"cityCode"
,
cityCode
)
.
put
(
"countyCode"
,
countyCode
)
.
put
(
"equCategory"
,
equCategoryCode
)
.
put
(
"isXiXian"
,
isXiXian
)
.
put
(
"superviseCode"
,
superviseCode
)
.
build
();
Map
<
String
,
Object
>
result
=
tzsServiceFeignClient
.
createCode
(
map
).
getResult
();
return
ImmutableMap
.<
String
,
String
>
builder
()
.
put
(
"superviseCode"
,
Optional
.
ofNullable
(
result
)
.
map
(
r
->
(
String
)
r
.
get
(
"superviseCode"
))
.
orElse
(
""
))
.
put
(
"superviseCode"
,
superviseCode
)
.
put
(
"code96333"
,
Optional
.
ofNullable
(
result
)
.
map
(
r
->
(
String
)
r
.
get
(
"code96333"
))
.
orElse
(
""
))
...
...
@@ -935,7 +936,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
String
supervisoryCode
=
""
,
code96333
=
""
;
//区外移装
if
(
"1"
.
equals
(
transfer
.
getTransferType
()))
{
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create
SupervisoryCode
(
historyData
);
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create
96333Code
(
historyData
,
device
.
getEquId
()
);
supervisoryCode
=
supervisoryCodeMap
.
get
(
"superviseCode"
);
code96333
=
supervisoryCodeMap
.
get
(
"code96333"
);
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
supervisoryCode
,
transfer
.
getReceiveCompanyCode
(),
false
));
...
...
@@ -957,7 +958,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
.
map
(
ReginStepEnum:
:
getCode
)
.
anyMatch
(
code
->
code
.
equals
(
county
)
||
code
.
equals
(
deviceCity
));
if
(
shouldUpdateCode
)
{
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create
SupervisoryCode
(
historyData
);
Map
<
String
,
String
>
supervisoryCodeMap
=
this
.
create
96333Code
(
historyData
,
device
.
getEquId
()
);
supervisoryCode
=
supervisoryCodeMap
.
get
(
"superviseCode"
);
code96333
=
supervisoryCodeMap
.
get
(
"code96333"
);
useRegistrationCode
.
set
(
commonServiceImpl
.
generateRegistrationCode
(
device
.
getEquId
(),
supervisoryCode
,
transfer
.
getReceiveCompanyCode
(),
false
));
...
...
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/JgChangeVehicleRegistrationUnitServiceImpl.java
View file @
38cc221c
...
...
@@ -488,7 +488,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
jgCertificateChangeRecord
.
setRegType
(
BUSINESS_NAME
);
jgCertificateChangeRecord
.
setRegDate
(
jgChangeVehicleRegistrationUnit
.
getApplyDate
());
FeignClientResult
<
AgencyUserModel
>
agencyUserModelFeignClientResult
=
Privilege
.
agencyUserClient
.
queryByUserId
(
jgChangeVehicleRegistrationUnit
.
getCreateUserId
());
jgCertificateChangeRecord
.
setChangeContent
(
jgChangeVehicleRegistrationUnit
.
get
UseUnitName
()+
"的"
+
agencyUserModelFeignClientResult
.
getResult
().
getRealName
()
+
"办理了【"
+
BUSINESS_NAME
+
"】,"
+
"单号【"
+
jgChangeVehicleRegistrationUnit
.
getApplyNo
()
+
jgCertificateChangeRecord
.
setChangeContent
(
jgChangeVehicleRegistrationUnit
.
get
NewUseUnitName
()
+
"的"
+
agencyUserModelFeignClientResult
.
getResult
().
getRealName
()
+
"办理了【"
+
BUSINESS_NAME
+
"】,"
+
"单号【"
+
jgChangeVehicleRegistrationUnit
.
getApplyNo
()
+
"】,原"
+
jgChangeVehicleRegistrationUnit
.
getUseUnitName
()
+
"变更为"
+
jgChangeVehicleRegistrationUnit
.
getNewUseUnitName
()
+
",办理日期"
+
sdf
.
format
(
jgChangeVehicleRegistrationUnit
.
getAuditPassDate
()));
jgCertificateChangeRecord
.
setRecUserId
(
jgChangeVehicleRegistrationUnit
.
getRecUserId
());
jgCertificateChangeRecord
.
setRecDate
(
new
Date
());
...
...
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/JgEquipTransferServiceImpl.java
View file @
38cc221c
...
...
@@ -37,6 +37,7 @@ import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -101,6 +102,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param reginParams redis信息
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
JgEquipTransfer
>
saveTransfer
(
String
submitType
,
JSONObject
jsonObjectMap
,
ReginParams
reginParams
)
{
JgEquipTransferDto
model
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
jsonObjectMap
),
JgEquipTransferDto
.
class
);
...
...
@@ -110,6 +112,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
throw
new
BadRequest
(
"请选择设备!"
);
}
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
deviceList
.
forEach
(
device
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
String
.
valueOf
(
device
.
get
(
"SEQUENCE_NBR"
)),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
//获取申请单编号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
getCode
.
get
(
String
.
valueOf
(
jsonObjectMap
.
get
(
"businessCode"
))),
deviceList
.
size
());
this
.
handleResponseModel
(
listResponseModel
,
"告知单获取失败: "
);
...
...
@@ -154,14 +165,6 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
this
.
updateRedisBatch
(
transferList
);
// 创建历史数据
this
.
saveOrUpdateHisDataBatch
(
jgEquipTransferEqList
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
//放在最后面防止前面有异常
//如果是提交,用于校验设备是否已经在流程中,如果不在标记设备已经在流程中
CompanyBo
company
=
reginParams
.
getCompany
();
jgEquipTransferEqList
.
forEach
(
equipTransferEq
->
EquipUsedCheckStrategyContext
.
getUsedStrategy
(
EQUIP_TRANSFER_PROCESS_KEY
)
.
equipRepeatUsedCheck
(
equipTransferEq
.
getEquId
(),
CompanyTypeEnum
.
INDIVIDUAL
.
getName
().
equals
(
company
.
getCompanyType
())
?
company
.
getCompanyCode
().
split
(
"_"
)[
1
]
:
company
.
getCompanyCode
()));
}
return
transferList
;
}
...
...
@@ -324,6 +327,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @return 设备信息
*/
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
JgEquipTransferDto
updateEquipTransfer
(
String
submitType
,
JgEquipTransferDto
equipTransferDto
,
String
op
,
ReginParams
reginParams
)
{
if
(
Objects
.
isNull
(
equipTransferDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
...
...
@@ -428,6 +432,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param op 通过或驳回
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
JgEquipTransferDto
jgEquipTransferDto
,
String
op
)
{
String
instanceId
=
jgEquipTransferDto
.
getInstanceId
();
String
nextTaskId
=
jgEquipTransferDto
.
getNextTaskId
();
...
...
@@ -538,6 +543,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
* @param equipTransferInfo 设备移交信息
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
void
cancel
(
JgEquipTransferDto
equipTransferInfo
)
{
String
instanceId
=
equipTransferInfo
.
getInstanceId
();
String
nextTaskId
=
equipTransferInfo
.
getNextTaskId
();
...
...
@@ -803,6 +809,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@GlobalTransactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteForBatch
(
Long
[]
ids
)
{
Collection
<
JgEquipTransfer
>
jgEquipTransfers
=
this
.
listByIds
(
Arrays
.
asList
(
ids
));
for
(
JgEquipTransfer
notice
:
jgEquipTransfers
)
{
...
...
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/JgInstallationNoticeServiceImpl.java
View file @
38cc221c
...
...
@@ -113,24 +113,11 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private
static
final
String
CONSTRUCTION_TYPE_NAME
=
"安装"
;
// 西安行政区划code
private
static
final
String
XIAN
=
"610100"
;
// 咸阳行政区划code
private
static
final
String
XIAN_YANG
=
"610400"
;
@Value
(
"classpath:/json/urlInfo.json"
)
public
Resource
bizTypeInfo
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Autowired
JgInstallationNoticeEqMapper
jgInstallationNoticeEqMapper
;
@Autowired
JgInstallationNoticeEqServiceImpl
jgInstallationNoticeEqService
;
@Autowired
JgUseRegistrationMapper
jgUseRegistrationMapper
;
@Autowired
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
@Autowired
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
IdxBizJgRegisterInfoMapper
tzsJgRegistrationInfoMapper
;
...
...
@@ -143,8 +130,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Autowired
SupervisoryCodeInfoMapper
supervisoryCodeInfoMapper
;
@Autowired
SuperviseInfoMapper
superviseInfoMapper
;
@Autowired
IIdxBizJgConstructionInfoService
constructionInfoService
;
@Autowired
IIdxBizJgUseInfoService
useInfoService
;
...
...
@@ -153,12 +138,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Value
(
value
=
"${tzs.domain:http://sxtzsb.sxsei.com}"
)
String
TZSDOMAIN
;
@Autowired
AmosRequestContext
amosRequestContext
;
@Autowired
CodeUtil
codeUtil
;
@Autowired
CommonServiceImpl
commonServiceImpl
;
@Autowired
JgCertificateChangeRecordServiceImpl
certificateChangeRecordService
;
@Autowired
JgCertificateChangeRecordEqServiceImpl
certificateChangeRecordEqService
;
...
...
@@ -203,6 +184,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
EventPublisher
eventPublisher
;
/**
* 安装改造维修单位吱资质类型:1234
*/
@Value
(
"${company.type.notice:1234}"
)
private
String
companyType
;
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
...
...
@@ -610,7 +597,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ArrayList
<
Map
<
String
,
Object
>>
maps
=
new
ArrayList
<>();
equList
.
forEach
(
equ
->
{
List
<
Map
<
String
,
Object
>>
informationList
=
jgInstallationNoticeMapper
.
queryEquipInformation
(
equ
.
getSequenceNbr
());
if
(
Objects
.
isNull
(
jgInstallationNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
if
(
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"安装告知单不存在"
);
}
Map
<
String
,
Object
>
placeholders
=
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_INSTALLATION_NOTIFICATION
.
getName
().
substring
(
0
,
2
));
...
...
@@ -633,8 +620,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String
useCode
=
String
.
valueOf
(
informObj
.
get
(
"installUnitCreditCode"
));
LambdaQueryWrapper
<
TzBaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
TzBaseUnitLicence:
:
getUnitCode
,
useCode
);
wrapper
.
eq
(
TzBaseUnitLicence:
:
getCertTypeCode
,
companyType
);
wrapper
.
orderByDesc
(
TzBaseUnitLicence:
:
getExpiryDate
);
wrapper
.
orderByDesc
(
TzBaseUnitLicence:
:
getRecDate
);
// 去重显示3个
wrapper
.
groupBy
(
TzBaseUnitLicence:
:
getCertNo
,
TzBaseUnitLicence:
:
getExpiryDate
);
wrapper
.
select
(
TzBaseUnitLicence:
:
getCertNo
,
TzBaseUnitLicence:
:
getExpiryDate
);
wrapper
.
last
(
" LIMIT 3"
);
List
<
TzBaseUnitLicence
>
list
=
baseUnitLicenceMapper
.
selectList
(
wrapper
);
...
...
@@ -1143,8 +1134,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
ResponseModel
<
String
>
responseModel
=
tzsServiceFeignClient
.
deviceRegistrationCode
(
registrationCode
);
String
deviceRegistrationCode
=
responseModel
.
getResult
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"code96333"
,
tzsJgOtherInfo
.
getCode96333
());
map
.
put
(
"superviseCode"
,
tzsJgOtherInfo
.
getSupervisoryCode
());
map
.
put
(
"cityCode"
,
jgInstallationNotice
.
getCity
());
map
.
put
(
"countyCode"
,
jgInstallationNotice
.
getCounty
());
map
.
put
(
"equCategory"
,
idxBizJgRegisterInfo
.
getEquCategory
());
...
...
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/JgUseRegistrationServiceImpl.java
View file @
38cc221c
...
...
@@ -64,7 +64,10 @@ import org.apache.commons.io.IOUtils;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -107,10 +110,12 @@ import static java.util.stream.Collectors.toList;
*/
@Service
@Slf4j
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>
{
public
class
JgUseRegistrationServiceImpl
extends
BaseService
<
JgUseRegistrationDto
,
JgUseRegistration
,
JgUseRegistrationMapper
>
implements
IJgUseRegistrationService
,
ICompensateFlowDataOfRedis
<
JgUseRegistration
>
,
ApplicationContextAware
{
private
static
final
String
DEFINITION_KEY
=
"useRegistration"
;
private
final
List
<
String
>
NOT_FLOWING_STATE
=
Arrays
.
asList
(
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
,
"已作废"
);
private
ApplicationContext
applicationContext
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
...
...
@@ -124,8 +129,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
IdxBizJgDesignInfoServiceImpl
idxBizJgDesignInfoService
;
@Autowired
TzsUserInfoMapper
userInfoMapper
;
@Autowired
ICommonService
commonService
;
@Autowired
CommonServiceImpl
commonServiceImpl
;
...
...
@@ -136,8 +139,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
TzBaseEnterpriseInfoMapper
tzBaseEnterpriseInfoMapper
;
@Autowired
EquipTechParamPipelineMapper
equipTechParamPipelineMapper
;
@Autowired
EventPublisher
eventPublisher
;
@Autowired
...
...
@@ -209,6 +210,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
@Autowired
SupervisoryCodeInfoMapper
supervisoryCodeInfoMapper
;
/**
* @param auditPassDate 通过时间
* @param exportParamsMap 参数map
...
...
@@ -1757,6 +1760,10 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
jsonObject
.
put
(
"useRegistrationCode"
,
jgUseRegistration
.
getUseRegistrationCode
());
// 转化 附件 字段
commonServiceImpl
.
convertStringToJsonobject
(
jsonObject
,
jsonFields
);
// 结果增强,填充单据是否可变更设备状态,用来控制前端按钮的显示隐藏。
new
FillingUseRegisterResult
(
sequenceNbr
,
jsonObject
,
applicationContext
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
jsonObject
).
getData
();
return
jsonObject
;
}
// 基本信息 + 制造信息
...
...
@@ -1802,9 +1809,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 附件解析
commonServiceImpl
.
convertStringToJsonobject
(
detail
,
jsonFields
);
detail
.
put
(
"province"
,
"610000"
);
return
detail
;
JSONObject
result
=
new
JSONObject
();
result
.
putAll
(
detail
);
// 结果增强,填充单据是否可变更设备状态
new
DefaultUseRegisterResult
(
result
).
getData
();
// 结果增强,填充当前人是否有编辑按钮权限
new
FillingEditPermForCurrentUser
(
result
).
getData
();
return
result
;
}
public
Map
<
String
,
Object
>
getDetailByIdx
(
String
record
)
{
// 基本信息 + 制造信息
Map
<
String
,
Object
>
detail
=
this
.
baseMapper
.
getDetail
(
record
);
...
...
@@ -2553,8 +2569,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
this
.
rollBackForEquipEsInfo
(
record
,
flag
);
// 5.历史设备处理
this
.
dealHisRegEquipData
(
jgUseRegistration
,
record
);
});
List
<
String
>
equipTransferIds
=
eqList
.
stream
()
.
map
(
JgUseRegistrationEq:
:
getEquipTransferId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
if
(!
equipTransferIds
.
isEmpty
())
{
jgResumeInfoService
.
deleteBatchByBusinessId
(
equipTransferIds
);
}
}
private
void
dealHisRegEquipData
(
JgUseRegistration
jgUseRegistration
,
String
record
)
{
...
...
@@ -3506,4 +3528,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
public
void
compensate
(
JgUseRegistration
jgUseRegistration
)
{
commonService
.
saveExecuteFlowData2Redis
(
jgUseRegistration
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgUseRegistration
));
}
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
applicationContext
=
applicationContext
;
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgVehicleInformationServiceImpl.java
View file @
38cc221c
...
...
@@ -848,6 +848,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 登记证记录主键
Long
changeRecordId
=
sequence
.
nextId
();
List
<
String
>
equipIdList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
mapData
=
jsonArray
.
getJSONObject
(
i
);
// 设备ID
...
...
@@ -890,7 +891,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
changeRecordEq
.
setEquId
(
registerInfo
.
getRecord
());
//设备主键
changeRecordEq
.
setProductCode
(
idxBizJgFactoryInfo
.
getFactoryNum
());
//产品编号
certificateChangeRecordEqService
.
save
(
changeRecordEq
);
equipIdList
.
add
(
equId
);
}
// 更新新生成的历史数据的设备代码
jgRegistrationHistory
.
setChangeData
(
JSON
.
toJSONString
(
jsonArray
));
jgRegistrationHistoryService
.
updateById
(
jgRegistrationHistory
);
...
...
@@ -917,6 +920,21 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 生成一条tzs_jg_certificate_change_record记录
generateCertificateChangeRecord
(
jgVehicleInformation
,
registerInfo
,
changeRecordId
,
taskV2Model
);
jgResumeInfoService
.
saveBatchResume
(
equipIdList
.
stream
()
.
map
(
equipId
->
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgVehicleInformation
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_VEHICLE_GAS_APPLICATION
.
getName
())
.
businessId
(
String
.
valueOf
(
jgVehicleInformation
.
getSequenceNbr
()))
.
equId
(
equipId
)
.
approvalUnit
(
jgVehicleInformation
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgVehicleInformation
.
getReceiveCompanyCode
())
.
status
(
"正常"
)
.
routePath
(
taskV2Model
.
getRoutePath
())
.
build
())
.
collect
(
Collectors
.
toList
())
);
}
this
.
getBaseMapper
().
updateById
(
jgVehicleInformation
);
commonService
.
saveExecuteFlowData2Redis
(
jgVehicleInformation
.
getInstanceId
(),
this
.
buildInstanceRuntimeData
(
jgVehicleInformation
));
...
...
@@ -1757,7 +1775,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
throw
new
BadRequest
(
"使用登记证编号已存在!"
);
}
// 检测是否三环系统中的车用气瓶数据 不让三环系统数据通过设备新增方式进来
this
.
checkIsSanSystemHanData
(
map
);
//
this.checkIsSanSystemHanData(map);
//使用登记证编号判断是否使用未来系统生成编号
idxBizJgRegisterInfoService
.
checkUseRegistrationCode
(
useRegistrationCode1
,
"vehicle"
);
...
...
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/ShCarEquServiceImpl.java
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ShCarDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCar
;
import
com.yeejoin.amos.boot.module.jg.api.entity.ShCarEqu
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.ShCarEquMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IShCarEquService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.CarAndEquVo
;
import
com.yeejoin.amos.boot.module.jg.api.vo.ShCarEquVo
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -49,7 +53,8 @@ public class ShCarEquServiceImpl extends BaseService<ShCarEqu, ShCarEqu, ShCarEq
return
this
.
queryForList
(
""
,
false
);
}
public
CarAndEquVo
queryByCarId
(
String
carId
,
ReginParams
reginParams
)
{
public
Map
<
String
,
Object
>
queryByCarId
(
String
carId
,
String
claimOneself
,
ReginParams
reginParams
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
// 根据carId获取Car
LambdaQueryWrapper
<
ShCar
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
ShCar:
:
getSequenceNbr
,
carId
);
...
...
@@ -60,26 +65,98 @@ public class ShCarEquServiceImpl extends BaseService<ShCarEqu, ShCarEqu, ShCarEq
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
AgencyUserModel
userModel
=
reginParams
.
getUserModel
();
shCarDto
.
setCompanyType
(
companyType
);
shCarDto
.
setUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
shCarDto
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
String
[]
code
=
reginParams
.
getCompany
().
getCompanyCode
().
split
(
"_"
);
String
useUnitCode
=
code
.
length
>
1
?
code
[
1
]
:
code
[
0
];
if
(
"个人主体"
.
equals
(
companyType
))
{
shCarDto
.
setUseUnitAddress
((
String
)
commonService
.
getEnterpriseInfo
(
useUnitCode
).
get
(
"address"
));
}
else
{
shCarDto
.
setUseUnitAddress
(
reginParams
.
getCompany
().
getAddress
());
if
(
"true"
.
equals
(
claimOneself
)){
//认领自己的
shCarDto
.
setUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
shCarDto
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
if
(
"个人主体"
.
equals
(
companyType
))
{
shCarDto
.
setUseUnitAddress
((
String
)
commonService
.
getEnterpriseInfo
(
useUnitCode
).
get
(
"address"
));
}
else
{
shCarDto
.
setUseUnitAddress
(
reginParams
.
getCompany
().
getAddress
());
}
}
if
(
"false"
.
equals
(
claimOneself
)){
//帮别人认领 取 原三环数据填充表单
shCarDto
.
setUseUnitName
(
shCar
.
getOwner
());
shCarDto
.
setUseUnitCreditCode
(
shCar
.
getOwner
());
shCarDto
.
setUseUnitAddress
(
shCar
.
getAddress
());
}
shCarDto
.
setSafetyManagerId
(
"个人主体"
.
equals
(
companyType
)
?
userModel
.
getRealName
()
:
null
);
shCarDto
.
setPhone
(
"个人主体"
.
equals
(
companyType
)
?
userModel
.
getMobile
()
:
null
);
if
(!
ValidationUtil
.
isEmpty
(
shCarDto
.
getVehicleAttribute
())){
switch
(
shCarDto
.
getVehicleAttribute
())
{
case
"A"
:
shCarDto
.
setVehicleAttribute
(
"PRIVATE_CAR"
);
break
;
case
"B"
:
shCarDto
.
setVehicleAttribute
(
"BUS"
);
break
;
case
"H"
:
shCarDto
.
setVehicleAttribute
(
"SERVICE_VEHICLE"
);
break
;
case
"P"
:
shCarDto
.
setVehicleAttribute
(
"SERVICE_CAR"
);
break
;
case
"V"
:
shCarDto
.
setVehicleAttribute
(
"MINIVAN"
);
break
;
case
"X"
:
shCarDto
.
setVehicleAttribute
(
"OTHER"
);
break
;
case
"T"
:
shCarDto
.
setVehicleAttribute
(
"TAXI"
);
break
;
case
"J"
:
shCarDto
.
setVehicleAttribute
(
"TRAINING_CAR"
);
break
;
default
:
shCarDto
.
setVehicleAttribute
(
"OTHER"
);
}
}
if
(
"原车"
.
equals
(
shCarDto
.
getCylinderInstallationMethod
())){
shCarDto
.
setCylinderInstallationMethod
(
"ORIGINAL_CAR"
);
}
else
if
(
"加装"
.
equals
(
shCarDto
.
getCylinderInstallationMethod
())){
shCarDto
.
setCylinderInstallationMethod
(
"RELOADING"
);
}
// 根据carId获取设备列表
LambdaQueryWrapper
<
ShCarEqu
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
ShCarEqu:
:
getCarId
,
carId
);
List
<
ShCarEqu
>
list
=
this
.
list
(
queryWrapper
);
// 将设备列表转换为前端可识别bean
List
<
ShCarEquVo
>
collect
=
list
.
stream
().
map
(
shCarEqu
->
new
ShCarEquVo
(
shCarEqu
)).
collect
(
Collectors
.
toList
());
List
<
ShCarEquVo
>
collect
=
list
.
stream
().
map
(
shCarEqu
->
{
ShCarEquVo
shCarEquVo
=
new
ShCarEquVo
(
shCarEqu
);
shCarEquVo
.
setWhetherVehicleCylinder
(
"1"
);
shCarEquVo
.
setEquList
(
"2000"
);
shCarEquVo
.
setEquCategory
(
"2300"
);
shCarEquVo
.
setEquDefine
(
"23T0"
);
return
shCarEquVo
;
}).
collect
(
Collectors
.
toList
());
// 封装返回VO
return
new
CarAndEquVo
(
shCarDto
,
collect
);
HashMap
<
String
,
Object
>
hashMap
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
shCarDto
),
HashMap
.
class
);
hashMap
.
put
(
"equList"
,
collect
);
hashMap
.
put
(
"identificationCode"
,
shCarDto
.
getFrameNumber
());
result
.
put
(
"completeDataSanHuan"
,
hashMap
);
// 帮别人认领 + 单位变更给自己
if
(
"false"
.
equals
(
claimOneself
)){
HashMap
<
String
,
Object
>
gasCylinderChangeObj
=
new
HashMap
<>();
if
(
"个人主体"
.
equals
(
companyType
))
{
String
[]
companyName
=
reginParams
.
getCompany
().
getCompanyName
().
split
(
"_"
);
String
newUseUnitCreditCodeStr
=
companyName
.
length
>
1
?
companyName
[
1
]
:
companyName
[
0
];
gasCylinderChangeObj
.
put
(
"newUseUnitCreditCode"
,
newUseUnitCreditCodeStr
);
// 使用单位
gasCylinderChangeObj
.
put
(
"address"
,
commonService
.
getEnterpriseInfo
(
useUnitCode
).
get
(
"address"
));
gasCylinderChangeObj
.
put
(
"companyType"
,
"person"
);
}
else
{
gasCylinderChangeObj
.
put
(
"newUseUnitCreditCode"
,
reginParams
.
getCompany
().
getCompanyName
());
// 使用单位
gasCylinderChangeObj
.
put
(
"address"
,
commonService
.
getEnterpriseInfo
(
reginParams
.
getCompany
().
getCompanyCode
()).
get
(
"address"
));
gasCylinderChangeObj
.
put
(
"companyType"
,
"company"
);
}
gasCylinderChangeObj
.
put
(
"useRegistrationCode"
,
shCarDto
.
getUseRegistrationCode
());
gasCylinderChangeObj
.
put
(
"carNumber"
,
shCarDto
.
getCarNumber
());
result
.
put
(
"gasCylinderChange"
,
gasCylinderChangeObj
);
}
return
result
;
}
...
...
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/ShCarServiceImpl.java
View file @
38cc221c
This diff is collapsed.
Click to expand it.
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/SingleDataChangeProcessStrategy.java
View file @
38cc221c
...
...
@@ -107,6 +107,14 @@ public class SingleDataChangeProcessStrategy implements IChangeDataProcessStrate
jsonFields
.
add
(
field
.
getName
());
}
}
Field
[]
fields5
=
TechParamsPipelineChangeFieldDto
.
class
.
getDeclaredFields
();
for
(
Field
field
:
fields5
)
{
field
.
setAccessible
(
true
);
FieldDisplayDefine
fieldDisplayDefine
=
field
.
getAnnotation
(
FieldDisplayDefine
.
class
);
if
(
fieldDisplayDefine
!=
null
&&
fieldDisplayDefine
.
type
()
==
JSON
.
class
)
{
jsonFields
.
add
(
field
.
getName
());
}
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionApplicationMapper.xml
View file @
38cc221c
...
...
@@ -444,7 +444,7 @@
LEFT JOIN tz_jyjc_inspection_application_equip tjiae ON tjia.sequence_nbr = tjiae.application_seq
LEFT JOIN idx_biz_jg_register_info ri ON tjiae.equip_unicode = ri.RECORD
where
tjia.status != '661
7
' and
tjia.status != '661
0' and tjia.status != '6615
' and
((tbei.supervise_org_code != '50' and tbei.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or
(tbei.supervise_org_code = '50' and tbei.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
<if
test=
"dto.beginDate != null and dto.beginDate != ''"
>
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
View file @
38cc221c
...
...
@@ -548,7 +548,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
// 查询资质的人,
List
<
TzsUserPermissionDto
>
permissionDtos
=
userInfoMapper
.
queryPermissionByUserSeq
(
userInfo
.
getSequenceNbr
(),
this
.
buildPermissionKey
(
post
));
// 注意检验资质、检测资质,每人只有一行数据, 一个人一个证
if
(
permissionDtos
.
size
()
>
0
)
{
if
(
!
permissionDtos
.
isEmpty
()
)
{
TzsUserPermissionDto
userPermissionDto
=
permissionDtos
.
get
(
0
);
// 不会出现为null, 程序健壮处理
if
(
userPermissionDto
.
getPermissionItem
()
!=
null
&&
userPermissionDto
.
getPermissionLevel
()
!=
null
)
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/AlertUseUnitStatisticsMapper.java
View file @
38cc221c
...
...
@@ -18,4 +18,6 @@ public interface AlertUseUnitStatisticsMapper extends BaseMapper<AlertUseUnitSta
List
<
Map
<
String
,
String
>>
getStatisticsMessage
(
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
AlertUseUnitStatistics
getUseUnitMessage
(
@Param
(
"unitCode"
)
String
unitCode
,
@Param
(
"equipmentId"
)
String
equipmentId
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
List
<
Map
<
String
,
Object
>>
countByUseUnitCode
(
@Param
(
"useUnitCodeList"
)
List
<
String
>
useUnitCodeList
);
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/AlertUseUnitStatisticsMapper.xml
View file @
38cc221c
...
...
@@ -43,6 +43,48 @@
and father_alert is null
) as faultNum
</select>
<select
id=
"countByUseUnitCode"
resultType=
"java.util.Map"
>
SELECT
tbei.use_unit_code AS useUnitCode,
l.expiry_date AS expiryDate,
IFNULL ( u."userCount", '0' ) AS userCount,
IFNULL ( e."equipCount", '0' ) AS equipCount
FROM
tz_base_enterprise_info tbei
LEFT JOIN ( SELECT * FROM tz_base_unit_licence GROUP BY unit_code ORDER BY expiry_date DESC ) AS l ON l.unit_code = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS userCount
FROM
tz_base_enterprise_info tbei
INNER JOIN tzs_user_info ui ON tbei.use_unit_code = ui.unit_code
where tbei.use_unit_code IN
<foreach
collection=
"useUnitCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY
tbei.use_unit_code
) u ON u."useNnitCode" = tbei.use_unit_code
LEFT JOIN (
SELECT
tbei.use_unit_code AS useNnitCode,
COUNT ( 1 ) AS equipCount
FROM
tz_base_enterprise_info tbei
INNER JOIN idx_biz_jg_use_info jui ON tbei.use_unit_code = jui.USE_UNIT_CREDIT_CODE
LEFT JOIN idx_biz_jg_other_info joi ON joi.RECORD = jui.RECORD
AND joi.SUPERVISORY_CODE IS NOT NULL
AND joi.SUPERVISORY_CODE != ''
AND joi.SUPERVISORY_CODE != 'null'
where tbei.use_unit_code IN
<foreach
collection=
"useUnitCodeList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
GROUP BY
tbei.use_unit_code
) e ON e."useNnitCode" = tbei.use_unit_code
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/YJDPStatisticsController.java
View file @
38cc221c
...
...
@@ -321,7 +321,7 @@ public class YJDPStatisticsController {
@ApiOperation
(
value
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
,
notes
=
"月度困人故障高发使用单位-右上角更多-地市月度应急事件高发使用单位-表格"
)
@PostMapping
(
"/alertUseUnitTable/dp"
)
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
,
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>
>>
alertUseUnitTableForDP
(
@Validated
@RequestBody
DPFilterParamForDetailDto
detailDto
,
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
Integer
current
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
Integer
size
)
throws
Exception
{
detailDto
.
setCurrent
(
current
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/AQZSDPStatisticsServiceImpl.java
View file @
38cc221c
...
...
@@ -933,6 +933,7 @@ public class AQZSDPStatisticsServiceImpl {
result
.
put
(
DPMapStatisticsItemEnum
.
CONSTRUCTION_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MAINTENANCE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
result
.
put
(
DPMapStatisticsItemEnum
.
MANUFACTURING_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_MANUFACTURE
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
result
.
put
(
DPMapStatisticsItemEnum
.
GAS_UNITS
.
getCode
(),
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
COMPANY_TYPE_FILLING
)).
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
result
.
put
(
"companyCount"
,
countDtos
.
stream
().
mapToInt
(
CountDto:
:
getIntValue
).
sum
());
}
private
void
setDefaultCompanyCountData
(
Map
<
String
,
Object
>
m
)
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/EnterpriseBizByTCMServiceImpl.java
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -134,7 +135,24 @@ public class EnterpriseBizByTCMServiceImpl {
resultMap
.
remove
(
"regUnitInfoDto"
);
resultMap
.
remove
(
"tzsBaseInstitution"
);
resultMap
.
put
(
"unitAddress"
,
resultMap
.
get
(
"province"
)
+
"/"
+
resultMap
.
get
(
"city"
)
+
"/"
+
resultMap
.
get
(
"district"
));
String
unitAddress
=
""
;
if
(
StrUtil
.
isNotBlank
(
resultMap
.
get
(
"province"
)+
""
)
&&
!
"null"
.
equals
(
resultMap
.
get
(
"province"
)+
""
)){
unitAddress
+=
resultMap
.
get
(
"province"
);
}
if
(
StrUtil
.
isNotBlank
(
resultMap
.
get
(
"city"
)+
""
)
&&
!
"null"
.
equals
(
resultMap
.
get
(
"city"
)+
""
)){
unitAddress
+=
"/"
+
resultMap
.
get
(
"city"
);
}
if
(
StrUtil
.
isNotBlank
(
resultMap
.
get
(
"district"
)+
""
)
&&
!
"null"
.
equals
(
resultMap
.
get
(
"district"
)+
""
)){
unitAddress
+=
"/"
+
resultMap
.
get
(
"district"
);
}
// 确保不以斜杠开始
if
(
unitAddress
.
startsWith
(
"/"
))
{
unitAddress
=
unitAddress
.
substring
(
1
);
}
if
(
StrUtil
.
isNotBlank
(
unitAddress
))
{
resultMap
.
put
(
"unitAddress"
,
unitAddress
);
}
Map
<
String
,
Object
>
longitudeLatitudeMap
=
new
HashMap
<>();
longitudeLatitudeMap
.
put
(
"address"
,
resultMap
.
get
(
"address"
));
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
View file @
38cc221c
...
...
@@ -1108,7 +1108,11 @@ public class JGDPStatisticsServiceImpl {
regionModels
.
forEach
(
r
->
{
xData
.
add
(
r
.
getRegionName
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
().
toString
());
yData
.
add
(
this
.
avgAndSumDealDate
(
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
if
(!
ValidationUtil
.
isEmpty
(
orgCode
))
{
yData
.
add
(
this
.
avgAndSumDealDate
(
countDtos
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
}
else
{
yData
.
add
(
"0"
);
}
});
resultMap
.
put
(
"xdata"
,
xData
);
resultMap
.
put
(
"ydata"
,
yData
);
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/YJDPStatisticsServiceImpl.java
View file @
38cc221c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistcs
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -40,7 +41,9 @@ import org.elasticsearch.search.aggregations.AggregationBuilders;
import
org.elasticsearch.search.aggregations.bucket.terms.Terms
;
import
org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder
;
import
org.elasticsearch.search.builder.SearchSourceBuilder
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.DateTimeUtil
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
...
...
@@ -714,14 +717,14 @@ public class YJDPStatisticsServiceImpl {
return
ResponseHelper
.
buildResponse
(
res
);
}
public
ResponseModel
<
IPage
<
AlertUseUnitStatistics
>>
alertUseUnitTableForDP
(
DPFilterParamForDetailDto
detailDto
)
throws
Exception
{
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>
>>
alertUseUnitTableForDP
(
DPFilterParamForDetailDto
detailDto
)
throws
Exception
{
Page
<
AlertUseUnitStatistics
>
page
=
new
Page
<>();
page
.
setCurrent
(
detailDto
.
getCurrent
());
page
.
setSize
(
detailDto
.
getSize
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
ValidationUtil
.
isEmpty
(
detailDto
.
getCityCode
())
?
"610000"
:
detailDto
.
getCityCode
());
if
(
orgCode
==
null
)
{
return
ResponseHelper
.
buildResponse
(
page
);
return
ResponseHelper
.
buildResponse
(
new
Page
<>()
);
}
LambdaQueryWrapper
<
AlertUseUnitStatistics
>
lambda
=
new
QueryWrapper
<
AlertUseUnitStatistics
>().
lambda
();
...
...
@@ -766,7 +769,30 @@ public class YJDPStatisticsServiceImpl {
lambda
.
le
(
AlertUseUnitStatistics:
:
getEquipmentClassificationCode
,
detailDto
.
getEquListCode
());
}
IPage
<
AlertUseUnitStatistics
>
alertUseUnitStatistics
=
alertUseUnitStatisticsMapper
.
selectPage
(
page
,
lambda
);
return
ResponseHelper
.
buildResponse
(
alertUseUnitStatistics
);
List
<
AlertUseUnitStatistics
>
records
=
alertUseUnitStatistics
.
getRecords
();
List
<
String
>
useUnitCodeList
=
records
.
stream
().
map
(
AlertUseUnitStatistics:
:
getUseUnitCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
Map
<
String
,
Object
>>
useUnitMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
useUnitCodeList
)){
List
<
Map
<
String
,
Object
>>
list
=
alertUseUnitStatisticsMapper
.
countByUseUnitCode
(
useUnitCodeList
);
if
(!
CollectionUtils
.
isEmpty
(
list
)){
list
.
forEach
(
map
->
{
useUnitMap
.
put
(
map
.
get
(
"useUnitCode"
).
toString
(),
map
);
});
}
}
records
.
forEach
(
t
->{
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
t
);
map
.
putAll
(
useUnitMap
.
get
(
t
.
getUseUnitCode
()));
resultList
.
add
(
map
);
});
Page
<
Map
<
String
,
Object
>>
resultPage
=
new
Page
<>();
resultPage
.
setCurrent
(
page
.
getCurrent
());
resultPage
.
setSize
(
page
.
getSize
());
resultPage
.
setTotal
(
alertUseUnitStatistics
.
getTotal
());
resultPage
.
setRecords
(
resultList
);
return
ResponseHelper
.
buildResponse
(
resultPage
);
}
public
List
<
JSONObject
>
getKeyPositionMonitor
(
DPFilterParamForDetailDto
filterParamDto
)
{
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/ZBGLImpl/YwblpjsxtjServiceImpl.java
View file @
38cc221c
...
...
@@ -101,7 +101,32 @@ public class YwblpjsxtjServiceImpl implements IZBGLService {
@Override
public
Page
<
Map
<
String
,
Object
>>
getPage
(
Page
page
,
DPFilterParamForDetailDto
dpFilterParamForDetailDto
)
{
List
<
RegionModel
>
regionModels
=
stCommonService
.
setRegionIfRootParent
(
dpFilterParamForDetailDto
.
getCityCode
());
String
orgCodeP
=
stCommonService
.
getAndSetOrgCode
(
dpFilterParamForDetailDto
.
getCityCode
());
DPFilterParamDto
dpFilterParamDto
=
new
DPFilterParamDto
();
//安装告知、维修告知、改造告知、移装告知
List
<
CountDto
>
noticCount
=
jgStatisticsMapper
.
queryNoticeAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//使用登记、车用气瓶使用登记
List
<
CountDto
>
useCount
=
jgStatisticsMapper
.
queryUseAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//更名变更登记、改造变更登记、移装变更登记、单位变更登记、气瓶单位变更登记
List
<
CountDto
>
changeCount
=
jgStatisticsMapper
.
queryChangeAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//启用停用
List
<
CountDto
>
disableCount
=
jgStatisticsMapper
.
queryDisableAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
//注销报废
List
<
CountDto
>
cancelCount
=
jgStatisticsMapper
.
queryCancelAvgDayByReceiveCompany
(
dpFilterParamDto
,
orgCodeP
);
List
list
=
new
ArrayList
();
regionModels
.
forEach
(
r
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"regionName"
,
r
.
getRegionName
());
String
orgCode
=
stCommonService
.
getAndSetOrgCode
(
r
.
getRegionCode
().
toString
());
map
.
put
(
"notic"
,
this
.
avgAndSumDealDate
(
noticCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
map
.
put
(
"use"
,
this
.
avgAndSumDealDate
(
useCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
map
.
put
(
"change"
,
this
.
avgAndSumDealDate
(
changeCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
map
.
put
(
"disable"
,
this
.
avgAndSumDealDate
(
disableCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
map
.
put
(
"cancel"
,
this
.
avgAndSumDealDate
(
cancelCount
.
stream
().
filter
(
c
->
c
.
getKeyStr
().
contains
(
orgCode
)).
collect
(
Collectors
.
toList
())));
list
.
add
(
map
);
});
page
.
setRecords
(
list
);
page
.
setTotal
(
list
.
size
());
return
page
;
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java
View file @
38cc221c
...
...
@@ -127,15 +127,16 @@ public class TzBaseEnterpriseInfoServiceImpl
* 公司类型下的资质类型map:key为登录人的公司类型、value为包含的资质枚举
*/
private
static
final
Map
<
String
,
String
>
COMPANY_TYPE_CERT_TYPE_MAP
=
new
HashMap
<>();
// 数据来源cb_data_dictionary type='UNIT_TYPE_NEW'
/*
数据来源cb_data_dictionary type='UNIT_TYPE_NEW',目前登录身份分为3个如下
*/
static
{
// 使用单位资质
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"使用单位"
,
"1232"
);
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"充装单位"
,
"1231"
);
// 注意检验检测机构资质细分为1233-1、1233-2
// 检验检测机构资质:细分为1233-1、1233-2
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"检验检测机构"
,
"1233"
);
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"制造单位"
,
"1236"
);
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"设计单位"
,
"1235"
);
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"安装改造维修单位"
,
"1234"
);
// 安装改造维修单位身份资质:充装单位-1231 制造单位-1236 设计单位-1235 安装改造维修单位-1234
COMPANY_TYPE_CERT_TYPE_MAP
.
put
(
"安装改造维修单位"
,
"1231,1234,1235,1236"
);
}
/**
...
...
@@ -211,15 +212,9 @@ public class TzBaseEnterpriseInfoServiceImpl
if
(
"监管机构"
.
equals
(
companyType
))
{
unitLicencesCollect
=
unitLicences
;
}
else
{
Predicate
<
BaseUnitLicence
>
certTypePredicate
;
if
(
INSPECTION_AND_TESTING_INSTITUTIONS
.
equals
(
companyType
))
{
certTypePredicate
=
baseUnitLicence
->
INSPECTION_AGENCY
.
equals
(
baseUnitLicence
.
getCertType
())
||
TESTING_INSTITUTIONS
.
equals
(
baseUnitLicence
.
getCertType
());
}
else
{
certTypePredicate
=
baseUnitLicence
->
companyType
.
contains
(
baseUnitLicence
.
getCertType
());
}
// 解决脏数据问题,脏数据不再显示
unitLicencesCollect
=
unitLicences
.
stream
()
.
filter
(
certTypePredicate
)
.
filter
(
baseUnitLicence
->
baseUnitLicence
.
getCertTypeCode
()
!=
null
&&
COMPANY_TYPE_CERT_TYPE_MAP
.
get
(
companyType
).
contains
((
baseUnitLicence
.
getCertTypeCode
()))
)
.
collect
(
Collectors
.
toList
());
}
if
(!
ValidationUtil
.
isEmpty
(
unitLicencesCollect
))
{
...
...
@@ -733,9 +728,15 @@ public class TzBaseEnterpriseInfoServiceImpl
private
void
removeLicenceDataBeforeSave
(
ReginParams
reginParams
,
TzBaseEnterpriseInfo
tzBaseEnterpriseInfo
)
{
String
companyType
=
reginParams
.
getCompany
().
getCompanyType
();
baseUnitLicenceService
.
remove
(
new
LambdaQueryWrapper
<
BaseUnitLicence
>()
.
likeRight
(
BaseUnitLicence:
:
getCertTypeCode
,
COMPANY_TYPE_CERT_TYPE_MAP
.
get
(
companyType
))
.
eq
(
BaseUnitLicence:
:
getUnitCode
,
tzBaseEnterpriseInfo
.
getUseCode
()));
LambdaQueryWrapper
<
BaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseUnitLicence:
:
getUnitCode
,
tzBaseEnterpriseInfo
.
getUseCode
());
wrapper
.
and
(
w
->
{
String
[]
certTypeCodeArray
=
COMPANY_TYPE_CERT_TYPE_MAP
.
get
(
companyType
).
split
(
","
);
for
(
String
certTypeCode:
certTypeCodeArray
){
w
.
or
().
likeRight
(
BaseUnitLicence:
:
getCertTypeCode
,
certTypeCode
);
}
});
baseUnitLicenceService
.
remove
(
wrapper
);
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-biz/src/main/java/com/yeejoin/amos/boot/module/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
View file @
38cc221c
...
...
@@ -33,6 +33,7 @@ import com.yeejoin.amos.component.feign.utils.FeignUtil;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.lucene.queryparser.classic.QueryParser
;
import
org.elasticsearch.action.search.SearchRequest
;
import
org.elasticsearch.action.search.SearchResponse
;
...
...
@@ -431,11 +432,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
*/
@Override
public
Map
<
String
,
String
>
createSupervisorCode
(
Map
<
String
,
Object
>
map
)
{
String
city
,
county
,
equipCategory
,
isNotXiXian
,
code96333
;
String
city
,
county
,
equipCategory
,
isNotXiXian
,
code96333
,
superviseCode
;
// 获取对应行政区划
city
=
String
.
valueOf
(
map
.
get
(
"cityCode"
));
county
=
String
.
valueOf
(
map
.
get
(
"countyCode"
));
code96333
=
String
.
valueOf
(
map
.
get
(
"code96333"
));
superviseCode
=
String
.
valueOf
(
map
.
get
(
"superviseCode"
));
// 获取对应设备分类
equipCategory
=
String
.
valueOf
(
map
.
get
(
"equCategory"
));
if
(
"null"
.
equals
(
equipCategory
)
||
"null"
.
equals
(
city
)
||
"null"
.
equals
(
county
))
{
...
...
@@ -443,8 +445,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
isNotXiXian
=
Optional
.
ofNullable
(
map
.
get
(
"isXiXian"
)).
orElse
(
"0"
).
toString
();
// 生成码
EquipmentCategoryServiceImpl
categoryService
=
(
EquipmentCategoryServiceImpl
)
AopContext
.
currentProxy
();
Map
<
String
,
String
>
codeMap
=
creatCode
(
isNotXiXian
,
city
,
county
,
equipCategory
,
code96333
,
"null"
);
Map
<
String
,
String
>
codeMap
=
creatCode
(
isNotXiXian
,
city
,
county
,
equipCategory
,
code96333
,
superviseCode
);
if
(
ObjectUtils
.
isEmpty
(
codeMap
))
{
throw
new
BadRequest
(
"该请求参数未生成监管码或96333码,请核对参数"
);
}
...
...
@@ -704,10 +705,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
}
// 判断原数据是否存在监管码,存在则用原监管码即可,不存在则生成
if
(
"null"
.
equals
(
supervisionCode
))
{
if
(
"null"
.
equals
(
supervisionCode
)
||
StringUtils
.
isEmpty
(
supervisionCode
)
)
{
String
supervisor
=
createSupervisorCode
(
isNotXiXian
,
city
,
county
,
equipCategory
);
supervisorCode
.
append
(
supervisor
);
}
else
{
log
.
info
(
"使用上送的监管码{},不再生成监管码"
,
supervisionCode
);
supervisorCode
=
new
StringBuilder
(
supervisionCode
);
}
...
...
@@ -1420,7 +1422,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
dto
.
setUSE_UNIT_CREDIT_CODE
(
companyCode
);
}
else
{
// 监管单位
dto
.
setORG_BRANCH_CODE
(
orgCode
);
dto
.
setORG_BRANCH_CODE
(
ObjectUtils
.
isEmpty
(
dto
.
getORG_BRANCH_CODE
())
?
orgCode
:
dto
.
getORG_BRANCH_CODE
()
);
}
List
<
EquipExportVo
>
equipExportData
=
equipmentCategoryMapper
.
getEquipExportData
(
dto
);
if
(!
ObjectUtils
.
isEmpty
(
equipExportData
))
{
...
...
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