Commit 69b353c0 zshaohui

1.盘点物料顺序修改

2.手动移转按最新的入库时间去计算
1 个父辈 42e47a46
...@@ -792,6 +792,13 @@ public class InventoryController { ...@@ -792,6 +792,13 @@ public class InventoryController {
if (boxBarcode == null || BoxUtil.isInventoryFinished(boxStr)) { if (boxBarcode == null || BoxUtil.isInventoryFinished(boxStr)) {
return boxStr + "不是要盘点的料箱"; return boxStr + "不是要盘点的料箱";
} }
//从库位中去查找
StoragePos pos = storagePosManager.getByBarcode(boxBarcode.getBarcode());
if (pos != null) {
boxBarcode = pos.getBarcode();
}
Barcode barcode = codeBean.getBarcode(); Barcode barcode = codeBean.getBarcode();
//判断是否在料箱中 //判断是否在料箱中
String posName = barcode.getPosName(); String posName = barcode.getPosName();
...@@ -834,23 +841,7 @@ public class InventoryController { ...@@ -834,23 +841,7 @@ public class InventoryController {
List<Map<String, String>> reelInfoList = getReelInfoList(boxBarcode, posName, inventoryBatch, data); List<Map<String, String>> reelInfoList = getReelInfoList(boxBarcode, posName, inventoryBatch, data);
if (reelInfoList != null && !reelInfoList.isEmpty()) { if (reelInfoList != null && !reelInfoList.isEmpty()) {
int index = -1; int index = 0;
for (int i = 0; i < reelInfoList.size(); i++) {
Map<String, String> map = reelInfoList.get(i);
String code = map.get("code");
String reel = map.get("reel");
if (code.equals(reel)) {
index = i;
break;
}
}
if (index < 0){
index = reelInfoList.size() - 1;
} else if (index > 0){
index = index -1;
} else if (index == 0){
index = -1;
}
if (index != -1){ if (index != -1){
Map<String, String> map = reelInfoList.get(index); Map<String, String> map = reelInfoList.get(index);
String code = map.get("code"); String code = map.get("code");
...@@ -901,6 +892,19 @@ public class InventoryController { ...@@ -901,6 +892,19 @@ public class InventoryController {
inventoryDataManager.save(inventoryData); inventoryDataManager.save(inventoryData);
} }
} }
//同时设置barcode的seq
barcode.setSeq(0 - barcode.getSeq());
barcodeManager.save(barcode);
boxBarcode.updateSubCodes(barcode);
barcodeManager.save(boxBarcode);
if (pos != null){
pos.setBarcode(boxBarcode);
storagePosManager.save(pos);
}
return errorMsg; return errorMsg;
} }
......
...@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.swing.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
...@@ -174,6 +175,16 @@ public class ManualStorTransferController { ...@@ -174,6 +175,16 @@ public class ManualStorTransferController {
log.info(barcode.getBarcode() + "不可以放到料格:" + newPartition + ",原因为:" + canPutIn); log.info(barcode.getBarcode() + "不可以放到料格:" + newPartition + ",原因为:" + canPutIn);
return ResultBean.newErrorResult(-1, "", barcode.getBarcode() + "不可以放到料格:" + newPartition + ",原因为:" + canPutIn); return ResultBean.newErrorResult(-1, "", barcode.getBarcode() + "不可以放到料格:" + newPartition + ",原因为:" + canPutIn);
} }
//获取最早的创建时间(转库的时候,每次转移的料盘,取当前隔口的最早创建时间)
Date createDate = BoxHandleUtil.getCreateDate(boxBarcode, newPartition);
if (barcode.getCreateDate() == null){
barcode.setCreateDate(createDate);
}
if (barcode.getCreateDate().getTime() > createDate.getTime()){
barcode.setCreateDate(createDate);
}
barcode.setPosName(newPartition); barcode.setPosName(newPartition);
barcode.setWarehouseCode(warehouseCode); barcode.setWarehouseCode(warehouseCode);
barcode.setBarSource("隔口移转"); barcode.setBarSource("隔口移转");
......
...@@ -354,6 +354,29 @@ public class BoxHandleUtil { ...@@ -354,6 +354,29 @@ public class BoxHandleUtil {
return seq; return seq;
} }
/**
* 获取序列号
*
* @param boxBarcode
* @param binCode
* @return
*/
public static int getSmallestSeq(Barcode boxBarcode, String binCode) {
int seq = 0;
List<Barcode> subCodeList = boxBarcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
for (Barcode barcode : subCodeList) {
if (binCode.equals(barcode.getPosName())) {
if (seq > barcode.getSeq()) {
seq = barcode.getSeq();
}
}
}
}
return seq;
}
public static StoragePos locOnePos(Barcode boxBarcode) { public static StoragePos locOnePos(Barcode boxBarcode) {
//判断信息是否在已经在库位中(出入库只改变料箱位置状态,不从StoragePos表中清除) //判断信息是否在已经在库位中(出入库只改变料箱位置状态,不从StoragePos表中清除)
...@@ -608,4 +631,23 @@ public class BoxHandleUtil { ...@@ -608,4 +631,23 @@ public class BoxHandleUtil {
} }
return task; return task;
} }
public static Date getCreateDate(Barcode boxBarcode, String binCode) {
Date createDate = new Date();
int seq = 0;
List<Barcode> subCodeList = boxBarcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
for (Barcode barcode : subCodeList) {
if (binCode.equals(barcode.getPosName())) {
if (createDate.getTime() > barcode.getCreateDate().getTime()){
createDate = barcode.getCreateDate();
}
}
}
}
return createDate;
}
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!