Commit 51e76bea zshaohui

1.迈征配置自动出料口和非自动出料口

1 个父辈 b5da796a
...@@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RequestMapping("/storageExport") @RequestMapping("/storageExport")
...@@ -29,12 +31,23 @@ public class StorageExportController { ...@@ -29,12 +31,23 @@ public class StorageExportController {
@RequestMapping("/updateMaiZhengExport") @RequestMapping("/updateMaiZhengExport")
@AnonymousAccess @AnonymousAccess
public ResultBean updateMaiZhengExport(@RequestBody Map<String,List<String>> paramMap) { public ResultBean updateMaiZhengExport(@RequestBody Map<String,List<String>> paramMap) {
List<String> maiZhengExportList = paramMap.get("maiZhengExportList"); List<String> maiZhengAutoExportList = paramMap.get("maiZhengAutoExportList"); //自动出料口
if (maiZhengExportList == null || maiZhengExportList.isEmpty()){ List<String> maiZhengNoAutoExportList = paramMap.get("maiZhengNoAutoExportList"); //非自动出料口
return ResultBean.newErrorResult(-1,"","配置信息不能为空"); if (maiZhengAutoExportList == null || maiZhengAutoExportList.isEmpty()){
return ResultBean.newErrorResult(-1,"","自动出料口配置信息不能为空");
} }
log.info("修改迈征出料口配置:"+ JSON.toJSONString(maiZhengExportList)); if (maiZhengNoAutoExportList == null || maiZhengNoAutoExportList.isEmpty()){
dataCache.updateCache(StorageExportUtil.Cache_MaiZheng_Export,maiZhengExportList); return ResultBean.newErrorResult(-1,"","非自动出料口配置信息不能为空");
}
log.info("修改迈征出料口配置:,自动信息为:"+ JSON.toJSONString(maiZhengAutoExportList)+",非自动出料口为:"+JSON.toJSONString(maiZhengNoAutoExportList));
List<String> commonList = maiZhengAutoExportList.stream()
.filter(maiZhengNoAutoExportList::contains)
.collect(Collectors.toList());
if (commonList != null && !commonList.isEmpty()){
return ResultBean.newErrorResult(-1,"","自动和非自动出料口,配置错误,有相同的出料口:"+JSON.toJSONString(commonList));
}
dataCache.updateCache(StorageExportUtil.Cache_MaiZheng_Export,maiZhengAutoExportList);
dataCache.updateCache(StorageExportUtil.Cache_MaiZheng_NoAuto_Export,maiZhengNoAutoExportList);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
...@@ -46,6 +59,14 @@ public class StorageExportController { ...@@ -46,6 +59,14 @@ public class StorageExportController {
if (maiZhengExportList == null){ if (maiZhengExportList == null){
maiZhengExportList = new ArrayList<>(); maiZhengExportList = new ArrayList<>();
} }
return ResultBean.newOkResult(maiZhengExportList); List<String> maiZhengNoAutoExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_NoAuto_Export);
if (maiZhengNoAutoExportList == null){
maiZhengNoAutoExportList = new ArrayList<>();
}
Map<String,List<String>> resultMap = new HashMap<>();
resultMap.put("auto",maiZhengExportList);
resultMap.put("noAuto",maiZhengNoAutoExportList);
return ResultBean.newOkResult(resultMap);
} }
} }
...@@ -29,6 +29,8 @@ public class StorageExportUtil { ...@@ -29,6 +29,8 @@ public class StorageExportUtil {
public static final String Cache_MaiZheng_Export = "Cache_MaiZheng_Export"; public static final String Cache_MaiZheng_Export = "Cache_MaiZheng_Export";
public static final String Cache_MaiZheng_NoAuto_Export = "Cache_MaiZheng_NoAuto_Export";
public static final String OUT_STATION = "_outStation"; public static final String OUT_STATION = "_outStation";
/* private static String disableExport = ""; /* private static String disableExport = "";
...@@ -118,30 +120,32 @@ public class StorageExportUtil { ...@@ -118,30 +120,32 @@ public class StorageExportUtil {
} }
//判断是否为迈征 //判断是否为迈征
if (maizheng){ if (maizheng) {
/*if ("1".equals(recvIndex)) { //非自动
log.info("迈征数据获取出料口信息工单号为:" + orderNo + "出料口信息为:" + maizhengExport); if ("1".equals(recvIndex)) {
if (StringUtils.isNotBlank(maizhengExport)) { log.info("迈征数据获取出料口信息工单号为:" + orderNo);
StorageExport export = getExport(maizhengExport); List<String> maiZhengExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_NoAuto_Export);
if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) { if (maiZhengExportList != null && !maiZhengExportList.isEmpty()) {
return maizhengExport; for (String maizhengBoxExport : maiZhengExportList) {
} StorageExport export = getExport(maizhengBoxExport);
} if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) {
} else { log.info("orderNo:"+orderNo+"获取到出料口为:"+maizhengBoxExport);
log.info("迈征数据获取出料口信息工单号为:" + orderNo + "出料口信息为:" + maizhengBoxExport); return maizhengBoxExport;
if (StringUtils.isNotBlank(maizhengBoxExport)) { }
StorageExport export = getExport(maizhengBoxExport);
if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) {
return maizhengBoxExport;
} }
} }
}*/ }
List<String> maiZhengExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_Export); //自动
if (maiZhengExportList != null && !maiZhengExportList.isEmpty()){ else {
for (String maizhengBoxExport : maiZhengExportList) { log.info("迈征数据获取出料口信息工单号为:" + orderNo);
StorageExport export = getExport(maizhengBoxExport); List<String> maiZhengExportList = dataCache.getCache(StorageExportUtil.Cache_MaiZheng_Export);
if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) { if (maiZhengExportList != null && !maiZhengExportList.isEmpty()) {
return maizhengBoxExport; for (String maizhengBoxExport : maiZhengExportList) {
StorageExport export = getExport(maizhengBoxExport);
if (!export.isDisable() && StringUtils.isBlank(export.getHSerial())) {
log.info("orderNo:"+orderNo+"获取到出料口为:"+maizhengBoxExport);
return maizhengBoxExport;
}
} }
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!