Commit 01d42593 authored by 赵啸非's avatar 赵啸非

添加服务检测拉起脚本

parent d42a7031
...@@ -24,6 +24,7 @@ import com.mortals.xhx.module.site.service.SiteThemeMatterService; ...@@ -24,6 +24,7 @@ import com.mortals.xhx.module.site.service.SiteThemeMatterService;
import com.mortals.xhx.module.site.service.SiteThemeService; import com.mortals.xhx.module.site.service.SiteThemeService;
import com.mortals.xhx.utils.SpringUtils; import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import org.springframework.util.ObjectUtils;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -76,26 +77,29 @@ public class SyncGovMatterDetailThread implements Runnable { ...@@ -76,26 +77,29 @@ public class SyncGovMatterDetailThread implements Runnable {
if (rest.getCode() == YesNoEnum.YES.getValue()) { if (rest.getCode() == YesNoEnum.YES.getValue()) {
List<MatterEntity> matterEntityList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue())); List<MatterEntity> matterEntityList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()).source(SourceEnum.政务网.getValue()));
List<MatterEntity> unSyncDetailMatterList = matterEntityList.stream().filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false")).collect(Collectors.toList()); List<MatterEntity> unSyncDetailMatterList = matterEntityList.stream().filter(f -> f.getHaveGetMatterInfo().equalsIgnoreCase("false")).collect(Collectors.toList());
log.info("同步站点事项到站点.....");
//查询站点事项相关 //查询站点事项相关
List<SiteEntity> siteEntities = siteService.find(new SiteQuery().areaCode(siteEntity.getAreaCode())); List<SiteEntity> siteEntities = siteService.find(new SiteQuery().areaCode(siteEntity.getAreaCode()));
//删除站点与政务事项相关项 //删除站点与政务事项相关项
for (SiteEntity site : siteEntities) { /* for (SiteEntity site : siteEntities) {
siteMatterService.deleteBysiteIdAndSource(site.getId(), SourceEnum.政务网.getValue(), context); siteMatterService.deleteBysiteIdAndSource(site.getId(), SourceEnum.政务网.getValue(), context);
} }*/
//重新添加 //重新添加
for (SiteEntity site : siteEntities) {
List<SiteMatterEntity> siteMatterList = matterEntityList.stream().map(item -> { if (ObjectUtils.isEmpty(siteEntities)) {
return matterService.switchMatterToSiteMatter(item, site, context).getData(); log.info("同步站点事项到站点.....");
}).filter(f -> f != null).collect(Collectors.toList()); for (SiteEntity site : siteEntities) {
List<SiteMatterEntity> siteMatterList = matterEntityList.stream().map(item -> {
List<List<SiteMatterEntity>> partition = ListUtil.partition(siteMatterList, 100); return matterService.switchMatterToSiteMatter(item, site, context).getData();
for (List<SiteMatterEntity> rests : partition) { }).filter(f -> f != null).collect(Collectors.toList());
siteMatterService.save(rests);
List<List<SiteMatterEntity>> partition = ListUtil.partition(siteMatterList, 100);
for (List<SiteMatterEntity> rests : partition) {
siteMatterService.save(rests);
}
} }
log.info("同步站点事项到站点完成.....");
} }
log.info("同步站点事项到站点完成.....");
log.info("同步站点事项详细条数....." + unSyncDetailMatterList.size()); log.info("同步站点事项详细条数....." + unSyncDetailMatterList.size());
unSyncDetailMatterList.parallelStream().forEach(matterEntity -> { unSyncDetailMatterList.parallelStream().forEach(matterEntity -> {
matterService.buildMatterDetail(matterEntity, context); matterService.buildMatterDetail(matterEntity, context);
......
...@@ -112,7 +112,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -112,7 +112,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//todo //todo
//更新关联站点名称 //更新关联站点名称
updateAssociateSiteName(oldSite, entity, context); updateAssociateSiteName(oldSite, entity, context);
refresh = true; refresh = true;
} }
...@@ -174,14 +173,9 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -174,14 +173,9 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected void saveBefore(SiteEntity entity, Context context) throws AppException { protected void saveBefore(SiteEntity entity, Context context) throws AppException {
List<SiteEntity> siteEntities = this.find(new SiteQuery().areaCode(entity.getAreaCode())); List<SiteEntity> siteEntities = this.find(new SiteQuery().areaCode(entity.getAreaCode()));
entity.setSiteCode(entity.getAreaCode() + Constant.SITE_SPLIT_MARK + StringUtils.lpad(siteEntities.size() + 1, Constant.SITE_CODE_NUM)); entity.setSiteCode(entity.getAreaCode() + Constant.SITE_SPLIT_MARK + StringUtils.lpad(siteEntities.size() + 1, Constant.SITE_CODE_NUM));
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
@Override @Override
protected void saveAfter(SiteEntity entity, Context context) throws AppException { protected void saveAfter(SiteEntity entity, Context context) throws AppException {
//刷新站点树 //刷新站点树
...@@ -216,7 +210,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -216,7 +210,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
} }
} }
//查詢指定的站點ids //查詢指定的站點ids
log.info(String.format("siteQuery==>%s", JSON.toJSONString(siteQuery))); log.info(String.format("siteQuery==>%s", JSON.toJSONString(siteQuery)));
List<SiteEntity> siteList = this.find(siteQuery); List<SiteEntity> siteList = this.find(siteQuery);
...@@ -314,6 +307,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -314,6 +307,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override @Override
protected void updateAfter(SiteEntity entity, Context context) throws AppException { protected void updateAfter(SiteEntity entity, Context context) throws AppException {
super.updateAfter(entity, context);
//刷新站点树 //刷新站点树
Rest<String> rest = userFeign.synchSiteAuth(); Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) { if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
...@@ -332,7 +326,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -332,7 +326,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
refresh = false; refresh = false;
} }
super.updateAfter(entity, context);
} }
...@@ -561,11 +554,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -561,11 +554,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
log.info("需要添加事项数量====" + subList.size()); log.info("需要添加事项数量====" + subList.size());
//差集进行插入并更新详细数据 //差集进行插入并更新详细数据
if (!ObjectUtils.isEmpty(subList)) { if (!ObjectUtils.isEmpty(subList)) {
/* for (MatterEntity matterEntity : subList) { for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode()); DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName()); matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterService.save(matterEntity, context); matterService.save(matterEntity, context);
}*/ }
List<List<MatterEntity>> partition = ListUtil.partition(subList, 100); List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) { for (List<MatterEntity> matterEntityList : partition) {
......
...@@ -18,8 +18,12 @@ POST {{baseUrl}}/app/list ...@@ -18,8 +18,12 @@ POST {{baseUrl}}/app/list
Content-Type: application/json Content-Type: application/json
{ {
"page":1, "siteId":1,
"size":-1 "idList": [1,2,3,4],
"type": 1,
"shelves": 1,
"page":1,
"size":-1
} }
......
...@@ -18,9 +18,8 @@ POST {{baseUrl}}/app/dataset/list ...@@ -18,9 +18,8 @@ POST {{baseUrl}}/app/dataset/list
Content-Type: application/json Content-Type: application/json
{ {
"appId": 20, "siteId": 1,
"fieldName": "标题", "appId": 2,
"fieldValue": "管理办法",
"page": 1, "page": 1,
"size": 10 "size": 10
} }
......
...@@ -13,5 +13,9 @@ ...@@ -13,5 +13,9 @@
}, },
"base-yibintest": { "base-yibintest": {
"baseUrl": "http://192.168.2.169:11078/base" "baseUrl": "http://192.168.2.169:11078/base"
},
"base-yibin": {
"baseUrl": "http://10.12.185.213:11078/base"
} }
} }
\ No newline at end of file
...@@ -126,7 +126,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id); ...@@ -126,7 +126,7 @@ client.global.set("Matter_id", JSON.parse(response.body).data.id);
%} %}
###基础事项查看 ###基础事项查看
GET {{baseUrl}}/matter/info?id=5809 GET {{baseUrl}}/matter/info?id=34000
Accept: application/json Accept: application/json
###基础事项编辑 ###基础事项编辑
......
...@@ -4,8 +4,8 @@ POST {{baseUrl}}/skin/base/list ...@@ -4,8 +4,8 @@ POST {{baseUrl}}/skin/base/list
Content-Type: application/json Content-Type: application/json
{ {
"page":1, "page": 1,
"size":10 "size": 10
} }
...@@ -15,20 +15,19 @@ Authorization: {{authToken}} ...@@ -15,20 +15,19 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"categoryId":1, "categoryId": 1,
"productId":1, "productId": 5,
"name": "321311", "name": "导视机",
"productName":"22", "imageResolution": "1",
"productName": "22",
"skinFieldList": [ "skinFieldList": [
{ {
"fieldCode":"2psfz0", "fieldCode": "2psfz0",
"fieldName":"wp1zqc", "fieldName": "wp1zqc",
"fieldType":"1", "fieldType": "1",
"fieldValue":"srpx1u" "fieldValue": "srpx1u"
}
}
] ]
} }
> {% > {%
......
...@@ -5,7 +5,7 @@ Content-Type: application/json ...@@ -5,7 +5,7 @@ Content-Type: application/json
{ {
"loginName":"admin", "loginName":"admin",
"password":"adsmile", "password":"admin",
"securityCode":"8888" "securityCode":"8888"
} }
......
...@@ -7,5 +7,9 @@ ...@@ -7,5 +7,9 @@
}, },
"portal-test": { "portal-test": {
"baseUrl": "http://192.168.0.98:11078/zwfw" "baseUrl": "http://192.168.0.98:11078/zwfw"
},
"portal-yibin": {
"baseUrl": "http://10.12.185.213:11078/zwfw"
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment