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
20c70720
Commit
20c70720
authored
Aug 06, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Plain Diff
feat(jg):更新null值调整
parents
3a71b1f6
cccc4d3d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
615 additions
and
107 deletions
+615
-107
CommonMapper.java
.../yeejoin/amos/boot/module/jg/api/mapper/CommonMapper.java
+1
-0
CommonMapper.xml
...-module-jg-api/src/main/resources/mapper/CommonMapper.xml
+29
-0
JgUseRegistrationMapper.xml
...api/src/main/resources/mapper/JgUseRegistrationMapper.xml
+2
-2
DataHandlerController.java
.../boot/module/jg/biz/controller/DataHandlerController.java
+37
-0
CommonEquipDataProcessService.java
...biz/edit/process/equip/CommonEquipDataProcessService.java
+3
-0
SingleEquipChangeProcess.java
...e/jg/biz/edit/process/equip/SingleEquipChangeProcess.java
+15
-0
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+7
-5
DataHandlerServiceImpl.java
...ot/module/jg/biz/service/impl/DataHandlerServiceImpl.java
+159
-4
EquipClaimServiceImpl.java
...oot/module/jg/biz/service/impl/EquipClaimServiceImpl.java
+0
-0
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+13
-18
JgVehicleInformationServiceImpl.java
.../jg/biz/service/impl/JgVehicleInformationServiceImpl.java
+13
-12
TzsUserInfo.java
...n/amos/boot/module/statistics/api/entity/TzsUserInfo.java
+6
-0
ConditionEnum.java
.../amos/boot/module/statistics/api/enums/ConditionEnum.java
+16
-3
EquipAdvanceSearchEnum.java
...t/module/statistics/api/enums/EquipAdvanceSearchEnum.java
+3
-1
TzsCustomFilterMapper.java
...t/module/statistics/api/mapper/TzsCustomFilterMapper.java
+9
-1
TzsUserInfoVo.java
...oin/amos/boot/module/statistics/api/vo/TzsUserInfoVo.java
+14
-2
TzsCustomFilterMapper.xml
...s-api/src/main/resources/mapper/TzsCustomFilterMapper.xml
+53
-1
ComprehensiveStatisticalAnalysisController.java
...ontroller/ComprehensiveStatisticalAnalysisController.java
+12
-0
JGDPStatisticsController.java
...le/statistcs/biz/controller/JGDPStatisticsController.java
+3
-2
ComprehensiveStatisticalAnalysisServiceImpl.java
...ice/impl/ComprehensiveStatisticalAnalysisServiceImpl.java
+76
-6
DPSubServiceImpl.java
...t/module/statistcs/biz/service/impl/DPSubServiceImpl.java
+41
-4
JGDPStatisticsServiceImpl.java
...statistcs/biz/service/impl/JGDPStatisticsServiceImpl.java
+8
-2
UserBizByTCMServiceImpl.java
...e/statistcs/biz/service/impl/UserBizByTCMServiceImpl.java
+8
-7
equip_8000.json
...le-statistics-biz/src/main/resources/json/equip_8000.json
+2
-1
TzsUserInfoMapper.xml
...e-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
+1
-1
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+20
-14
CategoryOtherInfoMapper.java
...s/boot/module/ymt/api/mapper/CategoryOtherInfoMapper.java
+2
-0
CategoryOtherInfoMapper.xml
...api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
+25
-8
EquipmentCategoryServiceImpl.java
...le/ymt/biz/service/impl/EquipmentCategoryServiceImpl.java
+25
-10
GenerateCodeServiceImpl.java
.../module/ymt/biz/service/impl/GenerateCodeServiceImpl.java
+12
-3
No files found.
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 @
20c70720
...
...
@@ -325,5 +325,6 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
*/
List
<
CountDto
>
countBizNumAfterUseRegBatchProjectContraption
(
@Param
(
"projectContraptionIds"
)
List
<
Long
>
projectContraptionIds
);
List
<
Map
<
String
,
String
>>
gdEquOnJgServiceOperationRecords
(
@Param
(
"record"
)
String
record
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/CommonMapper.xml
View file @
20c70720
...
...
@@ -3131,4 +3131,33 @@
)
group by projectContraptionId
</select>
<select
id=
"gdEquOnJgServiceOperationRecords"
resultType=
"java.util.Map"
>
SELECT
tjri.sequence_nbr AS sequenceNbr,
tjri.business_type AS businessType,
tjri.apply_no AS applyNo,
tjri.rec_user_id AS recUserId,
tjri.rec_user_name AS recUserName,
DATE_FORMAT ( rec_date, '%Y-%m-%d %H:%i:%s' ) AS recDate,
tjri.approval_unit AS approvalUnit,
tjri.status,
tjri.route_path AS routePath
FROM
tzs_jg_resume_info tjri
JOIN (
SELECT tjri2.apply_no,
MAX ( tjri2.rec_date ) AS max_rec_date
FROM
tzs_jg_resume_info
tjri2 LEFT JOIN tzs_jg_installation_notice tjin ON tjri2.equ_id = tjin.project_contraption_id
LEFT JOIN tzs_jg_installation_notice_eq tjineq ON tjin.sequence_nbr = tjineq.equip_transfer_id
WHERE
tjineq.equ_id = 'c005586e-0065-4ee8-b89a-5fcad85d4868'
GROUP BY
tjri2.apply_no
) AS latest ON tjri.apply_no = latest.apply_no
AND tjri.rec_date = latest.max_rec_date
ORDER BY
tjri.rec_date ASC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgUseRegistrationMapper.xml
View file @
20c70720
...
...
@@ -213,7 +213,7 @@
<select
id=
"getListPage"
resultType=
"java.util.Map"
>
SELECT * FROM (
-- 查询 equListCode = '8000' 的情况
-- 查询 equListCode
!
= '8000' 的情况
SELECT *
FROM (
<include
refid=
"page-list-sub-select"
/>
...
...
@@ -291,7 +291,7 @@
</where>
UNION ALL
-- 查询 equListCode
!
= '8000' 的情况
-- 查询 equListCode
=
= '8000' 的情况
SELECT *
FROM (
<include
refid=
"page-list-sub-pipline"
/>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/DataHandlerController.java
View file @
20c70720
...
...
@@ -283,4 +283,40 @@ public class DataHandlerController extends BaseController {
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
initFactoryCarNumber2Es
());
}
/**
* @apiNote 删除ES和数据库中状态≠已认领的设备
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"删除ES和数据库中状态≠已认领的设备(备份后谨慎操作,不可恢复)"
,
notes
=
"删除ES和数据库中状态≠已认领的设备(备份后谨慎操作,不可恢复)"
)
@PutMapping
(
value
=
"/equip/deleteEquipWithStatusNotInClaimed"
)
public
ResponseModel
<
Integer
>
deleteEquipWithStatusNotInClaimed
(
@RequestParam
(
value
=
"indices"
,
defaultValue
=
"idx_biz_view_jg_all"
)
String
indices
,
@RequestParam
(
value
=
"isDelete"
,
defaultValue
=
"false"
)
boolean
isDelete
)
throws
InterruptedException
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
deleteEquipWithStatusNotInClaimed
(
indices
,
isDelete
));
}
/**
* @apiNote 删除数据库中状态≠已认领的设备
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"删除数据库中状态≠已认领的设备"
,
notes
=
"删除数据库中状态≠已认领的设备"
)
@PutMapping
(
value
=
"/equip/deleteEquipExistDB"
)
public
ResponseModel
<
Integer
>
deleteEquipExistDB
(
@RequestParam
(
value
=
"isDelete"
,
defaultValue
=
"false"
)
boolean
isDelete
)
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
deleteEquipExistDB
(
isDelete
));
}
/**
* @apiNote 修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据"
,
notes
=
"修改SupervisionInfo中ORG_BRANCH_CODE=%50*X%的数据"
)
@PutMapping
(
value
=
"/equip/deleteEquipExistDB"
)
public
ResponseModel
<
Integer
>
deleteEquipExistDB2
(
@RequestParam
(
value
=
"isDelete"
,
defaultValue
=
"false"
)
boolean
isDelete
)
{
return
ResponseHelper
.
buildResponse
(
dataHandlerService
.
deleteEquipExistDB
(
isDelete
));
}
}
\ 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/edit/process/equip/CommonEquipDataProcessService.java
View file @
20c70720
...
...
@@ -786,6 +786,9 @@ public class CommonEquipDataProcessService {
IdxBizJgConstructionInfo
constructionInfo
=
jgUseRegistrationService
.
getIdxBizJgConstructionInfoService
().
queryNewestDetailByRecord
(
record
);
BaseTechParamsFieldDto
techParamsFieldDto
=
this
.
buildTechParamInfo
(
registerInfo
,
record
);
re
.
putAll
(
BeanUtil
.
beanToMap
(
useInfo
));
// 移除useInfo中的施工(安装)单位code和name,避免对constructionInfo数据产生影响
re
.
remove
(
"USC_UNIT_NAME"
);
re
.
remove
(
"USC_UNIT_CREDIT_CODE"
);
re
.
putAll
(
BeanUtil
.
beanToMap
(
registerInfo
));
re
.
putAll
(
BeanUtil
.
beanToMap
(
factoryInfo
));
re
.
putAll
(
BeanUtil
.
beanToMap
(
otherInfo
));
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/process/equip/SingleEquipChangeProcess.java
View file @
20c70720
...
...
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao
;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.common.BizCommonConstant
;
import
com.yeejoin.amos.boot.module.jg.api.dto.FieldChangeMeta
;
...
...
@@ -32,6 +34,7 @@ import java.io.IOException;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
/**
* 单个维护设备-策略实现类
...
...
@@ -48,6 +51,8 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
private
final
RestHighLevelClient
restHighLevelClient
;
private
final
EsEquipmentDao
esEquipmentDao
;
@Override
public
HandleResult
handle
(
Map
<
String
,
Object
>
changeData
,
String
record
)
{
...
...
@@ -149,6 +154,16 @@ public class SingleEquipChangeProcess implements IEquipChangeDataProcessStrategy
esUpdateService
.
updateEsData
(
record
,
factoryInfoNew
);
esUpdateService
.
updateEsData
(
record
,
idxBizJgSupervisionInfoNew
);
if
(
"50*X"
.
equals
(
idxBizJgSupervisionInfoOld
.
getOrgBranchCode
())
&&
!
"50*X"
.
equals
(
idxBizJgSupervisionInfoNew
.
getOrgBranchCode
())){
Optional
<
ESEquipmentInfo
>
esEquipmentDto
=
esEquipmentDao
.
findById
(
record
);
if
(
esEquipmentDto
.
isPresent
())
{
ESEquipmentInfo
esEquipmentInfo
=
esEquipmentDto
.
get
();
esEquipmentInfo
.
setORG_BRANCH_CODE
(
idxBizJgSupervisionInfoNew
.
getOrgBranchCode
());
esEquipmentInfo
.
setORG_BRANCH_NAME
(
idxBizJgSupervisionInfoNew
.
getOrgBranchName
());
esEquipmentDao
.
save
(
esEquipmentInfo
);
}
}
// 如果是气瓶则按照证更新其他同证下的气瓶字段
this
.
updateOtherEquipInSameCert
(
useInfoNew
,
registerInfoNew
,
registerInfoOld
,
allChangeColumns
);
// 设备技术参数入库处理
...
...
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 @
20c70720
...
...
@@ -2506,12 +2506,14 @@ public class CommonServiceImpl implements ICommonService {
// equips.stream().mapToDouble(e -> Optional.ofNullable(e.get("nominalWorkingPressure")).map(v -> Double.valueOf(v.toString())).orElse(0.0)).sum()
formData
.
put
(
"workPressure"
,
equips
.
stream
().
mapToDouble
(
e
->
Optional
.
ofNullable
(
e
.
get
(
"nominalWorkingPressure"
)).
map
(
v
->
Double
.
valueOf
(
v
.
toString
())).
orElse
(
0.0
)).
max
().
getAsDouble
());
formData
.
put
(
"volume"
,
equips
.
stream
().
mapToDouble
(
e
->
Optional
.
ofNullable
(
e
.
get
(
"singleBottleVolume"
)).
map
(
v
->
Double
.
valueOf
(
v
.
toString
())).
orElse
(
0.0
)).
sum
());
// BUG 30344 【生产问题】车用气瓶使用登记时,同一车辆可以选择多个充装介质不同的气瓶发起使用登记
Set
<
String
>
chargingMedium
=
equips
.
stream
().
map
(
e
->
String
.
valueOf
(
e
.
get
(
"chargingMedium"
))).
collect
(
Collectors
.
toSet
());
if
(
chargingMedium
.
size
()
>
1
)
{
throw
new
BadRequest
(
"充装介质仅可选择同一类型"
);
}
else
{
formData
.
put
(
"chargingMedium"
,
equips
.
get
(
0
).
get
(
"chargingMedium"
));
}
formData
.
put
(
"chargingMedium"
,
String
.
join
(
","
,
chargingMedium
));
// if (chargingMedium.size() > 1) {
// throw new BadRequest("充装介质仅可选择同一类型");
// } else {
// formData.put("chargingMedium", equips.get(0).get("chargingMedium"));
// }
}
}
...
...
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/DataHandlerServiceImpl.java
View file @
20c70720
...
...
@@ -54,6 +54,8 @@ import lombok.RequiredArgsConstructor;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -61,19 +63,18 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.util.StopWatch
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.lang.reflect.Method
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.sql.Timestamp
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.util.*
;
import
java.util.concurrent.
ConcurrentHashMap
;
import
java.util.concurrent.
*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
toJSONString
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE
;
import
static
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
.
JgInstallationNoticeServiceImpl
.
CONSTRUCTION_TYPE_NAME
;
...
...
@@ -85,7 +86,12 @@ import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNot
@Service
@RequiredArgsConstructor
public
class
DataHandlerServiceImpl
{
public
static
final
String
IDX_BIZ_VIEW_JG_ALL
=
"idx_biz_view_jg_all"
;
public
static
final
String
IDX_BIZ_EQUIPMENT_INFO
=
"idx_biz_equipment_info"
;
public
static
final
String
STATUS
=
"STATUS"
;
public
static
final
String
record
=
"record"
;
public
static
final
String
SEQUENCE_NBR
=
"SEQUENCE_NBR"
;
private
static
final
int
BATCH_SIZE
=
1000
;
private
final
ObjectMapper
objectMapper
;
private
final
JgRegistrationHistoryServiceImpl
registrationHistoryService
;
private
final
JgInstallationNoticeServiceImpl
installationNoticeService
;
...
...
@@ -147,6 +153,12 @@ public class DataHandlerServiceImpl {
@Value
(
"${jyjc.open.online: true}"
)
private
Boolean
onlineJyjc
;
private
final
JgUseRegistrationManageServiceImpl
registrationManageService
;
private
final
SuperviseInfoMapper
superviseInfoMapper
;
private
final
IdxBizJgOtherInfoMapper
otherInfoMapper
;
/**
* 安装告知压力管道历史数据修复-详情中的设备列表修改为汇总表格式
...
...
@@ -1828,4 +1840,147 @@ public class DataHandlerServiceImpl {
watch
.
stop
();
log
.
info
(
"增量添加ORG_BRANCH_CODE为50X综合搜索数据-设备信息入库结束,耗时:{}秒"
,
watch
.
getTotalTimeSeconds
());
}
public
Integer
deleteEquipWithStatusNotInClaimed
(
String
indices
,
boolean
isDelete
)
throws
InterruptedException
{
if
(!
Arrays
.
asList
(
IDX_BIZ_VIEW_JG_ALL
,
IDX_BIZ_EQUIPMENT_INFO
).
contains
(
indices
))
{
throw
new
IllegalArgumentException
(
"非法索引名,只允许使用 idx_biz_view_jg_all 或 idx_biz_equipment_info"
);
}
List
<?>
esList
;
List
<
String
>
records
;
if
(
IDX_BIZ_VIEW_JG_ALL
.
equals
(
indices
))
{
esList
=
queryUnclaimedEquipments
(
indices
,
ESEquipmentCategoryDto
.
class
);
}
else
{
esList
=
queryUnclaimedEquipments
(
indices
,
ESEquipmentInfo
.
class
);
}
if
(
CollectionUtils
.
isEmpty
(
esList
))
{
return
0
;
}
records
=
extractSequenceNbr
(
esList
);
if
(
records
.
isEmpty
())
{
return
0
;
}
if
(
isDelete
)
{
List
<
String
>
successDeleteList
=
Collections
.
synchronizedList
(
new
ArrayList
<>());
List
<
List
<
String
>>
allDataList
=
Lists
.
partition
(
records
,
BATCH_SIZE
);
ExecutorService
executor
=
new
ThreadPoolExecutor
(
10
,
// 核心线程数
20
,
// 最大线程数
60L
,
TimeUnit
.
SECONDS
,
new
LinkedBlockingQueue
<>(
1000
),
// 队列最多允许1000个任务
Executors
.
defaultThreadFactory
(),
new
ThreadPoolExecutor
.
CallerRunsPolicy
()
// 拒绝策略(可换成其他)
);
CountDownLatch
latch
=
new
CountDownLatch
(
allDataList
.
size
());
for
(
List
<
String
>
batch
:
allDataList
)
{
executor
.
submit
(()
->
{
try
{
superviseInfoMapper
.
deleteDataAll
(
batch
);
successDeleteList
.
addAll
(
batch
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批次删除失败: {}"
,
batch
,
e
);
}
finally
{
latch
.
countDown
();
}
});
}
latch
.
await
();
executor
.
shutdown
();
if
(!
successDeleteList
.
isEmpty
())
{
List
<?>
successEsList
=
esList
.
stream
()
.
filter
(
e
->
successDeleteList
.
contains
(
getSequenceNbr
(
e
)))
.
collect
(
Collectors
.
toList
());
if
(
IDX_BIZ_VIEW_JG_ALL
.
equals
(
indices
))
{
esEquipmentCategory
.
deleteAll
((
List
<
ESEquipmentCategoryDto
>)
successEsList
);
}
else
{
esEquipmentDao
.
deleteAll
((
List
<
ESEquipmentInfo
>)
successEsList
);
}
}
return
successDeleteList
.
size
();
}
return
records
.
size
();
}
private
String
getSequenceNbr
(
Object
e
)
{
try
{
if
(
e
instanceof
ESEquipmentCategoryDto
)
{
return
((
ESEquipmentCategoryDto
)
e
).
getSEQUENCE_NBR
();
}
else
if
(
e
instanceof
ESEquipmentInfo
)
{
return
((
ESEquipmentInfo
)
e
).
getSEQUENCE_NBR
();
}
}
catch
(
Exception
ex
)
{
log
.
warn
(
"无法获取sequenceNbr: {}"
,
e
,
ex
);
}
return
null
;
}
private
<
T
>
List
<
T
>
queryUnclaimedEquipments
(
String
index
,
Class
<
T
>
clazz
)
{
BoolQueryBuilder
boolQuery
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
statusFilter
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
termQuery
(
STATUS
,
"已认领"
)))
.
should
(
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
existsQuery
(
STATUS
)))
.
should
(
QueryBuilders
.
termQuery
(
STATUS
,
""
))
.
minimumShouldMatch
(
1
);
boolQuery
.
must
(
statusFilter
);
try
{
return
registrationManageService
.
searchResponse
(
index
,
boolQuery
,
hit
->
{
JSONObject
json
=
JSONObject
.
parseObject
(
hit
.
getSourceAsString
(),
JSONObject
.
class
);
json
.
put
(
SEQUENCE_NBR
,
Objects
.
toString
(
json
.
get
(
SEQUENCE_NBR
),
""
));
return
json
.
toJavaObject
(
clazz
);
}
);
}
catch
(
Exception
ex
)
{
log
.
error
(
"查询未认领设备异常:"
,
ex
);
return
Collections
.
emptyList
();
}
}
private
<
T
>
List
<
String
>
extractSequenceNbr
(
List
<
T
>
list
)
{
return
list
.
stream
()
.
map
(
item
->
{
try
{
Method
method
=
item
.
getClass
().
getMethod
(
"getSEQUENCE_NBR"
);
Object
value
=
method
.
invoke
(
item
);
return
Objects
.
toString
(
value
,
null
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"反射获取 SEQUENCE_NBR 失败"
,
e
);
return
null
;
}
})
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
}
public
Integer
deleteEquipExistDB
(
boolean
isDelete
)
{
LambdaQueryWrapper
<
IdxBizJgOtherInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
select
(
IdxBizJgOtherInfo:
:
getRecord
)
.
notIn
(
IdxBizJgOtherInfo:
:
getClaimStatus
,
"已认领"
,
""
);
List
<
IdxBizJgOtherInfo
>
jgOtherInfos
=
otherInfoMapper
.
selectList
(
wrapper
);
if
(
CollectionUtils
.
isEmpty
(
jgOtherInfos
))
{
return
0
;
}
List
<
String
>
records
=
jgOtherInfos
.
stream
()
.
map
(
IdxBizJgOtherInfo:
:
getRecord
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toList
());
if
(!
records
.
isEmpty
()
&&
isDelete
)
{
superviseInfoMapper
.
deleteDataAll
(
records
);
}
return
records
.
size
();
}
}
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/EquipClaimServiceImpl.java
View file @
20c70720
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/JgUseRegistrationServiceImpl.java
View file @
20c70720
...
...
@@ -1807,18 +1807,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 新增页面选择无设备代码后,在审批通过后自动生成设备代码
this
.
justGenerateEquCode
(
lambda
,
registerInfo
,
jgUseRegistration
.
getReceiveCompanyCode
(),
mapData
,
jgRegistrationHistory
);
idxBizJgRegisterInfoService
.
update
(
lambda
);
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
())
.
businessId
(
jgUseRegistration
.
getSequenceNbr
()
+
""
)
.
equId
((
String
)
mapData
.
get
(
"equipId"
))
.
approvalUnit
(
jgUseRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgUseRegistration
.
getReceiveCompanyCode
())
.
changeContent
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
status
(
"正常"
)
.
routePath
(
taskV2Model
.
getRoutePath
())
.
build
());
}
jgResumeInfoService
.
createWithModel
(
JgResumeInfoDto
.
builder
()
.
applyNo
(
jgUseRegistration
.
getApplyNo
())
.
businessType
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
())
.
businessId
(
jgUseRegistration
.
getSequenceNbr
()
+
""
)
.
equId
((
String
)
mapData
.
get
(
"equipId"
))
.
approvalUnit
(
jgUseRegistration
.
getReceiveOrgName
())
.
approvalUnitCode
(
jgUseRegistration
.
getReceiveCompanyCode
())
.
changeContent
(
BusinessTypeEnum
.
JG_USAGE_REGISTRATION
.
getName
()
+
"业务办理"
)
.
status
(
"正常"
)
.
routePath
(
taskV2Model
.
getRoutePath
())
.
build
());
}
// 使用信息
LambdaQueryWrapper
<
IdxBizJgUseInfo
>
lambda
=
new
QueryWrapper
<
IdxBizJgUseInfo
>().
lambda
();
...
...
@@ -4325,13 +4325,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.
map
(
parts
->
parts
[
1
])
.
orElse
(
null
));
useInfo
.
setPhone
(
String
.
valueOf
(
map
.
get
(
"phone"
)));
useInfo
.
setSafetyManager
(
String
.
valueOf
(
Optional
.
ofNullable
(
map
.
get
(
"safetyManager"
))
.
map
(
Object:
:
toString
)
.
filter
(
s
->
s
.
contains
(
"_"
))
.
map
(
s
->
s
.
split
(
"_"
,
2
))
.
filter
(
parts
->
parts
.
length
==
2
)
.
map
(
parts
->
parts
[
0
])
.
orElse
(
null
)));
useInfo
.
setSafetyManager
(
map
.
getString
(
"safetyManagerName"
));
useInfo
.
setSafetyManagerId
(
map
.
getString
(
"safetyManagerId"
));
useInfo
.
setUseDate
(
String
.
valueOf
(
map
.
get
(
"useDate"
)));
useInfo
.
setLongitudeLatitude
(
JSON
.
toJSONString
(
map
.
get
(
"longitudeLatitude"
)));
useInfo
.
setUsePlace
((
String
)
map
.
get
(
"usePlace"
));
...
...
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 @
20c70720
...
...
@@ -236,9 +236,9 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submit
))
{
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
||
equipmentLists
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
!=
1
)
{
throw
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!
"
);
// 不限制一个车只能使用一个充装介质的气瓶
if
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
)
{
throw
new
BadRequest
(
"请选择设备信息!
"
);
}
// 检查设备是否已经在使用
// 个人主体的身份证(6600_620422199903010258) 特殊处理 只取_后的身份证号码
...
...
@@ -1144,13 +1144,12 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 更新设备监管部门
IdxBizJgSupervisionInfo
idxBizJgSupervisionInfo
=
new
IdxBizJgSupervisionInfo
();
if
(
map
.
containsKey
(
"orgBranchCode"
)
&&
!
ObjectUtils
.
isEmpty
(
map
.
get
(
"orgBranchCode"
)))
{
String
[]
data
=
String
.
valueOf
(
map
.
getString
(
"orgBranchCode"
)).
split
(
"_"
);
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
data
[
0
]).
getResult
();
if
(!
ObjectUtils
.
isEmpty
(
jgVehicleInformation
.
getOrgBranchCode
()))
{
HashMap
<
String
,
Object
>
parentMessage
=
(
HashMap
<
String
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
jgVehicleInformation
.
getOrgBranchCode
()).
getResult
();
// 目前平台返回key为compnay(存在拼写错误)
CompanyModel
parentModel
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
parentMessage
.
get
(
"compnay"
)),
CompanyModel
.
class
);
idxBizJgSupervisionInfo
.
setOrgBranchCode
(
data
[
0
]
);
idxBizJgSupervisionInfo
.
setOrgBranchName
(
data
[
1
]
);
idxBizJgSupervisionInfo
.
setOrgBranchCode
(
jgVehicleInformation
.
getOrgBranchCode
()
);
idxBizJgSupervisionInfo
.
setOrgBranchName
(
jgVehicleInformation
.
getOrgBranchName
()
);
idxBizJgSupervisionInfo
.
setCompanyOrgBranchCode
(
parentModel
.
getCompanyCode
());
LambdaQueryWrapper
<
IdxBizJgSupervisionInfo
>
eq
=
new
QueryWrapper
<
IdxBizJgSupervisionInfo
>().
lambda
().
eq
(
IdxBizJgSupervisionInfo:
:
getRecord
,
map
.
get
(
"record"
));
idxBizJgSupervisionInfoMapper
.
update
(
idxBizJgSupervisionInfo
,
eq
);
...
...
@@ -1878,10 +1877,11 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.
convertValue
(
map
.
get
(
"equipmentLists"
),
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
// 设备列表判空 + 选择同一充装介质的设备
// 20250801修改为不限制一个车只能使用一个充装介质的气瓶
Optional
.
ofNullable
(
equipmentLists
)
.
filter
(
list
->
!
list
.
isEmpty
())
.
filter
(
list
->
list
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
==
1
)
.
orElseThrow
(()
->
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!
"
));
//
.filter(list -> list.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() == 1)
.
orElseThrow
(()
->
new
BadRequest
(
"请选择设备信息!
"
));
// 确保车用气瓶使用信息中填写的【使用登记证编号】【车辆VIN】与列表所选择设备的一致
Optional
.
of
(
equipmentLists
)
.
filter
(
eqLists
->
{
...
...
@@ -2230,10 +2230,11 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()))
+
""
,
ReginParams
.
class
);
JgVehicleInformationDto
vehicleInfoDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
JgVehicleInformationDto
.
class
);
List
<
Map
<
String
,
Object
>>
equipmentLists
=
(
List
<
Map
<
String
,
Object
>>)
map
.
get
(
"equipmentLists"
);
// 20250801修改为不限制一个车只能使用一个充装介质的气瓶
Optional
.
ofNullable
(
equipmentLists
)
.
filter
(
list
->
!
list
.
isEmpty
())
.
filter
(
list
->
list
.
stream
().
map
(
v
->
(
String
)
v
.
get
(
"chargingMedium"
)).
distinct
().
count
()
==
1
)
.
orElseThrow
(()
->
new
BadRequest
(
CollectionUtils
.
isEmpty
(
equipmentLists
)
?
"请选择设备信息!"
:
"请选择相同充装介质设备!
"
));
//
.filter(list -> list.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() == 1)
.
orElseThrow
(()
->
new
BadRequest
(
"请选择设备信息!
"
));
CompanyBo
company
=
reginParams
.
getCompany
();
vehicleInfoDto
.
setCreateDate
(
new
Date
());
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/entity/TzsUserInfo.java
View file @
20c70720
...
...
@@ -230,4 +230,10 @@ public class TzsUserInfo extends BaseEntity {
*/
@TableField
(
value
=
"create_date"
)
protected
Date
createDate
;
@TableField
(
value
=
"practice_registration"
)
private
String
practiceRegistration
;
@TableField
(
value
=
"labor_contract"
)
private
String
laborContract
;
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/ConditionEnum.java
View file @
20c70720
...
...
@@ -27,9 +27,9 @@ public enum ConditionEnum {
dateLt
(
"小于"
,
"lt"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateGe
(
"大于等于"
,
"gte"
,
TechnicalParameter
.
ParamType
.
DATE
),
dateLe
(
"小于等于"
,
"lte"
,
TechnicalParameter
.
ParamType
.
DATE
),
in
(
"包含"
,
"in"
,
null
),
notIn
(
"不包含"
,
"notIn"
,
null
),
eq
(
"等于"
,
"eq"
,
null
),
in
(
"包含"
,
"in"
,
null
),
notIn
(
"不包含"
,
"notIn"
,
null
),
eq
(
"等于"
,
"eq"
,
null
),
;
...
...
@@ -49,4 +49,17 @@ public enum ConditionEnum {
}
return
jsonArray
;
}
public
static
JSONArray
getByCode
(
String
code
,
TechnicalParameter
.
ParamType
paramType
)
{
JSONArray
jsonArray
=
new
JSONArray
();
for
(
ConditionEnum
value
:
values
())
{
if
(
value
.
code
==
code
&&
value
.
paramType
==
paramType
)
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"label"
,
value
.
name
);
jsonObject
.
put
(
"value"
,
value
.
code
);
jsonArray
.
add
(
jsonObject
);
}
}
return
jsonArray
;
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/enums/EquipAdvanceSearchEnum.java
View file @
20c70720
...
...
@@ -87,8 +87,10 @@ public enum EquipAdvanceSearchEnum {
if
(
"技术参数"
.
equals
(
item
.
name
))
{
jsonObject
.
put
(
"type"
,
"select2"
);
jsonObject
.
put
(
"method"
,
"POST"
);
jsonObject
.
put
(
"conditions"
,
ConditionEnum
.
getByCode
(
"eq"
,
item
.
paramType
));
}
else
{
jsonObject
.
put
(
"conditions"
,
ConditionEnum
.
getByCode
(
item
.
paramType
));
}
jsonObject
.
put
(
"conditions"
,
ConditionEnum
.
getByCode
(
item
.
paramType
));
jsonObject
.
put
(
"url"
,
item
.
url
);
jsonArray
.
add
(
jsonObject
);
}
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/mapper/TzsCustomFilterMapper.java
View file @
20c70720
...
...
@@ -25,7 +25,15 @@ public interface TzsCustomFilterMapper extends BaseMapper<TzsCustomFilter> {
JSONArray
queryEquCategory
(
@Param
(
"type"
)
String
type
,
@Param
(
"description"
)
String
description
);
Page
<
String
>
selectRecords
(
Page
<
String
>
page
);
Page
<
String
>
selectGasRecords
(
Page
<
String
>
page
);
List
<
String
>
selectRecords
(
@Param
(
"code"
)
String
code
,
@Param
(
"limit"
)
long
limit
);
void
addGas
(
@Param
(
"refreshRecords"
)
List
<
String
>
refreshRecords
);
Integer
selectRecordCount
(
String
code
);
void
setOrgBranchCodeIsNullByRecords
(
@Param
(
"records"
)
List
<
String
>
records
);
void
updateOrgBranchCodeByRecords
(
@Param
(
"dataList"
)
List
<
Map
<
String
,
Object
>>
dataList
);
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/java/com/yeejoin/amos/boot/module/statistics/api/vo/TzsUserInfoVo.java
View file @
20c70720
package
com
.
yeejoin
.
amos
.
boot
.
module
.
statistics
.
api
.
vo
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
TzsUserInfoVo
{
/**
* 主键
*/
@TableId
(
value
=
"sequence_nbr"
)
protected
Long
sequenceNbr
;
/**
* 姓名
*/
@TableField
(
"name"
)
...
...
@@ -119,6 +124,13 @@ public class TzsUserInfoVo {
*/
@TableField
(
"unit_name"
)
private
String
unitName
;
/**
* 单位code
*/
@TableField
(
"unit_code"
)
private
String
unitCode
;
/**
* 头像
*/
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-api/src/main/resources/mapper/TzsCustomFilterMapper.xml
View file @
20c70720
...
...
@@ -34,7 +34,7 @@
<select
id=
"selectEquipmentCategoryCountByParentId"
resultType=
"java.lang.Integer"
>
select count(1) from tz_equipment_category where is_delete = 0 and parent_id = #{parentId}
</select>
<select
id=
"selectRecords"
resultType=
"java.lang.String"
>
<select
id=
"select
Gas
Records"
resultType=
"java.lang.String"
>
SELECT
ibjui."RECORD"
FROM
...
...
@@ -50,6 +50,58 @@
AND "CLAIM_STATUS" = '已认领'
order by ibjui."RECORD" desc
</select>
<select
id=
"selectRecords"
resultType=
"java.lang.String"
>
SELECT
ibjsi."RECORD"
FROM
amos_tzs_biz.idx_biz_jg_supervision_info ibjsi
LEFT JOIN amos_tzs_biz.idx_biz_jg_register_info ibjri ON ibjsi."RECORD" = ibjri."RECORD"
WHERE
"ORG_BRANCH_CODE" = '50*X'
<if
test=
"code != '2300'"
>
AND ibjri."EQU_LIST" = #{code}
<if
test=
"code == '2000'"
>
AND ibjri."EQU_CATEGORY" != '2300'
</if>
</if>
<if
test=
"code == '2300'"
>
AND ibjri."EQU_CATEGORY" = #{code}
</if>
limit #{limit}
</select>
<select
id=
"selectRecordCount"
resultType=
"java.lang.Integer"
>
SELECT
count(1)
FROM
amos_tzs_biz.idx_biz_jg_supervision_info ibjsi
LEFT JOIN amos_tzs_biz.idx_biz_jg_register_info ibjri ON ibjsi."RECORD" = ibjri."RECORD"
WHERE
"ORG_BRANCH_CODE" = '50*X'
<if
test=
"code != '2300'"
>
AND ibjri."EQU_LIST" = #{code}
<if
test=
"code == '2000'"
>
AND ibjri."EQU_CATEGORY" != '2300'
</if>
</if>
<if
test=
"code == '2300'"
>
AND ibjri."EQU_CATEGORY" = #{code}
</if>
</select>
<update
id=
"setOrgBranchCodeIsNullByRecords"
>
update amos_tzs_biz.idx_biz_jg_supervision_info set "ORG_BRANCH_CODE" = null where "RECORD" in
<foreach
collection=
"records"
separator=
","
item=
"record"
open=
"("
close=
");"
>
#{record}
</foreach>
</update>
<update
id=
"updateOrgBranchCodeByRecords"
>
<foreach
collection=
"dataList"
item=
"data"
separator=
";"
>
update amos_tzs_biz.idx_biz_jg_supervision_info
set "ORG_BRANCH_CODE" = #{data.orgBranchCode}
where "RECORD" = #{data.record}
</foreach>
</update>
<insert
id=
"addGas"
>
INSERT INTO "amos_tzs_biz"."idx_biz_jg_supervision_info" ("SEQUENCE_NBR", "RECORD")
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/ComprehensiveStatisticalAnalysisController.java
View file @
20c70720
...
...
@@ -496,4 +496,16 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
public
ResponseModel
<
JSONArray
>
queryInspectionDate
()
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
queryInspectionDate
());
}
/**
* @param
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/updateDataByOrgBranchCode"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"修改ORG_BRANCH_CODE为50*X综合搜索数据-设备"
,
notes
=
"修改ORG_BRANCH_CODE为50*X综合搜索数据-设备"
)
public
ResponseModel
<
Object
>
updateDataByOrgBranchCode
(
@RequestParam
(
value
=
"code"
)
String
code
,
@RequestParam
(
value
=
"limit"
)
Integer
limit
)
{
return
ResponseHelper
.
buildResponse
(
statisticalAnalysisService
.
updateDataByOrgBranchCode
(
code
,
limit
));
}
}
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/controller/JGDPStatisticsController.java
View file @
20c70720
...
...
@@ -432,8 +432,9 @@ public class JGDPStatisticsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"common/equOnJgServiceOperationRecords"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询设备在jg业务中的记录"
,
notes
=
"查询设备在jg业务中的记录"
)
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
equOnJgServiceOperationRecords
(
@RequestParam
(
value
=
"record"
)
String
record
)
{
return
ResponseHelper
.
buildResponse
(
statisticsService
.
equOnJgServiceOperationRecords
(
record
));
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
equOnJgServiceOperationRecords
(
@RequestParam
(
value
=
"record"
)
String
record
,
@RequestParam
(
value
=
"equipType"
,
required
=
false
)
String
equipType
)
{
return
ResponseHelper
.
buildResponse
(
statisticsService
.
equOnJgServiceOperationRecords
(
record
,
equipType
));
}
/**
...
...
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/ComprehensiveStatisticalAnalysisServiceImpl.java
View file @
20c70720
...
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import
com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RequestContextWrapper
;
import
com.yeejoin.amos.boot.module.common.api.dao.EsEquipmentDao
;
import
com.yeejoin.amos.boot.module.common.api.dto.TechParamItem
;
import
com.yeejoin.amos.boot.module.common.api.entity.ESEquipmentInfo
;
import
com.yeejoin.amos.boot.module.common.api.enums.UnitTypeNewEnum
;
...
...
@@ -126,6 +127,8 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
final
String
or
=
"or"
;
private
final
String
and
=
"and"
;
private
final
EsEquipmentDao
esEquipmentDao
;
private
final
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
Runtime
.
getRuntime
().
availableProcessors
());
...
...
@@ -1656,11 +1659,17 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
private
void
addTechParam
(
JSONObject
techParam
,
JSONObject
paramRange
,
EnhancedDynamicQueryBuilder
builder
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
techParam
));
JSONObject
js
=
(
JSONObject
)
jsonObject
.
get
(
"value"
);
String
field
=
js
.
getString
(
"value
"
);
String
field
=
jsonObject
.
getString
(
"value"
);
JSONObject
js
=
(
JSONObject
)
jsonObject
.
get
(
"skillConfig
"
);
String
fieldType
=
js
.
getString
(
"fieldType"
);
String
itemCondition
=
paramRange
.
getString
(
"itemCondition"
);
Object
value
=
paramRange
.
get
(
"value"
);
Object
value
=
null
;
if
(
paramRange
.
get
(
"value"
)
instanceof
JSONObject
)
{
JSONObject
jsValue
=
(
JSONObject
)
paramRange
.
get
(
"value"
);
value
=
jsValue
.
get
(
"value"
);
}
else
{
value
=
paramRange
.
get
(
"value"
);
}
String
andOr
=
paramRange
.
getString
(
"andOr"
);
getParamQuery
(
field
,
itemCondition
,
value
,
fieldType
,
true
,
null
,
builder
,
andOr
);
}
...
...
@@ -1894,7 +1903,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
builder
.
add
(
existsQuery
,
and
);
}
}
}
else
if
(
field
.
equals
(
"issueDate"
))
{
}
else
if
(
field
.
equals
(
"issueDate"
))
{
BoolQueryBuilder
query
=
QueryBuilders
.
boolQuery
();
switch
(
itemCondition
)
{
case
"eq"
:
...
...
@@ -2807,7 +2816,6 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
public
JSONArray
queryTypeZYXM
(
String
type
)
{
JSONArray
result
=
new
JSONArray
();
if
(
"特种设备安全管理和作业人员证"
.
equals
(
type
))
{
...
...
@@ -4035,7 +4043,7 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
for
(
int
j
=
0
;
j
<=
times
;
j
++)
{
recordDtoPage
.
setCurrent
(
j
+
1
);
recordDtoPage
.
setSize
(
5000
);
Page
<
String
>
refreshRecords
=
tzsCustomFilterMapper
.
selectRecords
(
recordDtoPage
);
Page
<
String
>
refreshRecords
=
tzsCustomFilterMapper
.
select
Gas
Records
(
recordDtoPage
);
if
(!
ObjectUtils
.
isEmpty
(
refreshRecords
)
&&
refreshRecords
.
getRecords
().
size
()
>
0
)
{
total
+=
refreshRecords
.
getRecords
().
size
();
tzsCustomFilterMapper
.
addGas
(
refreshRecords
.
getRecords
());
...
...
@@ -4043,4 +4051,65 @@ public class ComprehensiveStatisticalAnalysisServiceImpl {
}
return
total
;
}
public
Object
updateDataByOrgBranchCode
(
String
code
,
Integer
limit
)
{
SearchRequest
request
=
new
SearchRequest
();
request
.
indices
(
StatisticalAnalysisEnum
.
equip
.
getKey
());
SearchSourceBuilder
builder
=
new
SearchSourceBuilder
();
builder
.
trackTotalHits
(
true
);
BoolQueryBuilder
boolMust
=
QueryBuilders
.
boolQuery
();
// 1、从数据库查询对应设备类型下50*X得数据record
Integer
count
=
tzsCustomFilterMapper
.
selectRecordCount
(
code
);
if
(
count
==
0
)
{
return
"数据库中该数据分类下无需要修改的数据"
;
}
limit
=
count
>
limit
?
limit
:
count
;
List
<
String
>
records
=
tzsCustomFilterMapper
.
selectRecords
(
code
,
limit
);
// 2、从es中查询对应record的数据
boolMust
.
must
(
QueryBuilders
.
termsQuery
(
"SEQUENCE_NBR.keyword"
,
records
));
builder
.
query
(
boolMust
);
builder
.
from
(
0
);
builder
.
size
(
limit
);
request
.
source
(
builder
);
// 数据库和es中都为50*X的数据集合
List
<
String
>
allNotDateList
=
new
ArrayList
<>();
// 数据库中为50*X的数据集合,但es中不为50*X的数据集合
List
<
Map
<
String
,
Object
>>
dataList
=
new
ArrayList
<>();
try
{
SearchResponse
response
=
restHighLevelClient
.
search
(
request
,
RequestOptions
.
DEFAULT
);
for
(
SearchHit
hit
:
response
.
getHits
().
getHits
())
{
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
hit
);
JSONObject
dto
=
jsonObject
.
getJSONObject
(
"sourceAsMap"
);
if
(
dto
.
containsKey
(
"ORG_BRANCH_CODE"
))
{
//3、判断查询回来的数据中是否为50*X,如果是50*X,则记录下来进行做置空处理/如果不为50*X,则记录下来进行数据库修复
if
(
"50*X"
.
equals
(
dto
.
getString
(
"ORG_BRANCH_CODE"
)))
{
allNotDateList
.
add
(
dto
.
getString
(
"SEQUENCE_NBR"
));
}
else
{
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"record"
,
dto
.
getString
(
"SEQUENCE_NBR"
));
dataMap
.
put
(
"orgBranchCode"
,
dto
.
getString
(
"ORG_BRANCH_CODE"
));
dataList
.
add
(
dataMap
);
}
}
}
//4、是50*X的进行es和数据库的双向修改/不是50*X的只需要做数据库修改
if
(!
ObjectUtils
.
isEmpty
(
allNotDateList
)){
tzsCustomFilterMapper
.
setOrgBranchCodeIsNullByRecords
(
allNotDateList
);
Iterable
<
ESEquipmentInfo
>
allById
=
esEquipmentDao
.
findAllById
(
allNotDateList
);
if
(!
ObjectUtils
.
isEmpty
(
allById
)){
for
(
ESEquipmentInfo
esEquipmentInfo
:
allById
)
{
esEquipmentInfo
.
setORG_BRANCH_CODE
(
""
);
}
}
esEquipmentDao
.
saveAll
(
allById
);
}
// 修改为es中的数据
if
(!
ObjectUtils
.
isEmpty
(
dataList
)){
tzsCustomFilterMapper
.
updateOrgBranchCodeByRecords
(
dataList
);
}
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
return
records
;
}
}
\ No newline at end of file
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/DPSubServiceImpl.java
View file @
20c70720
...
...
@@ -236,7 +236,7 @@ public class DPSubServiceImpl {
// 气瓶区分车用和非车用
if
(
"2300"
.
equals
(
param
.
getString
(
"EQU_CATEGORY_CODE"
))){
keyParams
=
JsonValueUtils
.
getValueByKey
(
content
,
"keyinfo"
,
"keyinfo.keyParams_2300_"
+
(
"
1
"
.
equals
(
param
.
getString
(
"WHETHER_VEHICLE_CYLINDER"
))
?
"true"
:
"false"
));
(
"
否"
.
equals
(
param
.
getString
(
"WHETHER_VEHICLE_CYLINDER"
))
||
"0
"
.
equals
(
param
.
getString
(
"WHETHER_VEHICLE_CYLINDER"
))
?
"true"
:
"false"
));
keyinfo
.
remove
(
"keyParams_2300_true"
);
keyinfo
.
remove
(
"keyParams_2300_false"
);
}
else
{
...
...
@@ -254,7 +254,7 @@ public class DPSubServiceImpl {
((
JSONArray
)
keyParams
).
stream
().
forEach
(
x
->
{
JSONObject
xobj
=
(
JSONObject
)
x
;
xobj
.
put
(
"type"
,
"text"
);
xobj
.
put
(
"value"
,
"param"
.
equals
(
xobj
.
getString
(
"source"
))
?
param
.
get
(
xobj
.
getString
(
"key"
))
:
result
.
get
(
xobj
.
getString
(
"key"
)));
xobj
.
put
(
"value"
,
"param"
.
equals
(
xobj
.
getString
(
"source"
))
||
"EQU_LIST"
.
equals
(
xobj
.
getString
(
"key"
))
?
param
.
get
(
xobj
.
getString
(
"key"
))
:
result
.
get
(
xobj
.
getString
(
"key"
)));
});
this
.
processQRCodeWidget
(
content
.
getJSONObject
(
"keyinfo"
).
getJSONObject
(
"qrcode"
),
result
);
...
...
@@ -776,7 +776,20 @@ public class DPSubServiceImpl {
));
jsonObject
.
put
(
"value"
,
fieldMap
.
get
(
value
));
}
}
else
if
(
"tableToTable"
.
equals
(
xObj
.
getString
(
"componentKey"
))){
}
else
if
(
"selectTree"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
String
name
=
null
;
if
(!
ValidationUtil
.
isEmpty
(
visualParams
.
getJSONObject
(
"api"
))
&&
StrUtil
.
isNotEmpty
(
visualParams
.
getJSONObject
(
"api"
).
getString
(
"apiPath"
)))
{
ResponseModel
selectResult
=
this
.
getApiResult
(
visualParams
.
getJSONObject
(
"api"
),
null
,
apiResult
);
if
(!
ValidationUtil
.
isEmpty
(
selectResult
)
&&
selectResult
.
getStatus
()
==
200
&&
!
ValidationUtil
.
isEmpty
(
value
))
{
JSONArray
result
=
(
JSONArray
)
selectResult
.
getResult
();
// 递归处理树形结构
name
=
getTreeNameById
(
result
,
value
.
toString
());
}
}
else
if
(!
CollectionUtils
.
isEmpty
(
visualParams
.
getJSONArray
(
"data"
)))
{
name
=
getTreeNameById
(
visualParams
.
getJSONArray
(
"data"
),
value
.
toString
());
}
jsonObject
.
put
(
"value"
,
name
);
}
else
if
(
"tableToTable"
.
equals
(
xObj
.
getString
(
"componentKey"
)))
{
}
}
...
...
@@ -786,6 +799,29 @@ public class DPSubServiceImpl {
return
datas
;
}
private
String
getTreeNameById
(
JSONArray
jsonArray
,
String
value
)
{
final
String
[]
name
=
new
String
[
1
];
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
List
<
Object
>
collect
=
jsonArray
.
stream
().
filter
(
y
->
value
.
equals
(
JsonValueUtils
.
getValueByKey
(
y
,
"id"
,
"id"
))).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
collect
.
stream
().
findFirst
().
ifPresent
(
z
->
name
[
0
]
=
((
JSONObject
)
z
).
getString
(
"name"
));
}
else
{
for
(
Object
object
:
jsonArray
)
{
JSONObject
object1
=
(
JSONObject
)
object
;
if
(!
ObjectUtils
.
isEmpty
(
object1
.
get
(
"children"
)))
{
name
[
0
]
=
getTreeNameById
(
object1
.
getJSONArray
(
"children"
),
value
);
if
(
name
[
0
]
!=
null
)
{
return
name
[
0
];
}
}
}
}
}
else
{
return
null
;
}
return
name
[
0
];
}
public
JSONObject
buildSubFormData
(
JSONObject
map
,
int
i
,
JSONObject
yObj
,
Object
apiResult
)
{
JSONArray
subs
=
map
.
getJSONArray
(
"subs"
);
JSONArray
children
=
yObj
.
getJSONArray
(
"children"
);
...
...
@@ -903,6 +939,7 @@ public class DPSubServiceImpl {
}
}
result
=
isRefactor
?
resultMap
:
result
;
responseModel
.
setResult
(
result
);
}
else
if
(
result
instanceof
JSONArray
)
{
JSONArray
jsonArray
=
(
JSONArray
)
result
;
...
...
@@ -916,8 +953,8 @@ public class DPSubServiceImpl {
}
}
result
=
isRefactor
?
jsonArray
:
result
;
responseModel
.
setResult
(
result
);
}
responseModel
.
setResult
(
result
);
}
return
responseModel
;
}
...
...
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 @
20c70720
...
...
@@ -2135,8 +2135,14 @@ public class JGDPStatisticsServiceImpl {
}
}
public
List
<
Map
<
String
,
String
>>
equOnJgServiceOperationRecords
(
String
record
)
{
return
commonMapper
.
equOnJgServiceOperationRecords
(
record
).
stream
()
public
List
<
Map
<
String
,
String
>>
equOnJgServiceOperationRecords
(
String
record
,
String
equipType
)
{
List
<
Map
<
String
,
String
>>
maps
=
new
ArrayList
<>();
if
(
"8000"
.
equals
(
equipType
))
{
maps
=
commonMapper
.
gdEquOnJgServiceOperationRecords
(
record
);
}
else
{
maps
=
commonMapper
.
equOnJgServiceOperationRecords
(
record
);
}
return
maps
.
stream
()
.
map
(
x
->
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"operatingTime"
,
x
.
get
(
"recDate"
));
...
...
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/UserBizByTCMServiceImpl.java
View file @
20c70720
...
...
@@ -23,7 +23,6 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.ArrayList
;
...
...
@@ -67,7 +66,7 @@ public class UserBizByTCMServiceImpl {
Map
<
String
,
Object
>
maps
=
new
HashMap
<>();
TzsUserInfo
tzsUserInfo
=
tzsUserInfoMapper
.
selectById
(
id
);
TzsUserInfoVo
tzsUserInfoVo
=
new
TzsUserInfoVo
();
BeanUtils
.
copyProperties
(
tzsUserInfo
,
tzsUserInfoVo
,
"identification"
,
"profile"
,
"post"
,
"permissionItem"
,
"appointDoc"
);
BeanUtils
.
copyProperties
(
tzsUserInfo
,
tzsUserInfoVo
,
"identification"
,
"profile"
,
"post"
,
"permissionItem"
,
"appointDoc"
,
"practiceRegistration"
,
"laborContract"
);
if
(!
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getPost
()))
{
tzsUserInfoVo
.
setPost
(
JSON
.
parseArray
(
tzsUserInfo
.
getPost
()));
}
...
...
@@ -83,13 +82,15 @@ public class UserBizByTCMServiceImpl {
tzsUserInfoVo
.
setIdentification
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getIdentification
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getIdentification
()));
tzsUserInfoVo
.
setProfile
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getProfile
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getProfile
()));
tzsUserInfoVo
.
setAppointDoc
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getAppointDoc
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getAppointDoc
()));
tzsUserInfoVo
.
setPracticeRegistration
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getPracticeRegistration
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getPracticeRegistration
()));
tzsUserInfoVo
.
setLaborContract
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getLaborContract
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getLaborContract
()));
tzsUserInfoVo
.
setOtherAccessories
(
ObjectUtils
.
isEmpty
(
tzsUserInfo
.
getOtherAccessories
())
?
null
:
JSON
.
parseArray
(
tzsUserInfo
.
getOtherAccessories
()));
tzsUserInfoVo
.
setBirthday
(
tzsUserInfo
.
getBirthday
()
!=
null
?
DateUtils
.
longStrDate
(
tzsUserInfo
.
getBirthday
()):
null
);
tzsUserInfoVo
.
setSpeciality_required
(
tzsUserInfo
.
getSpeciality
());
tzsUserInfoVo
.
setEducation_required
(
tzsUserInfo
.
getEducation
());
tzsUserInfoVo
.
setJobTitle_required
(
tzsUserInfo
.
getJobTitle
());
String
companyType
=
getUnitType
(
tzsUserInfo
.
getUnitCode
());
tzsUserInfoVo
.
setBirthday
(
tzsUserInfo
.
getBirthday
()
!=
null
?
DateUtils
.
longStrDate
(
tzsUserInfo
.
getBirthday
()):
null
);
String
companyType
=
getUnitType
();
tzsUserInfoVo
.
setCompanyType
(
companyType
.
contains
(
"个人主体"
)
?
"individual"
:
"no-individual"
);
Map
<
String
,
Object
>
userInfoMap
=
BeanUtil
.
beanToMap
(
tzsUserInfoVo
);
// userInfoMap.putAll(this.getPermissionDataJson(tzsUserInfo.getPermissionData()));
...
...
@@ -100,12 +101,12 @@ public class UserBizByTCMServiceImpl {
return
maps
;
}
public
String
getUnitType
()
{
List
<
CompanyModel
>
companyModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryListByChild
(
RequestContext
.
getExeUserId
()
));
if
(
companyModels
.
isEmpty
(
))
{
public
String
getUnitType
(
String
unitCode
)
{
CompanyModel
companyModel
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryByCompanyCode
(
unitCode
));
if
(
ObjectUtils
.
isEmpty
(
companyModel
))
{
return
""
;
}
return
companyModel
s
.
get
(
0
)
.
getCompanyType
();
return
companyModel
.
getCompanyType
();
}
/**
...
...
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/resources/json/equip_8000.json
View file @
20c70720
...
...
@@ -89,7 +89,8 @@
"httpMethod"
:
"GET"
,
"apiPath"
:
"/statistics/dp/jg/common/equOnJgServiceOperationRecords"
,
"params"
:
{
"record"
:
"{record}"
"record"
:
"{record}"
,
"equipType"
:
"8000"
},
"ruleData"
:
{
"responseSuccess"
:
"data.result"
,
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/resources/mapper/TzsUserInfoMapper.xml
View file @
20c70720
...
...
@@ -324,7 +324,7 @@
FROM
"tzs_user_info" u
left join tzs_user_permission p on u.sequence_nbr = p.user_seq
left join tz_base_enterprise_info e on u.unit_code = e.use_
unit_
code
left join tz_base_enterprise_info e on u.unit_code = e.use_code
<where>
u.is_delete = false
<if
test=
"filter.orgCode != null and filter.orgCode != ''"
>
...
...
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/TzsUserInfoServiceImpl.java
View file @
20c70720
...
...
@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.biz.common.utils.SnowflakeIdUtil
;
import
com.yeejoin.amos.boot.module.common.api.dto.UserPermissionDto
;
import
com.yeejoin.amos.boot.module.common.api.enums.UnitDataSourceEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.UserPostEnum
;
import
com.yeejoin.amos.boot.module.common.biz.event.CommonPublisher
;
import
com.yeejoin.amos.boot.module.common.biz.refresh.DataRefreshEvent
;
import
com.yeejoin.amos.boot.module.tcm.api.dto.*
;
...
...
@@ -1089,12 +1090,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
throw
new
BadRequest
(
"本单位下用户证件号码重复,请核对!"
);
}
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))
>
0
)
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
// 当人员类型仅为主要负责人时,不校验是否被其他单位绑定
if
(!
JSON
.
toJSONString
(
Collections
.
singletonList
(
UserPostEnum
.
ZYFZR
.
getCode
())).
equals
(
tzsUserInfo
.
getNewPost
()))
{
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfo
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfo
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))
>
0
)
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
}
}
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
...
...
@@ -1214,13 +1218,15 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))
>
0
)
{
throw
new
BadRequest
(
"本单位下用户证件号码重复,请核对!"
);
}
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfoDto
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfoDto
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))
>
0
)
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
// 当人员类型仅为主要负责人时,不校验是否被其他单位绑定
if
(!
JSON
.
toJSONString
(
Collections
.
singletonList
(
UserPostEnum
.
ZYFZR
.
getCode
())).
equals
(
tzsUserInfoDto
.
getNewPost
()))
{
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
.
eq
(
TzsUserInfo:
:
getCertificateType
,
tzsUserInfoDto
.
getCertificateType
())
.
eq
(
TzsUserInfo:
:
getCertificateNum
,
tzsUserInfoDto
.
getCertificateNum
())
.
ne
(
TzsUserInfo:
:
getUnitCode
,
companyModel
.
getCompanyCode
())
.
eq
(
TzsUserInfo:
:
getIsDelete
,
false
))
>
0
)
{
throw
new
BadRequest
(
"该用户已被其他单位绑定,请联系原单位转出!"
);
}
}
if
(
tzsUserInfoMapper
.
selectCount
(
new
LambdaQueryWrapper
<
TzsUserInfo
>()
...
...
@@ -2393,8 +2399,8 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(!
ObjectUtils
.
isEmpty
(
roleGroup
)
&&
roleGroup
.
getExtend
()
!=
null
)
{
Privilege
.
groupUserClient
.
create
(
Long
.
valueOf
(
roleGroup
.
getExtend
()),
userIds
);
}
// 绑定两个规定用户组
if
(
post
!=
null
)
{
// 绑定两个规定用户组
post
=
post
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
"\""
,
""
);
for
(
String
code
:
post
.
split
(
","
))
{
DataDictionary
groupId
=
iDataDictionaryService
.
getOne
(
new
LambdaQueryWrapper
<
DataDictionary
>().
eq
(
DataDictionary:
:
getCode
,
code
).
likeRight
(
DataDictionary:
:
getType
,
QYRYGW
));
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/CategoryOtherInfoMapper.java
View file @
20c70720
...
...
@@ -44,6 +44,8 @@ public interface CategoryOtherInfoMapper extends BaseMapper<CategoryOtherInfo> {
List
<
Integer
>
selectExceedElevatorCodeList
(
Integer
start
,
String
prefix
);
List
<
Integer
>
selectExceedElevatorSequenceCodeList
(
Integer
start
,
String
prefix
);
Integer
selectCode
(
Integer
start
,
Integer
end
,
String
prefix
);
/**
...
...
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/CategoryOtherInfoMapper.xml
View file @
20c70720
...
...
@@ -26,21 +26,24 @@
SELECT CODE96333 code
FROM biz_jg_supervisory_code bjsc
WHERE CODE96333 LIKE CONCAT(#{elevatorCode}, '%')
AND CODE96333 ~ '^\d+$' -- 确保是纯数字
<if
test=
"status != null and status != ''"
>
and status = #{status}
</if>
<if
test=
"status != 2 "
>
ORDER BY CODE96333 DESC LIMIT 1
</if>
<if
test=
"status == 2 "
>
ORDER BY CODE96333 ASC LIMIT 1
</if>
<if
test=
"status != 2 "
>
ORDER BY CODE96333
::BIGINT
DESC LIMIT 1
</if>
<if
test=
"status == 2 "
>
ORDER BY CODE96333
::BIGINT
ASC LIMIT 1
</if>
</select>
<select
id=
"selectElevatorCodeMaxValue"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.KV"
>
WITH ElevatorResults AS (
SELECT ROW_NUMBER() OVER (PARTITION BY SUBSTRING (CODE96333 FROM 1 FOR 2) ORDER BY CODE96333 DESC) AS row_num,
SELECT ROW_NUMBER() OVER (PARTITION BY SUBSTRING (CODE96333 FROM 1 FOR 2) ORDER BY CODE96333
::BIGINT
DESC) AS row_num,
CODE96333
FROM biz_jg_supervisory_code
WHERE CREATE_STATUS = 1
AND CODE96333 IS NOT NULL
AND CODE96333
<![CDATA[<> '']]>
)
AND CODE96333
<![CDATA[<> '']]>
AND CODE96333 ~ '^\d+$' -- 确保是纯数字
)
SELECT '96333_' || SUBSTRING(CODE96333 FROM 1 FOR 2) AS name,
CODE96333 AS value
FROM ElevatorResults WHERE row_num = 1
...
...
@@ -174,11 +177,13 @@
<select
id=
"selectExceedElevatorCodeList"
resultType=
"java.lang.Integer"
>
SELECT CODE96333 code
FROM biz_jg_supervisory_code bjsc
WHERE code LIKE CONCAT(#{prefix}, '%')
WHERE
CODE96333 ~ '^\d+$' -- 确保是纯数字
AND CODE96333 LIKE CONCAT(#{prefix}, '%')
<if
test=
"start != null and start != ''"
>
AND
code
<![CDATA[ >= ]]>
#{start}
AND
CODE96333::BIGINT
<![CDATA[ >= ]]>
#{start}::BIGINT -- 数值比较
</if>
ORDER BY
code
ORDER BY
CODE96333::BIGINT -- 数值排序
</select>
<select
id=
"selectCode"
resultType=
"java.lang.Integer"
>
...
...
@@ -198,6 +203,18 @@
SELECT CODE96333 code
FROM biz_jg_supervisory_code
WHERE CODE96333 = #{elevatorCode}
ORDER BY code
ORDER BY code::BIGINT;
</select>
<select
id=
"selectExceedElevatorSequenceCodeList"
resultType=
"java.lang.Integer"
>
SELECT SUBSTRING(CODE96333 FROM 3) AS code
FROM biz_jg_supervisory_code bjsc
WHERE
CODE96333 ~ '^\d+$' -- 确保是纯数字
AND CODE96333 LIKE CONCAT(#{prefix}, '%')
<if
test=
"start != null and start != ''"
>
AND CODE96333::BIGINT
<![CDATA[ >= ]]>
#{start}::BIGINT -- 数值比较
</if>
ORDER BY CODE96333::BIGINT -- 数值排序
</select>
</mapper>
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 @
20c70720
...
...
@@ -273,6 +273,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
private
ESElavtorRepository
esElavtorRepository
;
@Value
(
"${regulator.unit.code}"
)
private
String
code
;
// 仅测试时使用该起始序列号,默认为空。正式环境不配置该属性时使用枚举里的值
@Value
(
"${ymt.createCode.96333.startCode:}"
)
private
String
startCode
;
@Autowired
private
RedisUtils
redisUtils
;
// 一码通checkCode中redis key过期时间
...
...
@@ -718,7 +723,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
log
.
info
(
"生成码成功"
);
SupervisoryCodeInfo
supervisoryCodeInfo
=
new
SupervisoryCodeInfo
();
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
ionCode
));
SupervisoryCodeInfo
selectOne
=
supervisoryCodeInfoMapper
.
selectOne
(
new
QueryWrapper
<
SupervisoryCodeInfo
>().
eq
(
"supervisory_code"
,
supervis
orCode
.
toString
()
));
// 将生成的码添加到码表中,码的使用状态为初始状态
String
equState
=
EquipmentCategoryEnum
.
CSZT
.
getCode
();
supervisoryCodeInfo
.
setCode96333
(
String
.
valueOf
(
elevatorCode
));
...
...
@@ -882,16 +887,26 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
if
(!
ObjectUtils
.
isEmpty
(
elevatorOtherInfo
)
&&
elevatorOtherInfo
.
getCode
()
!=
null
)
{
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
Integer
start
=
Integer
.
valueOf
(
prefix
+
EquipmentCategoryEnum
.
getCode
.
get
(
prefix
));
Integer
end
=
Integer
.
valueOf
(
elevatorOtherInfo
.
getCode
());
List
<
Integer
>
allCodeList
=
IntStream
.
rangeClosed
(
start
,
end
)
.
boxed
()
.
collect
(
Collectors
.
toList
());
List
<
Integer
>
codeList
=
categoryOtherInfoMapper
.
selectExceedElevatorCodeList
(
start
,
prefix
);
List
<
Integer
>
resultList
=
getDiffrent
(
allCodeList
,
codeList
);
if
(!
ObjectUtils
.
isEmpty
(
resultList
))
{
// 改为都只拿序列号查找比较
int
start
=
Integer
.
parseInt
(
ValidationUtil
.
isEmpty
(
startCode
)
?
EquipmentCategoryEnum
.
getCode
.
get
(
prefix
)
:
startCode
);
int
end
=
Integer
.
parseInt
(
elevatorOtherInfo
.
getCode
().
substring
(
2
));
List
<
Integer
>
codeList
=
categoryOtherInfoMapper
.
selectExceedElevatorSequenceCodeList
(
Integer
.
valueOf
(
prefix
+
start
),
prefix
);
// 使用TreeSet便于快速查找和排序
TreeSet
<
Integer
>
usedCodes
=
new
TreeSet
<>(
codeList
);
Integer
firstAvailableCode
=
null
;
// 从start开始查找第一个未使用的编码
for
(
int
i
=
start
;
i
<=
end
;
i
++)
{
if
(!
usedCodes
.
contains
(
i
))
{
firstAvailableCode
=
i
;
break
;
}
}
if
(
firstAvailableCode
!=
null
)
{
elevatorCode
.
setLength
(
0
);
elevatorCode
.
append
(
resultList
.
get
(
0
)
);
elevatorCode
.
append
(
prefix
).
append
(
firstAvailableCode
);
}
else
{
//// 获取补零位长度
//String elevatorCode1 = elevatorOtherInfo.getCode().substring(2);
...
...
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/GenerateCodeServiceImpl.java
View file @
20c70720
...
...
@@ -35,6 +35,8 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
private
static
final
String
LOCK_KEY_SUPERVISORY
=
"sequence_lock_supervisory"
;
private
static
final
String
SEQUENCE_TYPE_UR
=
"%05d"
;
private
static
final
String
SEQUENCE_TYPE
=
"%08d"
;
private
static
final
String
SUPERVISOR_SEQUENCE_TYPE
=
"%07d"
;
private
final
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
final
StringRedisTemplate
stringRedisTemplate
;
private
final
CategoryOtherInfoMapper
categoryOtherInfoMapper
;
...
...
@@ -93,6 +95,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
}
@Override
@Deprecated
public
boolean
reduceElevatorCode
(
String
key
)
{
return
reduceSequence
(
key
,
SEQUENCE_TYPE
,
LOCK_KEY_ELEVATOR
);
}
...
...
@@ -127,7 +130,7 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
log
.
info
(
"===================>获取《{}》当前顺序码:{}<==================="
,
sequenceKey
,
currentSequenceStr
);
currentSequence
++;
// 生成顺序码
String
formattedSequence
=
String
.
format
(
GenerateCodeServiceImpl
.
SEQUENCE_TYPE
,
currentSequence
);
String
formattedSequence
=
String
.
format
(
GenerateCodeServiceImpl
.
S
UPERVISOR_S
EQUENCE_TYPE
,
currentSequence
);
log
.
info
(
"===================>更新《{}》顺序码:{}<==================="
,
sequenceKey
,
formattedSequence
);
// 更新顺序码
valueOps
.
set
(
sequenceKey
,
formattedSequence
);
...
...
@@ -294,13 +297,19 @@ public class GenerateCodeServiceImpl implements IGenerateCodeService {
log
.
info
(
"===================>获取《{}》初始码:{}<==================="
,
sequenceKey
,
initialCode
);
return
initialCode
;
}
Long
currentSequence
=
Long
.
parseLong
(
currentSequenceStr
);
// currentSequenceStr截取前两位作为prefix
String
prefix
=
currentSequenceStr
.
substring
(
0
,
2
);
// 截取剩余的数字作为顺序码
currentSequenceStr
=
currentSequenceStr
.
substring
(
2
);
long
currentSequence
=
Long
.
parseLong
(
currentSequenceStr
);
log
.
info
(
"===================>获取《{}》当前顺序码:{}<==================="
,
sequenceKey
,
currentSequenceStr
);
currentSequence
++;
currentSequence
=
Long
.
parseLong
(
prefix
+
currentSequence
);
// 生成顺序码
String
formattedSequence
=
String
.
format
(
sequenceType
,
currentSequence
);
// 去除先导0字符
formattedSequence
=
formattedSequence
.
replaceFirst
(
"^0+"
,
""
);
log
.
info
(
"===================>更新《{}》顺序码:{}<==================="
,
sequenceKey
,
formattedSequence
);
// 更新顺序码
valueOps
.
set
(
sequenceKey
,
formattedSequence
);
...
...
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