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
3f05f12c
Commit
3f05f12c
authored
Jul 26, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
15a89853
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
141 additions
and
70 deletions
+141
-70
PressurePumpEnum.java
...om/yeejoin/equipmanage/common/enums/PressurePumpEnum.java
+10
-4
OrganizationUser.java
...oin/amos/boot/module/jcs/api/entity/OrganizationUser.java
+3
-0
IOrganizationUserService.java
...boot/module/jcs/api/service/IOrganizationUserService.java
+4
-0
OrganizationMapper.xml
...-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
+1
-52
MqttReceiveServiceImpl.java
...join/equipmanage/service/impl/MqttReceiveServiceImpl.java
+41
-13
OrganizationUserController.java
...module/jcs/biz/controller/OrganizationUserController.java
+22
-0
OrganizationImpl.java
...os/boot/module/jcs/biz/service/impl/OrganizationImpl.java
+1
-1
OrganizationUserImpl.java
...oot/module/jcs/biz/service/impl/OrganizationUserImpl.java
+47
-0
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+12
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/enums/PressurePumpEnum.java
View file @
3f05f12c
...
@@ -13,14 +13,20 @@ public enum PressurePumpEnum {
...
@@ -13,14 +13,20 @@ public enum PressurePumpEnum {
ALONE_START_QT
(
"FHS_PressurePump_Start_ALONE_START_QT"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"5"
,
ALONE_START_QT
(
"FHS_PressurePump_Start_ALONE_START_QT"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"5"
,
PressurePumpValueEnum
.
LAST_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【5】分钟"
),
PressurePumpValueEnum
.
LAST_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【5】分钟"
),
ALONE_START_QT_WJ
(
"FHS_PressurePump_Start_ALONE_START_QT_WJ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"5"
,
"30"
,
PressurePumpValueEnum
.
LAST_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【30】分钟"
),
ALONE_START_QT_YZ
(
"FHS_PressurePump_Start_ALONE_START_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"30"
,
"60"
,
PressurePumpValueEnum
.
LAST_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YZ
.
getCode
(),
"【1】小时"
),
ALL_START_QT_WJ
(
"FHS_PressurePump_Start_ALL_START_QT_WJ"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"5"
,
ALL_START_QT_WJ
(
"FHS_PressurePump_Start_ALL_START_QT_WJ"
,
PressurePumpCheckEnum
.
LE
.
getCode
(),
""
,
"5"
,
PressurePumpValueEnum
.
LA
ST
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【5】分钟"
),
PressurePumpValueEnum
.
LA
TELY
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【5】分钟"
),
START_QT_WJ_ALL
(
"FHS_PressurePump_Start_ALL_START_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"5"
,
"30"
,
START_QT_WJ_ALL
(
"FHS_PressurePump_Start_ALL_START_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"5"
,
"30"
,
PressurePumpValueEnum
.
LA
ST
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【30】分钟"
),
PressurePumpValueEnum
.
LA
TELY
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_QT_WJ
.
getCode
(),
"【30】分钟"
),
ALL_STOP_QT_YZ
(
"FHS_PressurePump_St
op
_ALL_STOP_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"30"
,
"60"
,
ALL_STOP_QT_YZ
(
"FHS_PressurePump_St
art
_ALL_STOP_QT_YZ"
,
PressurePumpCheckEnum
.
BE
.
getCode
(),
"30"
,
"60"
,
PressurePumpValueEnum
.
LA
ST
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YZ
.
getCode
(),
"【1】小时"
);
PressurePumpValueEnum
.
LA
TELY
_START
.
getCode
(),
PressurePumpMessageEnum
.
MESSAGE_LEVEL_YZ
.
getCode
(),
"【1】小时"
);
// 备份2023-07-13
// 备份2023-07-13
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/OrganizationUser.java
View file @
3f05f12c
...
@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity {
...
@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity {
@ApiModelProperty
(
value
=
"排序"
)
@ApiModelProperty
(
value
=
"排序"
)
private
int
sort
;
private
int
sort
;
@ApiModelProperty
(
value
=
"是否是值长"
)
private
boolean
dutyLeader
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IOrganizationUserService.java
View file @
3f05f12c
...
@@ -8,9 +8,13 @@ public interface IOrganizationUserService {
...
@@ -8,9 +8,13 @@ public interface IOrganizationUserService {
OrganizationUser
updateModelById
(
OrganizationUser
organizationUser
);
OrganizationUser
updateModelById
(
OrganizationUser
organizationUser
);
void
updateModelByTel
(
OrganizationUser
organizationUser
);
OrganizationUser
getDetailsById
(
Long
id
);
OrganizationUser
getDetailsById
(
Long
id
);
IPage
<
OrganizationUser
>
getListPage
(
int
pageNumber
,
int
pageSize
,
Long
id
);
IPage
<
OrganizationUser
>
getListPage
(
int
pageNumber
,
int
pageSize
,
Long
id
);
IPage
<
OrganizationUser
>
getPage
(
int
pageNumber
,
int
pageSize
,
String
tel
);
int
deleteById
(
Long
id
);
int
deleteById
(
Long
id
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrganizationMapper.xml
View file @
3f05f12c
...
@@ -17,58 +17,7 @@
...
@@ -17,58 +17,7 @@
LIMIT 5
LIMIT 5
</select>
</select>
<select
id=
"getTeamLeader"
resultType=
"Map"
>
<select
id=
"getTeamLeader"
resultType=
"Map"
>
SELECT
SELECT cou.member_name AS `value`, cou.telephone AS tel, '当值值长' AS `name` FROM cb_organization_user cou WHERE cou.duty_leader = true LIMIT 1
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
</select>
</select>
<select
id=
"getOrganizationList"
resultType=
"java.util.Map"
>
<select
id=
"getOrganizationList"
resultType=
"java.util.Map"
>
SELECT
SELECT
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/MqttReceiveServiceImpl.java
View file @
3f05f12c
...
@@ -2019,6 +2019,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -2019,6 +2019,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List
<
EquipmentSpecificIndex
>
equipmentSpeIndexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndex
(
listIndex
);
List
<
EquipmentSpecificIndex
>
equipmentSpeIndexList
=
equipmentSpecificIndexService
.
getEquipmentSpeIndexByIndex
(
listIndex
);
List
<
PressurePumpEnum
>
enumListByCode
=
PressurePumpEnum
.
getEnumListByCode
(
indexValue
);
List
<
PressurePumpEnum
>
enumListByCode
=
PressurePumpEnum
.
getEnumListByCode
(
indexValue
);
if
(
TrueOrFalseEnum
.
fake
.
value
.
equals
(
indexValue
))
{
String
jobName
=
topicEntity
.
getIotCode
()
+
"_"
+
indexKey
;
String
triggerName
=
PUMP_TRIGGER_NAME
+
"-"
+
topicEntity
.
getIotCode
();
boolean
b
=
QuartzManager
.
checkExists
(
jobName
,
PUMP_JOB_GROUP_NAME
);
// 删除这个稳压泵的监听任务
if
(
b
)
{
QuartzManager
.
removeJob
(
jobName
,
PUMP_JOB_GROUP_NAME
,
triggerName
,
PUMP_TRIGGER_GROUP_NAME
);
}
// 稳压泵漏水告警恢复
List
<
EquipmentSpecificIndex
>
collect
=
equipmentSpeIndexList
.
stream
().
filter
(
item
->
!
ObjectUtils
.
isEmpty
(
item
.
getIotCode
())
&&
item
.
getIotCode
().
equals
(
topicEntity
.
getIotCode
())).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
)
&&
!
ObjectUtils
.
isEmpty
(
collect
.
get
(
0
))
&&
!
ObjectUtils
.
isEmpty
(
collect
.
get
(
0
).
getEquipmentId
()))
{
equipmentSpecificAlarmLogService
.
pressurePumpRestore
(
collect
.
get
(
0
).
getEquipmentId
());
}
}
if
(!
CollectionUtils
.
isEmpty
(
enumListByCode
))
{
if
(!
CollectionUtils
.
isEmpty
(
enumListByCode
))
{
enumListByCode
.
forEach
(
pressurePumpEnum
->
{
enumListByCode
.
forEach
(
pressurePumpEnum
->
{
// 1. 获取需要校验的值
// 1. 获取需要校验的值
...
@@ -2051,8 +2066,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -2051,8 +2066,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
else
{
}
else
{
throw
new
BadRequest
(
"装备物联编码错误,请确认!"
);
throw
new
BadRequest
(
"装备物联编码错误,请确认!"
);
}
}
String
jobName
=
topicEntity
.
getIotCode
()
+
"_"
+
indexKey
;
String
triggerName
=
PUMP_TRIGGER_NAME
+
"-"
+
topicEntity
.
getIotCode
();
switch
(
valueEnum
)
{
switch
(
valueEnum
)
{
case
LAST_STOP:
case
LAST_STOP:
List
<
EquipmentSpecificIndex
>
lastStop
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
List
<
EquipmentSpecificIndex
>
lastStop
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
...
@@ -2064,12 +2078,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -2064,12 +2078,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
}
}
break
;
break
;
case
LAST_START:
case
LAST_START:
boolean
b
=
QuartzManager
.
checkExists
(
jobName
,
PUMP_JOB_GROUP_NAME
);
// 删除这个稳压泵的监听任务
if
(
b
)
{
QuartzManager
.
removeJob
(
jobName
,
PUMP_JOB_GROUP_NAME
,
triggerName
,
PUMP_TRIGGER_GROUP_NAME
);
}
List
<
EquipmentSpecificIndex
>
lastStart
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
List
<
EquipmentSpecificIndex
>
lastStart
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
StringUtil
.
isNotEmpty
(
e
.
getValue
())
&&
e
.
getIotCode
().
equals
(
iotCode
)
&&
pressurePumpStart
.
equals
(
e
.
getEquipmentIndexKey
())).
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
StringUtil
.
isNotEmpty
(
e
.
getValue
())
&&
e
.
getIotCode
().
equals
(
iotCode
)
&&
pressurePumpStart
.
equals
(
e
.
getEquipmentIndexKey
())).
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -2090,10 +2098,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -2090,10 +2098,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
break
;
break
;
case
LATELY_START:
case
LATELY_START:
List
<
EquipmentSpecificIndex
>
latelyStart
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
List
<
EquipmentSpecificIndex
>
latelyStart
=
equipmentSpeIndexList
.
stream
().
filter
(
e
->
StringUtil
.
isNotEmpty
(
e
.
getValue
())
&&
pressurePumpStart
.
equals
(
e
.
getEquipmentIndexKey
())).
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
StringUtil
.
isNotEmpty
(
e
.
getValue
())
&&
e
.
getIotCode
().
equals
(
iotCode
)
&&
pressurePumpStart
.
equals
(
e
.
getEquipmentIndexKey
())).
sorted
(
Comparator
.
comparing
(
EquipmentSpecificIndex:
:
getUpdateDate
).
reversed
())
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
latelyStart
))
{
if
(!
CollectionUtils
.
isEmpty
(
latelyStart
))
{
EquipmentSpecificIndex
aTrue
=
getIotDate
(
equipmentSpecificIndex
,
latelyStart
,
prefix
,
null
,
"true"
);
EquipmentSpecificIndex
aTrue
=
getIotDate
ExceptSelf
(
equipmentSpecificIndex
,
latelyStart
,
prefix
,
suffix
,
"true"
);
BeanUtils
.
copyProperties
(
aTrue
,
equipmentSpecificIndex
);
BeanUtils
.
copyProperties
(
aTrue
,
equipmentSpecificIndex
);
}
}
break
;
break
;
...
@@ -2108,14 +2116,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
...
@@ -2108,14 +2116,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private
EquipmentSpecificIndex
getIotDate
(
EquipmentSpecificIndex
equipmentSpecificIndex
,
List
<
EquipmentSpecificIndex
>
listData
,
String
prefix
,
String
suffix
,
String
flag
)
{
private
EquipmentSpecificIndex
getIotDate
(
EquipmentSpecificIndex
equipmentSpecificIndex
,
List
<
EquipmentSpecificIndex
>
listData
,
String
prefix
,
String
suffix
,
String
flag
)
{
ResponseModel
start
=
iotFeign
.
selectOne
(
remoteSecurityService
.
getServerToken
().
getAppKey
(),
remoteSecurityService
.
getServerToken
().
getProduct
(),
remoteSecurityService
.
getServerToken
().
getToke
(),
"
1
"
,
prefix
,
suffix
,
flag
,
pressurePumpStart
);
ResponseModel
start
=
iotFeign
.
selectOne
(
remoteSecurityService
.
getServerToken
().
getAppKey
(),
remoteSecurityService
.
getServerToken
().
getProduct
(),
remoteSecurityService
.
getServerToken
().
getToke
(),
"
2
"
,
prefix
,
suffix
,
flag
,
pressurePumpStart
);
if
(
200
==
start
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
start
.
getResult
()))
{
if
(
200
==
start
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
start
.
getResult
()))
{
String
json1
=
JSON
.
toJSONString
(
start
.
getResult
());
String
json1
=
JSON
.
toJSONString
(
start
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"time"
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"time"
))).
collect
(
Collectors
.
toList
());
Date
startDate
=
null
;
if
(
1
<
collect
.
size
())
{
String
startTime
=
collect
.
get
(
1
).
get
(
"time"
).
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTime
),
+
8
);
}
listData
.
get
(
0
).
setUpdateDate
(
startDate
);
BeanUtils
.
copyProperties
(
listData
.
get
(
0
),
equipmentSpecificIndex
);
}
return
equipmentSpecificIndex
;
}
String
startTime
=
collect
.
get
(
0
).
get
(
"time"
).
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
private
EquipmentSpecificIndex
getIotDateExceptSelf
(
EquipmentSpecificIndex
equipmentSpecificIndex
,
List
<
EquipmentSpecificIndex
>
listData
,
String
prefix
,
String
suffix
,
String
flag
)
{
Date
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTime
),
+
8
);
ResponseModel
start
=
iotFeign
.
selectOne
(
remoteSecurityService
.
getServerToken
().
getAppKey
(),
remoteSecurityService
.
getServerToken
().
getProduct
(),
remoteSecurityService
.
getServerToken
().
getToke
(),
"100"
,
prefix
,
null
,
flag
,
pressurePumpStart
+
","
+
"deviceName"
);
if
(
200
==
start
.
getStatus
()
&&
!
ObjectUtils
.
isEmpty
(
start
.
getResult
()))
{
String
json1
=
JSON
.
toJSONString
(
start
.
getResult
());
List
<
Map
<
String
,
String
>>
listObject1
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json1
);
listObject1
=
listObject1
.
stream
().
filter
(
x
->
!
suffix
.
equalsIgnoreCase
(
x
.
get
(
"deviceName"
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
collect
=
listObject1
.
stream
().
filter
(
t
->
(
t
.
containsKey
(
"time"
))).
collect
(
Collectors
.
toList
());
Date
startDate
=
null
;
if
(
0
<
collect
.
size
())
{
String
startTime
=
collect
.
get
(
0
).
get
(
"time"
).
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
startDate
=
DateUtils
.
dateAddHours
(
DateUtils
.
longStr2Date
(
startTime
),
+
8
);
}
listData
.
get
(
0
).
setUpdateDate
(
startDate
);
listData
.
get
(
0
).
setUpdateDate
(
startDate
);
BeanUtils
.
copyProperties
(
listData
.
get
(
0
),
equipmentSpecificIndex
);
BeanUtils
.
copyProperties
(
listData
.
get
(
0
),
equipmentSpecificIndex
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrganizationUserController.java
View file @
3f05f12c
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Organization
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.Organization
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper
;
...
@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController {
...
@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController {
return
ResponseHelper
.
buildResponse
(
organizationUserService
.
updateModelById
(
organizationUser
));
return
ResponseHelper
.
buildResponse
(
organizationUserService
.
updateModelById
(
organizationUser
));
}
}
/**
* 编辑应急小组成员
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/updateByTel"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"编辑应急小组成员"
,
notes
=
"编辑应急小组成员"
)
public
ResponseModel
updateModelByTel
(
@RequestBody
OrganizationUser
organizationUser
){
organizationUserService
.
updateModelByTel
(
organizationUser
);
return
CommonResponseUtil
.
success
();
}
@GetMapping
(
value
=
"/getDetailsById"
)
@GetMapping
(
value
=
"/getDetailsById"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取详情"
,
notes
=
"获取详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取详情"
,
notes
=
"获取详情"
)
...
@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController {
...
@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController {
return
ResponseHelper
.
buildResponse
(
organizationUserService
.
getListPage
(
pageNumber
,
pageSize
,
id
));
return
ResponseHelper
.
buildResponse
(
organizationUserService
.
getListPage
(
pageNumber
,
pageSize
,
id
));
}
}
@GetMapping
(
value
=
"/page"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"卡片值长列表"
,
notes
=
"卡片值长列表"
)
public
ResponseModel
<
IPage
<
OrganizationUser
>>
getPage
(
@RequestParam
(
value
=
"pageNumber"
,
required
=
false
)
int
pageNumber
,
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
int
pageSize
,
@RequestParam
(
value
=
"tel"
,
required
=
false
)
String
tel
)
{
return
ResponseHelper
.
buildResponse
(
organizationUserService
.
getPage
(
pageNumber
,
pageSize
,
tel
));
}
@GetMapping
(
value
=
"/deleteById"
)
@GetMapping
(
value
=
"/deleteById"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"删除"
,
notes
=
"根据id删除"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationImpl.java
View file @
3f05f12c
...
@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
...
@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
}
else
{
}
else
{
// 跟现场确认此处值长只有一人,所以只做一人处理
// 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap
.
put
(
"name"
,
resMap
.
get
(
"name"
)
+
" "
+
"1人"
);
leaderMap
.
put
(
"name"
,
resMap
.
get
(
"name"
)
+
" "
+
"1人"
);
leaderMap
.
put
(
"value"
,
resMap
.
get
(
"value"
)
+
"-"
+
resMap
.
get
(
"tel"
));
leaderMap
.
put
(
"value"
,
resMap
.
get
(
"value"
)
+
(
ObjectUtils
.
isNotEmpty
(
resMap
.
get
(
"tel"
))
?
"-"
+
resMap
.
get
(
"tel"
)
:
""
));
}
}
res
.
add
(
leaderMap
);
res
.
add
(
leaderMap
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrganizationUserImpl.java
View file @
3f05f12c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.util.StringUtil
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
OrganizationUserImpl
extends
BaseService
<
OrganizationUser
,
OrganizationUser
,
OrganizationUserMapper
>
implements
IOrganizationUserService
{
public
class
OrganizationUserImpl
extends
BaseService
<
OrganizationUser
,
OrganizationUser
,
OrganizationUserMapper
>
implements
IOrganizationUserService
{
@Override
@Override
...
@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
...
@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
}
}
@Override
@Override
public
void
updateModelByTel
(
OrganizationUser
organizationUser
)
{
QueryWrapper
<
OrganizationUser
>
oldQuery
=
new
QueryWrapper
<>();
oldQuery
.
eq
(
"duty_leader"
,
1
);
List
<
OrganizationUser
>
oldList
=
this
.
baseMapper
.
selectList
(
oldQuery
);
if
(
0
<
oldList
.
size
())
{
oldList
.
forEach
(
x
->
{
x
.
setDutyLeader
(
false
);
this
.
baseMapper
.
updateById
(
x
);
});
}
LambdaQueryWrapper
<
OrganizationUser
>
wrapper
=
new
LambdaQueryWrapper
<>();
if
(!
ObjectUtils
.
isEmpty
(
organizationUser
.
getTelephone
()))
{
wrapper
.
eq
(
OrganizationUser:
:
getTelephone
,
organizationUser
.
getTelephone
());
}
else
if
(!
ObjectUtils
.
isEmpty
(
organizationUser
.
getSequenceNbr
()))
{
wrapper
.
eq
(
OrganizationUser:
:
getSequenceNbr
,
organizationUser
.
getSequenceNbr
());
}
List
<
OrganizationUser
>
newList
=
this
.
baseMapper
.
selectList
(
wrapper
);
newList
.
forEach
(
x
->
{
x
.
setDutyLeader
(
true
);
this
.
baseMapper
.
updateById
(
x
);
});
}
@Override
public
OrganizationUser
getDetailsById
(
Long
id
)
{
public
OrganizationUser
getDetailsById
(
Long
id
)
{
return
this
.
baseMapper
.
selectById
(
id
);
return
this
.
baseMapper
.
selectById
(
id
);
}
}
...
@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
...
@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
}
}
@Override
@Override
public
IPage
<
OrganizationUser
>
getPage
(
int
pageNumber
,
int
pageSize
,
String
tel
)
{
Page
<
OrganizationUser
>
page
=
new
Page
<>();
page
.
setSize
(
pageSize
);
page
.
setCurrent
(
pageNumber
);
LambdaQueryWrapper
<
OrganizationUser
>
wrapper
=
new
LambdaQueryWrapper
<>();
if
(
StringUtil
.
isNotEmpty
(
tel
))
{
wrapper
.
eq
(
OrganizationUser:
:
getTelephone
,
tel
);
}
wrapper
.
eq
(
OrganizationUser:
:
getIsDelete
,
false
);
wrapper
.
orderByDesc
(
OrganizationUser:
:
getSort
);
wrapper
.
groupBy
(
OrganizationUser:
:
getTelephone
);
return
this
.
baseMapper
.
selectPage
(
page
,
wrapper
);
}
@Override
public
int
deleteById
(
Long
id
)
{
public
int
deleteById
(
Long
id
)
{
return
this
.
baseMapper
.
deleteById
(
id
);
return
this
.
baseMapper
.
deleteById
(
id
);
}
}
...
...
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
3f05f12c
...
@@ -3894,4 +3894,16 @@
...
@@ -3894,4 +3894,16 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"ky"
id=
"2023-07-24"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"cb_organization_user"
columnName=
"duty_leader"
/>
</not>
</preConditions>
<comment>
cb_organization_user add column
</comment>
<sql>
alter table `cb_organization_user` add column `duty_leader` bit(1) NULL DEFAULT b'0' COMMENT '是否是值长'
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
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