Commit 80382e20 LN

SP仪表盘

1 个父辈 94964b9c
...@@ -6,12 +6,16 @@ import lombok.Data; ...@@ -6,12 +6,16 @@ import lombok.Data;
public class MachineStatusDto { public class MachineStatusDto {
/** /**
* 温度 * 温度/回温温度
*/ */
private String temperature = ""; private String temperature = "";
/**
* 冷藏温度
*/
private String codeTemperature = "";
/** /**
* 湿度 * 湿度
*/ */
private String humidity = ""; private String humidity = "";
} }
...@@ -6,13 +6,25 @@ import lombok.Data; ...@@ -6,13 +6,25 @@ import lombok.Data;
public class StorageCapacityDto { public class StorageCapacityDto {
/** /**
*容量 *百分比容量(SP:冷藏区使用百分比)
*/ */
private int capacity; private int capacity;
/** /**
* 百分比容量 * 百分比容量(SP:冷藏区总容量)
*/ */
private int perCapacity; private int perCapacity;
/**
* SP:回温区使用百分比
*/
private int warmCapacity;
/**
* SP:回温区总容量
*/
private int warmPerCapacity;
} }
package com.neotel.smfcore.core.dashboard.bean.dto.sp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class SpBoxStatusDto implements Serializable {
@ApiModelProperty("单台BOX状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试中,6入库执行中,7入仓位完成,8入库失败, 9出库执行中,10出仓位完成,11出库失败,12移栽出库,13 重置中,14 扫码入库失败 ")
private int status=0;
@ApiModelProperty("出库队列数量 ")
private int outJobCount=0;
}
...@@ -4,10 +4,12 @@ import cn.hutool.core.date.DateUnit; ...@@ -4,10 +4,12 @@ import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.agv.bean.AgvInfo; import com.neotel.smfcore.core.agv.bean.AgvInfo;
import com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.dashboard.bean.dto.second.MachineStatusDto; import com.neotel.smfcore.core.dashboard.bean.dto.second.MachineStatusDto;
import com.neotel.smfcore.core.dashboard.bean.dto.second.StorageCapacityDto; import com.neotel.smfcore.core.dashboard.bean.dto.second.StorageCapacityDto;
import com.neotel.smfcore.core.dashboard.bean.dto.second.UpcomingExpirationsDto; import com.neotel.smfcore.core.dashboard.bean.dto.second.UpcomingExpirationsDto;
import com.neotel.smfcore.core.dashboard.bean.dto.sp.SpBoxStatusDto;
import com.neotel.smfcore.core.device.bean.BoxStatusBean; import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean; import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
...@@ -24,6 +26,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -24,6 +26,8 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -64,6 +68,7 @@ public class SecondDashboardController { ...@@ -64,6 +68,7 @@ public class SecondDashboardController {
for (BoxStatusBean boxStatusBean : boxStatusBeans) { for (BoxStatusBean boxStatusBean : boxStatusBeans) {
dto.setHumidity(boxStatusBean.getHumidity()); dto.setHumidity(boxStatusBean.getHumidity());
dto.setTemperature(boxStatusBean.getTemperature()); dto.setTemperature(boxStatusBean.getTemperature());
dto.setCodeTemperature(boxStatusBean.getCodeAirTemp());
} }
} }
} }
...@@ -86,6 +91,29 @@ public class SecondDashboardController { ...@@ -86,6 +91,29 @@ public class SecondDashboardController {
int emptySlots = storage.getEmptySlots(); int emptySlots = storage.getEmptySlots();
int capacity = totalSlots - emptySlots; int capacity = totalSlots - emptySlots;
int perCapacity = (capacity * 100 )/ totalSlots ; int perCapacity = (capacity * 100 )/ totalSlots ;
int warmCapacity=0;
int warmPerCapacity=0;
if(storage.isSolderPaste()) {
warmPerCapacity = dataCache.getSpUsePosCount(storage.getCid(), DataCache.warmPosCount);
perCapacity = dataCache.getSpUsePosCount(storage.getCid(), DataCache.coldingPosCount);
Integer warmUseCount = dataCache.getSpUsePosCount(storage.getCid(), DataCache.warmPosUseCount);
Integer coldingUseCount = dataCache.getSpUsePosCount(storage.getCid(), DataCache.coldingPosUseCount);
if(coldingUseCount<=0||perCapacity<=0){
perCapacity=0;
}else {
perCapacity = (coldingUseCount * 100) / perCapacity;
}
if(warmUseCount<=0||warmPerCapacity<=0){
warmCapacity=0;
}else{
warmCapacity = (warmUseCount * 100) / warmPerCapacity;
}
}
dto.setWarmPerCapacity(warmPerCapacity);
dto.setWarmCapacity(warmCapacity);
dto.setCapacity(capacity); dto.setCapacity(capacity);
dto.setPerCapacity(perCapacity); dto.setPerCapacity(perCapacity);
} }
...@@ -157,4 +185,34 @@ public class SecondDashboardController { ...@@ -157,4 +185,34 @@ public class SecondDashboardController {
} }
return ResultBean.newOkResult(agvCacheList); return ResultBean.newOkResult(agvCacheList);
} }
@ApiOperation("sp看板状态")
@RequestMapping("/spInfo")
@AnonymousAccess
public ResultBean spInfo(@RequestParam("storageId") String storageId) {
SpBoxStatusDto dto = new SpBoxStatusDto();
Storage storage = dataCache.getStorageById(storageId);
if (storage != null) {
StatusBean statusBean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (statusBean != null) {
if (statusBean.timeOut()) {
dto.setStatus(0);
} else {
dto.setStatus(statusBean.getStatus());
}
}
if (storage.isSolderPaste()) {
Criteria c = Criteria.where("storageId").is(storageId)
.and("enabled").is(true)
.and("used").is(true)
.and("barcode.solderStatus").nin(null, "", SOLDER_STATUS.NONE.name(), SOLDER_STATUS.UNDER_REFRIGERATION.name(), SOLDER_STATUS.RETREAT_STORAGE.name());
List<StoragePos> taskPosList = storagePosManager.findByQuery(new Query(c));
dto.setOutJobCount(taskPosList.size());
}
}
return ResultBean.newOkResult(dto);
}
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!