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
45030d1e
Commit
45030d1e
authored
Mar 08, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_tzs_register' of…
Merge branch 'develop_tzs_register' of
http://36.40.66.175:5000/moa/amos-boot-biz
into develop_tzs_register
parents
d3b26550
1df46753
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
135 additions
and
225 deletions
+135
-225
JgChangeRegistrationReformMapper.xml
...ain/resources/mapper/JgChangeRegistrationReformMapper.xml
+2
-1
JgChangeRegistrationUnitMapper.xml
.../main/resources/mapper/JgChangeRegistrationUnitMapper.xml
+2
-1
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+8
-7
JgMaintainNoticeMapper.xml
...-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
+9
-6
JgReformNoticeMapper.xml
...jg-api/src/main/resources/mapper/JgReformNoticeMapper.xml
+8
-6
JgTransferNoticeMapper.xml
...-api/src/main/resources/mapper/JgTransferNoticeMapper.xml
+8
-7
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+2
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+26
-6
JgChangeRegistrationReformServiceImpl.java
...z/service/impl/JgChangeRegistrationReformServiceImpl.java
+1
-1
JgChangeRegistrationTransferServiceImpl.java
...service/impl/JgChangeRegistrationTransferServiceImpl.java
+1
-1
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+1
-1
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+29
-19
JgMaintainNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgMaintainNoticeServiceImpl.java
+10
-50
JgReformNoticeServiceImpl.java
...module/jg/biz/service/impl/JgReformNoticeServiceImpl.java
+15
-60
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+12
-57
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+1
-1
installation-notification-report.ftl
.../resources/templates/installation-notification-report.ftl
+0
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationReformMapper.xml
View file @
45030d1e
...
...
@@ -28,7 +28,8 @@
ur.promoter,
ur.supervisory_code as supervisoryCode,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId
from tzs_jg_change_registration_reform ur
LEFT JOIN tzs_jg_change_registration_reform_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationUnitMapper.xml
View file @
45030d1e
...
...
@@ -24,7 +24,8 @@
isn.audit_pass_date AS auditPassDate,
isn.equ_type AS equType,
isn.next_execute_user_ids as nextExecuteUserIds,
isn.next_task_id as nextTaskId
isn.next_task_id as nextTaskId,
isn.create_user_id as createUserId
FROM
tzs_jg_change_registration_unit isn
<where>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
45030d1e
...
...
@@ -122,14 +122,14 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei
.use_contact AS safetyManager,
ei
.contact_phone AS safetyManagerPhone,
ei
.use_code AS useCode,
i
sn.install_unit_credit
_code AS installUnitCreditCode,
useUnit
.use_contact AS safetyManager,
useUnit
.contact_phone AS safetyManagerPhone,
useUnit
.use_code AS useCode,
i
nstallUnit.use
_code AS installUnitCreditCode,
idi.INSPECT_REPORT as inspectReport,
ei
.address as useUnitLeaderAddress,
useUnit
.address as useUnitLeaderAddress,
re.equ_id as equId,
(select address from tz_base_enterprise_info where isn.install_unit_credit_code = use_unit_code)
installUnitAddress
installUnit.address
installUnitAddress
FROM
tzs_jg_installation_notice isn
LEFT JOIN tzs_jg_installation_notice_eq re ON re.equip_transfer_id = isn.sequence_nbr
...
...
@@ -138,7 +138,8 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info ei ON ei.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info useUnit ON useUnit.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info installUnit ON installUnit.use_code = isn.install_unit_credit_code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec ON ri."EQU_CATEGORY"::text = tec.code::text
LEFT JOIN amos_tzs_biz.tz_equipment_category tec1 ON ri."EQU_LIST"::text = tec1.code::text
LEFT JOIN amos_tzs_biz.tz_equipment_category tec2 ON ri."EQU_DEFINE"::text = tec2.code::text
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
View file @
45030d1e
...
...
@@ -111,12 +111,15 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei
.legal_person AS safetyManager,
ei
.legal_phone AS safetyManagerPhone,
useUnit
.legal_person AS safetyManager,
useUnit
.legal_phone AS safetyManagerPhone,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ei.ADDRESS AS useUnitAddress,
eio.use_code AS useCode
useUnit.ADDRESS AS useUnitAddress,
useUnit.ADDRESS AS useUnitLeaderAddress,
installUnit.use_code AS useCode,
installUnit.use_code AS installUnitCreditCode,
installUnit.address AS installUnitAddress
FROM tzs_jg_maintain_notice isn
LEFT JOIN tzs_jg_maintain_notice_eq re ON re.equip_transfer_id = isn.sequence_nbr
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id
...
...
@@ -124,8 +127,8 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info
ei ON ei
.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
eio ON eio
.use_code = isn.install_unit_credit_code
LEFT JOIN tz_base_enterprise_info
useUnit ON useUnit
.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
installUnit ON installUnit
.use_code = isn.install_unit_credit_code
WHERE isn.sequence_nbr = #{sequenceNbr} LIMIT 1
</select>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgReformNoticeMapper.xml
View file @
45030d1e
...
...
@@ -125,10 +125,12 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei.legal_person AS safetyManager,
ei.legal_phone AS safetyManagerPhone,
ei.ADDRESS AS useUnitAddress,
ei2.use_code AS useCode,
useUnit.legal_person AS safetyManager,
useUnit.legal_phone AS safetyManagerPhone,
useUnit.ADDRESS AS useUnitLeaderAddress,
installUnit.use_code AS useCode,
installUnit.use_code AS installUnitCreditCode,
installUnit.address AS installUnitAddress,
tec2.name AS equCategory,
tec1.name AS equList,
tec.name AS equDefine,
...
...
@@ -140,8 +142,8 @@
LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info
ei ON ei
.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
ei2 ON ei2
.use_code = isn.install_unit_credit_code
LEFT JOIN tz_base_enterprise_info
useUnit ON useUnit
.use_code = isn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
installUnit ON installUnit
.use_code = isn.install_unit_credit_code
LEFT JOIN tz_equipment_category tec ON ri."EQU_CATEGORY"::text = tec.code::text
LEFT JOIN tz_equipment_category tec1 ON ri."EQU_LIST"::text = tec1.code::text
LEFT JOIN tz_equipment_category tec2 ON ri."EQU_DEFINE"::text = tec2.code::text
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgTransferNoticeMapper.xml
View file @
45030d1e
...
...
@@ -105,7 +105,6 @@
tjtn.county,
tjtn.address AS address,
tjtn.use_unit_name AS useUnitName,
tjtn.install_unit_credit_code AS installUnitCreditCode,
tjtn.install_unit_name AS installUnitName,
tjtn.equip_num AS equipName,
tjtn.rec_date AS recDate,
...
...
@@ -155,16 +154,18 @@
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei
.use_contact AS safetyManager,
ei
.contact_phone AS safetyManagerPhone,
useUnit
.use_contact AS safetyManager,
useUnit
.contact_phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress,
eio.use_code AS useCode,
installUnit.use_code AS useCode,
installUnit.use_code AS installUnitCreditCode,
idi.INSPECT_REPORT as inspectReport,
re.equ_id as equId,
ei.address as useUnitLeaderAddress
useUnit.address as useUnitLeaderAddress,
installUnit.address installUnitAddress
FROM
tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr
...
...
@@ -174,8 +175,8 @@
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
left join idx_biz_jg_other_info oi on oi.RECORD = re.equ_id
LEFT JOIN tz_base_enterprise_info
ei ON ei
.use_code = tjtn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
eio ON eio
.use_code = tjtn.install_unit_credit_code
LEFT JOIN tz_base_enterprise_info
useUnit ON useUnit
.use_code = tjtn.use_unit_credit_code
LEFT JOIN tz_base_enterprise_info
installUnit ON installUnit
.use_code = tjtn.install_unit_credit_code
LEFT JOIN amos_tzs_biz.tz_equipment_category tec ON ri."EQU_CATEGORY"::text = tec.code::text
LEFT JOIN amos_tzs_biz.tz_equipment_category tec1 ON ri."EQU_LIST"::text = tec1.code::text
LEFT JOIN amos_tzs_biz.tz_equipment_category tec2 ON ri."EQU_DEFINE"::text = tec2.code::text
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
45030d1e
...
...
@@ -31,7 +31,8 @@
date_format(ur.audit_pass_date,'%Y-%m-%d') as auditPassDate,
ur.receive_org_name as receiveOrgName,
ur.next_execute_user_ids as nextExecuteUserIds,
ur.next_task_id as nextTaskId
ur.next_task_id as nextTaskId,
ur.create_user_id as createUserId
from tzs_jg_use_registration ur
LEFT JOIN tzs_jg_use_registration_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
...
...
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 @
45030d1e
...
...
@@ -1394,14 +1394,32 @@ public class CommonServiceImpl implements ICommonService {
/**
* 生成使用登记编号
*
* @param
supervisoryCode 监管码
* @param
equipId 设备id
* @param supervisoryCompanyCode 接收机构单位代码
* @return 使用登记编号
*/
public
String
generateRegistrationCode
(
String
supervisoryCode
,
String
supervisoryCompanyCode
)
{
if
(!
ObjectUtils
.
isEmpty
(
supervisoryCode
)
&&
supervisoryCode
.
length
()
>
5
)
{
String
name
=
EquipTypeEnum
.
getMessage
(
supervisoryCode
.
substring
(
1
,
2
));
String
type
=
supervisoryCode
.
substring
(
2
,
4
);
public
String
generateRegistrationCode
(
String
equipId
,
String
supervisoryCode
,
String
supervisoryCompanyCode
)
{
// 根据设备id查询设备类别、品种
LambdaQueryWrapper
<
RegistrationInfo
>
equipWrapper
=
new
LambdaQueryWrapper
<>();
equipWrapper
.
eq
(
RegistrationInfo:
:
getRecord
,
equipId
);
RegistrationInfo
equipRegistrationInfo
=
tzsJgRegistrationInfoMapper
.
selectOne
(
equipWrapper
);
if
(!
ValidationUtil
.
isEmpty
(
equipRegistrationInfo
))
{
String
equCategory
=
equipRegistrationInfo
.
getEquCategory
();
// 设备类别 "3100"
String
equDefine
=
equipRegistrationInfo
.
getEquDefine
();
// 设备品种 "3110"
if
(!
ObjectUtils
.
isEmpty
(
equCategory
))
{
// 设备种类简称
String
equCategoryAbbrName
=
EquipTypeEnum
.
getMessage
(
equCategory
.
substring
(
0
,
1
));
// 设备代码中间两位
String
equipType2MidDigits
;
if
(
ValidationUtil
.
isEmpty
(
equDefine
))
{
// 没有设备品种的设备取设备类别代码中间两位
equipType2MidDigits
=
equCategory
.
substring
(
1
,
3
);
}
else
{
// 设备品种代码中间两位
equipType2MidDigits
=
equDefine
.
substring
(
1
,
3
);
}
// 登记机关代号
String
city
=
supervisoryCode
.
substring
(
0
,
1
);
// 西咸新区监管码对应的设备使用登记证还按咸阳(D)生成
if
(
"X"
.
equals
(
city
))
{
...
...
@@ -1413,9 +1431,10 @@ public class CommonServiceImpl implements ICommonService {
city
=
specialRegionCode
.
getName
();
}
}
ResponseModel
<
String
>
stringResponseModel
=
tzsServiceFeignClient
.
useRegistrationCode
(
name
+
type
+
"陕"
+
city
);
ResponseModel
<
String
>
stringResponseModel
=
tzsServiceFeignClient
.
useRegistrationCode
(
equCategoryAbbrName
+
equipType2MidDigits
+
"陕"
+
city
);
return
stringResponseModel
.
getResult
();
}
}
return
null
;
}
}
\ 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/JgChangeRegistrationReformServiceImpl.java
View file @
45030d1e
...
...
@@ -343,7 +343,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
jgChangeRegistrationReform
.
setStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
jgChangeRegistrationReformEqMapper
.
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
"equip_transfer_id"
,
jgChangeRegistrationReform
.
getSequenceNbr
()));
// String newUseRegistrationCertificateNumber = getCode(jgChangeRegistrationReform.getSupervisoryCode());
String
newUseRegistrationCertificateNumber
=
commonServiceImpl
.
generateRegistrationCode
(
jgChangeRegistrationReform
.
getSupervisoryCode
(),
jgChangeRegistrationReform
.
getReceiveCompanyCode
());
String
newUseRegistrationCertificateNumber
=
commonServiceImpl
.
generateRegistrationCode
(
jgChangeRegistrationReform
Eq
.
getEquId
(),
jgChangeRegistrationReform
.
getSupervisoryCode
(),
jgChangeRegistrationReform
.
getReceiveCompanyCode
());
jgChangeRegistrationReform
.
setUseRegistrationCode
(
newUseRegistrationCertificateNumber
);
updateTechparamsByEquIdAndCurrentDoucumentId
(
jgChangeRegistrationReformEq
.
getEquId
(),
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
(),
newUseRegistrationCertificateNumber
,
jgChangeRegistrationReform
.
getApplyNo
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
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 @
45030d1e
...
...
@@ -754,7 +754,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
updateData
.
setRegPersonName
(
reginParams
.
getUserModel
().
getUserName
());
//使用登记证编号
// String useRegistrationCode = this.getCode(supervisoryCode);
String
useRegistrationCode
=
commonServiceImpl
.
generateRegistrationCode
(
supervisoryCode
,
updateData
.
getReceiveCompanyCode
());
String
useRegistrationCode
=
commonServiceImpl
.
generateRegistrationCode
(
transferEq
.
getEquId
(),
supervisoryCode
,
updateData
.
getReceiveCompanyCode
());
if
(!
ValidationUtil
.
isEmpty
(
useRegistrationCode
))
{
updateData
.
setUseRegistrationCode
(
useRegistrationCode
);
}
...
...
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/JgChangeRegistrationUnitServiceImpl.java
View file @
45030d1e
...
...
@@ -807,7 +807,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
// String code = getCode(tzsJgOtherInfo.getSupervisoryCode());
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
tzsJgOtherInfo
.
getSupervisoryCode
(),
dto
.
getReceiveCompanyCode
());
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
jgChangeRegistrationUnitEq
.
getEquId
(),
tzsJgOtherInfo
.
getSupervisoryCode
(),
dto
.
getReceiveCompanyCode
());
if
(
ValidationUtil
.
isEmpty
(
code
))
{
log
.
error
(
"生成新的使用登记证编号失败"
);
return
;
...
...
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 @
45030d1e
...
...
@@ -424,11 +424,25 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
if
(
Objects
.
isNull
(
jgInstallationNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"安装告知单不存在"
);
}
Map
<
String
,
Object
>
installation
=
informationList
.
get
(
0
);
Map
<
String
,
Object
>
placeholders
=
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_INSTALLATION_NOTIFICATION
.
getName
()
);
String
useCode
=
String
.
valueOf
(
installation
.
get
(
"installUnitCreditCode"
));
String
tempFileName
=
"安装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
// String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
//
// // 更新到数据库
// jgInstallationNotice.setNoticeReportUrl(url);
// this.updateById(jgInstallationNotice);
WordTemplateUtils
.
templateToPdfDownload
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
,
response
);
}
public
Map
<
String
,
Object
>
fullFillTemplateObj
(
List
<
Map
<
String
,
Object
>>
informationList
,
String
businessType
)
{
Map
<
String
,
Object
>
informObj
=
informationList
.
get
(
0
);
String
useCode
=
String
.
valueOf
(
informObj
.
get
(
"installUnitCreditCode"
));
LambdaQueryWrapper
<
TzBaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
TzBaseUnitLicence:
:
getUnitCode
,
useCode
);
wrapper
.
last
(
" LIMIT 3"
);
List
<
TzBaseUnitLicence
>
list
=
baseUnitLicenceMapper
.
selectList
(
wrapper
);
ArrayList
<
String
>
installLicenseNoList
=
new
ArrayList
<>();
...
...
@@ -443,7 +457,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
});
}
Function
<
String
,
String
>
getValue
=
key
->
in
stallation
.
getOrDefault
(
key
,
""
).
toString
();
Function
<
String
,
String
>
getValue
=
key
->
in
formObj
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
...
...
@@ -453,14 +467,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
//
TODO:
出厂编号
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
//出厂编号
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"installUnitAddress"
));
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"installUnitAddress"
));
// 施工单位地址
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"安装告知"
);
// TODO: 施工类别
placeholders
.
put
(
"installLicenseNo"
,
getValue
.
apply
(
"installLicenseNo"
));
placeholders
.
put
(
"installLicenseExpirationDate"
,
getValue
.
apply
(
"installLicenseExpirationDate"
));
placeholders
.
put
(
"installType"
,
businessType
);
// 施工类别
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
...
...
@@ -469,22 +481,14 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"useUnitLeaderAddress"
));
// 安装单位许可信息
placeholders
.
put
(
"installLicenseNoList"
,
installLicenseNoList
);
placeholders
.
put
(
"installLicenseExpirationDateList"
,
installLicenseExpirationDateList
);
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
placeholders
.
get
(
"informNumber"
)+
""
,
300
,
300
);
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"informNumber"
)
,
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
// String url = WordTemplateUtils.templateToPdf("installation-notification-report.ftl", placeholders);
// 更新到数据库
// jgInstallationNotice.setNoticeReportUrl(url);
// this.updateById(jgInstallationNotice);
//
// return url;
String
tempFileName
=
"安装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
WordTemplateUtils
.
templateToPdfDownload
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
,
response
);
return
placeholders
;
}
@Override
...
...
@@ -776,6 +780,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@Transactional
public
void
cancel
(
JgInstallationNoticeDto
noticeDto
)
{
JgInstallationNotice
jgInstallationNotice
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
String
expectedStatus
=
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
// 检查实际状态是否不等于期望状态
if
(!
expectedStatus
.
equals
(
jgInstallationNotice
.
getNoticeStatus
()))
{
throw
new
BadRequest
(
"当前业务状态不是待处理状态,请刷新页面后重试操作!"
);
}
ProcessTaskDTO
processTaskDTO
=
iCmWorkflowService
.
rollBack
(
jgInstallationNotice
.
getInstanceId
());
// 提取节点等信息
WorkflowResultDto
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
...
...
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/JgMaintainNoticeServiceImpl.java
View file @
45030d1e
...
...
@@ -26,10 +26,8 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
...
...
@@ -51,7 +49,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -109,6 +106,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Autowired
IIdxBizJgRegisterInfoService
idxBizJgRegisterInfoService
;
@Autowired
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
/**
* 根据sequenceNbr查询
...
...
@@ -353,53 +352,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
if
(
Objects
.
isNull
(
JgMaintainNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"维修告知单不存在"
);
}
Map
<
String
,
Object
>
installation
=
informationList
.
get
(
0
);
String
useCode
=
String
.
valueOf
(
installation
.
get
(
"useCode"
));
LambdaQueryWrapper
<
TzBaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
// 因模板许可证编号配置最多支持三个,再多样式混乱,目前返回三个
wrapper
.
eq
(
TzBaseUnitLicence:
:
getUnitCode
,
useCode
).
last
(
"limit 3"
);
List
<
TzBaseUnitLicence
>
list
=
baseUnitLicenceMapper
.
selectList
(
wrapper
);
ArrayList
<
String
>
installLicenseNoList
=
new
ArrayList
<>();
ArrayList
<
String
>
installLicenseExpirationDateList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
list
.
forEach
(
tzBaseUnitLicence
->
{
installLicenseNoList
.
add
(
tzBaseUnitLicence
.
getCertNo
());
installLicenseExpirationDateList
.
add
(
DateUtils
.
convertDateToString
(
tzBaseUnitLicence
.
getExpiryDate
(),
DateUtils
.
DATE_PATTERN
));
});
}
Function
<
String
,
String
>
getValue
=
key
->
installation
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
placeholders
.
put
(
"sequenceNbr"
,
getValue
.
apply
(
"sequenceNbr"
));
placeholders
.
put
(
"installUnitName"
,
getValue
.
apply
(
"installUnitName"
));
placeholders
.
put
(
"informNumber"
,
Objects
.
toString
(
getValue
.
apply
(
"informNumber"
),
getValue
.
apply
(
"applyNo"
)));
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"produceCode"
));
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"维修告知"
);
placeholders
.
put
(
"installLicenseNo"
,
""
);
placeholders
.
put
(
"installLicenseExpirationDate"
,
""
);
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
// 施工负责人
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
// 施工负责人手机
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
// TODO: 施工单位地址
placeholders
.
put
(
"useUnitName"
,
getValue
.
apply
(
"useUnitName"
));
placeholders
.
put
(
"useUnitLeaderName"
,
getValue
.
apply
(
"safetyManager"
));
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"useUnitProvinceName"
)
+
getValue
.
apply
(
"useUnitCityName"
)
+
getValue
.
apply
(
"useUnitCountyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"useUnitAddress"
));
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"informNumber"
),
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
placeholders
.
put
(
"installLicenseNoList"
,
installLicenseNoList
);
//许可证编号
placeholders
.
put
(
"installLicenseExpirationDateList"
,
installLicenseExpirationDateList
);
//许可证有效期
String
tempFileName
=
"安装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
Map
<
String
,
Object
>
placeholders
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_MAINTENANCE_NOTIFICATION
.
getName
());
String
tempFileName
=
"维修告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
String
url
=
WordTemplateUtils
.
templateToPdf
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
);
// 更新到数据库
JgMaintainNotice
.
setNoticeReportUrl
(
url
);
...
...
@@ -721,6 +676,11 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
public
void
cancel
(
JgMaintainNoticeDto
noticeDto
)
{
JgMaintainNotice
jgMaintainNotice
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
String
expectedStatus
=
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
// 检查实际状态是否不等于期望状态
if
(!
expectedStatus
.
equals
(
jgMaintainNotice
.
getNoticeStatus
()))
{
throw
new
BadRequest
(
"当前业务状态不是待处理状态,请刷新页面后重试操作!"
);
}
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
rollBack
(
jgMaintainNotice
.
getInstanceId
());
// 提取节点等信息
WorkflowResultDto
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
...
...
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/JgReformNoticeServiceImpl.java
View file @
45030d1e
...
...
@@ -22,15 +22,16 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgReformNoticeMapper;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgReformNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgRegisterInfoService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.*
;
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
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -44,9 +45,9 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -97,6 +98,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
@Autowired
IIdxBizJgRegisterInfoService
idxBizJgRegisterInfoService
;
@Autowired
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
/**
* 根据sequenceNbr查询
*
...
...
@@ -327,63 +331,9 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
if
(
Objects
.
isNull
(
JgReformNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"改造告知单不存在"
);
}
Map
<
String
,
Object
>
installation
=
informationList
.
get
(
0
);
Map
<
String
,
Object
>
placeholders
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_MODIFICATION_NOTIFICATION
.
getName
()
);
String
useCode
=
String
.
valueOf
(
installation
.
get
(
"useCode"
));
LambdaQueryWrapper
<
TzBaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
TzBaseUnitLicence:
:
getUnitCode
,
useCode
);
wrapper
.
last
(
" LIMIT 3"
);
List
<
TzBaseUnitLicence
>
list
=
baseUnitLicenceMapper
.
selectList
(
wrapper
);
ArrayList
<
String
>
installLicenseNoList
=
new
ArrayList
<>();
ArrayList
<
String
>
installLicenseExpirationDateList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
list
.
forEach
(
tzBaseUnitLicence
->
{
// 因模板许可证编号配置最多支持三个,再多样式混乱,目前返回三个
if
(
installLicenseNoList
.
size
()
<
3
)
{
installLicenseNoList
.
add
(
tzBaseUnitLicence
.
getCertNo
());
installLicenseExpirationDateList
.
add
(
DateUtils
.
convertDateToString
(
tzBaseUnitLicence
.
getExpiryDate
(),
DateUtils
.
DATE_PATTERN
));
}
});
}
Function
<
String
,
String
>
getValue
=
key
->
installation
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
placeholders
.
put
(
"sequenceNbr"
,
getValue
.
apply
(
"sequenceNbr"
));
placeholders
.
put
(
"installUnitName"
,
getValue
.
apply
(
"installUnitName"
));
placeholders
.
put
(
"informNumber"
,
Objects
.
toString
(
getValue
.
apply
(
"informNumber"
),
getValue
.
apply
(
"applyNo"
)));
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"produceCode"
));
// TODO: 制造编号 - 设备出厂编号
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"改造告知"
);
// TODO: 施工类别
placeholders
.
put
(
"installLicenseNo"
,
getValue
.
apply
(
"installLicenseNo"
));
placeholders
.
put
(
"installLicenseExpirationDate"
,
getValue
.
apply
(
"installLicenseExpirationDate"
));
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
// 施工负责人
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
// 施工负责人手机
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
// TODO: 施工单位地址
placeholders
.
put
(
"useUnitName"
,
getValue
.
apply
(
"useUnitName"
));
placeholders
.
put
(
"useUnitLeaderName"
,
getValue
.
apply
(
"safetyManager"
));
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"useUnitProvinceName"
)
+
getValue
.
apply
(
"useUnitCityName"
)
+
getValue
.
apply
(
"useUnitCountyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"useUnitAddress"
));
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"informNumber"
),
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
placeholders
.
put
(
"installLicenseNoList"
,
installLicenseNoList
);
placeholders
.
put
(
"installLicenseExpirationDateList"
,
installLicenseExpirationDateList
);
log
.
info
(
"改造告知单 => {}"
,
JSON
.
toJSONString
(
placeholders
));
String
tempFileName
=
"安装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
String
tempFileName
=
"改造告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
String
url
=
WordTemplateUtils
.
templateToPdf
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
);
// 更新到数据库
...
...
@@ -689,6 +639,11 @@ public class JgReformNoticeServiceImpl extends BaseService<JgReformNoticeDto, Jg
JgReformNotice
notice
=
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
if
(
notice
!=
null
)
{
String
expectedStatus
=
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
// 检查实际状态是否不等于期望状态
if
(!
expectedStatus
.
equals
(
notice
.
getNoticeStatus
()))
{
throw
new
BadRequest
(
"当前业务状态不是待处理状态,请刷新页面后重试操作!"
);
}
// 回滚工作流
ProcessTaskDTO
processTaskDTO
=
cmWorkflowService
.
rollBack
(
noticeDto
.
getInstanceId
());
WorkflowResultDto
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
...
...
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/JgTransferNoticeServiceImpl.java
View file @
45030d1e
...
...
@@ -24,11 +24,9 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseUnitLicence
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
...
...
@@ -47,11 +45,10 @@ import org.springframework.util.StringUtils;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -78,7 +75,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Autowired
IdxBizJgRegisterInfoServiceImpl
idxBizJgRegisterInfoService
;
@Autowired
private
CommonServiceImpl
commonService
;
...
...
@@ -92,9 +88,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
RedisUtils
redisUtils
;
@Autowired
private
TzBaseUnitLicenceMapper
baseUnitLicenceMapper
;
@Autowired
JgUseRegistrationMapper
jgUseRegistrationMapper
;
@Autowired
...
...
@@ -104,6 +97,9 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Autowired
IdxBizJgUseInfoMapper
idxBizJgUseInfoMapper
;
@Autowired
JgInstallationNoticeServiceImpl
jgInstallationNoticeService
;
/**
* 根据sequenceNbr查询
*
...
...
@@ -201,57 +197,10 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if
(
Objects
.
isNull
(
jgTransferNotice
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"移装告知单不存在"
);
}
Map
<
String
,
Object
>
maintain
=
informationList
.
get
(
0
);
String
useCode
=
String
.
valueOf
(
maintain
.
get
(
"installUnitCreditCode"
));
LambdaQueryWrapper
<
TzBaseUnitLicence
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
TzBaseUnitLicence:
:
getUnitCode
,
useCode
);
List
<
TzBaseUnitLicence
>
list
=
baseUnitLicenceMapper
.
selectList
(
wrapper
);
Map
<
String
,
Object
>
placeholders
=
jgInstallationNoticeService
.
fullFillTemplateObj
(
informationList
,
BusinessTypeEnum
.
JG_ADVICE_REMOVAL
.
getName
());
ArrayList
<
String
>
installLicenseNoList
=
new
ArrayList
<>();
ArrayList
<
String
>
installLicenseExpirationDateList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
list
.
forEach
(
tzBaseUnitLicence
->
{
// 因模板许可证编号配置最多支持三个,再多样式混乱,目前返回三个
if
(
installLicenseNoList
.
size
()
<
3
)
{
installLicenseNoList
.
add
(
tzBaseUnitLicence
.
getCertNo
());
installLicenseExpirationDateList
.
add
(
DateUtils
.
convertDateToString
(
tzBaseUnitLicence
.
getExpiryDate
(),
DateUtils
.
DATE_PATTERN
));
}
});
}
Function
<
String
,
String
>
getValue
=
key
->
maintain
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
placeholders
.
put
(
"sequenceNbr"
,
getValue
.
apply
(
"sequenceNbr"
));
placeholders
.
put
(
"installUnitName"
,
getValue
.
apply
(
"installUnitName"
));
placeholders
.
put
(
"informNumber"
,
Objects
.
toString
(
getValue
.
apply
(
"informNumber"
),
getValue
.
apply
(
"applyNo"
)));
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
// TODO: 制造编号 - 设备出厂编号
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"移装"
);
// TODO: 施工类别
placeholders
.
put
(
"installLicenseNo"
,
""
);
placeholders
.
put
(
"installLicenseExpirationDate"
,
""
);
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
// 施工负责人
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
// 施工负责人手机
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
// TODO: 施工单位地址
placeholders
.
put
(
"useUnitName"
,
getValue
.
apply
(
"useUnitName"
));
placeholders
.
put
(
"useUnitLeaderName"
,
getValue
.
apply
(
"safetyManager"
));
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"useUnitLeaderAddress"
));
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"informNumber"
),
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
placeholders
.
put
(
"installLicenseNoList"
,
installLicenseNoList
);
placeholders
.
put
(
"installLicenseExpirationDateList"
,
installLicenseExpirationDateList
);
String
tempFileName
=
"安装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
String
tempFileName
=
"移装告知单_"
+
System
.
currentTimeMillis
()
+
"_temp"
;
String
url
=
WordTemplateUtils
.
templateToPdf
(
tempFileName
,
"installation-notification-report.ftl"
,
placeholders
);
// 更新到数据库
...
...
@@ -664,6 +613,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
@Transactional
public
void
cancel
(
JgTransferNoticeDto
noticeDto
)
{
JgTransferNotice
jgInstallationNotice
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
String
expectedStatus
=
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
// 检查实际状态是否不等于期望状态
if
(!
expectedStatus
.
equals
(
jgInstallationNotice
.
getNoticeStatus
()))
{
throw
new
BadRequest
(
"当前业务状态不是待处理状态,请刷新页面后重试操作!"
);
}
ProcessTaskDTO
processTaskDTO
=
iCmWorkflowService
.
rollBack
(
jgInstallationNotice
.
getInstanceId
());
// 提取节点等信息
WorkflowResultDto
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
...
...
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 @
45030d1e
...
...
@@ -519,7 +519,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
updateEquipMessage
(
String
.
valueOf
(
sequenceNbr
),
jgUseRegistration
,
mapData
,
registerInfo
,
otherInfo
);
// 生成使用登记证编号
if
(!
ObjectUtils
.
isEmpty
(
jgUseRegistration
.
getSupervisoryCode
()))
{
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
jgUseRegistration
.
getSupervisoryCode
(),
jgUseRegistration
.
getReceiveCompanyCode
());
String
code
=
commonServiceImpl
.
generateRegistrationCode
(
jgUseRegistration
Eq
.
getEquId
(),
jgUseRegistration
.
getSupervisoryCode
(),
jgUseRegistration
.
getReceiveCompanyCode
());
jgUseRegistration
.
setUseRegistrationCode
(
code
);
jgUseRegistration
.
setAuditPassDate
(
new
Date
());
registerInfo
.
setUseOrgCode
(
code
);
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/resources/templates/installation-notification-report.ftl
View file @
45030d1e
This diff is collapsed.
Click to expand it.
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