Commit 78ab7c2b sunke

工单查询和出库

1 个父辈 edc8cf09
......@@ -44,7 +44,7 @@ import java.util.Set;
@Slf4j
@Api(tags = "系统:工单管理")
@Api(tags = "工单管理")
@RestController
@RequestMapping("/api/orders")
@RequiredArgsConstructor
......
......@@ -4,6 +4,8 @@ package com.neotel.smfcore.core.system.rest;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.utils.PageUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.system.rest.bean.dto.TaskDto;
import com.neotel.smfcore.core.system.rest.bean.mapstruct.TaskMapper;
import com.neotel.smfcore.core.system.rest.bean.query.TaskQueryCondition;
......@@ -42,6 +44,9 @@ public class TaskController {
@Autowired
private final TaskMapper taskMapper;
@Autowired
private DataCache dataCache;
// @ApiOperation("导出用户数据")
// @GetMapping(value = "/download")
// @PreAuthorize("@el.check('user:list')")
......@@ -60,18 +65,34 @@ public class TaskController {
@ApiOperation("获取队列中的任务")
@GetMapping
@PreAuthorize("@el.check('task:inQueue','task:list')")
public ResponseEntity<Object> query(String[] cids){
public ResponseEntity<Object> query(String groupId, String[] cids){
List<DataLog> resultTasks = Lists.newArrayList();
List<DataLog> allTasks = taskService.getAllTasks();
List<String> cidList = Lists.newArrayList();
if(!ObjectUtils.isEmpty(cids)){
List<String> cidList = Lists.newArrayList(cids);
cidList = Lists.newArrayList(cids);
}
if(!ObjectUtils.isEmpty(groupId)){
for (Storage storage : dataCache.getAllStorage().values()) {
String storageGroupId = storage.getGroupId();
if(storageGroupId!= null && storageGroupId.equals(groupId)){
cidList.add(storage.getCid());
}
}
}
if(cidList.isEmpty()){
for (DataLog task : allTasks) {
String cid = task.getCid();
if(cidList.contains(cid)){
resultTasks.add(task);
}
}
}else{
resultTasks = allTasks;
}
// DataLog testTask = new DataLog();
// testTask.setCid("123");
// testTask.setStatus("FINISHED");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!