Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
230ea3eb
提交
230ea3eb
authored
11月 17, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备模块,配套设备模块,单位模块): 修改单位替换老数据,新增存放位置id字段
修改单位替换老数据,新增存放位置id字段
上级
64c236d1
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
40 行增加
和
10 行删除
+40
-10
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+13
-7
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+4
-1
DeviceLibraryUpdateVo.java
.../dev/device/library/subject/vo/DeviceLibraryUpdateVo.java
+1
-1
MatchingDeviceLibraryServiceImpl.java
...tching/service/impl/MatchingDeviceLibraryServiceImpl.java
+5
-1
UnitStoreLocationDao.java
...ykj/dev/device/user/subject/dao/UnitStoreLocationDao.java
+2
-0
UnitStoreLocationService.java
...device/user/subject/service/UnitStoreLocationService.java
+8
-0
UnitStoreLocationServiceImpl.java
...er/subject/service/impl/UnitStoreLocationServiceImpl.java
+7
-0
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
230ea3eb
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLog;
...
@@ -17,6 +17,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLog;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UnitStoreLocationService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
...
@@ -237,6 +238,8 @@ public class DeviceLibraryController {
...
@@ -237,6 +238,8 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
deviceLibraryEntities
);
return
ResultUtil
.
success
(
deviceLibraryEntities
);
}
}
@Autowired
private
UnitStoreLocationService
unitStoreLocationService
;
@ApiOperation
(
value
=
"模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/core/feature/summary"
)
@PostMapping
(
"/core/feature/summary"
)
public
ResponseEntity
selectCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
selectCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
...
@@ -282,7 +285,8 @@ public class DeviceLibraryController {
...
@@ -282,7 +285,8 @@ public class DeviceLibraryController {
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
ownUnits
=
new
ArrayList
<>();
List
<
String
>
ownUnits
=
new
ArrayList
<>();
List
<
String
>
locationUnits
=
new
ArrayList
<>();
List
<
String
>
locationUnits
=
new
ArrayList
<>();
Set
<
String
>
storageLocation
=
new
HashSet
<>();
// Set<String> storageLocation = new HashSet<>();
List
<
Integer
>
storageLocationId
=
new
ArrayList
<>();
//形态
//形态
List
<
Integer
>
types
=
new
ArrayList
<>();
List
<
Integer
>
types
=
new
ArrayList
<>();
resultList
.
forEach
(
deviceVo
->
{
resultList
.
forEach
(
deviceVo
->
{
...
@@ -292,10 +296,12 @@ public class DeviceLibraryController {
...
@@ -292,10 +296,12 @@ public class DeviceLibraryController {
names
.
add
(
deviceVo
.
getName
());
names
.
add
(
deviceVo
.
getName
());
ownUnits
.
add
(
deviceVo
.
getOwnUnit
());
ownUnits
.
add
(
deviceVo
.
getOwnUnit
());
locationUnits
.
add
(
deviceVo
.
getLocationUnit
());
locationUnits
.
add
(
deviceVo
.
getLocationUnit
());
storageLocation
.
add
(
deviceVo
.
getStorageLocation
());
storageLocation
Id
.
add
(
deviceVo
.
getStorageLocationId
());
types
.
add
(
deviceVo
.
getType
());
types
.
add
(
deviceVo
.
getType
());
});
});
Map
<
Integer
,
String
>
byStorageLocationIds
=
unitStoreLocationService
.
findByStorageLocationIds
(
storageLocationId
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
map
.
put
(
"pages"
,
deviceLibraryEntities
);
map
.
put
(
"pages"
,
deviceLibraryEntities
);
//修改 增加排序
//修改 增加排序
//做一下去重
//做一下去重
...
@@ -309,14 +315,14 @@ public class DeviceLibraryController {
...
@@ -309,14 +315,14 @@ public class DeviceLibraryController {
List
<
String
>
finalLocationUnits
=
DeviceModelSort
.
unitToSort
(
locationUnits
);
List
<
String
>
finalLocationUnits
=
DeviceModelSort
.
unitToSort
(
locationUnits
);
map
.
put
(
"locationUnits"
,
finalLocationUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
map
.
put
(
"locationUnits"
,
finalLocationUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
()));
map
.
put
(
"lifeStatus"
,
status
.
stream
().
map
(
integer
->
new
LifeStatusVo
(
integer
,
lifeStatusMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
map
.
put
(
"lifeStatus"
,
status
.
stream
().
map
(
integer
->
new
LifeStatusVo
(
integer
,
lifeStatusMap
.
get
(
integer
))).
collect
(
Collectors
.
toList
()));
map
.
put
(
"storageLocation
"
,
storageLocation
);
map
.
put
(
"storageLocation
Ids"
,
byStorageLocationIds
);
//形态
//形态
List
<
TypeVo
>
typeVoList
=
types
.
stream
().
distinct
().
map
(
integer
->
new
TypeVo
(
integer
,
styleMap
.
get
(
integer
))).
sorted
(
Comparator
.
comparing
(
TypeVo:
:
getType
)).
collect
(
Collectors
.
toList
());
List
<
TypeVo
>
typeVoList
=
types
.
stream
().
distinct
().
map
(
integer
->
new
TypeVo
(
integer
,
styleMap
.
get
(
integer
))).
sorted
(
Comparator
.
comparing
(
TypeVo:
:
getType
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"types"
,
typeVoList
);
map
.
put
(
"types"
,
typeVoList
);
return
ResultUtil
.
success
(
map
);
return
ResultUtil
.
success
(
map
);
}
}
@ApiOperation
(
value
=
"查询省直属模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"查询省直属模糊查询核心装备分页"
,
notes
=
"可以通过这个接口查询装备列表
,省直属
"
)
@PostMapping
(
"/core/feature/under/summary"
)
@PostMapping
(
"/core/feature/under/summary"
)
public
ResponseEntity
selectUnderCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
selectUnderCoreDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
...
@@ -434,7 +440,7 @@ public class DeviceLibraryController {
...
@@ -434,7 +440,7 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
map
);
return
ResultUtil
.
success
(
map
);
}
}
@ApiOperation
(
value
=
"模糊查询日常管理装备父子分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询日常管理装备父子分页"
,
notes
=
"可以通过这个接口查询装备列表
,本级
"
)
@PostMapping
(
"/core/feature/summary/daily"
)
@PostMapping
(
"/core/feature/summary/daily"
)
public
ResponseEntity
selectDailyDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
){
public
ResponseEntity
selectDailyDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
){
Boolean
hasModelDim
=
deviceLibrarySelectVo
.
getModelDim
()!=
null
;
Boolean
hasModelDim
=
deviceLibrarySelectVo
.
getModelDim
()!=
null
;
...
@@ -610,7 +616,7 @@ public class DeviceLibraryController {
...
@@ -610,7 +616,7 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
map
);
return
ResultUtil
.
success
(
map
);
}
}
@ApiOperation
(
value
=
"模糊查询核心装备统计分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询核心装备统计分页"
,
notes
=
"可以通过这个接口查询装备列表
,全省设备库
"
)
@PostMapping
(
"/core/stat/summary"
)
@PostMapping
(
"/core/stat/summary"
)
public
ResponseEntity
getDeviceStatisticsPage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
getDeviceStatisticsPage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
List
<
DeviceStatisticsVo
>
deviceStatisticsVoList
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
(),
deviceLibrarySelectVo
.
getPageable
().
getSort
());
List
<
DeviceStatisticsVo
>
deviceStatisticsVoList
=
deviceLibraryService
.
getDeviceStatisticsPage
(
deviceLibrarySelectVo
,
deviceLibrarySelectVo
.
getPageable
(),
deviceLibrarySelectVo
.
getPageable
().
getSort
());
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
230ea3eb
...
@@ -160,12 +160,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -160,12 +160,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
Integer
selectLevel
;
Integer
selectLevel
;
List
<
String
>
units
;
List
<
String
>
units
;
if
(
selectAreaId
==
0
){
if
(
selectAreaId
==
0
){
//区域id为0 就是直属(原来)
selectLevel
=
2
;
selectLevel
=
2
;
units
=
userPublicService
.
findAllUnitNameByType2
();
units
=
userPublicService
.
findAllUnitNameByType2
();
}
else
{
}
else
{
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
//查询该区域下的所有单位
//查询该区域下的所有单位
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
// units = userPublicService.findAllUnitNameByAreaId(selectAreaId);//修改了地区
units
=
userPublicService
.
findByAreaExhibitionIdSubordinateAll
(
selectAreaId
).
stream
().
map
(
Units:
:
getName
)
.
collect
(
Collectors
.
toList
());
}
}
//市或县筛选出装备所属单位在units列表中的装备 zsp:或者所在
//市或县筛选出装备所属单位在units列表中的装备 zsp:或者所在
if
(
selectLevel
==
3
||
selectLevel
==
2
||
selectLevel
==
4
)
{
if
(
selectLevel
==
3
||
selectLevel
==
2
||
selectLevel
==
4
)
{
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceLibraryUpdateVo.java
浏览文件 @
230ea3eb
...
@@ -48,7 +48,7 @@ public class DeviceLibraryUpdateVo {
...
@@ -48,7 +48,7 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty
(
"库存位置"
)
@ApiModelProperty
(
"库存位置"
)
private
String
storageLocation
;
private
String
storageLocation
;
@ApiModelProperty
(
"库存位置
i
d"
)
@ApiModelProperty
(
"库存位置
I
d"
)
private
Integer
storageLocationId
;
private
Integer
storageLocationId
;
@ApiModelProperty
(
"备注"
)
@ApiModelProperty
(
"备注"
)
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/impl/MatchingDeviceLibraryServiceImpl.java
浏览文件 @
230ea3eb
...
@@ -14,6 +14,7 @@ import com.tykj.dev.device.matching.service.MatchingDeviceLibraryService;
...
@@ -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.domin.MatchingDeviceLibrary
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.MatchingDeviceSelectVo
;
import
com.tykj.dev.device.matching.subject.vo.RelationDeviceVo
;
import
com.tykj.dev.device.matching.subject.vo.RelationDeviceVo
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
...
@@ -189,7 +190,10 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
...
@@ -189,7 +190,10 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
//获取区域等级
//获取区域等级
Integer
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
Integer
selectLevel
=
userPublicService
.
getArea
(
selectAreaId
).
getType
();
//获取区域下所有单位名称
//获取区域下所有单位名称
List
<
String
>
units
=
userPublicService
.
findAllUnitNameByAreaId
(
selectAreaId
);
// List<String> units = userPublicService.findAllUnitNameByAreaId(selectAreaId);
List
<
String
>
units
=
userPublicService
.
findByAreaExhibitionIdSubordinateAll
(
selectAreaId
).
stream
()
.
map
(
Units:
:
getName
).
collect
(
Collectors
.
toList
());
// List<Integer> units = userPublicService.findAllUnitIdByAreaId(selectAreaId);
// List<Integer> units = userPublicService.findAllUnitIdByAreaId(selectAreaId);
//如果是市或县,筛选出创建单位在units中的设备
//如果是市或县,筛选出创建单位在units中的设备
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
if
(
selectLevel
==
3
||
selectLevel
==
2
)
{
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/dao/UnitStoreLocationDao.java
浏览文件 @
230ea3eb
...
@@ -8,4 +8,6 @@ import java.util.List;
...
@@ -8,4 +8,6 @@ import java.util.List;
public
interface
UnitStoreLocationDao
extends
JpaRepository
<
UnitStoreLocation
,
Integer
>,
JpaSpecificationExecutor
<
UnitStoreLocation
>
{
public
interface
UnitStoreLocationDao
extends
JpaRepository
<
UnitStoreLocation
,
Integer
>,
JpaSpecificationExecutor
<
UnitStoreLocation
>
{
List
<
UnitStoreLocation
>
findAllByUnitIdAndTypeName
(
Integer
unitId
,
String
typeName
);
List
<
UnitStoreLocation
>
findAllByUnitIdAndTypeName
(
Integer
unitId
,
String
typeName
);
List
<
UnitStoreLocation
>
findAllByIdIn
(
List
<
Integer
>
ids
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UnitStoreLocationService.java
浏览文件 @
230ea3eb
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.user.subject.entity.UnitStoreLocation;
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.user.subject.entity.UnitStoreLocation;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* @author zjm
* @author zjm
...
@@ -17,4 +18,11 @@ public interface UnitStoreLocationService extends PublicService<UnitStoreLocatio
...
@@ -17,4 +18,11 @@ public interface UnitStoreLocationService extends PublicService<UnitStoreLocatio
List
<
UnitStoreLocation
>
findAllByUnitIdAndTypeName
(
UnitStoreLocationVo
unitStoreLocationVo
);
List
<
UnitStoreLocation
>
findAllByUnitIdAndTypeName
(
UnitStoreLocationVo
unitStoreLocationVo
);
Map
<
Integer
,
String
>
findByUnitIdToDeviceMap
(
Integer
unitId
);
Map
<
Integer
,
String
>
findByUnitIdToDeviceMap
(
Integer
unitId
);
/**
* 根据id查询名称
* @param ids id集合
* @return map key为id value 名称
*/
Map
<
Integer
,
String
>
findByStorageLocationIds
(
List
<
Integer
>
ids
);
}
}
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitStoreLocationServiceImpl.java
浏览文件 @
230ea3eb
...
@@ -4,6 +4,7 @@ import com.tykj.dev.device.user.base.req.UnitStoreLocationVo;
...
@@ -4,6 +4,7 @@ import com.tykj.dev.device.user.base.req.UnitStoreLocationVo;
import
com.tykj.dev.device.user.subject.dao.UnitStoreLocationDao
;
import
com.tykj.dev.device.user.subject.dao.UnitStoreLocationDao
;
import
com.tykj.dev.device.user.subject.entity.UnitStoreLocation
;
import
com.tykj.dev.device.user.subject.entity.UnitStoreLocation
;
import
com.tykj.dev.device.user.subject.service.UnitStoreLocationService
;
import
com.tykj.dev.device.user.subject.service.UnitStoreLocationService
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -40,6 +41,12 @@ public class UnitStoreLocationServiceImpl implements UnitStoreLocationService {
...
@@ -40,6 +41,12 @@ public class UnitStoreLocationServiceImpl implements UnitStoreLocationService {
.
collect
(
Collectors
.
toMap
(
UnitStoreLocation:
:
getId
,
UnitStoreLocation:
:
getStoreName
));
.
collect
(
Collectors
.
toMap
(
UnitStoreLocation:
:
getId
,
UnitStoreLocation:
:
getStoreName
));
}
}
@Override
public
Map
<
Integer
,
String
>
findByStorageLocationIds
(
List
<
Integer
>
ids
)
{
List
<
UnitStoreLocation
>
storeLocations
=
unitStoreLocationDao
.
findAllByIdIn
(
ids
);
return
storeLocations
.
stream
().
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getId
,
UnitStoreLocation:
:
getStoreName
));
}
@Override
@Override
public
UnitStoreLocation
save
(
UnitStoreLocation
unitStoreLocation
)
{
public
UnitStoreLocation
save
(
UnitStoreLocation
unitStoreLocation
)
{
return
unitStoreLocationDao
.
save
(
unitStoreLocation
);
return
unitStoreLocationDao
.
save
(
unitStoreLocation
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论