采购到货拆批增加是否保密拆批逻辑

This commit is contained in:
彭枝刚 2024-12-16 19:03:10 +08:00
parent f86bbe1a6e
commit 0e952beae1
4 changed files with 16 additions and 12 deletions

View File

@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -385,7 +386,8 @@ public class ZWmsInventoryController {
String qmsSpecialMarking = request.get("qmsSpecialMarking");
String printer = request.get("printer");
boolean isSecrecy = Boolean.parseBoolean(request.get("isSecrecy"));
List<String> splitInventoryIdList = inventoryService.splitInventory(site, user, parentInventoryId, splitQty, splitNum, null, null, null, null, qmsSpecialMarking, printer, isSecrecy);
List<Inventory> inventoryIdObj = inventoryService.splitInventory(site, user, parentInventoryId, splitQty, splitNum, null, null, null, null, qmsSpecialMarking, printer, isSecrecy);
List<String> splitInventoryIdList = inventoryIdObj.stream().map(Inventory::getInventoryId).collect(Collectors.toList());
splitInventoryIdList.add(parentInventoryId);
splitInventoryIdList.remove(splitInventoryIdList.size() - 1);
return R.ok(splitInventoryIdList);

View File

@ -87,11 +87,11 @@ public interface ZWmsInventoryService extends IService<Inventory> {
* @param storageBinBo 货格BO(可选),为空则绑定到父库存货格
* @return 新库存ID集合
*/
List<String> splitInventory(String site, String user, String parentInventory, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo);
List<Inventory> splitInventory(String site, String user, String parentInventory, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo);
List<String> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy);
List<Inventory> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy);
List<String> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List<String> newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy);
List<Inventory> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List<String> newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy);
/**
* 合并库存

View File

@ -2079,7 +2079,8 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
// String parentInventoryStatus = parentInventory.getStatus();
//库存拆分
String inventoryId = inventoryService.splitInventory(site, user, parentInventoryId, inventoryQty, 1, documentNo, byCode.getDocumentType(), null,isSecrecy).get(0);
Inventory inventoryIdObj = inventoryService.splitInventory(site, user, parentInventoryId, inventoryQty, 1, documentNo, byCode.getDocumentType(), null,isSecrecy).get(0);
String inventoryId = inventoryIdObj.getInventoryId();
requestQty = requestQty.add(inventoryQty);
DocumentSfc documentSfc = new DocumentSfc();
@ -2101,9 +2102,9 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
// documentSfc.setGradeThrCarrier(groupNo);
documentSfcService.save(documentSfc);
if (isSecrecy) {
paramMap.put("UUID", inventoryId);
paramMap.put("UUID", inventoryIdObj.getSecrecyId());
paramMap.put("QTY", documentSfc.getQty());
paramMap.put("CODE", inventoryId);
paramMap.put("CODE", inventoryIdObj.getSecrecyId());
}else{
paramMap.put("ITEM", item);
paramMap.put("DES", itemDesc);
@ -5737,7 +5738,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
.eq(StorageBinBindInventory::getInventoryBo, inventoryBo)
.eq(StorageBinBindInventory::getStatus, "Y")
.select(StorageBinBindInventory::getStorageBinBo));
String freezeInventoryId = inventoryService.splitInventory(site,
Inventory inventoryIdObj = inventoryService.splitInventory(site,
user,
parentInventoryId,
ngQty,
@ -5747,6 +5748,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
storageBinBindInventory.getStorageBinBo(),
Collections.singletonList(parentInventoryId + "-1"), null, null, false
).get(0);
String freezeInventoryId = inventoryIdObj.getInventoryId();
inventoryService.update(Wrappers.lambdaUpdate(Inventory.class)
.eq(Inventory::getHandle, Inventory.genHandle(site, freezeInventoryId))
.set(Inventory::getStatus, Constant.INVENTORY_STSTUS_1005)

View File

@ -380,19 +380,19 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl<ZWmsInventoryMapper, I
}
@Override
public List<String> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo) {
public List<Inventory> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo) {
return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, false);
}
@Override
public List<String> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy) {
public List<Inventory> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, boolean isSecrecy) {
return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, isSecrecy);
}
//@GlobalTransactional
@Override
@Transactional(rollbackFor = Exception.class)
public List<String> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List<String> newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy) {
public List<Inventory> splitInventory(String site, String user, String parentInventoryId, BigDecimal splitQty, int splitNum, String documentNo, String documentType, String storageBinBo, List<String> newInventoryIdList, String qmsSpecialMarking, String printerName, boolean isSecrecy) {
Inventory parentInventory = isSecrecy ? lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getSecrecyId, parentInventoryId)
.one() : getById(Inventory.genHandle(site, parentInventoryId));
if (parentInventory == null) {
@ -486,7 +486,7 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl<ZWmsInventoryMapper, I
// 执行打印,单独开个线程去跑
printInventoryData(printerName, parentIsEmpty, isSecrecy, parentInventoryId, subtract, itemObj, parentInventory, documentNo, printData);
//返回新库存ID
return newInventoryIdList;
return newInventoryList;
}
}
}