Commit ab0a8019 LN

1.系统设置增加:过期天数,容量预警。

1 个父辈 2c7afc6d
......@@ -107,6 +107,15 @@ public class Constants {
* 呆滞天数
*/
public static final String CACHE_SluggishDay="sluggishDay";
/**
* 过期天数
*/
public static final String CACHE_ExpiresDay="expiresDay";
/**
* 容量预警
*/
public static final String CACHE_CapacityWarn="capacityWarn";
//
// /**
// * 停止定时器任务
......
......@@ -35,6 +35,9 @@ public class CodeResolve {
private List<BarcodeRule> barcodeRuleList;
private Integer defaultExpiresDay=0;
public void updateBarcodeRuleList(List<String> ruleList){
barcodeRuleList = Lists.newArrayList();
for(String codeRule : ruleList){
......@@ -43,6 +46,10 @@ public class CodeResolve {
}
}
}
public void updateExpiresDay(Integer expiresDay){
defaultExpiresDay=expiresDay;
}
public CodeBean resolveSingleCode(String barcodeItemStr ){
return resolveSingleCode(barcodeItemStr, COMPONENT_TYPE.COMPONENT);
......@@ -88,6 +95,10 @@ public class CodeResolve {
boolean setSize=false;
Component component = componentManager.findByPartNumberAndProvider(barcode.getPartNumber(),barcode.getProvider());
int validDay = 0;
if(defaultExpiresDay!=null&&defaultExpiresDay>0){
validDay=defaultExpiresDay;
}
if(component != null) {
validDay = component.getValidDay();
codeBeanFromRule.setShowImg(component.getShowImg());
......
......@@ -40,10 +40,10 @@ public enum OP_STATUS {
*/
END ,
/**
* 已从仓位中取出
*/
OUTBOX,
// /**
// * 已从仓位中取出
// */
// OUTBOX,
/**
* 在线体上
*/
......
......@@ -177,7 +177,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
} else if (BOX_STATUS.IN_FAILED == status) {//入库失败
//暂不处理
} else if (BOX_STATUS.OUT_FINISHED == status) {//出仓完成
finishedOutPos(statusBean.getCid(), posName,barcode, executeTime);
finishedOutPos(statusBean.getCid(), posName,barcode, executeTime,OP_STATUS.OUT_BOX);
} else if (BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口
//更改出库状态为OUT_DOOR
List<DataLog> finishedTasks = taskService.getFinishedTasks();
......@@ -234,6 +234,9 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String lastPosId = "";
String lineMsg = "";
log.info("流水线[" + cids + "]获取[" + code + "]的入库库位");
if(ObjectUtil.isEmpty(cids)){
cids="";
}
String[] cidArray= cids.split(",");
Map<String, Object> resultMap = Maps.newHashMap();
String okMsg = "";
......@@ -353,11 +356,12 @@ public class RobotBoxHandler extends BaseDeviceHandler {
Collection<DataLog> tasks = taskService.getAllTasks();
for (DataLog task : tasks) {
if (task.isCheckOutTask() && task.getStorageId().equals(pos.getStorageId())) {
if (!task.isFinished() && !task.isInRobot()) {
if ((!task.isFinished()) && (!task.isInRobot())&&(!task.isInLine()) ) {
errorMsg = "库位[" + pos.getPosName() + "]所在料仓有出库任务,暂停入库";
lineMsg = errorMsg;
resultMap.put("result", "99");
resultMap.put("msg", errorMsg);
log.info("[" + barcode.getBarcode() + "]分到库位[" + pos.getPosName() + "]所在料仓有出库任务,暂停入库");
return resultMap;
}
}
......@@ -460,10 +464,12 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
}
if (opTask == null) {
log.info(" taskId["+taskId+"],料盘[" + barcode + "]更新位置指令[" + statusStr + "]=" + locInfo+",失败:任务不存在");
return ResultBean.newErrorResult(301, "smfcore.task.notExist", "任务不存在");
}
if (opTask.isFinished()) {
log.info(" taskId["+taskId+"],料盘[" + barcode + "]更新位置指令[" + statusStr + "]=" + locInfo+",失败:任务已完成");
return ResultBean.newErrorResult(302, "smfcore.task.hasEnd", "任务已完成");
}
......@@ -471,7 +477,8 @@ public class RobotBoxHandler extends BaseDeviceHandler {
// return ResultBean.newErrorResult(303, "smfcore.task.hasCancel", "更新状态时{0}的出库任务[{1}]已被取消", new String[]{opTask.getBarcode(), opTask.getId()});
// }
statusStr = statusStr.toUpperCase();
log.info("更新料盘[" + barcode + "]的任务状态[" + opTask.getStatus() + "=" + opTask.getLocInfo() + "]为[" + statusStr + "=" + locInfo + "]");
String inouType=opTask.isCheckOutTask()? "出库":"入库";
log.info("更新料盘[" + barcode + "]的["+inouType+"]任务状态[" + opTask.getStatus() + "=" + opTask.getLocInfo() + "]为[" + statusStr + "=" + locInfo + "]");
opTask.setStatus(statusStr);
opTask.setLocInfo(locInfo);
......
......@@ -168,7 +168,7 @@ public class ThirdBoxHandler extends BaseDeviceHandler{
try{
//麦康尼料仓不发OUT_FINISHED,收到OutEnd的时候处理
finishedOutPos(statusBean.getCid(), posName,barcode, executeTime);
finishedOutPos(statusBean.getCid(), posName,barcode, executeTime, OP_STATUS.OUT_BOX);
}catch (Exception ex){
}
......
......@@ -104,6 +104,8 @@ public class DataCache {
@PostConstruct
public void initialize() {
settings = getSettings();
Integer caWarn=getCache(Constants.CACHE_CapacityWarn);
codeResolve.updateExpiresDay(caWarn);
initCacheItem();
}
......@@ -163,6 +165,9 @@ public class DataCache {
List<String> ruleList = (List<String>) value;
codeResolve.updateBarcodeRuleList(ruleList);
}
if(cacheKey.equals(Constants.CACHE_ExpiresDay)){
codeResolve.updateExpiresDay((Integer)value);
}
log.info("updateCache [" + cacheKey + "]=[" + value + "]");
}
......
......@@ -72,10 +72,14 @@ public class SettingsController {
boolean stopOut = dataCache.getCache(Constants.CACHE_StopOut);
boolean startJob = dataCache.getCache(Constants.CACHE_StartJob);
Integer sluggishDay=dataCache.getCache(Constants.CACHE_SluggishDay);
Integer expiresDay=dataCache.getCache(Constants.CACHE_ExpiresDay);
Integer caWarn=dataCache.getCache(Constants.CACHE_CapacityWarn);
SysSettingsDto dto = new SysSettingsDto();
dto.setStartJob(startJob);
dto.setStopOut(stopOut);
dto.setSluggishDay(sluggishDay);
dto.setExpiresDay(expiresDay);
dto.setCapacityWarn(caWarn);
return dto;
}
......@@ -86,7 +90,10 @@ public class SettingsController {
dataCache.updateCache(Constants.CACHE_StopOut, sysSettingsDto.isStopOut());
dataCache.updateCache(Constants.CACHE_StartJob, sysSettingsDto.isStartJob());
dataCache.updateCache(Constants.CACHE_SluggishDay,sysSettingsDto.getSluggishDay());
log.info("更改系统设置:stopout=" + sysSettingsDto.isStopOut() + ",stopjob=" + sysSettingsDto.isStartJob()+",sluggishDay="+sysSettingsDto.getSluggishDay());
dataCache.updateCache(Constants.CACHE_ExpiresDay,sysSettingsDto.getExpiresDay());
dataCache.updateCache(Constants.CACHE_CapacityWarn,sysSettingsDto.getCapacityWarn());
log.info("更改系统设置:stopout=" + sysSettingsDto.isStopOut() + ",stopjob=" + sysSettingsDto.isStartJob()+",sluggishDay="+sysSettingsDto.getSluggishDay()
+",expiresDay="+sysSettingsDto.getExpiresDay()+",capacityWarn="+sysSettingsDto.getCapacityWarn());
return ResultBean.newOkResult("保存成功");
}
......
......@@ -18,4 +18,10 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty("呆滞天数")
private Integer sluggishDay=0;
@ApiModelProperty("过期天数")
private Integer expiresDay=0;
@ApiModelProperty("容量预警")
private Integer capacityWarn=0;
}
......@@ -267,12 +267,15 @@ public class DataLog extends BasePo implements Serializable {
}
public boolean isOutBox(){
return OP_STATUS.OUTBOX.name().equals(status);
return OP_STATUS.OUT_BOX.name().equals(status);
}
public boolean isInRobot(){
return OP_STATUS.INROBOT.name().equals(status);
}
public boolean isInLine(){
return OP_STATUS.INLINE.name().equals(status);
}
public boolean isBoxdoor(){
return OP_STATUS.BOXDOOR.name().equals(status) || OP_STATUS.BOXDOOR_NOREEL.equals(status);
}
......
......@@ -38,4 +38,8 @@ public class SBDHViewDto implements Serializable {
@ApiModelProperty("出入库报表")
private List<ChartItem> chartItems;
@ApiModelProperty("容量预警")
private Integer capacityWarn=0;
}
package com.neotel.smfcore.custom.micron1053.controller;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
......@@ -196,6 +197,8 @@ public class MicronStatusController {
dto.setChartItems(chartItemMap.values().stream().collect(Collectors.toList()));
dto.setTodayCounts(todayCounts);
Integer caWarn=dataCache.getCache(Constants.CACHE_CapacityWarn);
dto.setCapacityWarn(caWarn);
return dto;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!