Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
ffa39774
提交
ffa39774
authored
1月 27, 2021
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
a92b5723
显示空白字符变更
内嵌
并排
正在显示
60 个修改的文件
包含
603 行增加
和
72 行删除
+603
-72
AllotBackBillController.java
.../dev/device/allot/controller/AllotBackBillController.java
+6
-1
AllotBackBillService.java
...m/tykj/dev/device/allot/service/AllotBackBillService.java
+7
-0
AllotBillService.java
...a/com/tykj/dev/device/allot/service/AllotBillService.java
+5
-0
AllotBackBillServiceImpl.java
...v/device/allot/service/impl/AllotBackBillServiceImpl.java
+14
-2
AllotBillServiceImpl.java
...j/dev/device/allot/service/impl/AllotBillServiceImpl.java
+13
-2
DeviceApplyBillService.java
...tykj/dev/device/apply/service/DeviceApplyBillService.java
+7
-0
DeviceApplyBillServiceImpl.java
...device/apply/service/impl/DeviceApplyBillServiceImpl.java
+14
-2
DeviceCheckBill.java
...ev/device/confirmcheck/entity/domain/DeviceCheckBill.java
+3
-0
DeviceCheckDetail.java
.../device/confirmcheck/entity/domain/DeviceCheckDetail.java
+3
-0
DeviceCheckStat.java
...ev/device/confirmcheck/entity/domain/DeviceCheckStat.java
+4
-0
ConfirmCheckService.java
.../dev/device/confirmcheck/service/ConfirmCheckService.java
+19
-0
ConfirmCheckServiceImpl.java
...ce/confirmcheck/service/impl/ConfirmCheckServiceImpl.java
+57
-1
DeviceDestroyBillService.java
.../dev/device/destroy/service/DeviceDestroyBillService.java
+6
-0
DeviceDestroyBillServiceImpl.java
...ce/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
+13
-2
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+5
-0
DeviceLogService.java
...com/tykj/dev/device/library/service/DeviceLogService.java
+5
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+13
-2
DeviceLogServiceImpl.java
...dev/device/library/service/impl/DeviceLogServiceImpl.java
+14
-3
MatchingDeviceBillService.java
...ev/device/matching/service/MatchingDeviceBillService.java
+7
-0
MatchingDeviceLibraryService.java
...device/matching/service/MatchingDeviceLibraryService.java
+5
-0
MatchingDeviceBillServiceImpl.java
.../matching/service/impl/MatchingDeviceBillServiceImpl.java
+14
-2
MatchingDeviceLibraryServiceImpl.java
...tching/service/impl/MatchingDeviceLibraryServiceImpl.java
+13
-2
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+7
-2
PackingLibraryService.java
...ykj/dev/device/packing/service/PackingLibraryService.java
+5
-0
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+13
-2
RepairBackBillService.java
...tykj/dev/device/repair/service/RepairBackBillService.java
+7
-0
RepairBillService.java
...com/tykj/dev/device/repair/service/RepairBillService.java
+7
-0
RepairDetailService.java
...m/tykj/dev/device/repair/service/RepairDetailService.java
+5
-0
RepairSendBillService.java
...tykj/dev/device/repair/service/RepairSendBillService.java
+7
-0
RepairBackBillServiceImpl.java
...device/repair/service/impl/RepairBackBillServiceImpl.java
+16
-5
RepairBillServiceImpl.java
...dev/device/repair/service/impl/RepairBillServiceImpl.java
+14
-2
RepairDetailServiceImpl.java
...v/device/repair/service/impl/RepairDetailServiceImpl.java
+16
-5
RepairSendBillServiceImpl.java
...device/repair/service/impl/RepairSendBillServiceImpl.java
+14
-2
DeviceRetiredBillService.java
.../dev/device/retired/service/DeviceRetiredBillService.java
+7
-0
DeviceRetiredBillServiceImpl.java
...ce/retired/service/Impl/DeviceRetiredBillServiceImpl.java
+14
-2
InputOutputDeviceService.java
...a/com/tykj/dev/rfid/service/InputOutputDeviceService.java
+5
-0
LibraryWarningLogDetailService.java
...tykj/dev/rfid/service/LibraryWarningLogDetailService.java
+6
-1
LibraryWarningLogService.java
...a/com/tykj/dev/rfid/service/LibraryWarningLogService.java
+5
-0
RfidChangeBillService.java
...java/com/tykj/dev/rfid/service/RfidChangeBillService.java
+7
-0
RfidChangeLogService.java
.../java/com/tykj/dev/rfid/service/RfidChangeLogService.java
+5
-0
InputOutputDeviceServiceImpl.java
...j/dev/rfid/service/impl/InputOutputDeviceServiceImpl.java
+13
-3
LibraryWarningLogDetailServiceImp.java
.../rfid/service/impl/LibraryWarningLogDetailServiceImp.java
+15
-3
LibraryWarningLogServiceImpl.java
...j/dev/rfid/service/impl/LibraryWarningLogServiceImpl.java
+13
-2
RfidChangeBillServiceImpl.java
...tykj/dev/rfid/service/impl/RfidChangeBillServiceImpl.java
+15
-2
RfidChangeLogServiceImpl.java
.../tykj/dev/rfid/service/impl/RfidChangeLogServiceImpl.java
+13
-2
ScrapBillService.java
...a/com/tykj/dev/device/scrap/service/ScrapBillService.java
+7
-0
ScrapBillServiceImpl.java
...j/dev/device/scrap/service/impl/ScrapBillServiceImpl.java
+14
-2
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+1
-1
SelfCheckBillService.java
...kj/dev/device/selfcheck/service/SelfCheckBillService.java
+7
-0
SelfCheckBillServiceImpl.java
...vice/selfcheck/service/impl/SelfCheckBillServiceImpl.java
+14
-2
SelfCheckSaveVo.java
...tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
+1
-1
StorageBillService.java
...m/tykj/dev/device/storage/service/StorageBillService.java
+5
-0
StorageBillServiceImpl.java
...v/device/storage/service/impl/StorageBillServiceImpl.java
+13
-2
TaskService.java
...in/java/com/tykj/dev/device/task/service/TaskService.java
+5
-0
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+17
-0
TrainThemeService.java
.../com/tykj/dev/device/train/service/TrainThemeService.java
+5
-0
TrainThemeServiceImpl.java
.../dev/device/train/service/impl/TrainThemeServiceImpl.java
+13
-8
UnitsServiceImpl.java
...ev/device/user/subject/service/impl/UnitsServiceImpl.java
+7
-2
DeviceUseReportService.java
.../dev/device/usereport/service/DeviceUseReportService.java
+5
-0
DeviceUseReportServiceImpl.java
...ce/usereport/service/impl/DeviceUseReportServiceImpl.java
+13
-2
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBackBillController.java
浏览文件 @
ffa39774
...
...
@@ -94,6 +94,8 @@ public class AllotBackBillController {
@PostMapping
(
value
=
"/back"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
allotBack
(
@RequestBody
@Validated
AllotBackBillSaveVo
allotBackBillSaveVo
)
{
List
<
AllotBackBill
>
allotBackBills
=
new
ArrayList
<>();
List
<
TaskBto
>
taskBtos
=
new
ArrayList
<>();
//获取当前配发退回task
TaskBto
taskBto
=
taskService
.
get
(
allotBackBillSaveVo
.
getTaskId
());
//获取父配发业务
...
...
@@ -128,11 +130,12 @@ public class AllotBackBillController {
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
String
num
=
"NO:第"
+
year
+
"TH"
+
allotBackBill1
.
getId
()
+
"号"
;
allotBackBill1
.
setNum
(
num
);
allotBackBill
Service
.
update
(
allotBackBill1
);
allotBackBill
s
.
add
(
allotBackBillService
.
update
(
allotBackBill1
)
);
//发起子任务
taskBto
.
setBillId
(
allotBackBill1
.
getId
());
taskBto
.
setOwnUnit
(
userPublicService
.
findUnitIdByName
(
allotBackBill1
.
getReceiveUnit
()));
TaskBto
taskBto1
=
taskService
.
moveToNext
(
taskBto
,
allotBackBill1
.
getReceiveUseraId
());
taskBtos
.
add
(
taskBto1
);
//改变装备状态
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
if
(
allotBackBillSaveVo
.
getFileName
()
!=
null
&&
allotBackBillSaveVo
.
getFileUrl
()
!=
null
)
{
...
...
@@ -157,6 +160,8 @@ public class AllotBackBillController {
inputOutputDeviceService
.
addWhiteDevices
(
ids
,
userUtils
.
getCurrentUnitId
(),
1
);
log
.
info
(
"[配发模块]:配发退回出库"
);
myWebSocket
.
sendMessage1
();
allotBackBillService
.
sendHash
(
allotBackBills
);
taskService
.
sendHash
(
taskBtos
);
return
ResponseEntity
.
ok
(
new
ResultObj
<>(
taskBto1
,
signId
.
toString
()));
}
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/AllotBackBillService.java
浏览文件 @
ffa39774
...
...
@@ -2,6 +2,8 @@ package com.tykj.dev.device.allot.service;
import
com.tykj.dev.device.allot.subject.domin.AllotBackBill
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -9,6 +11,11 @@ public interface AllotBackBillService {
AllotBackBill
addEntity
(
AllotBackBill
allotBackBill
);
/**
* @param allotBackBills 异步上链
*/
void
sendHash
(
List
<
AllotBackBill
>
allotBackBills
);
AllotBackBill
update
(
AllotBackBill
allotBackBill
);
AllotBackBill
getOne
(
Integer
id
);
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/AllotBillService.java
浏览文件 @
ffa39774
...
...
@@ -14,6 +14,11 @@ public interface AllotBillService {
AllotBill
addEntity
(
AllotBill
allotBillEntity
);
/**
* @param allotBills 异步上链
*/
void
sendHash
(
List
<
AllotBill
>
allotBills
);
AllotBill
update
(
AllotBill
allotBillEntity
);
Page
<
AllotBill
>
getPage
(
AllotBillSelectVo
allotBillSelectVo
,
Pageable
pageable
);
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBackBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -9,8 +9,10 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -27,11 +29,21 @@ public class AllotBackBillServiceImpl implements AllotBackBillService {
@Override
public
AllotBackBill
addEntity
(
AllotBackBill
allotBackBill
)
{
AllotBackBill
allotBackBill1
=
allotBackBillDao
.
save
(
allotBackBill
);
return
allotBackBillDao
.
save
(
allotBackBill
);
}
/**
* @param allotBackBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
AllotBackBill
>
allotBackBills
)
{
allotBackBills
.
forEach
(
allotBackBill1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
allotBackBill1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
allotBackBill1
.
setRecordId
(
recordId
);
return
allotBackBillDao
.
save
(
allotBackBill1
);
allotBackBillDao
.
save
(
allotBackBill1
);
});
}
@Override
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -38,11 +39,21 @@ public class AllotBillServiceImpl implements AllotBillService {
@Override
public
AllotBill
addEntity
(
AllotBill
allotBillEntity
)
{
AllotBill
allotBill
=
allotBillDao
.
save
(
allotBillEntity
);
return
allotBillDao
.
save
(
allotBillEntity
);
}
/**
* @param allotBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
AllotBill
>
allotBills
)
{
allotBills
.
forEach
(
allotBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
allotBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
allotBill
.
setRecordId
(
recordId
);
return
update
(
allotBill
);
update
(
allotBill
);
});
}
@Override
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/service/DeviceApplyBillService.java
浏览文件 @
ffa39774
...
...
@@ -3,6 +3,8 @@ package com.tykj.dev.device.apply.service;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -10,6 +12,11 @@ public interface DeviceApplyBillService {
DeviceApplyBill
addEntity
(
DeviceApplyBill
deviceApplyBillEntity
);
/**
* @param deviceApplyBills 异步上链
*/
void
sendHash
(
List
<
DeviceApplyBill
>
deviceApplyBills
);
DeviceApplyBill
update
(
DeviceApplyBill
deviceApplyBillEntity
);
DeviceApplyBill
getOne
(
Integer
id
);
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/service/impl/DeviceApplyBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -7,8 +7,10 @@ import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -25,11 +27,21 @@ public class DeviceApplyBillServiceImpl implements DeviceApplyBillService {
@Override
public
DeviceApplyBill
addEntity
(
DeviceApplyBill
deviceApplyBillEntity
)
{
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillDao
.
save
(
deviceApplyBillEntity
);
return
deviceApplyBillDao
.
save
(
deviceApplyBillEntity
);
}
/**
* @param deviceApplyBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceApplyBill
>
deviceApplyBills
)
{
deviceApplyBills
.
forEach
(
deviceApplyBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceApplyBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceApplyBill
.
setRecordId
(
recordId
);
return
update
(
deviceApplyBill
);
update
(
deviceApplyBill
);
});
}
@Override
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckBill.java
浏览文件 @
ffa39774
...
...
@@ -65,6 +65,9 @@ public class DeviceCheckBill extends BaseEntity {
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
public
DeviceCheckBill
(
Integer
userAId
,
Integer
userBId
,
Integer
checkStatus
,
String
checkDetail
,
String
checkTitle
,
Date
completeTime
,
String
remark
)
{
this
.
userAId
=
userAId
;
this
.
userBId
=
userBId
;
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckDetail.java
浏览文件 @
ffa39774
...
...
@@ -127,6 +127,9 @@ public class DeviceCheckDetail extends BaseEntity {
@ApiModelProperty
(
value
=
"预留字段2"
)
private
String
var2
;
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
/**
* 用于生成市级的核查详情账单的构造函数
*/
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/entity/domain/DeviceCheckStat.java
浏览文件 @
ffa39774
...
...
@@ -3,6 +3,7 @@ package com.tykj.dev.device.confirmcheck.entity.domain;
import
com.tykj.dev.device.confirmcheck.common.CheckType
;
import
com.tykj.dev.misc.base.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
...
...
@@ -74,6 +75,9 @@ public class DeviceCheckStat extends BaseEntity {
@Column
(
name
=
"check_userB_id"
)
private
Integer
checkUserBId
;
@ApiModelProperty
(
value
=
"区块链记录id"
)
private
String
recordId
;
/**
* 备注信息
*/
...
...
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/ConfirmCheckService.java
浏览文件 @
ffa39774
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
service
;
import
com.tykj.dev.device.confirmcheck.common.TaskPeriod
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBill
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckPeriod
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat
;
import
com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo
;
import
org.springframework.data.domain.Page
;
...
...
@@ -68,5 +71,21 @@ public interface ConfirmCheckService {
*/
boolean
stopAutoCheckCron
();
/**
* @param deviceCheckBills
* DeviceCheckBill异步上链
*/
void
sendHash1
(
List
<
DeviceCheckBill
>
deviceCheckBills
);
/**
* @param deviceCheckDetails
* DeviceCheckDetail异步上链
*/
void
sendHash2
(
List
<
DeviceCheckDetail
>
deviceCheckDetails
);
/**
* @param deviceCheckStats
* DeviceCheckStat异步上链
*/
void
sendHash3
(
List
<
DeviceCheckStat
>
deviceCheckStats
);
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/service/impl/ConfirmCheckServiceImpl.java
浏览文件 @
ffa39774
package
com
.
tykj
.
dev
.
device
.
confirmcheck
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.tykj.dev.blockcha.subject.entity.BcHash
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.device.confirmcheck.common.CheckType
;
import
com.tykj.dev.device.confirmcheck.common.TaskPeriod
;
import
com.tykj.dev.device.confirmcheck.entity.cache.AreaCache
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBill
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetail
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckPeriod
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat
;
import
com.tykj.dev.device.confirmcheck.entity.vo.CheckDeviceStatVo
;
import
com.tykj.dev.device.confirmcheck.entity.vo.CheckStatTableVo
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckBillDao
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckPeriodDao
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatDao
;
...
...
@@ -35,12 +39,16 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ScheduledFuture
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -96,6 +104,12 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
@Autowired
private
ThreadPoolTaskScheduler
threadPoolTaskScheduler
;
@Autowired
private
BlockChainUtil
blockChainUtil
;
@Autowired
private
DeviceCheckBillDao
deviceCheckBillDao
;
//实例化一个线程池任务调度类,可以使用自定义的ThreadPoolTaskScheduler
@Bean
public
ThreadPoolTaskScheduler
threadPoolTaskScheduler
()
{
...
...
@@ -406,6 +420,48 @@ public class ConfirmCheckServiceImpl implements ConfirmCheckService, CommandLine
return
flag
;
}
/**
* @param deviceCheckBills DeviceCheckBill异步上链
*/
@Override
@Async
public
void
sendHash1
(
List
<
DeviceCheckBill
>
deviceCheckBills
)
{
deviceCheckBills
.
forEach
(
deviceCheckBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceCheckBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceCheckBill
.
setRecordId
(
recordId
);
deviceCheckBillDao
.
save
(
deviceCheckBill
);
});
}
/**
* @param deviceCheckDetails DeviceCheckDetail异步上链
*/
@Override
@Async
public
void
sendHash2
(
List
<
DeviceCheckDetail
>
deviceCheckDetails
)
{
deviceCheckDetails
.
forEach
(
deviceCheckDetail
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceCheckDetail
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceCheckDetail
.
setRecordId
(
recordId
);
detailRepo
.
save
(
deviceCheckDetail
);
});
}
/**
* @param deviceCheckStats DeviceCheckStat异步上链
*/
@Override
@Async
public
void
sendHash3
(
List
<
DeviceCheckStat
>
deviceCheckStats
)
{
deviceCheckStats
.
forEach
(
deviceCheckStat
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceCheckStat
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceCheckStat
.
setRecordId
(
recordId
);
statDao
.
save
(
deviceCheckStat
);
});
}
/**
* 关键字过滤器
*
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/DeviceDestroyBillService.java
浏览文件 @
ffa39774
...
...
@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
java.text.ParseException
;
import
java.util.List
;
/**
* @author dengdiyi
...
...
@@ -15,6 +16,11 @@ public interface DeviceDestroyBillService {
DeviceDestroyBill
addEntity
(
DeviceDestroyBill
deviceDestoryBillEntity
);
/**
* @param deviceDestroyBills 异步上链
*/
void
sendHash
(
List
<
DeviceDestroyBill
>
deviceDestroyBills
);
Page
<
DeviceDestroyBill
>
getPage
(
DeviceDestroyBillSelectVo
deviceDestoryBillSelectVo
,
Pageable
pageable
);
DeviceDestroyBill
getOne
(
Integer
id
);
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/service/Impl/DeviceDestroyBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -20,6 +20,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -47,11 +48,21 @@ public class DeviceDestroyBillServiceImpl implements DeviceDestroyBillService {
@Override
public
DeviceDestroyBill
addEntity
(
DeviceDestroyBill
deviceDestroyBillEntity
)
{
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillDao
.
save
(
deviceDestroyBillEntity
);
return
deviceDestroyBillDao
.
save
(
deviceDestroyBillEntity
);
}
/**
* @param deviceDestroyBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceDestroyBill
>
deviceDestroyBills
)
{
deviceDestroyBills
.
forEach
(
deviceDestroyBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceDestroyBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceDestroyBill
.
setRecordId
(
recordId
);
return
updateEntity
(
deviceDestroyBill
);
updateEntity
(
deviceDestroyBill
);
});
}
@Override
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
ffa39774
...
...
@@ -18,6 +18,11 @@ public interface DeviceLibraryService {
*/
DeviceLibrary
addEntity
(
DeviceLibrary
deviceLibraryEntity
);
/**
* @param deviceLibraries 异步上链
*/
void
sendHash
(
List
<
DeviceLibrary
>
deviceLibraries
);
/**
* @param deviceLibrarySelectVo 装备查询vo
* @param pageable 获取装备分页
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLogService.java
浏览文件 @
ffa39774
...
...
@@ -16,6 +16,11 @@ public interface DeviceLogService {
*/
DeviceLogDto
addLog
(
DeviceLogDto
deviceLogDto
);
/**
* @param deviceLogDtos 异步上链
*/
void
sendHash
(
List
<
DeviceLogDto
>
deviceLogDtos
);
DeviceLogDto
getOne
(
Integer
id
);
void
saveAllLog
(
List
<
DeviceLog
>
deviceLogList
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -21,6 +21,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -48,11 +49,21 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
@Override
public
DeviceLibrary
addEntity
(
DeviceLibrary
deviceLibraryEntity
)
{
DeviceLibrary
deviceLibrary
=
deviceLibraryDao
.
save
(
deviceLibraryEntity
);
return
deviceLibraryDao
.
save
(
deviceLibraryEntity
);
}
/**
* @param deviceLibraries 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceLibrary
>
deviceLibraries
)
{
deviceLibraries
.
forEach
(
deviceLibrary
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceLibrary
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceLibrary
.
setRecordId
(
recordId
);
return
update
(
deviceLibrary
);
update
(
deviceLibrary
);
});
}
@Override
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLogServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -10,6 +10,7 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -30,12 +31,22 @@ public class DeviceLogServiceImpl implements DeviceLogService {
@Override
public
DeviceLogDto
addLog
(
DeviceLogDto
deviceLogDto
)
{
DeviceLog
deviceLogEntity
=
deviceLogDao
.
save
(
deviceLogDto
.
toDo
());
return
deviceLogDao
.
save
(
deviceLogDto
.
toDo
()).
parse2Dto
();
}
/**
* @param deviceLogDtos 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceLogDto
>
deviceLogDtos
)
{
deviceLogDtos
.
forEach
(
deviceLogDto
->
{
DeviceLog
deviceLogEntity
=
deviceLogDto
.
toDo
();
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceLogEntity
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceLogEntity
.
setRecordId
(
recordId
);
// blockChainUtil.appendHash(JacksonUtil.toJSon(deviceLogEntity),deviceLogEntity.getRecordId()
);
return
deviceLogDao
.
save
(
deviceLogEntity
).
parse2Dto
(
);
deviceLogDao
.
save
(
deviceLogEntity
);
}
);
}
@Override
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/MatchingDeviceBillService.java
浏览文件 @
ffa39774
...
...
@@ -3,6 +3,8 @@ package com.tykj.dev.device.matching.service;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -13,6 +15,11 @@ public interface MatchingDeviceBillService {
*/
MatchingDeviceBill
addEntity
(
MatchingDeviceBill
matchingDeviceBillEntity
);
/**
* @param matchingDeviceBills 异步上链
*/
void
sendHash
(
List
<
MatchingDeviceBill
>
matchingDeviceBills
);
/**
* @param id 通过id查找账单
*/
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/MatchingDeviceLibraryService.java
浏览文件 @
ffa39774
...
...
@@ -17,6 +17,11 @@ public interface MatchingDeviceLibraryService {
*/
MatchingDeviceLibrary
addEntity
(
MatchingDeviceLibrary
matchingDeviceLibraryEntity
);
/**
* @param matchingDeviceLibraries 异步上链
*/
void
sendHash
(
List
<
MatchingDeviceLibrary
>
matchingDeviceLibraries
);
/**
* @param id 通过id查询配套设备
*/
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/impl/MatchingDeviceBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -7,8 +7,10 @@ import com.tykj.dev.device.matching.service.MatchingDeviceBillService;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -25,11 +27,21 @@ public class MatchingDeviceBillServiceImpl implements MatchingDeviceBillService
@Override
public
MatchingDeviceBill
addEntity
(
MatchingDeviceBill
matchingDeviceBillEntity
)
{
MatchingDeviceBill
matchingDeviceBill
=
matchingDeviceBillDao
.
save
(
matchingDeviceBillEntity
);
return
matchingDeviceBillDao
.
save
(
matchingDeviceBillEntity
);
}
/**
* @param matchingDeviceBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
MatchingDeviceBill
>
matchingDeviceBills
)
{
matchingDeviceBills
.
forEach
(
matchingDeviceBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
matchingDeviceBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
matchingDeviceBill
.
setRecordId
(
recordId
);
return
update
(
matchingDeviceBill
);
update
(
matchingDeviceBill
);
});
}
@Override
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/service/impl/MatchingDeviceLibraryServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -17,6 +17,7 @@ import com.tykj.dev.misc.utils.ResultUtil;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -44,11 +45,21 @@ public class MatchingDeviceLibraryServiceImpl implements MatchingDeviceLibrarySe
@Override
public
MatchingDeviceLibrary
addEntity
(
MatchingDeviceLibrary
matchingDeviceLibraryEntity
)
{
MatchingDeviceLibrary
matchingDeviceLibrary
=
matchingDeviceLibraryDao
.
save
(
matchingDeviceLibraryEntity
);
return
matchingDeviceLibraryDao
.
save
(
matchingDeviceLibraryEntity
);
}
/**
* @param matchingDeviceLibraries 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
MatchingDeviceLibrary
>
matchingDeviceLibraries
)
{
matchingDeviceLibraries
.
forEach
(
matchingDeviceLibrary
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
matchingDeviceLibrary
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
matchingDeviceLibrary
.
setRecordId
(
recordId
);
return
update
(
matchingDeviceLibrary
);
update
(
matchingDeviceLibrary
);
});
}
@Override
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
ffa39774
...
...
@@ -58,10 +58,12 @@ public class PackingController {
@PostMapping
(
"/addPackingLibrary"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addPackingLibrary
(
@RequestBody
@Validated
PackingLibrarySaveVo
packingLibrarySaveVo
)
{
List
<
PackingLibrary
>
packingLibraries
=
new
ArrayList
<>();
//添加列装装备信息
PackingLibrary
p
=
packingLibrarySaveVo
.
toDo
();
p
.
setUseraId
(
userUtils
.
getCurrentUserId
());
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
addEntity
(
p
);
packingLibraries
.
add
(
packingLibraryEntity
);
//添加列装配件信息
for
(
PartSaveVo
part
:
packingLibrarySaveVo
.
getPartList
())
{
PackingLibrary
p2
=
new
PackingLibrary
();
...
...
@@ -70,7 +72,7 @@ public class PackingController {
p2
.
setId
(
null
);
p2
.
setIsPart
(
1
);
p2
.
setPartParentId
(
packingLibraryEntity
.
getId
());
packingLibrar
yService
.
addEntity
(
p2
);
packingLibrar
ies
.
add
(
packingLibraryService
.
addEntity
(
p2
)
);
}
//发起业务
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
...
@@ -80,6 +82,7 @@ public class PackingController {
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
PACKING_CONFIRM
.
id
,
"列装业务"
,
null
,
"."
,
packingLibraryEntity
.
getId
(),
1
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
TaskBto
saveEntity
=
taskService
.
start
(
taskBto
);
myWebSocket
.
sendMessage1
();
packingLibraryService
.
sendHash
(
packingLibraries
);
return
ResultUtil
.
success
(
saveEntity
);
}
...
...
@@ -145,12 +148,14 @@ public class PackingController {
@ApiOperation
(
value
=
"添加列装型号"
)
@PostMapping
(
"/add/model"
)
public
ResponseEntity
addModel
(
@RequestBody
@Validated
AddModel
addModel
){
List
<
PackingLibrary
>
packingLibraries
=
new
ArrayList
<>();
PackingLibrary
packingLibrary
=
new
PackingLibrary
();
BeanUtils
.
copyProperties
(
addModel
,
packingLibrary
);
packingLibrary
.
setIsRoot
(
1
);
packingLibrary
.
setName
(
addModel
.
getModel
());
packingLibrary
.
setPackingStatus
(
2
);
packingLibraryService
.
addEntity
(
packingLibrary
);
packingLibraries
.
add
(
packingLibraryService
.
addEntity
(
packingLibrary
));
packingLibraryService
.
sendHash
(
packingLibraries
);
return
ResponseEntity
.
ok
(
"添加成功"
);
}
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/PackingLibraryService.java
浏览文件 @
ffa39774
...
...
@@ -18,6 +18,11 @@ public interface PackingLibraryService {
*/
PackingLibrary
addEntity
(
PackingLibrary
packingLibraryEntity
);
/**
* @param packingLibraries 列装异步上链
*/
void
sendHash
(
List
<
PackingLibrary
>
packingLibraries
);
/**
* @param packingLibrarySelectVo 列装查询vo
* @param pageable 获取列装库分页
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -43,11 +44,21 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
@Override
public
PackingLibrary
addEntity
(
PackingLibrary
packingLibraryEntity
)
{
PackingLibrary
packingLibrary
=
packingLibraryDao
.
save
(
packingLibraryEntity
);
return
packingLibraryDao
.
save
(
packingLibraryEntity
);
}
/**
* @param packingLibraries 列装异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
PackingLibrary
>
packingLibraries
)
{
packingLibraries
.
forEach
(
packingLibrary
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
packingLibrary
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
packingLibrary
.
setRecordId
(
recordId
);
return
update
(
packingLibrary
);
update
(
packingLibrary
);
});
}
@Override
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/RepairBackBillService.java
浏览文件 @
ffa39774
...
...
@@ -3,7 +3,14 @@ package com.tykj.dev.device.repair.service;
import
com.tykj.dev.device.repair.subject.domin.RepairBackBill
;
import
java.util.List
;
public
interface
RepairBackBillService
extends
RepairPublicService
<
RepairBackBill
>
{
RepairBackBill
getOne
(
Integer
id
);
/**
* @param repairBackBills 异步上链
*/
void
sendHash
(
List
<
RepairBackBill
>
repairBackBills
);
}
dev-repair/src/main/java/com/tykj/dev/device/repair/service/RepairBillService.java
浏览文件 @
ffa39774
...
...
@@ -5,6 +5,8 @@ import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -12,6 +14,11 @@ public interface RepairBillService {
RepairBill
addEntity
(
RepairBill
deviceRepairBillEntity
);
/**
* @param repairBills 异步上链
*/
void
sendHash
(
List
<
RepairBill
>
repairBills
);
Page
<
RepairBill
>
getPage
(
RepairBillSelectVo
deviceRepairBillSelectVo
,
Pageable
pageable
);
RepairBill
getOne
(
Integer
id
);
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/RepairDetailService.java
浏览文件 @
ffa39774
...
...
@@ -38,4 +38,9 @@ public interface RepairDetailService extends RepairPublicService<RepairDetail> {
*/
RepairDetail
getOne
(
Integer
id
);
/**
* @param repairDetails 异步上链
*/
void
sendHash
(
List
<
RepairDetail
>
repairDetails
);
}
dev-repair/src/main/java/com/tykj/dev/device/repair/service/RepairSendBillService.java
浏览文件 @
ffa39774
...
...
@@ -5,6 +5,8 @@ import com.tykj.dev.device.repair.subject.vo.RepairBillSelectVo;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -12,6 +14,11 @@ public interface RepairSendBillService {
RepairSendBill
addEntity
(
RepairSendBill
deviceRepairSendBillEntity
);
/**
* @param repairSendBills 异步上链
*/
void
sendHash
(
List
<
RepairSendBill
>
repairSendBills
);
Page
<
RepairSendBill
>
getPage
(
RepairBillSelectVo
deviceRepairBillSelectVo
,
Pageable
pageable
);
RepairSendBill
getOne
(
Integer
id
);
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairBackBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -9,6 +9,7 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -31,11 +32,7 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
@Override
public
RepairBackBill
save
(
RepairBackBill
deviceRepairBackBillEntity
)
{
RepairBackBill
repairBackBill
=
deviceRepairBackBillDao
.
save
(
deviceRepairBackBillEntity
);
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairBackBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairBackBill
.
setRecordId
(
recordId
);
return
update
(
repairBackBill
);
return
deviceRepairBackBillDao
.
save
(
deviceRepairBackBillEntity
);
}
@Override
...
...
@@ -63,4 +60,18 @@ public class RepairBackBillServiceImpl implements RepairBackBillService {
throw
new
ApiException
(
ResultUtil
.
failed
(
"所查询的Id不存在"
));
}
}
/**
* @param repairBackBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RepairBackBill
>
repairBackBills
)
{
repairBackBills
.
forEach
(
repairBackBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairBackBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairBackBill
.
setRecordId
(
recordId
);
update
(
repairBackBill
);
});
}
}
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -14,10 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -37,11 +39,21 @@ public class RepairBillServiceImpl implements RepairBillService {
@Override
public
RepairBill
addEntity
(
RepairBill
deviceRepairBillEntity
)
{
RepairBill
repairBill
=
deviceRepairBillDao
.
save
(
deviceRepairBillEntity
);
return
deviceRepairBillDao
.
save
(
deviceRepairBillEntity
);
}
/**
* @param repairBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RepairBill
>
repairBills
)
{
repairBills
.
forEach
(
repairBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairBill
.
setRecordId
(
recordId
);
return
update
(
repairBill
);
update
(
repairBill
);
});
}
@Override
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairDetailServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -9,6 +9,7 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -31,11 +32,7 @@ public class RepairDetailServiceImpl implements RepairDetailService {
@Override
public
RepairDetail
save
(
RepairDetail
deviceRepairDetailEntity
)
{
RepairDetail
repairDetail
=
deviceRepairDetailDao
.
save
(
deviceRepairDetailEntity
);
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairDetail
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairDetail
.
setRecordId
(
recordId
);
return
update
(
repairDetail
);
return
deviceRepairDetailDao
.
save
(
deviceRepairDetailEntity
);
}
@Override
...
...
@@ -85,4 +82,18 @@ public class RepairDetailServiceImpl implements RepairDetailService {
throw
new
ApiException
(
ResultUtil
.
failed
(
"所查询ID不存在"
));
}
}
/**
* @param repairDetails 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RepairDetail
>
repairDetails
)
{
repairDetails
.
forEach
(
repairDetail
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairDetail
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairDetail
.
setRecordId
(
recordId
);
update
(
repairDetail
);
});
}
}
dev-repair/src/main/java/com/tykj/dev/device/repair/service/impl/RepairSendBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -14,10 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -37,11 +39,21 @@ public class RepairSendBillServiceImpl implements RepairSendBillService {
@Override
public
RepairSendBill
addEntity
(
RepairSendBill
deviceRepairSendBillEntity
)
{
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
save
(
deviceRepairSendBillEntity
);
return
deviceRepairSendBillDao
.
save
(
deviceRepairSendBillEntity
);
}
/**
* @param repairSendBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RepairSendBill
>
repairSendBills
)
{
repairSendBills
.
forEach
(
repairSendBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
repairSendBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
repairSendBill
.
setRecordId
(
recordId
);
return
update
(
repairSendBill
);
update
(
repairSendBill
);
});
}
@Override
...
...
dev-retired/src/main/java/com/tykj/dev/device/retired/service/DeviceRetiredBillService.java
浏览文件 @
ffa39774
...
...
@@ -2,6 +2,8 @@ package com.tykj.dev.device.retired.service;
import
com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
...
...
@@ -12,6 +14,11 @@ public interface DeviceRetiredBillService {
DeviceRetiredBill
addEntity
(
DeviceRetiredBill
deviceRetiredBillEntity
);
/**
* @param deviceRetiredBills 异步上链
*/
void
sendHash
(
List
<
DeviceRetiredBill
>
deviceRetiredBills
);
DeviceRetiredBill
getOne
(
Integer
id
);
DeviceRetiredBill
update
(
DeviceRetiredBill
deviceRetiredBillEntity
);
...
...
dev-retired/src/main/java/com/tykj/dev/device/retired/service/Impl/DeviceRetiredBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -11,8 +11,10 @@ import com.tykj.dev.device.retired.repository.DeviceRetiredBillDao;
import
com.tykj.dev.device.retired.service.DeviceRetiredBillService
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -35,11 +37,21 @@ public class DeviceRetiredBillServiceImpl implements DeviceRetiredBillService {
@Override
public
DeviceRetiredBill
addEntity
(
DeviceRetiredBill
deviceRetiredBillEntity
)
{
DeviceRetiredBill
deviceRetiredBill
=
deviceRetiredBillDao
.
save
(
deviceRetiredBillEntity
);
return
deviceRetiredBillDao
.
save
(
deviceRetiredBillEntity
);
}
/**
* @param deviceRetiredBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceRetiredBill
>
deviceRetiredBills
)
{
deviceRetiredBills
.
forEach
(
deviceRetiredBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceRetiredBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceRetiredBill
.
setRecordId
(
recordId
);
return
update
(
deviceRetiredBill
);
update
(
deviceRetiredBill
);
});
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/InputOutputDeviceService.java
浏览文件 @
ffa39774
...
...
@@ -19,6 +19,11 @@ public interface InputOutputDeviceService {
*/
InputOutputDevice
addEntity
(
InputOutputDevice
inputOutputDevice
);
/**
* @param inputOutputDevices 异步上链
*/
void
sendHash
(
List
<
InputOutputDevice
>
inputOutputDevices
);
List
<
InputOutputDevice
>
getByUnitIdAndDirection
(
Integer
unitId
,
Integer
direction
);
void
deleteAll
(
List
<
InputOutputDevice
>
inputOutputDevices
);
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/LibraryWarningLogDetailService.java
浏览文件 @
ffa39774
...
...
@@ -2,6 +2,8 @@ package com.tykj.dev.rfid.service;
import
com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
...
...
@@ -12,5 +14,8 @@ public interface LibraryWarningLogDetailService {
LibraryWarningLogDetail
addEntity
(
LibraryWarningLogDetail
libraryWarningLogDetail
);
/**
* @param libraryWarningLogDetails 异步上链
*/
void
sendHash
(
List
<
LibraryWarningLogDetail
>
libraryWarningLogDetails
);
}
dev-rfid/src/main/java/com/tykj/dev/rfid/service/LibraryWarningLogService.java
浏览文件 @
ffa39774
...
...
@@ -17,6 +17,11 @@ public interface LibraryWarningLogService {
LibraryWarningLog
addEntity
(
LibraryWarningLog
libraryWarningLog
);
/**
* @param libraryWarningLogs 异步上链
*/
void
sendHash
(
List
<
LibraryWarningLog
>
libraryWarningLogs
);
Page
<
LibraryWarningLog
>
getPage
(
LibraryWarningLogSelectVo
libraryWarningLogSelectVo
)
throws
ParseException
;
List
<
WarningDetailListVo
>
getWarningDetail
(
Integer
warningId
,
Boolean
isHandle
);
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/RfidChangeBillService.java
浏览文件 @
ffa39774
...
...
@@ -2,6 +2,8 @@ package com.tykj.dev.rfid.service;
import
com.tykj.dev.rfid.entity.domin.RfidChangeBill
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
...
...
@@ -12,6 +14,11 @@ public interface RfidChangeBillService {
RfidChangeBill
addEntity
(
RfidChangeBill
libraryWarningLogEntity
);
/**
* @param rfidChangeBills 异步上链
*/
void
sendHash
(
List
<
RfidChangeBill
>
rfidChangeBills
);
RfidChangeBill
getOne
(
Integer
id
);
RfidChangeBill
updateEntity
(
RfidChangeBill
rfidChangeBill
);
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/RfidChangeLogService.java
浏览文件 @
ffa39774
...
...
@@ -19,6 +19,11 @@ public interface RfidChangeLogService {
RfidChangeLog
addEntity
(
RfidChangeLog
rfidChangeLog
);
/**
* @param rfidChangeLogs 异步上链
*/
void
sendHash
(
List
<
RfidChangeLog
>
rfidChangeLogs
);
RfidChangeLog
updateEntity
(
RfidChangeLog
rfidChangeLog
);
}
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/InputOutputDeviceServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -9,6 +9,7 @@ import com.tykj.dev.rfid.entity.domin.InputOutputDevice;
import
com.tykj.dev.rfid.repository.InputOutputDeviceDao
;
import
com.tykj.dev.rfid.service.InputOutputDeviceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -34,12 +35,21 @@ public class InputOutputDeviceServiceImpl implements InputOutputDeviceService {
@Override
public
InputOutputDevice
addEntity
(
InputOutputDevice
inputOutputDevice
)
{
InputOutputDevice
inputOutputDevice1
=
inputOutputDeviceDao
.
save
(
inputOutputDevice
);
return
inputOutputDeviceDao
.
save
(
inputOutputDevice
);
}
/**
* @param inputOutputDevices 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
InputOutputDevice
>
inputOutputDevices
)
{
inputOutputDevices
.
forEach
(
inputOutputDevice1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
inputOutputDevice1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
inputOutputDevice1
.
setRecordId
(
recordId
);
// blockChainUtil.appendHash(JacksonUtil.toJSon(inputOutputDevice1),inputOutputDevice1.getRecordId()
);
return
inputOutputDeviceDao
.
save
(
inputOutputDevice1
);
inputOutputDeviceDao
.
save
(
inputOutputDevice1
);
}
);
}
@Override
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/LibraryWarningLogDetailServiceImp.java
浏览文件 @
ffa39774
...
...
@@ -7,8 +7,11 @@ import com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail;
import
com.tykj.dev.rfid.repository.LibraryWarningLogDetailDao
;
import
com.tykj.dev.rfid.service.LibraryWarningLogDetailService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
...
...
@@ -26,11 +29,20 @@ public class LibraryWarningLogDetailServiceImp implements LibraryWarningLogDetai
@Override
public
LibraryWarningLogDetail
addEntity
(
LibraryWarningLogDetail
libraryWarningLogDetail
)
{
LibraryWarningLogDetail
libraryWarningLogDetail1
=
libraryWarningLogDetailDao
.
save
(
libraryWarningLogDetail
);
return
libraryWarningLogDetailDao
.
save
(
libraryWarningLogDetail
);
}
/**
* @param libraryWarningLogDetails 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
LibraryWarningLogDetail
>
libraryWarningLogDetails
)
{
libraryWarningLogDetails
.
forEach
(
libraryWarningLogDetail1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
libraryWarningLogDetail1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
libraryWarningLogDetail1
.
setRecordId
(
recordId
);
// blockChainUtil.appendHash(JacksonUtil.toJSon(libraryWarningLogDetail1),libraryWarningLogDetail1.getRecordId()
);
return
libraryWarningLogDetailDao
.
save
(
libraryWarningLogDetail1
);
libraryWarningLogDetailDao
.
save
(
libraryWarningLogDetail1
);
}
);
}
}
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/LibraryWarningLogServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -22,6 +22,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -51,11 +52,21 @@ public class LibraryWarningLogServiceImpl implements LibraryWarningLogService {
@Override
public
LibraryWarningLog
addEntity
(
LibraryWarningLog
libraryWarningLog
)
{
LibraryWarningLog
libraryWarningLog1
=
libraryWarningLogDao
.
save
(
libraryWarningLog
);
return
libraryWarningLogDao
.
save
(
libraryWarningLog
);
}
/**
* @param libraryWarningLogs 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
LibraryWarningLog
>
libraryWarningLogs
)
{
libraryWarningLogs
.
forEach
(
libraryWarningLog1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
libraryWarningLog1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
libraryWarningLog1
.
setRecordId
(
recordId
);
return
update
(
libraryWarningLog1
);
update
(
libraryWarningLog1
);
});
}
@Override
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/RfidChangeBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -8,8 +8,11 @@ import com.tykj.dev.rfid.repository.RfidChangeBillDao;
import
com.tykj.dev.rfid.repository.RfidChangeLogDao
;
import
com.tykj.dev.rfid.service.RfidChangeBillService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @author HuangXiahao
* @version V1.0
...
...
@@ -30,11 +33,21 @@ public class RfidChangeBillServiceImpl implements RfidChangeBillService {
@Override
public
RfidChangeBill
addEntity
(
RfidChangeBill
libraryWarningLogEntity
)
{
RfidChangeBill
rfidChangeBill
=
rfidChangeBillDao
.
save
(
libraryWarningLogEntity
);
return
rfidChangeBillDao
.
save
(
libraryWarningLogEntity
);
}
/**
* @param rfidChangeBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RfidChangeBill
>
rfidChangeBills
)
{
rfidChangeBills
.
forEach
(
rfidChangeBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
rfidChangeBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
rfidChangeBill
.
setRecordId
(
recordId
);
return
updateEntity
(
rfidChangeBill
);
updateEntity
(
rfidChangeBill
);
});
}
@Override
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/service/impl/RfidChangeLogServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -11,6 +11,7 @@ import com.tykj.dev.rfid.repository.RfidChangeLogDao;
import
com.tykj.dev.rfid.service.RfidChangeLogService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -43,11 +44,21 @@ public class RfidChangeLogServiceImpl implements RfidChangeLogService {
@Override
public
RfidChangeLog
addEntity
(
RfidChangeLog
rfidChangeLog
)
{
RfidChangeLog
rfidChangeLog1
=
rfidChangeLogDao
.
save
(
rfidChangeLog
);
return
rfidChangeLogDao
.
save
(
rfidChangeLog
);
}
/**
* @param rfidChangeLogs 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
RfidChangeLog
>
rfidChangeLogs
)
{
rfidChangeLogs
.
forEach
(
rfidChangeLog1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
rfidChangeLog1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
rfidChangeLog1
.
setRecordId
(
recordId
);
return
updateEntity
(
rfidChangeLog1
);
updateEntity
(
rfidChangeLog1
);
});
}
@Override
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/ScrapBillService.java
浏览文件 @
ffa39774
...
...
@@ -4,6 +4,8 @@ import com.tykj.dev.device.scrap.subject.domin.ScrapBill;
import
com.tykj.dev.device.scrap.subject.vo.ScrapSelectVo
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -11,6 +13,11 @@ public interface ScrapBillService {
ScrapBill
add
(
ScrapBill
scrapBill
);
/**
* @param scrapBills 异步上链
*/
void
sendHash
(
List
<
ScrapBill
>
scrapBills
);
ScrapBill
getOne
(
Integer
id
);
ScrapBill
update
(
ScrapBill
scrapBill
);
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/service/impl/ScrapBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -13,10 +13,12 @@ import com.tykj.dev.misc.utils.JacksonUtil;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -33,11 +35,21 @@ public class ScrapBillServiceImpl implements ScrapBillService {
@Override
public
ScrapBill
add
(
ScrapBill
scrapBill
)
{
ScrapBill
scrapBill1
=
scrapBillDao
.
save
(
scrapBill
);
return
scrapBillDao
.
save
(
scrapBill
);
}
/**
* @param scrapBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
ScrapBill
>
scrapBills
)
{
scrapBills
.
forEach
(
scrapBill1
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
scrapBill1
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
scrapBill1
.
setRecordId
(
recordId
);
return
update
(
scrapBill1
);
update
(
scrapBill1
);
});
}
@Override
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
ffa39774
...
...
@@ -115,9 +115,9 @@ public class SelfCheckController {
public
ResponseEntity
setCycle
(
@PathVariable
(
"type"
)
int
type
){
if
(
selfCheckSchedulerTask
!=
null
)
{
String
corn
=
"0 0 0 1 1/"
+
type
+
" ? "
;
selfCheckSchedulerTask
.
setCron
(
corn
);
ScheduledFuture
scheduledFuture
=
selfCheckSchedulerTask
.
getScheduledFuture
();
scheduledFuture
.
cancel
(
true
);
selfCheckSchedulerTask
.
setCron
(
corn
);
selfCheckSchedulerTask
.
startTask
();
systemVariableService
.
setVaule
(
"selfCheckCycle"
,
corn
);
log
.
info
(
"[自查模块]:自查周期更改为"
+
type
+
"个月"
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/SelfCheckBillService.java
浏览文件 @
ffa39774
...
...
@@ -6,6 +6,8 @@ import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
java.util.List
;
/**
* @author dengdiyi
*/
...
...
@@ -13,6 +15,11 @@ public interface SelfCheckBillService {
SelfCheckBill
addEntity
(
SelfCheckBill
selfExaminationBillEntity
);
/**
* @param selfCheckBills 异步上链
*/
void
sendHash
(
List
<
SelfCheckBill
>
selfCheckBills
);
SelfCheckBill
update
(
SelfCheckBill
selfExaminationBillEntity
);
SelfCheckBill
getOne
(
Integer
id
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/service/impl/SelfCheckBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -16,10 +16,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
import
java.util.List
;
import
java.util.Optional
;
/**
...
...
@@ -39,11 +41,21 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
@Override
public
SelfCheckBill
addEntity
(
SelfCheckBill
selfExaminationBillEntity
)
{
SelfCheckBill
selfCheckBill
=
selfExaminationBillDao
.
save
(
selfExaminationBillEntity
);
return
selfExaminationBillDao
.
save
(
selfExaminationBillEntity
);
}
/**
* @param selfCheckBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
SelfCheckBill
>
selfCheckBills
)
{
selfCheckBills
.
forEach
(
selfCheckBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
selfCheckBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
selfCheckBill
.
setRecordId
(
recordId
);
return
update
(
selfCheckBill
);
update
(
selfCheckBill
);
});
}
@Override
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/subject/vo/SelfCheckSaveVo.java
浏览文件 @
ffa39774
...
...
@@ -28,7 +28,7 @@ public class SelfCheckSaveVo {
@ApiModelProperty
(
name
=
"任务id"
,
example
=
"1"
)
private
Integer
taskId
;
@NotNull
(
message
=
"userbId不能为空"
)
//
@NotNull(message = "userbId不能为空")
@Min
(
value
=
1
,
message
=
"userbId不能小于1"
)
@ApiModelProperty
(
name
=
"审核人ID"
,
example
=
"1"
)
private
Integer
userbId
;
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/service/StorageBillService.java
浏览文件 @
ffa39774
...
...
@@ -13,6 +13,11 @@ public interface StorageBillService {
StorageBill
addEntity
(
StorageBill
storageBillEntity
);
/**
* @param storageBills 异步上链
*/
void
sendHash
(
List
<
StorageBill
>
storageBills
);
Page
<
StorageBill
>
getPage
(
StorageBill
storageBillEntity
,
Pageable
pageable
);
List
<
StorageBill
>
getList
(
StorageBill
storageBillEntity
);
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/service/impl/StorageBillServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -9,6 +9,7 @@ import com.tykj.dev.misc.utils.JacksonUtil;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -28,11 +29,21 @@ public class StorageBillServiceImpl implements StorageBillService {
@Override
public
StorageBill
addEntity
(
StorageBill
storageBillEntity
)
{
StorageBill
storageBill
=
storageBillDao
.
save
(
storageBillEntity
);
return
storageBillDao
.
save
(
storageBillEntity
);
}
/**
* @param storageBills 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
StorageBill
>
storageBills
)
{
storageBills
.
forEach
(
storageBill
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
storageBill
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
storageBill
.
setRecordId
(
recordId
);
return
update
(
storageBill
);
update
(
storageBill
);
});
}
@Override
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/TaskService.java
浏览文件 @
ffa39774
...
...
@@ -99,6 +99,11 @@ public interface TaskService {
*/
TaskBto
start
(
TaskBto
taskBto
);
/**
* @param taskBtos 异步上链
*/
void
sendHash
(
List
<
TaskBto
>
taskBtos
);
/**
* 更新Task
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.task.service.impl;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.blockcha.subject.entity.BcHash
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.config.GlobalMap
;
import
com.tykj.dev.config.Log
;
...
...
@@ -20,10 +21,12 @@ import com.tykj.dev.device.user.subject.service.UserPublicService;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.socket.MyWebSocket
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
...
...
@@ -288,6 +291,20 @@ public class TaskServiceImpl implements TaskService {
return
task
.
parse2Bto
();
}
/**
* @param taskBtos 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
TaskBto
>
taskBtos
)
{
taskBtos
.
forEach
(
taskBto
->
{
Task
task
=
taskBto
.
toDo
();
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
task
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
task
.
setRecordId
(
recordId
);
});
}
/**
* 更新Task
*/
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/TrainThemeService.java
浏览文件 @
ffa39774
...
...
@@ -16,6 +16,11 @@ public interface TrainThemeService {
TrainTheme
save
(
TrainTheme
trainTheme
);
/**
* @param trainThemes 异步上链
*/
void
sendHash
(
List
<
TrainTheme
>
trainThemes
);
TrainTheme
findById
(
Integer
trainThemeId
);
List
<
TrainTheme
>
findAllStatus
(
Integer
status
);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/TrainThemeServiceImpl.java
浏览文件 @
ffa39774
package
com
.
tykj
.
dev
.
device
.
train
.
service
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.blockcha.subject.entity.BcHash
;
import
com.tykj.dev.blockcha.subject.entity.BcText
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.train.dao.TrainThemeDao
;
...
...
@@ -19,16 +17,14 @@ import com.tykj.dev.device.user.subject.service.UserService;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.http.RequestEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
java.lang.reflect.Field
;
...
...
@@ -65,12 +61,21 @@ public class TrainThemeServiceImpl implements TrainThemeService {
@Override
public
TrainTheme
save
(
TrainTheme
trainTheme
)
{
TrainTheme
trainTheme1
=
trainThemeDao
.
save
(
trainTheme
);
return
trainThemeDao
.
save
(
trainTheme
);
}
/**
* @param trainThemes 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
TrainTheme
>
trainThemes
)
{
trainThemes
.
forEach
(
trainTheme1
->
{
BcHash
bcHash
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
trainTheme1
));
trainTheme1
.
setRecordId
(
bcHash
.
getData
().
getRecordID
());
trainThemeDao
.
save
(
trainTheme1
);
return
trainTheme1
;
});
}
@Override
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitsServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -301,12 +301,17 @@ public class UnitsServiceImpl implements UnitsService {
@Override
public
Units
save
(
Units
units
)
{
if
(
units
.
getAreaId
()!=
null
&&
units
.
getAreaId
()!=
0
)
{
Optional
<
Area
>
optionalArea
=
areaDao
.
findById
(
units
.
getAreaId
());
if
(
optionalArea
.
isPresent
())
{
if
(
optionalArea
.
isPresent
())
{
units
.
setLevel
(
optionalArea
.
get
().
getType
());
}
else
{
}
else
{
throw
new
ApiException
(
ResponseEntity
.
ok
(
"[单位] 没找到对应的区域,请检查"
));
}
}
else
{
units
.
setLevel
(
4
);
}
return
unitsDao
.
save
(
units
);
}
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/service/DeviceUseReportService.java
浏览文件 @
ffa39774
...
...
@@ -17,6 +17,11 @@ public interface DeviceUseReportService {
DeviceUseReport
addEntity
(
DeviceUseReport
deviceUseReportEntity
);
/**
* @param deviceUseReports 异步上链
*/
void
sendHash
(
List
<
DeviceUseReport
>
deviceUseReports
);
Page
<
DeviceUseReport
>
getPage
(
DeviceUseReportSelectVo
deviceUseReportSelectVo
,
Pageable
pageable
);
DeviceUseReport
getOne
(
Integer
id
);
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/service/impl/DeviceUseReportServiceImpl.java
浏览文件 @
ffa39774
...
...
@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.Transient
;
...
...
@@ -88,11 +89,21 @@ public class DeviceUseReportServiceImpl implements DeviceUseReportService {
@Override
public
DeviceUseReport
addEntity
(
DeviceUseReport
deviceUseReportEntity
)
{
DeviceUseReport
deviceUseReport
=
deviceUseReportDao
.
save
(
deviceUseReportEntity
);
return
deviceUseReportDao
.
save
(
deviceUseReportEntity
);
}
/**
* @param deviceUseReports 异步上链
*/
@Override
@Async
public
void
sendHash
(
List
<
DeviceUseReport
>
deviceUseReports
)
{
deviceUseReports
.
forEach
(
deviceUseReport
->
{
BcHash
bcText
=
blockChainUtil
.
sendHash
(
1000
,
JacksonUtil
.
toJSon
(
deviceUseReport
));
String
recordId
=
bcText
.
getData
().
getRecordID
();
deviceUseReport
.
setRecordId
(
recordId
);
return
update
(
deviceUseReport
);
update
(
deviceUseReport
);
});
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论