Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
9f72af85
提交
9f72af85
authored
11月 12, 2021
作者:
zjm
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'bug' 到 'master'
Bug 查看合并请求
!77
上级
81cd3a7e
5c2b2b7f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
155 行增加
和
87 行删除
+155
-87
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+60
-54
UploadApplyFile.java
...com/tykj/dev/device/apply/subject/vo/UploadApplyFile.java
+6
-0
LossBillServiceImpl.java
...ykj/dev/device/loss/service/impl/LossBillServiceImpl.java
+24
-11
MessageFormatUtil.java
.../main/java/com/tykj/dev/misc/utils/MessageFormatUtil.java
+9
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+31
-12
RepelBusinessServiceImpl.java
...evice/sendback/service/impl/RepelBusinessServiceImpl.java
+20
-5
UnitsServiceImpl.java
...ev/device/user/subject/service/impl/UnitsServiceImpl.java
+5
-5
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
9f72af85
...
@@ -237,61 +237,65 @@ public class DeviceApplyController {
...
@@ -237,61 +237,65 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
"ok"
);
return
ResponseEntity
.
ok
(
"ok"
);
}
}
@ApiOperation
(
value
=
"装备申请批复"
,
notes
=
"可以通过这个接口批复"
)
// @ApiOperation(value = "装备申请批复", notes = "可以通过这个接口批复")
@PostMapping
(
"/replay"
)
//不用了
// @PostMapping("/replay")//不用了
@Transactional
(
rollbackFor
=
Exception
.
class
)
// @Transactional(rollbackFor = Exception.class)
public
ResponseEntity
addDeviceApplyBillReplay
(
@RequestBody
@Validated
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
// public ResponseEntity addDeviceApplyBillReplay(@RequestBody @Validated DeviceApplyConfirmVo deviceApplyConfirmVo) {
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyConfirmVo
.
getTaskId
());
// TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
DEVICE_APPLY_CONFIRM
);
// TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.DEVICE_APPLY_CONFIRM);
Integer
userId
=
userUtils
.
getCurrentUserId
();
// Integer userId = userUtils.getCurrentUserId();
taskService
.
addInvolveUser
(
taskBto
,
userId
);
// taskService.addInvolveUser(taskBto, userId);
DeviceApplyBill
applyBillEntity
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
// DeviceApplyBill applyBillEntity = deviceApplyBillService.getOne(taskBto.getBillId());
applyBillEntity
.
setReplyUseraId
(
userId
);
// applyBillEntity.setReplyUseraId(userId);
//阅知用户Id
// //阅知用户Id
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
// List<Integer> ids = userPublicService.findOtherUser(userId);
// ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(applyBillEntity.getApplyUnit())).stream()
//// ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(applyBillEntity.getApplyUnit())).stream()
//// .map(User::getUserId)
//// .collect(Collectors.toList()));
// ids.addAll(userDao.findAllByUnitsId(applyBillEntity.getApplyUnitId()).stream()
// .map(User::getUserId)
// .map(User::getUserId)
// .collect(Collectors.toList()));
// .collect(Collectors.toList()));
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
applyBillEntity
.
getApplyUnitId
()).
stream
()
// //如果修改了批复文号
.
map
(
User:
:
getUserId
)
// if (deviceApplyConfirmVo.getReplyNumber() != null) {
.
collect
(
Collectors
.
toList
()));
// applyBillEntity.setReplayNumber(deviceApplyConfirmVo.getReplyNumber());
//如果修改了批复文号
// }
if
(
deviceApplyConfirmVo
.
getReplyNumber
()
!=
null
)
{
// //批复驳回
applyBillEntity
.
setReplayNumber
(
deviceApplyConfirmVo
.
getReplyNumber
());
// if (deviceApplyConfirmVo.getStatus() == 1) {
}
// applyBillEntity.setApplyStatus(1);
//批复驳回
// taskService.update(taskService.moveToArchive(taskBto));
if
(
deviceApplyConfirmVo
.
getStatus
()
==
1
)
{
// deviceApplyBillService.update(applyBillEntity);
applyBillEntity
.
setApplyStatus
(
1
);
// //发送阅知信息 装备申请被拒绝
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
deviceApplyBillService
.
update
(
applyBillEntity
);
//// "不同意 申请业务:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "->【中办机要局】",ids);
//发送阅知信息
//
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
"不同意 申请业务:【"
+
userPublicService
.
getAreaNameByUnitName
(
applyBillEntity
.
getApplyUnit
())
+
"->【中办机要局】"
,
ids
);
// "装备申请被拒绝:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) +
messageService
.
add
(
messageBto
);
// "->【中办机要局】申请"+MessageFormatUtil.spellModelAndCount(),ids);
log
.
info
(
"[申请模块]:装备申请驳回"
);
// messageService.add(messageBto);
myWebSocket
.
sendMessage1
();
// log.info("[申请模块]:装备申请驳回");
return
ResponseEntity
.
ok
(
taskBto
);
// myWebSocket.sendMessage1();
}
// return ResponseEntity.ok(taskBto);
//批复成功
// }
if
(
deviceApplyConfirmVo
.
getStatus
()
==
0
)
{
// //批复成功
applyBillEntity
.
setApplyStatus
(
2
);
// if (deviceApplyConfirmVo.getStatus() == 0) {
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
// applyBillEntity.setApplyStatus(2);
//发送阅知信息
// taskService.update(taskService.moveToEnd(taskBto));
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"同意"
+
userPublicService
.
getAreaNameByUnitName
(
applyBillEntity
.
getApplyUnit
())
+
"的装备申请"
,
ids
);
// //发送阅知信息
messageService
.
add
(
messageBto
);
// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"同意" + userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "的装备申请",ids);
log
.
info
(
"[申请模块]:装备申请批复成功,发起配发子业务"
);
// messageService.add(messageBto);
//生成配发子任务
// log.info("[申请模块]:装备申请批复成功,发起配发子业务");
List
<
Integer
>
userIds
=
new
ArrayList
<>();
// //生成配发子任务
userIds
.
add
(
0
);
// List<Integer> userIds = new ArrayList<>();
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_ALLOT
.
id
,
"配发业务"
,
taskBto
.
getId
(),
"."
+
taskBto
.
getId
()
+
"."
,
0
,
3
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
// userIds.add(0);
TaskBto
task
=
taskService
.
start
(
taskBto1
);
// TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_ALLOT.id, "配发业务", taskBto.getId(), "." + taskBto.getId() + ".", 0, 3, userUtils.getCurrentUnitId(), 0, null, userIds);
deviceApplyBillService
.
update
(
applyBillEntity
);
// TaskBto task = taskService.start(taskBto1);
myWebSocket
.
sendMessage1
();
// deviceApplyBillService.update(applyBillEntity);
return
ResponseEntity
.
ok
(
task
);
// myWebSocket.sendMessage1();
}
else
{
// return ResponseEntity.ok(task);
throw
new
ApiException
(
ResultUtil
.
failed
(
"status只能为0或1"
));
// } else {
}
// throw new ApiException(ResultUtil.failed("status只能为0或1"));
}
// }
// }
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@PostMapping
(
"/allot"
)
//不用了
@PostMapping
(
"/allot"
)
//不用了
...
@@ -474,7 +478,9 @@ public class DeviceApplyController {
...
@@ -474,7 +478,9 @@ public class DeviceApplyController {
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveToEnd
(
taskBto
);
List
<
Integer
>
userIds
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
List
<
Integer
>
userIds
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
DeviceApplyBill
deviceApplyBill
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"申请不同意,申请业务办结"
,
userIds
,
0
);
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备申请被拒绝:"
+
MessageFormatUtil
.
spellModelAndCount
(
uploadApplyFile
.
getModels
(),
uploadApplyFile
.
getTotalNum
()),
userIds
,
0
);
messageService
.
add
(
messageBto
);
messageService
.
add
(
messageBto
);
deviceApplyBill
.
setApplyStatus
(
1
);
deviceApplyBill
.
setApplyStatus
(
1
);
deviceApplyBill
.
setBackFiles
(
FilesUtil
.
stringFileToList
(
uploadApplyFile
.
getBackFiles
()));
deviceApplyBill
.
setBackFiles
(
FilesUtil
.
stringFileToList
(
uploadApplyFile
.
getBackFiles
()));
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/UploadApplyFile.java
浏览文件 @
9f72af85
...
@@ -53,4 +53,10 @@ public class UploadApplyFile {
...
@@ -53,4 +53,10 @@ public class UploadApplyFile {
@ApiModelProperty
(
value
=
"经办人"
)
@ApiModelProperty
(
value
=
"经办人"
)
private
String
agent
;
private
String
agent
;
@ApiModelProperty
(
value
=
"型号的集合"
)
private
List
<
String
>
models
;
@ApiModelProperty
(
value
=
"总数量"
)
private
Integer
totalNum
;
}
}
dev-loss/src/main/java/com/tykj/dev/device/loss/service/impl/LossBillServiceImpl.java
浏览文件 @
9f72af85
package
com
.
tykj
.
dev
.
device
.
loss
.
service
.
impl
;
package
com
.
tykj
.
dev
.
device
.
loss
.
service
.
impl
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.blockcha.subject.service.BlockChainUtil
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.config.base.DeviceLifeStatus
;
import
com.tykj.dev.config.base.FileName
;
import
com.tykj.dev.config.base.FileName
;
...
@@ -10,6 +11,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
...
@@ -10,6 +11,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.service.DeviceLogService
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.Dto.DeviceLogDto
;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.domin.DeviceLog
;
import
com.tykj.dev.device.library.subject.vo.ScriptSaveVo
;
import
com.tykj.dev.device.loss.entity.domain.DeviceLoss
;
import
com.tykj.dev.device.loss.entity.domain.DeviceLoss
;
import
com.tykj.dev.device.loss.entity.vo.LossAuditvo
;
import
com.tykj.dev.device.loss.entity.vo.LossAuditvo
;
import
com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo
;
import
com.tykj.dev.device.loss.entity.vo.RetrieveAuditvo
;
...
@@ -31,15 +33,15 @@ import com.tykj.dev.device.user.subject.service.UserService;
...
@@ -31,15 +33,15 @@ import com.tykj.dev.device.user.subject.service.UserService;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.BusinessEnum
;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
//import com.tykj.dev.misc.base.DeviceLifeStatus;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
import
com.tykj.dev.misc.utils.MessageFormatUtil
;
import
com.tykj.dev.misc.utils.TaskDisposeUtil
;
import
com.tykj.dev.misc.utils.TaskDisposeUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -102,13 +104,24 @@ public class LossBillServiceImpl implements LossBillService {
...
@@ -102,13 +104,24 @@ public class LossBillServiceImpl implements LossBillService {
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
taskBto
=
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
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起
装备丢失:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
deviceLibraryService
.
upDateLeftStatus
(
DeviceLifeStatus
.
LOSS
.
id
,
deviceLoss
.
getDevIdsList
());
deviceLibraryService
.
upDateLeftStatus
(
DeviceLifeStatus
.
LOSS
.
id
,
deviceLoss
.
getDevIdsList
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备报备丢失"
,
deviceLoss
.
getCreateUserId
(),
taskBto
.
getId
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备报备丢失"
,
deviceLoss
.
getCreateUserId
(),
taskBto
.
getId
());
}
}
private
String
toMessageCount
(
String
json
){
List
<
Integer
>
ids
=
StringUtils
.
stringToList
(
json
);
Set
<
String
>
strings
=
new
HashSet
<>();
deviceLibraryService
.
findByIds
(
ids
).
forEach
(
deviceLibrary
->
{
strings
.
add
(
deviceLibrary
.
getModel
());
}
);
return
MessageFormatUtil
.
spellModelSetAndCount
(
strings
,
ids
.
size
());
}
@Override
@Override
public
void
superiorAuditLoss
(
LossAuditvo
lossAuditvo
)
{
public
void
superiorAuditLoss
(
LossAuditvo
lossAuditvo
)
{
...
@@ -132,7 +145,7 @@ public class LossBillServiceImpl implements LossBillService {
...
@@ -132,7 +145,7 @@ public class LossBillServiceImpl implements LossBillService {
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
LOSS1301
,
0
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
LOSS1301
,
0
);
}
}
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"审核
了装备丢失业务"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"审核
装备丢失:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
deviceLossService
.
save
(
deviceLoss
);
deviceLossService
.
save
(
deviceLoss
);
}
}
...
@@ -156,7 +169,7 @@ public class LossBillServiceImpl implements LossBillService {
...
@@ -156,7 +169,7 @@ public class LossBillServiceImpl implements LossBillService {
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
Units
parentUnits
=
unitsService
.
findUnitAreaId
(
area
.
getFatherId
());
taskBto
=
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
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起
装备找回"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
gainThisUser
(
securityUser
.
getCurrentUserInfo
().
getUserId
(),
securityUser
.
getCurrentUserInfo
().
getUnitsId
())));
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备找回上报"
,
deviceLoss
.
getCreateUserId
(),
taskBto
.
getId
());
devLogAdd
(
deviceLoss
.
getDevIdsList
(),
"装备找回上报"
,
deviceLoss
.
getCreateUserId
(),
taskBto
.
getId
());
}
}
...
@@ -175,11 +188,11 @@ public class LossBillServiceImpl implements LossBillService {
...
@@ -175,11 +188,11 @@ public class LossBillServiceImpl implements LossBillService {
taskService
.
moveToEnd
(
taskBto
);
taskService
.
moveToEnd
(
taskBto
);
deviceLoss
.
setBackStatus
(
2
);
deviceLoss
.
setBackStatus
(
2
);
deviceLibraryService
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
StringUtils
.
stringToList
(
deviceLoss
.
getDevIds
()));
deviceLibraryService
.
upDateLeftStatus
(
DeviceLifeStatus
.
IN_LIBRARY
.
id
,
StringUtils
.
stringToList
(
deviceLoss
.
getDevIds
()));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
装备找回业务审核成功"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
审核通过 装备找回:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
else
{
}
else
{
taskService
.
moveToEnd
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1403
));
taskService
.
moveToEnd
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1403
));
User
user1
=
userService
.
findByUser
(
taskBto
.
getCreateUserId
());
User
user1
=
userService
.
findByUser
(
taskBto
.
getCreateUserId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
装备找回业务审核不通过"
,
findUnitId
(
user1
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
审核不通过 装备找回:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
findUnitId
(
user1
.
getUnitsId
())));
deviceLoss
.
setBackStatus
(
3
);
deviceLoss
.
setBackStatus
(
3
);
}
}
}
else
{
}
else
{
...
@@ -190,12 +203,12 @@ public class LossBillServiceImpl implements LossBillService {
...
@@ -190,12 +203,12 @@ public class LossBillServiceImpl implements LossBillService {
if
(
retrieveAuditvo
.
getType
()==
1
){
if
(
retrieveAuditvo
.
getType
()==
1
){
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskBto
.
setOwnUnit
(
parentUnits
.
getUnitId
());
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1401
,
0
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1401
,
0
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
装备找回业务审核成功"
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
审核通过 装备找回:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
gainThisUser
(
user
.
getUserId
(),
user
.
getUnitsId
())));
}
else
{
}
else
{
taskService
.
moveToEnd
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1402
));
taskService
.
moveToEnd
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
RETRIEVE1402
));
deviceLoss
.
setBackStatus
(
3
);
deviceLoss
.
setBackStatus
(
3
);
User
user1
=
userService
.
findByUser
(
taskBto
.
getCreateUserId
());
User
user1
=
userService
.
findByUser
(
taskBto
.
getCreateUserId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
装备找回业务审核不通过"
,
findUnitId
(
user1
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
审核不通过 装备找回:"
+
toMessageCount
(
deviceLoss
.
getDevIds
())
,
findUnitId
(
user1
.
getUnitsId
())));
}
}
}
}
...
...
dev-misc/src/main/java/com/tykj/dev/misc/utils/MessageFormatUtil.java
浏览文件 @
9f72af85
...
@@ -42,6 +42,15 @@ public class MessageFormatUtil {
...
@@ -42,6 +42,15 @@ public class MessageFormatUtil {
}
}
/**
* 阅知中拼接型号和数量
*/
public
static
String
spellModelSetAndCount
(
Set
<
String
>
models
,
Integer
count
)
{
return
"【型号:"
+
String
.
join
(
","
,
models
)
+
"共"
+
count
+
"件装备】"
;
}
/**
/**
* 一个【】填空内容的通用接口
* 一个【】填空内容的通用接口
*/
*/
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
9f72af85
...
@@ -149,26 +149,37 @@ public class RepairController {
...
@@ -149,26 +149,37 @@ public class RepairController {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
judge
(
@RequestBody
List
<
Integer
>
ids
)
{
public
ResponseEntity
judge
(
@RequestBody
List
<
Integer
>
ids
)
{
//存放所有维修记录的发件单位
//存放所有维修记录的发件单位
Set
<
String
>
sendUnits
=
new
HashSet
<>();
// Set<String> sendUnits = new HashSet<>();
List
<
Integer
>
sendUnits
=
new
ArrayList
<>();
ids
.
forEach
(
integer
->
{
ids
.
forEach
(
integer
->
{
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
integer
);
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
integer
);
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
repairDetail
.
getDeviceRepairBillId
());
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
repairDetail
.
getDeviceRepairBillId
());
sendUnits
.
add
(
repairBill
.
getSendUnit
());
//
sendUnits.add(repairBill.getSendUnit());
sendUnits
.
add
(
repairBill
.
getSendUnitId
()
.
toString
()
);
sendUnits
.
add
(
repairBill
.
getSendUnitId
());
});
});
//去重
List
<
Integer
>
collect
=
sendUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//如果是同一单位返回单位名称,否则返error
//如果是同一单位返回单位名称,否则返error
// if (sendUnits.size() == 1) {
if
(
collect
.
size
()
==
1
)
{
Units
units
=
unitsService
.
findById
(
collect
.
get
(
0
));
// return ResponseEntity.ok(sendUnits.iterator().next());
// return ResponseEntity.ok(sendUnits.iterator().next());
// } else {
return
ResponseEntity
.
ok
(
units
);
// return ResponseEntity.ok("error");
// }
List
<
String
>
list
=
sendUnits
.
stream
().
sorted
().
collect
(
Collectors
.
toList
());
if
(
sendUnits
.
size
()
==
2
)
{
return
ResponseEntity
.
ok
(
list
);
}
else
{
}
else
{
return
ResponseEntity
.
ok
(
"error"
);
return
ResponseEntity
.
ok
(
"error"
);
}
}
// if (sendUnits.size() == 1) {
//// return ResponseEntity.ok(sendUnits.iterator().next());
// return ResponseEntity.ok(collect);
// } else {
// return ResponseEntity.ok("error");
// }
// List<String> list = sendUnits.stream().sorted().collect(Collectors.toList());
//
// if (sendUnits.size() == 2) {
// return ResponseEntity.ok(list);
// } else {
// return ResponseEntity.ok("error");
// }
}
}
@ApiOperation
(
value
=
"保存维修操作"
,
notes
=
"可以通过这个接口保存维修操作"
)
@ApiOperation
(
value
=
"保存维修操作"
,
notes
=
"可以通过这个接口保存维修操作"
)
...
@@ -1324,6 +1335,8 @@ public class RepairController {
...
@@ -1324,6 +1335,8 @@ public class RepairController {
//如果所属和所在一致,状态改为在库
//如果所属和所在一致,状态改为在库
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
deviceLibraryEntity
.
getLocationUnit
()))
{
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
deviceLibraryEntity
.
getLocationUnit
()))
{
deviceLibraryEntity
.
setLifeStatus
(
2
);
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
else
{
deviceLibraryEntity
.
setLifeStatus
(
4
);
}
}
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraries
.
add
(
deviceLibraryEntity
);
deviceLibraries
.
add
(
deviceLibraryEntity
);
...
@@ -2297,7 +2310,13 @@ public class RepairController {
...
@@ -2297,7 +2310,13 @@ public class RepairController {
deviceLogService
.
addLog
(
deviceLogDto
);
deviceLogService
.
addLog
(
deviceLogDto
);
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
integer
);
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
integer
);
deviceLibraryEntity
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
deviceLibraryEntity
.
setLifeStatus
(
2
);
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
repairBackBill
.
getReceiveUnit
())){
//在库
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
else
{
//维修中
deviceLibraryEntity
.
setLifeStatus
(
4
);
}
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
});
});
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/RepelBusinessServiceImpl.java
浏览文件 @
9f72af85
...
@@ -47,6 +47,7 @@ import java.time.LocalDateTime;
...
@@ -47,6 +47,7 @@ import java.time.LocalDateTime;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -643,7 +644,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
...
@@ -643,7 +644,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelId
(
deviceRepel1
.
getId
());
deviceRepelDetail
.
setRepelStatus
(
1
);
deviceRepelDetail
.
setRepelStatus
(
1
);
TaskBto
taskBto
=
cityInitiateTask
(
unitsFather
.
getUnitId
(),
deviceRepel1
.
getId
(),
deviceRepel
.
getTitle
(),
userId
);
TaskBto
taskBto
=
cityInitiateTask
(
unitsFather
.
getUnitId
(),
deviceRepel1
.
getId
(),
deviceRepel
.
getTitle
(),
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
user
.
getName
()
+
"发起清退任务["
+
deviceRepel1
.
getTitle
()
+
"]"
,
gainThisUser
(
userId
,
units
.
getUnitId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"发起 清退出库:"
+
toMessageCount
(
deviceRepelDetail
.
getScriptJson
(),
deviceRepelDetail
.
getSendUnit
())
,
gainThisUser
(
userId
,
units
.
getUnitId
())));
}
}
...
@@ -850,7 +851,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
...
@@ -850,7 +851,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1209
,
0
);
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
SEND_BACK_1209
,
0
);
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
());
DeviceRepel
deviceRepel
=
deviceRepelService
.
findDeviceRepel
(
deviceRepelDetail
.
getRepelId
());
waitingReceiptsTask
(
orderOutData
.
getSendUnitId
(),
deviceRepelDetail
.
getId
(),
taskBto
.
getId
(),
taskBto
.
getTitle
(),
userId
);
waitingReceiptsTask
(
orderOutData
.
getSendUnitId
(),
deviceRepelDetail
.
getId
(),
taskBto
.
getId
(),
taskBto
.
getTitle
(),
userId
);
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
清退设备出库完成"
,
gainThisUser
(
userId
,
user
.
getUnitsId
())));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
发起 清退出库:"
+
toMessageCount
(
deviceRepelDetail
.
getScriptJson
(),
deviceRepelDetail
.
getSendUnit
())
,
gainThisUser
(
userId
,
user
.
getUnitsId
())));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
deviceRepelDetail
.
getSendUnit
()
+
"装备清退出库"
+
",等待接收"
,
userId
,
taskBto
.
getId
());
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
deviceRepelDetail
.
getSendUnit
()
+
"装备清退出库"
+
",等待接收"
,
userId
,
taskBto
.
getId
());
orderOutDataRepelDetail
.
setDeviceLibraryEntities
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()));
orderOutDataRepelDetail
.
setDeviceLibraryEntities
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()));
//把一些字段填写到对象中,保存入库
//把一些字段填写到对象中,保存入库
...
@@ -1009,7 +1010,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
...
@@ -1009,7 +1010,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
taskService
.
moveToEnd
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
taskService
.
moveToEnd
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
taskService
.
moveToArchive
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
taskService
.
moveToArchive
(
taskService
.
findBillTypeAndFatherId
(
BusinessEnum
.
SEND_BACK
.
id
,
taskId
));
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"签收"
+
deviceRepelDetail
.
getSendUnit
()
+
"清退的设备"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
devLogAdd
(
findInvoleDevice
(
deviceRepelDetail
.
getDeviceIds
()),
"签收"
+
deviceRepelDetail
.
getSendUnit
()
+
"清退的设备"
,
storageDeviceRepel
.
getUserId
(),
taskBto
.
getId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()
+
"清退的设备"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
办结 清退业务:"
+
toMessageCount
(
deviceRepelDetail
.
getScriptJson
(),
deviceRepelDetail
.
getSendUnit
())
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
}
else
{
}
else
{
if
(
storageDeviceRepel
.
getIsIgnore
()
==
null
)
{
if
(
storageDeviceRepel
.
getIsIgnore
()
==
null
)
{
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
List
<
StatusEnum
>
enumList
=
new
ArrayList
<>();
...
@@ -1047,7 +1048,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
...
@@ -1047,7 +1048,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
FileRet
fileRet
=
pdfService
.
billPdf
(
documents
);
FileRet
fileRet
=
pdfService
.
billPdf
(
documents
);
deviceRepelDetail
.
setOutboundFile
(
JacksonUtil
.
toJSon
(
fileRet
));
deviceRepelDetail
.
setOutboundFile
(
JacksonUtil
.
toJSon
(
fileRet
));
deviceRepelDetail
.
setSendFiles
(
JacksonUtil
.
toJSon
(
fileRet
));
deviceRepelDetail
.
setSendFiles
(
JacksonUtil
.
toJSon
(
fileRet
));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
签收"
+
deviceRepelDetail
.
getSendUnit
()
+
"清退的设备"
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"
接收 清退业务:"
+
toMessageCount
(
deviceRepelDetail
.
getScriptJson
(),
deviceRepelDetail
.
getSendUnit
())
,
findUnitIds
(
user
.
getUserId
(),
unitIds
)));
}
}
}
}
deviceRepelDetail
.
setReceiveTime
(
new
Date
());
deviceRepelDetail
.
setReceiveTime
(
new
Date
());
...
@@ -1197,7 +1198,21 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
...
@@ -1197,7 +1198,21 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List
<
Integer
>
unitIds
=
new
ArrayList
<>();
List
<
Integer
>
unitIds
=
new
ArrayList
<>();
unitIds
.
add
(
deviceRepelDetail
.
getSendUnitId
());
unitIds
.
add
(
deviceRepelDetail
.
getSendUnitId
());
unitIds
.
add
(
deviceRepelDetail
.
getReceiveUnitId
());
unitIds
.
add
(
deviceRepelDetail
.
getReceiveUnitId
());
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"装备清退任务,出库方上传了回执单据任务结束"
,
findUnitIds
(
storageDeviceRepel
.
getUserId
(),
unitIds
)));
addMessage
(
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"办结 清退业务:"
+
toMessageCount
(
deviceRepelDetail
.
getScriptJson
(),
deviceRepelDetail
.
getSendUnit
()),
findUnitIds
(
storageDeviceRepel
.
getUserId
(),
unitIds
)));
}
private
String
toMessageCount
(
String
json
,
String
unitName
){
List
<
ScriptSaveVo
>
scriptSaveVoList
=
JacksonUtil
.
readValue
(
json
,
new
TypeReference
<
List
<
ScriptSaveVo
>>()
{
});
Set
<
String
>
strings
=
new
HashSet
<>();
AtomicInteger
count
=
new
AtomicInteger
();
scriptSaveVoList
.
forEach
(
scriptSaveVo
->
{
strings
.
add
(
scriptSaveVo
.
getModel
());
count
.
set
(
count
.
get
()
+
scriptSaveVo
.
getNum
());
}
);
return
MessageFormatUtil
.
spellUnitAndModelAndCount
(
unitName
,
strings
,
count
.
get
());
}
}
...
...
dev-user/src/main/java/com/tykj/dev/device/user/subject/service/impl/UnitsServiceImpl.java
浏览文件 @
9f72af85
...
@@ -320,11 +320,11 @@ public class UnitsServiceImpl implements UnitsService {
...
@@ -320,11 +320,11 @@ public class UnitsServiceImpl implements UnitsService {
leftNavigation
=
belongsArea
.
toLeftNavigation
();
leftNavigation
=
belongsArea
.
toLeftNavigation
();
LeftNavigation
units
=
securityUser
.
getCurrentUserInfo
().
getUnits
().
toLeftNavigation
();
LeftNavigation
units
=
securityUser
.
getCurrentUserInfo
().
getUnits
().
toLeftNavigation
();
List
<
LeftNavigation
>
leftNavigationList1
=
new
ArrayList
<>();
List
<
LeftNavigation
>
leftNavigationList1
=
new
ArrayList
<>();
systemConfigService
.
getStorageLocationMap
().
forEach
(
//
systemConfigService.getStorageLocationMap().forEach(
(
k
,
v
)
->
{
//
(k, v) -> {
leftNavigationList1
.
add
(
new
LeftNavigation
(
0
,
v
,
null
,
v
,
3
,
k
,
units
.
getId
()));
//
leftNavigationList1.add(new LeftNavigation(0, v, null, v, 3, k, units.getId()));
}
//
}
);
//
);
units
.
setLeftNavigations
(
leftNavigationList1
.
stream
().
sorted
(
Comparator
.
comparing
(
LeftNavigation:
:
getOrder
,
Comparator
.
nullsLast
(
Integer:
:
compareTo
))).
collect
(
Collectors
.
toList
()));
units
.
setLeftNavigations
(
leftNavigationList1
.
stream
().
sorted
(
Comparator
.
comparing
(
LeftNavigation:
:
getOrder
,
Comparator
.
nullsLast
(
Integer:
:
compareTo
))).
collect
(
Collectors
.
toList
()));
leftNavigationList
.
add
(
units
);
leftNavigationList
.
add
(
units
);
//把省直属组合一下 直属单位(type=2) 处室单位(type=4)
//把省直属组合一下 直属单位(type=2) 处室单位(type=4)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论