Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f4c65c95
提交
f4c65c95
authored
5月 26, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(日常检查模块): 添加了识别二维码的时候做一个校验
添加了识别二维码的时候做一个校验
上级
2c55546a
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
89 行增加
和
18 行删除
+89
-18
DailyCheckController.java
...dev/device/selfcheck/controller/DailyCheckController.java
+4
-2
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+25
-9
DailyCheckBillService.java
...j/dev/device/selfcheck/service/DailyCheckBillService.java
+1
-1
DailyCheckBillServiceImpl.java
...ice/selfcheck/service/impl/DailyCheckBillServiceImpl.java
+34
-2
SelfCheckUnitBill.java
...dev/device/selfcheck/subject/domin/SelfCheckUnitBill.java
+4
-4
ParseQrCodeVO.java
.../dev/device/selfcheck/subject/vo/daily/ParseQrCodeVO.java
+21
-0
没有找到文件。
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/DailyCheckController.java
浏览文件 @
f4c65c95
...
...
@@ -103,8 +103,8 @@ public class DailyCheckController {
@ApiOperation
(
value
=
"解析二维码"
,
notes
=
"解析二维码"
)
@PostMapping
(
value
=
"/parseQrCode"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
parseQrCode
(
@RequestBody
List
<
String
>
strings
){
List
<
DeviceLibrary
>
deviceLibraries
=
dailyCheckBillService
.
parseQrCode
(
strings
);
public
ResponseEntity
parseQrCode
(
@RequestBody
ParseQrCodeVO
parseQrCodeVO
){
List
<
DeviceLibrary
>
deviceLibraries
=
dailyCheckBillService
.
parseQrCode
(
parseQrCodeVO
);
deviceLibraries
.
forEach
(
DeviceLibrary:
:
setConfigName
);
return
ResponseEntity
.
ok
(
deviceLibraries
);
}
...
...
@@ -174,10 +174,12 @@ public class DailyCheckController {
String
dayDeviceList
=
checkUnitBill
.
getDayDeviceList
();
String
[]
ids
=
dayDeviceList
.
split
(
"x"
);
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
if
(
ids
.
length
>
0
){
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
int
i1
=
Integer
.
parseInt
(
ids
[
i
]);
deviceIds
.
add
(
i1
);
}
}
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryService
.
findAllByIds
(
deviceIds
);
deviceLibraryList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
checkUnitBill
.
setDeviceLibraryList
(
deviceLibraryList
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
f4c65c95
...
...
@@ -1044,21 +1044,37 @@ public class SelfCheckController {
@PostMapping
(
"/selectCheckDeviceList"
)
public
ResponseEntity
selectDeviceList
(
@RequestBody
SelfCheckVo
selfCheckVo
)
{
Integer
selfBillId
=
selfCheckVo
.
getSelfBillId
();
Integer
storageLocationId
=
null
;
if
(
selfBillId
!=
null
){
SelfCheckBill
checkBill
=
selfCheckBillService
.
getOne
(
selfBillId
);
storageLocationId
=
checkBill
.
getStorageLocationId
();
}
Integer
storageLocationId
=
selfCheckVo
.
getStorageLocationId
();
String
unit
=
userUtils
.
getCurrentUserUnitName
();
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
Specifications
.
and
();
predicateBuilder
.
eq
(
"locationUnit"
,
unit
);
if
(
selfCheckVo
.
getStorageLocationId
()
!=
null
){
predicateBuilder
.
eq
(
selfCheckVo
.
getStorageLocationId
()!=
null
,
"storageLocationId"
,
selfCheckVo
.
getStorageLocationId
());
}
else
{
if
(
storageLocationId
!=
null
){
if
(
selfBillId
!=
null
){
SelfCheckBill
checkBill
=
selfCheckBillService
.
getOne
(
selfBillId
);
Integer
storageLocationId1
=
checkBill
.
getStorageLocationId
();
if
(
storageLocationId1
!=
0
){
predicateBuilder
.
eq
(
"storageLocationId"
,
storageLocationId1
);
}
}
else
{
//说明直接传递的是库房
if
(
storageLocationId
!=
0
){
predicateBuilder
.
eq
(
"storageLocationId"
,
storageLocationId
);
}
}
// Integer storageLocationId = 0;
// if(selfBillId != null){
// SelfCheckBill checkBill = selfCheckBillService.getOne(selfBillId);
// storageLocationId = checkBill.getStorageLocationId();
// }
// String unit = userUtils.getCurrentUserUnitName();
// PredicateBuilder<DeviceLibrary> predicateBuilder = Specifications.and();
// predicateBuilder.eq("locationUnit", unit);
// if (selfCheckVo.getStorageLocationId() != 0){
// predicateBuilder.eq(selfCheckVo.getStorageLocationId()!=0,"storageLocationId",selfCheckVo.getStorageLocationId());
// } else {
// if (storageLocationId != null){
// predicateBuilder.eq("storageLocationId",storageLocationId);
// }
// }
List
<
Integer
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
5
,
10
,
12
));
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
findAll
(
predicateBuilder
.
build
())
.
stream
().
filter
(
deviceLibrary
->
!
status
.
contains
(
deviceLibrary
.
getLifeStatus
())).
collect
(
Collectors
.
toList
());
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/DailyCheckBillService.java
浏览文件 @
f4c65c95
...
...
@@ -68,7 +68,7 @@ public interface DailyCheckBillService {
* 解析二维码
* @return 返回检验后的设备数据
*/
List
<
DeviceLibrary
>
parseQrCode
(
List
<
String
>
strings
);
List
<
DeviceLibrary
>
parseQrCode
(
ParseQrCodeVO
parseQrCodeVO
);
/**
* 根据业务id查询详情
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/DailyCheckBillServiceImpl.java
浏览文件 @
f4c65c95
...
...
@@ -204,11 +204,21 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
}
@Override
public
List
<
DeviceLibrary
>
parseQrCode
(
List
<
String
>
strings
)
{
public
List
<
DeviceLibrary
>
parseQrCode
(
ParseQrCodeVO
parseQrCodeVO
)
{
List
<
String
>
codeList
=
parseQrCodeVO
.
getCodeList
();
//总的装备集合 返回给前端
TaskData
taskData
=
qrCodeBillUtil
.
parseCode
(
strings
);
TaskData
taskData
=
qrCodeBillUtil
.
parseCode
(
codeList
);
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
if
(
taskData
!=
null
)
{
//判断是不是当天的任务
LocalDate
todayDate
=
DateUtil
.
getLocalDate
(
new
Date
());
Date
taskCreateDate
=
taskData
.
getTaskCreateDate
();
LocalDate
taskDate
=
DateUtil
.
getLocalDate
(
taskCreateDate
);
if
(!
todayDate
.
equals
(
taskDate
)){
throw
new
ApiException
(
"扫描任务与当前的任务时间不一致"
);
}
List
<
DeviceCodeVO
>
deviceLibraryList
=
taskData
.
getDeviceLibraries
();
//0 缺失
List
<
DeviceCodeVO
>
libraryList
=
...
...
@@ -243,6 +253,25 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
deviceLibraryList1
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setCheckResult
(
2
));
deviceLibraries
.
addAll
(
deviceLibraryList1
);
}
List
<
Integer
>
deviceIds
=
deviceLibraries
.
stream
().
map
(
DeviceLibrary:
:
getId
).
distinct
().
collect
(
Collectors
.
toList
());
Integer
dailyCheckId
=
parseQrCodeVO
.
getDailyCheckId
();
DailyCheckBill
checkBill
=
getOne
(
dailyCheckId
);
String
[]
ids
=
checkBill
.
getCheckDetail
().
split
(
","
);
List
<
Integer
>
finalIds
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
int
j
=
Integer
.
parseInt
(
ids
[
i
]);
finalIds
.
add
(
j
);
}
if
(
deviceIds
.
size
()
!=
ids
.
length
){
throw
new
ApiException
(
"扫描任务与当前的任务时间不一致"
);
}
else
{
//长度一样
deviceIds
.
removeAll
(
finalIds
);
if
(
deviceIds
.
size
()>
0
){
throw
new
ApiException
(
"扫描任务与当前的任务时间不一致"
);
}
}
}
return
deviceLibraries
;
}
...
...
@@ -258,10 +287,13 @@ public class DailyCheckBillServiceImpl implements DailyCheckBillService {
String
dayDeviceList
=
checkBill
.
getCheckDetail
();
String
[]
ids
=
dayDeviceList
.
split
(
","
);
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
if
(
ids
.
length
>
0
){
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
int
i1
=
Integer
.
parseInt
(
ids
[
i
]);
deviceIds
.
add
(
i1
);
}
}
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryService
.
findAllByIds
(
deviceIds
);
deviceLibraryList
.
forEach
(
DeviceLibrary:
:
setConfigName
);
checkBill
.
setDayDeviceLibraries
(
deviceLibraryList
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/SelfCheckUnitBill.java
浏览文件 @
f4c65c95
...
...
@@ -26,8 +26,8 @@ import java.util.List;
@Data
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@SQLDelete
(
sql
=
"update self_check_unit_bill set delete_tag = 1 where id = ?"
)
@Where
(
clause
=
"delete_tag = 0"
)
//
@SQLDelete(sql = "update self_check_unit_bill set delete_tag = 1 where id = ?")
//
@Where(clause = "delete_tag = 0")
@ApiModel
(
"日常检查和单位的表"
)
public
class
SelfCheckUnitBill
{
...
...
@@ -74,8 +74,8 @@ public class SelfCheckUnitBill {
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty
(
value
=
"删除标记(0:未删除,1:已删除)"
)
private
Integer
deleteTag
=
0
;
//
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
//
private Integer deleteTag = 0;
@Transient
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/vo/daily/ParseQrCodeVO.java
0 → 100644
浏览文件 @
f4c65c95
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
subject
.
vo
.
daily
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author zsp
*/
@Data
@ApiModel
(
"解析二维码的vo"
)
public
class
ParseQrCodeVO
{
@ApiModelProperty
(
value
=
"二维码的内容"
)
private
List
<
String
>
codeList
;
@ApiModelProperty
(
value
=
"日常检查单据的id"
)
private
Integer
dailyCheckId
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论