Commit 322c581c authored by 赵啸非's avatar 赵啸非

修改根据业务查询部门逻辑

parent b9b680b2
...@@ -25,8 +25,6 @@ import java.util.Map; ...@@ -25,8 +25,6 @@ import java.util.Map;
public interface MatterService extends ICRUDService<MatterEntity, Long> { public interface MatterService extends ICRUDService<MatterEntity, Long> {
MatterEntity getCache(String id);
/** /**
* 添加业务到站点 * 添加业务到站点
* *
......
...@@ -61,7 +61,7 @@ import java.util.stream.Collectors; ...@@ -61,7 +61,7 @@ import java.util.stream.Collectors;
*/ */
@Service("matterService") @Service("matterService")
@Slf4j @Slf4j
public class MatterServiceImpl extends AbstractCRUDCacheServiceImpl<MatterDao, MatterEntity, Long> implements MatterService { public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, MatterEntity, Long> implements MatterService {
@Autowired @Autowired
private SiteMatterService siteMatterService; private SiteMatterService siteMatterService;
@Autowired @Autowired
......
...@@ -4,6 +4,7 @@ import com.mortals.framework.exception.AppException; ...@@ -4,6 +4,7 @@ import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterService; import com.mortals.xhx.module.matter.service.MatterService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -16,6 +17,7 @@ import org.springframework.util.ObjectUtils; ...@@ -16,6 +17,7 @@ import org.springframework.util.ObjectUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* SiteMatterService * SiteMatterService
...@@ -32,9 +34,14 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -32,9 +34,14 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
@Override @Override
protected void findAfter(SiteMatterEntity params, PageInfo pageInfo, Context context, List<SiteMatterEntity> list) throws AppException { protected void findAfter(SiteMatterEntity params, PageInfo pageInfo, Context context, List<SiteMatterEntity> list) throws AppException {
if(list.size()>1000000){
}else{
List<Long> matterIdlist = list.stream().map(item -> item.getMatterId()).collect(Collectors.toList());
Map<Long, MatterEntity> matterEntityMap = matterService.find(new MatterQuery().idList(matterIdlist)).parallelStream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list.forEach(item -> { list.forEach(item -> {
if (!ObjectUtils.isEmpty(item.getMatterId())) { if (!ObjectUtils.isEmpty(item.getMatterId())) {
MatterEntity matterEntity = matterService.getCache(item.getMatterId().toString()); MatterEntity matterEntity = matterEntityMap.get(item.getMatterId());
if (!ObjectUtils.isEmpty(matterEntity)) { if (!ObjectUtils.isEmpty(matterEntity)) {
item.setBelongDept(matterEntity.getBelongDept()); item.setBelongDept(matterEntity.getBelongDept());
item.setWindowToTheSceneNum(matterEntity.getWindowToTheSceneNum()); item.setWindowToTheSceneNum(matterEntity.getWindowToTheSceneNum());
...@@ -44,6 +51,24 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -44,6 +51,24 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
} }
} }
}); });
}
/*
list.forEach(item -> {
if (!ObjectUtils.isEmpty(item.getMatterId())) {
MatterEntity matterEntity = matterService.getCache(item.getMatterId().toString());
if (!ObjectUtils.isEmpty(matterEntity)) {
item.setBelongDept(matterEntity.getBelongDept());
item.setWindowToTheSceneNum(matterEntity.getWindowToTheSceneNum());
item.setOnlineToTheSceneNum(matterEntity.getOnlineToTheSceneNum());
item.setDeptCode(matterEntity.getDeptCode());
item.setAreaCode(matterEntity.getAreaCode());
}
}
});*/
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
} }
......
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