Commit f6324ca3 LN

Tool Utilization 功能完善。

1 个父辈 59473888
......@@ -939,6 +939,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
} else {
needSaveToMongo = statusBean.needSaveToMongo();
}
statusBean.setOfflineTime(-1);
statusBean.setTime(System.currentTimeMillis());
Map<String, BoxStatusBean> statusOfBoxes = statusBeanToSave.getBoxStatus();
......
......@@ -142,15 +142,19 @@ public class DataCache {
}
Boolean finishChangeConfig=getCache(Constants.CACHE_FinishChangeExpConfig);
if(finishChangeConfig==null|| !finishChangeConfig){
if(configs!=null){
if(finishChangeConfig==null|| !finishChangeConfig) {
//先备份原来的
log.info("CACHE_FinishChangeExpConfig=false,先转存过期年配置到:" + Constants.CACHE_ExpirationDateConfig_N + "_back");
updateCache(Constants.CACHE_ExpirationDateConfig_N + "_back", configs);
if (configs != null) {
for (ExpConfig c : configs) {
if(c!=null&&c.getValue()!=null){
c.setValue(c.getValue()*365);
if (c != null && c.getValue() != null) {
c.setValue(c.getValue() * 365);
}
}
updateCache(Constants.CACHE_ExpirationDateConfig_N, configs);
}
log.info(" 已完成,过期年改已改为天,保存CACHE_FinishChangeExpConfig=true");
updateCache(Constants.CACHE_FinishChangeExpConfig, true);
}
......
......@@ -145,7 +145,11 @@ public class DeviceStateDurationUtil {
lastStorageStatusMap.remove(currentDuration);
lastStorageStatusMap.add(newSlice);
msg = msg + " 开始时间" + DateUtil.toDateTimeString(newSlice.getStartTime());
if(msg==""){
msg=dType + ",cid=" + cid + ", 旧状态 " + currentDuration.getDeviceS() + " 开始时间" + DateUtil.toDateTimeString(newSlice.getStartTime());
}else {
msg = msg + " 开始时间" + DateUtil.toDateTimeString(newSlice.getStartTime());
}
}
if (ObjectUtil.isNotEmpty(msg)) {
log.info("ProcessState" + msg);
......
......@@ -218,4 +218,12 @@ public class EquipmentController {
log.info("设备cid=" + cid + ", equipType=" + equipment.getType() + " setActivate(false)成功");
return ResultBean.newOkResult("OK");
}
@ApiOperation("返回所有的非料仓设备")
@GetMapping(value = "/all")
public List<EquipmentDto> all() {
List<Equipment> list = equipmentManager.findAll();
List<EquipmentDto> dtos = equipmentMapper.toDto(list);
return dtos;
}
}
......@@ -2,6 +2,7 @@ package com.neotel.smfcore.core.report.rest.query;
import cn.hutool.core.date.DateTime;
import com.neotel.smfcore.common.bean.BetweenData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
......@@ -16,4 +17,9 @@ public class ReportQuery implements Serializable {
private String pn;
private List<String> cidList;
/**
* 区分设备类型:STORAGE=料仓,EQUIPMENT=其他设备
*/
private String deviceType;
}
......@@ -256,10 +256,10 @@ public class DevicesStatusUtil {
if (bean.getOfflineTime() == -1 && (bean.timeOut()||bean.getStatus()== BOX_STATUS.OFFLINE)) {
bean.setOfflineTime(System.currentTimeMillis());
DeviceMessageUtil.addOfflineMessage(bean.getCid(), "");
DeviceStateDurationUtil.deviceOffline(bean.getCid(), DeviceSKind.EQUIPMENT);
DeviceStateDurationUtil.deviceOffline(bean.getCid(), DeviceSKind.STORAGE);
}
}
}
}
} catch (Exception ex) {
log.error("设备状态定时器执行出错:", ex);
}
......
......@@ -510,7 +510,8 @@ public class TaskService {
public StatusBean checkOut(Storage storage, StatusBean statusBean) {
try {
//准备更新暂停出入库
if (dataCache.getCache(Constants.CACHE_StopOut)) {
Boolean stopOut=dataCache.getCache(Constants.CACHE_StopOut);
if (ObjectUtil.isNotEmpty(stopOut)&& stopOut) {
return statusBean;
}
String cid = storage.getCid();
......
......@@ -71,7 +71,7 @@ public class Micron1053Menu {
MenuInit.addMenu(menuLabel,pMenuReport,203, "ErrorLog","errorLog", "report/errorLog/index","errorLog");
MenuInit.addMenu(menuLabel,pMenuReport,204, "ErrorReport","errorReport", "report/errorReport/index","errorReport");
MenuInit.addMenu(menuLabel,pMenuReport,205, "EventLog","eventLog", "report/eventLog/index","eventlog");
MenuInit.addMenu(menuLabel,pMenuReport,206, "DeviceSChart","deviceSChart", "report/deviceSChart/index","deviceSChart");
MenuInit.addMenu(menuLabel,pMenuReport,206, "Tool Utilization","deviceSChart", "report/deviceSChart/index","deviceSChart");
//Help
MenuInit.addMenu(menuLabel,null,999, "Help","helps", "help/helps/index","help");
......
......@@ -18,6 +18,8 @@ public class DeviceStateChartDto implements Serializable {
@ApiModelProperty("设备CID")
private String cid;
@ApiModelProperty("区分设备类型:STORAGE=料仓,EQUIPMENT=其他设备")
private String deviceType;
@ApiModelProperty("日期/天")
private Date day;
......
......@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.deviceState.enums.DeviceSKind;
import com.neotel.smfcore.core.deviceState.service.manager.IDeviceStateDurationManager;
import com.neotel.smfcore.core.deviceState.service.po.DeviceStateDuration;
import com.neotel.smfcore.core.equipment.service.po.Equipment;
......@@ -389,6 +390,9 @@ public class MicronReportController {
if(reportQuery.getCidList()!=null){
query.addCriteria(Criteria.where("cid").in(reportQuery.getCidList()));
}
if(ObjectUtil.isNotEmpty(reportQuery.getDeviceType())){
query.addCriteria(Criteria.where("deviceType").is(reportQuery.getDeviceType()));
}
List<DeviceStateDuration> list = deviceStateDurationManager.findByQuery(query);
Map<String, Map<Date, DeviceStateChartDto>> resultMap = new HashMap<>();
......@@ -403,17 +407,19 @@ public class MicronReportController {
DeviceStateChartDto dto = dayMap.get(day);
if (dto == null) {
String deviceName = cid;
Storage storage = dataCache.getStorage(cid);
if (storage != null) {
deviceName = storage.getName();
} else {
Equipment eq = equipmentCache.getEquipment(cid);
if(d.getDeviceType()== DeviceSKind.STORAGE){
Storage storage = dataCache.getStorage(cid);
if (storage != null) {
deviceName = storage.getName();
}
}
else {
Equipment eq = equipmentCache.getEquipment(cid);
if (eq != null) {
deviceName = eq.getName();
}
}
dto = new DeviceStateChartDto(deviceName, cid, day, 0L, 0L, 0L);
dto = new DeviceStateChartDto(deviceName, cid,d.getDeviceType(), day, 0L, 0L, 0L);
dayMap.put(day, dto);
}
......
......@@ -409,3 +409,4 @@ smfcore.xray.countingHistory.xRayFile=\u56FE\u7247\u6587\u4EF6\u540D
smfcore.xray.countingHistory.resultFile=\u7ED3\u679C\u6587\u4EF6\u540D
smfcore.xray.countingHistory.uploadOk=\u662F\u5426\u4E0A\u4F20\u5B8C\u6210
smfcore.xray.countingHistory.countingTime=\u70B9\u6599\u65F6\u95F4
smfcore.deviceSChart=Tool Utilization
\ No newline at end of file
......@@ -386,4 +386,5 @@ smfcore.xray.countingHistory.tdBarcode=Barcode
smfcore.xray.countingHistory.xRayFile=Image File Name
smfcore.xray.countingHistory.resultFile=Result File Name
smfcore.xray.countingHistory.uploadOk=Upload Completed
smfcore.xray.countingHistory.countingTime=Counting Time
\ No newline at end of file
smfcore.xray.countingHistory.countingTime=Counting Time
smfcore.deviceSChart=Tool Utilization
\ No newline at end of file
......@@ -381,4 +381,5 @@ smfcore.xray.countingHistory.tdBarcode=\u30D0\u30FC\u30B3\u30FC\u30C9
smfcore.xray.countingHistory.xRayFile=\u753B\u50CF\u30D5\u30A1\u30A4\u30EB\u540D
smfcore.xray.countingHistory.resultFile=\u7D50\u679C\u30D5\u30A1\u30A4\u30EB\u540D
smfcore.xray.countingHistory.uploadOk=\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5B8C\u4E86
smfcore.xray.countingHistory.countingTime=\u30AB\u30A6\u30F3\u30C8\u6642\u9593
\ No newline at end of file
smfcore.xray.countingHistory.countingTime=\u30AB\u30A6\u30F3\u30C8\u6642\u9593
smfcore.deviceSChart=Tool Utilization
\ No newline at end of file
......@@ -383,4 +383,5 @@ smfcore.xray.countingHistory.resultFile=\u7ED3\u679C\u6587\u4EF6\u540D
smfcore.xray.countingHistory.uploadOk=\u662F\u5426\u4E0A\u4F20\u5B8C\u6210
smfcore.xray.countingHistory.countingTime=\u70B9\u6599\u65F6\u95F4
smfcore.common.createDate=\u521B\u5EFA\u65F6\u95F4
smfcore.common.updateDate=\u66F4\u65B0\u65F6\u95F4
\ No newline at end of file
smfcore.common.updateDate=\u66F4\u65B0\u65F6\u95F4
smfcore.deviceSChart=Tool Utilization
\ No newline at end of file
......@@ -384,4 +384,5 @@ smfcore.xray.countingHistory.tdBarcode=\u689D\u78BC
smfcore.xray.countingHistory.xRayFile=\u5716\u7247\u6A94\u540D
smfcore.xray.countingHistory.resultFile=\u7D50\u679C\u6A94\u540D
smfcore.xray.countingHistory.uploadOk=\u662F\u5426\u4E0A\u50B3\u5B8C\u6210
smfcore.xray.countingHistory.countingTime=\u9EDE\u6599\u6642\u9593
\ No newline at end of file
smfcore.xray.countingHistory.countingTime=\u9EDE\u6599\u6642\u9593
smfcore.deviceSChart=Tool Utilization
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!