Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
5ac46093
提交
5ac46093
authored
9月 24, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新业务日志aop
上级
6b49c8ff
隐藏空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
778 行增加
和
148 行删除
+778
-148
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+4
-3
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+9
-9
pom.xml
dev-config/pom.xml
+5
-0
GlobalMap.java
dev-config/src/main/java/com/tykj/dev/config/GlobalMap.java
+14
-1
LogAspect.java
dev-config/src/main/java/com/tykj/dev/config/LogAspect.java
+0
-34
LogType.java
dev-config/src/main/java/com/tykj/dev/config/LogType.java
+134
-0
Param.java
dev-config/src/main/java/com/tykj/dev/config/Param.java
+3
-6
DeviceCheckController.java
...device/confirmcheck/controller/DeviceCheckController.java
+6
-6
DeviceDestroyController.java
...ev/device/destroy/controller/DeviceDestroyController.java
+19
-10
DeviceDestroyBill.java
...j/dev/device/destroy/entity/domain/DeviceDestroyBill.java
+11
-1
DeviceDestroyConfirmVo.java
.../dev/device/destroy/entity/vo/DeviceDestroyConfirmVo.java
+6
-0
DeviceLibrarySaveVo.java
...kj/dev/device/library/subject/vo/DeviceLibrarySaveVo.java
+3
-0
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+7
-7
StatusEnum.java
...misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
+4
-1
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+8
-9
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+33
-30
DeviceRetiredController.java
...ev/device/retired/controller/DeviceRetiredController.java
+3
-3
RfidController.java
...ain/java/com/tykj/dev/rfid/controller/RfidController.java
+3
-3
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+7
-7
SendBackServiceImpl.java
...dev/device/sendback/service/impl/SendBackServiceImpl.java
+2
-2
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+7
-7
TaskService.java
...in/java/com/tykj/dev/device/task/service/TaskService.java
+1
-1
TaskServiceImpl.java
...om/tykj/dev/device/task/service/impl/TaskServiceImpl.java
+16
-3
TaskBto.java
...in/java/com/tykj/dev/device/task/subject/bto/TaskBto.java
+1
-1
TrainJobController.java
.../tykj/dev/device/train/controller/TrainJobController.java
+3
-3
WorkHandoverServiceImpl.java
...ev/device/train/service/impl/WorkHandoverServiceImpl.java
+1
-1
LogAspect.java
dev-union/src/main/java/com/tykj/dev/union/LogAspect.java
+448
-0
UnionApplication.java
...on/src/main/java/com/tykj/dev/union/UnionApplication.java
+20
-0
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
5ac46093
...
...
@@ -91,7 +91,7 @@ public class AllotBillController {
userIds
.
add
(
userId
);
userIds
.
add
(
allotBillSaveVo
.
getSendUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
,
"配发业务"
,
null
,
"."
,
billId
,
3
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
saveEntity
=
taskService
.
start
(
taskBto
);
Task
Bto
saveEntity
=
taskService
.
start
(
taskBto
);
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
allotBillEntity
.
getFileName
(),
allotBillEntity
.
getFileUrl
()));
...
...
@@ -179,9 +179,8 @@ public class AllotBillController {
@ApiOperation
(
value
=
"接收配发装备"
,
notes
=
"可以通过这个接口接收配发装备"
)
@PostMapping
(
value
=
"/receiveDevice"
)
public
ResponseEntity
receiveDevice
(
@RequestBody
AllotReceiveVo
allotReceiveVo
)
{
//获取当前任务
,推至下一阶段
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveVo
.
getTaskId
());
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
allotReceiveVo
.
getReceiveUserbId
()));
AllotBill
allotBillEntity
=
allotBillService
.
getOne
(
taskBto
.
getBillId
());
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
...
...
@@ -194,6 +193,8 @@ public class AllotBillController {
BeanUtils
.
copyProperties
(
allotReceiveVo
,
allotBillEntity
);
allotBillEntity
.
setReceiveTime
(
TimestampUtil
.
getCurrentTimestamp
());
allotBillService
.
update
(
allotBillEntity
);
//推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
allotReceiveVo
.
getReceiveUserbId
()));
//分隔装备id信息
String
deviceIdDetail
=
allotReceiveVo
.
getReceiveCheckDetail
();
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
5ac46093
...
...
@@ -106,10 +106,10 @@ public class DeviceApplyController {
userIds
.
add
(
0
);
taskBto
=
new
TaskBto
(
StatusEnum
.
DEVICE_APPLY_CONFIRM
.
id
,
"申请业务"
,
null
,
"."
,
deviceApplyBillEntity
.
getId
(),
9
,
userPublicService
.
findUnitIdByName
(
deviceApplySaveVo
.
getReplyUnit
()),
1
,
null
,
userIds
);
}
Task
saveEntity
=
taskService
.
start
(
taskBto
);
Task
Bto
saveEntity
=
taskService
.
start
(
taskBto
);
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
saveEntity
.
getId
(),
"发起装备申请"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起装备申请",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
deviceApplyBillEntity
);
}
...
...
@@ -129,8 +129,8 @@ public class DeviceApplyController {
applyBillEntity
.
setApplyStatus
(
1
);
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
deviceApplyBillService
.
update
(
applyBillEntity
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"装备申请批复驳回"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复驳回",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
taskBto
);
}
...
...
@@ -138,16 +138,16 @@ public class DeviceApplyController {
if
(
deviceApplyConfirmVo
.
getStatus
()==
0
){
applyBillEntity
.
setApplyStatus
(
2
);
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"装备申请批复通过"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"装备申请批复通过",null);
//
taskLogService.addLog(taskLogBto);
//生成配发子任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
WAIT_ALLOT
.
id
,
"配发业务"
,
taskBto
.
getId
(),
"."
+
taskBto
.
getId
()+
"."
,
0
,
3
,
userUtils
.
getCurrentUnitId
(),
0
,
null
,
userIds
);
Task
task
=
taskService
.
start
(
taskBto1
);
Task
Bto
task
=
taskService
.
start
(
taskBto1
);
deviceApplyBillService
.
update
(
applyBillEntity
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
task
.
parse2Bto
()
);
return
ResponseEntity
.
ok
(
task
);
}
else
{
throw
new
ApiException
(
ResultUtil
.
failed
(
"status只能为0或1"
));
...
...
dev-config/pom.xml
浏览文件 @
5ac46093
...
...
@@ -73,6 +73,11 @@
<artifactId>
misc
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
4.1.14
</version>
</dependency>
<!--<dependency>-->
...
...
dev-
misc/src/main/java/com/tykj/dev/misc/base
/GlobalMap.java
→
dev-
config/src/main/java/com/tykj/dev/config
/GlobalMap.java
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
misc
.
base
;
package
com
.
tykj
.
dev
.
config
;
import
com.tykj.dev.misc.base.RepairStatusEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
java.util.Arrays
;
import
java.util.Map
;
import
java.util.function.Function
;
...
...
@@ -14,11 +19,15 @@ public class GlobalMap {
private
static
final
Map
<
Integer
,
RepairStatusEnum
>
repairStatusMap
;
private
static
final
Map
<
Integer
,
LogType
>
logTypeMap
;
static
{
statusEnumMap
=
Arrays
.
stream
(
StatusEnum
.
values
())
.
collect
(
Collectors
.
toMap
(
statusEnum
->
statusEnum
.
id
,
Function
.
identity
()));
repairStatusMap
=
Arrays
.
stream
(
RepairStatusEnum
.
values
())
.
collect
(
Collectors
.
toMap
(
repairStatusEnum
->
repairStatusEnum
.
id
,
Function
.
identity
()));
logTypeMap
=
Arrays
.
stream
(
LogType
.
values
())
.
collect
(
Collectors
.
toMap
(
logType
->
logType
.
id
,
Function
.
identity
()));
}
public
static
Map
<
Integer
,
StatusEnum
>
getStatusEnumMap
()
{
...
...
@@ -28,4 +37,8 @@ public class GlobalMap {
public
static
Map
<
Integer
,
RepairStatusEnum
>
getRepairStatusMap
()
{
return
repairStatusMap
;
}
public
static
Map
<
Integer
,
LogType
>
getLogTypeMap
()
{
return
logTypeMap
;
}
}
dev-config/src/main/java/com/tykj/dev/config/LogAspect.java
deleted
100644 → 0
浏览文件 @
6b49c8ff
package
com
.
tykj
.
dev
.
config
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.springframework.stereotype.Component
;
/**
* 业务操作日志aop
*/
@Aspect
@Component
public
class
LogAspect
{
/**
* 请求中的所有参数
*/
private
Object
[]
args
;
/**
* 请求中的所有参数名
*/
private
String
[]
paramNames
;
/**
* 参数类
*/
private
Param
params
;
/**
* 业务操作日志定义切入点
*/
public
void
opreationLog
(){
}
}
dev-config/src/main/java/com/tykj/dev/config/LogType.java
0 → 100644
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
config
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
/**
* Type
*
* @author Lunhao Hu
* @date 2019-01-30 17:12
**/
@AllArgsConstructor
public
enum
LogType
{
/**
* 发起列装
*/
PACKING_1
(
1
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
PACKING_CONFIRM
.
id
,
"发起列装"
),
/**
* 列装审核成功
*/
PACKING_2
(
2
,
StatusEnum
.
PACKING_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"列装审核成功"
),
/**
* 列装审核失败
*/
PACKING_3
(
3
,
StatusEnum
.
PACKING_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"列装审核失败"
),
STORAGE_1
(
4
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
STORAGE_CONFIRM
.
id
,
"发起入库"
),
STORAGE_2
(
5
,
StatusEnum
.
STORAGE_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"入库审核成功"
),
STORAGE_3
(
6
,
StatusEnum
.
STORAGE_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"入库审核失败"
),
ALLOT_1
(
7
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
,
"对(%receiveUnit)发起配发"
),
ALLOT_2
(
8
,
StatusEnum
.
WAIT_ALLOT
.
id
,
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
,
"对(%receiveUnit)发起配发"
),
ALLOT_3
(
9
,
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"配发出库审核失败"
),
ALLOT_4
(
10
,
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
,
StatusEnum
.
ALLOTING
.
id
,
"审核成功并出库"
),
ALLOT_5
(
11
,
StatusEnum
.
ALLOTING
.
id
,
StatusEnum
.
ALLOT_RECEIVE_CONFIRM
.
id
,
"接收并发起入库"
),
ALLOT_6
(
12
,
StatusEnum
.
ALLOT_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"审核成功并入库"
),
ALLOT_7
(
13
,
StatusEnum
.
ALLOT_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"配发入库审核失败"
),
RFID_1
(
14
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
RFID_BUSINESS_NEED_CONFIRM
.
id
,
"发起标签替换"
),
RFID_2
(
15
,
StatusEnum
.
RFID_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"标签替换审核成功"
),
RFID_3
(
16
,
StatusEnum
.
RFID_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"标签替换审核失败"
),
SELF_CHECK_1
(
17
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
"手动发起自查"
),
SELF_CHECK_2
(
18
,
StatusEnum
.
WAIT_SELF_CHECK
.
id
,
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
"周期发起自查"
),
SELF_CHECK_3
(
19
,
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"自查审核成功"
),
SELF_CHECK_4
(
20
,
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"自查审核失败"
),
APPLY_1
(
21
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
DEVICE_APPLY_CONFIRM
.
id
,
"发起装备申请"
),
APPLY_2
(
22
,
StatusEnum
.
DEVICE_APPLY_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"装备申请批复通过"
),
APPLY_3
(
23
,
StatusEnum
.
DEVICE_APPLY_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"装备申请批复驳回"
),
DESTROY_1
(
24
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
DESTROY_BUSINESS_NEED_CONFIRM
.
id
,
"发起销毁"
),
DESTROY_2
(
25
,
StatusEnum
.
DESTROY_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"销毁出库审核成功"
),
DESTROY_3
(
26
,
StatusEnum
.
DESTROY_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"销毁出库审核失败"
),
MATCHING_1
(
27
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
,
"发起新增配套设备"
),
MATCHING_2
(
28
,
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"添加配套设备审核成功"
),
MATCHING_3
(
29
,
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"添加配套设备审核失败"
),
REPAIR_SEND_1
(
30
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
"向(%receiveUnit)发起装备维修"
),
REPAIR_SEND_2
(
31
,
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
StatusEnum
.
WAIT_RECEIVE
.
id
,
"审核成功并出库"
),
REPAIR_SEND_3
(
32
,
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"维修出库审核失败"
),
REPAIR_SEND_4
(
33
,
StatusEnum
.
WAIT_RECEIVE
.
id
,
StatusEnum
.
REPAIR_RECEIVE_CONFIRM
.
id
,
"接收维修装备并发起入库"
),
REPAIR_SEND_5
(
34
,
StatusEnum
.
REPAIR_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
REPAIRING
.
id
,
"审核成功并入库维修"
),
REPAIR_SEND_6
(
35
,
StatusEnum
.
REPAIR_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"维修装备入库审核失败"
),
REPAIR_SEND_7
(
36
,
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
StatusEnum
.
COUNTRY_REPAIRING
.
id
,
"审核成功并出库"
),
REPAIR_BACK_1
(
37
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
,
"向(%receiveUnit)退还维修装备"
),
REPAIR_BACK_2
(
38
,
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
,
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
"维修退回审核成功并出库"
),
REPAIR_BACK_3
(
39
,
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"维修退回出库审核失败"
),
REPAIR_BACK_4
(
40
,
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
,
StatusEnum
.
REPAIR_BACK_RECEIVE_CONFIRM
.
id
,
"维修退回装备接收并发起入库"
),
REPAIR_BACK_5
(
41
,
StatusEnum
.
REPAIR_BACK_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"维修退回装备入库审核成功"
),
REPAIR_BACK_6
(
42
,
StatusEnum
.
REPAIR_BACK_RECEIVE_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"维修退回装备入库审核失败"
),
RETIRED_1
(
43
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
RETIRED_BUSINESS_NEED_CONFIRM
.
id
,
"发起退装"
),
RETIRED_2
(
44
,
StatusEnum
.
RETIRED_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
END
.
id
,
"退装审核成功"
),
RETIRED_3
(
45
,
StatusEnum
.
RETIRED_BUSINESS_NEED_CONFIRM
.
id
,
StatusEnum
.
ARCHIVE
.
id
,
"退装审核失败"
),
TRAIN_1
(
46
,
StatusEnum
.
ORIGIN_STATUS
.
id
,
StatusEnum
.
TRAIN1000
.
id
,
"发起培训"
)
;
public
Integer
id
;
/**
* 旧状态
*/
public
Integer
oldStatus
;
/**
* 新状态
*/
public
Integer
newStatus
;
/**
* 执行操作
*/
public
String
operation
;
public
String
getOperation
()
{
return
this
.
operation
;
}
}
dev-config/src/main/java/com/tykj/dev/config/Param.java
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
config
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author dengdiyi
...
...
@@ -11,10 +12,6 @@ public class Param {
/**
* 所有可能存储在业务日志中的参数
*/
private
String
id
;
private
String
age
;
private
String
workOrderNumber
;
private
String
userId
;
private
String
name
;
private
String
email
;
private
String
receiveUnit
;
}
dev-confirmcheck/src/main/java/com/tykj/dev/device/confirmcheck/controller/DeviceCheckController.java
浏览文件 @
5ac46093
...
...
@@ -24,7 +24,7 @@ import com.tykj.dev.device.user.subject.entity.Area;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.entity.User
;
import
com.tykj.dev.device.user.util.AuthenticationUtils
;
import
com.tykj.dev.
misc.base
.GlobalMap
;
import
com.tykj.dev.
config
.GlobalMap
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.JacksonUtil
;
...
...
@@ -142,7 +142,7 @@ public class DeviceCheckController {
TaskBto
provStatTask
=
new
Task
(
CHECK_STAT_0
.
id
,
"省自动核查"
,
0
,
".0."
,
CONFIRM_CHECK_STAT
.
id
,
provStat
.
getId
(),
provUnit
.
getUnitId
())
.
parse2Bto
();
provStatTask
.
setInvolveUserIdList
(
Lists
.
newArrayList
(-
1
));
provStatTask
=
taskService
.
start
(
provStatTask
)
.
parse2Bto
()
;
provStatTask
=
taskService
.
start
(
provStatTask
);
resultIds
.
get
(
"taskId"
).
add
(
provStatTask
.
getId
());
List
<
CheckDeviceStatVo
>
statVoList
=
new
ArrayList
<>();
...
...
@@ -168,7 +168,7 @@ public class DeviceCheckController {
TaskBto
cityStatTask
=
new
Task
(
CHECK_STAT_0
.
id
,
city
.
getName
()
+
"自动核查统计"
,
provStatTask
.
getId
(),
addNode
(
provStatTask
.
getNodeIdDetail
(),
provinceStatDo
.
getId
()),
CONFIRM_CHECK_STAT
.
id
,
cityStat
.
getId
(),
city
.
getUnitId
())
.
parse2Bto
();
cityStatTask
.
setInvolveUserIdList
(
Lists
.
newArrayList
(-
1
));
cityStatTask
=
taskService
.
start
(
cityStatTask
)
.
parse2Bto
()
;
cityStatTask
=
taskService
.
start
(
cityStatTask
);
resultIds
.
get
(
"taskId"
).
add
(
cityStatTask
.
getId
());
// 构建市自查账单
...
...
@@ -189,7 +189,7 @@ public class DeviceCheckController {
statVoList
.
addAll
(
cityStatVoList
);
// 构建市自查TASK
TaskBto
cityDetailTask
=
new
TaskBto
(
CHECK_DETAIL_0
.
id
,
city
.
getName
()
+
"自动核查自查"
,
cityStatTask
.
getId
(),
addNode
(
cityStatTask
.
getNodeIdDetail
(),
cityStatTask
.
getId
()),
CONFIRM_CHECK_DETAIL
.
id
,
cityDetail
.
getId
(),
city
.
getUnitId
(),
0
);
cityDetailTask
=
taskService
.
start
(
cityDetailTask
)
.
parse2Bto
()
;
cityDetailTask
=
taskService
.
start
(
cityDetailTask
);
resultIds
.
get
(
"taskId"
).
add
(
cityDetailTask
.
getId
());
// 构建县任务
...
...
@@ -213,7 +213,7 @@ public class DeviceCheckController {
//构建县自查TASK
TaskBto
countyDetailTask
=
new
TaskBto
(
CHECK_DETAIL_0
.
id
,
county
.
getName
()
+
"自动核查自查"
,
cityStatTask
.
getId
(),
addNode
(
cityStatTask
.
getNodeIdDetail
(),
cityStatTask
.
getId
()),
CONFIRM_CHECK_DETAIL
.
id
,
countyDetail
.
getId
(),
county
.
getUnitId
(),
0
);
countyDetailTask
=
taskService
.
start
(
countyDetailTask
)
.
parse2Bto
()
;
countyDetailTask
=
taskService
.
start
(
countyDetailTask
);
resultIds
.
get
(
"taskId"
).
add
(
countyDetailTask
.
getId
());
}
...
...
@@ -281,7 +281,7 @@ public class DeviceCheckController {
provStatTask
.
getInvolveUserIdList
().
add
(
AuthenticationUtils
.
getAuthentication
().
getCurrentUserInfo
().
getUserId
());
provStatTask
.
getInvolveUserIdList
().
add
(-
1
);
provStatTask
.
setCurrentPoint
(
1
);
provStatTask
=
taskService
.
start
(
provStatTask
)
.
parse2Bto
()
;
provStatTask
=
taskService
.
start
(
provStatTask
);
// 3 构建被查单位的 自查账单 与 自查任务
// 获取所有在库装备与不在库装备
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/controller/DeviceDestroyController.java
浏览文件 @
5ac46093
...
...
@@ -27,6 +27,7 @@ import com.tykj.dev.misc.utils.StringSplitUtil;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -97,18 +98,17 @@ public class DeviceDestroyController {
DeviceDestroyBill
deviceDestroyBillEntitySaved
=
deviceDestroyBillService
.
addEntity
(
destroyBill
);
//生成日志所需的文件列表
ArrayList
<
FileVo
>
billList
=
ListUtil
.
createList
(
new
FileVo
(
"
销毁单据
"
,
deviceDestroyBillEntitySaved
.
getFileName
(),
deviceDestroyBillEntitySaved
.
getFileUrl
())
new
FileVo
(
"
出库确认单
"
,
deviceDestroyBillEntitySaved
.
getFileName
(),
deviceDestroyBillEntitySaved
.
getFileUrl
())
);
//生成装备变更日志
formVo
.
getDevices
().
forEach
(
d
->{
deviceLogService
.
addLog
(
new
DeviceLogDto
(
d
,
"发起销毁"
,
billList
));
deviceLogService
.
addLog
(
new
DeviceLogDto
(
d
,
"销毁待审核"
,
billList
));
});
//生成销毁审核任务
Task
task
=
taskService
.
start
(
initTaskBto
(
deviceDestroyBillEntitySaved
));
Task
Bto
task
=
taskService
.
start
(
initTaskBto
(
deviceDestroyBillEntitySaved
));
//生成任务日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"发起销毁"
,
billList
));
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"销毁待审核"
,
billList
));
//
taskLogService.addLog(new TaskLogBto(task.getId(),"发起销毁",billList));
//
taskLogService.addLog(new TaskLogBto(task.getId(),"销毁待审核",billList));
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"销毁-出库申请成功"
);
}
...
...
@@ -174,10 +174,18 @@ public class DeviceDestroyController {
//初始化需要的数据
TaskBto
task
=
taskService
.
get
(
deviceDestoryConfirmVo
.
getTaskId
());
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillService
.
getOne
(
task
.
getBillId
());
if
(
deviceDestoryConfirmVo
.
getDestroyFileName
()!=
null
){
deviceDestroyBill
.
setDestroyFileName
(
deviceDestoryConfirmVo
.
getDestroyFileName
());
}
if
(
deviceDestoryConfirmVo
.
getDestroyFileUrl
()!=
null
){
deviceDestroyBill
.
setDestroyFileUrl
(
deviceDestoryConfirmVo
.
getDestroyFileUrl
());
}
//判断审核结果 0为审核通过,1为审核不通过
if
(
deviceDestoryConfirmVo
.
getResult
()
==
1
)
{
//更改账单状态
deviceDestroyBill
.
setDestroyStatus
(
DestroyStatus
.
CONFIRM_FAILED
.
getStatus
());
//更新销毁账单
this
.
deviceDestroyBillService
.
updateEntity
(
deviceDestroyBill
);
//将任务推进至封存
taskService
.
moveToArchive
(
task
);
taskService
.
update
(
task
);
...
...
@@ -188,20 +196,21 @@ public class DeviceDestroyController {
deviceDestroyBill
.
setDestroyTime
(
new
Date
());
//为账单新增文号
deviceDestroyBill
.
setDocNumber
(
this
.
deviceDestroyBillService
.
getNewDocNumber
());
//更新销毁账单
this
.
deviceDestroyBillService
.
updateEntity
(
deviceDestroyBill
);
//将任务推进至完结
taskService
.
moveToEnd
(
task
);
taskService
.
update
(
task
);
}
//生成日志所需的文件列表
ArrayList
<
FileVo
>
billList
=
ListUtil
.
createList
(
new
FileVo
(
"标签替换单据"
,
deviceDestroyBill
.
getFileName
(),
deviceDestroyBill
.
getFileUrl
())
deviceDestroyBill
.
getDestroyFileName
()!=
null
&&
deviceDestroyBill
.
getDestroyFileUrl
()!=
null
?
new
FileVo
(
"销毁单据"
,
deviceDestroyBill
.
getDestroyFileName
(),
deviceDestroyBill
.
getDestroyFileUrl
()):
null
);
//更改对应装备的状态为销毁
handleDeviceDetail
(
deviceDestroyBill
,
billList
,
deviceDestoryConfirmVo
.
getResult
());
//更新销毁账单
this
.
deviceDestroyBillService
.
updateEntity
(
deviceDestroyBill
);
//生成任务日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
deviceDestoryConfirmVo
.
getResult
()
==
0
?
"销毁成功"
:
"销毁审核失败"
,
billList
));
// //生成任务日志
// taskLogService.addLog(new TaskLogBto(task.getId(),deviceDestoryConfirmVo.getResult() == 0?"销毁成功":"销毁审核失败",billList));
myWebSocket
.
sendMessage1
();
return
selectDestroyDetail
(
deviceDestroyBill
.
getId
());
}
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/domain/DeviceDestroyBill.java
浏览文件 @
5ac46093
...
...
@@ -68,7 +68,17 @@ public class DeviceDestroyBill {
* 出库附件文件地址URL
*/
@ApiModelProperty
(
value
=
"出库附件文件地址URL"
)
private
String
fileUrl
;
private
String
fileUrl
;
/**
* 出库附件文件名
*/
@ApiModelProperty
(
value
=
"销毁附件文件名"
)
private
String
destroyFileName
;
/**
* 出库附件文件地址URL
*/
@ApiModelProperty
(
value
=
"销毁附件文件地址URL"
)
private
String
destroyFileUrl
;
/**
* 装备销毁出库详情(装备主键id+核对结果(0缺失1无误2新增,字符x作为分隔符)),例如10x21x32,意为主键id为1的装备缺失,为2的无误,为3的新增
*/
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/entity/vo/DeviceDestroyConfirmVo.java
浏览文件 @
5ac46093
...
...
@@ -23,4 +23,10 @@ public class DeviceDestroyConfirmVo {
@NotNull
@ApiModelProperty
(
value
=
"审核结果 0为不通过 1为通过 "
,
example
=
"1"
)
private
Integer
result
;
@ApiModelProperty
(
value
=
"销毁附件文件名"
)
private
String
destroyFileName
;
@ApiModelProperty
(
value
=
"销毁附件文件地址URL"
)
private
String
destroyFileUrl
;
}
dev-library/src/main/java/com/tykj/dev/device/library/subject/vo/DeviceLibrarySaveVo.java
浏览文件 @
5ac46093
...
...
@@ -36,4 +36,7 @@ public class DeviceLibrarySaveVo {
@ApiModelProperty
(
value
=
"是不是单独的配件,0-不是,1-是"
)
private
Integer
isSinglePart
=
0
;
@ApiModelProperty
(
value
=
"货架位置"
)
private
String
position
;
}
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
5ac46093
...
...
@@ -86,12 +86,12 @@ public class MatchingDeviceController {
userIds
.
add
(
userId
);
userIds
.
add
(
matchingDeviceBillSaveVo
.
getUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
,
"新增配套"
,
null
,
"."
,
m
.
getId
(),
19
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
taskEntity1
=
taskService
.
start
(
taskBto
);
Task
Bto
taskEntity1
=
taskService
.
start
(
taskBto
);
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"新增确认单"
,
matchingDeviceBillEntity
.
getFileName
(),
matchingDeviceBillEntity
.
getFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskEntity1
.
getId
(),
"发起新增配套"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskEntity1.getId(),"发起新增配套",fileVoList);
//
taskLogService.addLog(taskLogBto);
for
(
MatchingDeviceSaveVo
matchingDeviceSaveVo:
matchingDeviceBillSaveVo
.
getMatchingDeviceSaveVoList
())
{
MatchingDeviceLibrary
matchingDeviceLibraryEntity
=
matchingDeviceSaveVo
.
toDo
();
MatchingDeviceLibrary
saveEntity
=
matchingDeviceLibraryService
.
addEntity
(
matchingDeviceLibraryEntity
);
...
...
@@ -116,8 +116,8 @@ public class MatchingDeviceController {
if
(
matchingDeviceBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//添加日业务志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"添加配套设备审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "添加配套设备审核成功", null);
//
taskLogService.addLog(taskLogBto);
//更新账单状态
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillService
.
getOne
(
taskBto
.
getBillId
());
matchingDeviceBillEntity
.
setBillStatus
(
2
);
...
...
@@ -140,8 +140,8 @@ public class MatchingDeviceController {
if
(
matchingDeviceBillConfirmVo
.
getStatus
()==
1
){
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//添加日业务志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"添加配套设备审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"添加配套设备审核失败",null);
//
taskLogService.addLog(taskLogBto);
//更新账单状态
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillService
.
getOne
(
taskBto
.
getBillId
());
matchingDeviceBillEntity
.
setBillStatus
(
1
);
...
...
dev-misc/src/main/java/com/tykj/dev/misc/base/StatusEnum.java
浏览文件 @
5ac46093
...
...
@@ -10,7 +10,10 @@ import lombok.AllArgsConstructor;
@AllArgsConstructor
public
enum
StatusEnum
{
/**
* 初始状态
*/
ORIGIN_STATUS
(
0
,
"初始状态"
),
/**
* RFID标签制作
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
5ac46093
...
...
@@ -11,7 +11,6 @@ import com.tykj.dev.device.task.service.TaskLogService;
import
com.tykj.dev.device.task.service.TaskService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskLogBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.task.subject.vo.TaskLogUserVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
...
...
@@ -76,12 +75,12 @@ public class PackingController {
userIds
.
add
(
userId
);
userIds
.
add
(
packingLibrarySaveVo
.
getUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
PACKING_CONFIRM
.
id
,
"列装业务"
,
null
,
"."
,
packingLibraryEntity
.
getId
(),
1
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
saveEntity
=
taskService
.
start
(
taskBto
);
Task
Bto
saveEntity
=
taskService
.
start
(
taskBto
);
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
saveEntity
.
getId
(),
"发起列装"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起列装",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
packingLibrary
Entity
);
return
ResultUtil
.
success
(
save
Entity
);
}
@ApiOperation
(
value
=
"列装审核"
,
notes
=
"可以通过这个接口进行列装审核"
)
...
...
@@ -101,8 +100,8 @@ public class PackingController {
}
packingLibraryService
.
update
(
packingLibraryEntity
);
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"列装审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核成功",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核通过列装成功"
);
}
...
...
@@ -119,8 +118,8 @@ public class PackingController {
}
packingLibraryService
.
update
(
packingLibraryEntity
);
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"列装审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核失败",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"列装审核失败"
);
}
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
device
.
repair
.
controller
;
import
com.tykj.dev.config.GlobalMap
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.service.DeviceChangeService
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
...
...
@@ -119,13 +120,11 @@ public class RepairController {
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
userIds
.
add
(
repairBillSaveVo
.
getStartUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
saveEntity
=
taskService
.
start
(
taskBto
);
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBillSaveVo
.
getFileName
(),
repairBillSaveVo
.
getFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
saveEntity
.
getId
(),
"向"
+
repairBillSaveVo
.
getReceiveUnit
()+
"发起装备维修"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"向"+repairBillSaveVo.getReceiveUnit()+"发起装备维修",fileVoList);
//
taskLogService.addLog(taskLogBto);
deviceRepairSendBillEntity
.
setRepairStatus
(
0
);
deviceRepairSendBillEntity
.
setSendTime
(
new
Date
());
StringBuffer
stringBuffer
=
new
StringBuffer
();
...
...
@@ -159,6 +158,8 @@ public class RepairController {
deviceRepairSendBillEntity
.
setAgent
(
repairBillSaveVo
.
getAgent
());
deviceRepairSendBillEntity
.
setTitle
(
"维修业务"
);
deviceRepairSendBillService
.
addEntity
(
deviceRepairSendBillEntity
);
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
,
"维修业务"
,
null
,
"."
,
repairBill1
.
getId
(),
5
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
TaskBto
saveEntity
=
taskService
.
start
(
taskBto
);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
saveEntity
);
}
...
...
@@ -207,8 +208,8 @@ public class RepairController {
taskService
.
update
(
taskService
.
moveToSpecial
(
taskBto
,
StatusEnum
.
COUNTRY_REPAIRING
,
repairSendBill
.
getStartUseraId
()));
}
//存业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核成功并出库"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并出库",null);
//
taskLogService.addLog(taskLogBto);
//如果当前为省,改变装备的所在为中办
if
(
level
==
1
){
//获取当前业务维修详情
...
...
@@ -302,14 +303,12 @@ public class RepairController {
repairSendBill
.
setRepairUseraId
(
userId
);
taskService
.
addInvolveUser
(
taskBto
,
userId
);
}
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
repairSendBill
.
getBillFileName
(),
repairSendBill
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
repairSendBill
.
getReceiveFileName
(),
repairSendBill
.
getReceiveFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"接收并发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"接收并发起入库",fileVoList);
//
taskLogService.addLog(taskLogBto);
//更新维修单和送修单
repairBill
.
setRepairStatus
(
6
);
repairBill
.
setRepairUserB
(
userPublicService
.
getOne
(
repairReceiveVo
.
getReceiveUserbId
()).
getName
());
...
...
@@ -325,6 +324,8 @@ public class RepairController {
repairSendBill
.
setRepairReciveCheckResult
(
repairReceiveVo
.
getReceiveCheckResult
());
repairSendBill
.
setRepairUserbId
(
repairReceiveVo
.
getReceiveUserbId
());
deviceRepairSendBillService
.
update
(
repairSendBill
);
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
//分隔装备id
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存接收无误的装备id
...
...
@@ -392,8 +393,8 @@ public class RepairController {
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairSendBill
.
getRepairUseraId
()));
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"审核成功并入库维修"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"审核成功并入库维修",null);
//
taskLogService.addLog(taskLogBto);
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
4
);
repairSendBill
.
setRepairStatus
(
5
);
...
...
@@ -425,8 +426,8 @@ public class RepairController {
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修装备入库审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修装备入库审核失败",null);
//
taskLogService.addLog(taskLogBto);
//修改维修单,送修单状态
repairBill
.
setRepairStatus
(
3
);
repairSendBill
.
setRepairStatus
(
4
);
...
...
@@ -519,12 +520,12 @@ public class RepairController {
userIds
.
add
(
userId
);
userIds
.
add
(
repairBackBillSaveVo
.
getStartUserbId
());
TaskBto
taskBto1
=
new
TaskBto
(
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
,
"维修退回"
,
taskBto
.
getId
(),
taskBto
.
getNodeIdDetail
()+
taskBto
.
getId
()+
"."
,
deviceRepairBackBillEntity1
.
getId
(),
BusinessEnum
.
REPAIR_BACK
.
id
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
task
=
taskService
.
start
(
taskBto1
);
Task
Bto
task
=
taskService
.
start
(
taskBto1
);
//添加业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"出库确认单"
,
repairBackBillSaveVo
.
getFileName
(),
repairBackBillSaveVo
.
getFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
task
.
getId
(),
"向"
+
repairBackBillSaveVo
.
getReceiveUnit
()
+
"发起配发"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(task.getId(),"向" + repairBackBillSaveVo.getReceiveUnit() + "发起配发",fileVoList);
//
taskLogService.addLog(taskLogBto);
//添加装备日志
for
(
DeviceDetailVo
d:
repairBackBillSaveVo
.
getDeviceList
())
{
DeviceLogDto
deviceLogDto
=
new
DeviceLogDto
(
d
.
getDeviceId
(),
"向"
+
repairBackBillSaveVo
.
getReceiveUnit
()
+
"退还维修装备"
,
fileVoList
);
...
...
@@ -590,8 +591,8 @@ public class RepairController {
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
));
}
//添加业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修退回审核成功并出库"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修退回审核成功并出库",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"维修退回出库审核通过"
);
}
...
...
@@ -633,9 +634,9 @@ public class RepairController {
repairBackBill
=
deviceRepairBackBillService
.
getOne
(
taskBto
.
getBillId
());
}
else
{
//
获取父任务送修单
TaskBto
taskBto1
=
taskService
.
get
(
taskBto
.
getParentTaskId
()
);
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
taskBto
1
.
getBillId
());
//
结束父任务
taskService
.
moveToEnd
(
taskBto
);
RepairSendBill
repairSendBill
=
deviceRepairSendBillDao
.
findByDeviceRepairBillId
(
taskBto
.
getBillId
());
repairBackBill
=
new
RepairBackBill
();
repairBackBill
.
setSendUnit
(
"中办"
);
repairBackBill
.
setBackCheckDetail
(
repairSendBill
.
getRepairDeviceCheckDetail
());
...
...
@@ -646,8 +647,6 @@ public class RepairController {
repairBackBill
.
setReceiveUseraId
(
userId
);
taskService
.
addInvolveUser
(
taskBto
,
userId
);
}
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"维修单"
,
repairBackBill
.
getBillFileName
(),
repairBackBill
.
getBillFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
repairBackBill
.
getReceiveFileName
(),
repairBackBill
.
getReceiveFileUrl
()));
...
...
@@ -673,9 +672,13 @@ public class RepairController {
TaskLogBto
taskLogBto2
=
new
TaskLogBto
(
taskBto1
.
getId
(),
"维修退回装备接收并发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto2
);
}
else
{
//任务推至下一阶段
taskService
.
update
(
taskService
.
moveToNext
(
taskBto
,
repairReceiveVo
.
getReceiveUserbId
()));
}
//添加业务日志
TaskLogBto
taskLogBto3
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修退回装备接收并发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto3
);
//
TaskLogBto taskLogBto3 = new TaskLogBto(taskBto.getId(),"维修退回装备接收并发起入库",fileVoList);
//
taskLogService.addLog(taskLogBto3);
String
[]
strings
=
deviceIdDetail
.
split
(
"x"
);
//存放正常接收的装备id
List
<
Integer
>
idList
=
new
ArrayList
<>();
...
...
@@ -741,8 +744,8 @@ public class RepairController {
//业务完结
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//存业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修退回装备入库审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修退回装备入库审核成功",null);
//
taskLogService.addLog(taskLogBto);
//更新退回单状态
repairBackBill
.
setBackStatus
(
5
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
...
...
@@ -779,8 +782,8 @@ public class RepairController {
//业务封存
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//存业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"维修退回装备入库审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"维修退回装备入库审核失败",null);
//
taskLogService.addLog(taskLogBto);
//更新退回单状态
repairBackBill
.
setBackStatus
(
4
);
deviceRepairBackBillService
.
update
(
repairBackBill
);
...
...
dev-retired/src/main/java/com/tykj/dev/device/retired/controller/DeviceRetiredController.java
浏览文件 @
5ac46093
...
...
@@ -103,9 +103,9 @@ public class DeviceRetiredController {
DeviceRetiredBill
retiredBill
=
DeviceRetiredBill
.
formVoToBill
(
formVo
,
currentUserInfo
);
retiredBill
=
deviceRetiredBillService
.
addEntity
(
retiredBill
);
//生成Task
Task
task
=
taskService
.
start
(
initTaskBto
(
retiredBill
));
Task
Bto
task
=
taskService
.
start
(
initTaskBto
(
retiredBill
));
//生成任务日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"发起退装"
,
null
));
//
taskLogService.addLog(new TaskLogBto(task.getId(), "发起退装", null));
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"退装申请成功"
);
}
...
...
@@ -160,7 +160,7 @@ public class DeviceRetiredController {
}
}
//生成日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
deviceRetiredConfirmVo
.
getResult
()==
1
?
"退装审核失败"
:
"退装审核成功"
,
null
));
//
taskLogService.addLog(new TaskLogBto(task.getId(),deviceRetiredConfirmVo.getResult()==1?"退装审核失败":"退装审核成功",null));
myWebSocket
.
sendMessage1
();
return
selectDestoryDetail
(
deviceRetiredBillEntity
.
getId
());
}
...
...
dev-rfid/src/main/java/com/tykj/dev/rfid/controller/RfidController.java
浏览文件 @
5ac46093
...
...
@@ -136,9 +136,9 @@ public class RfidController {
deviceLogService
.
addLog
(
new
DeviceLogDto
(
d
.
getDeviceId
(),
"发起标签替换"
,
billList
));
});
//生成Task
Task
task
=
taskService
.
start
(
initTaskBto
(
currentUserInfo
,
rfidChangeBillSaved
));
Task
Bto
task
=
taskService
.
start
(
initTaskBto
(
currentUserInfo
,
rfidChangeBillSaved
));
//生成任务日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
"发起标签替换"
,
billList
));
//
taskLogService.addLog(new TaskLogBto(task.getId(),"发起标签替换",billList));
myWebSocket
.
sendMessage1
();;
return
ResultUtil
.
success
(
"标签修改申请成功"
);
}
...
...
@@ -184,7 +184,7 @@ public class RfidController {
//处理详情和生成日志
handleBillDetail
(
task
,
billList
,
rfidChangeConfirmVo
.
getResult
());
//生成任务变更日志
taskLogService
.
addLog
(
new
TaskLogBto
(
task
.
getId
(),
rfidChangeConfirmVo
.
getResult
()==
0
?
"标签替换审核成功"
:
"标签替换审核失败"
,
billList
));
//
taskLogService.addLog(new TaskLogBto(task.getId(),rfidChangeConfirmVo.getResult()==0?"标签替换审核成功":"标签替换审核失败",billList));
//更新账单
rfidChangeBillService
.
updateEntity
(
rfidChangeBill
);
myWebSocket
.
sendMessage1
();
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
5ac46093
...
...
@@ -169,10 +169,10 @@ public class SelfCheckController {
userIds
.
add
(
userId
);
userIds
.
add
(
selfExaminationBillEntity1
.
getUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
SELF_CHECK_CONFIRM
.
id
,
"自查业务"
,
null
,
"."
,
selfExaminationBillEntity1
.
getId
(),
4
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
saveEntity
=
taskService
.
start
(
taskBto
);
Task
Bto
saveEntity
=
taskService
.
start
(
taskBto
);
//存业务日志
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
saveEntity
.
getId
(),
"发起自查"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起自查",null);
//
taskLogService.addLog(taskLogBto);
//添加装备日志
for
(
String
s:
strings
)
{
if
(
s
.
length
()>=
2
)
{
...
...
@@ -195,8 +195,8 @@ public class SelfCheckController {
//审核通过,改变账单和任务状态,发起确认的任务
if
(
selfCheckConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"自查审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "自查审核成功", null);
//
taskLogService.addLog(taskLogBto);
selfExaminationBillEntity
.
setCheckStatus
(
2
);
selfExaminationBillService
.
update
(
selfExaminationBillEntity
);
for
(
String
s:
strings
)
{
...
...
@@ -212,8 +212,8 @@ public class SelfCheckController {
//审核不通过,改变账单和任务状态
if
(
selfCheckConfirmVo
.
getStatus
()==
1
){
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"自查审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"自查审核失败",null);
//
taskLogService.addLog(taskLogBto);
selfExaminationBillEntity
.
setCheckStatus
(
1
);
selfExaminationBillService
.
update
(
selfExaminationBillEntity
);
for
(
String
s:
strings
)
{
...
...
dev-sendback/src/main/java/com/tykj/dev/device/sendback/service/impl/SendBackServiceImpl.java
浏览文件 @
5ac46093
...
...
@@ -811,7 +811,7 @@ public class SendBackServiceImpl implements SendBackService {
// addJob(task.getId(),task.getBillStatus(),startUserId,null,0,0);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1200
.
id
,
"装备清退"
,
parentTaskId
,
"."
,
billEntity
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
0
,
null
,
integers
))
.
parse2Bto
()
;
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1200
.
id
,
"装备清退"
,
parentTaskId
,
"."
,
billEntity
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
0
,
null
,
integers
));
}
/**
...
...
@@ -847,7 +847,7 @@ public class SendBackServiceImpl implements SendBackService {
// addJob(task.getId(),task.getBillStatus(),startUserId,null,0,0);
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1200
.
id
,
"装备清退"
,
parentTaskId
,
"."
,
billEntity
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
null
,
integers
))
.
parse2Bto
()
;
return
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
SEND_BACK_1200
.
id
,
"装备清退"
,
parentTaskId
,
"."
,
billEntity
.
getId
(),
BusinessEnum
.
SEND_BACK
.
id
,
unitId
,
1
,
null
,
integers
));
}
/**
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
5ac46093
...
...
@@ -127,13 +127,13 @@ public class StorageBillController {
userIds
.
add
(
userId
);
userIds
.
add
(
storageBillSaveVo
.
getReceiveUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
STORAGE_CONFIRM
.
id
,
"入库业务"
,
null
,
"."
,
storageBillEntity
.
getId
(),
2
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
Task
taskEntity1
=
taskService
.
start
(
taskBto
);
Task
Bto
taskEntity1
=
taskService
.
start
(
taskBto
);
//存业务日志
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"配发单"
,
storageBillEntity
.
getFileName
(),
storageBillEntity
.
getFileUrl
()));
fileVoList
.
add
(
new
FileVo
(
"入库确认单"
,
storageBillEntity
.
getReceiveFileName
(),
storageBillEntity
.
getReceiveFileUrl
()));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskEntity1
.
getId
(),
"发起入库"
,
fileVoList
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskEntity1.getId(),"发起入库",fileVoList);
//
taskLogService.addLog(taskLogBto);
//3.存装备
Integer
parentId
=
null
;
for
(
DeviceLibrarySaveVo
d:
storageBillSaveVo
.
getDeviceLibrarySaveVoList
())
{
...
...
@@ -181,8 +181,8 @@ public class StorageBillController {
//1.审核成功,入库任务结束,发起新的确认任务,改变装备状态
if
(
storageBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"入库审核成功"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "入库审核成功", null);
//
taskLogService.addLog(taskLogBto);
StorageBill
storageBillEntity
=
storageBillService
.
getOne
(
taskBto
.
getBillId
());
storageBillEntity
.
setStorageStatus
(
2
);
storageBillService
.
update
(
storageBillEntity
);
...
...
@@ -199,8 +199,8 @@ public class StorageBillController {
//2.审核失败
if
(
storageBillConfirmVo
.
getStatus
()==
1
){
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
taskBto
.
getId
(),
"入库审核失败"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"入库审核失败",null);
//
taskLogService.addLog(taskLogBto);
StorageBill
storageBillEntity
=
storageBillService
.
getOne
(
taskBto
.
getBillId
());
storageBillEntity
.
setStorageStatus
(
1
);
storageBillService
.
update
(
storageBillEntity
);
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/TaskService.java
浏览文件 @
5ac46093
...
...
@@ -79,7 +79,7 @@ public interface TaskService {
/**
* 新增Task
*/
Task
start
(
TaskBto
taskBto
);
Task
Bto
start
(
TaskBto
taskBto
);
/**
* 更新Task
*/
...
...
dev-task/src/main/java/com/tykj/dev/device/task/service/impl/TaskServiceImpl.java
浏览文件 @
5ac46093
...
...
@@ -2,6 +2,7 @@ package com.tykj.dev.device.task.service.impl;
import
com.github.wenhao.jpa.PredicateBuilder
;
import
com.github.wenhao.jpa.Specifications
;
import
com.tykj.dev.config.Log
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.repository.TaskLogDao
;
import
com.tykj.dev.device.task.service.TaskService
;
...
...
@@ -13,7 +14,7 @@ import com.tykj.dev.device.task.subject.vo.TaskUserVo;
import
com.tykj.dev.device.task.utils.TaskUtils
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.
misc.base
.GlobalMap
;
import
com.tykj.dev.
config
.GlobalMap
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.ResultUtil
;
...
...
@@ -54,6 +55,7 @@ public class TaskServiceImpl implements TaskService {
* <li>不指定待办用户</li>
*/
@Override
@Log
public
TaskBto
moveToNext
(
TaskBto
taskBto
)
{
//status++
taskBto
.
setBillStatus
(
GlobalMap
.
getStatusEnumMap
().
getOrDefault
(
taskBto
.
getBillStatus
()
+
1
,
StatusEnum
.
END
).
id
);
...
...
@@ -73,6 +75,7 @@ public class TaskServiceImpl implements TaskService {
* @param customInfo 自定义信息
*/
@Override
@Log
public
TaskBto
moveToNext
(
TaskBto
taskBto
,
String
customInfo
)
{
//status++
taskBto
.
setBillStatus
(
GlobalMap
.
getStatusEnumMap
().
getOrDefault
(
taskBto
.
getBillStatus
()
+
1
,
StatusEnum
.
END
).
id
);
...
...
@@ -93,6 +96,7 @@ public class TaskServiceImpl implements TaskService {
* @param userId 待办用户Id
*/
@Override
@Log
public
TaskBto
moveToNext
(
TaskBto
taskBto
,
Integer
userId
)
{
//status++
taskBto
.
setBillStatus
(
GlobalMap
.
getStatusEnumMap
().
getOrDefault
(
taskBto
.
getBillStatus
()
+
1
,
StatusEnum
.
END
).
id
);
...
...
@@ -113,6 +117,7 @@ public class TaskServiceImpl implements TaskService {
* @param customInfo 自定义信息
*/
@Override
@Log
public
TaskBto
moveToNext
(
TaskBto
taskBto
,
Integer
userId
,
String
customInfo
)
{
//status++
taskBto
.
setBillStatus
(
GlobalMap
.
getStatusEnumMap
().
getOrDefault
(
taskBto
.
getBillStatus
()
+
1
,
StatusEnum
.
END
).
id
);
...
...
@@ -132,6 +137,7 @@ public class TaskServiceImpl implements TaskService {
* @param statusEnum 状态枚举
*/
@Override
@Log
public
TaskBto
moveToSpecial
(
TaskBto
taskBto
,
StatusEnum
statusEnum
)
{
//status++
taskBto
.
setBillStatus
(
statusEnum
.
id
);
...
...
@@ -152,6 +158,7 @@ public class TaskServiceImpl implements TaskService {
* @param customInfo 自定义信息
*/
@Override
@Log
public
TaskBto
moveToSpecial
(
TaskBto
taskBto
,
StatusEnum
statusEnum
,
String
customInfo
)
{
//status++
taskBto
.
setBillStatus
(
statusEnum
.
id
);
...
...
@@ -173,6 +180,7 @@ public class TaskServiceImpl implements TaskService {
* @param userId 待办用户Id
*/
@Override
@Log
public
TaskBto
moveToSpecial
(
TaskBto
taskBto
,
StatusEnum
statusEnum
,
Integer
userId
)
{
//status++
taskBto
.
setBillStatus
(
statusEnum
.
id
);
...
...
@@ -194,6 +202,7 @@ public class TaskServiceImpl implements TaskService {
* @param customInfo 自定义信息
*/
@Override
@Log
public
TaskBto
moveToSpecial
(
TaskBto
taskBto
,
StatusEnum
statusEnum
,
Integer
userId
,
String
customInfo
)
{
//status++
taskBto
.
setBillStatus
(
statusEnum
.
id
);
...
...
@@ -212,6 +221,7 @@ public class TaskServiceImpl implements TaskService {
* 业务完结
*/
@Override
@Log
public
TaskBto
moveToEnd
(
TaskBto
taskBto
)
{
//set status end
taskBto
.
setBillStatus
(
StatusEnum
.
END
.
id
);
...
...
@@ -223,6 +233,7 @@ public class TaskServiceImpl implements TaskService {
* 业务审核失败封存
*/
@Override
@Log
public
TaskBto
moveToArchive
(
TaskBto
taskBto
)
{
//set status archive
taskBto
.
setBillStatus
(
StatusEnum
.
ARCHIVE
.
id
);
...
...
@@ -235,8 +246,10 @@ public class TaskServiceImpl implements TaskService {
*/
@Override
@ExceptionHandler
(
Exception
.
class
)
public
Task
start
(
TaskBto
taskBto
)
{
return
taskDao
.
save
(
taskBto
.
toDo
());
@Log
public
TaskBto
start
(
TaskBto
taskBto
)
{
Task
task
=
taskDao
.
save
(
taskBto
.
toDo
());
return
task
.
parse2Bto
();
}
/**
...
...
dev-task/src/main/java/com/tykj/dev/device/task/subject/bto/TaskBto.java
浏览文件 @
5ac46093
...
...
@@ -4,7 +4,7 @@ import com.tykj.dev.device.task.subject.domin.Task;
import
com.tykj.dev.device.task.subject.vo.TaskUserVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
com.tykj.dev.
misc.base
.GlobalMap
;
import
com.tykj.dev.
config
.GlobalMap
;
import
com.tykj.dev.misc.utils.SpringUtils
;
import
com.tykj.dev.misc.utils.StringSplitUtil
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
dev-train/src/main/java/com/tykj/dev/device/train/controller/TrainJobController.java
浏览文件 @
5ac46093
...
...
@@ -92,7 +92,7 @@ public class TrainJobController {
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
Task
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1000
.
id
,
trainTheme
.
getName
(),
null
,
null
,
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
Task
Bto
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1000
.
id
,
trainTheme
.
getName
(),
null
,
null
,
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
//1 新建培训
// jobService.addEntity(new JobEntity(taskEntity.getId(),1,39,0,"x"+securityUser.getCurrentUserInfo().getUserId()+"x",0));
...
...
@@ -125,8 +125,8 @@ public class TrainJobController {
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
TRAIN1002
.
id
,
trainTheme
.
getName
(),
task
.
getId
(),
task
.
getId
().
toString
(),
trainTheme
.
getTrainId
(),
BusinessEnum
.
TRAIN
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
list
));
}
);
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
task
.
getId
(),
"发起培训"
,
null
);
taskLogService
.
addLog
(
taskLogBto
);
//
TaskLogBto taskLogBto = new TaskLogBto(task.getId(),"发起培训",null);
//
taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
trainTheme
);
}
...
...
dev-train/src/main/java/com/tykj/dev/device/train/service/impl/WorkHandoverServiceImpl.java
浏览文件 @
5ac46093
...
...
@@ -53,7 +53,7 @@ public class WorkHandoverServiceImpl implements WorkHandoverService {
WorkHandover
workHandover
=
workHandoverDao
.
save
(
workHandoverAddVo
.
toWorkHandover
());
List
<
Integer
>
integers
=
new
ArrayList
<>();
integers
.
add
(
securityUser
.
getCurrentUserInfo
().
getUserId
());
Task
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
Task
Bto
task
=
taskService
.
start
(
new
TaskBto
(
StatusEnum
.
WORKHANDOVER1011
.
id
,
"工作交接"
,
null
,
null
,
workHandover
.
getWorkHandoverId
(),
BusinessEnum
.
WORK_HANDOVER
.
id
,
securityUser
.
getCurrentUserInfo
().
getUnitsId
(),
0
,
null
,
integers
));
return
workHandover
;
}
...
...
dev-union/src/main/java/com/tykj/dev/union/LogAspect.java
0 → 100644
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
union
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.tykj.dev.config.GlobalMap
;
import
com.tykj.dev.config.Log
;
import
com.tykj.dev.config.Param
;
import
com.tykj.dev.config.LogType
;
import
com.tykj.dev.device.allot.repository.AllotBillDao
;
import
com.tykj.dev.device.allot.service.AllotBillService
;
import
com.tykj.dev.device.allot.subject.domin.AllotBill
;
import
com.tykj.dev.device.apply.service.DeviceApplyBillService
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckBillEntity
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckDetailEntity
;
import
com.tykj.dev.device.confirmcheck.entity.domain.DeviceCheckStat
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckBillDao
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckDetailDao
;
import
com.tykj.dev.device.confirmcheck.repository.DeviceCheckStatRepo
;
import
com.tykj.dev.device.destroy.entity.domain.DeviceDestroyBill
;
import
com.tykj.dev.device.destroy.service.DeviceDestroyBillService
;
import
com.tykj.dev.device.library.subject.vo.FileVo
;
import
com.tykj.dev.device.library.subject.vo.LogVo
;
import
com.tykj.dev.device.matching.service.MatchingDeviceBillService
;
import
com.tykj.dev.device.matching.service.MatchingDeviceLibraryService
;
import
com.tykj.dev.device.matching.subject.domin.MatchingDeviceBill
;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.repair.repository.RepairBackBillDao
;
import
com.tykj.dev.device.repair.repository.RepairSendBillDao
;
import
com.tykj.dev.device.repair.service.RepairBillService
;
import
com.tykj.dev.device.repair.service.RepairSendBillService
;
import
com.tykj.dev.device.repair.subject.domin.RepairBackBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairBill
;
import
com.tykj.dev.device.repair.subject.domin.RepairSendBill
;
import
com.tykj.dev.device.retired.entity.domain.DeviceRetiredBill
;
import
com.tykj.dev.device.retired.service.DeviceRetiredBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.sendback.entity.domain.SendBackBill
;
import
com.tykj.dev.device.sendback.repository.SendBackBillDao
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
import
com.tykj.dev.device.storage.subject.domin.StorageBill
;
import
com.tykj.dev.device.task.service.TaskLogService
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskLogBto
;
import
com.tykj.dev.device.train.dao.TrainThemeDao
;
import
com.tykj.dev.device.train.dao.WorkHandoverDao
;
import
com.tykj.dev.device.train.entity.TrainTheme
;
import
com.tykj.dev.device.train.entity.WorkHandover
;
import
com.tykj.dev.device.train.service.TrainThemeService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BeanHelper
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.utils.SpringUtils
;
import
com.tykj.dev.rfid.entity.domin.RfidChangeBill
;
import
com.tykj.dev.rfid.service.RfidChangeBillService
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.modelmapper.ModelMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletResponse
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.util.*
;
/**
* 业务操作日志aop
* @author dengdiyi
*/
@Aspect
@Component
public
class
LogAspect
{
@Autowired
private
TaskLogService
taskLogService
;
@Autowired
private
UserUtils
userUtils
;
/**
* 所有参数
*/
private
Object
[]
args
;
/**
* 输入参数Task
*/
private
TaskBto
inputTask
=
new
TaskBto
();
/**
* 输出参数Task
*/
private
TaskBto
outPutTask
;
/**
* 日志操作描述
*/
private
String
opreation
;
/**
* 参数类
*/
private
Param
params
;
/**
* 业务类型
*/
private
Integer
businessType
;
/**
* 日志附件信息
*/
private
List
<
FileVo
>
fileVos
=
new
ArrayList
<>();
/**
* 业务旧状态
*/
private
Integer
oldStatus
;
/**
* 业务新状态
*/
private
Integer
newStatus
;
/**
* 业务账单中的所有参数名
*/
private
List
<
String
>
paramNames
=
new
ArrayList
<>();
/**
* 业务操作日志定义切入点
*/
@Pointcut
(
"@annotation(com.tykj.dev.config.Log)"
)
public
void
operationLog
(){
}
/**
* 方法执行前触发
*/
@Before
(
value
=
"operationLog()"
)
public
void
doBefore
(
JoinPoint
point
){
//获取旧Task状态
this
.
args
=
point
.
getArgs
();
//找到输入的taskBto
for
(
Object
o:
this
.
args
)
{
if
(
"com.tykj.dev.device.task.subject.bto.TaskBto"
.
equals
(
o
.
getClass
().
getName
())){
ModelMapper
modelMapper
=
BeanHelper
.
getUserMapper
();
modelMapper
.
map
(
o
,
this
.
inputTask
);
this
.
oldStatus
=
this
.
inputTask
.
getBillStatus
();
break
;
}
}
}
/**
* 新增结果返回后触发
*/
@AfterReturning
(
returning
=
"returnValue"
,
pointcut
=
"operationLog() && @annotation(log)"
)
public
void
doAfterReturning
(
JoinPoint
point
,
Object
returnValue
,
Log
log
)
{
try
{
//输出的taskBto
this
.
outPutTask
=
(
TaskBto
)
returnValue
;
this
.
businessType
=
this
.
outPutTask
.
getBusinessType
();
this
.
newStatus
=
this
.
outPutTask
.
getBillStatus
();
if
(
this
.
inputTask
.
getId
()!=
null
)
{
for
(
LogType
l:
LogType
.
values
()){
if
(
l
.
oldStatus
.
equals
(
oldStatus
)&&
l
.
newStatus
.
equals
(
newStatus
)){
this
.
opreation
=
l
.
getOperation
();
break
;
}
}
}
else
{
this
.
oldStatus
=
0
;
for
(
LogType
l:
LogType
.
values
()){
if
(
l
.
oldStatus
==
0
&&
l
.
newStatus
.
equals
(
newStatus
)){
this
.
opreation
=
l
.
getOperation
();
break
;
}
}
}
params
=
new
Param
();
//获取账单的所有属性名称
this
.
getBillParam
();
if
(!
opreation
.
isEmpty
())
{
// 将模板中的参数全部替换掉
opreation
=
this
.
replaceParam
(
opreation
);
}
TaskLogBto
taskLogBto
=
new
TaskLogBto
(
this
.
outPutTask
.
getId
(),
this
.
opreation
,
this
.
fileVos
);
taskLogService
.
addLog
(
taskLogBto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 将模板中的预留字段全部替换为拦截到的参数
*/
private
String
replaceParam
(
String
template
)
{
// 将模板中的需要替换的参数转化成map
Map
<
String
,
String
>
paramsMap
=
this
.
convertToMap
(
template
);
for
(
String
key
:
paramsMap
.
keySet
())
{
template
=
template
.
replace
(
"%"
+
key
,
paramsMap
.
get
(
key
)).
replace
(
"("
,
""
).
replace
(
")"
,
""
);
}
return
template
;
}
/**
* 将模板中的参数转换成map的key-value形式
*/
private
Map
<
String
,
String
>
convertToMap
(
String
template
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
String
[]
arr
=
template
.
split
(
"\\("
);
for
(
String
s
:
arr
)
{
if
(
s
.
contains
(
"%"
))
{
String
key
=
s
.
substring
(
s
.
indexOf
(
"%"
),
s
.
indexOf
(
")"
)).
replace
(
"%"
,
""
).
replace
(
")"
,
""
).
replace
(
"-"
,
""
).
replace
(
"]"
,
""
);
String
value
=
this
.
getParam
(
this
.
params
,
key
);
map
.
put
(
key
,
"null"
.
equals
(
value
)
?
"(空)"
:
value
);
}
}
return
map
;
}
/**
* 通过反射获取传入的类中对应key的值
*/
private
<
T
>
String
getParam
(
T
targetClass
,
String
key
)
{
String
value
=
""
;
try
{
Method
targetClassParamGetMethod
=
targetClass
.
getClass
().
getMethod
(
"get"
+
this
.
setFirstLetterUpperCase
(
key
));
value
=
String
.
valueOf
(
targetClassParamGetMethod
.
invoke
(
targetClass
));
}
catch
(
NoSuchMethodException
|
IllegalAccessException
|
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
return
value
;
}
/**
* 将字符串的首字母大写
*/
private
String
setFirstLetterUpperCase
(
String
str
)
{
if
(
str
==
null
)
{
return
null
;
}
return
str
.
substring
(
0
,
1
).
toUpperCase
()
+
str
.
substring
(
1
);
}
/**
* 获取业务对应账单的参数
*/
private
void
getBillParam
(){
//获取账单
switch
(
this
.
businessType
){
case
1
:
PackingLibraryService
packingLibraryService
=
SpringUtils
.
getBean
(
"packingLibraryServiceImpl"
);
if
(
packingLibraryService
!=
null
)
{
getFieldsParam
(
packingLibraryService
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
2
:
StorageBillService
storageBillService
=
SpringUtils
.
getBean
(
"storageBillServiceImpl"
);
if
(
storageBillService
!=
null
)
{
StorageBill
storageBill
=
storageBillService
.
getOne
(
outPutTask
.
getBillId
());
getFieldsParam
(
storageBill
);
if
(
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
PACKING_CONFIRM
.
id
)){
this
.
fileVos
.
add
(
new
FileVo
(
"配发单"
,
storageBill
.
getFileName
(),
storageBill
.
getFileUrl
()));
this
.
fileVos
.
add
(
new
FileVo
(
"入库确认单"
,
storageBill
.
getReceiveFileName
(),
storageBill
.
getReceiveFileUrl
()));
}
}
break
;
case
3
:
AllotBillService
allotBillService
=
SpringUtils
.
getBean
(
"allotBillServiceImpl"
);
if
(
allotBillService
!=
null
)
{
AllotBill
allotBill
=
allotBillService
.
getOne
(
outPutTask
.
getBillId
());
getFieldsParam
(
allotBill
);
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
))
||(
this
.
oldStatus
.
equals
(
StatusEnum
.
WAIT_ALLOT
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
ALLOT_SEND_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"出库确认单"
,
allotBill
.
getFileName
(),
allotBill
.
getFileUrl
()));
}
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ALLOTING
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
ALLOT_RECEIVE_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"配发单"
,
allotBill
.
getBillFileName
(),
allotBill
.
getBillFileUrl
()));
this
.
fileVos
.
add
(
new
FileVo
(
"入库确认单"
,
allotBill
.
getReceiveFileName
(),
allotBill
.
getReceiveFileUrl
()));
}
}
break
;
case
4
:
SelfCheckBillService
selfCheckBillService
=
SpringUtils
.
getBean
(
"selfCheckBillServiceImpl"
);
if
(
selfCheckBillService
!=
null
)
{
getFieldsParam
(
selfCheckBillService
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
5
:
RepairBillService
repairBillService
=
SpringUtils
.
getBean
(
"repairBillServiceImpl"
);
RepairSendBillDao
repairSendBillDao
=
SpringUtils
.
getBean
(
"repairSendBillDao"
);
if
(
repairBillService
!=
null
&&
repairSendBillDao
!=
null
)
{
RepairBill
repairBill
=
repairBillService
.
getOne
(
outPutTask
.
getBillId
());
RepairSendBill
repairSendBill
=
repairSendBillDao
.
findByDeviceRepairBillId
(
repairBill
.
getId
());
getFieldsParam
(
repairBillService
.
getOne
(
outPutTask
.
getBillId
()));
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
REPAIR_SEND_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"出库确认单"
,
repairSendBill
.
getFileName
(),
repairSendBill
.
getFileUrl
()));
}
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
WAIT_RECEIVE
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
REPAIR_RECEIVE_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"维修单"
,
repairSendBill
.
getBillFileName
(),
repairSendBill
.
getBillFileUrl
()));
this
.
fileVos
.
add
(
new
FileVo
(
"入库确认单"
,
repairSendBill
.
getReceiveFileName
(),
repairSendBill
.
getReceiveFileUrl
()));
}
}
break
;
case
6
:
DeviceCheckBillDao
deviceCheckBillDao
=
SpringUtils
.
getBean
(
"deviceCheckBillDao"
);
if
(
deviceCheckBillDao
!=
null
)
{
getFieldsParam
(
deviceCheckBillDao
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
7
:
DeviceCheckStatRepo
deviceCheckStatRepo
=
SpringUtils
.
getBean
(
"deviceCheckStatRepo"
);
if
(
deviceCheckStatRepo
!=
null
)
{
getFieldsParam
(
deviceCheckStatRepo
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
8
:
DeviceCheckDetailDao
deviceCheckDetailDao
=
SpringUtils
.
getBean
(
"deviceCheckDetailDao"
);
if
(
deviceCheckDetailDao
!=
null
)
{
getFieldsParam
(
deviceCheckDetailDao
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
9
:
DeviceApplyBillService
deviceApplyBillService
=
SpringUtils
.
getBean
(
"deviceApplyBillServiceImpl"
);
if
(
deviceApplyBillService
!=
null
)
{
getFieldsParam
(
deviceApplyBillService
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
10
:
RepairBackBillDao
repairBackBillDao
=
SpringUtils
.
getBean
(
"repairBackBillDao"
);
if
(
repairBackBillDao
!=
null
)
{
RepairBackBill
repairBackBill
=
repairBackBillDao
.
getOne
(
outPutTask
.
getBillId
());
getFieldsParam
(
repairBackBill
);
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
REPAIR_BACK_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"出库确认单"
,
repairBackBill
.
getFileName
(),
repairBackBill
.
getFileUrl
()));
}
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
WAIT_BACK_RECEIVE
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
REPAIR_BACK_RECEIVE_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"维修单"
,
repairBackBill
.
getBillFileName
(),
repairBackBill
.
getBillFileUrl
()));
this
.
fileVos
.
add
(
new
FileVo
(
"入库确认单"
,
repairBackBill
.
getReceiveFileName
(),
repairBackBill
.
getReceiveFileUrl
()));
}
}
break
;
case
13
:
TrainThemeDao
trainThemeDao
=
SpringUtils
.
getBean
(
"trainThemeDao"
);
if
(
trainThemeDao
!=
null
)
{
getFieldsParam
(
trainThemeDao
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
14
:
DeviceDestroyBillService
deviceDestroyBillService
=
SpringUtils
.
getBean
(
"deviceDestroyBillServiceImpl"
);
if
(
deviceDestroyBillService
!=
null
)
{
DeviceDestroyBill
deviceDestroyBill
=
deviceDestroyBillService
.
getOne
(
outPutTask
.
getBillId
());
getFieldsParam
(
deviceDestroyBill
);
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
DESTROY_BUSINESS_NEED_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"出库确认单"
,
deviceDestroyBill
.
getFileName
(),
deviceDestroyBill
.
getFileUrl
()));
}
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
DESTROY_BUSINESS_NEED_CONFIRM
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
END
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"销毁单"
,
deviceDestroyBill
.
getDestroyFileName
(),
deviceDestroyBill
.
getDestroyFileUrl
()));
}
}
break
;
case
15
:
DeviceRetiredBillService
deviceRetiredBillService
=
SpringUtils
.
getBean
(
"deviceRetiredBillServiceImpl"
);
if
(
deviceRetiredBillService
!=
null
)
{
getFieldsParam
(
deviceRetiredBillService
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
16
:
SendBackBillDao
sendBackBillDao
=
SpringUtils
.
getBean
(
"sendBackBillDao"
);
if
(
sendBackBillDao
!=
null
)
{
getFieldsParam
(
sendBackBillDao
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
19
:
MatchingDeviceBillService
matchingDeviceBillService
=
SpringUtils
.
getBean
(
"matchingDeviceBillServiceImpl"
);
if
(
matchingDeviceBillService
!=
null
)
{
MatchingDeviceBill
matchingDeviceBill
=
matchingDeviceBillService
.
getOne
(
outPutTask
.
getBillId
());
getFieldsParam
(
matchingDeviceBill
);
if
((
this
.
oldStatus
.
equals
(
StatusEnum
.
ORIGIN_STATUS
.
id
)&&
this
.
newStatus
.
equals
(
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
))){
this
.
fileVos
.
add
(
new
FileVo
(
"新增确认单"
,
matchingDeviceBill
.
getFileName
(),
matchingDeviceBill
.
getFileUrl
()));
}
}
break
;
case
20
:
RfidChangeBillService
rfidChangeBillService
=
SpringUtils
.
getBean
(
"rfidChangeBillServiceImpl"
);
if
(
rfidChangeBillService
!=
null
)
{
getFieldsParam
(
rfidChangeBillService
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
case
21
:
WorkHandoverDao
workHandoverDao
=
SpringUtils
.
getBean
(
"workHandoverDao"
);
if
(
workHandoverDao
!=
null
)
{
getFieldsParam
(
workHandoverDao
.
getOne
(
outPutTask
.
getBillId
()));
}
break
;
default
:
break
;
}
}
/**
* 遍历账单实体类名称并添加到paramNames
*/
private
<
T
>
void
getFieldsParam
(
T
target
)
{
Field
[]
fields
=
target
.
getClass
().
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
paramNames
.
add
(
field
.
getName
());
String
paramName
=
field
.
getName
();
if
(
this
.
isExist
(
paramName
))
{
String
value
=
this
.
getParam
(
target
,
paramName
);
this
.
setParam
(
this
.
params
,
paramName
,
value
);
}
}
}
/**
* 判断该参数在参数类中是否存在(是否是需要记录的参数)
*/
private
<
T
>
Boolean
isExist
(
String
name
)
{
boolean
exist
=
true
;
try
{
String
key
=
this
.
setFirstLetterUpperCase
(
name
);
Method
targetClassGetMethod
=
this
.
params
.
getClass
().
getMethod
(
"get"
+
key
);
}
catch
(
Exception
e
)
{
exist
=
false
;
}
return
exist
;
}
/**
* 将数据写入参数类的实例中
*/
private
<
T
>
void
setParam
(
T
targetClass
,
String
key
,
String
value
)
{
try
{
Method
targetClassParamSetMethod
=
targetClass
.
getClass
().
getMethod
(
"set"
+
this
.
setFirstLetterUpperCase
(
key
),
String
.
class
);
targetClassParamSetMethod
.
invoke
(
targetClass
,
value
);
}
catch
(
NoSuchMethodException
|
IllegalAccessException
|
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
}
}
dev-union/src/main/java/com/tykj/dev/union/UnionApplication.java
浏览文件 @
5ac46093
package
com
.
tykj
.
dev
.
union
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.data.jpa.repository.config.EnableJpaAuditing
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.util.Arrays
;
@SpringBootApplication
(
scanBasePackages
=
"com.tykj.dev.*"
)
@EnableSwagger2
@ServletComponentScan
...
...
@@ -24,4 +29,19 @@ public class UnionApplication extends SpringBootServletInitializer {
SpringApplication
.
run
(
UnionApplication
.
class
,
args
);
}
// @Bean
// public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
// return args -> {
//
// System.out.println("Let's inspect the beans provided by Spring Boot:");
//
// String[] beanNames = ctx.getBeanDefinitionNames();
// Arrays.sort(beanNames);
// for (String beanName : beanNames) {
// System.out.println(beanName);
// }
//
// };
// }
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论