Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
d59d5c53
提交
d59d5c53
authored
5月 24, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(日常检查模块): 新增众多接口
新增众多接口
上级
9151c603
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
467 行增加
和
47 行删除
+467
-47
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+120
-28
HistoryDailyDeviceBillDao.java
...evice/selfcheck/repository/HistoryDailyDeviceBillDao.java
+22
-0
HistoryDeviceBillDao.java
...dev/device/selfcheck/repository/HistoryDeviceBillDao.java
+21
-0
HistoryDailyDeviceBillService.java
...vice/selfcheck/service/HistoryDailyDeviceBillService.java
+26
-0
HistoryDeviceBillService.java
...ev/device/selfcheck/service/HistoryDeviceBillService.java
+26
-0
HistoryDailyDeviceBillServiceImpl.java
...check/service/impl/HistoryDailyDeviceBillServiceImpl.java
+24
-0
HistoryDeviceBillServiceImpl.java
.../selfcheck/service/impl/HistoryDeviceBillServiceImpl.java
+30
-0
DailyCheckBill.java
...kj/dev/device/selfcheck/subject/domin/DailyCheckBill.java
+1
-5
HistoryDailyDeviceBill.java
...evice/selfcheck/subject/domin/HistoryDailyDeviceBill.java
+78
-0
HistoryDeviceBill.java
...dev/device/selfcheck/subject/domin/HistoryDeviceBill.java
+79
-0
SelfCheckSaveVo.java
...tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
+9
-0
TaskSelectController.java
...ev/device/taskselect/controller/TaskSelectController.java
+31
-14
没有找到文件。
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
d59d5c53
...
...
@@ -18,8 +18,10 @@ import com.tykj.dev.device.library.subject.vo.FileVo;
import
com.tykj.dev.device.library.subject.vo.SelfCheckVo
;
import
com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask
;
import
com.tykj.dev.device.selfcheck.repository.SelfCheckBillDao
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckUnitBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckUnitBill
;
import
com.tykj.dev.device.selfcheck.subject.vo.*
;
...
...
@@ -122,6 +124,9 @@ public class SelfCheckController {
@Resource
private
SelfCheckUnitBillService
service
;
@Resource
private
HistoryDeviceBillService
historyDeviceBillService
;
/**
* 月度
*/
...
...
@@ -300,9 +305,9 @@ public class SelfCheckController {
}
@ApiOperation
(
value
=
"生成自查待办"
,
notes
=
"可以通过这个接口生成自查待办"
)
@GetMapping
(
value
=
"/create/{type}"
)
@GetMapping
(
value
=
"/create/{type}
/{storageLocationId}
"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
createTask
(
@PathVariable
(
"type"
)
int
type
){
public
ResponseEntity
createTask
(
@PathVariable
(
"type"
)
int
type
,
@PathVariable
(
"storageLocationId"
)
Integer
storageLocationId
){
String
message
=
type
==
0
?
"手动"
:
"扫码"
;
String
message2
=
type
==
0
?
"手动"
:
"终端"
;
String
unitName
=
userUtils
.
getCurrentUserUnitName
();
...
...
@@ -311,6 +316,7 @@ public class SelfCheckController {
selfCheckBill
.
setCheckUnit
(
unitName
);
selfCheckBill
.
setCheckUnitId
(
userUtils
.
getCurrentUnitId
());
selfCheckBill
.
setTitle
(
unitName
+
"发起的"
+
message2
+
"自查任务"
);
selfCheckBill
.
setStorageLocationId
(
storageLocationId
);
SelfCheckBill
selfCheckBill1
=
selfExaminationBillService
.
addEntity
(
selfCheckBill
);
//发起待自查任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
...
...
@@ -343,16 +349,10 @@ public class SelfCheckController {
selfExaminationBillEntity
=
selfExaminationBillService
.
getOne
(
taskBto
.
getBillId
());
selfExaminationBillEntity
.
setCheckTime
(
new
Date
());
selfExaminationBillEntity
.
setCheckStatus
(
0
);
BeanUtils
.
copyProperties
(
selfCheckSaveVo
,
selfExaminationBillEntity
);
// selfExaminationBillEntity.setCheckDetail(selfCheckSaveVo.getCheckDetail());
// selfExaminationBillEntity.setCheckResult(selfCheckSaveVo.getCheckResult());
// selfExaminationBillEntity.setCheckedCount(selfCheckSaveVo.getCheckedCount());
// selfExaminationBillEntity.setCheckingCount(selfCheckSaveVo.getCheckingCount());
// selfExaminationBillEntity.setUserbId(selfCheckSaveVo.getUserbId());
// selfExaminationBillEntity.setHandheldTerminalInformation(selfCheckSaveVo.getHandheldTerminalInformation());
if
(
selfCheckSaveVo
.
getUnStockDevices
()!=
null
&&
selfCheckSaveVo
.
getUnStockDevices
().
size
()>
0
){
selfExaminationBillEntity
.
setUnStockDetail
(
JacksonUtil
.
toJSon
(
selfCheckSaveVo
.
getUnStockDevices
()));
}
BeanUtils
.
copyProperties
(
selfCheckSaveVo
,
selfExaminationBillEntity
);
}
else
{
selfExaminationBillEntity
=
selfCheckSaveVo
.
toDo
();
...
...
@@ -379,6 +379,74 @@ public class SelfCheckController {
});
}
SelfCheckBill
selfExaminationBillEntity1
=
selfExaminationBillService
.
addEntity
(
selfExaminationBillEntity
);
if
(
selfCheckSaveVo
.
getType
()
==
0
){
//手动 则全部是1
//全是1
List
<
DeviceLibrary
>
checkDeviceList
=
selfCheckSaveVo
.
getCheckDeviceList1
();
if
(
checkDeviceList
.
size
()
>
0
){
//修改 存储新的表去存放在库和不在库的设备
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
new
ArrayList
<>();
checkDeviceList
.
forEach
(
deviceLibrary
->
{
HistoryDeviceBill
historyDeviceBill
=
new
HistoryDeviceBill
();
historyDeviceBill
.
setBillId
(
selfExaminationBillEntity1
.
getId
());
historyDeviceBill
.
setModel
(
deviceLibrary
.
getModel
());
historyDeviceBill
.
setName
(
deviceLibrary
.
getName
());
historyDeviceBill
.
setDeviceId
(
deviceLibrary
.
getId
());
historyDeviceBill
.
setRfidCardId
(
deviceLibrary
.
getRfidCardId
());
historyDeviceBill
.
setLocationUnit
(
deviceLibrary
.
getLocationUnit
());
historyDeviceBill
.
setOwnUnit
(
deviceLibrary
.
getOwnUnit
());
historyDeviceBill
.
setDeviceStatus
(
1
);
historyDeviceBill
.
setSeqNumber
(
deviceLibrary
.
getSeqNumber
());
historyDeviceBillList
.
add
(
historyDeviceBill
);
});
//保存
historyDeviceBillService
.
batchSave
(
historyDeviceBillList
);
}
}
else
{
// 是0 和1
List
<
DeviceLibrary
>
checkDeviceList1
=
selfCheckSaveVo
.
getCheckDeviceList1
();
if
(
checkDeviceList1
.
size
()
>
0
){
//修改 存储新的表去存放在库和不在库的设备
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
new
ArrayList
<>();
checkDeviceList1
.
forEach
(
deviceLibrary
->
{
HistoryDeviceBill
historyDeviceBill
=
new
HistoryDeviceBill
();
historyDeviceBill
.
setBillId
(
selfExaminationBillEntity1
.
getId
());
historyDeviceBill
.
setModel
(
deviceLibrary
.
getModel
());
historyDeviceBill
.
setName
(
deviceLibrary
.
getName
());
historyDeviceBill
.
setDeviceId
(
deviceLibrary
.
getId
());
historyDeviceBill
.
setRfidCardId
(
deviceLibrary
.
getRfidCardId
());
historyDeviceBill
.
setLocationUnit
(
deviceLibrary
.
getLocationUnit
());
historyDeviceBill
.
setOwnUnit
(
deviceLibrary
.
getOwnUnit
());
historyDeviceBill
.
setDeviceStatus
(
1
);
historyDeviceBill
.
setSeqNumber
(
deviceLibrary
.
getSeqNumber
());
historyDeviceBillList
.
add
(
historyDeviceBill
);
});
//保存
historyDeviceBillService
.
batchSave
(
historyDeviceBillList
);
}
List
<
DeviceLibrary
>
checkDeviceList0
=
selfCheckSaveVo
.
getCheckDeviceList0
();
if
(
checkDeviceList0
.
size
()
>
0
){
//修改 存储新的表去存放在库和不在库的设备
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
new
ArrayList
<>();
checkDeviceList0
.
forEach
(
deviceLibrary
->
{
HistoryDeviceBill
historyDeviceBill
=
new
HistoryDeviceBill
();
historyDeviceBill
.
setBillId
(
selfExaminationBillEntity1
.
getId
());
historyDeviceBill
.
setModel
(
deviceLibrary
.
getModel
());
historyDeviceBill
.
setName
(
deviceLibrary
.
getName
());
historyDeviceBill
.
setDeviceId
(
deviceLibrary
.
getId
());
historyDeviceBill
.
setRfidCardId
(
deviceLibrary
.
getRfidCardId
());
historyDeviceBill
.
setLocationUnit
(
deviceLibrary
.
getLocationUnit
());
historyDeviceBill
.
setOwnUnit
(
deviceLibrary
.
getOwnUnit
());
historyDeviceBill
.
setDeviceStatus
(
0
);
historyDeviceBill
.
setSeqNumber
(
deviceLibrary
.
getSeqNumber
());
historyDeviceBillList
.
add
(
historyDeviceBill
);
});
//保存
historyDeviceBillService
.
batchSave
(
historyDeviceBillList
);
}
}
// Integer userId = userUtils.getCurrentUserId();
String
deviceIdDetail
=
selfCheckSaveVo
.
getCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
...
...
@@ -391,6 +459,7 @@ public class SelfCheckController {
taskService
.
addInvolveUser
(
taskBto
,
currentUserId
);
//推至下一阶段
taskService
.
moveToNext
(
taskBto
,
selfExaminationBillEntity1
.
getUseraId
());
}
else
if
(
selfCheckSaveVo
.
getType
()==
1
){
taskBto
.
setCustomInfo
(
"扫码"
);
...
...
@@ -448,6 +517,24 @@ public class SelfCheckController {
selfExaminationBillService
.
update
(
selfExaminationBillEntity1
);
}
}
if
(
selfCheckSaveVo
.
getNewDeviceList
()
!=
null
)
{
//按新增不在系统的装备按rfid卡号拼接保存
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
new
ArrayList
<>();
for
(
String
s
:
selfCheckSaveVo
.
getNewDeviceList
())
{
HistoryDeviceBill
historyDeviceBill
=
new
HistoryDeviceBill
();
historyDeviceBill
.
setBillId
(
selfExaminationBillEntity1
.
getId
());
historyDeviceBill
.
setModel
(
""
);
historyDeviceBill
.
setName
(
""
);
historyDeviceBill
.
setDeviceId
(
0
);
historyDeviceBill
.
setRfidCardId
(
s
);
historyDeviceBill
.
setLocationUnit
(
""
);
historyDeviceBill
.
setOwnUnit
(
""
);
historyDeviceBill
.
setDeviceStatus
(
0
);
historyDeviceBill
.
setSeqNumber
(
""
);
historyDeviceBillList
.
add
(
historyDeviceBill
);
}
historyDeviceBillService
.
batchSave
(
historyDeviceBillList
);
}
//添加装备日志
//进行修改日志存储慢的问题
List
<
DeviceLogDto
>
deviceLogDtos
=
new
ArrayList
<>();
...
...
@@ -709,7 +796,7 @@ public class SelfCheckController {
@ApiOperation
(
value
=
"查询自查任务详情"
,
notes
=
"可以通过这个接口查询自查任务详情"
)
@GetMapping
(
value
=
"/detail/{billId}"
)
public
ResponseEntity
selectDetail
(
@PathVariable
(
"billId"
)
int
billId
)
{
Map
<
Integer
,
DeviceLibrary
>
deviceLibraryMap
=
deviceLibraryService
.
getAllDeviceMap
();
//
Map<Integer,DeviceLibrary> deviceLibraryMap = deviceLibraryService.getAllDeviceMap();
List
<
Object
>
list
=
new
ArrayList
<>();
//获取业务
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
SELF_CHECK
.
id
);
...
...
@@ -726,23 +813,23 @@ public class SelfCheckController {
//1.实体
list
.
add
(
selfExaminationBillEntity
);
//获取自查详情
String
str3
=
selfExaminationBillEntity
.
getCheckDetail
();
//
String str3 = selfExaminationBillEntity.getCheckDetail();
String
str4
=
selfExaminationBillEntity
.
getNewDeviceDetail
();
List
<
DeviceLibrary
>
libraryEntities1
=
new
ArrayList
<>();
if
(
str3
!=
null
)
{
String
[]
split
=
str3
.
split
(
"x"
);
//添加自查装备
for
(
String
s:
split
)
{
if
(
s
.
length
()>=
2
)
{
Integer
i
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
Integer
checkResult
=
Integer
.
parseInt
(
s
.
substring
(
s
.
length
()-
1
));
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryMap
.
get
(
i
);
deviceLibraryEntity
.
setCheckResult
(
checkResult
);
libraryEntities1
.
add
(
deviceLibraryEntity
);
}
}
}
//
List<DeviceLibrary> libraryEntities1 = new ArrayList<>();
//
//
if (str3 != null) {
//
String[] split = str3.split("x");
//
//添加自查装备
//
for (String s:split) {
//
if (s.length()>=2) {
//
Integer i = Integer.parseInt(s.substring(0, s.length() - 1));
//
Integer checkResult = Integer.parseInt(s.substring(s.length()-1));
//
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(i);
//
deviceLibraryEntity.setCheckResult(checkResult);
//
libraryEntities1.add(deviceLibraryEntity);
//
}
//
}
//
}
//添加新增不在系统的装备
List
<
DeviceLibrary
>
newDeviceList
=
new
ArrayList
<>();
...
...
@@ -764,13 +851,18 @@ public class SelfCheckController {
}
}
}
//
2.添加新增不在系统的装备
//
2.添加新增不在系统的装备
list
.
add
(
newDeviceList
);
//根据业务id和业务类型查询
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
historyDeviceBillService
.
selectByBillId
(
billId
);
//3.添加自查装备
list
.
add
(
libraryEntities1
);
// list.add(libraryEntities1);
list
.
add
(
historyDeviceBillList
);
// 4添加业务日志
list
.
add
(
taskLogService
.
getByTaskId
(
taskBto
.
getId
()));
if
(
selfExaminationBillEntity
.
getUnStockDetail
()!=
null
){
//5 非在库
list
.
add
(
JacksonUtil
.
readValue
(
selfExaminationBillEntity
.
getUnStockDetail
(),
new
TypeReference
<
List
<
DeviceLibrary
>>()
{
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/repository/HistoryDailyDeviceBillDao.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
repository
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDailyDeviceBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 9:22
*/
public
interface
HistoryDailyDeviceBillDao
extends
JpaRepository
<
HistoryDailyDeviceBill
,
Integer
>,
JpaSpecificationExecutor
<
HistoryDailyDeviceBill
>
{
/**
* 根据业务id和业务类型查询
* @param billId 业务id
* @return 实体对象
*/
List
<
HistoryDailyDeviceBill
>
findAllByBillId
(
Integer
billId
);
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/repository/HistoryDeviceBillDao.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
repository
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 9:22
*/
public
interface
HistoryDeviceBillDao
extends
JpaRepository
<
HistoryDeviceBill
,
Integer
>,
JpaSpecificationExecutor
<
HistoryDeviceBill
>
{
/**
* 根据业务id和业务类型查询
* @param billId 业务id
* @return 实体对象
*/
List
<
HistoryDeviceBill
>
findAllByBillId
(
Integer
billId
);
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/HistoryDailyDeviceBillService.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
service
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 14:57
*/
public
interface
HistoryDailyDeviceBillService
{
/**
* 批量保存
* @param historyDeviceBillList historyDeviceBillList
*/
void
batchSave
(
List
<
HistoryDeviceBill
>
historyDeviceBillList
);
/**
* 根据业务id和业务类型查询
* @param billId 业务id
* @return 实体对象
*/
List
<
HistoryDeviceBill
>
selectByBillId
(
Integer
billId
);
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/HistoryDeviceBillService.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
service
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 14:57
*/
public
interface
HistoryDeviceBillService
{
/**
* 批量保存
* @param historyDeviceBillList historyDeviceBillList
*/
void
batchSave
(
List
<
HistoryDeviceBill
>
historyDeviceBillList
);
/**
* 根据业务id和业务类型查询
* @param billId 业务id
* @return 实体对象
*/
List
<
HistoryDeviceBill
>
selectByBillId
(
Integer
billId
);
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/HistoryDailyDeviceBillServiceImpl.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
service
.
impl
;
import
com.tykj.dev.device.selfcheck.service.HistoryDailyDeviceBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 16:18
*/
@Service
public
class
HistoryDailyDeviceBillServiceImpl
implements
HistoryDailyDeviceBillService
{
@Override
public
void
batchSave
(
List
<
HistoryDeviceBill
>
historyDeviceBillList
)
{
}
@Override
public
List
<
HistoryDeviceBill
>
selectByBillId
(
Integer
billId
)
{
return
null
;
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/HistoryDeviceBillServiceImpl.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
service
.
impl
;
import
com.tykj.dev.device.selfcheck.repository.HistoryDeviceBillDao
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 14:58
*/
@Service
public
class
HistoryDeviceBillServiceImpl
implements
HistoryDeviceBillService
{
@Resource
private
HistoryDeviceBillDao
historyDeviceBillDao
;
@Override
public
void
batchSave
(
List
<
HistoryDeviceBill
>
historyDeviceBillList
)
{
historyDeviceBillDao
.
saveAll
(
historyDeviceBillList
);
}
@Override
public
List
<
HistoryDeviceBill
>
selectByBillId
(
Integer
billId
)
{
return
historyDeviceBillDao
.
findAllByBillId
(
billId
);
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/DailyCheckBill.java
浏览文件 @
d59d5c53
...
...
@@ -38,11 +38,7 @@ public class DailyCheckBill {
@ApiModelProperty
(
name
=
"主键id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
id
;
/**
* 自查周期(1:月度,2:季度,3:年度,0:未设定周期)
*/
@ApiModelProperty
(
value
=
"自查周期(1:月度,2:季度,3:年度,0:未设定周期)"
)
private
Integer
cycle
;
/**
* 自查标题
*/
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/HistoryDailyDeviceBill.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
subject
.
domin
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
/**
* @author zsp
* @create 2022/5/23 14:37
*/
@Data
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@ApiModel
(
"存放日常检查历史设备单据表"
)
public
class
HistoryDailyDeviceBill
{
/**
* 主键id
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@ApiModelProperty
(
name
=
"主键id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
id
;
/**
* 装备id
*/
@ApiModelProperty
(
value
=
"装备id"
)
private
Integer
deviceId
;
/**
* 型号
*/
@ApiModelProperty
(
value
=
"型号"
)
private
String
model
;
/**
* 装备名称
*/
@ApiModelProperty
(
value
=
"装备名称"
)
private
String
name
;
/**
* 装备序列号
*/
@ApiModelProperty
(
value
=
"装备序列号"
)
private
String
seqNumber
;
/**
* rfid卡号
*/
@ApiModelProperty
(
value
=
"rfid卡号"
)
private
String
rfidCardId
;
/**
* 所在单位
*/
@ApiModelProperty
(
value
=
"所在单位"
)
private
String
locationUnit
;
/**
* 所属单位
*/
@ApiModelProperty
(
value
=
"所属单位"
)
private
String
ownUnit
;
/**
* 设备的状态
*/
@ApiModelProperty
(
value
=
"设备的状态"
,
example
=
"0 缺失 1 正常 2 新增"
)
private
Integer
deviceStatus
;
@ApiModelProperty
(
value
=
"业务id"
)
private
Integer
billId
;
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/HistoryDeviceBill.java
0 → 100644
浏览文件 @
d59d5c53
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
subject
.
domin
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.hibernate.annotations.SQLDelete
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
/**
* @author zsp
* @create 2022/5/23 14:37
*/
@Data
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@ApiModel
(
"存放历史设备单据表"
)
public
class
HistoryDeviceBill
{
/**
* 主键id
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@ApiModelProperty
(
name
=
"主键id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
id
;
/**
* 装备id
*/
@ApiModelProperty
(
value
=
"装备id"
)
private
Integer
deviceId
;
/**
* 型号
*/
@ApiModelProperty
(
value
=
"型号"
)
private
String
model
;
/**
* 装备名称
*/
@ApiModelProperty
(
value
=
"装备名称"
)
private
String
name
;
/**
* 装备序列号
*/
@ApiModelProperty
(
value
=
"装备序列号"
)
private
String
seqNumber
;
/**
* rfid卡号
*/
@ApiModelProperty
(
value
=
"rfid卡号"
)
private
String
rfidCardId
;
/**
* 所在单位
*/
@ApiModelProperty
(
value
=
"所在单位"
)
private
String
locationUnit
;
/**
* 所属单位
*/
@ApiModelProperty
(
value
=
"所属单位"
)
private
String
ownUnit
;
/**
* 设备的状态
*/
@ApiModelProperty
(
value
=
"设备的状态"
,
example
=
"0 缺失 1 正常 2 新增"
)
private
Integer
deviceStatus
;
@ApiModelProperty
(
value
=
"业务id"
)
private
Integer
billId
;
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
浏览文件 @
d59d5c53
...
...
@@ -56,9 +56,18 @@ public class SelfCheckSaveVo {
@ApiModelProperty
(
name
=
"自查详情"
,
example
=
"10x21x"
,
value
=
"自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增"
)
private
String
checkDetail
;
@ApiModelProperty
(
name
=
"自查详情 1 正常"
)
private
List
<
DeviceLibrary
>
checkDeviceList1
;
@ApiModelProperty
(
name
=
"自查详情 0 缺失"
)
private
List
<
DeviceLibrary
>
checkDeviceList0
;
@ApiModelProperty
(
name
=
"新增未记录装备RFID列表"
)
private
List
<
String
>
newDeviceList
;
@ApiModelProperty
(
name
=
"新增未记录装备RFID列表"
)
private
List
<
DeviceLibrary
>
newDeviceLibraryList
;
@ApiModelProperty
(
value
=
"检查附件名"
)
private
List
<
FileRet
>
checkFiles
;
...
...
dev-taskselect/src/main/java/com/tykj/dev/device/taskselect/controller/TaskSelectController.java
浏览文件 @
d59d5c53
...
...
@@ -26,7 +26,9 @@ import com.tykj.dev.device.repair.service.RepairBackBillService;
import
com.tykj.dev.device.repair.service.RepairBillService
;
import
com.tykj.dev.device.repair.subject.domin.RepairBackBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.selfcheck.service.HistoryDeviceBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.HistoryDeviceBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
import
com.tykj.dev.device.storage.subject.domin.StorageBill
;
...
...
@@ -37,6 +39,7 @@ import com.tykj.dev.device.task.subject.domin.Task;
import
com.tykj.dev.device.taskselect.vo.SignatureSaveVo
;
import
com.tykj.dev.device.user.cache.UserCache
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
...
...
@@ -117,6 +120,9 @@ public class TaskSelectController {
@Autowired
private
TaskDao
taskDao
;
@Resource
private
HistoryDeviceBillService
historyDeviceBillService
;
// @Autowired
// private ReadMachineBillService readMachineBillService;
//
...
...
@@ -307,7 +313,9 @@ public class TaskSelectController {
}
selfExaminationBillEntity
.
setCheckFileList
(
FilesUtil
.
stringFileToList
(
selfExaminationBillEntity
.
getCheckFiles
()));
list
.
add
(
selfExaminationBillEntity
);
String
str3
=
selfExaminationBillEntity
.
getCheckDetail
();
String
str4
=
selfExaminationBillEntity
.
getNewDeviceDetail
();
String
[]
split
;
if
(
str3
!=
null
)
{
...
...
@@ -332,23 +340,32 @@ public class TaskSelectController {
newDeviceList
.
add
(
d
);
}
}
//添加新增的
list
.
add
(
newDeviceList
);
}
if
(
str4
==
null
)
{
List
<
DeviceLibrary
>
newDeviceList
=
new
ArrayList
<>();
list
.
add
(
newDeviceList
);
}
//
if (str4 == null) {
//
List<DeviceLibrary> newDeviceList = new ArrayList<>();
//
list.add(newDeviceList);
//
}
List
<
DeviceLibrary
>
libraryEntities1
=
new
ArrayList
<>();
for
(
String
s
:
split
)
{
if
(
s
.
length
()
>=
2
)
{
Integer
id
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
Integer
checkResult
=
Integer
.
parseInt
(
s
.
substring
(
s
.
length
()
-
1
));
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryMap
.
get
(
id
);
deviceLibraryEntity
.
setCheckResult
(
checkResult
);
libraryEntities1
.
add
(
deviceLibraryEntity
);
}
}
list
.
add
(
libraryEntities1
);
// for (String s : split) {
// if (s.length() >= 2) {
// Integer id = Integer.parseInt(s.substring(0, s.length() - 1));
// Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
// DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(id);
// deviceLibraryEntity.setCheckResult(checkResult);
// libraryEntities1.add(deviceLibraryEntity);
// }
// }
List
<
HistoryDeviceBill
>
historyDeviceBillList
=
historyDeviceBillService
.
selectByBillId
(
billId
);
//过滤出1的
List
<
HistoryDeviceBill
>
billList1
=
historyDeviceBillList
.
stream
().
filter
(
historyDeviceBill
->
historyDeviceBill
.
getDeviceStatus
()
==
1
)
.
collect
(
Collectors
.
toList
());
// list.add(libraryEntities1);
list
.
add
(
billList1
);
if
(
selfExaminationBillEntity
.
getUnStockDetail
()!=
null
){
list
.
add
(
JacksonUtil
.
readValue
(
selfExaminationBillEntity
.
getUnStockDetail
(),
new
TypeReference
<
List
<
DeviceLibrary
>>()
{
}));
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论