Commit 550737d4 authored by 赵啸非's avatar 赵啸非

添加已经部署脚本

parent 0ad9ad15
......@@ -69,4 +69,8 @@ public interface SiteService extends ICRUDCacheService<SiteEntity, Long> {
void deleteBysiteIdAndSource(Long siteId, Integer source, Context context);
void updateAllSiteTree(Context context);
void updateSiteInfo(SiteEntity siteEntity, Context context);
}
\ No newline at end of file
......@@ -33,6 +33,12 @@ import com.mortals.xhx.common.utils.MatterHtmlParseUtil;
import com.mortals.xhx.common.utils.SyncTreeSiteThread;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.app.model.AppCategoryEntity;
import com.mortals.xhx.module.app.model.AppCategoryQuery;
import com.mortals.xhx.module.app.model.AppEntity;
import com.mortals.xhx.module.app.model.AppQuery;
import com.mortals.xhx.module.app.service.AppCategoryService;
import com.mortals.xhx.module.app.service.AppService;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaQuery;
import com.mortals.xhx.module.area.service.AreaService;
......@@ -117,6 +123,12 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Autowired
private IDeviceFeign deviceFeign;
@Autowired
private AppService appService;
@Autowired
private AppCategoryService appCategoryService;
private volatile Boolean refresh = false;
@Override
......@@ -904,6 +916,45 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
ThreadPool.getInstance().execute(syncTreeSiteThread);
}
/**
* 外部添加站点,更新站点相关信息
*
* @param siteEntity
* @param context
*/
@Override
public void updateSiteInfo(SiteEntity siteEntity, Context context) {
List<AppEntity> updateAppList = appService.find(new AppQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppList)){
appService.update(updateAppList,context);
}
List<AppCategoryEntity> updateAppCategoryList = appCategoryService.find(new AppCategoryQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateAppCategoryList)){
appCategoryService.update(updateAppCategoryList,context);
}
List<WindowEntity> updateWindowList = windowService.find(new WindowQuery().siteId(siteEntity.getId())).stream().map(item -> {
item.setSiteId(siteEntity.getId());
item.setSiteName(siteEntity.getSiteName());
return item;
}).collect(Collectors.toList());
if(!ObjectUtils.isEmpty(updateWindowList)){
windowService.update(updateWindowList,context);
}
}
public List<MatterEntity> subList(List<MatterEntity> firstList, List<MatterEntity> secondList) {
Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet());
......
......@@ -555,6 +555,10 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
}
SiteEntity save = this.service.save(siteEntity, getContext());
//todo 更新相关表中的站点名称,站点编码,站点ID
this.service.updateSiteInfo(siteEntity,getContext());
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_DATA, save);
......@@ -567,4 +571,7 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
return jsonObject.toJSONString();
}
}
\ 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