Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
7ae59048
提交
7ae59048
authored
5月 16, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[核查模块] 重构了即时计算模块
上级
df1a6641
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
89 行增加
和
26 行删除
+89
-26
CheckType.java
...va/com/tykj/dev/device/confirmcheck/common/CheckType.java
+1
-0
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+0
-0
CheckAreaStatVo.java
...kj/dev/device/confirmcheck/entity/vo/CheckAreaStatVo.java
+1
-12
CheckDeviceStatVo.java
.../dev/device/confirmcheck/entity/vo/CheckDeviceStatVo.java
+11
-4
CheckStatVo.java
...m/tykj/dev/device/confirmcheck/entity/vo/CheckStatVo.java
+14
-1
LinkCheckDetail.java
...kj/dev/device/confirmcheck/entity/vo/LinkCheckDetail.java
+5
-0
LinkExamDetail.java
...ykj/dev/device/confirmcheck/entity/vo/LinkExamDetail.java
+5
-0
LinkVo.java
...va/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
+11
-0
UnitIds.java
...a/com/tykj/dev/device/confirmcheck/entity/vo/UnitIds.java
+21
-0
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+13
-6
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+4
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+3
-3
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CheckType.java
浏览文件 @
7ae59048
...
...
@@ -25,4 +25,5 @@ public enum CheckType {
private
final
Integer
id
;
private
final
String
name
;
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
7ae59048
差异被折叠。
点击展开。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/CheckAreaStatVo.java
浏览文件 @
7ae59048
...
...
@@ -7,6 +7,7 @@ import lombok.experimental.Accessors;
import
org.springframework.objenesis.ObjenesisHelper
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* CheckAreaStatVo.
...
...
@@ -173,19 +174,7 @@ public class CheckAreaStatVo implements Cloneable {
return
this
;
}
public
CheckAreaStatVo
combine
(
CheckAreaStatVo
other
)
{
this
.
areaName
=
other
.
getAreaName
();
this
.
supposeCount
+=
other
.
getSupposeCount
();
this
.
actualCount
+=
other
.
getActualCount
();
if
(
other
.
comProgress
==
1
){
this
.
comProgress
=
1
;
}
if
(
other
.
comSituation
==
1
){
this
.
comSituation
=
1
;
}
return
this
;
}
public
RevAreaStat
reverse
(){
return
new
RevAreaStat
(
areaName
,
actualCount
,
supposeCount
,
comProgress
,
comSituation
);
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/CheckDeviceStatVo.java
浏览文件 @
7ae59048
...
...
@@ -113,13 +113,17 @@ public class CheckDeviceStatVo implements Cloneable {
return
mergeVo
;
}
//将目前已有的地区制作成map areaMap里是杭州市 other是西湖区
Map
<
String
,
CheckAreaStatVo
>
areaMap
=
mergeVo
.
areaStatList
.
stream
()
.
collect
(
toMap
(
CheckAreaStatVo:
:
getAreaName
,
Function
.
identity
()));
for
(
CheckAreaStatVo
otherArea
:
other
.
getAreaStatList
())
{
//如果原来的没有则添加,否则累加
areaMap
.
putIfAbsent
(
otherArea
.
getAreaName
(),
otherArea
);
areaMap
.
computeIfPresent
(
otherArea
.
getAreaName
(),
(
k
,
v
)
->
v
.
reduce
(
otherArea
));
if
(!
areaMap
.
containsKey
(
otherArea
.
getAreaName
()))
{
areaMap
.
putIfAbsent
(
otherArea
.
getAreaName
(),
otherArea
);
}
else
{
areaMap
.
computeIfPresent
(
otherArea
.
getAreaName
(),
(
k
,
v
)
->
v
.
reduce
(
otherArea
));
}
}
mergeVo
.
areaStatList
=
new
ArrayList
<>(
areaMap
.
values
());
...
...
@@ -153,8 +157,11 @@ public class CheckDeviceStatVo implements Cloneable {
for
(
CheckAreaStatVo
otherArea
:
other
.
getAreaStatList
())
{
//如果原来的没有则添加,否则累加
areaMap
.
putIfAbsent
(
otherArea
.
getAreaName
(),
otherArea
);
areaMap
.
computeIfPresent
(
otherArea
.
getAreaName
(),
(
k
,
v
)
->
v
.
cleanReduce
(
otherArea
));
if
(!
areaMap
.
containsKey
(
otherArea
.
getAreaName
()))
{
areaMap
.
putIfAbsent
(
otherArea
.
getAreaName
(),
otherArea
);
}
else
{
areaMap
.
computeIfPresent
(
otherArea
.
getAreaName
(),
(
k
,
v
)
->
v
.
reduce
(
otherArea
));
}
}
mergeVo
.
areaStatList
=
new
ArrayList
<>(
areaMap
.
values
());
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/CheckStatVo.java
浏览文件 @
7ae59048
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.tykj.dev.device.confirmcheck.common.CheckType
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
...
...
@@ -64,7 +65,7 @@ public class CheckStatVo {
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
name
=
"检查类型(0
异常,1自动,2手动
)"
)
@ApiModelProperty
(
name
=
"检查类型(0
核查 1检查
)"
)
private
Integer
checkType
;
private
Integer
createUserId
;
...
...
@@ -134,6 +135,18 @@ public class CheckStatVo {
//数据转JSON并赋值
String
jsonString
=
JacksonUtil
.
toJSon
(
this
.
deviceStatVoList
);
initialStat
.
setStatInfo
(
jsonString
);
if
(
this
.
checkType
==
0
){
initialStat
.
setCheckType
(
CheckType
.
CT_CHECK
);
}
else
if
(
this
.
checkType
==
1
){
initialStat
.
setCheckType
(
CheckType
.
CT_EXAM
);
}
else
{
try
{
throw
new
Exception
(
"[核查模块] 见到异常的checktype类型!id= "
+
this
.
checkType
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
initialStat
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/LinkCheckDetail.java
浏览文件 @
7ae59048
...
...
@@ -15,6 +15,11 @@ import lombok.NoArgsConstructor;
@Data
public
class
LinkCheckDetail
{
/**
* 检查业务ID
*/
private
Integer
id
;
private
String
checkUnit
;
private
String
checkSituation
;
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/LinkExamDetail.java
浏览文件 @
7ae59048
...
...
@@ -15,6 +15,11 @@ import lombok.NoArgsConstructor;
@Data
public
class
LinkExamDetail
{
/**
* 自查业务ID
*/
private
Integer
id
;
/**
* 检查组名称
*/
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
浏览文件 @
7ae59048
...
...
@@ -25,10 +25,21 @@ public class LinkVo {
*/
private
int
type
;
/**
* 核查/检查总标题
*/
private
String
title
;
private
LocalDate
endTime
;
/**
* 里面装的都是检查数据
*/
private
List
<
LinkCheckDetail
>
lcDetail
;
/**
* 里面装的都是自查数据
*/
private
List
<
LinkExamDetail
>
leDetail
;
private
int
detailId
;
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/UnitIds.java
0 → 100644
浏览文件 @
7ae59048
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* UnitIds.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/5/17 at 1:31 上午
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
UnitIds
{
private
List
<
Integer
>
ids
;
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
7ae59048
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.confirmcheck.utils;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.Lists
;
import
com.tykj.dev.device.confirmcheck.common.CheckType
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBill
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat
;
...
...
@@ -13,6 +14,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.base.enums.AuExample
;
import
com.tykj.dev.device.user.subject.dao.AreaDao
;
...
...
@@ -125,8 +127,8 @@ public class ObjTransUtil {
// 构建完成情况参数 未完成数量/总数
// 获得当前节点的子节点总数 = 总数 其中状态为9999的为已完成
Integer
fatherTaskId
=
taskService
.
get
(
stat
.
getId
(),
BusinessEnum
.
CONFIRM_CHECK_STAT
.
id
)
.
getId
();
TaskBto
fatherTask
=
taskService
.
get
(
stat
.
getId
(),
BusinessEnum
.
CONFIRM_CHECK_STAT
.
id
);
Integer
fatherTaskId
=
fatherTask
.
getId
();
List
<
Task
>
childTasks
=
taskDao
.
findAllByParentTaskId
(
fatherTaskId
);
long
total
=
childTasks
.
size
();
...
...
@@ -135,10 +137,14 @@ public class ObjTransUtil {
.
filter
(
task
->
task
.
getBillStatus
().
equals
(
9999
))
.
count
();
//如果是检查统计的话那么还要看一下他的父节点是不是已经完成了
String
completion
;
if
(
done
==
total
)
{
completion
=
"核查完成"
;
if
(
stat
.
getCheckType
()
==
CheckType
.
CT_EXAM
&&
!
fatherTask
.
getBillStatus
().
equals
(
9999
))
{
completion
=
"核查完成待办结"
;
}
else
{
completion
=
"核查完成"
;
}
}
else
{
completion
=
done
+
"/"
+
total
;
}
...
...
@@ -191,6 +197,7 @@ public class ObjTransUtil {
initialStat
.
setDeviceStatVoList
(
Arrays
.
asList
(
checkDeviceStatVos
));
initialStat
.
setCheckUserAName
(
userAName
);
initialStat
.
setCheckUserBName
(
userBName
);
initialStat
.
setCheckType
(
statDo
.
getCheckType
().
getId
());
return
initialStat
;
}
...
...
@@ -219,8 +226,8 @@ public class ObjTransUtil {
}
/**
*
* 这里不考虑不在库的装备
*
* @param inLibrary
* @param notInLibrary
* @return
...
...
@@ -312,7 +319,7 @@ public class ObjTransUtil {
detailVo
.
setRemark
(
detailDo
.
getRemark
());
//核查签字单
if
(
detailDo
.
getCheckFiles
()
!=
null
)
{
if
(
detailDo
.
getCheckFiles
()
!=
null
)
{
detailVo
.
setCheckFileList
(
FilesUtil
.
stringFileToList
(
detailDo
.
getCheckFiles
()));
}
return
detailVo
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
7ae59048
...
...
@@ -17,6 +17,10 @@ import java.util.List;
@SuppressWarnings
(
"SqlResolve"
)
public
interface
DeviceLibraryDao
extends
JpaRepository
<
DeviceLibrary
,
Integer
>,
JpaSpecificationExecutor
<
DeviceLibrary
>
{
List
<
DeviceLibrary
>
findAllByOwnUnit
(
String
ownUnit
);
List
<
DeviceLibrary
>
findAllByIdIn
(
List
<
Integer
>
ids
);
List
<
DeviceLibrary
>
getAllByModel
(
String
model
);
List
<
DeviceLibrary
>
getAllByOwnUnit
(
String
unit
);
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
7ae59048
...
...
@@ -1156,8 +1156,8 @@ public class TaskServiceImpl implements TaskService {
});
}
}
if
(!
ids
.
contains
(
userId
)){
throw
new
ApiException
(
ResponseEntity
.
status
(
50000
).
body
(
"当前用户不能操作此任务"
));
}
//
if (!ids.contains(userId)){
//
throw new ApiException(ResponseEntity.status(50000).body("当前用户不能操作此任务"));
//
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论