Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
3ec17b41
提交
3ec17b41
authored
12月 07, 2020
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[用户] [清退] [专管员统计] 代码提交
上级
30f83dbe
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
175 行增加
和
30 行删除
+175
-30
BlockchaController.java
.../com/tykj/dev/blockcha/controller/BlockchaController.java
+0
-0
BlockChainUtil.java
...com/tykj/dev/blockcha/subject/service/BlockChainUtil.java
+20
-0
BlockChainUtilImpl.java
...dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
+37
-3
SendBackBill.java
.../tykj/dev/device/sendback/entity/domain/SendBackBill.java
+3
-0
SendBackBillDetail.java
...dev/device/sendback/entity/domain/SendBackBillDetail.java
+3
-0
SendBackServiceImpl.java
...dev/device/sendback/service/impl/SendBackServiceImpl.java
+57
-16
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+32
-8
TrainTheme.java
...ain/java/com/tykj/dev/device/train/entity/TrainTheme.java
+2
-0
TrainUser.java
...main/java/com/tykj/dev/device/train/entity/TrainUser.java
+3
-0
WorkHandover.java
...n/java/com/tykj/dev/device/train/entity/WorkHandover.java
+3
-0
TrainThemeServiceImpl.java
.../dev/device/train/service/impl/TrainThemeServiceImpl.java
+13
-1
SecurityConfig.java
.../java/com/tykj/dev/device/user/config/SecurityConfig.java
+2
-2
没有找到文件。
dev-blockcha/src/main/java/com/tykj/dev/blockcha/controller/BlockchaController.java
浏览文件 @
3ec17b41
差异被折叠。
点击展开。
dev-blockcha/src/main/java/com/tykj/dev/blockcha/subject/service/BlockChainUtil.java
浏览文件 @
3ec17b41
...
@@ -57,6 +57,17 @@ public interface BlockChainUtil {
...
@@ -57,6 +57,17 @@ public interface BlockChainUtil {
*/
*/
BcHash
sendHash
(
Integer
index
,
Integer
subCode
,
String
content
);
BcHash
sendHash
(
Integer
index
,
Integer
subCode
,
String
content
);
/**
* hash 上链
*
* @param subCode 业务代码编号
* @param content 内容哈希,256bits hex编码。 方法可参考本模块HexUtil,方法内已转换,直接传入内容即可
* @return bh
*/
BcHash
sendHash
(
Integer
subCode
,
String
content
);
/**
/**
* 记录查询
* 记录查询
*
*
...
@@ -113,6 +124,15 @@ public interface BlockChainUtil {
...
@@ -113,6 +124,15 @@ public interface BlockChainUtil {
*/
*/
BcHash
appendHash
(
Integer
index
,
String
content
,
String
recordId
);
BcHash
appendHash
(
Integer
index
,
String
content
,
String
recordId
);
/**
* 哈希追加更新
*
* @param content 内容哈希,256bits hex编码,方法内已转换,直接传入内容即可
* @param recordId 本条记录上次上链或追加返回的记录id, 确保顺序追加
* @return bc
*/
BcHash
appendHash
(
String
content
,
String
recordId
);
/**
/**
* 哈希防篡改校验
* 哈希防篡改校验
*
*
...
...
dev-blockcha/src/main/java/com/tykj/dev/blockcha/subject/service/impl/BlockChainUtilImpl.java
浏览文件 @
3ec17b41
...
@@ -27,9 +27,13 @@ import java.util.UUID;
...
@@ -27,9 +27,13 @@ import java.util.UUID;
@Component
@Component
public
class
BlockChainUtilImpl
implements
BlockChainUtil
{
public
class
BlockChainUtilImpl
implements
BlockChainUtil
{
public
String
SECRET_KEY
=
"3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8"
;
// private static String SECRET_KEY = "3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8";
public
String
SECRET_ID
=
"3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp"
;
// private static String SECRET_ID = "3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp";
private
final
static
String
BLOCK_CHAIN_URL
=
"http://10.153.4.12:8076"
;
//测试环境
public
String
SECRET_KEY
=
"3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs"
;
public
String
SECRET_ID
=
"JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS"
;
private
final
static
String
BLOCK_CHAIN_URL
=
"http://192.168.0.80:8076"
;
private
final
static
String
BLOCK_CHAIN_URL2
=
"http://10.153.8.10:8076"
;
private
final
static
String
BLOCK_CHAIN_URL2
=
"http://10.153.8.10:8076"
;
private
final
static
String
BLOCK_CHAIN_URL3
=
"http://10.153.8.11:8076"
;
private
final
static
String
BLOCK_CHAIN_URL3
=
"http://10.153.8.11:8076"
;
private
final
static
String
BLOCK_CHAIN_URL4
=
"http://10.153.110.10:8076"
;
private
final
static
String
BLOCK_CHAIN_URL4
=
"http://10.153.110.10:8076"
;
...
@@ -177,6 +181,22 @@ public class BlockChainUtilImpl implements BlockChainUtil {
...
@@ -177,6 +181,22 @@ public class BlockChainUtilImpl implements BlockChainUtil {
);
);
}
}
@Override
public
BcHash
sendHash
(
Integer
subCode
,
String
content
)
{
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
request
.
put
(
"content"
,
HexUtil
.
hex64
(
content
));
request
.
put
(
"subCode"
,
subCode
);
String
s
=
ApiSignatureUtil
.
getApiSignature
(
request
,
SECRET_KEY
);
log
.
info
(
"apiSignature:{}"
,
s
);
request
.
put
(
"apiSignature"
,
s
);
return
new
RestTemplate
().
postForObject
(
BLOCK_CHAIN_URL
+
BcUrl
.
SEND_HASH
,
request
,
BcHash
.
class
);
}
@Override
@Override
public
BcRecord
fetchRecord
(
String
recordId
)
{
public
BcRecord
fetchRecord
(
String
recordId
)
{
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
...
@@ -310,6 +330,20 @@ public class BlockChainUtilImpl implements BlockChainUtil {
...
@@ -310,6 +330,20 @@ public class BlockChainUtilImpl implements BlockChainUtil {
}
}
@Override
public
BcHash
appendHash
(
String
content
,
String
recordId
)
{
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
request
.
put
(
"content"
,
HexUtil
.
hex64
(
content
));
request
.
put
(
"recordID"
,
recordId
);
String
s
=
ApiSignatureUtil
.
getApiSignature
(
request
,
SECRET_KEY
);
request
.
put
(
"apiSignature"
,
s
);
return
new
RestTemplate
().
postForObject
(
BLOCK_CHAIN_URL
+
BcUrl
.
APPEND_HASH
,
request
,
BcHash
.
class
);
}
@Override
@Override
public
BcVerify
verifyHash
(
String
content
,
String
recordId
)
{
public
BcVerify
verifyHash
(
String
content
,
String
recordId
)
{
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
SortedMap
<
Object
,
Object
>
request
=
getRequest
();
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/SendBackBill.java
浏览文件 @
3ec17b41
...
@@ -104,4 +104,7 @@ public class SendBackBill {
...
@@ -104,4 +104,7 @@ public class SendBackBill {
@ApiModelProperty
(
value
=
"是否完成"
)
@ApiModelProperty
(
value
=
"是否完成"
)
private
Integer
isComplete
;
private
Integer
isComplete
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/SendBackBillDetail.java
浏览文件 @
3ec17b41
...
@@ -223,4 +223,7 @@ public class SendBackBillDetail {
...
@@ -223,4 +223,7 @@ public class SendBackBillDetail {
@ApiModelProperty
(
value
=
"收件单位签章id"
)
@ApiModelProperty
(
value
=
"收件单位签章id"
)
private
String
rightSignatureId
;
private
String
rightSignatureId
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
}
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/SendBackServiceImpl.java
浏览文件 @
3ec17b41
...
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.github.wenhao.jpa.Specifications
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.blockcha.subject.entity.BcText
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
...
@@ -78,6 +80,9 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -78,6 +80,9 @@ public class SendBackServiceImpl implements SendBackService {
@Autowired
@Autowired
Snowflake
snowflake
;
Snowflake
snowflake
;
@Autowired
BlockChainUtil
blockChainUtil
;
@Autowired
@Autowired
MessageService
messageService
;
MessageService
messageService
;
/**
/**
...
@@ -304,7 +309,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -304,7 +309,8 @@ public class SendBackServiceImpl implements SendBackService {
TaskBto
parentTask
=
taskService
.
get
(
parentTaskId
);
TaskBto
parentTask
=
taskService
.
get
(
parentTaskId
);
SendBackBill
parentBillEntity
=
sendBackBillEntityDao
.
findById
(
parentTask
.
getBillId
()).
get
();
SendBackBill
parentBillEntity
=
sendBackBillEntityDao
.
findById
(
parentTask
.
getBillId
()).
get
();
parentBillEntity
.
setExceptionDes
(
JSON
.
toJSONString
(
unDeviceDes
));
parentBillEntity
.
setExceptionDes
(
JSON
.
toJSONString
(
unDeviceDes
));
sendBackBillEntityDao
.
save
(
parentBillEntity
);
saveSendBackBill
(
parentBillEntity
);
Set
<
String
>
locationKey
=
locationUnitList
.
keySet
();
Set
<
String
>
locationKey
=
locationUnitList
.
keySet
();
...
@@ -401,7 +407,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -401,7 +407,8 @@ public class SendBackServiceImpl implements SendBackService {
}
}
sendBackBillEntityDao
.
save
(
parentTaskBill
);
// sendBackBillEntityDao.save(parentTaskBill);
saveSendBackBill
(
parentTaskBill
);
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveToEnd
(
taskBto
);
if
(
units
.
getLevel
()==
2
){
if
(
units
.
getLevel
()==
2
){
...
@@ -409,7 +416,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -409,7 +416,8 @@ public class SendBackServiceImpl implements SendBackService {
Integer
cityTaskBillId
=
cityTask
.
getBillId
();
Integer
cityTaskBillId
=
cityTask
.
getBillId
();
SendBackBill
cityTaskBill
=
sendBackBillEntityDao
.
findById
(
cityTaskBillId
).
get
();
SendBackBill
cityTaskBill
=
sendBackBillEntityDao
.
findById
(
cityTaskBillId
).
get
();
parentTaskBill
.
setInvoleDevice
(
cityTaskBill
.
getInvoleDevice
()+
involeDevice
);
parentTaskBill
.
setInvoleDevice
(
cityTaskBill
.
getInvoleDevice
()+
involeDevice
);
sendBackBillEntityDao
.
save
(
parentTaskBill
);
saveSendBackBill
(
parentTaskBill
);
// sendBackBillEntityDao.save(parentTaskBill);
}
}
return
ResponseEntity
.
ok
(
"异常处理成功"
);
return
ResponseEntity
.
ok
(
"异常处理成功"
);
...
@@ -518,10 +526,12 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -518,10 +526,12 @@ public class SendBackServiceImpl implements SendBackService {
sendBackBillDetailEntity
.
setNum
(
"第"
+
new
Date
().
getYear
()+
"QT"
+
taskEntity
.
getBillId
()+
"号"
);
sendBackBillDetailEntity
.
setNum
(
"第"
+
new
Date
().
getYear
()+
"QT"
+
taskEntity
.
getBillId
()+
"号"
);
sendBackBillDetailEntity
.
setLeftSignatureId
(
String
.
valueOf
(
snowflake
.
creatNextId
()));
sendBackBillDetailEntity
.
setLeftSignatureId
(
String
.
valueOf
(
snowflake
.
creatNextId
()));
sendBackBillDetailEntity
.
setRightSignatureId
(
String
.
valueOf
(
snowflake
.
creatNextId
()));
sendBackBillDetailEntity
.
setRightSignatureId
(
String
.
valueOf
(
snowflake
.
creatNextId
()));
SendBackBillDetail
backBillDetailEntity
=
sendBackBillDetailEntityDao
.
save
(
sendBackBillDetailEntity
);
// SendBackBillDetail backBillDetailEntity = sendBackBillDetailEntityDao.save(sendBackBillDetailEntity);
bill
.
setFormId
(
backBillDetailEntity
.
getId
());
SendBackBillDetail
backBillDetailEntity
=
saveSendBackBillDetail
(
sendBackBillDetailEntity
);
sendBackBillEntityDao
.
save
(
bill
);
bill
.
setFormId
(
backBillDetailEntity
.
getId
());
// sendBackBillEntityDao.save(bill);
saveSendBackBill
(
bill
);
Units
father
=
fatherUnit
.
get
(
0
);
Units
father
=
fatherUnit
.
get
(
0
);
taskEntity
.
setOwnUnit
(
father
.
getUnitId
());
taskEntity
.
setOwnUnit
(
father
.
getUnitId
());
...
@@ -595,7 +605,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -595,7 +605,8 @@ public class SendBackServiceImpl implements SendBackService {
Integer
billId
=
taskEntity
.
getBillId
();
Integer
billId
=
taskEntity
.
getBillId
();
SendBackBill
bill
=
sendBackBillEntityDao
.
findById
(
billId
).
get
();
SendBackBill
bill
=
sendBackBillEntityDao
.
findById
(
billId
).
get
();
bill
.
setIsComplete
(
1
);
bill
.
setIsComplete
(
1
);
sendBackBillEntityDao
.
save
(
bill
);
// sendBackBillEntityDao.save(bill);
saveSendBackBill
(
bill
);
List
<
Integer
>
idList
=
stringToList
(
bill
.
getInvoleDevice
());
List
<
Integer
>
idList
=
stringToList
(
bill
.
getInvoleDevice
());
List
<
DeviceLibrary
>
deviceList
=
deviceLibraryDao
.
getDeviceLibraryEntitiesByIdIn
(
idList
);
List
<
DeviceLibrary
>
deviceList
=
deviceLibraryDao
.
getDeviceLibraryEntitiesByIdIn
(
idList
);
for
(
DeviceLibrary
d:
deviceList
)
{
for
(
DeviceLibrary
d:
deviceList
)
{
...
@@ -658,7 +669,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -658,7 +669,8 @@ public class SendBackServiceImpl implements SendBackService {
}
else
{
}
else
{
sendBackVo
.
setStatus
(
0
);
sendBackVo
.
setStatus
(
0
);
fatherBill
.
setSendBackStatistical
(
JSON
.
toJSONString
(
sendBackVo
));
fatherBill
.
setSendBackStatistical
(
JSON
.
toJSONString
(
sendBackVo
));
sendBackBillEntityDao
.
save
(
fatherBill
);
// sendBackBillEntityDao.save(fatherBill);
saveSendBackBill
(
fatherBill
);
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1201
,
fatherTaskBto
.
getCreateUserId
());
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1201
,
fatherTaskBto
.
getCreateUserId
());
}
}
}
}
...
@@ -816,8 +828,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -816,8 +828,8 @@ public class SendBackServiceImpl implements SendBackService {
form
.
setSendedCount
(
sendBackOut
.
getShouldOut
());
form
.
setSendedCount
(
sendBackOut
.
getShouldOut
());
form
.
setReceiveUserBId
(
sendBackOut
.
getReviewerNameId
());
form
.
setReceiveUserBId
(
sendBackOut
.
getReviewerNameId
());
form
.
setReceiveUserBName
(
sendBackOut
.
getReviewerName
());
form
.
setReceiveUserBName
(
sendBackOut
.
getReviewerName
());
sendBackBillDetailEntityDao
.
save
(
form
);
//
sendBackBillDetailEntityDao.save(form);
saveSendBackBillDetail
(
form
);
Units
unit
=
unitsDao
.
findById
(
taskEntity
.
getOwnUnit
()).
get
();
Units
unit
=
unitsDao
.
findById
(
taskEntity
.
getOwnUnit
()).
get
();
...
@@ -829,7 +841,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -829,7 +841,8 @@ public class SendBackServiceImpl implements SendBackService {
修改装备是所属单位
修改装备是所属单位
*/
*/
bill
.
setIsComplete
(
1
);
bill
.
setIsComplete
(
1
);
sendBackBillEntityDao
.
save
(
bill
);
// sendBackBillEntityDao.save(bill);
saveSendBackBill
(
bill
);
List
<
Integer
>
idList
=
stringToList
(
bill
.
getInvoleDevice
());
List
<
Integer
>
idList
=
stringToList
(
bill
.
getInvoleDevice
());
List
<
DeviceLibrary
>
deviceList
=
deviceLibraryDao
.
getDeviceLibraryEntitiesByIdIn
(
idList
);
List
<
DeviceLibrary
>
deviceList
=
deviceLibraryDao
.
getDeviceLibraryEntitiesByIdIn
(
idList
);
for
(
DeviceLibrary
d:
deviceList
)
{
for
(
DeviceLibrary
d:
deviceList
)
{
...
@@ -949,7 +962,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -949,7 +962,8 @@ public class SendBackServiceImpl implements SendBackService {
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
SendBackBill
billEntity
=
sendBackBillEntityDao
.
save
(
sendBackBillEntity
);
// SendBackBill billEntity = sendBackBillEntityDao.save(sendBackBillEntity);
SendBackBill
billEntity
=
saveSendBackBill
(
sendBackBillEntity
);
//生成省级及以下的Task
//生成省级及以下的Task
List
<
Integer
>
integers
=
new
ArrayList
<>();
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
=
userDao
.
findAllByUnitsId
(
unitId
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
integers
=
userDao
.
findAllByUnitsId
(
unitId
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
...
@@ -979,8 +993,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -979,8 +993,8 @@ public class SendBackServiceImpl implements SendBackService {
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
SendBackBill
billEntity
=
sendBackBillEntityDao
.
save
(
sendBackBillEntity
);
//
SendBackBill billEntity = sendBackBillEntityDao.save(sendBackBillEntity);
SendBackBill
billEntity
=
saveSendBackBill
(
sendBackBillEntity
);
/*
/*
生成省级及以下的Task
生成省级及以下的Task
*/
*/
...
@@ -1019,7 +1033,8 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -1019,7 +1033,8 @@ public class SendBackServiceImpl implements SendBackService {
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setTitle
(
"异常装备处理"
);
sendBackBillEntity
.
setTitle
(
"异常装备处理"
);
SendBackBill
billEntity
=
sendBackBillEntityDao
.
save
(
sendBackBillEntity
);
// SendBackBill billEntity = sendBackBillEntityDao.save(sendBackBillEntity);
SendBackBill
billEntity
=
saveSendBackBill
(
sendBackBillEntity
);
/*
/*
生成省级及以下的Task
生成省级及以下的Task
...
@@ -1054,7 +1069,9 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -1054,7 +1069,9 @@ public class SendBackServiceImpl implements SendBackService {
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setDeadLine
(
deadLine
);
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setReviewUserId
(
startUserId
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
sendBackBillEntity
.
setTitle
(
"清退账单"
);
SendBackBill
billEntity
=
sendBackBillEntityDao
.
save
(
sendBackBillEntity
);
// SendBackBill billEntity = sendBackBillEntityDao.save(sendBackBillEntity);
SendBackBill
billEntity
=
saveSendBackBill
(
sendBackBillEntity
);
/*
/*
生成省级及以下的Task
生成省级及以下的Task
*/
*/
...
@@ -1654,4 +1671,28 @@ public class SendBackServiceImpl implements SendBackService {
...
@@ -1654,4 +1671,28 @@ public class SendBackServiceImpl implements SendBackService {
return
areaToTaskId
;
return
areaToTaskId
;
}
}
private
SendBackBill
saveSendBackBill
(
SendBackBill
sendBackBill
){
SendBackBill
sendBackBill1
=
sendBackBillEntityDao
.
save
(
sendBackBill
);
if
(
sendBackBill1
.
getRecordId
()==
null
||
sendBackBill1
.
getRecordId
().
equals
(
""
)){
BcText
bcText
=
blockChainUtil
.
sendText
(
1000
,
JacksonUtil
.
toJSon
(
sendBackBill1
));
sendBackBill1
.
setRecordId
(
bcText
.
getData
().
getRecordID
());
return
sendBackBillEntityDao
.
save
(
sendBackBill1
);
}
else
{
blockChainUtil
.
appendText
(
JacksonUtil
.
toJSon
(
sendBackBill1
),
sendBackBill1
.
getRecordId
());
return
sendBackBill1
;
}
}
private
SendBackBillDetail
saveSendBackBillDetail
(
SendBackBillDetail
sendBackBillDetail
){
SendBackBillDetail
sendBackBillDetail1
=
sendBackBillDetailEntityDao
.
save
(
sendBackBillDetail
);
if
(
sendBackBillDetail1
.
getRecordId
()==
null
||
sendBackBillDetail1
.
getRecordId
().
equals
(
""
)){
BcText
bcText
=
blockChainUtil
.
sendText
(
1000
,
JacksonUtil
.
toJSon
(
sendBackBillDetail1
));
sendBackBillDetail1
.
setRecordId
(
bcText
.
getData
().
getRecordID
());
return
sendBackBillDetailEntityDao
.
save
(
sendBackBillDetail1
);
}
else
{
blockChainUtil
.
appendText
(
JacksonUtil
.
toJSon
(
sendBackBillDetail1
),
sendBackBillDetail1
.
getRecordId
());
return
sendBackBillDetail1
;
}
}
}
}
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
3ec17b41
package
com
.
tykj
.
dev
.
device
.
train
.
controller
;
package
com
.
tykj
.
dev
.
device
.
train
.
controller
;
import
com.tykj.dev.blockcha.subject.entity.BcText
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.service.TaskService
;
...
@@ -74,6 +76,9 @@ public class TrainJobController {
...
@@ -74,6 +76,9 @@ public class TrainJobController {
@Autowired
@Autowired
UserLogService
userLogService
;
UserLogService
userLogService
;
@Autowired
BlockChainUtil
blockChainUtil
;
// 发起培训给选中人员都发一个代办任务报名,此任务在发起人跟踪里
// 发起培训给选中人员都发一个代办任务报名,此任务在发起人跟踪里
...
@@ -107,7 +112,8 @@ public class TrainJobController {
...
@@ -107,7 +112,8 @@ public class TrainJobController {
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsNotJoinUserId
(
1
);
trainUser
.
setIsNotJoinUserId
(
1
);
trainUser
.
setTrainId
(
trainTheme
.
getTrainId
());
trainUser
.
setTrainId
(
trainTheme
.
getTrainId
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
...
@@ -117,7 +123,8 @@ public class TrainJobController {
...
@@ -117,7 +123,8 @@ public class TrainJobController {
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsSignUp
(
2
);
trainUser
.
setIsNotJoinUserId
(
0
);
trainUser
.
setIsNotJoinUserId
(
0
);
trainUser
.
setTrainId
(
trainTheme
.
getTrainId
());
trainUser
.
setTrainId
(
trainTheme
.
getTrainId
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
...
@@ -175,7 +182,7 @@ public class TrainJobController {
...
@@ -175,7 +182,7 @@ public class TrainJobController {
}
}
trainUser
.
setUnitsName
(
unitsDao
.
findById
(
trainUser
.
getUnitsId
()).
get
().
getName
());
trainUser
.
setUnitsName
(
unitsDao
.
findById
(
trainUser
.
getUnitsId
()).
get
().
getName
());
myWebSocket
.
sendMessage1
();
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
trainUserDao
.
save
(
trainUser
));
return
ResponseEntity
.
ok
(
saveTrainUser
(
trainUser
));
}
}
/**
/**
...
@@ -194,7 +201,8 @@ public class TrainJobController {
...
@@ -194,7 +201,8 @@ public class TrainJobController {
List
<
Integer
>
ids
=
taskBto
.
getInvolveUserIdList
();
List
<
Integer
>
ids
=
taskBto
.
getInvolveUserIdList
();
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
ids
.
get
(
ids
.
size
()-
1
),
trainTheme
.
getTrainId
());
TrainUser
trainUser
=
trainUserDao
.
findByUserIdAndTrainId
(
ids
.
get
(
ids
.
size
()-
1
),
trainTheme
.
getTrainId
());
trainUser
.
setIsSignUp
(
1
);
trainUser
.
setIsSignUp
(
1
);
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
userLogService
.
save
(
new
UserLog
(
trainUser
.
getUserId
(),
new
Date
(),
"报名参加培训"
));
userLogService
.
save
(
new
UserLog
(
trainUser
.
getUserId
(),
new
Date
(),
"报名参加培训"
));
}
}
);
);
...
@@ -249,7 +257,8 @@ public class TrainJobController {
...
@@ -249,7 +257,8 @@ public class TrainJobController {
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1005
.
id
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1005
.
id
);
...
@@ -281,7 +290,8 @@ public class TrainJobController {
...
@@ -281,7 +290,8 @@ public class TrainJobController {
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1006
.
id
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1006
.
id
);
...
@@ -310,7 +320,8 @@ public class TrainJobController {
...
@@ -310,7 +320,8 @@ public class TrainJobController {
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUser
.
setCertificate
(
gradeEntry
.
getCertificate
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1007
.
id
);
trainTheme
.
setTrainStatus
(
StatusEnum
.
TRAIN1007
.
id
);
...
@@ -360,7 +371,8 @@ public class TrainJobController {
...
@@ -360,7 +371,8 @@ public class TrainJobController {
trainUser
.
setAttendance
(
gradeEntry
.
getAttendance
());
trainUser
.
setAttendance
(
gradeEntry
.
getAttendance
());
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setScore
(
gradeEntry
.
getScore
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUser
.
setEvaluation
(
gradeEntry
.
getEvaluation
());
trainUserDao
.
save
(
trainUser
);
// trainUserDao.save(trainUser);
saveTrainUser
(
trainUser
);
}
}
);
);
trainThemeService
.
save
(
trainTheme
);
trainThemeService
.
save
(
trainTheme
);
...
@@ -442,4 +454,16 @@ public class TrainJobController {
...
@@ -442,4 +454,16 @@ public class TrainJobController {
return
mapper
.
map
(
user
,
TrainUser
.
class
);
return
mapper
.
map
(
user
,
TrainUser
.
class
);
}
}
private
TrainUser
saveTrainUser
(
TrainUser
trainUser
){
TrainUser
trainUser1
=
trainUserDao
.
save
(
trainUser
);
if
(
trainUser1
.
getRecordId
()==
null
||
trainUser1
.
getRecordId
().
equals
(
""
)){
BcText
bcText
=
blockChainUtil
.
sendText
(
1000
,
JacksonUtil
.
toJSon
(
trainUser1
));
trainUser1
.
setRecordId
(
bcText
.
getData
().
getRecordID
());
return
trainUserDao
.
save
(
trainUser1
);
}
else
{
blockChainUtil
.
appendText
(
JacksonUtil
.
toJSon
(
trainUser1
),
trainUser1
.
getRecordId
());
return
trainUser1
;
}
}
}
}
dev-train/src/main/java/com/tykj/dev/device/train/entity/TrainTheme.java
浏览文件 @
3ec17b41
...
@@ -176,6 +176,8 @@ public class TrainTheme {
...
@@ -176,6 +176,8 @@ public class TrainTheme {
@ApiModelProperty
(
value
=
"培训试卷名称"
,
name
=
"trainPapersName"
)
@ApiModelProperty
(
value
=
"培训试卷名称"
,
name
=
"trainPapersName"
)
private
String
trainPapersName
;
private
String
trainPapersName
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
public
ByTrainingPeople
toByTrainingPeople
()
{
public
ByTrainingPeople
toByTrainingPeople
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/TrainUser.java
浏览文件 @
3ec17b41
...
@@ -128,6 +128,9 @@ public class TrainUser {
...
@@ -128,6 +128,9 @@ public class TrainUser {
@ApiModelProperty
(
value
=
"是否必须报名 1.必须 2.不必须"
,
name
=
"certificate"
)
@ApiModelProperty
(
value
=
"是否必须报名 1.必须 2.不必须"
,
name
=
"certificate"
)
private
Integer
isNotJoinUserId
;
private
Integer
isNotJoinUserId
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
@Transient
@Transient
private
Mgrcert
mgrcert
;
private
Mgrcert
mgrcert
;
...
...
dev-train/src/main/java/com/tykj/dev/device/train/entity/WorkHandover.java
浏览文件 @
3ec17b41
...
@@ -81,6 +81,9 @@ public class WorkHandover {
...
@@ -81,6 +81,9 @@ public class WorkHandover {
@LastModifiedDate
@LastModifiedDate
private
Integer
updateTime
;
private
Integer
updateTime
;
@ApiModelProperty
(
value
=
"区块链RID"
,
name
=
"recordId"
)
private
String
recordId
;
public
WorkHandoverVo
toWorkHandover
()
{
public
WorkHandoverVo
toWorkHandover
()
{
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
ModelMapper
mapper
=
BeanHelper
.
getUserMapper
();
WorkHandoverVo
workHandoverVo
=
mapper
.
map
(
this
,
WorkHandoverVo
.
class
);
WorkHandoverVo
workHandoverVo
=
mapper
.
map
(
this
,
WorkHandoverVo
.
class
);
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/TrainThemeServiceImpl.java
浏览文件 @
3ec17b41
...
@@ -3,6 +3,8 @@ package com.tykj.dev.device.train.service.impl;
...
@@ -3,6 +3,8 @@ package com.tykj.dev.device.train.service.impl;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.github.wenhao.jpa.Specifications
;
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.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.train.dao.TrainThemeDao
;
import
com.tykj.dev.device.train.dao.TrainThemeDao
;
import
com.tykj.dev.device.train.dao.TrainUserDao
;
import
com.tykj.dev.device.train.dao.TrainUserDao
;
...
@@ -57,10 +59,20 @@ public class TrainThemeServiceImpl implements TrainThemeService {
...
@@ -57,10 +59,20 @@ public class TrainThemeServiceImpl implements TrainThemeService {
@Autowired
@Autowired
TrainUserDao
trainUserDao
;
TrainUserDao
trainUserDao
;
@Autowired
BlockChainUtil
blockChainUtil
;
@Override
@Override
public
TrainTheme
save
(
TrainTheme
trainTheme
)
{
public
TrainTheme
save
(
TrainTheme
trainTheme
)
{
return
trainThemeDao
.
save
(
trainTheme
);
TrainTheme
trainTheme1
=
trainThemeDao
.
save
(
trainTheme
);
if
(
trainTheme1
.
getRecordId
()==
null
||
trainTheme1
.
getRecordId
().
equals
(
""
)){
BcText
bcText
=
blockChainUtil
.
sendText
(
1000
,
JacksonUtil
.
toJSon
(
trainTheme1
));
trainTheme1
.
setRecordId
(
bcText
.
getData
().
getRecordID
());
return
trainThemeDao
.
save
(
trainTheme1
);
}
else
{
blockChainUtil
.
appendText
(
JacksonUtil
.
toJSon
(
trainTheme1
),
trainTheme1
.
getRecordId
());
return
trainTheme1
;
}
}
}
@Override
@Override
...
...
dev-user/src/main/java/com/tykj/dev/device/user/config/SecurityConfig.java
浏览文件 @
3ec17b41
...
@@ -108,7 +108,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -108,7 +108,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
cors
()
.
cors
()
.
and
()
.
and
()
.
authorizeRequests
()
.
authorizeRequests
()
.
antMatchers
(
"/** "
).
permitAll
()
.
antMatchers
(
HttpMethod
.
OPTIONS
,
"/** "
).
permitAll
()
.
antMatchers
(
HttpMethod
.
OPTIONS
,
"/** "
).
permitAll
()
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// .withObjectPostProcessor(new ObjectPostProcessor<FilterSecurityInterceptor>() {
// @Override
// @Override
...
@@ -118,7 +118,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -118,7 +118,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// return o;
// return o;
// }
// }
// })
// })
.
anyRequest
().
authenticated
()
//
.anyRequest().authenticated()
.
and
()
.
and
()
.
formLogin
()
.
formLogin
()
.
loginProcessingUrl
(
"/userLogin"
)
.
loginProcessingUrl
(
"/userLogin"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论