Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
112148f4
提交
112148f4
authored
11月 11, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(配套模块,统计模块): 不同单位登录工作台显示的配套设备的数量
不同单位登录工作台显示的配套设备的数量
上级
0c37538a
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
8 行删除
+27
-8
MatchingDeviceLibraryServiceImpl.java
...tching/service/impl/MatchingDeviceLibraryServiceImpl.java
+6
-4
StatisticalServiceImpl.java
.../dev/statistical/service/impl/StatisticalServiceImpl.java
+21
-4
没有找到文件。
dev-matching/src/main/java/com/tykj/dev/device/matching/service/impl/MatchingDeviceLibraryServiceImpl.java
浏览文件 @
112148f4
...
...
@@ -14,6 +14,7 @@ import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.RelationDeviceVo
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
...
...
@@ -163,7 +164,8 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
}
}
}
@Autowired
private
UnitsService
unitsService
;
@Override
public
List
<
MatchingDeviceLibrary
>
getMatchingDevicePage
(
MatchingDeviceSelectVo
matchingDeviceSelectVo
)
{
PredicateBuilder
<
MatchingDeviceLibrary
>
predicateBuilder
=
getPredicate
(
matchingDeviceSelectVo
);
...
...
@@ -187,8 +189,8 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
//获取区域等级
Integer
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
//获取区域下所有单位名称
//
List<String> units = userPublicService.findAllUnitNameByAreaId(selectAreaId);
List
<
Integer
>
units
=
userPublicService
.
findAllUnitIdByAreaId
(
selectAreaId
);
List
<
String
>
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
//
List<Integer> units = userPublicService.findAllUnitIdByAreaId(selectAreaId);
//如果是市或县,筛选出创建单位在units中的设备
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll(getPredicate(matchingDeviceSelectVo).build())
...
...
@@ -197,7 +199,7 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
// .collect(Collectors.toList());
List
<
MatchingDeviceLibrary
>
resultList
=
matchingDeviceLibraryDao
.
findAll
(
getPredicate
(
matchingDeviceSelectVo
).
build
())
.
stream
()
.
filter
(
matchingDeviceLibraryEntity
->
units
.
contains
(
matchingDeviceLibraryEntity
.
getCreateUnitId
()))
.
filter
(
matchingDeviceLibraryEntity
->
units
.
contains
(
unitsService
.
findById
(
matchingDeviceLibraryEntity
.
getCreateUnitId
()).
getName
()))
.
collect
(
Collectors
.
toList
());
// List<MatchingDeviceLibrary> resultList = matchingDeviceLibraryDao.findAll().stream()
// .filter(matchingDeviceLibraryEntity -> units.contains(matchingDeviceLibraryEntity.getCreateUnit()))
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/service/impl/StatisticalServiceImpl.java
浏览文件 @
112148f4
...
...
@@ -9,7 +9,9 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo
;
import
com.tykj.dev.device.matching.repository.MatchingDeviceLibraryDao
;
import
com.tykj.dev.device.matching.service.MatchingDeviceLibraryService
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.packing.repository.PackingLibraryDao
;
import
com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask
;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
...
...
@@ -511,6 +513,9 @@ public class StatisticalServiceImpl implements StatisticalService {
@Autowired
private
AreaService
areaService
;
@Autowired
private
MatchingDeviceLibraryService
matchingDeviceLibraryService
;
@Override
public
WorkBench
getWorkBenchStat
()
{
Integer
unit
=
userUtils
.
getCurrentUnitId
();
...
...
@@ -524,10 +529,22 @@ public class StatisticalServiceImpl implements StatisticalService {
workBench
.
setAllDeviceNum
(
deviceLibraries
.
size
());
workBench
.
setSelfDeviceNum
(
Long
.
valueOf
(
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getOwnUnit
().
equals
(
unitName
)).
count
()).
intValue
());
//查询当前登录单位的配套设备
List
<
MatchingDeviceLibrary
>
allByCreateUnitId
=
matchingDeviceLibraryDao
.
findAllByCreateUnitId
(
unit
);
if
(!
allByCreateUnitId
.
isEmpty
()){
workBench
.
setMatchingDeviceNum
(
allByCreateUnitId
.
size
());
//查询当前登录单位的配套设备 以及下级所有单位
// List<MatchingDeviceLibrary> allByCreateUnitId = matchingDeviceLibraryDao.findAllByCreateUnitId(unit);
// if (!allByCreateUnitId.isEmpty()){
// workBench.setMatchingDeviceNum(allByCreateUnitId.size());
// }else {
// workBench.setMatchingDeviceNum(0);
// }
MatchingDeviceSelectVo
matchingDeviceSelectVo
=
new
MatchingDeviceSelectVo
();
//通过单位id查询区域id
Integer
currentUnitId
=
userUtils
.
getCurrentUnitId
();
Units
units
=
unitsService
.
findById
(
currentUnitId
);
matchingDeviceSelectVo
.
setAreaId
(
units
.
getAreaId
());
List
<
MatchingDeviceLibrary
>
matchingDevicePage
=
matchingDeviceLibraryService
.
getMatchingDevicePage
(
matchingDeviceSelectVo
);
if
(!
matchingDevicePage
.
isEmpty
()){
workBench
.
setMatchingDeviceNum
(
matchingDevicePage
.
size
());
}
else
{
workBench
.
setMatchingDeviceNum
(
0
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论