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
03ccbc6e
Commit
03ccbc6e
authored
Sep 29, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jyjc): 报检规则4.0开发
1.报检申请表生成url功能初始版本提交
parent
25ae6d2f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
384 additions
and
0 deletions
+384
-0
pom.xml
...s/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/pom.xml
+6
-0
DocGeneratorFactory.java
...jyjc/biz/file/inspectapp/factory/DocGeneratorFactory.java
+31
-0
DocGenerator.java
...yjc/biz/file/inspectapp/factory/support/DocGenerator.java
+5
-0
SupportableDocGenerator.java
...e/inspectapp/factory/support/SupportableDocGenerator.java
+7
-0
GenericDocGeneratorStrategy.java
...file/inspectapp/strategy/GenericDocGeneratorStrategy.java
+80
-0
PipelineDocGeneratorStrategy.java
...ile/inspectapp/strategy/PipelineDocGeneratorStrategy.java
+85
-0
InspectAppDocCmService.java
...le/inspectapp/strategy/common/InspectAppDocCmService.java
+54
-0
DocGeneratorWrapper.java
...jyjc/biz/file/inspectapp/wrapper/DocGeneratorWrapper.java
+17
-0
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+6
-0
InspectTypeHandler.java
.../boot/module/jyjc/biz/typeHandler/InspectTypeHandler.java
+30
-0
RegionCodeTypeHandler.java
...ot/module/jyjc/biz/typeHandler/RegionCodeTypeHandler.java
+36
-0
WordTemplateUtils.java
...oin/amos/boot/module/jyjc/biz/util/WordTemplateUtils.java
+0
-0
inspect-app-generic.ftl
...-biz/src/main/resources/templates/inspect-app-generic.ftl
+0
-0
inspect-app-pipeline.ftl
...biz/src/main/resources/templates/inspect-app-pipeline.ftl
+0
-0
IdxBizJgUseInfoMapper.java
...mos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
+2
-0
IdxBizJgUseInfoMapper.xml
...t-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
+25
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/pom.xml
View file @
03ccbc6e
...
@@ -27,6 +27,12 @@
...
@@ -27,6 +27,12 @@
<artifactId>
spring-kafka
</artifactId>
<artifactId>
spring-kafka
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.aspose
</groupId>
<artifactId>
aspose-words
</artifactId>
<version>
19.5jdk
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
net.javacrumbs.shedlock
</groupId>
<groupId>
net.javacrumbs.shedlock
</groupId>
<artifactId>
shedlock-spring
</artifactId>
<artifactId>
shedlock-spring
</artifactId>
</dependency>
</dependency>
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/factory/DocGeneratorFactory.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
factory
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.DocGenerator
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.SupportableDocGenerator
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.wrapper.DocGeneratorWrapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Service
@RequiredArgsConstructor
public
class
DocGeneratorFactory
{
private
final
Map
<
String
,
DocGenerator
>
docGenerators
=
new
ConcurrentHashMap
<>();
private
final
List
<
SupportableDocGenerator
>
factories
;
public
DocGenerator
getGenerator
(
String
equList
,
String
equCategory
,
String
equDefine
)
{
return
docGenerators
.
computeIfAbsent
(
equList
,
k
->
new
DocGeneratorWrapper
(
factories
.
stream
()
.
filter
(
s
->
s
.
support
(
equList
,
equCategory
,
equDefine
))
.
findFirst
()
.
orElseThrow
(()
->
new
UnsupportedOperationException
(
String
.
format
(
"No generator found for type: %s (list=%s, define=%s)"
,
equCategory
,
equList
,
equDefine
))))
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/factory/support/DocGenerator.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
factory
.
support
;
public
interface
DocGenerator
{
String
generate
(
String
appId
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/factory/support/SupportableDocGenerator.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
factory
.
support
;
public
interface
SupportableDocGenerator
extends
DocGenerator
{
boolean
support
(
String
equList
,
String
equCategory
,
String
equDefine
);
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/strategy/GenericDocGeneratorStrategy.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
strategy
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.module.common.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.SupportableDocGenerator
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.strategy.common.InspectAppDocCmService
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationEquipServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.io.File
;
import
java.nio.file.Files
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
@RequiredArgsConstructor
@Slf4j
public
class
GenericDocGeneratorStrategy
implements
SupportableDocGenerator
{
private
final
JyjcInspectionApplicationServiceImpl
jyjcInspectionApplicationService
;
private
final
JyjcInspectionApplicationEquipServiceImpl
jyjcInspectionApplicationEquipService
;
private
final
InspectAppDocCmService
appDocCmService
;
private
final
IdxBizJgUseInfoMapper
idxBizJgUseInfoMapper
;
@Override
public
boolean
support
(
String
equList
,
String
equCategory
,
String
equDefine
)
{
return
!
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equList
);
}
@Override
public
String
generate
(
String
appId
)
{
Map
<
String
,
Object
>
params
=
appDocCmService
.
getBaseInFo
(
appId
);
JyjcInspectionApplication
inspectionApplication
=
jyjcInspectionApplicationService
.
getBaseMapper
().
selectById
(
appId
);
params
.
put
(
"numberOfEquip"
,
inspectionApplication
.
getNumberOfEquip
());
params
.
put
(
"equips"
,
this
.
buildEquipsBatch
(
inspectionApplication
.
getSequenceNbr
()));
return
this
.
generatePdfAndUpload
(
params
);
}
private
String
generatePdfAndUpload
(
Map
<
String
,
Object
>
formData
)
{
String
wordPath
=
"inspect-app-generic.ftl"
;
String
fileName
=
"检验检测报检申请受理单"
;
File
pdfFile
=
null
;
try
{
// 填充模板, word转pdf
pdfFile
=
WordTemplateUtils
.
wordToPdf
(
fileName
,
wordPath
,
formData
);
// 上传文档到文件服务器
return
WordTemplateUtils
.
uploadFile
(
pdfFile
,
"upload/tzs/pdf/inspectApp"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
if
(
pdfFile
!=
null
)
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
.
getMessage
());
}
}
}
private
List
<
Map
<
String
,
Object
>>
buildEquipsBatch
(
Long
sequenceNbr
)
{
List
<
JyjcInspectionApplicationEquip
>
equips
=
jyjcInspectionApplicationEquipService
.
list
(
new
LambdaQueryWrapper
<
JyjcInspectionApplicationEquip
>()
.
eq
(
JyjcInspectionApplicationEquip:
:
getApplicationSeq
,
sequenceNbr
)
.
select
(
BaseEntity:
:
getSequenceNbr
,
JyjcInspectionApplicationEquip:
:
getEquipUnicode
));
List
<
String
>
records
=
equips
.
stream
().
map
(
JyjcInspectionApplicationEquip:
:
getEquipUnicode
).
collect
(
Collectors
.
toList
());
return
idxBizJgUseInfoMapper
.
queryBaseInfoByIds
(
records
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/strategy/PipelineDocGeneratorStrategy.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
strategy
;
import
com.yeejoin.amos.boot.module.common.api.enums.EquipmentClassifityEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionHistory
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.SupportableDocGenerator
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.strategy.common.InspectAppDocCmService
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionHistoryServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.util.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.nio.file.Files
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Slf4j
@RequiredArgsConstructor
public
class
PipelineDocGeneratorStrategy
implements
SupportableDocGenerator
{
private
final
JyjcInspectionApplicationServiceImpl
jyjcInspectionApplicationService
;
private
final
InspectAppDocCmService
appDocCmService
;
private
final
JyjcInspectionHistoryServiceImpl
inspectionHistoryService
;
@Override
public
boolean
support
(
String
equList
,
String
equCategory
,
String
equDefine
)
{
return
EquipmentClassifityEnum
.
YLGD
.
getCode
().
equals
(
equList
);
}
@Override
public
String
generate
(
String
appId
)
{
Map
<
String
,
Object
>
params
=
appDocCmService
.
getBaseInFo
(
appId
);
JyjcInspectionApplication
inspectionApplication
=
jyjcInspectionApplicationService
.
getBaseMapper
().
selectById
(
appId
);
this
.
setPipelineInfo
(
params
,
inspectionApplication
);
return
this
.
generatePdfAndUpload
(
params
);
}
private
void
setPipelineInfo
(
Map
<
String
,
Object
>
params
,
JyjcInspectionApplication
inspectionApplication
)
{
if
(
inspectionApplication
.
getStatus
().
equals
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())))
{
JyjcInspectionHistory
inspectionHistory
=
inspectionHistoryService
.
getBySSeq
(
inspectionApplication
.
getSequenceNbr
());
if
(
inspectionHistory
!=
null
)
{
// 新报检单记录历史数据的逻辑
params
.
put
(
"pipelines"
,
inspectionHistory
.
getHistoryData
().
get
(
"equip"
));
params
.
put
(
"numberOfEquip"
,
inspectionHistory
.
getHistoryData
().
get
(
"pipelineLength"
));
}
else
{
List
<
Map
<
String
,
Object
>>
pipelines
=
jyjcInspectionApplicationService
.
getPipelines
(
inspectionApplication
);
params
.
put
(
"pipelines"
,
pipelines
);
params
.
put
(
"numberOfEquip"
,
JyjcInspectionApplicationServiceImpl
.
calTotalLength
(
pipelines
));
}
}
else
{
List
<
Map
<
String
,
Object
>>
pipelines
=
jyjcInspectionApplicationService
.
getPipelines
(
inspectionApplication
);
params
.
put
(
"pipelines"
,
pipelines
);
params
.
put
(
"numberOfEquip"
,
JyjcInspectionApplicationServiceImpl
.
calTotalLength
(
pipelines
));
}
}
private
String
generatePdfAndUpload
(
Map
<
String
,
Object
>
formData
)
{
String
wordPath
=
"inspect-app-pipeline.ftl"
;
String
fileName
=
"检验检测报检申请受理单"
;
File
pdfFile
=
null
;
try
{
// 填充模板, word转pdf
pdfFile
=
WordTemplateUtils
.
wordToPdf
(
fileName
,
wordPath
,
formData
);
// 上传文档到文件服务器
return
WordTemplateUtils
.
uploadFile
(
pdfFile
,
"upload/tzs/pdf/inspectApp"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
try
{
if
(
pdfFile
!=
null
)
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"文件找不到,删除失败:{}"
,
e
.
getMessage
());
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/strategy/common/InspectAppDocCmService.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
strategy
.
common
;
import
cn.hutool.core.date.DateUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.biz.service.impl.JyjcInspectionApplicationServiceImpl
;
import
com.yeejoin.amos.boot.module.jyjc.biz.typeHandler.EquipCategoryTypeHandler
;
import
com.yeejoin.amos.boot.module.jyjc.biz.typeHandler.InspectTypeHandler
;
import
com.yeejoin.amos.boot.module.jyjc.biz.typeHandler.RegionCodeTypeHandler
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
@RequiredArgsConstructor
public
class
InspectAppDocCmService
{
private
final
JyjcInspectionApplicationServiceImpl
jyjcInspectionApplicationService
;
private
final
EquipCategoryTypeHandler
equipCategoryTypeHandler
;
private
final
InspectTypeHandler
inspectTypeHandler
;
private
final
RegionCodeTypeHandler
regionCodeTypeHandler
;
public
Map
<
String
,
Object
>
getBaseInFo
(
String
appId
)
{
Map
<
String
,
Object
>
baseInfo
=
new
HashMap
<>();
JyjcInspectionApplication
inspectionApplication
=
jyjcInspectionApplicationService
.
getBaseMapper
().
selectById
(
appId
);
baseInfo
.
put
(
"inspectionType"
,
inspectTypeHandler
.
handle
(
inspectionApplication
.
getInspectionType
()));
baseInfo
.
put
(
"applicationNo"
,
inspectionApplication
.
getApplicationNo
());
baseInfo
.
put
(
"applicationDate"
,
DateUtil
.
formatDate
(
inspectionApplication
.
getApplicationDate
()));
baseInfo
.
put
(
"applicationUnitName"
,
inspectionApplication
.
getApplicationUnitName
());
baseInfo
.
put
(
"applicationContactName"
,
inspectionApplication
.
getApplicationContactName
());
baseInfo
.
put
(
"applicationContactPhone"
,
inspectionApplication
.
getApplicationContactPhone
());
baseInfo
.
put
(
"address"
,
this
.
buildAddress
(
inspectionApplication
));
baseInfo
.
put
(
"equList"
,
this
.
equCategoryCode2Name
(
inspectionApplication
.
getEquipClassify
()));
baseInfo
.
put
(
"equCategory"
,
this
.
equCategoryCode2Name
(
inspectionApplication
.
getEquCategory
()));
baseInfo
.
put
(
"equDefine"
,
this
.
equCategoryCode2Name
(
inspectionApplication
.
getEquDefine
()));
baseInfo
.
put
(
"remark"
,
inspectionApplication
.
getRemark
());
baseInfo
.
put
(
"inspectionUnitName"
,
inspectionApplication
.
getInspectionUnitName
());
baseInfo
.
put
(
"acceptDate"
,
DateUtil
.
formatDate
(
inspectionApplication
.
getAcceptDate
()));
baseInfo
.
put
(
"processDescription"
,
inspectionApplication
.
getProcessDescription
());
return
baseInfo
;
}
private
String
equCategoryCode2Name
(
String
equipClassify
)
{
return
equipCategoryTypeHandler
.
handle
(
equipClassify
);
}
private
String
buildAddress
(
JyjcInspectionApplication
inspectionApplication
)
{
return
"陕西省"
+
regionCodeTypeHandler
.
handle
(
inspectionApplication
.
getCity
())
+
regionCodeTypeHandler
.
handle
(
inspectionApplication
.
getCounty
());
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/file/inspectapp/wrapper/DocGeneratorWrapper.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
file
.
inspectapp
.
wrapper
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.DocGenerator
;
import
com.yeejoin.amos.boot.module.jyjc.biz.file.inspectapp.factory.support.SupportableDocGenerator
;
public
class
DocGeneratorWrapper
implements
DocGenerator
{
private
final
SupportableDocGenerator
docGenerator
;
public
DocGeneratorWrapper
(
final
SupportableDocGenerator
docGenerator
)
{
this
.
docGenerator
=
docGenerator
;
}
@Override
public
String
generate
(
String
appId
)
{
return
docGenerator
.
generate
(
appId
);
}
}
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/JyjcInspectionApplicationServiceImpl.java
View file @
03ccbc6e
...
@@ -1781,6 +1781,12 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
...
@@ -1781,6 +1781,12 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
return
this
.
getBaseMapper
().
selectPieLineListOfInspect
(
records
);
return
this
.
getBaseMapper
().
selectPieLineListOfInspect
(
records
);
}
}
public
List
<
Map
<
String
,
Object
>>
getPipelines
(
JyjcInspectionApplication
application
)
{
List
<
JyjcInspectionApplicationEquipModel
>
applicationEquipModels
=
applicationEquipService
.
listApplicationEquipByApplicationSeq
(
application
.
getSequenceNbr
());
List
<
String
>
records
=
applicationEquipModels
.
stream
().
map
(
JyjcInspectionApplicationEquipModel:
:
getEquipUnicode
).
collect
(
Collectors
.
toList
());
return
this
.
getBaseMapper
().
selectPieLineListOfInspect
(
records
);
}
@NotNull
@NotNull
private
JSONObject
setPieLineInfo
(
JyjcInspectionApplicationModel
applicationModel
,
IdxBizJgProjectContraption
projectContraption
,
JSONObject
jsonObject
,
List
<
Map
<
String
,
Object
>>
equList
)
{
private
JSONObject
setPieLineInfo
(
JyjcInspectionApplicationModel
applicationModel
,
IdxBizJgProjectContraption
projectContraption
,
JSONObject
jsonObject
,
List
<
Map
<
String
,
Object
>>
equList
)
{
jsonObject
.
put
(
"equip"
,
equList
);
jsonObject
.
put
(
"equip"
,
equList
);
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/typeHandler/InspectTypeHandler.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
typeHandler
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.typeHandler.TypeHandler
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* 特种设备目录处理器
*/
@Component
(
"equipCategoryTypeHandler"
)
@RequiredArgsConstructor
public
class
InspectTypeHandler
implements
TypeHandler
<
String
>
{
private
final
Map
<
String
,
String
>
CODE_NAME_MAP
=
new
ConcurrentHashMap
<>();
private
final
DataDictionaryServiceImpl
dataDictionaryService
;
@Override
public
String
handle
(
String
code
)
{
return
StringUtils
.
isNotEmpty
(
code
)
?
CODE_NAME_MAP
.
computeIfAbsent
(
code
,
(
k
)
->
{
DataDictionary
dictionary
=
dataDictionaryService
.
getByCode
(
k
,
"JYJC"
);
return
dictionary
!=
null
?
dictionary
.
getName
()
:
""
;
})
:
null
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/typeHandler/RegionCodeTypeHandler.java
0 → 100644
View file @
03ccbc6e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
typeHandler
;
import
com.yeejoin.amos.boot.biz.common.typeHandler.TypeHandler
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Stream
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
constant
.
TZSCommonConstant
.*;
/**
* 行政区划处理器
*/
@Component
(
"regionCodeTypeHandler"
)
@RequiredArgsConstructor
public
class
RegionCodeTypeHandler
implements
TypeHandler
<
String
>
{
private
final
RedisUtils
redisUtils
;
private
final
Map
<
String
,
String
>
CODE_NAME_MAP
=
new
ConcurrentHashMap
<>();
@Override
public
String
handle
(
String
regionCode
)
{
return
StringUtils
.
isNotBlank
(
regionCode
)
?
CODE_NAME_MAP
.
computeIfAbsent
(
regionCode
,
(
k
)
->
{
List
<
LinkedHashMap
>
list1
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
PROVINCE
);
List
<
LinkedHashMap
>
list2
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
CITY
);
List
<
LinkedHashMap
>
list3
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
REGION
);
List
<
LinkedHashMap
>
list4
=
(
List
<
LinkedHashMap
>)
redisUtils
.
get
(
STREET
);
Optional
<
LinkedHashMap
>
op
=
Stream
.
of
(
list1
,
list2
,
list3
,
list4
).
flatMap
(
Collection:
:
stream
).
filter
(
item
->
String
.
valueOf
(
item
.
get
(
"regionCode"
)).
trim
().
equals
(
regionCode
)).
findFirst
();
return
op
.
map
(
linkedHashMap
->
linkedHashMap
.
get
(
"regionName"
).
toString
()).
orElse
(
""
);
})
:
""
;
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/util/WordTemplateUtils.java
0 → 100644
View file @
03ccbc6e
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/resources/templates/inspect-app-generic.ftl
0 → 100644
View file @
03ccbc6e
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/resources/templates/inspect-app-pipeline.ftl
0 → 100644
View file @
03ccbc6e
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/IdxBizJgUseInfoMapper.java
View file @
03ccbc6e
...
@@ -45,4 +45,6 @@ public interface IdxBizJgUseInfoMapper extends CustomBaseMapper<IdxBizJgUseInfo>
...
@@ -45,4 +45,6 @@ public interface IdxBizJgUseInfoMapper extends CustomBaseMapper<IdxBizJgUseInfo>
Page
<
String
>
selectPiPeRecords
(
Page
<
String
>
page
);
Page
<
String
>
selectPiPeRecords
(
Page
<
String
>
page
);
JSONObject
getUsePlaceAndCodeByRecord
(
@Param
(
"record"
)
String
record
);
JSONObject
getUsePlaceAndCodeByRecord
(
@Param
(
"record"
)
String
record
);
List
<
Map
<
String
,
Object
>>
queryBaseInfoByIds
(
@Param
(
"records"
)
List
<
String
>
records
);
}
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/IdxBizJgUseInfoMapper.xml
View file @
03ccbc6e
...
@@ -190,5 +190,30 @@
...
@@ -190,5 +190,30 @@
AND "CLAIM_STATUS" NOT IN ('待认领','已拒领','草稿')
AND "CLAIM_STATUS" NOT IN ('待认领','已拒领','草稿')
order by ibjui."RECORD" desc
order by ibjui."RECORD" desc
</select>
</select>
<select
id=
"queryBaseInfoByIds"
resultType=
"java.util.Map"
>
SELECT
ibjui."RECORD" AS "record",
ibjsi."ORG_BRANCH_NAME" AS "orgBranchName",
ibjri."USE_ORG_CODE" AS "useOrgCode",
ibjui."USE_INNER_CODE" AS "useInnerCode",
ibjui."DATA_SOURCE" AS "dataSource",
ibjoi."CODE96333" AS "code96333",
ibjri."EQU_CODE" AS "equCode",
ibjoi."SUPERVISORY_CODE" AS "supervisoryCode",
CONCAT_WS('', ibjui."PROVINCE_NAME", ibjui."CITY_NAME", ibjui."COUNTY_NAME", ibjui."STREET_NAME", ibjui."ADDRESS") AS "address",
ibjfi."FACTORY_NUM" AS "factoryNum"
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN amos_tzs_biz.idx_biz_jg_supervision_info ibjsi ON ibjui."RECORD" = ibjsi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_register_info ibjri ON ibjui."RECORD" = ibjri."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_other_info ibjoi ON ibjui."RECORD" = ibjoi."RECORD"
LEFT JOIN amos_tzs_biz.idx_biz_jg_factory_info ibjfi ON ibjui."RECORD" = ibjfi."RECORD"
where ibjui.record = ANY(
ARRAY[
<foreach
collection=
"records"
item=
"record"
index=
"index"
separator=
","
>
#{record}
</foreach>
])
</select>
</mapper>
</mapper>
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