Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
a8ea4361
提交
a8ea4361
authored
5月 25, 2023
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(设备模块): 新增更换时间字段,新增设置更换时间接口
新增更换时间字段,新增设置更换时间接口
上级
fced1f3f
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
66 行增加
和
1 行删除
+66
-1
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+7
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+5
-1
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+19
-0
DeviceLibrary.java
.../tykj/dev/device/library/subject/domin/DeviceLibrary.java
+8
-0
ChangeDeviceVo.java
...om/tykj/dev/device/library/subject/vo/ChangeDeviceVo.java
+27
-0
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
a8ea4361
...
...
@@ -1372,6 +1372,13 @@ public class DeviceLibraryController {
return
ResponseEntity
.
ok
(
deviceLibraryService
.
queryByOwnUniName
(
devNameVO
.
getName
()));
}
@PostMapping
(
"/deviceLibraryChangeTime"
)
@ApiOperation
(
value
=
"设备设置更换时间"
)
public
ResponseEntity
<
String
>
deviceChangeTime
(
@RequestBody
ChangeDeviceVo
changeDeviceVo
){
deviceLibraryService
.
deviceLibraryChangeTime
(
changeDeviceVo
);
return
ResponseEntity
.
ok
(
"success"
);
}
// @ApiOperation(value = "修改单位名称", notes = "修改单位名称")
// @PostMapping("/updateDeviceLocationAndOwnUnit")
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
a8ea4361
...
...
@@ -599,5 +599,9 @@ public interface DeviceLibraryService {
*/
List
<
DeviceLibrary
>
queryByOwnUniName
(
String
ownUniName
);
/**
* 装备设置更换时间vo
* @param changeDeviceVo
*/
void
deviceLibraryChangeTime
(
ChangeDeviceVo
changeDeviceVo
);
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
a8ea4361
...
...
@@ -43,6 +43,7 @@ import org.springframework.data.jpa.domain.Specification;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StopWatch
;
...
...
@@ -50,6 +51,7 @@ import javax.annotation.Resource;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CountDownLatch
;
...
...
@@ -1765,6 +1767,23 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
deviceLibraryList
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deviceLibraryChangeTime
(
ChangeDeviceVo
changeDeviceVo
)
{
List
<
Integer
>
devIdsList
=
changeDeviceVo
.
getDevIdsList
();
LocalDateTime
changeTime
=
changeDeviceVo
.
getChangeTime
();
if
(
devIdsList
.
size
()
>
0
){
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryDao
.
findAllByIdIn
(
devIdsList
);
deviceLibraryList
.
forEach
(
deviceLibrary
->
{
deviceLibrary
.
setChangeTime
(
changeTime
);
deviceLibraries
.
add
(
deviceLibrary
);
});
deviceLibraryDao
.
saveAll
(
deviceLibraries
);
log
.
info
(
"装备更换时间更新成功,共有:{}条"
,
deviceLibraries
.
size
());
}
}
private
Specification
<
DeviceLibrary
>
getSelectSpecification
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
deviceLibrarySelectVo
);
//unitId为空,默认查询当前单位
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/domin/DeviceLibrary.java
浏览文件 @
a8ea4361
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
domin
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.tykj.dev.config.cache.ConfigCache
;
import
com.tykj.dev.device.library.subject.vo.DeviceExcel
;
import
com.tykj.dev.device.library.subject.vo.DeviceExcelVo
;
...
...
@@ -20,9 +21,11 @@ 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.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -199,6 +202,11 @@ public class DeviceLibrary implements Serializable {
@ApiModelProperty
(
value
=
"是否是试用装备"
,
notes
=
"0 是正式 1 是测试"
)
private
Integer
tryOutDevice
=
0
;
@ApiModelProperty
(
name
=
"changeTime"
,
value
=
"更换时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
changeTime
;
@ApiModelProperty
(
value
=
"入库操作人"
)
@Transient
private
String
storageProcessingUser
;
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/ChangeDeviceVo.java
0 → 100644
浏览文件 @
a8ea4361
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"装备更换的vo"
)
public
class
ChangeDeviceVo
{
@ApiModelProperty
(
value
=
"装备id的集合"
)
private
List
<
Integer
>
devIdsList
;
@ApiModelProperty
(
name
=
"changeTime"
,
value
=
"更换时间"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
LocalDateTime
changeTime
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论