Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
75285542
提交
75285542
authored
9月 30, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[维修模块]修改维修task强转bug
上级
9d175f61
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
102 行增加
和
6 行删除
+102
-6
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+6
-0
DeviceLibraryService.java
...tykj/dev/device/library/service/DeviceLibraryService.java
+5
-0
DeviceLibraryServiceImpl.java
...device/library/service/impl/DeviceLibraryServiceImpl.java
+15
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+1
-2
SelfCheckSchedulerTask.java
...ykj/dev/device/selfcheck/base/SelfCheckSchedulerTask.java
+5
-4
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+47
-0
TaskSelectController.java
...ev/device/taskselect/controller/TaskSelectController.java
+23
-0
没有找到文件。
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
75285542
...
@@ -95,6 +95,12 @@ public class DeviceLibraryController {
...
@@ -95,6 +95,12 @@ public class DeviceLibraryController {
return
ResultUtil
.
success
(
deviceLibraryService
.
getAllName
());
return
ResultUtil
.
success
(
deviceLibraryService
.
getAllName
());
}
}
@ApiOperation
(
value
=
"查询在库的装备所有型号"
,
notes
=
"可以通过这个接口查询在库的装备所有型号"
)
@GetMapping
(
"/select/libraray/models"
)
public
ResponseEntity
selectLibraryModels
()
{
return
ResultUtil
.
success
(
deviceLibraryService
.
getAllInLibraryModels
());
}
@ApiOperation
(
value
=
"模糊查询标签管理装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@ApiOperation
(
value
=
"模糊查询标签管理装备分页"
,
notes
=
"可以通过这个接口查询装备列表"
)
@PostMapping
(
"/selectTagDevicePage"
)
@PostMapping
(
"/selectTagDevicePage"
)
public
ResponseEntity
selectTagDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
ResponseEntity
selectTagDevicePage
(
@RequestBody
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
...
...
dev-library/src/main/java/com/tykj/dev/device/library/service/DeviceLibraryService.java
浏览文件 @
75285542
...
@@ -109,4 +109,9 @@ public interface DeviceLibraryService {
...
@@ -109,4 +109,9 @@ public interface DeviceLibraryService {
* 查询拥有装备的所有单位
* 查询拥有装备的所有单位
*/
*/
List
<
String
>
getAllUnit
();
List
<
String
>
getAllUnit
();
/**
* 查询在库所有装备的型号
*/
List
<
String
>
getAllInLibraryModels
();
}
}
dev-library/src/main/java/com/tykj/dev/device/library/service/impl/DeviceLibraryServiceImpl.java
浏览文件 @
75285542
...
@@ -294,6 +294,20 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -294,6 +294,20 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
return
new
ArrayList
<>(
s
);
return
new
ArrayList
<>(
s
);
}
}
/**
* 查询在库所有装备的型号
*/
@Override
public
List
<
String
>
getAllInLibraryModels
()
{
List
<
DeviceLibrary
>
deviceLibraryEntities
=
deviceLibraryDao
.
findAll
(
getAllotSelectSpecification
(
new
DeviceLibrarySelectVo
()));
//用Set存装备型号,排除重复名称
Set
<
String
>
s
=
new
HashSet
<>();
for
(
DeviceLibrary
d:
deviceLibraryEntities
)
{
s
.
add
(
d
.
getModel
());
}
return
new
ArrayList
<>(
s
);
}
@Override
@Override
public
List
<
DeviceLibrary
>
getAllList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
public
List
<
DeviceLibrary
>
getAllList
(
DeviceLibrarySelectVo
deviceLibrarySelectVo
)
{
return
deviceLibraryDao
.
findAll
(
getSelectSpecification4
(
deviceLibrarySelectVo
));
return
deviceLibraryDao
.
findAll
(
getSelectSpecification4
(
deviceLibrarySelectVo
));
...
@@ -382,6 +396,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
...
@@ -382,6 +396,7 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
deviceLibrarySelectVo
);
PredicateBuilder
<
DeviceLibrary
>
predicateBuilder
=
getPredicateBuilder
(
deviceLibrarySelectVo
);
String
unit
=
userUtils
.
getCurrentUserUnitName
();
String
unit
=
userUtils
.
getCurrentUserUnitName
();
predicateBuilder
.
eq
(
"ownUnit"
,
unit
);
predicateBuilder
.
eq
(
"ownUnit"
,
unit
);
predicateBuilder
.
eq
(
"locationUnit"
,
unit
);
predicateBuilder
.
eq
(
"lifeStatus"
,
2
);
predicateBuilder
.
eq
(
"lifeStatus"
,
2
);
return
predicateBuilder
.
build
();
return
predicateBuilder
.
build
();
}
}
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
75285542
...
@@ -173,8 +173,7 @@ public class RepairController {
...
@@ -173,8 +173,7 @@ public class RepairController {
public
ResponseEntity
continueCreateRepair
(
@RequestBody
RepairBillSaveVo
deviceRepairBillSaveVo
)
{
public
ResponseEntity
continueCreateRepair
(
@RequestBody
RepairBillSaveVo
deviceRepairBillSaveVo
)
{
ResponseEntity
responseEntity
=
createRepair
(
deviceRepairBillSaveVo
);
ResponseEntity
responseEntity
=
createRepair
(
deviceRepairBillSaveVo
);
ResultObj
resultObj
=
(
ResultObj
)
responseEntity
.
getBody
();
ResultObj
resultObj
=
(
ResultObj
)
responseEntity
.
getBody
();
Task
task
=
(
Task
)
Objects
.
requireNonNull
(
resultObj
).
getData
();
TaskBto
taskBto
=
(
TaskBto
)
Objects
.
requireNonNull
(
resultObj
).
getData
();
TaskBto
taskBto
=
task
.
parse2Bto
();
TaskBto
parentTask
=
taskService
.
get
(
deviceRepairBillSaveVo
.
getTaskId
());
TaskBto
parentTask
=
taskService
.
get
(
deviceRepairBillSaveVo
.
getTaskId
());
taskBto
.
setParentTaskId
(
parentTask
.
getId
());
taskBto
.
setParentTaskId
(
parentTask
.
getId
());
taskBto
.
setNodeIdDetail
(
parentTask
.
getNodeIdDetail
()
+
deviceRepairBillSaveVo
.
getTaskId
()
+
"."
);
taskBto
.
setNodeIdDetail
(
parentTask
.
getNodeIdDetail
()
+
deviceRepairBillSaveVo
.
getTaskId
()
+
"."
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/base/SelfCheckSchedulerTask.java
浏览文件 @
75285542
...
@@ -12,6 +12,9 @@ import org.springframework.scheduling.annotation.Scheduled;
...
@@ -12,6 +12,9 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -31,11 +34,9 @@ public class SelfCheckSchedulerTask {
...
@@ -31,11 +34,9 @@ public class SelfCheckSchedulerTask {
*/
*/
private
String
cron3
=
"0 0 0 1 1 ? *"
;
private
String
cron3
=
"0 0 0 1 1 ? *"
;
private
ThreadPoolTaskScheduler
threadPoolTaskScheduler
;
// @Async
// @Async
// @Scheduled(cron = "0 0
/1 * * *
? ")
// @Scheduled(cron = "0 0
0 1 1/1
? ")
// public void createSelfCheckTask()
throws InterruptedException
{
// public void createSelfCheckTask() {
// UnitsDao unitsDao = SpringUtils.getBean("unitsDao");
// UnitsDao unitsDao = SpringUtils.getBean("unitsDao");
// TaskService taskService = SpringUtils.getBean("taskServiceImpl");
// TaskService taskService = SpringUtils.getBean("taskServiceImpl");
// if (unitsDao != null && taskService!=null) {
// if (unitsDao != null && taskService!=null) {
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
75285542
...
@@ -6,6 +6,7 @@ import com.tykj.dev.device.library.service.DeviceLibraryService;
...
@@ -6,6 +6,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.DeviceLibrary
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.selfcheck.base.SelfCheckSchedulerTask
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.service.SelfCheckBillService
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill
;
import
com.tykj.dev.device.selfcheck.subject.vo.*
;
import
com.tykj.dev.device.selfcheck.subject.vo.*
;
...
@@ -25,10 +26,15 @@ import io.swagger.annotations.ApiOperation;
...
@@ -25,10 +26,15 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Proxy
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author dengdiyi
* @author dengdiyi
...
@@ -66,6 +72,39 @@ public class SelfCheckController {
...
@@ -66,6 +72,39 @@ public class SelfCheckController {
@Autowired
@Autowired
private
MyWebSocket
myWebSocket
;
private
MyWebSocket
myWebSocket
;
/**
* 月度
*/
private
String
cron1
=
"0 0 0 1 1/1 ? "
;
/**
* 季度
*/
private
String
cron2
=
"0 0 0 1 3,6,9,12 ? "
;
/**
* 年度
*/
private
String
cron3
=
"0 0 0 1 1 ? *"
;
@ApiOperation
(
value
=
"设置自查周期"
,
notes
=
"可以通过这个接口设置自查周期"
)
@PostMapping
(
value
=
"/set/cycle/{type}"
)
public
ResponseEntity
setCycle
(
@PathVariable
(
"type"
)
int
type
)
throws
NoSuchMethodException
,
IllegalAccessException
,
NoSuchFieldException
{
switch
(
type
){
case
1
:
setCorn
(
cron1
);
return
ResponseEntity
.
ok
(
"自查周期更改为月度"
);
case
2
:
setCorn
(
cron2
);
return
ResponseEntity
.
ok
(
"自查周期更改为季度"
);
case
3
:
setCorn
(
cron3
);
return
ResponseEntity
.
ok
(
"自查周期更改为年度"
);
case
4
:
setCorn
(
"0 0/1 * * * ? "
);
return
ResponseEntity
.
ok
(
"自查周期更改为每分钟"
);
default
:
return
ResponseEntity
.
ok
(
ResultUtil
.
failed
(
"设置失败:type只能为1,2,3"
));
}
}
@ApiOperation
(
value
=
"装备比较"
,
notes
=
"可以通过这个接口发起比较装备"
)
@ApiOperation
(
value
=
"装备比较"
,
notes
=
"可以通过这个接口发起比较装备"
)
@PostMapping
(
value
=
"/compare"
)
@PostMapping
(
value
=
"/compare"
)
public
ResponseEntity
compare
(
@RequestBody
CompareVo
compareVo
)
{
public
ResponseEntity
compare
(
@RequestBody
CompareVo
compareVo
)
{
...
@@ -303,4 +342,12 @@ public class SelfCheckController {
...
@@ -303,4 +342,12 @@ public class SelfCheckController {
return
ResultUtil
.
success
(
list
);
return
ResultUtil
.
success
(
list
);
}
}
private
void
setCorn
(
String
cron
)
throws
NoSuchMethodException
,
NoSuchFieldException
,
IllegalAccessException
{
Scheduled
scheduled
=
SelfCheckSchedulerTask
.
class
.
getDeclaredMethod
(
"createSelfCheckTask"
).
getAnnotation
(
Scheduled
.
class
);
InvocationHandler
h
=
Proxy
.
getInvocationHandler
(
scheduled
);
Field
field
=
h
.
getClass
().
getDeclaredField
(
"memberValues"
);
field
.
setAccessible
(
true
);
Map
memberValues
=
(
Map
)
field
.
get
(
h
);
memberValues
.
put
(
"cron"
,
cron
);
}
}
}
dev-taskselect/src/main/java/com/tykj/dev/device/taskselect/controller/TaskSelectController.java
浏览文件 @
75285542
...
@@ -24,11 +24,14 @@ import com.tykj.dev.device.sendback.repository.SendBackBillDao;
...
@@ -24,11 +24,14 @@ import com.tykj.dev.device.sendback.repository.SendBackBillDao;
import
com.tykj.dev.device.sendback.repository.SendBackBillDetailDao
;
import
com.tykj.dev.device.sendback.repository.SendBackBillDetailDao
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
import
com.tykj.dev.device.storage.service.StorageBillService
;
import
com.tykj.dev.device.storage.subject.domin.StorageBill
;
import
com.tykj.dev.device.storage.subject.domin.StorageBill
;
import
com.tykj.dev.device.task.repository.TaskDao
;
import
com.tykj.dev.device.task.service.TaskService
;
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.TaskBto
;
import
com.tykj.dev.device.task.subject.domin.Task
;
import
com.tykj.dev.device.taskselect.vo.SignatureSaveVo
;
import
com.tykj.dev.device.taskselect.vo.SignatureSaveVo
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.ResultObj
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.misc.utils.Snowflake
;
import
com.tykj.dev.misc.utils.Snowflake
;
...
@@ -105,6 +108,9 @@ public class TaskSelectController {
...
@@ -105,6 +108,9 @@ public class TaskSelectController {
@Autowired
@Autowired
private
Snowflake
snowflake
;
private
Snowflake
snowflake
;
@Autowired
private
TaskDao
taskDao
;
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@ApiOperation
(
value
=
"查询业务对应页面的数据"
,
notes
=
"可以通过这个接口查询业务对应页面的数据"
)
@GetMapping
(
"/manage/detail/{id}"
)
@GetMapping
(
"/manage/detail/{id}"
)
public
ResponseEntity
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
public
ResponseEntity
selectData
(
@PathVariable
(
"id"
)
int
taskId
)
{
...
@@ -333,6 +339,22 @@ public class TaskSelectController {
...
@@ -333,6 +339,22 @@ public class TaskSelectController {
}
}
list
.
add
(
packingLibraryEntityList
);
list
.
add
(
packingLibraryEntityList
);
list
.
add
(
deviceLibraryService
.
getAllotList
(
new
DeviceLibrarySelectVo
()).
stream
().
filter
(
deviceLibraryEntity
->
packingIdList
.
contains
(
deviceLibraryEntity
.
getPackingId
())).
sorted
(
Comparator
.
comparing
(
DeviceLibrary:
:
getPackingId
)).
collect
(
Collectors
.
toList
()));
list
.
add
(
deviceLibraryService
.
getAllotList
(
new
DeviceLibrarySelectVo
()).
stream
().
filter
(
deviceLibraryEntity
->
packingIdList
.
contains
(
deviceLibraryEntity
.
getPackingId
())).
sorted
(
Comparator
.
comparing
(
DeviceLibrary:
:
getPackingId
)).
collect
(
Collectors
.
toList
()));
List
<
Task
>
tasks
=
taskDao
.
findAllByParentTaskId
(
taskId
);
List
<
DeviceLibrary
>
deviceLibraries
=
new
ArrayList
<>();
if
(
tasks
.
size
()==
1
){
Task
task
=
tasks
.
get
(
0
);
if
(
task
.
getBusinessType
()==
3
){
if
(
task
.
getBillId
()>
0
){
AllotBill
allotBill
=
allotBillService
.
getOne
(
task
.
getBillId
());
if
(
allotBill
.
getAllotCheckDetail
()!=
null
){
StringSplitUtil
.
split
(
allotBill
.
getAllotCheckDetail
()).
forEach
(
integer
->
{
deviceLibraries
.
add
(
deviceLibraryService
.
getOne
(
integer
));
});
}
}
}
}
list
.
add
(
deviceLibraries
);
return
ResponseEntity
.
ok
(
new
ResultObj
(
list
,
"查询成功"
));
return
ResponseEntity
.
ok
(
new
ResultObj
(
list
,
"查询成功"
));
default
:
throw
new
ApiException
(
ResultUtil
.
failed
(
"该接口不支持当前task业务类型"
));
default
:
throw
new
ApiException
(
ResultUtil
.
failed
(
"该接口不支持当前task业务类型"
));
}
}
...
@@ -430,5 +452,6 @@ public class TaskSelectController {
...
@@ -430,5 +452,6 @@ public class TaskSelectController {
@GetMapping
(
"/signature/create"
)
@GetMapping
(
"/signature/create"
)
public
ResponseEntity
createSignatureId
(){
public
ResponseEntity
createSignatureId
(){
return
ResponseEntity
.
ok
(
snowflake
.
creatNextId
());
return
ResponseEntity
.
ok
(
snowflake
.
creatNextId
());
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论