Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
9151c603
提交
9151c603
authored
5月 23, 2022
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(日常检查模块): 新增了日常检查的模块接口
新增了日常检查的模块接口
上级
48e35ba5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
592 行增加
和
177 行删除
+592
-177
BusinessEnum.java
...sc/src/main/java/com/tykj/dev/misc/base/BusinessEnum.java
+2
-0
DailyCheckController.java
...dev/device/selfcheck/controller/DailyCheckController.java
+135
-0
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+71
-71
DailyCheckBillDao.java
...kj/dev/device/selfcheck/repository/DailyCheckBillDao.java
+12
-0
DailyCheckBillService.java
...j/dev/device/selfcheck/service/DailyCheckBillService.java
+70
-0
SelfCheckBillService.java
...kj/dev/device/selfcheck/service/SelfCheckBillService.java
+1
-1
DailyCheckBillServiceImpl.java
...ice/selfcheck/service/impl/DailyCheckBillServiceImpl.java
+0
-0
SelfCheckBillServiceImpl.java
...vice/selfcheck/service/impl/SelfCheckBillServiceImpl.java
+75
-76
DailyCheckBill.java
...kj/dev/device/selfcheck/subject/domin/DailyCheckBill.java
+209
-0
SelfCheckBill.java
...ykj/dev/device/selfcheck/subject/domin/SelfCheckBill.java
+0
-27
SelfCheckSaveVo.java
...tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
+17
-2
没有找到文件。
dev-misc/src/main/java/com/tykj/dev/misc/base/BusinessEnum.java
浏览文件 @
9151c603
...
@@ -124,6 +124,8 @@ public enum BusinessEnum {
...
@@ -124,6 +124,8 @@ public enum BusinessEnum {
READMACHINE
(
30
,
"盘存盘点"
),
READMACHINE
(
30
,
"盘存盘点"
),
READMACHINE_SELFCHECK
(
31
,
"盘存自查"
),
READMACHINE_SELFCHECK
(
31
,
"盘存自查"
),
DAILY_SELF_CHECK
(
32
,
"日常检查"
),
;
;
public
Integer
id
;
public
Integer
id
;
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/DailyCheckController.java
0 → 100644
浏览文件 @
9151c603
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.selfcheck.service.DailyCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckUnitBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill
;
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.SelfCheckSaveVo
;
import
com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.user.cache.StoreCache
;
import
com.tykj.dev.device.user.cache.UnitsCache
;
import
com.tykj.dev.device.user.cache.UserCache
;
import
com.tykj.dev.device.user.subject.service.PublicService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 9:45
*/
@RestController
@RequestMapping
(
value
=
"/dailyCheck"
)
@AutoDocument
@Api
(
tags
=
"日常检查模块"
,
description
=
"日常检查模块"
)
@Slf4j
public
class
DailyCheckController
{
@Resource
private
DailyCheckBillService
dailyCheckBillService
;
@Resource
private
SelfCheckUnitBillService
service
;
@Resource
private
UserUtils
userUtils
;
@Resource
private
TaskService
taskService
;
@Resource
private
StoreCache
storeCache
;
@Resource
private
UserCache
userCache
;
@Resource
private
UnitsCache
unitsCache
;
@Resource
private
DeviceLibraryService
deviceLibraryService
;
@ApiOperation
(
value
=
"发起日常检查业务"
,
notes
=
"发起日常检查业务"
)
@PostMapping
(
value
=
"/addDayBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addDayBill
(
@RequestBody
@Validated
SelfCheckSaveVo
selfCheckSaveVo
){
dailyCheckBillService
.
addDayBill
(
selfCheckSaveVo
);
return
ResponseEntity
.
ok
(
"发起成功"
);
}
@ApiOperation
(
value
=
"保存和更新日常检查的装备列表"
,
notes
=
"保存和更新日常检查的装备列表"
)
@PostMapping
(
value
=
"/saveDayDevice"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
saveDayDevice
(
@RequestBody
SelfCheckUnitBill
selfCheckUnitBill
)
{
SelfCheckUnitBill
unitBill
=
service
.
add
(
selfCheckUnitBill
);
return
ResultUtil
.
success
(
unitBill
);
}
@ApiOperation
(
value
=
"查询自查任务"
,
notes
=
"可以通过这个接口查询自查任务"
)
@PostMapping
(
value
=
"/summary"
)
public
ResponseEntity
selectSelfExaminationBill
(
@RequestBody
SelfCheckSelectVo
selfCheckSelectVo
)
{
Page
<
DailyCheckBill
>
page
=
dailyCheckBillService
.
getDailyCheckPage
(
selfCheckSelectVo
);
for
(
DailyCheckBill
dailyCheckBill
:
page
.
getContent
())
{
if
(
dailyCheckBill
.
getCreateUnitId
()!=
null
)
{
dailyCheckBill
.
setCreateUnit
(
unitsCache
.
findById
(
dailyCheckBill
.
getId
()).
getName
());
}
if
(
dailyCheckBill
.
getUseraId
()!=
null
)
{
dailyCheckBill
.
setCheckUser
(
userCache
.
findById
(
dailyCheckBill
.
getUseraId
()).
getName
());
}
if
(
dailyCheckBill
.
getUserbId
()!=
null
)
{
dailyCheckBill
.
setCheckUser
(
userCache
.
findById
(
dailyCheckBill
.
getUseraId
()).
getName
());
}
if
(
dailyCheckBill
.
getCreateUserId
()!=
null
)
{
dailyCheckBill
.
setCreateUser
(
userCache
.
findById
(
dailyCheckBill
.
getUseraId
()).
getName
());
}
if
(
dailyCheckBill
.
getId
()!=
null
){
dailyCheckBill
.
setTaskId
(
taskService
.
get
(
dailyCheckBill
.
getId
(),
4
).
getId
());
}
if
(
dailyCheckBill
.
getStorageLocationId
()
!=
null
){
dailyCheckBill
.
setStorageLocationName
(
storeCache
.
idToName
(
dailyCheckBill
.
getStorageLocationId
()));
}
}
return
ResultUtil
.
success
(
page
);
}
@ApiOperation
(
value
=
"根据单位id查询日常检查选择的设备"
,
notes
=
"根据单位id查询日常检查选择的设备"
)
@GetMapping
(
value
=
"/findByUnitId"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
findByUnitId
()
{
Integer
unitId
=
userUtils
.
getCurrentUnitId
();
SelfCheckUnitBill
checkUnitBill
=
service
.
findByUnitId
(
unitId
);
if
(
checkUnitBill
!=
null
){
//取出设备的id
String
dayDeviceList
=
checkUnitBill
.
getDayDeviceList
();
String
[]
ids
=
dayDeviceList
.
split
(
"x"
);
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
int
i1
=
Integer
.
parseInt
(
ids
[
i
]);
deviceIds
.
add
(
i1
);
}
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryService
.
findAllByIds
(
deviceIds
);
checkUnitBill
.
setDeviceLibraryList
(
deviceLibraryList
);
}
return
ResultUtil
.
success
(
checkUnitBill
);
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
9151c603
...
@@ -986,70 +986,70 @@ public class SelfCheckController {
...
@@ -986,70 +986,70 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
map
);
return
ResultUtil
.
success
(
map
);
}
}
@ApiOperation
(
value
=
"发起日常检查业务"
,
notes
=
"发起日常检查业务"
)
//
@ApiOperation(value = "发起日常检查业务", notes = "发起日常检查业务")
@PostMapping
(
value
=
"/addDayBill"
)
//
@PostMapping(value = "/addDayBill")
@Transactional
(
rollbackFor
=
Exception
.
class
)
//
@Transactional(rollbackFor = Exception.class)
public
ResponseEntity
addDayBill
(
@RequestBody
@Validated
SelfCheckSaveVo
selfCheckSaveVo
)
{
//
public ResponseEntity addDayBill(@RequestBody @Validated SelfCheckSaveVo selfCheckSaveVo) {
//当前登录的用户ID
//
//当前登录的用户ID
Integer
currentUserId
=
userUtils
.
getCurrentUserId
();
//
Integer currentUserId = userUtils.getCurrentUserId();
//当前登录的单位ID
//
//当前登录的单位ID
Integer
unitId
=
userUtils
.
getCurrentUnitId
();
//
Integer unitId = userUtils.getCurrentUnitId();
//当前登录的单位名称
//
//当前登录的单位名称
String
currentUserUnitName
=
userUtils
.
getCurrentUserUnitName
();
//
String currentUserUnitName = userUtils.getCurrentUserUnitName();
//添加账单
//
//添加账单
SelfCheckBill
selfExaminationBillEntity
;
//
SelfCheckBill selfExaminationBillEntity;
TaskBto
taskBto
;
//
TaskBto taskBto;
if
(
selfCheckSaveVo
.
getTaskId
()!=
null
){
//
if (selfCheckSaveVo.getTaskId()!=null){
taskBto
=
taskService
.
get
(
selfCheckSaveVo
.
getTaskId
());
//
taskBto = taskService.get(selfCheckSaveVo.getTaskId());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
WAIT_SELF_CHECK
);
//
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.WAIT_SELF_CHECK);
selfExaminationBillEntity
=
selfExaminationBillService
.
getOne
(
taskBto
.
getBillId
());
//
selfExaminationBillEntity = selfExaminationBillService.getOne(taskBto.getBillId());
selfExaminationBillEntity
.
setCheckTime
(
new
Date
());
//
selfExaminationBillEntity.setCheckTime(new Date());
//
BeanUtils
.
copyProperties
(
selfCheckSaveVo
,
selfExaminationBillEntity
);
//
BeanUtils.copyProperties(selfCheckSaveVo,selfExaminationBillEntity);
if
(
selfCheckSaveVo
.
getUnStockDevices
()!=
null
&&
selfCheckSaveVo
.
getUnStockDevices
().
size
()>
0
){
//
if (selfCheckSaveVo.getUnStockDevices()!=null&&selfCheckSaveVo.getUnStockDevices().size()>0){
selfExaminationBillEntity
.
setUnStockDetail
(
JacksonUtil
.
toJSon
(
selfCheckSaveVo
.
getUnStockDevices
()));
//
selfExaminationBillEntity.setUnStockDetail(JacksonUtil.toJSon(selfCheckSaveVo.getUnStockDevices()));
}
//
}
if
(
selfCheckSaveVo
.
getType
()==
1
){
//
if (selfCheckSaveVo.getType()==1){
taskBto
.
setCustomInfo
(
"扫码"
);
//
taskBto.setCustomInfo("扫码");
//添加涉及人员
//
//添加涉及人员
taskService
.
addInvolveUser
(
taskBto
,
currentUserId
);
//
taskService.addInvolveUser(taskBto,currentUserId);
}
else
{
//
}else {
throw
new
ApiException
(
"type只能为0或1"
);
//
throw new ApiException("type只能为0或1");
}
//
}
selfExaminationBillEntity
.
setTaskId
(
selfCheckSaveVo
.
getTaskId
());
//
selfExaminationBillEntity.setTaskId(selfCheckSaveVo.getTaskId());
}
//
}
else
{
//
else {
//发起任务
//
//发起任务
selfExaminationBillEntity
=
selfCheckSaveVo
.
toDo
();
//
selfExaminationBillEntity = selfCheckSaveVo.toDo();
selfExaminationBillEntity
.
setTitle
(
currentUserUnitName
+
"发起的日常检查任务"
);
//
selfExaminationBillEntity.setTitle(currentUserUnitName + "发起的日常检查任务");
selfExaminationBillEntity
.
setCheckUnit
(
currentUserUnitName
);
//
selfExaminationBillEntity.setCheckUnit(currentUserUnitName);
selfExaminationBillEntity
.
setCheckUnitId
(
unitId
);
//
selfExaminationBillEntity.setCheckUnitId(unitId);
//更新
//
//更新
selfCheckBillService
.
addEntity
(
selfExaminationBillEntity
);
//
selfCheckBillService.addEntity(selfExaminationBillEntity);
//发起任务
//
//发起任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
//
List<Integer> userIds = new ArrayList<>();
userIds
.
add
(
currentUserId
);
//
userIds.add(currentUserId);
taskBto
=
new
TaskBto
(
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
currentUserUnitName
+
"发起的日常检查任务"
,
//
taskBto = new TaskBto(StatusEnum.SELF_CHECK_CONFIRM.id, currentUserUnitName + "发起的日常检查任务",
null
,
"."
,
selfExaminationBillEntity
.
getId
(),
4
,
//
null, ".", selfExaminationBillEntity.getId(), 4,
currentUserId
,
0
,
null
,
userIds
);
//
currentUserId, 0, null, userIds);
TaskBto
taskBto1
=
new
TaskBto
();
//
TaskBto taskBto1 = new TaskBto();
if
(
selfCheckSaveVo
.
getType
()==
1
){
//
if (selfCheckSaveVo.getType()==1){
taskBto
.
setCustomInfo
(
"扫码"
);
//
taskBto.setCustomInfo("扫码");
taskBto1
=
taskService
.
start
(
taskBto
);
//
taskBto1 = taskService.start(taskBto);
//未检查
//
//未检查
selfExaminationBillEntity
.
setCheckStatus
(
3
);
//
selfExaminationBillEntity.setCheckStatus(3);
selfExaminationBillEntity
.
setTaskId
(
taskBto1
.
getId
());
//
selfExaminationBillEntity.setTaskId(taskBto1.getId());
}
//
}
}
//
}
//日常检查设备
//
//日常检查设备
String
dayDeviceList
=
selfCheckSaveVo
.
getDayCheckList
();
//
String dayDeviceList = selfCheckSaveVo.getDayCheckList();
selfExaminationBillEntity
.
setDayCheckList
(
dayDeviceList
);
//
selfExaminationBillEntity.setDayCheckList(dayDeviceList);
selfExaminationBillEntity
.
setUseraId
(
currentUserId
);
//
selfExaminationBillEntity.setUseraId(currentUserId);
selfExaminationBillEntity
.
setCreateUnitId
(
unitId
);
//
selfExaminationBillEntity.setCreateUnitId(unitId);
selfExaminationBillService
.
update
(
selfExaminationBillEntity
);
//
selfExaminationBillService.update(selfExaminationBillEntity);
log
.
info
(
"[自查模块]:发起日常检查"
);
//
log.info("[自查模块]:发起日常检查");
return
ResultUtil
.
success
(
selfExaminationBillEntity
);
//
return ResultUtil.success(selfExaminationBillEntity);
}
//
}
@ApiOperation
(
value
=
"保存和更新日常检查的装备列表"
,
notes
=
"保存和更新日常检查的装备列表"
)
@ApiOperation
(
value
=
"保存和更新日常检查的装备列表"
,
notes
=
"保存和更新日常检查的装备列表"
)
@PostMapping
(
value
=
"/saveDayDevice"
)
@PostMapping
(
value
=
"/saveDayDevice"
)
...
@@ -1144,12 +1144,12 @@ public class SelfCheckController {
...
@@ -1144,12 +1144,12 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
save
);
return
ResultUtil
.
success
(
save
);
}
}
@ApiOperation
(
value
=
"查询日常检查的详情"
,
notes
=
"查询日常检查的详情"
)
//
@ApiOperation(value = "查询日常检查的详情", notes = "查询日常检查的详情")
@GetMapping
(
value
=
"/selectDetail"
)
//
@GetMapping(value = "/selectDetail")
@Transactional
(
rollbackFor
=
Exception
.
class
)
//
@Transactional(rollbackFor = Exception.class)
public
ResponseEntity
selectDetail
(
Integer
billId
)
{
//
public ResponseEntity selectDetail(Integer billId) {
Map
<
String
,
Object
>
detail
=
selfCheckBillService
.
selectDetail
(
billId
);
//
Map<String, Object> detail = selfCheckBillService.selectDetail(billId);
return
ResultUtil
.
success
(
detail
);
//
return ResultUtil.success(detail);
}
//
}
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/repository/DailyCheckBillDao.java
0 → 100644
浏览文件 @
9151c603
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
repository
;
import
com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
/**
* @author zsp
* @create 2022/5/23 9:22
*/
public
interface
DailyCheckBillDao
extends
JpaRepository
<
DailyCheckBill
,
Integer
>,
JpaSpecificationExecutor
<
DailyCheckBill
>
{
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/DailyCheckBillService.java
0 → 100644
浏览文件 @
9151c603
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
service
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSaveVo
;
import
com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo
;
import
com.tykj.dev.misc.qrcode.vo.TaskData
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zsp
* @create 2022/5/23 9:21
*/
public
interface
DailyCheckBillService
{
/**
* 根据id查询
* @param id id
* @return 业务对象
*/
DailyCheckBill
getOne
(
Integer
id
);
/**
* 保存和更新接口
* @param dailyCheckBill 要更新的实体
* @return 更新后的实体
*/
DailyCheckBill
update
(
DailyCheckBill
dailyCheckBill
);
/**
* 发起日常检查
* @param selfCheckSaveVo 日常检查的vo
*/
void
addDayBill
(
SelfCheckSaveVo
selfCheckSaveVo
);
/**
* 生成二维码
* @param taskData 需要传递的参数vo
* @return 二维码的地址的集合
*/
List
<
String
>
createQrcode
(
TaskData
taskData
);
/**
* 解析二维码
* @return 返回检验后的设备数据
*/
List
<
DeviceLibrary
>
parseQrCode
(
List
<
String
>
strings
);
/**
* 根据业务id查询详情
* @param billId 业务id
* @return 详情
*/
Map
<
String
,
Object
>
selectDetail
(
Integer
billId
);
/**
* 查询日常检查列表
* @param selfCheckSelectVo
* @return
*/
Page
<
DailyCheckBill
>
getDailyCheckPage
(
SelfCheckSelectVo
selfCheckSelectVo
);
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/SelfCheckBillService.java
浏览文件 @
9151c603
...
@@ -61,5 +61,5 @@ public interface SelfCheckBillService {
...
@@ -61,5 +61,5 @@ public interface SelfCheckBillService {
*/
*/
List
<
DeviceLibrary
>
parseQrCode
(
List
<
String
>
strings
);
List
<
DeviceLibrary
>
parseQrCode
(
List
<
String
>
strings
);
Map
<
String
,
Object
>
selectDetail
(
Integer
billId
);
//
Map<String,Object> selectDetail(Integer billId);
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/DailyCheckBillServiceImpl.java
0 → 100644
浏览文件 @
9151c603
差异被折叠。
点击展开。
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/SelfCheckBillServiceImpl.java
浏览文件 @
9151c603
...
@@ -211,8 +211,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
...
@@ -211,8 +211,7 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
private
QrCodeBillUtil
qrCodeBillUtil
;
private
QrCodeBillUtil
qrCodeBillUtil
;
@Override
@Override
public
List
<
String
>
createQrcode
(
TaskData
taskData
)
{
public
List
<
String
>
createQrcode
(
TaskData
taskData
)
{
List
<
String
>
code
=
qrCodeBillUtil
.
createCode
(
taskData
);
return
qrCodeBillUtil
.
createCode
(
taskData
);
return
code
;
}
}
...
@@ -261,80 +260,80 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
...
@@ -261,80 +260,80 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
return
deviceLibraries
;
return
deviceLibraries
;
}
}
@Override
//
@Override
public
Map
<
String
,
Object
>
selectDetail
(
Integer
billId
)
{
//
public Map<String, Object> selectDetail(Integer billId) {
Map
<
Integer
,
DeviceLibrary
>
deviceLibraryMap
=
//
Map<Integer, DeviceLibrary> deviceLibraryMap =
deviceLibraryCacheService
.
getAllDeviceLibraryList
().
stream
().
collect
(
Collectors
.
toMap
(
DeviceLibrary:
:
getId
,
//
deviceLibraryCacheService.getAllDeviceLibraryList().stream().collect(Collectors.toMap(DeviceLibrary::getId,
Function
.
identity
()));
//
Function.identity()));
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
//
Map<String, Object> map = new HashMap<>();
//根据billid查询实体
//
//根据billid查询实体
SelfCheckBill
checkBill
=
getOne
(
billId
);
//
SelfCheckBill checkBill = getOne(billId);
//日常设备信息
//
//日常设备信息
if
(
checkBill
.
getDayCheckList
()
!=
null
)
{
//
if (checkBill.getDayCheckList() != null) {
//
String
dayDeviceList
=
checkBill
.
getDayCheckList
();
//
String dayDeviceList = checkBill.getDayCheckList();
String
[]
ids
=
dayDeviceList
.
split
(
"x"
);
//
String[] ids = dayDeviceList.split("x");
List
<
Integer
>
deviceIds
=
new
ArrayList
<>();
//
List<Integer> deviceIds = new ArrayList<>();
for
(
int
i
=
0
;
i
<
ids
.
length
;
i
++)
{
//
for (int i = 0; i < ids.length; i++) {
int
i1
=
Integer
.
parseInt
(
ids
[
i
]);
//
int i1 = Integer.parseInt(ids[i]);
deviceIds
.
add
(
i1
);
//
deviceIds.add(i1);
}
//
}
List
<
DeviceLibrary
>
deviceLibraryList
=
deviceLibraryService
.
findAllByIds
(
deviceIds
);
//
List<DeviceLibrary> deviceLibraryList = deviceLibraryService.findAllByIds(deviceIds);
checkBill
.
setDayDeviceLibraries
(
deviceLibraryList
);
//
checkBill.setDayDeviceLibraries(deviceLibraryList);
}
//
}
//设备信息
//
//设备信息
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
//
List<DeviceLibrary> deviceLibraries = new ArrayList<>();
String
checkDetail
=
checkBill
.
getCheckDetail
();
//
String checkDetail = checkBill.getCheckDetail();
if
(
checkDetail
!=
null
)
{
//
if (checkDetail != null) {
String
[]
split
=
checkDetail
.
split
(
"x"
);
//
String[] split = checkDetail.split("x");
//添加自查装备
//
//添加自查装备
for
(
String
s
:
split
)
{
//
for (String s : split) {
if
(
s
.
length
()
>=
2
)
{
//
if (s.length() >= 2) {
Integer
i
=
Integer
.
parseInt
(
s
.
substring
(
0
,
s
.
length
()
-
1
));
//
Integer i = Integer.parseInt(s.substring(0, s.length() - 1));
Integer
checkResult
=
Integer
.
parseInt
(
s
.
substring
(
s
.
length
()
-
1
));
//
Integer checkResult = Integer.parseInt(s.substring(s.length() - 1));
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryMap
.
get
(
i
);
//
DeviceLibrary deviceLibraryEntity = deviceLibraryMap.get(i);
deviceLibraryEntity
.
setCheckResult
(
checkResult
);
//
deviceLibraryEntity.setCheckResult(checkResult);
deviceLibraries
.
add
(
deviceLibraryEntity
);
//
deviceLibraries.add(deviceLibraryEntity);
}
//
}
}
//
}
}
//
}
checkBill
.
setInDeviceLibraries
(
deviceLibraries
);
//
checkBill.setInDeviceLibraries(deviceLibraries);
//新增的
//
//新增的
String
newDeviceDetail
=
checkBill
.
getNewDeviceDetail
();
//
String newDeviceDetail = checkBill.getNewDeviceDetail();
List
<
DeviceLibrary
>
newDeviceList
=
new
ArrayList
<>();
//
List<DeviceLibrary> newDeviceList = new ArrayList<>();
if
(
newDeviceDetail
!=
null
)
{
//
if (newDeviceDetail != null) {
//分隔字符获得rfid卡号
//
//分隔字符获得rfid卡号
String
[]
split2
=
newDeviceDetail
.
split
(
"\\."
);
//
String[] split2 = newDeviceDetail.split("\\.");
newDeviceList
=
new
ArrayList
<>();
//
newDeviceList = new ArrayList<>();
for
(
String
rfid
:
split2
)
{
//
for (String rfid : split2) {
if
(
rfid
.
length
()
>
0
)
{
//
if (rfid.length() > 0) {
DeviceLibrary
d
=
new
DeviceLibrary
();
//
DeviceLibrary d = new DeviceLibrary();
d
.
setCheckResult
(
2
);
//
d.setCheckResult(2);
d
.
setSeqNumber
(
"-"
);
//
d.setSeqNumber("-");
d
.
setName
(
"-"
);
//
d.setName("-");
d
.
setType
(
0
);
//
d.setType(0);
d
.
setRfidSurfaceId
(
"-"
);
//
d.setRfidSurfaceId("-");
d
.
setProdNumber
(
"-"
);
//
d.setProdNumber("-");
d
.
setRfidCardId
(
rfid
);
//
d.setRfidCardId(rfid);
newDeviceList
.
add
(
d
);
//
newDeviceList.add(d);
}
//
}
}
//
}
}
//
}
checkBill
.
setNewDeviceLibraries
(
newDeviceList
);
//
checkBill.setNewDeviceLibraries(newDeviceList);
//处理文件
//
//处理文件
if
(
checkBill
.
getCheckFiles
()
!=
null
&&
checkBill
.
getCheckFiles
().
length
()
>
0
){
//
if (checkBill.getCheckFiles() != null && checkBill.getCheckFiles().length() >0){
checkBill
.
setCheckFileList
(
FilesUtil
.
stringFileToList
(
checkBill
.
getCheckFiles
()));
//
checkBill.setCheckFileList(FilesUtil.stringFileToList(checkBill.getCheckFiles()));
}
//
}
map
.
put
(
"checkBill"
,
checkBill
);
//
map.put("checkBill", checkBill);
//根据业务id查询任务日志
//
//根据业务id查询任务日志
TaskBto
taskBto
=
taskService
.
get
(
billId
,
BusinessEnum
.
SELF_CHECK
.
id
);
//
TaskBto taskBto = taskService.get(billId, BusinessEnum.SELF_CHECK.id);
List
<
TaskLogUserVo
>
taskLogUserVoList
=
taskLogService
.
getByTaskId
(
taskBto
.
getId
());
//
List<TaskLogUserVo> taskLogUserVoList = taskLogService.getByTaskId(taskBto.getId());
map
.
put
(
"taskLogUserVoList"
,
taskLogUserVoList
);
//
map.put("taskLogUserVoList", taskLogUserVoList);
//查询任务
//
//查询任务
TaskUserVo
taskUserVo
=
taskBto
.
toVo
();
//
TaskUserVo taskUserVo = taskBto.toVo();
map
.
put
(
"taskUserVo"
,
taskUserVo
);
//
map.put("taskUserVo", taskUserVo);
return
map
;
//
return map;
}
//
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
List
<
String
>
strings
=
new
ArrayList
<>();
List
<
String
>
strings
=
new
ArrayList
<>();
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/DailyCheckBill.java
0 → 100644
浏览文件 @
9151c603
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
subject
.
domin
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
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.annotation.CreatedBy
;
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
javax.persistence.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author zsp
* @create 2022/5/23 9:20
*/
@Data
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@SQLDelete
(
sql
=
"update daily_check_bill set delete_tag = 1 where id = ?"
)
@Where
(
clause
=
"delete_tag = 0"
)
@ApiModel
(
"日常检查账单"
)
public
class
DailyCheckBill
{
/**
* 主键id
*/
@Id
@GeneratedValue
@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
;
/**
* 自查标题
*/
@ApiModelProperty
(
value
=
"自查标题"
)
private
String
title
;
/**
* 经办人id(A岗)
*/
@ApiModelProperty
(
value
=
"经办人id(A岗)"
)
private
Integer
useraId
;
/**
* 审核人id(B岗)
*/
@ApiModelProperty
(
value
=
"审核人id(B岗)"
)
private
Integer
userbId
;
/**
* 自查时间
*/
@ApiModelProperty
(
value
=
"自查时间"
)
private
Date
checkTime
;
/**
* 自查单位
*/
@ApiModelProperty
(
value
=
"自查单位"
)
private
String
checkUnit
;
@ApiModelProperty
(
value
=
"自查单位Id"
)
private
Integer
checkUnitId
;
/**
* 应查数量
*/
@ApiModelProperty
(
value
=
"应查数量"
)
private
Integer
checkingCount
;
/**
* 实查数量
*/
@ApiModelProperty
(
value
=
"实查数量"
)
private
Integer
checkedCount
;
/**
* 自查结果
*/
@ApiModelProperty
(
value
=
"自查结果"
)
private
String
checkResult
;
/**
* 自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
@Column
(
name
=
"check_detail"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"自查详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增"
)
private
String
checkDetail
;
@Column
(
name
=
"un_stock_detail"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"非在库装备转JSon"
)
private
String
unStockDetail
;
/**
* 自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)
*/
@ApiModelProperty
(
value
=
"自查状态(0:待审核,1:审核失败,2:自查完成,3:未检)"
)
private
Integer
checkStatus
;
/**
* 创建用户id
*/
@CreatedBy
@ApiModelProperty
(
value
=
"创建用户id"
)
private
Integer
createUserId
;
/**
* 创建单位id
*/
@ApiModelProperty
(
value
=
"创建单位id"
)
private
Integer
createUnitId
;
/**
* 创建时间
*/
@CreatedDate
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
/**
* 更新用户id
*/
@LastModifiedBy
@ApiModelProperty
(
value
=
"更新用户id"
)
private
Integer
updateUserId
;
/**
* 更新时间
*/
@LastModifiedDate
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateTime
;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty
(
value
=
"删除标记(0:未删除,1:已删除)"
)
private
Integer
deleteTag
=
0
;
/**
* 自查未入库新增装备详情(RFID卡号以.为分隔符)
*/
@Column
(
name
=
"new_device_detail"
,
columnDefinition
=
"TEXT"
)
@ApiModelProperty
(
value
=
"自查未入库新增装备详情(RFID卡号以.为分隔符)"
)
private
String
newDeviceDetail
;
@ApiModelProperty
(
value
=
"手持终端信息"
)
private
String
handheldTerminalInformation
;
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
private
Integer
storageLocationId
;
@ApiModelProperty
(
value
=
"是否是日常检查"
,
notes
=
"0代表 常规检查, 1代表 日常检查"
)
private
Integer
isDayCheck
=
0
;
// @ApiModelProperty(value = "生成二维码的地址")
// @Column(name = "qr_code_path",columnDefinition = "TEXT")
// private String qrcodePath ;
@ApiModelProperty
(
value
=
"日常检查装备的集合"
,
example
=
"id 以x进行分割 id"
)
@Column
(
name
=
"day_check_detail"
,
columnDefinition
=
"TEXT"
)
private
String
dayCheckDetail
;
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
@Transient
private
String
storageLocationName
;
@ApiModelProperty
(
value
=
"检查人"
)
@Transient
private
String
checkUser
;
@ApiModelProperty
(
value
=
"确认人"
)
@Transient
private
String
confirmUser
;
@ApiModelProperty
(
value
=
"创建人"
)
@Transient
private
String
createUser
;
@ApiModelProperty
(
value
=
"创建单位"
)
@Transient
private
String
createUnit
;
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
@Column
(
name
=
"check_files"
,
columnDefinition
=
"TEXT"
)
private
String
checkFiles
;
@Transient
private
List
<
FileRet
>
checkFileList
=
new
ArrayList
<>();
@Transient
private
Integer
taskId
;
@Transient
@ApiModelProperty
(
name
=
"任务创建时间"
)
private
Integer
taskCreateDate
;
@Transient
@ApiModelProperty
(
"日常检查的设备列表"
)
private
List
<
DeviceLibrary
>
dayDeviceLibraries
;
@Transient
@ApiModelProperty
(
"日常检查设备信息列表"
)
private
List
<
DeviceLibrary
>
inDeviceLibraries
;
@Transient
@ApiModelProperty
(
"日常检查的设备新增设备列表"
)
private
List
<
DeviceLibrary
>
newDeviceLibraries
;
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/domin/SelfCheckBill.java
浏览文件 @
9151c603
...
@@ -148,17 +148,6 @@ public class SelfCheckBill {
...
@@ -148,17 +148,6 @@ public class SelfCheckBill {
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
private
Integer
storageLocationId
;
private
Integer
storageLocationId
;
@ApiModelProperty
(
value
=
"是否是日常检查"
,
notes
=
"0代表 常规检查, 1代表 日常检查"
)
private
Integer
isDayCheck
=
0
;
// @ApiModelProperty(value = "生成二维码的地址")
// @Column(name = "qr_code_path",columnDefinition = "TEXT")
// private String qrcodePath ;
@ApiModelProperty
(
value
=
"日常检查装备的集合"
,
example
=
"id 以x进行分割 id"
)
@Column
(
name
=
"day_check_list"
,
columnDefinition
=
"TEXT"
)
private
String
dayCheckList
;
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
@ApiModelProperty
(
value
=
"装备存放位置Id"
,
notes
=
"默认是库房, null代表是所有库房"
)
@Transient
@Transient
private
String
storageLocationName
;
private
String
storageLocationName
;
...
@@ -191,20 +180,4 @@ public class SelfCheckBill {
...
@@ -191,20 +180,4 @@ public class SelfCheckBill {
@Transient
@Transient
private
Integer
taskId
;
private
Integer
taskId
;
@Transient
@ApiModelProperty
(
name
=
""
)
private
Integer
taskCreateDate
;
@Transient
@ApiModelProperty
(
"日常检查的设备列表"
)
private
List
<
DeviceLibrary
>
dayDeviceLibraries
;
@Transient
@ApiModelProperty
(
"日常检查设备信息列表"
)
private
List
<
DeviceLibrary
>
inDeviceLibraries
;
@Transient
@ApiModelProperty
(
"日常检查的设备新增设备列表"
)
private
List
<
DeviceLibrary
>
newDeviceLibraries
;
}
}
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
浏览文件 @
9151c603
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.selfcheck.subject.vo;
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.selfcheck.subject.vo;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.entity.FileRet
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.selfcheck.subject.domin.DailyCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
...
@@ -70,8 +71,8 @@ public class SelfCheckSaveVo {
...
@@ -70,8 +71,8 @@ public class SelfCheckSaveVo {
@ApiModelProperty
(
value
=
"是否是日常检查"
,
notes
=
"0代表 常规检查, 1代表 日常检查"
)
@ApiModelProperty
(
value
=
"是否是日常检查"
,
notes
=
"0代表 常规检查, 1代表 日常检查"
)
private
Integer
isDayCheck
=
0
;
private
Integer
isDayCheck
=
0
;
@ApiModelProperty
(
value
=
"日常检查装备"
)
@ApiModelProperty
(
value
=
"日常检查装备
详情
"
)
private
String
dayCheck
List
;
private
String
dayCheck
Detail
;
public
SelfCheckBill
toDo
()
{
public
SelfCheckBill
toDo
()
{
SelfCheckBill
selfExaminationBillEntity
=
new
SelfCheckBill
();
SelfCheckBill
selfExaminationBillEntity
=
new
SelfCheckBill
();
...
@@ -86,4 +87,18 @@ public class SelfCheckSaveVo {
...
@@ -86,4 +87,18 @@ public class SelfCheckSaveVo {
}
}
return
selfExaminationBillEntity
;
return
selfExaminationBillEntity
;
}
}
public
DailyCheckBill
toDailyCheckBill
()
{
DailyCheckBill
dailyCheckBill
=
new
DailyCheckBill
();
BeanUtils
.
copyProperties
(
this
,
dailyCheckBill
);
dailyCheckBill
.
setCheckTime
(
new
Date
());
dailyCheckBill
.
setCheckStatus
(
0
);
if
(
this
.
checkFiles
!=
null
&&
this
.
checkFiles
.
size
()>
0
){
dailyCheckBill
.
setCheckFiles
(
FilesUtil
.
stringFileToList
(
this
.
checkFiles
));
}
if
(
this
.
unStockDevices
!=
null
&&
this
.
unStockDevices
.
size
()>
0
){
dailyCheckBill
.
setUnStockDetail
(
JacksonUtil
.
toJSon
(
this
.
unStockDevices
));
}
return
dailyCheckBill
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论