Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
64df6d4f
提交
64df6d4f
authored
7月 01, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[清退] 添加阅知信息 以及修改标题
上级
3ae93133
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
151 行增加
和
86 行删除
+151
-86
DeviceRepel.java
...m/tykj/dev/device/sendback/entity/domain/DeviceRepel.java
+5
-2
DeviceRepelDetail.java
.../dev/device/sendback/entity/domain/DeviceRepelDetail.java
+5
-2
RepelBusinessService.java
...ykj/dev/device/sendback/service/RepelBusinessService.java
+6
-1
RepelBusinessServiceImpl.java
...evice/sendback/service/impl/RepelBusinessServiceImpl.java
+131
-81
HandoverController.java
.../tykj/dev/device/train/controller/HandoverController.java
+1
-0
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+3
-0
没有找到文件。
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/DeviceRepel.java
浏览文件 @
64df6d4f
...
...
@@ -5,7 +5,9 @@ import com.tykj.dev.device.file.entity.FileRet;
import
com.tykj.dev.misc.base.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.annotations.SQLDelete
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
...
...
@@ -24,13 +26,14 @@ import java.util.List;
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@ApiModel
(
"清退账单"
)
@NoArgsConstructor
@AllArgsConstructor
public
class
DeviceRepel
extends
BaseEntity
{
/**
* 数据id
*/
@Id
@GeneratedValue
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
/**
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/entity/domain/DeviceRepelDetail.java
浏览文件 @
64df6d4f
...
...
@@ -8,7 +8,9 @@ import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
import
com.tykj.dev.misc.base.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
import
javax.persistence.*
;
...
...
@@ -27,14 +29,15 @@ import java.util.List;
@Entity
@EntityListeners
(
AuditingEntityListener
.
class
)
@ApiModel
(
"清退详情"
)
@NoArgsConstructor
@AllArgsConstructor
public
class
DeviceRepelDetail
extends
BaseEntity
{
/**
* 主键id
*/
@Id
@GeneratedValue
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@ApiModelProperty
(
name
=
"主键id"
)
@Column
(
columnDefinition
=
"integer NOT NULL AUTO_INCREMENT"
)
private
Integer
id
;
/**
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/RepelBusinessService.java
浏览文件 @
64df6d4f
...
...
@@ -137,6 +137,11 @@ public interface RepelBusinessService {
*/
void
AllRepelNotDeviceSubmit
(
SecurityUser
securityUser
,
Integer
taskId
);
/**
* 撤回任务
* 根据任务id找到对应的任务 因为只有回执单时才有 回执单任务为只任务,主要配发任务为当前任务的主任务
* 子任务 封存 主任务根据单位进行回退到不同的状态 市 -1206 区 -1205 装备统一变程在库状态
*/
void
withdraw
(
Integer
taskId
);
}
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelBusinessServiceImpl.java
浏览文件 @
64df6d4f
...
...
@@ -23,6 +23,7 @@ import com.tykj.dev.device.sendback.entity.vo.*;
import
com.tykj.dev.device.sendback.service.*
;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.user.base.ret.MemberThat
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
...
...
@@ -37,14 +38,12 @@ import com.tykj.dev.device.user.subject.service.UserService;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.DeviceSeqUtil
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.StringUtils
;
import
com.tykj.dev.misc.utils.TaskDisposeUtil
;
import
com.tykj.dev.misc.utils.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.*
;
...
...
@@ -114,6 +113,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
* @param userId
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
initiateRepel
(
DeviceRepel
deviceRepel
,
Integer
userId
)
{
//生成一个清退任务 省清退任务 类型为 清退统计 17 16清退
//参照选择的范围给单位都发送 市清退任务待执行
...
...
@@ -188,10 +188,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepel
.
setEquipmentInvolvingUnit
(
JacksonUtil
.
toJSon
(
supervisorMap
));
}
DeviceRepel
deviceRepel1
=
deviceRepelService
.
saveDeviceRepel
(
deviceRepel
);
DeviceRepelDetail
deviceRepelDetail
=
new
DeviceRepelDetail
();
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
TaskBto
taskBto
=
statsXTask
(
units
.
getUnitId
(),
deviceRepel1
.
getId
(),
deviceRepel
.
getTitle
(),
userId
);
TaskBto
taskBto
=
statsXTask
(
units
.
getUnitId
(),
deviceRepel1
.
getId
(),
"清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备任务"
,
userId
);
//给本单位其他专管员阅知
// addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
List
<
RepelTaskStatistical
>
list
=
new
ArrayList
<>();
...
...
@@ -205,13 +204,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
// directlUnderUnitDeviceIds.addAll(unitNameMap.get(units1.getName()));
}
else
if
(
units1
.
getType
()
==
1
)
{
Area
area1
=
areaService
.
findByid
(
units1
.
getAreaId
());
DeviceRepelDetail
deviceRepelDetail
=
new
DeviceRepelDetail
();
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
deviceRepelDetail
.
setSendUnit
(
units1
.
getName
());
deviceRepelDetail
.
setSendUnitId
(
units1
.
getUnitId
());
deviceRepelDetail
.
setId
(
null
);
long
time
=
System
.
currentTimeMillis
();
Integer
count
=
deviceLibraryService
.
countAllRepel
(
deviceRepel
.
getFieldingIds
(),
unitsService
.
findBySubordinateUnitName
(
units1
.
getUnitId
()),
seqNumbers
,
lifeStatus
);
if
(
count
!=
0
)
{
TaskBto
taskBto1
=
cityRepelTask
(
unisId
,
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
"["
+
units1
.
getName
()+
"]"
+
deviceRepel
.
getTitle
(),
taskBto
.
getId
(),
userId
);
TaskBto
taskBto1
=
cityRepelTask
(
unisId
,
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
units1
.
getName
()+
"清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备"
,
taskBto
.
getId
(),
userId
);
list
.
add
(
new
RepelTaskStatistical
(
deviceRepel1
.
getId
(),
taskBto
.
getId
(),
taskBto1
.
getId
(),
0
,
area1
.
getName
(),
repelStatusJudgeCount
(
deviceRepel
.
getRepelStatus
(),
count
),
""
));
}
}
...
...
@@ -220,13 +223,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
}
);
DeviceRepelDetail
deviceRepelDetail
=
new
DeviceRepelDetail
();
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
deviceRepelDetail
.
setSendUnitId
(
units
.
getUnitId
());
deviceRepelDetail
.
setSendUnit
(
units
.
getName
());
deviceRepelDetail
.
setId
(
null
);
deviceRepelDetail
.
setRepelType
(
2
);
Integer
count
=
deviceLibraryService
.
countAllRepel
(
deviceRepel
.
getFieldingIds
(),
directlUnderUnitNames
,
seqNumbers
,
lifeStatus
);
if
(
directlUnderUnit
.
get
()&&
count
!=
0
){
TaskBto
taskBto2
=
directlyUnderTask
(
units
.
getUnitId
(),
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
taskBto
.
getId
(),
deviceRepel
.
getTitle
(),
userId
);
TaskBto
taskBto2
=
directlyUnderTask
(
units
.
getUnitId
(),
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
taskBto
.
getId
(),
"省直属单位清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备"
,
userId
);
list
.
add
(
new
RepelTaskStatistical
(
deviceRepel1
.
getId
(),
taskBto
.
getId
(),
taskBto2
.
getId
(),
0
,
"省直属"
,
repelStatusJudgeCount
(
deviceRepel
.
getRepelStatus
(),
count
),
""
));
}
deviceRepelDetail
.
setId
(
null
);
...
...
@@ -236,7 +243,9 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
count
=
deviceLibraryService
.
countAllRepel
(
deviceRepel
.
getFieldingIds
(),
strings
,
seqNumbers
,
lifeStatus
);
log
.
info
(
"[清退] 本级装备件数{}"
,
count
);
if
(
correspondingLevel
.
get
()&&
count
!=
0
){
TaskBto
taskBto1
=
oneselfTask
(
units
.
getUnitId
(),
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
taskBto
.
getId
(),
deviceRepel
.
getTitle
(),
userId
);
TaskBto
taskBto1
=
oneselfTask
(
units
.
getUnitId
(),
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
taskBto
.
getId
(),
"省本级清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备"
,
userId
);
list
.
add
(
new
RepelTaskStatistical
(
deviceRepel1
.
getId
(),
taskBto
.
getId
(),
taskBto1
.
getId
(),
0
,
"省本级"
,
repelStatusJudgeCount
(
deviceRepel
.
getRepelStatus
(),
count
),
""
));
}
if
(
list
==
null
||
list
.
size
()==
0
){
...
...
@@ -254,6 +263,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
resolveRepel
(
DeviceRepel
deviceRepel
,
Integer
taskId
,
Integer
userId
)
{
// 按照装备给下面区县发起 区清退任务待执行
...
...
@@ -291,10 +301,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
}
DeviceRepel
deviceRepel1
=
deviceRepelService
.
saveDeviceRepel
(
deviceRepel
);
DeviceRepelDetail
deviceRepelDetail
=
new
DeviceRepelDetail
();
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
TaskBto
taskBto
=
cityTotalTask
(
units
.
getUnitId
(),
deviceRepel1
.
getId
(),
deviceRepel
.
getTitle
()
,
taskId
,
userId
);
TaskBto
taskBto
=
cityTotalTask
(
units
.
getUnitId
(),
deviceRepel1
.
getId
(),
units
.
getName
()+
"清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备统计任务"
,
taskId
,
userId
);
// addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"转发清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
List
<
RepelTaskStatistical
>
list
=
new
ArrayList
<>();
...
...
@@ -303,12 +313,16 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if
(
unisId
!=
units
.
getUnitId
())
{
Units
units1
=
unitsService
.
findById
(
unisId
);
Area
area1
=
areaService
.
findByid
(
units1
.
getAreaId
());
deviceRepelDetail
.
setId
(
null
);
DeviceRepelDetail
deviceRepelDetail
=
new
DeviceRepelDetail
();
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
deviceRepelDetail
.
setSendUnit
(
units1
.
getName
());
deviceRepelDetail
.
setSendUnitId
(
units1
.
getUnitId
());
Integer
count
=
deviceLibraryService
.
countAllRepel
(
deviceRepel
.
getFieldingIds
(),
unitsService
.
findBySubordinateUnitName
(
units1
.
getUnitId
()),
DeviceSeqUtil
.
selectDeviceSeqs
(
deviceRepel
.
getSeqNumbers
()),
lifeStatus
);
if
(
count
!=
0
)
{
TaskBto
taskBto1
=
countyRepelTask
(
unisId
,
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
"["
+
units1
.
getName
()+
"]"
+
deviceRepel
.
getTitle
(),
taskBto
.
getId
(),
userId
);
TaskBto
taskBto1
=
countyRepelTask
(
unisId
,
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
units1
.
getName
()+
"清退型号为"
+
StringSplitUtil
.
stringListToString
(
deviceRepel
.
getModels
().
stream
()
.
distinct
()
.
collect
(
Collectors
.
toList
()))+
"设备"
,
taskBto
.
getId
(),
userId
);
list
.
add
(
new
RepelTaskStatistical
(
deviceRepel1
.
getId
(),
taskBto
.
getId
(),
taskBto1
.
getId
(),
0
,
area1
.
getName
(),
repelStatusJudgeCount
(
deviceRepel
.
getRepelStatus
(),
count
),
""
));
}
}
...
...
@@ -323,6 +337,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
cityInitiateRepel
(
DeviceRepel
deviceRepel
,
Integer
userId
)
{
User
user
=
userService
.
findByUser
(
userId
);
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
...
...
@@ -341,58 +356,60 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
provinceAuditCity
(
Integer
taskId
,
Integer
userId
,
RepelAuditResult
repelAuditResult
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
SEND_BACK_1211
);
List
<
Integer
>
lifeStatus
=
new
ArrayList
<>();
lifeStatus
.
add
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
);
lifeStatus
.
add
(
DeviceLifeStatus
.
REPEL
.
id
);
lifeStatus
.
add
(
DeviceLifeStatus
.
REPAIRING
.
id
);
lifeStatus
.
add
(
DeviceLifeStatus
.
IN_TRANSIT
.
id
);
lifeStatus
.
add
(
DeviceLifeStatus
.
USE
.
id
);
lifeStatus
.
add
(
DeviceLifeStatus
.
SEND_BACK
.
id
);
if
(
repelAuditResult
.
getType
()==
1
)
{
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetailNoDev
(
taskBto
.
getBillId
());
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
());
Set
<
ModelCount
>
modelCounts
=
new
HashSet
<>();
packingLibraryDao
.
findAllByIdIn
(
StringUtils
.
stringToList
(
deviceRepel
.
getFielding
())).
forEach
(
i
->
{
modelCounts
.
add
(
new
ModelCount
(
i
.
getModel
(),
0
));
});
String
model
=
JacksonUtil
.
toJSon
(
modelCounts
);
List
<
RepelTaskStatistical
>
list
=
new
ArrayList
<>();
StringUtils
.
stringToList
(
deviceRepel
.
getTaskScope
()).
forEach
(
unisId
->
{
if
(
unisId
!=
deviceRepel
.
getUnitId
())
{
Units
units1
=
unitsService
.
findById
(
unisId
);
Area
area1
=
areaService
.
findByid
(
units1
.
getAreaId
());
deviceRepelDetail
.
setId
(
null
);
deviceRepelDetail
.
setSendUnit
(
units1
.
getName
());
deviceRepelDetail
.
setSendUnitId
(
units1
.
getUnitId
());
Integer
count
=
deviceLibraryService
.
countAllRepel
(
deviceRepel
.
getFieldingIds
(),
unitsService
.
findBySubordinateUnitName
(
units1
.
getUnitId
()),
DeviceSeqUtil
.
selectDeviceSeqs
(
deviceRepel
.
getSeqNumbers
()),
lifeStatus
);
if
(
count
!=
0
)
{
TaskBto
taskBto1
=
countyRepelTask
(
unisId
,
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
).
getId
(),
deviceRepel
.
getTitle
(),
taskBto
.
getId
(),
userId
);
list
.
add
(
new
RepelTaskStatistical
(
deviceRepel
.
getId
(),
taskBto
.
getId
(),
taskBto1
.
getId
(),
0
,
area1
.
getName
(),
repelStatusJudgeCount
(
deviceRepel
.
getRepelStatus
(),
count
),
""
));
}
}
else
{
//同上 缺失
}
}
);
if
(
list
==
null
||
list
.
size
()==
0
){
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1212
,
userId
);
}
else
{
repelTaskStatisticalService
.
saveAllRepelTaskStatistical
(
list
);
taskBto
.
setOwnUnit
(
deviceRepel
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1204
,
-
1
);
}
}
else
{
taskService
.
moveToEnd
(
taskBto
);
}
//
TaskBto taskBto=taskService.get(taskId);
//
TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.SEND_BACK_1211);
//
List<Integer> lifeStatus=new ArrayList<>();
//
lifeStatus.add(DeviceLifeStatus.IN_LIBRARY.id);
//
lifeStatus.add(DeviceLifeStatus.REPEL.id);
//
lifeStatus.add(DeviceLifeStatus.REPAIRING.id);
//
lifeStatus.add(DeviceLifeStatus.IN_TRANSIT.id);
//
lifeStatus.add(DeviceLifeStatus.USE.id);
//
lifeStatus.add(DeviceLifeStatus.SEND_BACK.id);
//
if (repelAuditResult.getType()==1) {
//
DeviceRepelDetail deviceRepelDetail = deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
//
DeviceRepel deviceRepel = deviceRepelService.findDeviceRepel(deviceRepelDetail.getRepelId());
//
Set<ModelCount> modelCounts = new HashSet<>();
//
packingLibraryDao.findAllByIdIn(StringUtils.stringToList(deviceRepel.getFielding())).forEach(i -> {
//
modelCounts.add(new ModelCount(i.getModel(), 0));
//
});
//
String model = JacksonUtil.toJSon(modelCounts);
//
List<RepelTaskStatistical> list = new ArrayList<>();
//
StringUtils.stringToList(deviceRepel.getTaskScope()).forEach(
//
unisId -> {
//
if (unisId != deviceRepel.getUnitId()) {
//
Units units1 = unitsService.findById(unisId);
//
Area area1 = areaService.findByid(units1.getAreaId());
//
deviceRepelDetail.setId(null);
//
deviceRepelDetail.setSendUnit(units1.getName());
//
deviceRepelDetail.setSendUnitId(units1.getUnitId());
//
Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()), DeviceSeqUtil.selectDeviceSeqs(deviceRepel.getSeqNumbers()),lifeStatus);
//
if (count!=0) {
//
TaskBto taskBto1 = countyRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId(),userId);
//
list.add(new RepelTaskStatistical(deviceRepel.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), ""));
//
}
//
}else {
//
//同上 缺失
//
}
//
}
//
);
//
if (list==null||list.size()==0){
//
taskService.moveToSpecial(taskBto, StatusEnum.SEND_BACK_1212,userId);
//
}else {
//
repelTaskStatisticalService.saveAllRepelTaskStatistical(list);
//
taskBto.setOwnUnit(deviceRepel.getUnitId());
//
taskService.moveToSpecial(taskBto, StatusEnum.SEND_BACK_1204, -1);
//
}
//
}else {
//
taskService.moveToEnd(taskBto);
//
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
resolveConfirm
(
Integer
taskId
,
Integer
userId
)
{
// 修改当前任务的状态 清退待提交装备审核
...
...
@@ -420,9 +437,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatisticalService
.
saveRepelTaskStatistical
(
repelTaskStatistical
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
user
.
getName
()+
"操作了["
+
deviceRepel
.
getTitle
()+
"]任务,选择了退回装备"
,
gainThisUser
(
userId
,
user
.
getUnitsId
())));
// addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"操作了["+deviceRepel.getTitle()+"]任务,选择了退回装备",gainThisUser(userId,user.getUnitsId())));
}
public
static
void
main
(
String
[]
args
)
{
...
...
@@ -433,6 +448,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
submitChooseDevice
(
Integer
taskId
,
ResolveConfirm
resolveConfirm
)
{
long
stime
=
System
.
currentTimeMillis
();
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
...
...
@@ -466,6 +482,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
resolveAudit
(
Integer
taskId
,
RepelAuditResult
repelAuditResult
)
{
// 检查上级任务是完成
...
...
@@ -489,7 +506,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskBto
=
taskService
.
moveToEnd
(
taskBto
);
deviceRepelDetail
.
setRepelStatus
(
3
);
repelTaskStatistical
.
setTaskStatus
(
1
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"清退任务审核通过,无提交装备任务结束"
,
findUnitId
(
taskBto
.
getOwnUnit
())));
//
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"清退任务审核通过,无提交装备任务结束",findUnitId(taskBto.getOwnUnit())));
}
}
else
{
//审核失败
...
...
@@ -510,8 +527,10 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
DeviceRepelDetail
sendBackOutCheck
(
Integer
taskId
,
Integer
userId
,
OrderOutData
orderOutData
)
{
User
user
=
userService
.
findByUser
(
userId
);
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
List
<
StatusEnum
>
statusEnums
=
new
ArrayList
<>();
statusEnums
.
add
(
StatusEnum
.
SEND_BACK_1205
);
...
...
@@ -540,8 +559,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskBto
.
setOwnUnit
(
orderOutData
.
getReceiveUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1209
,
0
);
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
());
waitingReceiptsTask
(
orderOutData
.
getSendUnitId
(),
deviceRepelDetail
.
getId
(),
taskBto
.
getId
(),
"清退装备出库等待上传回执单"
,
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
根据["
+
deviceRepel
.
getTitle
()+
"]任务,已完成退回出库
"
,
gainThisUser
(
userId
,
user
.
getUnitsId
())));
waitingReceiptsTask
(
orderOutData
.
getSendUnitId
(),
deviceRepelDetail
.
getId
(),
taskBto
.
getId
(),
taskBto
.
getTitle
()
,
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
清退设备出库完成
"
,
gainThisUser
(
userId
,
user
.
getUnitsId
())));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
deviceRepelDetail
.
getSendUnit
()+
"装备清退出库"
+
",等待接收"
,
userId
,
taskBto
.
getId
());
orderOutDataRepelDetail
.
setDeviceLibraryEntities
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()));
//把一些字段填写到对象中,保存入库
...
...
@@ -550,6 +569,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
sealOfAudit
(
Integer
taskId
,
Integer
userId
,
OrderOutData
orderOutData
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
MemberThat
memberThat
=
userService
.
findById
(
orderOutData
.
getSendUserbId
());
...
...
@@ -578,6 +598,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
sendSealOfAudit
(
Integer
taskId
,
Integer
userId
,
StorageDeviceRepel
storageDeviceRepel
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
...
...
@@ -603,6 +624,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
outSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
if
(
reviewTheResults
==
0
){
...
...
@@ -617,6 +639,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
sendSealOfAuditEnd
(
Integer
taskId
,
Integer
reviewTheResults
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
if
(
reviewTheResults
==
0
){
...
...
@@ -631,6 +654,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
storageDeviceRepel
(
Integer
taskId
,
StorageDeviceRepel
storageDeviceRepel
)
{
//判断是否上传单据
//是 直接入库 任务完结
...
...
@@ -681,7 +705,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if
(
units
.
getLevel
()==
1
){
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
filterTypeReturnLeftStatus
(
deviceRepel
.
getType
()),
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
}
else
{
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
SEND_BACK
.
id
,
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
}
List
<
DeviceLibrary
>
libraries
=
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
());
libraries
.
forEach
(
...
...
@@ -693,8 +717,8 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveToEnd
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
taskService
.
moveToArchive
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"
上传清退装备签收单,任务完成
"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
上传签收单,任务完成
"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()+
"清退的设备
"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()+
"清退的设备
"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
}
else
{
if
(
storageDeviceRepel
.
getIsIgnore
()==
null
)
{
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
...
...
@@ -715,7 +739,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveToEnd
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
taskService
.
moveToArchive
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"
上传清退装备签收单,任务完成
"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()+
"清退的设备
"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
Documents
documents
=
deviceRepelDetail
.
toDoc
();
documents
.
setSrcA
(
storageDeviceRepel
.
getSrcA
());
documents
.
setSrcB
(
storageDeviceRepel
.
getSrcB
());
...
...
@@ -732,7 +756,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
FileRet
fileRet
=
pdfService
.
billPdf
(
documents
);
deviceRepelDetail
.
setOutboundFile
(
JacksonUtil
.
toJSon
(
fileRet
));
deviceRepelDetail
.
setSendFiles
(
JacksonUtil
.
toJSon
(
fileRet
));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
上传签收单,任务完成
"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()+
"清退的设备
"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
}
}
deviceRepelDetail
.
setReceiveTime
(
new
Date
());
...
...
@@ -743,6 +767,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
oneselfRepel
(
Integer
taskId
,
StorageDeviceRepel
storageDeviceRepel
,
Integer
userId
)
{
//完结当前任务
...
...
@@ -787,10 +812,11 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatisticalService
.
saveRepelTaskStatistical
(
repelTaskStatistical
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
isEnd
(
taskBto
,
deviceRepelDetail
.
getRepelId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"完成["
+
deviceRepel
.
getTitle
()+
"]本级清退任务"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
//
addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"完成["+deviceRepel.getTitle()+"]本级清退任务",gainThisUser(user.getUserId(),user.getUnitsId())));
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
provinceDirectlyUnder
(
Integer
taskId
,
SecurityUser
securityUser
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
SEND_BACK_1202
);
...
...
@@ -822,11 +848,13 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
provinceRepel
(
Integer
taskId
)
{
taskService
.
moveToEnd
(
taskService
.
get
(
taskId
));
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
cityRepelEnd
(
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
...
...
@@ -841,6 +869,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
receipts
(
StorageDeviceRepel
storageDeviceRepel
)
{
User
user
=
userService
.
findByUser
(
storageDeviceRepel
.
getUserId
());
Units
units
=
unitsService
.
findById
(
user
.
getUnitsId
());
...
...
@@ -872,7 +901,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail
.
setReceiveUserA
(
storageDeviceRepel
.
getUserAName
());
}
if
(
units
.
getLevel
()==
3
)
{
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
SEND_BACK
.
id
,
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
}
else
{
deviceLibraryDao
.
upDateLeftStatusAndUnitNameAndLockStatus
(
filterTypeReturnLeftStatus
(
deviceRepel
.
getType
()),
deviceRepelDetail
.
getReceiveUnit
(),
0
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
}
...
...
@@ -894,6 +923,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
addSendBUser
(
StorageDeviceRepel
storageDeviceRepel
)
{
TaskBto
taskBto
=
taskService
.
get
(
storageDeviceRepel
.
getTaskId
());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
SEND_BACK_1214
);
...
...
@@ -916,6 +946,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
AllRepelNotDeviceSubmit
(
SecurityUser
securityUser
,
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
...
...
@@ -934,10 +965,29 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatisticalService
.
saveRepelTaskStatistical
(
repelTaskStatistical
);
deviceRepelDetailService
.
saveDeviceRepelDetail
(
deviceRepelDetail
);
isEnd
(
taskBto
,
deviceRepelDetail
.
getRepelId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"本单位无装备提交,完成了清退任务"
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
// addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"本单位无装备提交,完成了清退任务",gainThisUser(securityUser.getCurrentUserInfo().getUserId(),securityUser.getCurrentUserInfo().getUnitsId())));
}
@Override
public
void
withdraw
(
Integer
taskId
)
{
TaskBto
taskBto
=
taskService
.
get
(
taskId
);
Units
units
=
unitsService
.
findById
(
taskBto
.
getOwnUnit
());
TaskBto
fatherTaskBto
=
taskService
.
get
(
taskBto
.
getParentTaskId
());
Task
task
=
taskBto
.
toDo
();
task
.
setDeleteTag
(
1
);
taskService
.
deleteById
(
task
);
DeviceRepelDetail
deviceRepelDetail
=
deviceRepelDetailService
.
findDeviceRepelDetailNoDev
(
taskBto
.
getBillId
());
deviceLibraryDao
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
StringUtils
.
stringToList
(
deviceRepelDetail
.
getDeviceIds
()));
fatherTaskBto
.
setOwnUnit
(
units
.
getUnitId
());
if
(
units
.
getLevel
()==
3
){
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1205
,
0
);
}
else
{
taskService
.
moveToSpecial
(
fatherTaskBto
,
StatusEnum
.
SEND_BACK_1206
,
0
);
}
}
...
...
@@ -1065,7 +1115,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
list
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1202
.
id
,
title
+
"直属单位"
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
"DirectlyUnder"
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1202
.
id
,
title
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
"DirectlyUnder"
,
list
));
}
/**
...
...
@@ -1079,7 +1129,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List
<
Integer
>
list
=
new
ArrayList
<>();
list
.
add
(
userId
);
list
.
add
(
0
);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1203
.
id
,
title
+
"省本级"
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
""
,
list
));
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1203
.
id
,
title
,
parentTaskId
,
"."
,
repelDetailId
,
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
""
,
list
));
}
/**
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/HandoverController.java
浏览文件 @
64df6d4f
...
...
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
64df6d4f
...
...
@@ -35,6 +35,7 @@ import org.checkerframework.checker.units.qual.A;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.stream.Collector
;
...
...
@@ -75,6 +76,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
WorkHandoverDevDao
workHandoverDevDao
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
WorkHandover
createWorkHandover
(
WorkHandoverAddVo
workHandoverAddVo
,
SecurityUser
securityUser
)
{
log
.
info
(
"[workHandover] 新建工作交接"
);
// WorkHandover
...
...
@@ -105,6 +107,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
WorkHandover
endWorkHandover
(
WorkHandoverEndAddVo
workHandoverEndAddVo
)
{
//更新workHamdoverDb状态
WorkHandover
workHandover
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论