Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
598d7b72
提交
598d7b72
authored
11月 22, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(装备模块,配套设备模块,统计模块): 解决了配套设备的数量和序列号区间不一致,解决了工作台本级设备库和全省设备库的数量
解决了配套设备的数量和序列号区间不一致,解决了工作台本级设备库和全省设备库的数量
上级
a2f46ace
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
92 行增加
和
15 行删除
+92
-15
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+2
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+6
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+6
-0
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+2
-1
DeviceSeqUtil.java
.../src/main/java/com/tykj/dev/misc/utils/DeviceSeqUtil.java
+60
-3
StatisticalServiceImpl.java
.../dev/statistical/service/impl/StatisticalServiceImpl.java
+16
-11
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
598d7b72
...
@@ -171,6 +171,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
...
@@ -171,6 +171,8 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
List
<
DeviceLibrary
>
findAllByPackingIdIn
(
List
<
Integer
>
packingIds
);
List
<
DeviceLibrary
>
findAllByPackingIdIn
(
List
<
Integer
>
packingIds
);
List
<
DeviceLibrary
>
findAllByOwnUnitInOrLocationUnitIn
(
List
<
String
>
unitName
,
List
<
String
>
unitName1
);
@Modifying
@Modifying
@Query
(
"update DeviceLibrary d set d.model = :newModel where d.model = :oldModel"
)
@Query
(
"update DeviceLibrary d set d.model = :newModel where d.model = :oldModel"
)
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
598d7b72
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.library.service;
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.library.service;
import
com.tykj.dev.config.UpdateCache
;
import
com.tykj.dev.config.UpdateCache
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.library.subject.vo.*
;
import
com.tykj.dev.device.user.util.DecryptMD5
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
...
@@ -513,4 +514,9 @@ public interface DeviceLibraryService {
...
@@ -513,4 +514,9 @@ public interface DeviceLibraryService {
*/
*/
void
updateDeviceLocationAndOwnUnit
(
UpdateUnitVo
updateUnitVo
);
void
updateDeviceLocationAndOwnUnit
(
UpdateUnitVo
updateUnitVo
);
/**
* @param unitId 单位id
*/
List
<
DeviceLibrary
>
getDeviceByUnitNameAll
(
Integer
unitId
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
598d7b72
...
@@ -1220,6 +1220,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1220,6 +1220,12 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
deviceLibraryDao
.
updateOwnUnit
(
updateUnitVo
.
getOriginUnitName
(),
updateUnitVo
.
getUpdateUnitName
());
deviceLibraryDao
.
updateOwnUnit
(
updateUnitVo
.
getOriginUnitName
(),
updateUnitVo
.
getUpdateUnitName
());
}
}
@Override
public
List
<
DeviceLibrary
>
getDeviceByUnitNameAll
(
Integer
unitId
)
{
List
<
String
>
unitNames
=
userPublicService
.
findByUnitIdSubordinateAll
(
unitId
).
stream
().
map
(
Units:
:
getName
).
collect
(
Collectors
.
toList
());
return
deviceLibraryDao
.
findAllByOwnUnitInOrLocationUnitIn
(
unitNames
,
unitNames
);
}
// @Override
// @Override
// @UpdateCache
// @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) {
// public int updatePartParentId(List<Integer> deviceIds) {
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
598d7b72
...
@@ -121,7 +121,8 @@ public class MatchingDeviceController {
...
@@ -121,7 +121,8 @@ public class MatchingDeviceController {
//当手动输入序列号的时候 需要进行遍历成集合
//当手动输入序列号的时候 需要进行遍历成集合
matchingDeviceSaveVos
.
forEach
(
matchingDeviceSaveVo
->
{
matchingDeviceSaveVos
.
forEach
(
matchingDeviceSaveVo
->
{
List
<
String
>
deviceSeqs
=
DeviceSeqUtil
.
createDeviceSeqs
(
matchingDeviceSaveVo
.
getSeqNumber
(),
matchingDeviceSaveVo
.
getStorageCount
());
// List<String> deviceSeqs = DeviceSeqUtil.createDeviceSeqs(matchingDeviceSaveVo.getSeqNumber(), matchingDeviceSaveVo.getStorageCount());
List
<
String
>
deviceSeqs
=
DeviceSeqUtil
.
getIntervalSeqsForMatchingDevice
(
matchingDeviceSaveVo
.
getSeqNumber
());
matchingDeviceSaveVo
.
setSeqList
(
deviceSeqs
);
matchingDeviceSaveVo
.
setSeqList
(
deviceSeqs
);
});
});
//做校验 数量跟序列号
//做校验 数量跟序列号
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/DeviceSeqUtil.java
浏览文件 @
598d7b72
...
@@ -253,7 +253,8 @@ public class DeviceSeqUtil {
...
@@ -253,7 +253,8 @@ public class DeviceSeqUtil {
if
(
num1
.
length
()
!=
num2
.
length
()){
if
(
num1
.
length
()
!=
num2
.
length
()){
throw
new
ApiException
(
"序列号区间后面数字位数不相同"
);
throw
new
ApiException
(
"序列号区间后面数字位数不相同"
);
}
}
else
if
(
new
BigInteger
(
num1
).
compareTo
(
new
BigInteger
(
num2
))
>
0
){
else
if
(
new
BigInteger
(
num1
).
compareTo
(
new
BigInteger
(
num2
))
>
0
){
throw
new
ApiException
(
"序列号区间前数字大于后数字"
);
throw
new
ApiException
(
"序列号区间前数字大于后数字"
);
}
}
else
{
else
{
...
@@ -278,7 +279,62 @@ public class DeviceSeqUtil {
...
@@ -278,7 +279,62 @@ public class DeviceSeqUtil {
}
}
}
}
else
{
else
{
throw
new
ApiException
(
"序列号区间包含多个-"
);
throw
new
ApiException
(
"序列号区间包含多个-,或者输入不是序列号区间"
);
}
return
stringList
;
}
/**
* @param s 区间字符串
* 根据区间字符串获取该区间序列号列表
*/
public
static
List
<
String
>
getIntervalSeqsForMatchingDevice
(
String
s
){
List
<
String
>
stringList
=
new
ArrayList
<>();
//根据-分隔
String
[]
strings
=
s
.
split
(
"-"
);
if
(
strings
.
length
==
2
){
//左区间字符串
String
s1
=
strings
[
0
];
//右区间字符串
String
s2
=
strings
[
1
];
// if (s1.length()!=s2.length()){
// throw new ApiException("序列号区间前面字符位数不相同");
// }
// else {
//获得左区间最后几位的数字
String
num1
=
s1
.
replaceAll
(
".*[^\\d](?=(\\d+))"
,
""
);
//获得右区间最后几位的数字
String
num2
=
s2
.
replaceAll
(
".*[^\\d](?=(\\d+))"
,
""
);
// if (num1.length() != num2.length()){
//// throw new ApiException("序列号区间后面数字位数不相同");
// }
// else
if
(
new
BigInteger
(
num1
).
compareTo
(
new
BigInteger
(
num2
))
>
0
){
throw
new
ApiException
(
"序列号区间前数字大于后数字"
);
}
else
{
BigInteger
minSeq
=
new
BigInteger
(
num1
);
BigInteger
maxSeq
=
new
BigInteger
(
num2
);
if
(
maxSeq
.
compareTo
(
minSeq
)
<
0
){
throw
new
ApiException
(
"前区间数字大于后区间"
);
}
else
{
while
(
minSeq
.
compareTo
(
maxSeq
)<=
0
){
StringBuffer
stringBuffer
=
new
StringBuffer
();
//拼接数字之前的字符串
stringBuffer
.
append
(
s1
,
0
,
s1
.
length
()-
num1
.
length
());
//将数字按长度格式化,缺位补0
String
codeFormat
=
"%0"
+
num1
.
length
()
+
"d"
;
stringBuffer
.
append
(
String
.
format
(
codeFormat
,
minSeq
));
stringList
.
add
(
stringBuffer
.
toString
());
minSeq
=
minSeq
.
add
(
new
BigInteger
(
"1"
));
}
}
}
}
// }
else
{
throw
new
ApiException
(
"序列号区间包含多个-,或者输入不是序列号区间"
);
}
}
return
stringList
;
return
stringList
;
}
}
...
@@ -295,7 +351,8 @@ public class DeviceSeqUtil {
...
@@ -295,7 +351,8 @@ public class DeviceSeqUtil {
//左区间字符串
//左区间字符串
String
s1
=
strings
[
0
];
String
s1
=
strings
[
0
];
if
(
s1
.
equals
(
"0"
)){
if
(
s1
.
equals
(
"0"
)){
s1
=
s1
+
"0"
;
// s1 = s1+"0";
s1
=
"0"
+
s1
;
}
}
//右区间字符串
//右区间字符串
String
s2
=
strings
[
1
];
String
s2
=
strings
[
1
];
...
...
dev-statistical/src/main/java/com/tykj/dev/statistical/service/impl/StatisticalServiceImpl.java
浏览文件 @
598d7b72
...
@@ -525,18 +525,13 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -525,18 +525,13 @@ public class StatisticalServiceImpl implements StatisticalService {
// deviceLibrarySelectVo.setAreaId(areaCache.findByName("浙江省").getId());
// deviceLibrarySelectVo.setAreaId(areaCache.findByName("浙江省").getId());
deviceLibrarySelectVo
.
setAreaId
(
unitsService
.
findById
(
unit
).
getAreaId
());
deviceLibrarySelectVo
.
setAreaId
(
unitsService
.
findById
(
unit
).
getAreaId
());
workBench
.
setPackingNum
(
packingLibraryDao
.
findAllByIsRootAndPackingStatus
(
0
,
2
).
size
());
workBench
.
setPackingNum
(
packingLibraryDao
.
findAllByIsRootAndPackingStatus
(
0
,
2
).
size
());
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
getCoreDevicePage
(
deviceLibrarySelectVo
);
// List<DeviceLibrary> deviceLibraries = deviceLibraryService.getCoreDevicePage(deviceLibrarySelectVo);
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryService
.
getDeviceByUnitNameAll
(
unit
);
workBench
.
setAllDeviceNum
(
deviceLibraries
.
size
());
workBench
.
setAllDeviceNum
(
deviceLibraries
.
size
());
workBench
.
setSelfDeviceNum
(
Long
.
valueOf
(
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
workBench
.
setSelfDeviceNum
(
Long
.
valueOf
(
deviceLibraries
.
stream
().
filter
(
deviceLibrary
->
deviceLibrary
.
getOwnUnit
().
equals
(
unitName
)).
count
()).
intValue
());
deviceLibrary
.
getOwnUnit
().
equals
(
unitName
)).
count
()).
intValue
());
//查询当前登录单位的配套设备 以及下级所有单位
//查询当前登录单位的配套设备 以及下级所有单位
// List<MatchingDeviceLibrary> allByCreateUnitId = matchingDeviceLibraryDao.findAllByCreateUnitId(unit);
// if (!allByCreateUnitId.isEmpty()){
// workBench.setMatchingDeviceNum(allByCreateUnitId.size());
// }else {
// workBench.setMatchingDeviceNum(0);
// }
//通过单位id查询区域id
//通过单位id查询区域id
Integer
currentUnitId
=
userUtils
.
getCurrentUnitId
();
Integer
currentUnitId
=
userUtils
.
getCurrentUnitId
();
List
<
MatchingDeviceLibrary
>
matchingDevicePage
=
matchingDeviceLibraryService
.
getMatchingByUnitIdAll
(
currentUnitId
);
List
<
MatchingDeviceLibrary
>
matchingDevicePage
=
matchingDeviceLibraryService
.
getMatchingByUnitIdAll
(
currentUnitId
);
...
@@ -551,10 +546,20 @@ public class StatisticalServiceImpl implements StatisticalService {
...
@@ -551,10 +546,20 @@ public class StatisticalServiceImpl implements StatisticalService {
List
<
Task
>
allTasks
=
taskDao
.
findAll
();
List
<
Task
>
allTasks
=
taskDao
.
findAll
();
List
<
Task
>
tasks
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
7
).
collect
(
Collectors
.
toList
());
List
<
Task
>
tasks
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
7
).
collect
(
Collectors
.
toList
());
List
<
Task
>
tasks2
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
4
).
collect
(
Collectors
.
toList
());
List
<
Task
>
tasks2
=
allTasks
.
stream
().
filter
(
task
->
task
.
getBusinessType
()==
4
).
collect
(
Collectors
.
toList
());
workBench
.
setCheckNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
"check"
.
equals
(
task
.
getCustomInfo
())).
count
()).
intValue
());
workBench
.
setCheckNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
"check"
.
equals
(
task
.
getCustomInfo
())
workBench
.
setCompleteCheckNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
"check"
.
equals
(
task
.
getCustomInfo
())).
count
()).
intValue
());
&&
unit
.
equals
(
task
.
getOwnUnit
())&&
task
.
getParentTaskId
()
==
0
).
count
()).
intValue
());
workBench
.
setExamNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())&&
task
.
getOwnUnit
().
equals
(
unit
)).
count
()).
intValue
());
workBench
.
setCompleteCheckNum
(
Long
.
valueOf
(
tasks
.
stream
()
workBench
.
setExamCompleteNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())&&
task
.
getOwnUnit
().
equals
(
unit
)).
count
()).
intValue
());
.
filter
(
task
->
(
task
.
getBillStatus
()==
9999
||
task
.
getBillStatus
()
==
20001
)&&
"check"
.
equals
(
task
.
getCustomInfo
())
&&
unit
.
equals
(
task
.
getOwnUnit
())&&
task
.
getParentTaskId
()
==
0
)
.
count
()).
intValue
());
//检查
workBench
.
setExamNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())&&
task
.
getOwnUnit
().
equals
(
unit
))
.
count
()).
intValue
());
workBench
.
setExamCompleteNum
(
Long
.
valueOf
(
tasks
.
stream
().
filter
(
task
->
(
task
.
getBillStatus
()==
9999
||
task
.
getBillStatus
()
==
20001
)
&&
task
.
getParentTaskId
()==
0
&&
"exam"
.
equals
(
task
.
getCustomInfo
())
&&
task
.
getOwnUnit
().
equals
(
unit
))
.
count
()).
intValue
());
workBench
.
setSelfCheckNum
(
Long
.
valueOf
(
tasks2
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
unit
.
equals
(
task
.
getOwnUnit
())).
count
()).
intValue
());
workBench
.
setSelfCheckNum
(
Long
.
valueOf
(
tasks2
.
stream
().
filter
(
task
->
task
.
getBillStatus
()==
9999
&&
unit
.
equals
(
task
.
getOwnUnit
())).
count
()).
intValue
());
List
<
TrainTheme
>
themeList
=
trainThemeDao
.
findAll
();
List
<
TrainTheme
>
themeList
=
trainThemeDao
.
findAll
();
workBench
.
setTrainNum
(
themeList
.
size
());
workBench
.
setTrainNum
(
themeList
.
size
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论