Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
0be48775
提交
0be48775
authored
11月 12, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(申请模块,维修模块): 修改申请阅知,修改了市送给省装备,省修好给市,显示装备为在库(此时该装备所属在区)
修改申请阅知,修改了市送给省装备,省修好给市,显示装备为在库(此时该装备所属在区)
上级
30706ebc
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
96 行增加
和
65 行删除
+96
-65
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+60
-54
UploadApplyFile.java
...com/tykj/dev/device/apply/subject/vo/UploadApplyFile.java
+6
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+30
-11
没有找到文件。
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
0be48775
...
...
@@ -237,61 +237,65 @@ public class DeviceApplyController {
return
ResponseEntity
.
ok
(
"ok"
);
}
@ApiOperation
(
value
=
"装备申请批复"
,
notes
=
"可以通过这个接口批复"
)
@PostMapping
(
"/replay"
)
//不用了
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addDeviceApplyBillReplay
(
@RequestBody
@Validated
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyConfirmVo
.
getTaskId
());
TaskDisposeUtil
.
isNotSubmit
(
taskBto
.
getBillStatus
(),
StatusEnum
.
DEVICE_APPLY_CONFIRM
);
Integer
userId
=
userUtils
.
getCurrentUserId
();
taskService
.
addInvolveUser
(
taskBto
,
userId
);
DeviceApplyBill
applyBillEntity
=
deviceApplyBillService
.
getOne
(
taskBto
.
getBillId
());
applyBillEntity
.
setReplyUseraId
(
userId
);
//阅知用户Id
List
<
Integer
>
ids
=
userPublicService
.
findOtherUser
(
userId
);
// ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(applyBillEntity.getApplyUnit())).stream()
// @ApiOperation(value = "装备申请批复", notes = "可以通过这个接口批复")
// @PostMapping("/replay")//不用了
// @Transactional(rollbackFor = Exception.class)
// public ResponseEntity addDeviceApplyBillReplay(@RequestBody @Validated DeviceApplyConfirmVo deviceApplyConfirmVo) {
// TaskBto taskBto = taskService.get(deviceApplyConfirmVo.getTaskId());
// TaskDisposeUtil.isNotSubmit(taskBto.getBillStatus(),StatusEnum.DEVICE_APPLY_CONFIRM);
// Integer userId = userUtils.getCurrentUserId();
// taskService.addInvolveUser(taskBto, userId);
// DeviceApplyBill applyBillEntity = deviceApplyBillService.getOne(taskBto.getBillId());
// applyBillEntity.setReplyUseraId(userId);
// //阅知用户Id
// List<Integer> ids = userPublicService.findOtherUser(userId);
//// 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)
// .collect(Collectors.toList()));
ids
.
addAll
(
userDao
.
findAllByUnitsId
(
applyBillEntity
.
getApplyUnitId
()).
stream
()
.
map
(
User:
:
getUserId
)
.
collect
(
Collectors
.
toList
()));
//如果修改了批复文号
if
(
deviceApplyConfirmVo
.
getReplyNumber
()
!=
null
)
{
applyBillEntity
.
setReplayNumber
(
deviceApplyConfirmVo
.
getReplyNumber
());
}
//批复驳回
if
(
deviceApplyConfirmVo
.
getStatus
()
==
1
)
{
applyBillEntity
.
setApplyStatus
(
1
);
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
deviceApplyBillService
.
update
(
applyBillEntity
);
//发送阅知信息
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"不同意 申请业务:【"
+
userPublicService
.
getAreaNameByUnitName
(
applyBillEntity
.
getApplyUnit
())
+
"->【中办机要局】"
,
ids
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[申请模块]:装备申请驳回"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
taskBto
);
}
//批复成功
if
(
deviceApplyConfirmVo
.
getStatus
()
==
0
)
{
applyBillEntity
.
setApplyStatus
(
2
);
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//发送阅知信息
MessageBto
messageBto
=
new
MessageBto
(
taskBto
.
getId
(),
taskBto
.
getBusinessType
(),
"同意"
+
userPublicService
.
getAreaNameByUnitName
(
applyBillEntity
.
getApplyUnit
())
+
"的装备申请"
,
ids
);
messageService
.
add
(
messageBto
);
log
.
info
(
"[申请模块]:装备申请批复成功,发起配发子业务"
);
//生成配发子任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
0
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_ALLOT
.
id
,
"配发业务"
,
taskBto
.
getId
(),
"."
+
taskBto
.
getId
()
+
"."
,
0
,
3
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
TaskBto
task
=
taskService
.
start
(
taskBto1
);
deviceApplyBillService
.
update
(
applyBillEntity
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
task
);
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"status只能为0或1"
));
}
}
// //如果修改了批复文号
// if (deviceApplyConfirmVo.getReplyNumber() != null) {
// applyBillEntity.setReplayNumber(deviceApplyConfirmVo.getReplyNumber());
// }
// //批复驳回
// if (deviceApplyConfirmVo.getStatus() == 1) {
// applyBillEntity.setApplyStatus(1);
// taskService.update(taskService.moveToArchive(taskBto));
// deviceApplyBillService.update(applyBillEntity);
// //发送阅知信息 装备申请被拒绝
//// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
//// "不同意 申请业务:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "->【中办机要局】",ids);
//
// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),
// "装备申请被拒绝:【"+userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) +
// "->【中办机要局】申请"+MessageFormatUtil.spellModelAndCount(),ids);
// messageService.add(messageBto);
// log.info("[申请模块]:装备申请驳回");
// myWebSocket.sendMessage1();
// return ResponseEntity.ok(taskBto);
// }
// //批复成功
// if (deviceApplyConfirmVo.getStatus() == 0) {
// applyBillEntity.setApplyStatus(2);
// taskService.update(taskService.moveToEnd(taskBto));
// //发送阅知信息
// MessageBto messageBto = new MessageBto(taskBto.getId(),taskBto.getBusinessType(),"同意" + userPublicService.getAreaNameByUnitName(applyBillEntity.getApplyUnit()) + "的装备申请",ids);
// messageService.add(messageBto);
// log.info("[申请模块]:装备申请批复成功,发起配发子业务");
// //生成配发子任务
// List<Integer> userIds = new ArrayList<>();
// userIds.add(0);
// TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_ALLOT.id, "配发业务", taskBto.getId(), "." + taskBto.getId() + ".", 0, 3, userUtils.getCurrentUnitId(), 0, null, userIds);
// TaskBto task = taskService.start(taskBto1);
// deviceApplyBillService.update(applyBillEntity);
// myWebSocket.sendMessage1();
// return ResponseEntity.ok(task);
// } else {
// throw new ApiException(ResultUtil.failed("status只能为0或1"));
// }
// }
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@PostMapping
(
"/allot"
)
//不用了
...
...
@@ -474,7 +478,9 @@ public class DeviceApplyController {
taskService
.
moveToEnd
(
taskBto
);
List
<
Integer
>
userIds
=
userPublicService
.
findOtherUser
(
userUtils
.
getCurrentUserId
());
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
);
deviceApplyBill
.
setApplyStatus
(
1
);
deviceApplyBill
.
setBackFiles
(
FilesUtil
.
stringFileToList
(
uploadApplyFile
.
getBackFiles
()));
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/subject/vo/UploadApplyFile.java
浏览文件 @
0be48775
...
...
@@ -53,4 +53,10 @@ public class UploadApplyFile {
@ApiModelProperty
(
value
=
"经办人"
)
private
String
agent
;
@ApiModelProperty
(
value
=
"型号的集合"
)
private
List
<
String
>
models
;
@ApiModelProperty
(
value
=
"总数量"
)
private
Integer
totalNum
;
}
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
0be48775
...
...
@@ -149,26 +149,37 @@ public class RepairController {
@Transactional
(
rollbackFor
=
Exception
.
class
)
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
->
{
RepairDetail
repairDetail
=
deviceRepairDetailService
.
getOne
(
integer
);
RepairBill
repairBill
=
deviceRepairBillService
.
getOne
(
repairDetail
.
getDeviceRepairBillId
());
sendUnits
.
add
(
repairBill
.
getSendUnit
());
sendUnits
.
add
(
repairBill
.
getSendUnitId
()
.
toString
()
);
//
sendUnits.add(repairBill.getSendUnit());
sendUnits
.
add
(
repairBill
.
getSendUnitId
());
});
//去重
List
<
Integer
>
collect
=
sendUnits
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
//如果是同一单位返回单位名称,否则返error
// if (sendUnits.size() == 1) {
if
(
collect
.
size
()
==
1
)
{
Units
units
=
unitsService
.
findById
(
collect
.
get
(
0
));
// return ResponseEntity.ok(sendUnits.iterator().next());
// } else {
// return ResponseEntity.ok("error");
// }
List
<
String
>
list
=
sendUnits
.
stream
().
sorted
().
collect
(
Collectors
.
toList
());
if
(
sendUnits
.
size
()
==
2
)
{
return
ResponseEntity
.
ok
(
list
);
return
ResponseEntity
.
ok
(
units
);
}
else
{
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
=
"可以通过这个接口保存维修操作"
)
...
...
@@ -1324,6 +1335,8 @@ public class RepairController {
//如果所属和所在一致,状态改为在库
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
deviceLibraryEntity
.
getLocationUnit
()))
{
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
else
{
deviceLibraryEntity
.
setLifeStatus
(
4
);
}
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraries
.
add
(
deviceLibraryEntity
);
...
...
@@ -2297,7 +2310,13 @@ public class RepairController {
deviceLogService
.
addLog
(
deviceLogDto
);
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
integer
);
deviceLibraryEntity
.
setLocationUnit
(
repairBackBill
.
getReceiveUnit
());
if
(
deviceLibraryEntity
.
getOwnUnit
().
equals
(
repairBackBill
.
getReceiveUnit
())){
//在库
deviceLibraryEntity
.
setLifeStatus
(
2
);
}
else
{
//维修中
deviceLibraryEntity
.
setLifeStatus
(
4
);
}
deviceLibraryEntity
.
setManageStatus
(
1
);
deviceLibraryService
.
update
(
deviceLibraryEntity
);
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论