Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
ef7729a2
提交
ef7729a2
authored
2月 14, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(装备模块): 新增了装备的校验接口
新增了装备的校验接口
上级
84f9df39
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
1 行删除
+65
-1
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+7
-1
VerificationService.java
.../tykj/dev/device/library/service/VerificationService.java
+16
-0
VerificationServiceImpl.java
.../device/library/service/impl/VerificationServiceImpl.java
+42
-0
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
ef7729a2
...
...
@@ -11,6 +11,7 @@ import com.tykj.dev.device.file.service.FilesUtil;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.service.VerificationService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
...
...
@@ -134,6 +135,9 @@ public class AllotBillController {
@Resource
private
UnitsCache
unitsCache
;
@Resource
private
VerificationService
verificationService
;
@ApiOperation
(
value
=
"导入二维码获取配发装备"
,
notes
=
"可以通过这个接口导入二维码获取配发装备"
)
@PostMapping
(
value
=
"/load"
)
public
ResponseEntity
loadDevice
(
@RequestBody
RfidVo
rfidVo
)
{
...
...
@@ -162,7 +166,9 @@ public class AllotBillController {
public
ResponseEntity
addAllotBill
(
@RequestBody
@Validated
AllotBillSaveVo
allotBillSaveVo
)
{
//判断发起配发的装备的生命状态
if
(
allotBillSaveVo
.
getAllotCheckDetail
()
!=
null
&&
allotBillSaveVo
.
getAllotCheckDetail
().
length
()
>
0
)
{
deviceLibraryService
.
isInStockOrWaitRetired
(
StringSplitUtil
.
split
(
allotBillSaveVo
.
getAllotCheckDetail
()));
// deviceLibraryService.isInStockOrWaitRetired(StringSplitUtil.split(allotBillSaveVo.getAllotCheckDetail()));
//新增装备是否是自己的判断
verificationService
.
isLocal
(
StringSplitUtil
.
split
(
allotBillSaveVo
.
getAllotCheckDetail
()));
}
//1.添加配发单
AllotBill
a
=
allotBillSaveVo
.
toDo
();
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/VerificationService.java
0 → 100644
浏览文件 @
ef7729a2
package
com
.
tykj
.
dev
.
device
.
library
.
service
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/2/14 13:21
*/
public
interface
VerificationService
{
/**
* 判断装备是否所在是不是自己(若不是抛出303异常)
* @param ids 装备ID的集合
*/
void
isLocal
(
List
<
Integer
>
ids
);
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/VerificationServiceImpl.java
0 → 100644
浏览文件 @
ef7729a2
package
com
.
tykj
.
dev
.
device
.
library
.
service
.
impl
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.VerificationService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.exception.ApiException
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/2/14 13:25
*/
@Service
public
class
VerificationServiceImpl
implements
VerificationService
{
@Resource
private
DeviceLibraryService
deviceLibraryService
;
@Resource
private
UserUtils
userUtils
;
@Override
public
void
isLocal
(
List
<
Integer
>
ids
)
{
String
currentUserUnitName
=
userUtils
.
getCurrentUserUnitName
();
ids
.
forEach
(
integer
->
{
DeviceLibrary
library
=
deviceLibraryService
.
getOne
(
integer
);
if
(
library
.
getLifeStatus
()!=
2
&&
library
.
getLifeStatus
()!=
15
&&
library
.
getLifeStatus
()!=
14
&&
!
library
.
getLifeStatus
().
equals
(
DeviceLifeStatus
.
SEND_BACK
.
id
)){
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"序列号"
+
library
.
getSeqNumber
()+
"的装备已被其他专管员操作"
));
}
if
(!
currentUserUnitName
.
equals
(
library
.
getLocationUnit
())){
throw
new
ApiException
(
ResponseEntity
.
status
(
303
).
body
(
"序列号"
+
library
.
getSeqNumber
()+
"的装备已被其他专管员操作"
));
}
});
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论