Commit 69a85b13 zshaohui

每天7点 19点抛送货架使用情况 到中控

1 个父辈 353f6454
......@@ -1320,8 +1320,8 @@ public class CDeviceController {
}
if (checkType == LiteorderCheckType.PICKING_CHECKOUT){
try {
// LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, orderNo, pkItemId, barcode.getPartNumber()
// , barcode.getWarehouseCode(), brand, face, batchCode, Arrays.asList(barcode.getBarcode())));
LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, orderNo, pkItemId, barcode.getPartNumber()
, barcode.getWarehouseCode(), brand, face, batchCode, Arrays.asList(barcode.getBarcode())));
} catch (Exception e) {
saveMessage(MessageType.ERROR.name(),currentLoc,"通知WMS失败:"+e.getMessage()+"隔口号为"+boxPar);
log.info(barcode.getBarcode()+"通知WMS失败:"+e.getMessage()+"隔口号为"+boxPar);
......@@ -1330,8 +1330,8 @@ public class CDeviceController {
} else {
//人工出库,
try {
//LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, "SMFW" + System.currentTimeMillis(), "0", barcode.getPartNumber()
// , barcode.getWarehouseCode(), "", "", "", Arrays.asList(barcode.getBarcode())));
LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, "SMFW" + System.currentTimeMillis(), "0", barcode.getPartNumber()
, barcode.getWarehouseCode(), "", "", "", Arrays.asList(barcode.getBarcode())));
} catch (Exception e) {
saveMessage(MessageType.ERROR.name(),currentLoc,"通知WMS失败:"+e.getMessage()+"隔口号为"+boxPar);
log.info(barcode.getBarcode()+"通知WMS失败:"+e.getMessage()+"隔口号为"+boxPar);
......@@ -1386,7 +1386,7 @@ public class CDeviceController {
resultMap.put("platSize",barcode.getPlateSize()+"");
resultMap.put("height",barcode.getHeight()+"");
//kafkaService.sendMachineParameterStackerAndBox(stacker,currentLoc,0,boxBarcode.getBarcode(),barcode.getAmount(),4);
kafkaService.sendMachineParameterStackerAndBox(stacker,currentLoc,0,boxBarcode.getBarcode(),barcode.getAmount(),4);
return ResultBean.newOkResult(resultMap);
}
......
......@@ -16,4 +16,6 @@ public class KafkaConfig {
* MachineParameter
*/
public static final String MACHINEPARAMETER_TOPIC = "MachineParameter";
public static final String SMARTWH_TOPIC = "SmartWH";
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache;
......@@ -12,6 +13,7 @@ import com.neotel.smfcore.core.equipment.bean.EquipMsg;
import com.neotel.smfcore.core.equipment.bean.EquipStatusBean;
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.IDataLogManager;
import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.*;
......@@ -26,10 +28,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
//@Async
......@@ -134,9 +133,9 @@ public class KafkaService {
heartbeat.setMachineID(machineId);
heartbeat.setTopicType(KafkaConfig.HEARTBEAT_TOPIC);
String statusStr = JSON.toJSONString(heartbeat);
log.info("原材料仓抛送心跳信息:" + KafkaConfig.HEARTBEAT_TOPIC + "内容为:" + statusStr);
//log.info("原材料仓抛送心跳信息:" + KafkaConfig.HEARTBEAT_TOPIC + "内容为:" + statusStr);
ListenableFuture future = kafkaTemplate.send(KafkaConfig.HEARTBEAT_TOPIC, statusStr);
log.info("原材料仓抛送心跳信息结束为:" + JSON.toJSONString(future));
//log.info("原材料仓抛送心跳信息结束为:" + JSON.toJSONString(future));
}
}
}
......@@ -210,6 +209,43 @@ public class KafkaService {
log.info("结束推送原材料仓,入料和出料机构设备状态信息");
}
@Scheduled(cron = "0 0 7,19 * * ? ")
//@Scheduled(fixedRate = 1000 * 5)
public void setPosUseInfo(){
List<String> storageIdList = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) {
if (!storage.isVirtual()) {
storageIdList.add(storage.getId());
}
}
Query query = new Query(Criteria.where("storageId").in(storageIdList));
query.fields().include("barcode.status","posName");
List<Map<String,String>> dataList = new ArrayList<>();
List<StoragePos> storagePosList = storagePosManager.findByQuery(query);
for (StoragePos pos : storagePosList) {
Map<String,String> dataMap = new HashMap<>();
dataMap.put("Storage",pos.getPosName());
dataMap.put("Status",0+"");
Barcode barcode = pos.getBarcode();
if (barcode != null){
if (barcode.getStatus() == BARCODE_STATUS.IN_STORE){
dataMap.put("Status",1+"");
}
}
dataList.add(dataMap);
}
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("MachineID",StorageNameConfig.rawMaterialTower);
paramMap.put("data",dataList);
String statusStr = JSON.toJSONString(paramMap);
log.info("原材料仓抛送货架使用情况:" + KafkaConfig.SMARTWH_TOPIC + "内容为:" + statusStr);
ListenableFuture future = kafkaTemplate.send(KafkaConfig.SMARTWH_TOPIC, statusStr);
log.info("原材料仓抛送货架使用情况:" + JSON.toJSONString(future));
}
public static Map<String, StackerKafkaCache> stackerInMap = new ConcurrentHashMap<>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!