Commit b5853c71 zshaohui

1.根据箱子获取到库位信息

2.获取入库线体上的箱子数量
1 个父辈 71cb733c
......@@ -15,12 +15,15 @@ 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.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.CtuTask;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.RawOutUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.third.util.RawInLineUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -595,4 +598,51 @@ public class CtuDeviceController {
return ResultBean.newOkResult(resultList);
}
@ApiOperation("根据料箱获取对应的库位信息")
@RequestMapping("/getBoxPosName")
@AnonymousAccess
public ResultBean getBoxPosName(@RequestBody List<String> boxList) {
if (boxList == null || boxList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "料箱信息不能为空");
}
List<Map<String, String>> resultList = new ArrayList<>();
Criteria c = Criteria.where("barcode.barcode").in(boxList);
Query q = new Query();
q.addCriteria(c);
List<StoragePos> storagePosList = storagePosManager.findByQuery(q);
for (StoragePos pos : storagePosList) {
Barcode barcode = pos.getBarcode();
Map<String, String> resultMap = new HashMap<>();
resultMap.put("posName", pos.getPosName());
resultMap.put("box", barcode.getBarcode());
resultList.add(resultMap);
}
return ResultBean.newOkResult(resultList);
}
@ApiOperation("获取入库分拣机上的数量")
@RequestMapping("/getRawInStackerNum")
@AnonymousAccess
public ResultBean getRawInStackerNum(){
List<Map<String,String>> resultList = new ArrayList<>();
Set<String> stackerSet = RawInLineUtil.getAllRawInStacker();
for (String stacker : stackerSet) {
if (!MaterialUtil.bindInfo(stacker)){
continue;
} else {
String size = MaterialUtil.getMaterialSize(stacker);
Map<String,String> resultMap = new HashMap<>();
resultMap.put("stacker",stacker);
resultMap.put("size",size);
resultList.add(resultMap);
}
}
return ResultBean.newOkResult(resultList);
}
}
......@@ -13,8 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Collection;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@Component
......@@ -163,4 +165,12 @@ public class RawInLineUtil {
destinationMap.remove(materialStr);
dataCache.updateCache(CacheNameUtil.CHCHE_RAWIN_LINE_MATERIAL_DESTINATION,destinationMap);
}
public static Set<String> getAllRawInStacker() {
Map<String, RawInLineMaterialLoc> destinationMap = dataCache.getCache(CacheNameUtil.CHCHE_RAWIN_LINE_MATERIAL_DESTINATION);
if (destinationMap == null) {
destinationMap = new ConcurrentHashMap<>();
}
return destinationMap.keySet();
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!