Commit 515bc395 zshaohui

Merge remote-tracking branch 'origin/master'

2 个父辈 350210bf afc8d9b8
package com.neotel.smfcore.core.humiture.rest; package com.neotel.smfcore.core.humiture.rest;
import cn.hutool.core.util.ObjectUtil; import com.google.common.collect.Lists;
import com.google.common.base.Strings; import com.neotel.smfcore.common.base.IExcelDownLoad;
import com.neotel.smfcore.common.bean.PageData; import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean; import com.neotel.smfcore.common.utils.*;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.humiture.rest.bean.dto.HumitureDto; import com.neotel.smfcore.core.humiture.rest.bean.dto.HumitureDto;
import com.neotel.smfcore.core.humiture.rest.bean.query.HumitureQueryCriteria; import com.neotel.smfcore.core.humiture.rest.bean.query.HumitureQueryCriteria;
import com.neotel.smfcore.core.kanban.rest.bean.dto.*; import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.kanban.rest.bean.mapstruct.BoxTaskMapper;
import com.neotel.smfcore.core.kanban.rest.bean.query.BoxTaskQueryCriter;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.msd.bean.MSDSettiings; import com.neotel.smfcore.core.msd.bean.MSDSettiings;
import com.neotel.smfcore.core.order.enums.LITEORDER_STATUS;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.manager.IHumitureManager; import com.neotel.smfcore.core.system.service.manager.IHumitureManager;
import com.neotel.smfcore.core.system.service.manager.impl.DataLogManagerImpl;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.service.po.Humiture; import com.neotel.smfcore.core.system.service.po.Humiture;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import com.neotel.smfcore.security.annotation.AnonymousPutMapping;
import com.neotel.smfcore.security.service.manager.IGroupManager;
import com.neotel.smfcore.security.service.manager.impl.UserManagerImpl;
import com.neotel.smfcore.security.service.po.Group;
import com.neotel.smfcore.security.service.po.User;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
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.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Slf4j @Slf4j
...@@ -84,4 +58,54 @@ public class HumitureController { ...@@ -84,4 +58,54 @@ public class HumitureController {
restultDto.setHumitureList(humitureList); restultDto.setHumitureList(humitureList);
return restultDto; return restultDto;
} }
@ApiOperation("导出温湿度列表")
@GetMapping(value = "api/humiture/list/download")
public void download(HttpServletResponse response, HumitureQueryCriteria criteria, Pageable pageable, HttpServletRequest request) throws IOException {
MSDSettiings msdSettiings = dataCache.getCache(Constants.CACHE_msdSetting);
if (msdSettiings == null) {
msdSettiings = new MSDSettiings();
}
Float maxTemperature = msdSettiings.getMaxTemperature();
Float maxHumidity = msdSettiings.getMaxHumidity();
Query query = QueryHelp.getQuery(criteria);
query.with(Sort.by(Sort.Direction.ASC, "createDate"));
query.addCriteria(Criteria.where("temperature").ne("0"));
FileUtil.downloadExcel(query, pageable, response, new IExcelDownLoad() {
@Override
public List<List<String>> getHeader() {
List<List<String>> header = new ArrayList<>();
Locale locale = request.getLocale();
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.cid", locale, "CID")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.temperature", locale, "温度")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.humiture", locale, "湿度")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.createDate", locale, "创建时间")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.updateDate", locale, "更新时间")));
return header;
}
@Override
public List<List<Object>> getPageData(Query query, Pageable pageable) {
List<List<Object>> dataList = new ArrayList<>();
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<Map<String, Object>> list = new ArrayList<>();
List<Humiture> humitureList = humitureManager.findByQuery(query, pageable);
for (Humiture humiture : humitureList) {
String createDate = humiture.getCreateDate() == null ? "" : dateFormat.format(humiture.getCreateDate());
String updateDate = humiture.getUpdateDate() == null ? "" : dateFormat.format(humiture.getUpdateDate());
List<Object> data = new ArrayList<>();
data.add(humiture.getCid());
data.add(humiture.getTemperature());
data.add(humiture.getHumidity());
data.add(createDate);
data.add(updateDate);
dataList.add(data);
}
return dataList;
}
});
}
} }
...@@ -140,6 +140,7 @@ public class MaterialStockController { ...@@ -140,6 +140,7 @@ public class MaterialStockController {
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.batch",locale,"物料批次")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量")));
...@@ -170,6 +171,7 @@ public class MaterialStockController { ...@@ -170,6 +171,7 @@ public class MaterialStockController {
data.add(pos.getBarcode().getPartNumber()); data.add(pos.getBarcode().getPartNumber());
data.add(proDate); data.add(proDate);
data.add(expireDate); data.add(expireDate);
data.add(pos.getBarcode().getBatch());
data.add(pos.getPosName()); data.add(pos.getPosName());
data.add(pos.getBarcode().getLockName()); data.add(pos.getBarcode().getLockName());
data.add(pos.getBarcode().getAmount()); data.add(pos.getBarcode().getAmount());
...@@ -233,6 +235,7 @@ public class MaterialStockController { ...@@ -233,6 +235,7 @@ public class MaterialStockController {
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.batch",locale,"物料批次")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量")));
...@@ -264,6 +267,7 @@ public class MaterialStockController { ...@@ -264,6 +267,7 @@ public class MaterialStockController {
data.add(proDate); data.add(proDate);
data.add(expireDate); data.add(expireDate);
data.add(pos.getPosName()); data.add(pos.getPosName());
data.add(pos.getBarcode().getBatch());
data.add(pos.getBarcode().getLockName()); data.add(pos.getBarcode().getLockName());
data.add(pos.getBarcode().getAmount()); data.add(pos.getBarcode().getAmount());
data.add(putInTime); data.add(putInTime);
......
...@@ -372,6 +372,7 @@ public class StoragePosController { ...@@ -372,6 +372,7 @@ public class StoragePosController {
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"物料编号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.proDate",locale,"生产日期")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.expireDate",locale,"过期时间")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.batch",locale,"物料批次")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.lockName",locale,"工单号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量"))); header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.amount",locale,"数量")));
...@@ -402,6 +403,7 @@ public class StoragePosController { ...@@ -402,6 +403,7 @@ public class StoragePosController {
data.add(pos.getBarcode().getPartNumber()); data.add(pos.getBarcode().getPartNumber());
data.add(proDate); data.add(proDate);
data.add(expireDate); data.add(expireDate);
data.add(pos.getBarcode().getBatch());
data.add(pos.getPosName()); data.add(pos.getPosName());
data.add(pos.getBarcode().getLockName()); data.add(pos.getBarcode().getLockName());
data.add(pos.getBarcode().getAmount()); data.add(pos.getBarcode().getAmount());
......
...@@ -2,6 +2,11 @@ package com.neotel.smfcore.core.system.service.manager; ...@@ -2,6 +2,11 @@ package com.neotel.smfcore.core.system.service.manager;
import com.neotel.smfcore.common.base.IBaseManager; import com.neotel.smfcore.common.base.IBaseManager;
import com.neotel.smfcore.core.system.service.po.Humiture; import com.neotel.smfcore.core.system.service.po.Humiture;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.query.Query;
import java.util.List;
public interface IHumitureManager extends IBaseManager<Humiture> { public interface IHumitureManager extends IBaseManager<Humiture> {
List<Humiture> findByQuery(Query query, Pageable pageable);
} }
...@@ -2,10 +2,8 @@ package com.neotel.smfcore.core.system.service.manager.impl; ...@@ -2,10 +2,8 @@ package com.neotel.smfcore.core.system.service.manager.impl;
import com.neotel.smfcore.common.bean.PageData; import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.system.service.dao.IDataLogDao;
import com.neotel.smfcore.core.system.service.dao.IHumitureDao; import com.neotel.smfcore.core.system.service.dao.IHumitureDao;
import com.neotel.smfcore.core.system.service.manager.IHumitureManager; import com.neotel.smfcore.core.system.service.manager.IHumitureManager;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.service.po.Humiture; import com.neotel.smfcore.core.system.service.po.Humiture;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
...@@ -46,4 +44,8 @@ public class HumitureManagerImpl implements IHumitureManager { ...@@ -46,4 +44,8 @@ public class HumitureManagerImpl implements IHumitureManager {
public List<Humiture> findByQuery(Query query) { public List<Humiture> findByQuery(Query query) {
return humitureDao.findByQuery(query); return humitureDao.findByQuery(query);
} }
@Override
public List<Humiture> findByQuery(Query query,Pageable pageable) {
return humitureDao.findByQuery(query,pageable);
}
} }
package com.neotel.smfcore.custom.micron1053.bean;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ML5NgReelInfo implements Serializable {
@ApiModelProperty("NG口位置,1=左侧,2=右侧")
private int NgPos=0;
@ApiModelProperty("物料类型:pizzaBox,pcb,tray,reel")
private String mType;
@ApiModelProperty("条码")
private String barcode;
@ApiModelProperty("库位号")
private String posName;
@ApiModelProperty("出入库类型,1=入库,2=出库")
private String type;
@ApiModelProperty("NG原因")
private String ngMsg;
}
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
@NoArgsConstructor @NoArgsConstructor
public class MicronEquipStatus implements Serializable { public class MicronEquipStatus implements Serializable {
/** /**
* 设备名称:ML5,CI,R1,R2,R3,M1-M8,SBDH1,SBDH2,SBDH3,SBSH1,SBSH2 * 设备名称:CI,R1,R2,R3,M1-M8,SBDH1,SBDH2,SBDH3,SBSH1,SBSH2
* ML5-R1,ML5-R2,ML5-L1,ML5-R2 * ML5-R1,ML5-R2,ML5-L1,ML5-R2
*/ */
private String equipName; private String equipName;
...@@ -21,9 +21,19 @@ public class MicronEquipStatus implements Serializable { ...@@ -21,9 +21,19 @@ public class MicronEquipStatus implements Serializable {
*/ */
private int status; private int status;
/** /**
* 左边代表l1,l2,1=正常运行,2=报警。3=入库中,4=出库中,5=满料待取出
*/
private int P1status;
/**
* 右边代表R1R21,1=正常运行,2=报警。3=入库中,4=出库中,5=满料待取出
*/
private int P2status;
/**
* 当name为ML5-R1对应右侧的ng,ML5-L1对应左侧的ng * 当name为ML5-R1对应右侧的ng,ML5-L1对应左侧的ng
*/ */
private int ngCount; private int ngCount;
private long updateTime; private long updateTime;
private List<EquipMsg> msgList=null; private List<EquipMsg> msgList=null;
/** /**
......
...@@ -18,9 +18,9 @@ public class ML5StatusDto implements Serializable { ...@@ -18,9 +18,9 @@ public class ML5StatusDto implements Serializable {
private int l1Status=0; private int l1Status=0;
@ApiModelProperty("L2状态 0=离线,1=正常运行,2=报警") @ApiModelProperty("L2状态 0=离线,1=正常运行,2=报警")
private int l2Status=0; private int l2Status=0;
@ApiModelProperty("R1状态 0=离线,1=正常运行,2=报警") @ApiModelProperty("R1状态 0=离线,1=正常运行,2=报警,3=入库中,4=出库中,5=满料待取出")
private int r1Status=0; private int r1Status=0;
@ApiModelProperty("R2状态 0=离线,1=正常运行,2=报警") @ApiModelProperty("R2状态 0=离线,1=正常运行,2=报警,3=入库中,4=出库中,5=满料待取出")
private int r2Status=0; private int r2Status=0;
@ApiModelProperty("NG1处料盘数量") @ApiModelProperty("NG1处料盘数量")
......
...@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean; ...@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.JsonUtil; import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo;
import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus; import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus;
import com.neotel.smfcore.custom.micron1053.util.MicronDataCache; import com.neotel.smfcore.custom.micron1053.util.MicronDataCache;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
...@@ -97,6 +98,31 @@ public class MicronDeviceController { ...@@ -97,6 +98,31 @@ public class MicronDeviceController {
Object value = MicronDataCache.getDDate(key); Object value = MicronDataCache.getDDate(key);
return ResultBean.newOkResult(value); return ResultBean.newOkResult(value);
} }
@ApiOperation("上传一个NG料 ")
@PostMapping(value = "/uploadNgReel")
@ResponseBody
@AnonymousAccess
public ResultBean uploadNgReel(@RequestBody Object param, HttpServletRequest request) {
ML5NgReelInfo info = JsonUtil.toObj(param.toString(), ML5NgReelInfo.class);
if (info == null) {
return ResultBean.newOkResult("fail");
}
log.info("uploadNgReel : [" + info.getNgPos() + "],barcode:[" + info.getBarcode() + "],posName:[" + info.getPosName() + "]type:[" + info.getMType() + "]inout:[" + info.getType() + "],msg[" + info.getNgMsg() + "]");
MicronDataCache.uploadNgReel(info);
return ResultBean.newOkResult("ok");
}
@ApiOperation("清空指定NG的NG料,参数 ngPos:1=左侧,2=右侧 ")
@PostMapping(value = "/clearNgPos")
@ResponseBody
@AnonymousAccess
public ResultBean clearNgPos( HttpServletRequest request) {
Integer ngPos =Integer.valueOf(request.getParameter("ngPos")) ;
log.info("clearNgPos : ngPos=" + ngPos);
MicronDataCache.clearNgPos(ngPos);
return ResultBean.newOkResult("clearNgPos " + ngPos + " ok");
}
// @ApiOperation("ML5设备状态更新") // @ApiOperation("ML5设备状态更新")
// @PostMapping(value = "ml5/updateStatus") // @PostMapping(value = "ml5/updateStatus")
......
...@@ -3,10 +3,10 @@ package com.neotel.smfcore.custom.micron1053.controller; ...@@ -3,10 +3,10 @@ package com.neotel.smfcore.custom.micron1053.controller;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.micron1053.bean.EquipMsg; import com.neotel.smfcore.custom.micron1053.bean.EquipMsg;
import com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo;
import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus; import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus;
import com.neotel.smfcore.custom.micron1053.bean.dto.ML5ShelfDto; import com.neotel.smfcore.custom.micron1053.bean.dto.ML5ShelfDto;
import com.neotel.smfcore.custom.micron1053.bean.dto.ML5StatusDto; import com.neotel.smfcore.custom.micron1053.bean.dto.ML5StatusDto;
import com.neotel.smfcore.custom.micron1053.enums.MicronEquipName;
import com.neotel.smfcore.custom.micron1053.util.MicronDataCache; import com.neotel.smfcore.custom.micron1053.util.MicronDataCache;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
...@@ -32,30 +33,22 @@ public class MicronML5Controller { ...@@ -32,30 +33,22 @@ public class MicronML5Controller {
@AnonymousAccess @AnonymousAccess
public ML5StatusDto ml5Status( ) { public ML5StatusDto ml5Status( ) {
ML5StatusDto resultDto = new ML5StatusDto(); ML5StatusDto resultDto = new ML5StatusDto();
MicronEquipStatus r1 = MicronDataCache.getStatus(MicronEquipName.ML5_R1.getName()); MicronEquipStatus mlL = MicronDataCache.getStatus("ML5-L");
MicronEquipStatus r2 = MicronDataCache.getStatus(MicronEquipName.ML5_R2.getName()); MicronEquipStatus mlR = MicronDataCache.getStatus("ML5-R");
MicronEquipStatus l1 = MicronDataCache.getStatus(MicronEquipName.ML5_L1.getName());
MicronEquipStatus l2 = MicronDataCache.getStatus(MicronEquipName.ML5_L2.getName());
resultDto.setL1Status(l1.getStatus()); resultDto.setL1Status(mlL.getP1status());
resultDto.setL2Status(l2.getStatus()); resultDto.setL2Status(mlL.getP2status());
resultDto.setR1Status(r1.getStatus()); resultDto.setR1Status(mlR.getP1status());
resultDto.setR2Status(r2.getStatus()); resultDto.setR2Status(mlR.getP2status());
resultDto.setNg1Count(l1.getNgCount()); resultDto.setNg1Count(mlL.getNgCount());
resultDto.setNg2Count(r1.getNgCount()); resultDto.setNg2Count(mlR.getNgCount());
List<EquipMsg> msgs = new ArrayList<>(); List<EquipMsg> msgs = new ArrayList<>();
if (r1.getMsgList() != null && r1.getMsgList().size() > 0) { if (mlL.getMsgList() != null && mlL.getMsgList().size() > 0) {
msgs.addAll(r1.getMsgList()); msgs.addAll(mlL.getMsgList());
} }
if (r2.getMsgList() != null && r2.getMsgList().size() > 0) { if (mlR.getMsgList() != null && mlR.getMsgList().size() > 0) {
msgs.addAll(r2.getMsgList()); msgs.addAll(mlR.getMsgList());
}
if (l1.getMsgList() != null && l1.getMsgList().size() > 0) {
msgs.addAll(l1.getMsgList());
}
if (l2.getMsgList() != null && l2.getMsgList().size() > 0) {
msgs.addAll(l2.getMsgList());
} }
if (msgs.size() > 0) { if (msgs.size() > 0) {
resultDto.setMsgList(msgs); resultDto.setMsgList(msgs);
...@@ -96,4 +89,13 @@ public class MicronML5Controller { ...@@ -96,4 +89,13 @@ public class MicronML5Controller {
return resultDto; return resultDto;
} }
@ApiOperation("ML5页面点击NG查看详情;参数 ngPos:1=左侧,2=右侧")
@GetMapping("/ngDetials")
@AnonymousAccess
public List<ML5NgReelInfo> ngDetials(Integer ngPos, HttpServletRequest servletRequest) {
List<ML5NgReelInfo> results=MicronDataCache.getNgDetials(ngPos);
return results;
}
} }
...@@ -20,7 +20,6 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil; ...@@ -20,7 +20,6 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.custom.micron1053.bean.EquipMsg; import com.neotel.smfcore.custom.micron1053.bean.EquipMsg;
import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus; import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus;
import com.neotel.smfcore.custom.micron1053.bean.dto.*; import com.neotel.smfcore.custom.micron1053.bean.dto.*;
import com.neotel.smfcore.custom.micron1053.enums.MicronEquipName;
import com.neotel.smfcore.custom.micron1053.util.MicronDataCache; import com.neotel.smfcore.custom.micron1053.util.MicronDataCache;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -60,12 +59,13 @@ public class MicronStatusController { ...@@ -60,12 +59,13 @@ public class MicronStatusController {
dto.setStatusMap(new HashMap<>()); dto.setStatusMap(new HashMap<>());
// ML5,CI,R1,R2,R3 // ML5,CI,R1,R2,R3
String[] names=new String[]{"ML5","CI","R1","R2","R3"}; String[] names=new String[]{"ML5-L","ML5-R","CI","R1","R2","R3"};
for (String name :names for (String name :names
) { ) {
MicronEquipStatus s=MicronDataCache.getStatus(name); MicronEquipStatus s=MicronDataCache.getStatus(name);
if(!s.timeOut()){ if(!s.timeOut()){
dto.getStatusMap().put(s.getEquipName(),s.getStatus() ); String newKey=s.getEquipName().replace("-","");
dto.getStatusMap().put(newKey,s.getStatus() );
// if(s.getMsgList()!=null&&s.getMsgList().size()>0) { // if(s.getMsgList()!=null&&s.getMsgList().size()>0) {
// dto.getMsgList().addAll(s.getMsgList()); // dto.getMsgList().addAll(s.getMsgList());
// } // }
...@@ -91,9 +91,15 @@ public class MicronStatusController { ...@@ -91,9 +91,15 @@ public class MicronStatusController {
) { ) {
boxList.add("M"+i); boxList.add("M"+i);
} }
for (MicronEquipName name : MicronEquipName.sbBoxList()){ // SBDH1, SBDH2, SBDH3, SBSH1, SBSH2
boxList.add(name.getName()); boxList.add("SBDH1");
} boxList.add("SBDH2");
boxList.add("SBDH3");
boxList.add("SBSH1");
boxList.add("SBSH2");
// for (MicronEquipName name : MicronEquipName.sbBoxList()){
// boxList.add(name.getName());
// }
for (String boxName : for (String boxName :
boxList) { boxList) {
...@@ -125,7 +131,7 @@ public class MicronStatusController { ...@@ -125,7 +131,7 @@ public class MicronStatusController {
private MicronEquipStatus getBoxEquip(String boxName,Locale locale) { private MicronEquipStatus getBoxEquip(String boxName,Locale locale) {
List<String> cids =getCidsByBoxName(boxName); List<String> cids =getCidsByBoxName(boxName);
MicronEquipStatus dto = new MicronEquipStatus(boxName, 0,0, System.currentTimeMillis(), new ArrayList<>()); MicronEquipStatus dto = new MicronEquipStatus(boxName, 0,0,0,0, System.currentTimeMillis(), new ArrayList<>());
List<StatusBean> statusBeans = new ArrayList<>(); List<StatusBean> statusBeans = new ArrayList<>();
for (String cid : for (String cid :
cids) { cids) {
......
...@@ -7,43 +7,43 @@ import java.util.List; ...@@ -7,43 +7,43 @@ import java.util.List;
/** /**
* Created by sunke on 2021/7/13. * Created by sunke on 2021/7/13.
*/ */
public enum MicronEquipName { //public enum MicronEquipName {
// ,,,,,M1-M8,SBDH1,SBDH2,SBDH3,SBSH1,SBSH2 //// ,,,,,M1-M8,SBDH1,SBDH2,SBDH3,SBSH1,SBSH2
//
ML5("ML5"), // ML5("ML5"),
CI("CI"), // CI("CI"),
R1("R1"), // R1("R1"),
R2("R2"), // R2("R2"),
R3("R3"), // R3("R3"),
SBDH1("SBDH1"), // SBDH1("SBDH1"),
SBDH2("SBDH2"), // SBDH2("SBDH2"),
SBDH3("SBDH3"), // SBDH3("SBDH3"),
SBSH1("SBSH1"), // SBSH1("SBSH1"),
SBSH2("SBSH2"), // SBSH2("SBSH2"),
ML5_R1("ML5-R1"), // ML5_R1("ML5-R1"),
ML5_R2("ML5-R2"), // ML5_R2("ML5-R2"),
ML5_L1("ML5-L1"), // ML5_L1("ML5-L1"),
ML5_L2("ML5-L2"); // ML5_L2("ML5-L2");
//
private String key; // private String key;
//
MicronEquipName(String key) { // MicronEquipName(String key) {
this.key = key; // this.key = key;
} // }
//
public String getKey() { // public String getKey() {
return key; // return key;
} // }
//
public void setKey(String key) { // public void setKey(String key) {
this.key = key; // this.key = key;
} // }
//
public String getName() { // public String getName() {
return name(); // return name();
} // }
//
public static List<MicronEquipName> sbBoxList() { // public static List<MicronEquipName> sbBoxList() {
return Lists.newArrayList(SBDH1, SBDH2, SBDH3, SBSH1, SBSH2); // return Lists.newArrayList(SBDH1, SBDH2, SBDH3, SBSH1, SBSH2);
} // }
} //}
...@@ -3,13 +3,16 @@ package com.neotel.smfcore.custom.micron1053.util; ...@@ -3,13 +3,16 @@ package com.neotel.smfcore.custom.micron1053.util;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.micron1053.bean.EquipMsg; import com.neotel.smfcore.custom.micron1053.bean.EquipMsg;
import com.neotel.smfcore.custom.micron1053.bean.ML5NgReelInfo;
import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus; import com.neotel.smfcore.custom.micron1053.bean.MicronEquipStatus;
import lombok.extern.slf4j.Slf4j;
import java.util.*; import java.util.*;
/** /**
* 设备状态缓存类 * 设备状态缓存类
*/ */
@Slf4j
public class MicronDataCache { public class MicronDataCache {
// public static ML5StatusBean ml5StatusBean=null; // public static ML5StatusBean ml5StatusBean=null;
...@@ -145,4 +148,24 @@ public class MicronDataCache { ...@@ -145,4 +148,24 @@ public class MicronDataCache {
Object value = deviceDataMap.getOrDefault(key, ""); Object value = deviceDataMap.getOrDefault(key, "");
return value; return value;
} }
public static Map<Integer,List<ML5NgReelInfo>> ml5NgMap=new HashMap<>();
public static void uploadNgReel(ML5NgReelInfo info) {
List<ML5NgReelInfo> list=ml5NgMap.getOrDefault(info.getNgPos(),new ArrayList<>());
list.add(info);
ml5NgMap.put(info.getNgPos(),list);
}
public static void clearNgPos(Integer ngPos) {
ml5NgMap.remove(ngPos);
}
public static List<ML5NgReelInfo> getNgDetials(Integer ngPos){
List<ML5NgReelInfo> list=ml5NgMap.getOrDefault(ngPos,new ArrayList<>());
return list;
}
} }
...@@ -304,6 +304,12 @@ smfcore.diagnosis=Diagnosis ...@@ -304,6 +304,12 @@ smfcore.diagnosis=Diagnosis
smfcore.helps=Help smfcore.helps=Help
smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165 smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165
smfcore.status=Status smfcore.status=Status
smfcore.storagePos.batch=\u6279\u6B21
smfcore.humiture.cid=CID
smfcore.humiture.temperature=\u6E29\u5EA6
smfcore.humiture.humiture=\u6E7F\u5EA6
smfcore.humiture.createDate=\u521B\u5EFA\u65F6\u95F4
smfcore.humiture.updateDate=\u66F4\u65B0\u65F6\u95F4
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0} #smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F #smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
...@@ -303,3 +303,9 @@ smfcore.diagnosis=Diagnosis ...@@ -303,3 +303,9 @@ smfcore.diagnosis=Diagnosis
smfcore.helps=Help smfcore.helps=Help
smfcore.error.storage.noPos={0}'s cell [{1}] is full and cannot be added smfcore.error.storage.noPos={0}'s cell [{1}] is full and cannot be added
smfcore.status=Status smfcore.status=Status
smfcore.storagePos.batch=Material Batch
smfcore.humiture.cid=CID
smfcore.humiture.temperature=Temperature
smfcore.humiture.humiture=Humidity
smfcore.humiture.createDate=Create Time
smfcore.humiture.updateDate=Update Time
\ No newline at end of file \ No newline at end of file
...@@ -300,3 +300,9 @@ smfcore.diagnosis=Diagnosis ...@@ -300,3 +300,9 @@ smfcore.diagnosis=Diagnosis
smfcore.helps=Help smfcore.helps=Help
smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165 smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165
smfcore.status=Status smfcore.status=Status
smfcore.storagePos.batch=\u54C1\u76EE\u30ED\u30C3\u30C8
smfcore.humiture.cid=CID
smfcore.humiture.temperature=\u6E29\u5EA6
smfcore.humiture.humiture=\u6E7F\u5EA6
smfcore.humiture.createDate=\u521B\u5EFA\u65F6\u95F4
smfcore.humiture.updateDate=\u66F4\u65B0\u65F6\u95F4
...@@ -300,3 +300,9 @@ smfcore.diagnosis=Diagnosis ...@@ -300,3 +300,9 @@ smfcore.diagnosis=Diagnosis
smfcore.helps=Help smfcore.helps=Help
smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165 smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EE1,\u65E0\u6CD5\u7EE7\u7EED\u653E\u5165
smfcore.status=Status smfcore.status=Status
smfcore.storagePos.batch=\u6279\u6B21
smfcore.humiture.cid=CID
smfcore.humiture.temperature=\u6E29\u5EA6
smfcore.humiture.humiture=\u6E7F\u5EA6
smfcore.humiture.createDate=\u521B\u5EFA\u65F6\u95F4
smfcore.humiture.updateDate=\u66F4\u65B0\u65F6\u95F4
\ No newline at end of file \ No newline at end of file
...@@ -301,3 +301,9 @@ smfcore.diagnosis=Diagnosis ...@@ -301,3 +301,9 @@ smfcore.diagnosis=Diagnosis
smfcore.helps=Help smfcore.helps=Help
smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EFF,\u7121\u6CD5\u7E7C\u7E8C\u653E\u5165 smfcore.error.storage.noPos={0}\u7684\u6599\u683C[{1}]\u5DF2\u6EFF,\u7121\u6CD5\u7E7C\u7E8C\u653E\u5165
smfcore.status=Status smfcore.status=Status
smfcore.storagePos.batch=\u6279\u6B21
smfcore.humiture.cid=CID
smfcore.humiture.temperature=\u6E29\u5EA6
smfcore.humiture.humiture=\u6E7F\u5EA6
smfcore.humiture.createDate=\u521B\u5EFA\u65F6\u95F4
smfcore.humiture.updateDate=\u66F4\u65B0\u65F6\u95F4
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!