Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
004e7331
提交
004e7331
authored
4月 25, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[用户 丢失] 添加阅知
上级
1acf5f4f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
35 行删除
+65
-35
LossBillServiceImpl.java
...ykj/dev/device/loss/service/impl/LossBillServiceImpl.java
+61
-21
matchingApp.java
...c/main/java/com/tykj/dev/device/matching/matchingApp.java
+1
-0
UserService.java
...com/tykj/dev/device/user/subject/service/UserService.java
+3
-14
没有找到文件。
dev-loss/src/main/java/com/tykj/dev/device/loss/service/impl/LossBillServiceImpl.java
浏览文件 @
004e7331
...
...
@@ -15,11 +15,14 @@ import com.tykj.dev.device.loss.util.StringUtils;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.entity.Area
;
import
com.tykj.dev.device.user.subject.entity.SecurityUser
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.subject.service.AreaService
;
import
com.tykj.dev.device.user.subject.service.UnitsService
;
import
com.tykj.dev.device.user.subject.service.UserService
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.DeviceLifeStatus
;
import
com.tykj.dev.misc.base.StatusEnum
;
...
...
@@ -31,6 +34,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.stream.Collectors
;
/**
* @author zjm
...
...
@@ -69,6 +73,9 @@ public class LossBillServiceImpl implements LossBillService {
@Autowired
MessageService
messageService
;
@Autowired
UserService
userService
;
@Override
public
void
initiateLoss
(
DeviceLoss
deviceLoss
,
SecurityUser
securityUser
)
{
deviceLibraryService
.
isInStockOrWaitRetired
(
deviceLoss
.
getDevIdsList
());
...
...
@@ -77,15 +84,18 @@ public class LossBillServiceImpl implements LossBillService {
DeviceLoss
deviceLossThis
=
deviceLossService
.
save
(
deviceLoss
);
Units
units
=
unitsService
.
findById
(
deviceLoss
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
TaskBto
taskBto
;
if
(
units
.
getLevel
()
==
1
)
{
end
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
units
.
getUnitId
());
taskBto
=
end
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
units
.
getUnitId
());
}
else
if
(
units
.
getLevel
()==
2
){
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
newLossCityTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskBto
=
newLossCityTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
else
{
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
newLossCountyTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskBto
=
newLossCountyTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"丢失装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起了装备丢失"
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
LOSS
.
id
,
deviceLoss
.
getDevIdsList
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备报备丢失"
,
deviceLoss
.
getCreateUserId
());
}
...
...
@@ -94,6 +104,7 @@ public class LossBillServiceImpl implements LossBillService {
@Override
public
void
superiorAuditLoss
(
LossAuditvo
lossAuditvo
)
{
User
user
=
userService
.
findByUser
(
lossAuditvo
.
getUserId
());
Units
units
=
unitsService
.
findById
(
lossAuditvo
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
TaskBto
taskBto
=
taskService
.
get
(
lossAuditvo
.
getTaskId
());
...
...
@@ -105,9 +116,7 @@ public class LossBillServiceImpl implements LossBillService {
deviceLoss
.
setProvinceUnitName
(
units
.
getName
());
deviceLoss
.
setProvinceDes
(
lossAuditvo
.
getDes
());
taskService
.
moveToEnd
(
taskBto
);
}
else
{
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
LOSS1300
);
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
deviceLoss
.
setCityUnitName
(
units
.
getName
());
...
...
@@ -115,6 +124,7 @@ public class LossBillServiceImpl implements LossBillService {
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
LOSS1301
,
0
);
}
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"审核了装备丢失业务"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
deviceLossService
.
save
(
deviceLoss
);
}
...
...
@@ -127,22 +137,24 @@ public class LossBillServiceImpl implements LossBillService {
DeviceLoss
deviceLossThis
=
deviceLossService
.
save
(
deviceLoss
);
Units
units
=
unitsService
.
findById
(
deviceLoss
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
TaskBto
taskBto
;
if
(
units
.
getLevel
()
==
1
)
{
endRetrieve
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
units
.
getUnitId
());
taskBto
=
endRetrieve
(
deviceLossThis
.
getCreateUserId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
units
.
getUnitId
());
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceLoss
.
getDevIdsList
());
}
else
if
(
units
.
getLevel
()==
2
){
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
newRetrieveCityTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskBto
=
newRetrieveCityTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
else
{
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
newRetrieveCountyTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
taskBto
=
newRetrieveCountyTask
(
parentUnits
.
getUnitId
(),
deviceLossThis
.
getId
(),
units
.
getName
()
+
"找回装备任务"
,
securityUser
.
getCurrentUserInfo
().
getUserId
());
}
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起装备找回业务"
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备找回上报"
,
deviceLoss
.
getCreateUserId
());
}
@Override
public
void
superiorAuditRetrieve
(
RetrieveAuditvo
retrieveAuditvo
)
{
User
user
=
userService
.
findByUser
(
retrieveAuditvo
.
getUserId
());
Units
units
=
unitsService
.
findById
(
retrieveAuditvo
.
getUnitId
());
Area
area
=
areaService
.
findByid
(
units
.
getAreaId
());
TaskBto
taskBto
=
taskService
.
get
(
retrieveAuditvo
.
getTaskId
());
...
...
@@ -155,7 +167,9 @@ public class LossBillServiceImpl implements LossBillService {
if
(
retrieveAuditvo
.
getType
()==
1
){
deviceLoss
.
setBackStatus
(
2
);
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
StringUtils
.
stringToList
(
deviceLoss
.
getDevIds
()));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备找回业务审核成功"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
else
{
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备找回业务审核不通过"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
deviceLoss
.
setBackStatus
(
3
);
}
}
else
{
...
...
@@ -167,9 +181,12 @@ public class LossBillServiceImpl implements LossBillService {
if
(
retrieveAuditvo
.
getType
()==
1
){
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1401
,
0
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备找回业务审核成功"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
else
{
taskService
.
moveToEnd
(
taskBto
);
deviceLoss
.
setBackStatus
(
3
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备找回业务审核不通过"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
}
...
...
@@ -177,45 +194,45 @@ public class LossBillServiceImpl implements LossBillService {
}
private
void
newRetrieveCountyTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
private
TaskBto
newRetrieveCountyTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userID
);
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE1400
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
1
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE1400
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
1
,
""
,
list
));
}
private
void
newRetrieveCityTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
private
TaskBto
newRetrieveCityTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userID
);
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE1401
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
1
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
RETRIEVE1401
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
1
,
""
,
list
));
}
private
void
endRetrieve
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
private
TaskBto
endRetrieve
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
0
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
RETRIEVE
.
id
,
unitId
,
0
,
""
,
list
));
}
private
void
newLossCountyTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
private
TaskBto
newLossCountyTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userID
);
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1300
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
1
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1300
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
1
,
""
,
list
));
}
private
void
newLossCityTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
private
TaskBto
newLossCityTask
(
Integer
unitId
,
Integer
lossId
,
String
title
,
Integer
userID
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userID
);
list
.
add
(
0
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1301
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
1
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
LOSS1301
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
1
,
""
,
list
));
}
private
void
end
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
private
TaskBto
end
(
Integer
userId
,
Integer
lossId
,
String
title
,
Integer
unitId
){
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
END
.
id
,
title
,
0
,
"."
,
lossId
,
BusinessEnum
.
LOSS
.
id
,
unitId
,
0
,
""
,
list
));
}
...
...
@@ -228,6 +245,29 @@ public class LossBillServiceImpl implements LossBillService {
CompletableFuture
.
runAsync
(()
->
deviceLogService
.
saveAllLog
(
logDtos
));
}
private
void
addMessage
(
MessageBto
messageBto
){
messageService
.
add
(
messageBto
);
}
/**
* 根据单位id查询用户 去除用户id
* @param userId
* @param unitId
* @return
*/
private
List
<
Integer
>
gainThisUser
(
Integer
userId
,
Integer
unitId
){
return
userService
.
findAllByUnite
(
unitId
).
stream
().
filter
(
user
->
user
.
getUnitsId
()!=
userId
).
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
/**
* 根据单位id查询用户id集合
* @param unitId
* @return
*/
private
List
<
Integer
>
findUnitId
(
Integer
unitId
){
return
userService
.
findAllByUnite
(
unitId
).
stream
().
map
(
User:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
}
dev-matching/src/main/java/com/tykj/dev/device/matching/matchingApp.java
浏览文件 @
004e7331
...
...
@@ -12,6 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*/
@SpringBootApplication
(
scanBasePackages
=
{
"com.tykj.dev.device.matching*"
,
"com.tykj.dev.device.*"
}
)
public
class
matchingApp
{
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/UserService.java
浏览文件 @
004e7331
...
...
@@ -22,8 +22,8 @@ public interface UserService extends PublicService<User> {
/**
* 根据用户名查询用户对象
*
* @param userName
* @return
* @param userName
用户名称
* @return
用户对象
*/
User
findByUserName
(
String
userName
);
...
...
@@ -31,9 +31,7 @@ public interface UserService extends PublicService<User> {
/**
* 查询同级人员
*
* @param userId
* @return
* @param userId 用户Id
*/
List
<
UserShenRe
>
findByUserId
(
Integer
userId
);
...
...
@@ -90,15 +88,6 @@ public interface UserService extends PublicService<User> {
*/
List
<
User
>
findSubordinate
(
Integer
userId
);
/**
* 根据用户ID查询下级所有用户 UserTrainVo
*
* @param userId 用户ID
* @return 用户集合
*/
// List<UserTrainVo> findByIdUserTarinVo(Integer userId);
/**
* 根据用户ID查询下级单位集合 UnitsTrainVo
*
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论