提交 150674a6 authored 作者: 邓砥奕's avatar 邓砥奕

update

上级 96fa8899
......@@ -275,11 +275,13 @@ public class DeviceLibraryController {
DeviceLibrary::addChildNode
);
Map<Integer,String> lifeStatusMap = configCache.getLifeStatusMap();
Map<Integer,String> matchingRangeMap = configCache.getMatchingRangeMap();
Set<Integer> status = new HashSet<>();
Set<String> models = new HashSet<>();
Set<String> names = new HashSet<>();
Set<String> ownUnits = new HashSet<>();
Set<String> locationUnits = new HashSet<>();
Set<Integer> matchingRanges = new HashSet<>();
resultList.forEach(deviceVo -> {
deviceVo.setConfigName();
status.add(deviceVo.getLifeStatus());
......@@ -287,12 +289,14 @@ public class DeviceLibraryController {
names.add(deviceVo.getName());
ownUnits.add(deviceVo.getOwnUnit());
locationUnits.add(deviceVo.getLocationUnit());
matchingRanges.add(deviceVo.getMatchingRange());
});
map.put("models",models);
map.put("names",names);
map.put("ownUnits",ownUnits);
map.put("locationUnits",locationUnits);
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
map.put("matchingRanges",matchingRanges.stream().map(integer -> new LifeStatusVo(integer,matchingRangeMap.get(integer))).collect(Collectors.toList()));
Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), containList, deviceLibrarySelectVo.getPageable());
map.put("pages",deviceLibraryEntities);
return ResultUtil.success(map);
......
......@@ -989,12 +989,12 @@ public class RepairController {
//不缺少单据直接办结
if (repairReceiveVo.getStatus()==0) {
userIds.add(userId);
TaskBto taskBto1 = new TaskBto(StatusEnum.END.id, repairBackBill.getSendUnit()+"维修退回型号"+StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"共有"+repairBackBill.getSendingCount()+"件至"+repairBackBill.getReceiveUnit(), null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
TaskBto taskBto1 = new TaskBto(StatusEnum.END.id, repairBackBill.getSendUnit()+"维修退回型号"+StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"共有"+repairBackBill.getReceiveCount()+"件至"+repairBackBill.getReceiveUnit(), null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
taskBto2 = taskService.start(taskBto1);
}
else {
userIds.add(0);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE.id, repairBackBill.getSendUnit()+"维修退回型号:"+StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"共有"+repairBackBill.getSendingCount()+"件至"+repairBackBill.getReceiveUnit(), null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
TaskBto taskBto1 = new TaskBto(StatusEnum.WAIT_UPLOAD_BACK_FILE.id, repairBackBill.getSendUnit()+"维修退回型号:"+StringSplitUtil.stringListToString(repairReceiveVo.getScriptSaveVos().stream().map(ScriptSaveVo::getModel).distinct().collect(Collectors.toList()))+"共有"+repairBackBill.getReceiveCount()+"件至"+repairBackBill.getReceiveUnit(), null, ".", repairBackBill1.getId(), BusinessEnum.REPAIR_BACK.id, userUtils.getCurrentUnitId(), 0, "country", userIds);
taskBto2 = taskService.start(taskBto1);
}
//遍历改变维修详情
......
package com.tykj.dev.rfid.controller;
import com.tykj.dev.config.repository.SystemVariableDao;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tykj.dev.config.service.SystemVariableService;
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.misc.exception.ApiException;
......@@ -13,7 +13,9 @@ import com.tykj.dev.rfid.entity.domin.AccessControlName;
import com.tykj.dev.rfid.entity.domin.InputOutputDevice;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLog;
import com.tykj.dev.rfid.entity.domin.LibraryWarningLogDetail;
import com.tykj.dev.rfid.entity.vo.*;
import com.tykj.dev.rfid.entity.vo.AccessData;
import com.tykj.dev.rfid.entity.vo.DataResult;
import com.tykj.dev.rfid.entity.vo.Record;
import com.tykj.dev.rfid.repository.AccessControlNameDao;
import com.tykj.dev.rfid.repository.LibraryWarningLogDetailDao;
import com.tykj.dev.rfid.service.AccessControlNameService;
......@@ -21,7 +23,6 @@ import com.tykj.dev.rfid.service.InputOutputDeviceService;
import com.tykj.dev.rfid.service.LibraryWarningLogDetailService;
import com.tykj.dev.rfid.service.LibraryWarningLogService;
import io.swagger.annotations.Api;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
......@@ -37,9 +38,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -96,8 +95,8 @@ public class AccessController {
sp.append(line);
}
String json = sp.toString();
String cmd = json.substring(10,15);
// System.out.println(json);
JSONObject jsonObject = JSON.parseObject(json);
String cmd = jsonObject.getString("cmd");
//数据提交
if ("20001".equals(cmd)){
//Json转对象
......@@ -149,7 +148,11 @@ public class AccessController {
//获取最近10s报警的Id
List<Integer> ids = getLatestWarningDeviceIds();
//排除使用状态中的装备,映射成id
List<Integer> idList = deviceLibraries.stream().filter(deviceLibrary -> deviceLibrary.getLifeStatus()!=14).map(DeviceLibrary::getId).collect(Collectors.toList());
List<Integer> idList = deviceLibraries
.stream()
.filter(deviceLibrary -> deviceLibrary.getLifeStatus()!=14)
.map(DeviceLibrary::getId)
.collect(Collectors.toList());
ids.retainAll(idList);
idList.removeAll(ids);
if(idList.size()>0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论