Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
7d8270b1
Commit
7d8270b1
authored
Feb 01, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加服务检测拉起脚本
parent
f204dbfd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
66 deletions
+110
-66
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+32
-45
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowBusinessServiceImpl.java
...module/window/service/impl/WindowBusinessServiceImpl.java
+28
-13
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowMatterServiceImpl.java
...x/module/window/service/impl/WindowMatterServiceImpl.java
+27
-0
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowServiceImpl.java
...als/xhx/module/window/service/impl/WindowServiceImpl.java
+12
-8
base-manager/src/main/java/com/mortals/xhx/module/window/web/WindowMatterController.java
...mortals/xhx/module/window/web/WindowMatterController.java
+11
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
7d8270b1
...
...
@@ -57,6 +57,7 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
PARAM_SERVER_HTTP_IMAGE_URL
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
PARAM_SERVER_HTTP_URL
;
/**
* SiteService
...
...
@@ -100,51 +101,52 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Autowired
private
IDeviceFeign
deviceFeign
;
private
volatile
Boolean
refresh
=
false
;
@Override
protected
void
updateBefore
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
//校验下前后名称是否一直 如果不一致 同步修改所以关联
SiteEntity
oldSite
=
this
.
get
(
entity
.
getId
(),
context
);
if
(!
oldSite
.
getSiteName
().
equals
(
entity
.
getSiteName
()))
{
if
(!
oldSite
.
getSiteName
().
equals
(
entity
.
getSiteName
()))
{
//todo
//更新关联站点名称
updateAssociateSiteName
(
oldSite
,
entity
,
context
);
//通知设备更新站点信息
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
entity
.
getId
());
Rest
<
Void
>
rest
=
deviceFeign
.
refreshMessage
(
devicePdu
);
log
.
info
(
"调用刷新结果:{}"
,
JSON
.
toJSONString
(
rest
));
updateAssociateSiteName
(
oldSite
,
entity
,
context
);
refresh
=
true
;
}
super
.
updateBefore
(
entity
,
context
);
}
private
void
updateAssociateSiteName
(
SiteEntity
oldSite
,
SiteEntity
newSite
,
Context
context
)
{
private
void
updateAssociateSiteName
(
SiteEntity
oldSite
,
SiteEntity
newSite
,
Context
context
)
{
//更新窗口站点名称
WindowEntity
windowEntity
=
new
WindowEntity
();
windowEntity
.
setSiteName
(
newSite
.
getSiteName
());
WindowEntity
condition
=
new
WindowEntity
();
condition
.
setSiteName
(
oldSite
.
getSiteName
());
windowService
.
updateBatch
(
windowEntity
,
condition
,
context
);
windowService
.
updateBatch
(
windowEntity
,
condition
,
context
);
//更新站点业务名称
SiteBusinessEntity
siteBusinessEntity
=
new
SiteBusinessEntity
();
siteBusinessEntity
.
setSiteName
(
newSite
.
getSiteName
());
SiteBusinessEntity
siteBusinessCondition
=
new
SiteBusinessEntity
();
siteBusinessCondition
.
setSiteName
(
oldSite
.
getSiteName
());
siteBusinessService
.
updateBatch
(
siteBusinessEntity
,
siteBusinessCondition
,
context
);
siteBusinessService
.
updateBatch
(
siteBusinessEntity
,
siteBusinessCondition
,
context
);
//更新站点事项名称
SiteMatterEntity
siteMatterEntity
=
new
SiteMatterEntity
();
siteMatterEntity
.
setSiteName
(
newSite
.
getSiteName
());
SiteMatterEntity
siteMatterCondition
=
new
SiteMatterEntity
();
siteMatterCondition
.
setSiteName
(
oldSite
.
getSiteName
());
siteMatterService
.
updateBatch
(
siteMatterEntity
,
siteMatterCondition
,
context
);
siteMatterService
.
updateBatch
(
siteMatterEntity
,
siteMatterCondition
,
context
);
//更新站点主题事项名称
SiteThemeMatterEntity
siteThemeMatterEntity
=
new
SiteThemeMatterEntity
();
siteThemeMatterEntity
.
setSiteName
(
newSite
.
getSiteName
());
SiteThemeMatterEntity
siteThemeMatterCondition
=
new
SiteThemeMatterEntity
();
siteThemeMatterCondition
.
setSiteName
(
oldSite
.
getSiteName
());
siteThemeMatterService
.
updateBatch
(
siteThemeMatterEntity
,
siteThemeMatterCondition
,
context
);
siteThemeMatterService
.
updateBatch
(
siteThemeMatterEntity
,
siteThemeMatterCondition
,
context
);
//更新工作人员站点
...
...
@@ -152,31 +154,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
workmanEntity
.
setSiteName
(
newSite
.
getSiteName
());
WorkmanEntity
workmanEntityCondition
=
new
WorkmanEntity
();
workmanEntityCondition
.
setSiteName
(
oldSite
.
getSiteName
());
workmanService
.
updateBatch
(
workmanEntity
,
workmanEntityCondition
,
context
);
/* List<WindowEntity> windowEntityList = windowService.find(new WindowQuery().siteId(entity.getId()));
windowEntityList.forEach(item->item.setSiteName(entity.getSiteName()));
windowService.update(windowEntityList, context);
//更新站点业务名称
List<SiteBusinessEntity> siteBusinessEntities = siteBusinessService.find(new SiteBusinessQuery().siteId(entity.getId()));
siteBusinessEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteBusinessService.update(siteBusinessEntities, context);
//更新站点主题事项名称
List<SiteMatterEntity> siteMatterEntities = siteMatterService.find(new SiteMatterQuery().siteId(entity.getId()));
siteMatterEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteMatterService.update(siteMatterEntities, context);
//更新站点主题事项名称
List<SiteThemeMatterEntity> siteThemeMatterEntities = siteThemeMatterService.find(new SiteThemeMatterQuery().siteId(entity.getId()));
siteThemeMatterEntities.forEach(item->item.setSiteName(entity.getSiteName()));
siteThemeMatterService.update(siteThemeMatterEntities, context);
workmanService
.
updateBatch
(
workmanEntity
,
workmanEntityCondition
,
context
);
//更新工作人员站点
List<WorkmanEntity> workmanEntities = workmanService.find(new WorkmanQuery().siteId(entity.getId()));
workmanEntities.forEach(item->item.setSiteName(entity.getSiteName()));
workmanService.update(workmanEntities, context);*/
}
@Override
...
...
@@ -202,7 +181,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected
void
saveAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
//刷新站点树
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
Rest
<
String
>
rest
=
userFeign
.
synchSiteAuth
();
if
(
rest
.
getCode
().
equals
(
YesNoEnum
.
YES
.
getValue
()))
{
UserPdu
userPdu
=
new
UserPdu
();
...
...
@@ -215,6 +193,15 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//更新同步部门相关
deptService
.
syncDeptBySiteId
(
entity
,
context
);
if
(
refresh
)
{
//通知设备更新站点信息
DevicePdu
devicePdu
=
new
DevicePdu
();
devicePdu
.
setSiteId
(
entity
.
getId
());
Rest
<
Void
>
rest1
=
deviceFeign
.
refreshMessage
(
devicePdu
);
log
.
info
(
"调用刷新结果:{}"
,
JSON
.
toJSONString
(
rest1
));
refresh
=
false
;
}
super
.
saveAfter
(
entity
,
context
);
}
...
...
@@ -418,15 +405,15 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
}
@Override
public
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
)
{
public
Rest
<
List
<
SiteAreaVo
>>
getAreaSitesBySite
(
SiteQuery
query
,
Context
context
)
{
List
<
SiteAreaVo
>
list
=
new
ArrayList
<>();
//获取当前节点的第一层子节点
if
(
ObjectUtils
.
isEmpty
(
query
.
getAreaName
()))
{
if
(
ObjectUtils
.
isEmpty
(
query
.
getAreaName
()))
{
throw
new
AppException
(
"区域名称查询参数不能为空!"
);
}
//SiteEntity siteCache = this.getCache(query.getId().toString());
AreaEntity
areaEntity
=
areaService
.
selectOne
(
new
AreaQuery
().
name
(
query
.
getAreaName
()),
context
);
if
(
ObjectUtils
.
isEmpty
(
areaEntity
))
{
AreaEntity
areaEntity
=
areaService
.
selectOne
(
new
AreaQuery
().
name
(
query
.
getAreaName
()),
context
);
if
(
ObjectUtils
.
isEmpty
(
areaEntity
))
{
throw
new
AppException
(
"区域名称不存在!"
);
}
if
(
"False"
.
equalsIgnoreCase
(
areaEntity
.
getHaveSonArea
()))
{
...
...
@@ -442,7 +429,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
String
matchCode
=
child
.
getAreaCode
().
replaceAll
(
"(0)+$"
,
""
);
SiteQuery
siteQuery
=
new
SiteQuery
();
siteQuery
.
setAreaCode
(
matchCode
+
"%"
);
if
(!
ObjectUtils
.
isEmpty
(
query
.
getSiteName
()))
{
if
(!
ObjectUtils
.
isEmpty
(
query
.
getSiteName
()))
{
siteQuery
.
setSiteName
(
query
.
getSiteName
());
}
List
<
SiteEntity
>
siteEntities
=
this
.
find
(
siteQuery
);
...
...
@@ -516,7 +503,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
public
void
changeUrlPath
(
SiteEntity
siteEntity
)
{
if
(!
ObjectUtils
.
isEmpty
(
siteEntity
)
&&
!
ObjectUtils
.
isEmpty
(
siteEntity
.
getLogoPath
()))
{
String
domain
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_HTTP_
IMAGE_
URL
,
"http://192.168.0.98:11091"
);
String
domain
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_HTTP_URL
,
"http://192.168.0.98:11091"
);
String
fullPath
=
URLUtil
.
completeUrl
(
domain
,
siteEntity
.
getLogoPath
());
siteEntity
.
setLogoFullPath
(
fullPath
);
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowBusinessServiceImpl.java
View file @
7d8270b1
package
com.mortals.xhx.module.window.service.impl
;
import
cn.hutool.core.collection.ListUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
...
...
@@ -34,12 +35,12 @@ import static com.mortals.framework.util.HttpUtil.HEADER_CONTENT_TYPE;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
PARAM_SERVER_PHP_HTTP_URL
;
/**
* WindowBusinessService
* 窗口业务 service实现
*
* @author zxfei
* @date 2022-01-12
*/
* WindowBusinessService
* 窗口业务 service实现
*
* @author zxfei
* @date 2022-01-12
*/
@Service
(
"windowBusinessService"
)
@Slf4j
public
class
WindowBusinessServiceImpl
extends
AbstractCRUDServiceImpl
<
WindowBusinessDao
,
WindowBusinessEntity
,
Long
>
implements
WindowBusinessService
{
...
...
@@ -50,11 +51,11 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
protected
void
findAfter
(
WindowBusinessEntity
entity
,
PageInfo
pageInfo
,
Context
context
,
List
<
WindowBusinessEntity
>
list
)
throws
AppException
{
Map
<
Long
,
WindowEntity
>
collect
=
windowService
.
findToMap
(
new
WindowQuery
(),
context
);
Iterator
iterator
=
list
.
iterator
();
while
(
iterator
.
hasNext
()){
while
(
iterator
.
hasNext
())
{
WindowBusinessEntity
item
=
(
WindowBusinessEntity
)
iterator
.
next
();
if
(!
ObjectUtils
.
isEmpty
(
item
.
getWindowId
())&&!
ObjectUtils
.
isEmpty
(
collect
.
get
(
item
.
getWindowId
())))
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getWindowId
())
&&
!
ObjectUtils
.
isEmpty
(
collect
.
get
(
item
.
getWindowId
())))
{
item
.
setFromnum
(
collect
.
get
(
item
.
getWindowId
()).
getFromnum
());
}
else
{
}
else
{
iterator
.
remove
();
}
}
...
...
@@ -62,6 +63,21 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
}
/**
* @param ids
* @param context
* @throws AppException
*/
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
Arrays
.
asList
(
ids
).
forEach
(
id
->
{
WindowBusinessEntity
windowBusinessEntity
=
this
.
get
(
id
,
context
);
pushChangeMsg
(
windowBusinessEntity
);
});
super
.
removeBefore
(
ids
,
context
);
}
/**
* @param entity
* @param context
...
...
@@ -75,7 +91,6 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
}
/**
* @param entity
* @param context
...
...
@@ -89,10 +104,10 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
private
void
pushChangeMsg
(
WindowBusinessEntity
entity
)
{
String
phpUrl
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_PHP_HTTP_URL
,
"http://172.15.28.116:8090"
);
phpUrl
+=
"/api/window/winNameChange"
;
phpUrl
+=
"/api/window/winNameChange"
;
HashMap
<
String
,
Object
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"windowid"
,
entity
.
getWindowId
());
paramsMap
.
put
(
"typeinfo"
,
1
);
paramsMap
.
put
(
"typeinfo"
,
1
);
String
resp
=
null
;
try
{
Map
<
String
,
String
>
header
=
new
HashMap
<>();
...
...
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowMatterServiceImpl.java
View file @
7d8270b1
...
...
@@ -13,6 +13,7 @@ import com.mortals.xhx.module.window.dao.WindowMatterDao;
import
com.mortals.xhx.module.window.model.WindowMatterEntity
;
import
com.mortals.xhx.module.window.service.WindowMatterService
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -40,6 +41,32 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte
super
.
saveAfter
(
entity
,
context
);
}
/**
* @param id
* @param context
* @throws AppException
*/
@Override
protected
void
removeBefore
(
Long
id
,
Context
context
)
throws
AppException
{
WindowMatterEntity
windowMatterEntity
=
this
.
get
(
id
,
context
);
pushChangeMsg
(
windowMatterEntity
);
super
.
removeBefore
(
id
,
context
);
}
/**
* @param ids
* @param context
* @throws AppException
*/
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
Arrays
.
asList
(
ids
).
forEach
(
id
->{
WindowMatterEntity
windowMatterEntity
=
this
.
get
(
id
,
context
);
pushChangeMsg
(
windowMatterEntity
);
});
super
.
removeBefore
(
ids
,
context
);
}
/**
* @param entity
* @param context
...
...
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowServiceImpl.java
View file @
7d8270b1
...
...
@@ -142,6 +142,10 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
List
<
WindowMatterEntity
>
windowMatterEntities
=
windowMatterService
.
find
(
windowMatterQuery
);
windowMatterService
.
removeList
(
windowMatterEntities
,
context
);
}
Arrays
.
asList
(
ids
).
forEach
(
id
->
{
pushChangeMsg
(
id
);
});
super
.
removeAfter
(
ids
,
context
,
result
);
}
...
...
@@ -154,7 +158,7 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
@Override
protected
void
updateAfter
(
WindowEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
pushChangeMsg
(
entity
);
pushChangeMsg
(
entity
.
getId
()
);
}
/**
...
...
@@ -165,18 +169,18 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
@Override
protected
void
saveAfter
(
WindowEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveAfter
(
entity
,
context
);
pushChangeMsg
(
entity
);
pushChangeMsg
(
entity
.
getId
()
);
}
private
void
pushChangeMsg
(
WindowEntity
entity
)
{
log
.
info
(
"pushChangeMsg:{}"
,
JSON
.
toJSONString
(
entity
));
private
void
pushChangeMsg
(
Long
windowId
)
{
log
.
info
(
"pushChangeMsg:{}"
,
JSON
.
toJSONString
(
windowId
));
String
phpUrl
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_PHP_HTTP_URL
,
"http://172.15.28.116:8090"
);
phpUrl
+=
"/api/window/winNameChange"
;
phpUrl
+=
"/api/window/winNameChange"
;
HashMap
<
String
,
Object
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"windowid"
,
entity
.
getId
()
);
paramsMap
.
put
(
"typeinfo"
,
1
);
paramsMap
.
put
(
"windowid"
,
windowId
);
paramsMap
.
put
(
"typeinfo"
,
1
);
phpUrl
+=
"/api/window/winNameChange"
;
phpUrl
+=
"/api/window/winNameChange"
;
String
resp
=
null
;
try
{
Map
<
String
,
String
>
header
=
new
HashMap
<>();
...
...
base-manager/src/main/java/com/mortals/xhx/module/window/web/WindowMatterController.java
View file @
7d8270b1
...
...
@@ -81,4 +81,15 @@ public class WindowMatterController extends BaseCRUDJsonBodyMappingController<Wi
}
return
super
.
saveAfter
(
entity
,
model
,
context
);
}
/**
* @param ids
* @param context
* @throws AppException
*/
@Override
protected
void
deleteBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
super
.
deleteBefore
(
ids
,
context
);
}
}
\ No newline at end of file
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