Commit d35053f5 authored by 赵啸非's avatar 赵啸非

修改窗口导入后redis信息id未更新

parent 6e669953
......@@ -69,13 +69,9 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
Map<Long, List<WorkmanEntity>> workmanCollect = workmanService.find(new WorkmanQuery()).stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId()));
Map<Long, List<WindowBusinessEntity>> windowBusinessCollect = windowBusinessService.find(new WindowBusinessQuery())
.stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId()));
Map<Long, List<WindowMatterEntity>> windowMatterCollect = windowMatterService.find(new WindowMatterQuery())
.stream().filter(f -> f.getWindowId() != null).collect(Collectors.groupingBy(x -> x.getWindowId()));
Map<Long, WindowHallEntity> windowHallMap = windowHallService.find(new WindowHallQuery()).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), y -> y, (o, n) -> n));
list.stream().peek(item -> {
if (!ObjectUtils.isEmpty(workmanCollect.get(item.getId()))) {
item.setWorkmanList(workmanCollect.get(item.getId()));
......@@ -83,7 +79,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
if (!ObjectUtils.isEmpty(windowBusinessCollect.get(item.getId()))) {
item.setWindowBusinessList(windowBusinessCollect.get(item.getId()));
}
if (!ObjectUtils.isEmpty(windowMatterCollect.get(item.getId()))) {
item.setWindowMatterList(windowMatterCollect.get(item.getId()));
}
......@@ -92,7 +87,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
item.setHallId(windowHallEntity.getHallId());
item.setHallName(windowHallEntity.getHallName());
}
}).count();
super.findAfter(params, pageInfo, context, list);
}
......@@ -109,7 +103,6 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
}
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
//windowBusinessQuery.setSiteBusinessIdList(businessIdList);
//先删除后再新增
windowBusinessQuery.setWindowId(windowId);
Long[] ids = windowBusinessService.find(windowBusinessQuery).stream()
......@@ -215,6 +208,13 @@ public class WindowServiceImpl extends AbstractCRUDCacheServiceImpl<WindowDao, W
@Override
protected void saveAfter(WindowEntity entity, Context context) throws AppException {
super.saveAfter(entity, context);
//判断是否存在id,如果不存在 查询后获取
if(entity.newEntity()){
WindowEntity windowEntity = this.selectOne(new WindowQuery().siteId(entity.getSiteId()).fromnum(entity.getFromnum()));
if(!ObjectUtils.isEmpty(windowEntity)){
entity.setId(windowEntity.getId());
}
}
pushChangeMsg(entity.getId());
}
......
......@@ -167,10 +167,8 @@ public class WindowController extends BaseCRUDJsonBodyMappingController<WindowSe
*/
@Override
public void doImportDataBefore(List<WindowEntity> list, boolean updateSupport, Context context) throws AppException {
String siteId = request.getParameter("siteId");
String deptId = request.getParameter("deptId");
log.info("siteId:{}", siteId);
SiteEntity siteEntity = null;
DeptEntity deptEntity = null;
if (!ObjectUtils.isEmpty(siteId)) {
......
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