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

添加大厅与窗口关联

parent d359400b
...@@ -28,4 +28,14 @@ public class WindowBusinessVo extends BaseEntityLong { ...@@ -28,4 +28,14 @@ public class WindowBusinessVo extends BaseEntityLong {
/** 窗口id列表 */ /** 窗口id列表 */
private List <Long> windowIdList; private List <Long> windowIdList;
/**
* 大厅ID
*/
private Long hallId;
/**
* 大厅名称
*/
private String hallName;
} }
\ No newline at end of file
...@@ -14,8 +14,8 @@ import com.mortals.xhx.module.business.model.BusinessQuery; ...@@ -14,8 +14,8 @@ import com.mortals.xhx.module.business.model.BusinessQuery;
import com.mortals.xhx.module.site.model.SiteBusinessEntity; import com.mortals.xhx.module.site.model.SiteBusinessEntity;
import com.mortals.xhx.module.site.model.SiteBusinessQuery; import com.mortals.xhx.module.site.model.SiteBusinessQuery;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.window.model.WindowEntity; import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.WindowQuery; import com.mortals.xhx.module.window.service.WindowHallService;
import com.mortals.xhx.module.window.service.WindowService; import com.mortals.xhx.module.window.service.WindowService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
...@@ -24,11 +24,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -24,11 +24,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.window.dao.WindowBusinessDao; import com.mortals.xhx.module.window.dao.WindowBusinessDao;
import com.mortals.xhx.module.window.model.WindowBusinessEntity;
import com.mortals.xhx.module.window.service.WindowBusinessService; import com.mortals.xhx.module.window.service.WindowBusinessService;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.mortals.framework.util.HttpUtil.HEADER_CONTENT_TYPE; import static com.mortals.framework.util.HttpUtil.HEADER_CONTENT_TYPE;
...@@ -46,15 +46,25 @@ import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_PHP_HTTP_URL; ...@@ -46,15 +46,25 @@ import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_PHP_HTTP_URL;
public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBusinessDao, WindowBusinessEntity, Long> implements WindowBusinessService { public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBusinessDao, WindowBusinessEntity, Long> implements WindowBusinessService {
@Autowired @Autowired
private WindowService windowService; private WindowService windowService;
@Autowired
private WindowHallService windowHallService;
@Override @Override
protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException { protected void findAfter(WindowBusinessEntity entity, PageInfo pageInfo, Context context, List<WindowBusinessEntity> list) throws AppException {
Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context); Map<Long, WindowEntity> collect = windowService.findToMap(new WindowQuery(), context);
Map<Long, WindowHallEntity> windowHallEntityMap = windowHallService.find(new WindowHallQuery(), context).parallelStream().collect(Collectors.toMap(x -> x.getWindowId(), Function.identity()));
Iterator iterator = list.iterator(); Iterator iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
WindowBusinessEntity item = (WindowBusinessEntity) iterator.next(); 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()); item.setFromnum(collect.get(item.getWindowId()).getFromnum());
WindowHallEntity windowHallEntity = windowHallEntityMap.get(item.getWindowId());
item.setHallId(windowHallEntity.getHallId() == null ? null : windowHallEntity.getWindowId());
item.setHallName(windowHallEntity.getHallName() == null ? "" : windowHallEntity.getHallName());
} else { } else {
iterator.remove(); iterator.remove();
} }
......
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