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
016ed367
Commit
016ed367
authored
Oct 28, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加证扫描逻辑
parent
aae3334d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
37 deletions
+60
-37
FieldDisplayDefine.java
...os/boot/module/app/api/annotation/FieldDisplayDefine.java
+6
-0
CylinderInfoForWX.java
...ejoin/amos/boot/module/app/api/dto/CylinderInfoForWX.java
+3
-3
VehicleInfoForWX.java
...eejoin/amos/boot/module/app/api/dto/VehicleInfoForWX.java
+4
-1
AppCommonMapper.xml
...ule-app-api/src/main/resources/mapper/AppCommonMapper.xml
+2
-1
TzsAppController.java
...amos/boot/module/app/biz/controller/TzsAppController.java
+4
-4
SetSearchDetailDetailHandlerImpl.java
...pp/biz/service/impl/SetSearchDetailDetailHandlerImpl.java
+1
-1
TzsAppService.java
.../amos/boot/module/app/biz/service/impl/TzsAppService.java
+8
-6
UnitSearchDetailDetailHandlerImpl.java
...p/biz/service/impl/UnitSearchDetailDetailHandlerImpl.java
+1
-1
VehicleSearchDetailDetailHandlerImpl.java
...iz/service/impl/VehicleSearchDetailDetailHandlerImpl.java
+29
-18
ISearchDetailHandler.java
...os/boot/module/app/biz/strategy/ISearchDetailHandler.java
+2
-2
No files found.
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/annotation/FieldDisplayDefine.java
View file @
016ed367
...
...
@@ -10,6 +10,12 @@ public @interface FieldDisplayDefine {
String
value
();
/**
* 字段别名 兼容前端使用
* @return 别名key
*/
String
alias
()
default
""
;
boolean
isExist
()
default
true
;
Class
<?
extends
Converter
>
converter
()
default
DefaultConverter
.
class
;
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/dto/CylinderInfoForWX.java
View file @
016ed367
...
...
@@ -22,7 +22,7 @@ public class CylinderInfoForWX {
@FieldDisplayDefine
(
value
=
"制造单位"
)
private
String
produceUnitName
;
@FieldDisplayDefine
(
value
=
"制造年月"
)
@FieldDisplayDefine
(
value
=
"制造年月"
,
alias
=
"produceDateStr"
)
private
String
produceDate
;
@FieldDisplayDefine
(
value
=
"充装介质"
,
converter
=
ChargeMediaConverter
.
class
)
...
...
@@ -34,10 +34,10 @@ public class CylinderInfoForWX {
@FieldDisplayDefine
(
value
=
"容积(L)"
)
private
String
singleBottleVolume
;
@FieldDisplayDefine
(
value
=
"最近一次检验日期"
)
@FieldDisplayDefine
(
value
=
"最近一次检验日期"
,
alias
=
"lastInspectDateStr"
)
private
String
lastInspectDate
;
@FieldDisplayDefine
(
value
=
"下次检验日期"
)
@FieldDisplayDefine
(
value
=
"下次检验日期"
,
alias
=
"nextInspectDateStr"
)
private
String
nextInspectDate
;
@FieldDisplayDefine
(
value
=
"检验结果"
,
converter
=
InspectResultConverter
.
class
)
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/java/com/yeejoin/amos/boot/module/app/api/dto/VehicleInfoForWX.java
View file @
016ed367
...
...
@@ -10,9 +10,12 @@ public class VehicleInfoForWX {
@FieldDisplayDefine
(
value
=
"车牌号"
)
private
String
carNumber
;
@FieldDisplayDefine
(
value
=
"使用登记证编号"
)
@FieldDisplayDefine
(
value
=
"使用登记证编号"
,
isExist
=
false
)
private
String
useRegistrationCode
;
@FieldDisplayDefine
(
value
=
"使用登记证状态"
,
isExist
=
false
)
private
String
certificateStatus
;
@FieldDisplayDefine
(
value
=
"设备类别"
)
private
String
equCategory
;
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-api/src/main/resources/mapper/AppCommonMapper.xml
View file @
016ed367
...
...
@@ -85,7 +85,8 @@
equ_category,
gas_num,
use_unit_address,
use_unit_name
use_unit_name,
certificate_status
FROM
"tzs_jg_use_registration_manage"
where
...
...
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 @
016ed367
...
...
@@ -130,11 +130,11 @@ public class TzsAppController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/
certInfoWX
"
)
@GetMapping
(
value
=
"/
{certSeq}/certInfo
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"小程序获取登记证或者使用标志详情"
,
notes
=
"小程序获取登记证或者使用标志详情"
)
public
ResponseModel
<
Map
>
getCertInfoForWX
(
@
RequestParam
String
applyNo
,
@RequestParam
String
from
)
{
return
ResponseHelper
.
buildResponse
(
appService
.
getCertInfoForWX
(
applyNo
,
from
));
public
ResponseModel
<
Map
>
getCertInfoForWX
(
@
PathVariable
String
certSeq
,
@RequestParam
(
required
=
false
)
String
certType
)
{
return
ResponseHelper
.
buildResponse
(
appService
.
getCertInfoForWX
(
certSeq
,
certType
));
}
...
...
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/SetSearchDetailDetailHandlerImpl.java
View file @
016ed367
...
...
@@ -7,7 +7,7 @@ import java.util.Collections;
import
java.util.Map
;
@Component
public
class
SetSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
<
Map
<
String
,
Object
>>
{
public
class
SetSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
{
@Override
public
String
manageType
()
{
return
"set"
;
...
...
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/TzsAppService.java
View file @
016ed367
...
...
@@ -264,17 +264,19 @@ public class TzsAppService {
return
map
;
}
public
Map
<
String
,
Object
>
getCertInfoForWX
(
String
applyNo
,
String
from
)
{
// 单位办理方式[unit](气瓶、压力管道)、台套办理方式[set](7大类,不包含压力管道)、车用气瓶(压力容器->气瓶)
public
Map
<
String
,
Object
>
getCertInfoForWX
(
String
certSeq
,
String
certType
)
{
return
SearchDetailStrategyContext
.
getHandler
(
this
.
getManageType
(
certSeq
)).
hanlder
(
certSeq
,
certType
);
}
private
String
getManageType
(
String
applyNo
)
{
// 3类:单位办理方式[unit](气瓶、压力管道)、台套办理方式[set](7大类,不包含压力管道)、车用气瓶[vehicle](压力容器->气瓶)
JgUseRegistrationManageDto
jgUseRegistrationManage
=
commonMapper
.
selectOneCert
(
applyNo
);
// 使用登记、车用气瓶登记
String
regType
=
jgUseRegistrationManage
.
getRegType
();
// unit、set、null
String
manageType
=
jgUseRegistrationManage
.
getManageType
()
==
null
?
"set"
:
jgUseRegistrationManage
.
getManageType
();
if
(
REG_TYPE_VEHICLE
.
equals
(
regType
))
{
return
SearchDetailStrategyContext
.
getHandler
(
"vehicle"
).
hanlder
(
applyNo
,
from
)
;
return
"vehicle"
;
}
return
SearchDetailStrategyContext
.
getHandler
(
manageType
).
hanlder
(
applyNo
,
from
);
return
jgUseRegistrationManage
.
getManageType
()
==
null
?
"set"
:
jgUseRegistrationManage
.
getManageType
(
);
}
...
...
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/UnitSearchDetailDetailHandlerImpl.java
View file @
016ed367
...
...
@@ -7,7 +7,7 @@ import java.util.Collections;
import
java.util.Map
;
@Component
public
class
UnitSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
<
Map
<
String
,
Object
>>
{
public
class
UnitSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
{
@Override
public
String
manageType
()
{
return
"unit"
;
...
...
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 @
016ed367
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.app.api.mapper.AppCommonMapper;
import
com.yeejoin.amos.boot.module.app.biz.strategy.ISearchDetailHandler
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.entity.ContentType
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.stereotype.Component
;
...
...
@@ -23,7 +24,7 @@ import java.lang.reflect.Field;
import
java.util.*
;
@Component
public
class
VehicleSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
<
Map
<
String
,
Object
>>
{
public
class
VehicleSearchDetailDetailHandlerImpl
implements
ISearchDetailHandler
{
private
final
AppCommonMapper
appCommonMapper
;
...
...
@@ -38,17 +39,17 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
}
@Override
public
Map
<
String
,
Object
>
hanlder
(
String
applyNo
,
String
from
)
{
return
this
.
getQueryCarCylinderInfo
(
applyNo
);
public
Map
<
String
,
Object
>
hanlder
(
String
certSeq
,
String
certType
)
{
return
this
.
getQueryCarCylinderInfo
(
certSeq
);
}
private
Map
<
String
,
Object
>
getQueryCarCylinderInfo
(
String
qrCode
)
{
VehicleInfoForWX
baseInfo
=
appCommonMapper
.
queryVehicleBaseInfo
(
qrCode
);
List
<
CylinderInfoForWX
>
cylinderInfos
=
appCommonMapper
.
queryCylinderIfoOfVehicle
(
qrCode
);
private
Map
<
String
,
Object
>
getQueryCarCylinderInfo
(
String
certSeq
)
{
VehicleInfoForWX
baseInfo
=
appCommonMapper
.
queryVehicleBaseInfo
(
certSeq
);
List
<
CylinderInfoForWX
>
cylinderInfos
=
appCommonMapper
.
queryCylinderIfoOfVehicle
(
certSeq
);
fillEquDefine
(
baseInfo
,
cylinderInfos
);
Map
<
String
,
Object
>
result
=
new
LinkedHashMap
<>();
JSONArray
tabs
=
new
JSONArray
();
buildFixFields
(
qrCode
,
baseInfo
,
result
);
buildFixFields
(
baseInfo
,
result
);
buildOneItemTypeMap
(
baseInfo
,
tabs
);
buildManyItemTypeTab
(
cylinderInfos
,
tabs
);
result
.
put
(
"tab"
,
tabs
);
...
...
@@ -59,29 +60,34 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
cylinderInfos
.
forEach
(
c
->
c
.
setEquDefine
(
baseInfo
.
getEquDefine
()));
}
private
void
buildFixFields
(
String
qrCode
,
VehicleInfoForWX
baseInfo
,
Map
<
String
,
Object
>
result
)
{
result
.
putAll
(
getQRCode
(
qrCode
));
result
.
put
(
"unitName"
,
baseInfo
.
getUseUnitName
());
private
void
buildFixFields
(
VehicleInfoForWX
baseInfo
,
Map
<
String
,
Object
>
result
)
{
result
.
put
(
"useUnitName"
,
baseInfo
.
getUseUnitName
());
result
.
put
(
"equList"
,
baseInfo
.
getEquList
());
result
.
put
(
"useRegistrationCode"
,
baseInfo
.
getUseRegistrationCode
());
result
.
put
(
"status"
,
baseInfo
.
getCertificateStatus
());
// 控制颜色 扩展证状态使用
result
.
put
(
"color"
,
"#00FF00"
);
}
private
void
buildManyItemTypeTab
(
List
<
CylinderInfoForWX
>
cylinderInfos
,
JSONArray
tabs
)
{
JSONObject
tab
=
new
JSONObject
();
tab
.
put
(
"title"
,
"气瓶信息"
);
tab
.
put
(
"tabKey"
,
"cylinderInfo"
);
tab
.
put
(
"tabValue"
,
this
.
buildFieldsWithGroup
(
cylinderInfos
));
tab
.
put
(
"isGroup"
,
true
);
tabs
.
add
(
tab
);
}
private
void
buildOneItemTypeMap
(
VehicleInfoForWX
baseInfo
,
JSONArray
tabs
)
{
JSONObject
tab
=
new
JSONObject
();
tab
.
put
(
"title"
,
"基本信息"
);
tab
.
put
(
"tab
Value"
,
this
.
buildFieldsNoGroup
(
baseInfo
)
);
tab
.
put
(
"
isGroup"
,
false
);
tab
.
put
(
"tab
Key"
,
"baseInfo"
);
tab
.
put
(
"
tabValue"
,
this
.
buildFieldsOneGroup
(
baseInfo
)
);
tabs
.
add
(
tab
);
}
private
Object
buildFieldsNoGroup
(
VehicleInfoForWX
baseInfo
)
{
private
JSONArray
buildFieldsOneGroup
(
VehicleInfoForWX
baseInfo
)
{
JSONArray
groupArray
=
new
JSONArray
();
JSONObject
group
=
new
JSONObject
();
JSONArray
fieldArray
=
new
JSONArray
();
Field
[]
fields
=
baseInfo
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
...
...
@@ -92,7 +98,7 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
String
fieldName
=
displayDefine
.
value
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"fieldName"
,
fieldName
);
json
.
put
(
"fieldKey"
,
field
.
getName
());
json
.
put
(
"fieldKey"
,
StringUtils
.
isNotBlank
(
displayDefine
.
alias
())
?
displayDefine
.
alias
()
:
field
.
getName
());
json
.
put
(
"fieldValue"
,
field
.
get
(
baseInfo
));
fieldArray
.
add
(
json
);
}
...
...
@@ -100,7 +106,11 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
throw
new
RuntimeException
(
e
);
}
}
return
fieldArray
;
group
.
put
(
"groupKey"
,
"baseInfo"
);
group
.
put
(
"groupName"
,
""
);
group
.
put
(
"groupValue"
,
fieldArray
);
groupArray
.
add
(
group
);
return
groupArray
;
}
private
Object
buildFieldsWithGroup
(
List
<
CylinderInfoForWX
>
cylinderInfos
)
{
...
...
@@ -117,7 +127,7 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
String
fieldName
=
displayDefine
.
value
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"fieldName"
,
fieldName
);
json
.
put
(
"fieldKey"
,
field
.
getName
());
json
.
put
(
"fieldKey"
,
StringUtils
.
isNotBlank
(
displayDefine
.
alias
())
?
displayDefine
.
alias
()
:
field
.
getName
());
Converter
<
String
>
converter
=
displayDefine
.
converter
().
newInstance
();
if
(
field
.
get
(
cylinderInfo
)
!=
null
){
json
.
put
(
"fieldValue"
,
converter
.
convertToLabelData
((
String
)
field
.
get
(
cylinderInfo
)));
...
...
@@ -130,8 +140,9 @@ public class VehicleSearchDetailDetailHandlerImpl implements ISearchDetailHandle
throw
new
RuntimeException
(
e
);
}
}
group
.
put
(
"groupKey"
,
cylinderInfo
.
getEquCode
());
group
.
put
(
"groupName"
,
String
.
format
(
"气瓶(%s)"
,
cylinderInfo
.
getFactoryNum
()));
group
.
put
(
"group
Fields
"
,
fieldArray
);
group
.
put
(
"group
Value
"
,
fieldArray
);
groupArray
.
add
(
group
);
}
return
groupArray
;
...
...
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/strategy/ISearchDetailHandler.java
View file @
016ed367
...
...
@@ -2,7 +2,7 @@ package com.yeejoin.amos.boot.module.app.biz.strategy;
import
java.util.Map
;
public
interface
ISearchDetailHandler
<
T
extends
Map
<
String
,
Object
>>
{
public
interface
ISearchDetailHandler
{
/**
* 可处理方式
...
...
@@ -16,5 +16,5 @@ public interface ISearchDetailHandler<T extends Map<String, Object>> {
* @param from 来源
* @return T
*/
T
hanlder
(
String
applyNo
,
String
from
);
Map
<
String
,
Object
>
hanlder
(
String
applyNo
,
String
from
);
}
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