Commit 0b3f6abe zshaohui

1.库位有变动,上报到中控

1 个父辈 5897ca5c
...@@ -19,6 +19,7 @@ import com.neotel.smfcore.custom.luxsan.api.bean.util.LuxsanApiResult; ...@@ -19,6 +19,7 @@ import com.neotel.smfcore.custom.luxsan.api.bean.util.LuxsanApiResult;
import com.neotel.smfcore.custom.luxsan.api.enums.LuxsanApiEnum; import com.neotel.smfcore.custom.luxsan.api.enums.LuxsanApiEnum;
import com.neotel.smfcore.custom.luxsan.common.constants.BusinessConst; import com.neotel.smfcore.custom.luxsan.common.constants.BusinessConst;
import com.neotel.smfcore.custom.luxsan.common.util.RequestURLUtil; import com.neotel.smfcore.custom.luxsan.common.util.RequestURLUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.kafka.service.KafkaService;
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.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -33,6 +34,9 @@ public class LuxsanApi extends DefaultSmfApiListener { ...@@ -33,6 +34,9 @@ public class LuxsanApi extends DefaultSmfApiListener {
@Autowired @Autowired
private IStoragePosManager storagePosManager; private IStoragePosManager storagePosManager;
@Autowired
private KafkaService kafkaService;
/** /**
* QueryBin:储位查询 * QueryBin:储位查询
* *
...@@ -1212,10 +1216,18 @@ public class LuxsanApi extends DefaultSmfApiListener { ...@@ -1212,10 +1216,18 @@ public class LuxsanApi extends DefaultSmfApiListener {
return result; return result;
} }
@Override
public void inTaskStatusChange(String inNotifyUrl, DataLog task) {
if (task.isFinished()){
kafkaService.sendPosChange(task.getPosName(), "1");
}
}
@Override @Override
public void outTaskStatusChange(String outNotifyUrl, DataLog task) { public void outTaskStatusChange(String outNotifyUrl, DataLog task) {
//pickingIssue(new PickingIssueRequest()); if (task.isOutFromPos() || task.isFinished()) {
kafkaService.sendPosChange(task.getPosName(), "0");
}
} }
@Override @Override
......
...@@ -98,7 +98,7 @@ public class KafkaService { ...@@ -98,7 +98,7 @@ public class KafkaService {
@Scheduled(cron = "0 0 7,19 * * ? ") @Scheduled(cron = "0 0 7,19 * * ? ")
//@Scheduled(fixedRate = 1000 * 5) //@Scheduled(fixedRate = 1000 * 5)
public void setPosUseInfo(){ public void sendPosUseInfo(){
List<String> storageIdList = new ArrayList<>(); List<String> storageIdList = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) { for (Storage storage : dataCache.getAllStorage().values()) {
if (!storage.isVirtual()) { if (!storage.isVirtual()) {
...@@ -132,6 +132,26 @@ public class KafkaService { ...@@ -132,6 +132,26 @@ public class KafkaService {
} }
//status为1时入库 status为0 为出库
public void sendPosChange(String posName,String status){
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("MachineID",StorageNameConfig.semiFinishedTower);
List<Map<String,String>> dataList = new ArrayList<>();
Map<String,String> dataMap = new HashMap<>();
dataMap.put("Storage",posName);
dataMap.put("Status",status);
dataList.add(dataMap);
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) //@Scheduled(fixedRate = 1000 * 10)
......
...@@ -5,9 +5,9 @@ api: ...@@ -5,9 +5,9 @@ api:
name: #Lizhen name: #Lizhen
inCheckUrl: #http://10.190.25.124:8001/Npm/WmsCheckReelfob #禁用料 inCheckUrl: #http://10.190.25.124:8001/Npm/WmsCheckReelfob #禁用料
batchCheckUrl: #http://172.30.60.117:8001/Npm/WmsCheckReelfob_Batch #批量禁用料 batchCheckUrl: #http://172.30.60.117:8001/Npm/WmsCheckReelfob_Batch #批量禁用料
outNotifyUrl: #http://172.30.170.148:8082/SmtAutoWH/Save2DReelInfo #保存物料(外仓配置) outNotifyUrl: 1
outNotifyUrlPK: #http://172.30.170.148:8001/Sct/SaveReelInfo #PK发料保存(外仓配置) outNotifyUrlPK: #http://172.30.170.148:8001/Sct/SaveReelInfo #PK发料保存(外仓配置)
inNotifyUrl: #http://10.190.25.124:8082/SmtAutoWH/Save2DReelInfo #保存物料(内仓配置) inNotifyUrl: 1
fetchOrderUrl: #http://172.30.170.148:8082/SmtAutoWH/GetWoPickingList #获取工单 fetchOrderUrl: #http://172.30.170.148:8082/SmtAutoWH/GetWoPickingList #获取工单
barcodeInfoUrl: #http://10.190.25.124:8001/Sct/GetReelInfo #mes数量 barcodeInfoUrl: #http://10.190.25.124:8001/Sct/GetReelInfo #mes数量
fetchGRUrl: #http://10.42.25.199:8082/api/wcs/fetchGR #gr标签 fetchGRUrl: #http://10.42.25.199:8082/api/wcs/fetchGR #gr标签
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!