Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
723c7806
提交
723c7806
authored
9月 24, 2021
作者:
Matrix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(核查模块): 增加了终止任务功能
上级
62b1a8c5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
252 行增加
和
1 行删除
+252
-1
CcDataCache.java
.../com/tykj/dev/device/confirmcheck/common/CcDataCache.java
+19
-0
CcInitRunner.java
...com/tykj/dev/device/confirmcheck/common/CcInitRunner.java
+22
-0
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+0
-0
DeviceCheckLink.java
...ev/device/confirmcheck/entity/domain/DeviceCheckLink.java
+59
-0
DeviceCheckLinkVo.java
.../dev/device/confirmcheck/entity/vo/DeviceCheckLinkVo.java
+47
-0
LinkVo.java
...va/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
+23
-0
DeviceCheckLinkDao.java
...ev/device/confirmcheck/repository/DeviceCheckLinkDao.java
+20
-0
ObjTransUtil.java
.../com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
+3
-1
BaseEntity.java
...misc/src/main/java/com/tykj/dev/misc/base/BaseEntity.java
+3
-0
BaseVo.java
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseVo.java
+56
-0
没有找到文件。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CcDataCache.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
common
;
import
com.tykj.dev.device.confirmcheck.entity.vo.LinkVo
;
import
lombok.Data
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* CcDataCache. 核查模块自用缓存
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:32 下午
*/
@Data
public
class
CcDataCache
{
public
static
Map
<
Integer
,
LinkVo
>
linkVoCache
=
new
HashMap
<>();
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/common/CcInitRunner.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
common
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
java.util.HashMap
;
/**
* CcInitRunner.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:30 下午
*/
@Order
(
99
)
public
class
CcInitRunner
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
//初始化Map 从DB里面拿数据
CcDataCache
.
linkVoCache
=
new
HashMap
<>(
32
);
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
723c7806
差异被折叠。
点击展开。
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckLink.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
domain
;
import
com.tykj.dev.device.confirmcheck.entity.vo.DeviceCheckLinkVo
;
import
com.tykj.dev.device.confirmcheck.entity.vo.LinkVo
;
import
com.tykj.dev.device.confirmcheck.utils.MapperHelper
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.modelmapper.ModelMapper
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
java.time.LocalDateTime
;
/**
* DeviceCheckLink.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/23 at 5:40 下午
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Entity
@SQLDelete
(
sql
=
"update device_check_link set delete_tag = 1 where id = ?"
)
@ApiModel
(
"核查检查列表的缓存表"
)
@NoArgsConstructor
@Table
(
name
=
"device_check_link"
)
public
class
DeviceCheckLink
extends
BaseEntity
{
private
Integer
statId
;
@Column
(
name
=
"link_text"
,
columnDefinition
=
"TEXT"
)
private
String
linkText
;
public
DeviceCheckLinkVo
toVo
()
{
ModelMapper
mapper
=
MapperHelper
.
getMapper
();
DeviceCheckLinkVo
dcLinkVo
=
mapper
.
map
(
this
,
DeviceCheckLinkVo
.
class
);
LinkVo
linkVo
=
JacksonUtil
.
readValue
(
linkText
,
LinkVo
.
class
);
dcLinkVo
.
setLinkVo
(
linkVo
);
return
dcLinkVo
;
}
public
DeviceCheckLink
(
Integer
statId
,
String
linkText
)
{
this
.
statId
=
statId
;
this
.
linkText
=
linkText
;
}
public
DeviceCheckLink
(
Integer
id
,
Integer
createUserId
,
Integer
updateUserId
,
LocalDateTime
createTime
,
LocalDateTime
updateTime
,
Integer
deleteTag
,
Integer
statId
,
String
linkText
)
{
super
(
id
,
createUserId
,
updateUserId
,
createTime
,
updateTime
,
deleteTag
);
this
.
statId
=
statId
;
this
.
linkText
=
linkText
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/DeviceCheckLinkVo.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
com.alibaba.fastjson.JSON
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckLink
;
import
com.tykj.dev.device.confirmcheck.utils.MapperHelper
;
import
com.tykj.dev.misc.base.BaseVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
org.modelmapper.ModelMapper
;
import
java.time.LocalDateTime
;
/**
* DeviceCheckLinkVo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 10:58 上午
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@NoArgsConstructor
public
class
DeviceCheckLinkVo
extends
BaseVo
{
private
Integer
statId
;
private
LinkVo
linkVo
;
public
DeviceCheckLinkVo
(
Integer
statId
,
LinkVo
linkVo
)
{
this
.
statId
=
statId
;
this
.
linkVo
=
linkVo
;
}
public
DeviceCheckLinkVo
(
Integer
id
,
Integer
createUserId
,
Integer
updateUserId
,
LocalDateTime
createTime
,
LocalDateTime
updateTime
,
Integer
deleteTag
,
Integer
statId
,
LinkVo
linkVo
)
{
super
(
id
,
createUserId
,
updateUserId
,
createTime
,
updateTime
,
deleteTag
);
this
.
statId
=
statId
;
this
.
linkVo
=
linkVo
;
}
public
DeviceCheckLink
toDo
()
{
ModelMapper
mapper
=
MapperHelper
.
getMapper
();
DeviceCheckLink
dcLink
=
mapper
.
map
(
this
,
DeviceCheckLink
.
class
);
String
linkText
=
JSON
.
toJSONStringWithDateFormat
(
this
.
linkVo
,
"yyyy-MM-dd HH:mm:ss"
);
dcLink
.
setLinkText
(
linkText
);
return
dcLink
;
}
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/vo/LinkVo.java
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
entity
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer
;
import
com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer
;
import
io.swagger.annotations.ApiModel
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDate
;
import
java.util.List
;
...
...
@@ -25,11 +31,19 @@ public class LinkVo {
*/
private
int
type
;
/**
* 是否终结 true = 已终结 ,false = 未终结
*/
private
boolean
isShutDown
;
/**
* 核查/检查总标题
*/
private
String
title
;
@JsonDeserialize
(
using
=
LocalDateDeserializer
.
class
)
@JsonSerialize
(
using
=
LocalDateSerializer
.
class
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
private
LocalDate
endTime
;
/**
...
...
@@ -48,4 +62,13 @@ public class LinkVo {
this
.
type
=
type
;
this
.
endTime
=
endTime
;
}
// public LinkVo(int type, String title, String endTime, List<LinkCheckDetail> lcDetail, List<LinkExamDetail> leDetail, int detailId) {
// this.type = type;
// this.title = title;
// this.endTime = LocalDate.parse(endTime);
// this.lcDetail = lcDetail;
// this.leDetail = leDetail;
// this.detailId = detailId;
// }
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/repository/DeviceCheckLinkDao.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
repository
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckLink
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.stereotype.Repository
;
import
java.util.Optional
;
/**
* DeviceCheckLinkDao.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 11:05 上午
*/
@Repository
public
interface
DeviceCheckLinkDao
extends
JpaRepository
<
DeviceCheckLink
,
Integer
>,
JpaSpecificationExecutor
<
DeviceCheckLink
>
{
Optional
<
DeviceCheckLink
>
findByStatId
(
Integer
statId
);
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/utils/ObjTransUtil.java
浏览文件 @
723c7806
...
...
@@ -42,6 +42,8 @@ import java.util.*;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
com
.
tykj
.
dev
.
misc
.
base
.
StatusEnum
.
END
;
import
static
com
.
tykj
.
dev
.
misc
.
base
.
StatusEnum
.
REVOKEALLOTTASK
;
import
static
java
.
util
.
stream
.
Collectors
.
toList
;
import
static
java
.
util
.
stream
.
Collectors
.
toMap
;
...
...
@@ -164,7 +166,7 @@ public class ObjTransUtil {
long
total
=
childTask
.
size
();
long
done
=
childTask
.
stream
()
.
filter
(
task
->
task
.
getBillStatus
().
equals
(
9999
))
.
filter
(
task
->
task
.
getBillStatus
().
equals
(
END
.
id
)||
task
.
getBillStatus
().
equals
(
REVOKEALLOTTASK
.
id
))
.
count
();
//如果是检查统计的话那么还要看一下他的父节点是不是已经完成了
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseEntity.java
浏览文件 @
723c7806
...
...
@@ -9,6 +9,7 @@ import org.springframework.data.annotation.CreatedDate;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.*
;
import
java.time.LocalDateTime
;
...
...
@@ -52,12 +53,14 @@ public class BaseEntity {
* 创建时间
*/
@CreatedDate
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
@LastModifiedDate
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
updateTime
;
/**
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/BaseVo.java
0 → 100644
浏览文件 @
723c7806
package
com
.
tykj
.
dev
.
misc
.
base
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
java.time.LocalDateTime
;
/**
* BaseVo.
*
* @author Matrix <xhyrzldf@gmail.com>
* @since 2021/9/24 at 11:02 上午
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
BaseVo
{
/**
* 主键id
*/
private
Integer
id
;
/**
* 创建用户id
*/
private
Integer
createUserId
;
/**
* 更新用户id
*/
private
Integer
updateUserId
;
/**
* 创建时间
*/
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
private
LocalDateTime
updateTime
;
/**
* 删除标记(0:未删除,1:已删除)
*/
private
Integer
deleteTag
=
0
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论