Commit f63fb992 zshaohui

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/resources/messages.properties
#	src/main/resources/messages_en_US.properties
#	src/main/resources/messages_ja_JP.properties
#	src/main/resources/messages_zh_CN.properties
#	src/main/resources/messages_zh_TW.properties
2 个父辈 93de5194 82db65f6
......@@ -703,15 +703,23 @@ public class StatusBean {
return returnMsg;
}
public String getErrorMsg(Locale locale) {
public String getErrorMsg(Locale locale){
String msg=getMsgByType(locale,MessageType.ERROR.name() );
if(ObjectUtil.isEmpty(msg)){
msg=getMsgByType(locale,MessageType.WARNING.name());
}
return msg;
}
public String getMsgByType(Locale locale,String msgType) {
if (ObjectUtil.isEmpty(this.msgList)) {
return "";
}
for (MsgInfo msg :
msgList) {
if (msg.getType().toUpperCase().equals(MessageType.ERROR.name())) {
return msg.getMsg();
if (msg.getType().toUpperCase().equals(msgType)) {
return GetMsgStr(msg,locale);
}
}
return "";
......
......@@ -432,6 +432,10 @@ public class BaseDeviceHandler implements IDeviceHandler {
if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId());
log.info("出库已在库位中的物料[" + barcodeSave.getBarcode() + "]");
String msg=MessageUtils.getText("smfcore.error.barcode.inStorage",new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()},MessageUtils.getDefaultLocal(),
"[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中");
taskService.checkout(storage, pos, true, true, "", "", msg);
throw new ValidateException("smfcore.error.barcode.inStorage", "[ " + barcodeSave.getBarcode() + "]已在" + storage.getName() + "[" + pos.getPosName() + "]中", new String[]{barcodeSave.getBarcode(), storage.getName(), pos.getPosName()});
}
......
......@@ -2,13 +2,17 @@ package com.neotel.smfcore.core.equipment.bean;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.core.language.util.MessageUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.Locale;
@ToString
@Data
@AllArgsConstructor
@NoArgsConstructor
public class EquipMsg {
/**
* 设备模块
......
......@@ -28,6 +28,6 @@ public class Equipment extends BasePo implements Serializable {
private boolean available = true;
public boolean isNEOSCAN() {
return EquipmentType.NEOSCAN.name().equals(type);
return EquipmentType.NEOSCAN.name().equals(type)||EquipmentType.NS200.name().equals(type);
}
}
......@@ -116,6 +116,92 @@ public class StoragePosController {
}
@ApiOperation("导出库位列表")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('storagePos:list')")
public void download(HttpServletResponse response, StoragePosQueryCriteria criteria, Pageable pageable, HttpServletRequest request) throws IOException {
if (criteria.getStorageIdList() != null && criteria.getStorageIdList().contains("0")) {
criteria.setStorageIdList(null);
}
criteria.setStorageIdList(QueryHelp.getGroupStorageIdList(criteria.getStorageIdList()));
String blurry = criteria.getBlurry();
if(!Strings.isNullOrEmpty(blurry)){
//去除库位中的SOxxxx
blurry = blurry.substring(blurry.indexOf("-")+1);
criteria.setBlurry(blurry);
}
Locale locale = request.getLocale();
String enable=MessageUtils.getText("smfcore.storagePos.yes",locale,"是");
String noEnable= MessageUtils.getText("smfcore.storagePos.no",locale,"否");
Query query = QueryHelp.getQuery(criteria);
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.storagePos.storageName",locale,"设备名称")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.posName",locale,"库位号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.column",locale,"列")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.magazine",locale,"模组")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.layer",locale,"层")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.slot",locale,"槽位")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.available",locale,"是否可用")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.barcode",locale,"条码")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.partNumber",locale,"料件编号")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.plateSize",locale,"料盘尺寸")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.w",locale,"直径")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.h",locale,"厚度")));
return header;
}
@Override
public List<List<Object>> getPageData(Query query, Pageable pageable) {
List<List<Object>> dataList = new ArrayList<>();
List<Map<String, Object>> list = new ArrayList<>();
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
for (int i=0;i<StoragePosDtos.size();i++){
Storage storage=dataCache.getStorageById(StoragePosDtos.get(i).getStorageId());
if(storage!=null){
StoragePosDtos.get(i).setStorageName(storage.getName());
}
}
for (StoragePosDto pos : StoragePosDtos) {
List<Object> data = new ArrayList<>();
data.add(pos.getStorageName());
data.add(pos.getPosName());
data.add(pos.getColumn());
data.add(pos.getMagazine());
data.add(pos.getLayer());
data.add(pos.getSlot());
data.add(pos.isEnabled()?(enable):noEnable);
if(pos.getBarcode()!=null){
data.add(pos.getBarcode().getBarcode());
data.add(pos.getBarcode().getPartNumber());
data.add(pos.getBarcode().getPlateSize()+"X"+pos.getBarcode().getHeight());
}else{
data.add("");
data.add("");
data.add("");
}
data.add(pos.getW());
data.add(pos.getH());
dataList.add(data);
}
return dataList;
}
});
}
@ApiOperation("删除指定料仓所有库位")
@PutMapping("/removeAllPos")
@PreAuthorize("@el.check('storagePos:edit')")
......@@ -410,6 +496,9 @@ public class StoragePosController {
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.amount",locale,"数量")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.plateSize",locale,"料盘尺寸")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.w",locale,"直径")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.h",locale,"厚度")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.putInTime",locale,"首次入库时间")));
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.storagePos.putInDate",locale,"入库时间")));
......@@ -441,6 +530,9 @@ public class StoragePosController {
data.add(pos.getPosName());
data.add(pos.getBarcode().getLockName());
data.add(pos.getBarcode().getAmount());
data.add(pos.getBarcode().getPlateSize()+"X"+pos.getBarcode().getHeight());
data.add(pos.getW());
data.add(pos.getH());
data.add(putInTime);
data.add(dateFormat.format(pos.getBarcode().getPutInDate()));
dataList.add(data);
......
......@@ -195,7 +195,11 @@ public class DevicesStatusUtil {
}
}
if (newMsg) {
DeviceMessageUtil.addDeviceMessage(cid, MessageType.ERROR.name(), msg.getMoudle(), msg.getMsgKey(), msg.getMsg(), msg.getMsgParam(),msg.getAlarmType(),msg.getAlarmCode());
String msgType= msg.getType();
if(ObjectUtil.isEmpty(msgType)){
msgType=MessageType.ERROR.name();
}
DeviceMessageUtil.addDeviceMessage(cid, msgType, msg.getMoudle(), msg.getMsgKey(), msg.getMsg(), msg.getMsgParam(),msg.getAlarmType(),msg.getAlarmCode());
}
}
......
......@@ -8,6 +8,7 @@ import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.equipment.bean.EquipStatusBean;
import com.neotel.smfcore.core.equipment.service.po.Equipment;
import com.neotel.smfcore.core.equipment.util.EquipmentCache;
import com.neotel.smfcore.core.storage.service.po.Storage;
......@@ -52,7 +53,7 @@ public class DEIF20861Controller {
}
Map<String, BoxStatusBean> boxStatusMap = statusBean.getBoxStatus();
int status = -1;
String shelfS = statusBean.getData().getOrDefault("shelfState", "OFFLINE");
String shelfS = statusBean.getData().getOrDefault("shelfStatus", "");
String hserial = statusBean.getData().getOrDefault("hSerial", "");
String shelfType = statusBean.getData().getOrDefault("shelfType", "");
if (boxStatusMap != null) {
......@@ -62,9 +63,20 @@ public class DEIF20861Controller {
}
}
if (status == StorageConstants.STATUS.OFFLINE || statusBean.timeOut()) {
//离线
// OFFLINE=离线;
// IDLE=空闲;
// LOADING=入库中;
// UNLOADING=出库中;
// NEED_EMPTY=需要空料串出库;
// EMPTY_OUT=空料串需要取走
// FULL_OUT=满料串需要取走
if (status==-1|| status == StorageConstants.STATUS.OFFLINE || statusBean.timeOut()) {
//设备离线
shelfS = "OFFLINE";
}else{
if(ObjectUtil.isEmpty(shelfS)){
shelfS="IDLE";
}
}
Map<String, Object> itemMap = new HashMap<>();
itemMap.put("cid", storage.getCid());
......@@ -137,6 +149,20 @@ public class DEIF20861Controller {
@RequestMapping("/nsShelfInfo")
@AnonymousAccess
public ResultBean nsShelfInfo( @RequestBody Map<String, Object> paramMap) {
// 定时通信,data需要增加料串状态
//
// * key=inShelfStatus ,表示入口料串状态:
// * key=inShelfType 表示入口料串类型 smallReel, bigReel, tray
// *
// * key=outShelfStatus ,表示出口料串状态:
// * key=outShelfType 表示出口料串类型 smallReel, bigReel, tray
// 料串状态定义 IDLE=空闲;
// LOADING=入库中;
// UNLOADING=出库中;
// NEED_EMPTY=需要空料串出库;
// EMPTY_OUT=空料串需要取走
// FULL_OUT=满料串需要取走
Collection<Equipment> storageList = Lists.newArrayList();
storageList.addAll(equipmentCache.getAllEquipment().values());
......@@ -145,24 +171,26 @@ public class DEIF20861Controller {
if(!equipment.isNEOSCAN()){
continue;
}
StatusBean statusBean = DevicesStatusUtil.getStatusBean(equipment.getCid());
if (statusBean == null) {
statusBean = new StatusBean();
}
Map<String, BoxStatusBean> boxStatusMap = statusBean.getBoxStatus();
EquipStatusBean equipStatus = EquipStatusUtil.getStatusBean(equipment.getCid());
int status = -1;
String outShelfStatus = statusBean.getData().getOrDefault("outShelfStatus ", "OFFLINE");
String inShelfStatus = statusBean.getData().getOrDefault("inShelfStatus ", "OFFLINE");
if (boxStatusMap != null) {
BoxStatusBean boxStatusBean = boxStatusMap.get("1");
if (boxStatusBean != null) {
status = boxStatusBean.getStatus();
}
if (equipStatus == null) {
equipStatus = new EquipStatusBean();
}else{
status=equipStatus.getStatus();
}
if (status == StorageConstants.STATUS.OFFLINE || statusBean.timeOut()) {
//离线
String outShelfStatus = equipStatus.getData().getOrDefault("outShelfStatus", "").toString();
String inShelfStatus = equipStatus.getData().getOrDefault("inShelfStatus", "").toString();
if(status==1&&(!equipStatus.timeOut())){
if(ObjectUtil.isEmpty(outShelfStatus)){
outShelfStatus="IDLE";
}
if(ObjectUtil.isEmpty(inShelfStatus))
{
inShelfStatus="IDLE";
}
}else {
outShelfStatus = "OFFLINE";
inShelfStatus="OFFLINE";
inShelfStatus = "OFFLINE";
}
Map<String, Object> itemMap = new HashMap<>();
itemMap.put("cid", equipment.getCid());
......
......@@ -466,7 +466,8 @@ public class PanaApiController extends BaseSmfApiListener {
return barcode;
}else{
String errorMsg = "PanaCIM [" + barcode.getBarcode() + "] NG:"+ ErrorCode;
throw new ValidateException(errorMsg, "PanaCIM验证失败");
log.error(errorMsg);
throw new ValidateException(errorMsg, errorMsg);
}
}
......@@ -551,7 +552,12 @@ public class PanaApiController extends BaseSmfApiListener {
}
}
}
throw new ValidateException(errorMsg, "PanaCIM验证失败");
if(ObjectUtil.isEmpty(errorMsg)){
//
errorMsg="PanaCIM verification failure";
log.error(errorMsg);
}
throw new ValidateException(errorMsg, errorMsg);
}else{
log.info("没有配置PanaCIM条码检测接口,查找setConfiguration注册的IP 及端口");
......
......@@ -78,8 +78,8 @@ public class ReplaceQtyApiHandler extends DefaultSmfApiListener {
return barcode;
}
} catch (Exception e) {
log.error("入库修改数量接口出错:" + e.getMessage());
throw new ValidateException("smfcore.mesApi.inCheck.error","修改数量出错:" + e.getMessage());
log.error("入库修改数量接口出错:" + e.toString());
throw new ValidateException("smfcore.mesApi.inCheck.error","修改数量出错:"+e.toString());
}
return null;
}
......
......@@ -388,4 +388,15 @@ smfcore.msg.op.fail=\u64CD\u4F5C\u5931\u8D25
smfcore.equip.notExist=\u8BBE\u5907\u4E0D\u5B58\u5728
smfcore.order.finished=\u5DE5\u5355[{0}]\u7684\u4EFB\u52A1\u5DF2\u5168\u90E8\u5B8C\u6210
smfcore.spkanban=SP\u4EEA\u8868\u76D8
smfcore.neximWorkOrder=Nexim \u5DE5\u5355
\ No newline at end of file
smfcore.neximWorkOrder=Nexim \u5DE5\u5355
smfcore.storagePos.plateSize=\u6599\u76D8\u5C3A\u5BF8
smfcore.storagePos.w=\u76F4\u5F84
smfcore.storagePos.h=\u539A\u5EA6
smfcore.storagePos.storageName=\u8BBE\u5907\u540D\u79F0
smfcore.storagePos.column=\u5217
smfcore.storagePos.magazine=\u6A21\u7EC4
smfcore.storagePos.layer=\u5C42
smfcore.storagePos.slot=\u69FD\u4F4D
smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes=\u662F
smfcore.storagePos.no=\u5426
\ No newline at end of file
......@@ -379,4 +379,15 @@ smfcore.msg.op.fail=failure of an operation
smfcore.equip.notExist=Device does not exist
smfcore.order.finished=workorder[{0}] has completed all of its tasks
smfcore.spkanban=SP Dash Board
smfcore.neximWorkOrder=Nexim WorkOrder
\ No newline at end of file
smfcore.neximWorkOrder=Nexim WorkOrder
smfcore.storagePos.plateSize=Detected Size
smfcore.storagePos.w=Diameter
smfcore.storagePos.h=Thickness
smfcore.storagePos.storageName=Equipment Name
smfcore.storagePos.column=Column
smfcore.storagePos.magazine=Magazine
smfcore.storagePos.layer=Layer
smfcore.storagePos.slot=Slot
smfcore.storagePos.available=Available
smfcore.storagePos.yes=Yes
smfcore.storagePos.no=No
\ No newline at end of file
......@@ -375,4 +375,15 @@ smfcore.msg.op.fail=\u64CD\u4F5C\u5931\u8D25
smfcore.equip.notExist=\u8BBE\u5907\u4E0D\u5B58\u5728
smfcore.order.finished=\u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC[{0}]\u306E\u30BF\u30B9\u30AF\u306F\u3059\u3079\u3066\u5B8C\u4E86\u3057\u307E\u3057\u305F
smfcore.spkanban=\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9
smfcore.neximWorkOrder=Nexim \u5DE5\u55AE
\ No newline at end of file
smfcore.neximWorkOrder=Nexim \u5DE5\u55AE
smfcore.storagePos.plateSize=\u6599\u76D8\u5C3A\u5BF8
smfcore.storagePos.w=\u76F4\u5F84
smfcore.storagePos.h=\u539A\u3055
smfcore.storagePos.storageName=\u8BBE\u5907\u540D\u79F0
smfcore.storagePos.column=\u5217
smfcore.storagePos.magazine=\u6A21\u7EC4
smfcore.storagePos.layer=\u5C42
smfcore.storagePos.slot=\u69FD\u4F4D
smfcore.storagePos.available=\u5229\u7528\u53EF\u5426
smfcore.storagePos.yes=\u662F
smfcore.storagePos.no=\u5426
\ No newline at end of file
......@@ -375,4 +375,15 @@ smfcore.msg.op.fail=\u64CD\u4F5C\u5931\u8D25
smfcore.equip.notExist=\u8BBE\u5907\u4E0D\u5B58\u5728
smfcore.order.finished=\u5DE5\u5355[{0}]\u7684\u4EFB\u52A1\u5DF2\u5168\u90E8\u5B8C\u6210
smfcore.spkanban=SP\u4EEA\u8868\u76D8
smfcore.neximWorkOrder=Nexim \u5DE5\u5355
\ No newline at end of file
smfcore.neximWorkOrder=Nexim \u5DE5\u5355
smfcore.storagePos.plateSize=\u6599\u76D8\u5C3A\u5BF8
smfcore.storagePos.w=\u76F4\u5F84
smfcore.storagePos.h=\u539A\u5EA6
smfcore.storagePos.storageName=\u8BBE\u5907\u540D\u79F0
smfcore.storagePos.column=\u5217
smfcore.storagePos.magazine=\u6A21\u7EC4
smfcore.storagePos.layer=\u5C42
smfcore.storagePos.slot=\u69FD\u4F4D
smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes=\u662F
smfcore.storagePos.no=\u5426
\ No newline at end of file
......@@ -375,4 +375,15 @@ smfcore.msg.op.fail=\u64CD\u4F5C\u5931\u6557
smfcore.equip.notExist=\u8A2D\u5099\u4E0D\u5B58\u5728
smfcore.order.finished=\u5DE5\u55AE[{0}]\u7684\u4EFB\u52D9\u5DF2\u5168\u90E8\u5B8C\u6210
smfcore.spkanban=SP\u5100\u9336\u76E4
smfcore.neximWorkOrder=Nexim \u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u30A2\u30A6\u30C8
\ No newline at end of file
smfcore.neximWorkOrder=Nexim \u30EF\u30FC\u30AF\u30AA\u30FC\u30C0\u30FC\u30A2\u30A6\u30C8
smfcore.storagePos.plateSize=\u6599\u76D8\u5C3A\u5BF8
smfcore.storagePos.w=\u76F4\u5F84
smfcore.storagePos.h=\u539A\u5EA6
smfcore.storagePos.storageName=\u8A2D\u5099\u540D\u7A31
smfcore.storagePos.column=\u5217
smfcore.storagePos.magazine=\u6A21\u7D44
smfcore.storagePos.layer=\u5C64
smfcore.storagePos.slot=\u69FD\u4F4D
smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes=\u662F
smfcore.storagePos.no=\u5426
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!