Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f61756d9
提交
f61756d9
authored
8月 17, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(系统配置): 新增了库房存放位置
新增了一个map去存放库房
上级
b859b659
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
30 行增加
和
5 行删除
+30
-5
ConfigApplication.java
.../src/main/java/com/tykj/dev/config/ConfigApplication.java
+1
-2
ConfigCache.java
.../src/main/java/com/tykj/dev/config/cache/ConfigCache.java
+11
-0
SystemConfigService.java
...java/com/tykj/dev/config/service/SystemConfigService.java
+4
-0
SystemConfigServiceImpl.java
...tykj/dev/config/service/impl/SystemConfigServiceImpl.java
+7
-0
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+2
-2
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+5
-1
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/ConfigApplication.java
浏览文件 @
f61756d9
...
@@ -7,8 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
...
@@ -7,8 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author huangxiahao
* @author huangxiahao
*/
*/
@SpringBootApplication
(
scanBasePackages
=
{
@SpringBootApplication
(
scanBasePackages
=
{
"com.tykj.dev.config"
,
"com.tykj.dev.*"
"com.tykj.dev.misc"
}
}
)
)
public
class
ConfigApplication
{
public
class
ConfigApplication
{
...
...
dev-config/src/main/java/com/tykj/dev/config/cache/ConfigCache.java
浏览文件 @
f61756d9
...
@@ -30,6 +30,9 @@ public class ConfigCache {
...
@@ -30,6 +30,9 @@ public class ConfigCache {
private
Map
<
Integer
,
String
>
positionMap
;
private
Map
<
Integer
,
String
>
positionMap
;
private
Map
<
Integer
,
String
>
storageLocationMap
;
public
ConfigCache
(
List
<
SystemConfig
>
systemConfigs
){
public
ConfigCache
(
List
<
SystemConfig
>
systemConfigs
){
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingRangeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingRange"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingRangeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingRange"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
...
@@ -41,6 +44,8 @@ public class ConfigCache {
...
@@ -41,6 +44,8 @@ public class ConfigCache {
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
}
}
public
Map
<
Integer
,
String
>
getMatchingRangeMap
()
{
public
Map
<
Integer
,
String
>
getMatchingRangeMap
()
{
...
@@ -83,6 +88,11 @@ public class ConfigCache {
...
@@ -83,6 +88,11 @@ public class ConfigCache {
return
allotTypeMap
;
return
allotTypeMap
;
}
}
public
Map
<
Integer
,
String
>
getStorageLocationMap
()
{
return
storageLocationMap
;
}
public
ConfigCache
refresh
(
List
<
SystemConfig
>
systemConfigs
){
public
ConfigCache
refresh
(
List
<
SystemConfig
>
systemConfigs
){
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
lifeStatusMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"lifeStatus"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingRangeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingRange"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
matchingRangeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"matchingRange"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
...
@@ -94,6 +104,7 @@ public class ConfigCache {
...
@@ -94,6 +104,7 @@ public class ConfigCache {
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
natureMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"nature"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
positionMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"position"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
allotTypeMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"allotType"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
this
.
storageLocationMap
=
systemConfigs
.
stream
().
filter
(
systemConfig
->
"storageLocation"
.
equals
(
systemConfig
.
getEnglishName
())).
collect
(
Collectors
.
toMap
(
SystemConfig:
:
getValue
,
SystemConfig:
:
getLabel
));
return
this
;
return
this
;
}
}
}
}
dev-config/src/main/java/com/tykj/dev/config/service/SystemConfigService.java
浏览文件 @
f61756d9
...
@@ -2,6 +2,8 @@ package com.tykj.dev.config.service;
...
@@ -2,6 +2,8 @@ package com.tykj.dev.config.service;
import
com.tykj.dev.config.domin.SystemConfig
;
import
com.tykj.dev.config.domin.SystemConfig
;
import
java.util.Map
;
/**
/**
* @author dengdiyi
* @author dengdiyi
*/
*/
...
@@ -16,4 +18,6 @@ public interface SystemConfigService {
...
@@ -16,4 +18,6 @@ public interface SystemConfigService {
Integer
getMaxValue
(
String
englishName
);
Integer
getMaxValue
(
String
englishName
);
SystemConfig
getOne
(
Integer
id
);
SystemConfig
getOne
(
Integer
id
);
Map
<
Integer
,
String
>
getStorageLocationMap
();
}
}
dev-config/src/main/java/com/tykj/dev/config/service/impl/SystemConfigServiceImpl.java
浏览文件 @
f61756d9
...
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
...
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
public
class
SystemConfigServiceImpl
implements
SystemConfigService
{
public
class
SystemConfigServiceImpl
implements
SystemConfigService
{
...
@@ -53,4 +54,10 @@ public class SystemConfigServiceImpl implements SystemConfigService {
...
@@ -53,4 +54,10 @@ public class SystemConfigServiceImpl implements SystemConfigService {
public
SystemConfig
getOne
(
Integer
id
)
{
public
SystemConfig
getOne
(
Integer
id
)
{
return
systemConfigDao
.
findById
(
id
).
get
();
return
systemConfigDao
.
findById
(
id
).
get
();
}
}
@Override
public
Map
<
Integer
,
String
>
getStorageLocationMap
()
{
return
configCache
.
getStorageLocationMap
();
}
}
}
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
f61756d9
...
@@ -815,15 +815,16 @@ public class DeviceLibraryController {
...
@@ -815,15 +815,16 @@ public class DeviceLibraryController {
List
<
DeviceLibrary
>
byIds
=
deviceLibraryService
.
findByIds
(
deviceSelectIdsVo
.
getIds
());
List
<
DeviceLibrary
>
byIds
=
deviceLibraryService
.
findByIds
(
deviceSelectIdsVo
.
getIds
());
byIds
.
forEach
(
DeviceLibrary:
:
setConfigName
);
byIds
.
forEach
(
DeviceLibrary:
:
setConfigName
);
//key为所属单位
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
byIds
.
stream
().
collect
(
Collectors
.
groupingBy
(
DeviceLibrary:
:
getOwnUnit
));
Map
<
String
,
List
<
DeviceLibrary
>>
map
=
byIds
.
stream
().
collect
(
Collectors
.
groupingBy
(
DeviceLibrary:
:
getOwnUnit
));
List
<
DeviceNewVo
>
deviceNewVoList
=
new
ArrayList
<>();
List
<
DeviceNewVo
>
deviceNewVoList
=
new
ArrayList
<>();
map
.
forEach
((
k
,
v
)->{
map
.
forEach
((
k
,
v
)->{
DeviceNewVo
deviceNewVo
=
new
DeviceNewVo
(
v
.
get
(
0
).
getModel
(),
v
.
get
(
0
).
getName
(),
DeviceNewVo
deviceNewVo
=
new
DeviceNewVo
(
v
.
get
(
0
).
getModel
(),
v
.
get
(
0
).
getName
(),
v
.
get
(
0
).
getMatchingRangeName
(),
v
.
get
(
0
).
getTypeName
(),
v
.
get
(
0
).
getMatchingRangeName
(),
v
.
get
(
0
).
getTypeName
(),
v
.
size
(),
k
,
DeviceModelSort
.
toUnitSort
(
k
),
v
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()));
v
.
size
(),
k
,
DeviceModelSort
.
toUnitSort
(
k
),
v
.
stream
().
map
(
DeviceLibrary:
:
getId
).
collect
(
Collectors
.
toList
()));
deviceNewVoList
.
add
(
deviceNewVo
);
deviceNewVoList
.
add
(
deviceNewVo
);
});
});
//实现按照组织架构排序
deviceNewVoList
.
sort
(
Comparator
.
comparing
(
DeviceNewVo:
:
getLevel
));
deviceNewVoList
.
sort
(
Comparator
.
comparing
(
DeviceNewVo:
:
getLevel
));
return
deviceNewVoList
;
return
deviceNewVoList
;
}
}
...
@@ -833,7 +834,6 @@ public class DeviceLibraryController {
...
@@ -833,7 +834,6 @@ public class DeviceLibraryController {
*/
*/
@GetMapping
(
"/setNumber"
)
@GetMapping
(
"/setNumber"
)
public
List
<
DeviceLibrary
>
setNumber
(){
public
List
<
DeviceLibrary
>
setNumber
(){
List
<
DeviceLibrary
>
allListAndParent
=
getAllListAndParent
();
List
<
DeviceLibrary
>
allListAndParent
=
getAllListAndParent
();
AtomicInteger
sortNum
=
new
AtomicInteger
();
AtomicInteger
sortNum
=
new
AtomicInteger
();
return
setOrderNumber
(
sortNum
,
allListAndParent
);
return
setOrderNumber
(
sortNum
,
allListAndParent
);
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
f61756d9
...
@@ -791,5 +791,9 @@ public class StorageBillController {
...
@@ -791,5 +791,9 @@ public class StorageBillController {
/**
/**
* 根据任务id 查询单据
* 根据任务id 查询单据
*/
*/
// public Map<>
@ApiOperation
(
"根据任务id获取单据集合"
)
@GetMapping
(
"/getFileList"
)
public
ResponseEntity
getFiles
(
Integer
taskId
){
return
ResponseEntity
.
ok
(
storageBillService
.
getFileList
(
taskId
));
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论