Commit 12c1121a hjh

UID出库增加线体和PN出库回显

1 个父辈 fa9b0cbe
...@@ -83,6 +83,9 @@ public class Barcode extends BasePo implements Serializable { ...@@ -83,6 +83,9 @@ public class Barcode extends BasePo implements Serializable {
* 盘高 * 盘高
*/ */
private int height = 0; private int height = 0;
/**
* 供应商
*/
private String provider; private String provider;
/** /**
* 批次 * 批次
...@@ -561,4 +564,7 @@ public class Barcode extends BasePo implements Serializable { ...@@ -561,4 +564,7 @@ public class Barcode extends BasePo implements Serializable {
} }
} }
} }
public String getPartNumberAndProvider(){
return this.partNumber+"_"+this.provider;
}
} }
...@@ -468,10 +468,12 @@ public class DataCache { ...@@ -468,10 +468,12 @@ public class DataCache {
for (InventoryItem item : map.values()) { for (InventoryItem item : map.values()) {
if (ObjectUtil.isNotEmpty(blurry)) { if (ObjectUtil.isNotEmpty(blurry)) {
if (item.getPartNumber().contains(blurry)) { if (item.getPartNumber().contains(blurry)) {
resultMap.put(item.getPartNumber(), item); resultMap.put(item.getPartNumberAndProvider(), item);
// resultMap.put(item.getPartNumber(), item);
} }
} else { } else {
resultMap.put(item.getPartNumber(), item); resultMap.put(item.getPartNumberAndProvider(), item);
// resultMap.put(item.getPartNumber(), item);
} }
} }
return resultMap; return resultMap;
...@@ -488,7 +490,9 @@ public class DataCache { ...@@ -488,7 +490,9 @@ public class DataCache {
for(InventoryItem storageInventoryItem : storageInventory.values()){ for(InventoryItem storageInventoryItem : storageInventory.values()){
storageInventoryItem.setStorageName(storage.getName()); storageInventoryItem.setStorageName(storage.getName());
String partNumber = storageInventoryItem.getPartNumber(); String partNumber = storageInventoryItem.getPartNumber();
InventoryItem pnInventoryItem = resultMap.get(storageInventoryItem.getPartNumber()); String provider = storageInventoryItem.getProvider();
InventoryItem pnInventoryItem = resultMap.get(storageInventoryItem.getPartNumberAndProvider());
// InventoryItem pnInventoryItem = resultMap.get(storageInventoryItem.getPartNumber());
if(pnInventoryItem == null){ if(pnInventoryItem == null){
pnInventoryItem = new InventoryItem(); pnInventoryItem = new InventoryItem();
pnInventoryItem.setStorageName(storageInventoryItem.getStorageName()); pnInventoryItem.setStorageName(storageInventoryItem.getStorageName());
...@@ -498,12 +502,13 @@ public class DataCache { ...@@ -498,12 +502,13 @@ public class DataCache {
pnInventoryItem.setStorageId(null); pnInventoryItem.setStorageId(null);
} }
pnInventoryItem.setPartNumber(partNumber); pnInventoryItem.setPartNumber(partNumber);
pnInventoryItem.setProvider(provider);
pnInventoryItem.setStockCount(pnInventoryItem.getStockCount() + storageInventoryItem.getStockCount()); pnInventoryItem.setStockCount(pnInventoryItem.getStockCount() + storageInventoryItem.getStockCount());
pnInventoryItem.setLockCount(pnInventoryItem.getLockCount() + storageInventoryItem.getLockCount()); pnInventoryItem.setLockCount(pnInventoryItem.getLockCount() + storageInventoryItem.getLockCount());
pnInventoryItem.setStockReel(pnInventoryItem.getStockReel() + storageInventoryItem.getStockReel()); pnInventoryItem.setStockReel(pnInventoryItem.getStockReel() + storageInventoryItem.getStockReel());
pnInventoryItem.setLockReel(pnInventoryItem.getLockReel() + storageInventoryItem.getLockReel()); pnInventoryItem.setLockReel(pnInventoryItem.getLockReel() + storageInventoryItem.getLockReel());
resultMap.put(storageInventoryItem.getPartNumberAndProvider(),pnInventoryItem);
resultMap.put(partNumber,pnInventoryItem); // resultMap.put(partNumber,pnInventoryItem);
} }
} }
return resultMap; return resultMap;
...@@ -523,10 +528,13 @@ public class DataCache { ...@@ -523,10 +528,13 @@ public class DataCache {
public InventoryItem getStorageInventoryByPartNumber(String cid, String partNumber){ public InventoryItem getStorageInventoryByPartNumber(String cid, String partNumber){
Map<String, InventoryItem> storageInventory = getStorageInventory(cid); Map<String, InventoryItem> storageInventory = getStorageInventory(cid);
// 修改
InventoryItem partNumberInventoryItem = storageInventory.get(partNumber); InventoryItem partNumberInventoryItem = storageInventory.get(partNumber);
if(partNumberInventoryItem == null){ if(partNumberInventoryItem == null){
partNumberInventoryItem = new InventoryItem(); partNumberInventoryItem = new InventoryItem();
partNumberInventoryItem.setPartNumber(partNumber); partNumberInventoryItem.setPartNumber(partNumber);
// 添加供货商
partNumberInventoryItem.setProvider("");
} }
return partNumberInventoryItem; return partNumberInventoryItem;
} }
......
...@@ -18,6 +18,13 @@ public class InventoryItem { ...@@ -18,6 +18,13 @@ public class InventoryItem {
*/ */
private String partNumber; private String partNumber;
//加个字段(供应商)
/**
* 供货商编号
*/
private String provider;
/** /**
* 库存数量 * 库存数量
*/ */
...@@ -154,4 +161,8 @@ public class InventoryItem { ...@@ -154,4 +161,8 @@ public class InventoryItem {
public void setLockCount(int lockCount) { public void setLockCount(int lockCount) {
this.lockCount = lockCount; this.lockCount = lockCount;
} }
public String getPartNumberAndProvider(){
return this.partNumber+"_"+this.provider;
}
} }
...@@ -704,6 +704,10 @@ public class StoragePosController { ...@@ -704,6 +704,10 @@ public class StoragePosController {
if (checkOutDto.getSingleOut() == null) { if (checkOutDto.getSingleOut() == null) {
checkOutDto.setSingleOut(true + ""); checkOutDto.setSingleOut(true + "");
} }
// 判断线体是否为空
if (StringUtils.isNotEmpty(checkOutDto.getLine())) {
throw new ValidateException("smfcore.valueCanotNull", "{0}不能为空", new String[]{"线体"});
}
String isSingleOutStr = checkOutDto.getSingleOut(); String isSingleOutStr = checkOutDto.getSingleOut();
boolean isSingleOut = Boolean.valueOf(isSingleOutStr); boolean isSingleOut = Boolean.valueOf(isSingleOutStr);
...@@ -724,9 +728,8 @@ public class StoragePosController { ...@@ -724,9 +728,8 @@ public class StoragePosController {
// if(!result) { // if(!result) {
// throw new ValidateException("smfcore.error.getMaterialLot.out", "条码[{0}]验证失败,无法出库", new String[]{pos.getBarcode().getBarcode()}); // throw new ValidateException("smfcore.error.getMaterialLot.out", "条码[{0}]验证失败,无法出库", new String[]{pos.getBarcode().getBarcode()});
// } // }
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】"); log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, isSingleOut,SecurityUtils.getCurrentUsername(),null,ExtendType.MANUAL_CHECKOUT); String outResult = taskService.checkout(storage, pos, isSingleOut,SecurityUtils.getCurrentUsername(),null,ExtendType.MANUAL_CHECKOUT,checkOutDto.getLine());
if (!Strings.isNullOrEmpty(outResult)) { if (!Strings.isNullOrEmpty(outResult)) {
throw new ValidateException("smfcore.error", outResult); throw new ValidateException("smfcore.error", outResult);
} }
......
...@@ -5,8 +5,11 @@ import lombok.Data; ...@@ -5,8 +5,11 @@ import lombok.Data;
@Data @Data
public class CheckOutDto { public class CheckOutDto {
@ApiModelProperty("库位ID号 ") @ApiModelProperty("库位ID号 ")
private String[] pids; private String[] pids;
@ApiModelProperty("是否是单盘出库") @ApiModelProperty("是否是单盘出库")
private String singleOut; private String singleOut;
@ApiModelProperty("线体")
private String line;
} }
...@@ -12,6 +12,9 @@ public class InventoryItemDto implements Serializable { ...@@ -12,6 +12,9 @@ public class InventoryItemDto implements Serializable {
@ApiModelProperty("物编") @ApiModelProperty("物编")
private String partNumber; private String partNumber;
@ApiModelProperty("供应商")
private String provider;
@ApiModelProperty("库存数量") @ApiModelProperty("库存数量")
private int stockCount = 0; private int stockCount = 0;
......
...@@ -12,6 +12,9 @@ public class TacticsOutDto implements Serializable { ...@@ -12,6 +12,9 @@ public class TacticsOutDto implements Serializable {
@ApiModelProperty("物编") @ApiModelProperty("物编")
private String partNumber; private String partNumber;
@ApiModelProperty("供应商")
private String provider;
@ApiModelProperty("出库盘数") @ApiModelProperty("出库盘数")
private Integer plateNumber; private Integer plateNumber;
......
...@@ -33,6 +33,10 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> { ...@@ -33,6 +33,10 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType); StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberAndProviderInStorages(List<String> storageIdList, String pn, String provider,Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberAndProviderNumberInStorages(List<String> storageIdList,String labelId, String pn,String provider, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberInStorages(List<String> storageIdList,String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType); StoragePos findPartNumberInStorages(List<String> storageIdList,String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType,String brand); StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType,String brand);
......
...@@ -141,7 +141,7 @@ public class TaskService { ...@@ -141,7 +141,7 @@ public class TaskService {
public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName, String stationName) throws ValidateException { public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName, String stationName) throws ValidateException {
return checkout(storage, pos, isSingleOut, opUserName, stationName, -1); return checkout(storage, pos, isSingleOut, opUserName, stationName, -1,"");
} }
/** /**
...@@ -153,13 +153,11 @@ public class TaskService { ...@@ -153,13 +153,11 @@ public class TaskService {
* @return * @return
* @throws ValidateException * @throws ValidateException
*/ */
public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName, String stationName, int extendType) throws ValidateException { public synchronized String checkout(Storage storage, StoragePos pos, boolean isSingleOut, String opUserName, String stationName, int extendType,String line) throws ValidateException {
if (pos.getBarcode() == null) { if (pos.getBarcode() == null) {
String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略"; String msg = "库位[" + pos.getPosName() + "]中已无物料,忽略";
log.info(msg); log.info(msg);
throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料", new String[]{pos.getPosName()}); throw new ValidateException("smfcore.allBoxView.noReel", "库位{0}中无物料", new String[]{pos.getPosName()});
// Barcode barcode=new Barcode(); // Barcode barcode=new Barcode();
// SimpleDateFormat formatter= new SimpleDateFormat("HHmmss"); // SimpleDateFormat formatter= new SimpleDateFormat("HHmmss");
// Date date = new Date(System.currentTimeMillis()); // Date date = new Date(System.currentTimeMillis());
...@@ -207,6 +205,9 @@ public class TaskService { ...@@ -207,6 +205,9 @@ public class TaskService {
if (extendType != -1) { if (extendType != -1) {
task.setExtendType(extendType); task.setExtendType(extendType);
} }
if (StringUtils.isNotEmpty(line)){
task.setLine(line);
}
addTaskToExecute(task); addTaskToExecute(task);
//} //}
return ""; return "";
...@@ -1211,17 +1212,18 @@ public class TaskService { ...@@ -1211,17 +1212,18 @@ public class TaskService {
//其他出库模式一次性全部生成任务 //其他出库模式一次性全部生成任务
for (TacticsOutDto item : tacticsOutDtos) { for (TacticsOutDto item : tacticsOutDtos) {
log.info("开始执行策略出库[" + item.getPartNumber() + "] [" + item.getStorageId() + "] 盘数=" + item.getPlateNumber()); log.info("开始执行策略出库[" + item.getPartNumber() + "][" + item.getProvider() + "] [" + item.getStorageId() + "] 盘数=" + item.getPlateNumber());
String partNumber = item.getPartNumber(); String partNumber = item.getPartNumber();
String provider = item.getProvider();
for (int i = 1; i <= item.getPlateNumber(); i++) { for (int i = 1; i <= item.getPlateNumber(); i++) {
Collection<String> excludePosIds = excludePosIds(); Collection<String> excludePosIds = excludePosIds();
StoragePos pos = null; StoragePos pos = null;
if (item.getStorageId() != null) { if (item.getStorageId() != null) {
String[] storageIds = new String[]{item.getStorageId()}; String[] storageIds = new String[]{item.getStorageId()};
pos = storagePosManager.findPartNumberInStorages(Lists.newArrayList(storageIds), partNumber, excludePosIds, checkoutType); pos = storagePosManager.findPartNumberAndProviderInStorages(Lists.newArrayList(storageIds), partNumber,provider, excludePosIds, checkoutType);
} else { } else {
pos = storagePosManager.findPartNumberInStorages(availableStorageIds, partNumber, excludePosIds, checkoutType); pos = storagePosManager.findPartNumberAndProviderInStorages(availableStorageIds, partNumber,provider, excludePosIds, checkoutType);
} }
if (pos == null) { if (pos == null) {
log.error("策略出库[" + item.getPartNumber() + "] 未找到可以出库的物料[" + partNumber + "]"); log.error("策略出库[" + item.getPartNumber() + "] 未找到可以出库的物料[" + partNumber + "]");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!