Commit 5897ca5c zshaohui

1.7/19 抛送库位使用情况

2.人工线功能提交
1 个父辈 2f8db4fe
......@@ -2362,8 +2362,8 @@ public class LiteOrderCache {
}
private List<StoragePos> findTargetPos(List<StoragePos> numbers, int targetNum) {
numbers.sort((a, b) -> Integer.valueOf(b.getBarcode().getQty()).compareTo(Integer.valueOf(a.getBarcode().getQty())));
Collections.sort(numbers, (s1, s2) -> Long.compare(s2.getBarcode().getPutInTime(), s1.getBarcode().getPutInTime()));
numbers.sort((a, b) -> Integer.valueOf(b.getBarcode().getQty()).compareTo(Integer.valueOf(a.getBarcode().getQty())));
int target = targetNum;
List<StoragePos> result = new ArrayList<>();
for (int i = 0; i < 3000; i++) {
......
......@@ -36,6 +36,8 @@ import com.neotel.smfcore.custom.lizhen.innerBox.bean.StorageExport;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.lizhen.innerBox.util.StorageExportUtil;
import com.neotel.smfcore.custom.lizhen.virtual.service.manager.IVirInventoryManager;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -213,6 +215,7 @@ public class TaskService {
if (extendType != -1) {
task.setExtendType(extendType);
}
task.setLoc(TaskLocUtil.MW);
task.setCartonId(barcode.getCartonId());
addTaskToExecute(task);
//}
......
......@@ -18,6 +18,8 @@ public class KafkaConfig {
public static final String MACHINEPARAMETER_TOPIC = "MachineParameter";
public static final String SMARTWH_TOPIC = "SmartWH";
public static final String LINE_CID = "line";
}
......@@ -3,12 +3,14 @@ package com.neotel.smfcore.custom.luxsan.factory_c.wipstor.kafka.service;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
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;
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.wipstor.kafka.bean.Heartbeat;
......@@ -25,9 +27,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.*;
//@Async
@Service
......@@ -95,6 +95,45 @@ public class KafkaService {
log.info("结束推送原材料仓tower数据");
}
@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","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){
dataMap.put("Status",1+"");
}
dataList.add(dataMap);
}
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("MachineID",StorageNameConfig.semiFinishedTower);
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));
}
//@Scheduled(fixedRate = 1000 * 10)
public void sendHeartbeat() {
Heartbeat heartbeat = new Heartbeat();
......
......@@ -6,5 +6,6 @@ public class TaskLocUtil {
public static final String OUT = "semiFinished_Out";
public static final String NG = "semiFinished_ng";
public static final String MW = "semiFinished_mw"; //人工工位
public static final String MW_IN = "semiFinished_mw_in"; //人工工位
public static final String RR = "semiFinished_rr"; //还原补箱 restoreReplace
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!