Commit 083060ed zshaohui

1.线体与model进行对应

1 个父辈 90eebc5e
......@@ -440,12 +440,12 @@ public class NLShelfHandler extends BaseDeviceHandler {
Barcode barcodeApi = lizhenApi.barcodeInfo(barcode);
//如果是L开头的去量测
if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
//if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
boolean check = lizhenApi.checkReelMeasure(barcode);
if (!check) {
return ResultBean.newErrorResult(-1, "", barcode.getBarcode() + "散料未量测");
}
} else {
/* } else {
if (barcodeApi != null) {
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if (barcodeApi.getAmount() != barcode.getLabelAmount()) {
......@@ -464,7 +464,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
}
}
}
}*/
if (barcodeApi != null){
barcode = barcodeApi;
......
......@@ -260,12 +260,12 @@ public class DeviceController {
Barcode barcodeApi = lizhenApi.barcodeInfo(barcode);
//如果是L开头的去量测
if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
//if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
boolean check = lizhenApi.checkReelMeasure(barcode);
if (!check) {
throw new ValidateException("", barcode.getBarcode() + "散料未量测");
}
} else {
/* } else {
if (barcodeApi != null) {
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if (barcodeApi.getAmount() != barcode.getLabelAmount()) {
......@@ -284,7 +284,7 @@ public class DeviceController {
}
}
}
}
}*/
if (barcodeApi != null){
barcode = barcodeApi;
......
......@@ -670,16 +670,49 @@ public class LiteOrderCache {
//C02-3FSMT-18,C02-3FSMT-19,C02-3FSMT-09,C02-3FSMT-08
String orderLine = cacheOrder.getLine();
if (StringUtils.isNotEmpty(orderLine)) {
if (orderLine.startsWith("C02-3FSMT-18") ||
orderLine.startsWith("C02-3FSMT-19") ||
orderLine.startsWith("C02-3FSMT-08") ||
orderLine.startsWith("C02-3FSMT-09")) {
if (orderLine.startsWith("C02-1FSMT-98")){
model = "RAINIER";
} else if (orderLine.startsWith("C02-3FSMT-03")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-04")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-05")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-06")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-07")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-13")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-14")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-15")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-16")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-17")){
model = "RAINIER";
}else if (orderLine.startsWith("C03-1FSMT-02")){
model = "RAINIER";
}else if (orderLine.startsWith("C03-1FSMT-12")){
model = "RAINIER";
}else if (orderLine.startsWith("C02-3FSMT-08")){
model = "X11";
}else if (orderLine.startsWith("C02-3FSMT-18")){
model = "X11";
}else if (orderLine.startsWith("C03-1FSMT-01")){
model = "X11";
}else if (orderLine.startsWith("C03-1FSMT-11")){
model = "X11";
}else if (orderLine.startsWith("C02-3FSMT-09")){
model = "X8";
}else if (orderLine.startsWith("C02-3FSMT-19")){
model = "X8";
} else {
model = "EVEREST";
model = "ALL";
}
} else {
model = "EVEREST";
model = "ALL";
}
}
......
......@@ -738,9 +738,51 @@ public class StoragePosController {
}
String model = checkOutDto.getModel();
if (StringUtils.isEmpty(model)){
if (!"C2".equals(line)){
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"机种"});
if (StringUtils.isEmpty(model)) {
if (StringUtils.isNotEmpty(line)) {
if (line.startsWith("C02-1FSMT-98")){
model = "RAINIER";
} else if (line.startsWith("C02-3FSMT-03")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-04")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-05")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-06")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-07")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-13")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-14")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-15")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-16")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-17")){
model = "RAINIER";
}else if (line.startsWith("C03-1FSMT-02")){
model = "RAINIER";
}else if (line.startsWith("C03-1FSMT-12")){
model = "RAINIER";
}else if (line.startsWith("C02-3FSMT-08")){
model = "X11";
}else if (line.startsWith("C02-3FSMT-18")){
model = "X11";
}else if (line.startsWith("C03-1FSMT-01")){
model = "X11";
}else if (line.startsWith("C03-1FSMT-11")){
model = "X11";
}else if (line.startsWith("C02-3FSMT-09")){
model = "X8";
}else if (line.startsWith("C02-3FSMT-19")){
model = "X8";
} else {
model = "ALL";
}
} else {
model = "ALL";
}
}
......
......@@ -8,6 +8,8 @@ import java.util.Map;
@Data
public class ReelConsumption {
private String req;
private String partNumber;
private String replacementPartNumber;
......
......@@ -54,7 +54,9 @@ public class ReelConsumptionController {
@AnonymousAccess
public void download(HttpServletResponse response) throws IOException {
List<List<String>> headerList = new ArrayList<>();
headerList.add(Arrays.asList("序号"));
headerList.add(Arrays.asList("料号"));
headerList.add(Arrays.asList("替代料"));
headerList.add(Arrays.asList("库别"));
headerList.add(Arrays.asList("Everst1340最小库存"));
headerList.add(Arrays.asList("Everst1340最大库存"));
......@@ -69,7 +71,9 @@ public class ReelConsumptionController {
List<List<Object>> datas = new ArrayList<>();
for (int i = 0; i < 10; i++) {
List<Object> dataList = new ArrayList<>();
dataList.add(i);
dataList.add("料号"+i);
dataList.add("替代料"+i);
dataList.add("库别"+i);
dataList.add(i);
dataList.add(i+10);
......@@ -131,6 +135,18 @@ public class ReelConsumptionController {
ReelConsumption reelConsumption = new ReelConsumption();
for (String header : headerList) {
if ("序号".equals(header)) {
Integer index = headerMap.get(header);
if (index == null || index == -1) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"序号"});
}
Cell cell = dataRaw.getCell(index);
String value = String.valueOf((int)cell.getNumericCellValue());
if (StringUtils.isEmpty(value)) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"序号"});
}
reelConsumption.setReq(value);
} else
if ("料号".equals(header)) {
Integer index = headerMap.get(header);
if (index == null || index == -1) {
......@@ -143,16 +159,16 @@ public class ReelConsumptionController {
}
reelConsumption.setPartNumber(value);
} else if ("替代料".equals(header)) {
/* Integer index = headerMap.get(header);
Integer index = headerMap.get(header);
if (index == null || index == -1) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"替代料"});
}
Cell cell = dataRaw.getCell(index);
String value = cell.getStringCellValue();
String value = String.valueOf((int)cell.getNumericCellValue());
if (StringUtils.isEmpty(value)) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"替代料"});
}*/
reelConsumption.setReplacementPartNumber("");
}
reelConsumption.setReplacementPartNumber(value);
} else if ("库别".equals(header)) {
Integer index = headerMap.get(header);
if (index == null || index == -1) {
......
......@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.lizhen.third.firstfloor;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.bean.InventoryItem;
import com.neotel.smfcore.custom.lizhen.innerBox.bean.ReelConsumption;
......@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
......@@ -37,8 +39,12 @@ public class InventoryUsageController {
Map<String, Integer> lineMap = dataCache.getCache(Constants.CACHE_wireQtyMaint);
//缓存的物料用量基本信息
Map<String, ReelConsumption> reelConsumptionMap = dataCache.getCache(Constants.Cache_reelConsumption);
Collection<ReelConsumption> allReelConsumption = reelConsumptionMap.values();
for (ReelConsumption reelConsumption : reelConsumptionMap.values()) {
InventoryUsage inventoryUsage = new InventoryUsage();
inventoryUsage.setReq(reelConsumption.getReq());
inventoryUsage.setPartNumber(reelConsumption.getPartNumber());
inventoryUsage.setReplacePartNumber(reelConsumption.getReplacementPartNumber());
inventoryUsage.setWareHouseCode(reelConsumption.getWarehouseCode());
......@@ -59,11 +65,31 @@ public class InventoryUsageController {
}
inventoryUsage.setMaxInventory(maxInventory);
inventoryUsage.setMinInventory(minInventory);
List<InventoryItem> inventoryItemList = new ArrayList<>();
InventoryItem inventoryItem = allInventory.get(reelConsumption.getPartNumber());
if (inventoryItem != null) {
int stockReel = inventoryItem.getStockReel();
inventoryUsage.setCurrentInventory(stockReel);
inventoryItemList.add(inventoryItem);
}
String replacementPartNumber = reelConsumption.getReplacementPartNumber();
if (StringUtils.isNotEmpty(replacementPartNumber)) {
for (ReelConsumption consumption : allReelConsumption) {
if (replacementPartNumber.equals(consumption.getReq())) {
String partNumber = consumption.getPartNumber();
InventoryItem replaceInventory = allInventory.get(partNumber);
if (replaceInventory != null) {
inventoryItemList.add(replaceInventory);
}
}
}
}
int stockReel = 0;
if (inventoryItemList != null && !inventoryItemList.isEmpty()) {
for (InventoryItem item : inventoryItemList) {
stockReel = stockReel + item.getStockReel();
}
}
inventoryUsage.setCurrentInventory(stockReel);
inventoryUsageList.add(inventoryUsage);
}
return ResultBean.newOkResult(inventoryUsageList);
......
......@@ -5,6 +5,8 @@ import lombok.Data;
@Data
public class InventoryUsage {
private String req;
private String partNumber;
private String replacePartNumber;
......
......@@ -137,12 +137,12 @@ public class VirtualRestController {
Barcode barcodeApi = lizhenApi.barcodeInfo(barcode);
//如果是L开头的去量测
if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
//if (barcode.getBarcode().startsWith("L") || barcode.getBarcode().startsWith("l")) {
boolean check = lizhenApi.checkReelMeasure(barcode);
if (!check) {
return ResultBean.newErrorResult(-1, "", barcode.getBarcode() + "散料未量测");
}
} else {
/* } else {
if (barcodeApi != null) {
//判断返回过来的物料数量与标签上的是否一致,如果不一致,则调用散料量测接口
if (barcodeApi.getAmount() != barcode.getLabelAmount()) {
......@@ -152,7 +152,7 @@ public class VirtualRestController {
}
}
}
}
}*/
if (barcodeApi != null){
barcode = barcodeApi;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!