Commit e7ca553e zshaohui

砍单回库修改

1 个父辈 001038dd
......@@ -109,4 +109,30 @@ public class CancelRestockController {
return ResultBean.newOkResult("");
}
@ApiOperation("获取砍单回库的料箱信息")
@RequestMapping("/boxInfo")
@AnonymousAccess
public ResultBean boxInfo() {
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF);
if (cacheMap == null) {
cacheMap = new HashMap<>();
}
return ResultBean.newOkResult(cacheMap.values());
}
@ApiOperation("移除砍单回库的料箱信息")
@RequestMapping("/removeBoxInfo")
@AnonymousAccess
public ResultBean removeBoxInfo(String boxStr) {
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF);
if (cacheMap == null) {
cacheMap = new HashMap<>();
}
cacheMap.remove(boxStr);
dataCache.updateCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF,cacheMap);
return ResultBean.newOkResult("");
}
}
......@@ -35,6 +35,7 @@ import com.neotel.smfcore.custom.luxsan.api.enums.PalletEnum;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.bean.ManualPutIn;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.CacheUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.ManualWorkUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
......@@ -101,15 +102,16 @@ public class LineController {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.invalid", "条码无效");
}
//如果是人工作业 直接返回ok
if (ManualWorkUtil.bindManualWork(barcode.getBarcode()) || ManualWorkUtil.bindShipCancelUpShelf(barcode.getBarcode())) {
return ResultBean.newOkResult("");
}
String scanCartonId = barcode.getScanCartonId();
if(Strings.isBlank(scanCartonId)){
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noBind", "条码未绑定CartonId");
}
//如果是人工作业 直接返回ok
if (ManualWorkUtil.bindManualWork(barcode.getBarcode())) {
return ResultBean.newOkResult("");
}
try {
ValidCartonResult result = LuxsanApi.validCarton(new ValidCartonRequest("", scanCartonId, CommonUtil.plantCode));
......@@ -144,8 +146,8 @@ public class LineController {
//如果是人工作业的,直接入库
if (ManualWorkUtil.bindManualWork(barcode.getBarcode())){
if (ManualWorkUtil.bindManualWork(barcode.getBarcode()) || ManualWorkUtil.bindShipCancelUpShelf(barcode.getBarcode())){
log.info(barcode.getBarcode()+"绑定人工作业或者砍单回库作业,不进行校验");
} else {
//2.请求接口判断是否过账
try {
......@@ -224,27 +226,13 @@ public class LineController {
//清理扫描的cartonId
barcode.setScanCartonId("");
barcode.setOdn("");
//4.生成入库任务
String boxLoc = TaskLocUtil.IN;
taskService.addPutInTaskToExecute(storage, barcode, pos,boxLoc);
Map<String, ManualPutIn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_WIP_MANUAL_INPUT);
if (cacheMap == null){
cacheMap = new ConcurrentHashMap<>();
}
cacheMap.remove(barcode.getBarcode());
dataCache.updateCache(CacheNameUtil.CHCHE_WIP_MANUAL_INPUT,cacheMap);
List<String> cacheList = dataCache.getCache(CacheNameUtil.CHCHE_MANUALWORK_PUTIN);
if (cacheList == null) {
cacheList = new ArrayList<>();
}
cacheList.remove(barcode.getBarcode());
dataCache.updateCache(CacheNameUtil.CHCHE_MANUALWORK_PUTIN,cacheList);
CacheUtil.clearBindInfo(barcode.getBarcode());
return ResultBean.newOkResult("");
}
......@@ -370,8 +358,14 @@ public class LineController {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.invalid", "条码无效");
}
barcode.setScanCartonId(cartonId);
barcode.setCartonId("");
barcode.setPalletId("");
barcode.setOdn("");
barcodeManager.saveBarcode(barcode);
//先移除绑定信息
CacheUtil.clearBindInfo(barcode.getBarcode());
Map<String, ManualPutIn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_WIP_MANUAL_INPUT);
if (cacheMap == null){
cacheMap = new ConcurrentHashMap<>();
......
package com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.wipstor.bean.ManualPutIn;
import lombok.extern.slf4j.Slf4j;
import org.ehcache.impl.internal.concurrent.ConcurrentHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class CacheUtil {
private static DataCache dataCache;
@Autowired
private void setDataCache(DataCache cache){
CacheUtil.dataCache = cache;
}
public static void clearBindInfo(String boxStr){
//移除人工绑定信息
List<String> cacheList = dataCache.getCache(CacheNameUtil.CHCHE_MANUALWORK_PUTIN);
if (cacheList == null) {
cacheList = new ArrayList<>();
}
cacheList.remove(boxStr);
dataCache.updateCache(CacheNameUtil.CHCHE_MANUALWORK_PUTIN,cacheList);
//移除人工绑定信息
Map<String, ManualPutIn> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_WIP_MANUAL_INPUT);
if (cacheMap == null){
cacheMap = new ConcurrentHashMap<>();
}
cacheMap.remove(boxStr);
dataCache.updateCache(CacheNameUtil.CHCHE_WIP_MANUAL_INPUT,cacheMap);
//移除砍单回库信息
Map<String, String> cancelCacheMap = dataCache.getCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF);
if (cancelCacheMap == null) {
cancelCacheMap = new HashMap<>();
}
cancelCacheMap.remove(boxStr);
dataCache.updateCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF,cacheMap);
}
}
......@@ -6,7 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class ManualWorkUtil {
......@@ -28,4 +30,12 @@ public class ManualWorkUtil {
}
public static boolean bindShipCancelUpShelf(String boxStr){
Map<String, String> cacheMap = dataCache.getCache(CacheNameUtil.CHCHE_SHIPCANCELUPSHELF);
if (cacheMap == null) {
cacheMap = new HashMap<>();
}
return cacheMap.containsKey(boxStr);
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!