Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
1d2eef21
提交
1d2eef21
authored
11月 15, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备管理模块): 新增修改单位名称同时修改装备的所属所在
新增修改单位名称同时修改装备的所属所在
上级
4d78a7cd
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
64 行增加
和
0 行删除
+64
-0
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+8
-0
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+13
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+8
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+9
-0
UpdateUnitVo.java
.../com/tykj/dev/device/library/subject/vo/UpdateUnitVo.java
+26
-0
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
1d2eef21
...
@@ -1133,10 +1133,18 @@ public class DeviceLibraryController {
...
@@ -1133,10 +1133,18 @@ public class DeviceLibraryController {
@ApiOperation
(
value
=
"为工作交接查询装备"
,
notes
=
"为工作交接查询装备"
)
@ApiOperation
(
value
=
"为工作交接查询装备"
,
notes
=
"为工作交接查询装备"
)
@GetMapping
(
"/selectDeviceForWorkUse"
)
@GetMapping
(
"/selectDeviceForWorkUse"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
WorkUseVo
>
selectDeviceForWorkUse
(){
public
List
<
WorkUseVo
>
selectDeviceForWorkUse
(){
return
deviceLibraryService
.
getDevicesForWorkUse
();
return
deviceLibraryService
.
getDevicesForWorkUse
();
}
}
@ApiOperation
(
value
=
"修改单位名称"
,
notes
=
"修改单位名称"
)
@PostMapping
(
"/updateDeviceLocationAndOwnUnit"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
<
String
>
updateDeviceLocationAndOwnUnit
(
@RequestBody
UpdateUnitVo
updateUnitVo
){
deviceLibraryService
.
updateDeviceLocationAndOwnUnit
(
updateUnitVo
);
return
ResponseEntity
.
ok
(
"修改成功"
);
}
public
List
<
DeviceLibrary
>
getAllListAndParent
(){
public
List
<
DeviceLibrary
>
getAllListAndParent
(){
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
DeviceLibrarySelectVo
deviceLibrarySelectVo
=
new
DeviceLibrarySelectVo
();
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
1d2eef21
...
@@ -228,5 +228,18 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
...
@@ -228,5 +228,18 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Query
(
"update DeviceLibrary o set o.storageLocation = :storageLocation where o.id in :deviceIds"
)
@Query
(
"update DeviceLibrary o set o.storageLocation = :storageLocation where o.id in :deviceIds"
)
int
updateStorageLocation
(
@Param
(
"storageLocation"
)
String
storageLocation
,
int
updateStorageLocation
(
@Param
(
"storageLocation"
)
String
storageLocation
,
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Param
(
"deviceIds"
)
List
<
Integer
>
deviceIds
);
@Transactional
@Modifying
@Query
(
"update DeviceLibrary o set o.locationUnit = :updateUnitName where o.locationUnit = :originUnitName"
)
int
updateLocationUnit
(
@Param
(
"originUnitName"
)
String
originUnitName
,
@Param
(
"updateUnitName"
)
String
updateUnitName
);
@Transactional
@Modifying
@Query
(
"update DeviceLibrary o set o.ownUnit = :updateUnitName where o.ownUnit = :originUnitName"
)
int
updateOwnUnit
(
@Param
(
"originUnitName"
)
String
originUnitName
,
@Param
(
"updateUnitName"
)
String
updateUnitName
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
1d2eef21
...
@@ -505,4 +505,12 @@ public interface DeviceLibraryService {
...
@@ -505,4 +505,12 @@ public interface DeviceLibraryService {
* @return WorkUseVos
* @return WorkUseVos
*/
*/
List
<
WorkUseVo
>
getDevicesForWorkUse
();
List
<
WorkUseVo
>
getDevicesForWorkUse
();
/**
* 修改单位名称则装备的所属所在也需要进行修改
* @param updateUnitVo 修改单位名称的vo
*/
void
updateDeviceLocationAndOwnUnit
(
UpdateUnitVo
updateUnitVo
);
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
1d2eef21
...
@@ -1203,6 +1203,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -1203,6 +1203,15 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
workUseVos
;
return
workUseVos
;
}
}
@Override
@UpdateCache
public
void
updateDeviceLocationAndOwnUnit
(
UpdateUnitVo
updateUnitVo
)
{
//先修改所在
deviceLibraryDao
.
updateLocationUnit
(
updateUnitVo
.
getOriginUnitName
(),
updateUnitVo
.
getUpdateUnitName
());
//修改所属
deviceLibraryDao
.
updateOwnUnit
(
updateUnitVo
.
getOriginUnitName
(),
updateUnitVo
.
getUpdateUnitName
());
}
// @Override
// @Override
// @UpdateCache
// @UpdateCache
// public int updatePartParentId(List<Integer> deviceIds) {
// public int updatePartParentId(List<Integer> deviceIds) {
...
...
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/UpdateUnitVo.java
0 → 100644
浏览文件 @
1d2eef21
package
com
.
tykj
.
dev
.
device
.
library
.
subject
.
vo
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
"修改单位名称的vo"
)
public
class
UpdateUnitVo
{
@ApiModelProperty
(
value
=
"原单位名称"
)
private
String
originUnitName
;
@ApiModelProperty
(
value
=
"修改后单位名称"
)
private
String
updateUnitName
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论