Commit 17e9fc47 zshaohui

迈征出料口做成可配置项

1 个父辈 8a524466
package com.neotel.smfcore.custom.lizhen.innerBox.rest;
import com.alibaba.fastjson.JSON;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.lizhen.innerBox.util.StorageExportUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RequestMapping("/storageExport")
@RestController
public class StorageExportController {
@Autowired
private DataCache dataCache;
@ApiOperation("修改迈征出料口")
@RequestMapping("/updateMaiZhengExport")
@AnonymousAccess
public ResultBean updateMaiZhengExport(@RequestBody List<String> maiZhengExportList) {
if (maiZhengExportList == null || maiZhengExportList.isEmpty()){
return ResultBean.newErrorResult(-1,"","配置信息不能为空");
}
log.info("修改迈征出料口配置:"+ JSON.toJSONString(maiZhengExportList));
dataCache.updateCache(StorageExportUtil.Cache_MaiZheng_Export,maiZhengExportList);
return ResultBean.newOkResult("");
}
@ApiOperation("获取迈征出料口")
@RequestMapping("/getAlleMaiZhengExport")
@AnonymousAccess
public ResultBean getAlleMaiZhengExport(){
List<String> maiZhengExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_Export);
if (maiZhengExportList == null){
maiZhengExportList = new ArrayList<>();
}
return ResultBean.newOkResult(maiZhengExportList);
}
}
......@@ -27,6 +27,8 @@ public class StorageExportUtil {
dataCache = cache;
}
public static final String Cache_MaiZheng_Export = "Cache_MaiZheng_Export";
public static final String OUT_STATION = "_outStation";
/* private static String disableExport = "";
......@@ -117,7 +119,7 @@ public class StorageExportUtil {
//判断是否为迈征
if (maizheng){
if ("1".equals(recvIndex)) {
/*if ("1".equals(recvIndex)) {
log.info("迈征数据获取出料口信息工单号为:" + orderNo + "出料口信息为:" + maizhengExport);
if (StringUtils.isNotBlank(maizhengExport)) {
StorageExport export = getExport(maizhengExport);
......@@ -133,6 +135,15 @@ public class StorageExportUtil {
return maizhengBoxExport;
}
}
}*/
List<String> maiZhengExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_Export);
if (maiZhengExportList != null && !maiZhengExportList.isEmpty()){
for (String maizhengBoxExport : maiZhengExportList) {
StorageExport export = getExport(maizhengBoxExport);
if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) {
return maizhengBoxExport;
}
}
}
return "";
}
......
......@@ -76,8 +76,8 @@ file:
#迈征配置
maizheng:
stationStatusApi: http://10.190.196.124:8300/API/MZSM
export: MU3_1
boxExport: MU2_1
export:
boxExport:
line:
transReelBoxApi: http://10.190.196.124:52232/API/TransReelBoxAuto
prepareReelBoxApi: http://10.190.196.124:52232/API/PrepareReelBoxAuto
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!