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

This commit is contained in:
彭枝刚 2024-12-16 18:29:55 +08:00
parent 9eff1ca4a6
commit f86bbe1a6e
4 changed files with 38 additions and 15 deletions

View File

@ -14,6 +14,17 @@ import java.util.List;
*/
@Data
public class DocumentDetailedDto extends DocumentDetailed {
private boolean isSecrecy;
public boolean getIsSecrecy() {
return isSecrecy;
}
public void setIsSecrecy(boolean isSecrecy) {
isSecrecy = isSecrecy;
}
private String isPack;
private String inventoryIdOrCarrier;

View File

@ -89,6 +89,8 @@ public interface ZWmsInventoryService extends IService<Inventory> {
*/
List<String> 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<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);
/**

View File

@ -2031,6 +2031,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
String user = SecurityUtils.getUserName();
String documentNo = itemList.get(0).getDocumentNo();
String printerName = itemList.get(0).getPrinter();
boolean isSecrecy = itemList.get(0).getIsSecrecy();
String documentBo = Document.genHandle(site, documentNo);
Document byCode = getById(documentBo);
if (!Constant.DOCUMENT_STATUS_SUBMIT.equals(byCode.getState())) {
@ -2078,7 +2079,7 @@ 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).get(0);
String inventoryId = inventoryService.splitInventory(site, user, parentInventoryId, inventoryQty, 1, documentNo, byCode.getDocumentType(), null,isSecrecy).get(0);
requestQty = requestQty.add(inventoryQty);
DocumentSfc documentSfc = new DocumentSfc();
@ -2099,18 +2100,23 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
documentSfc.setCreateUser(user);
// documentSfc.setGradeThrCarrier(groupNo);
documentSfcService.save(documentSfc);
paramMap.put("ITEM", item);
paramMap.put("DES", itemDesc);
paramMap.put("DATE", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
paramMap.put("BATCH", parentInventory.getBatchNo());
paramMap.put("QTY", documentSfc.getQty());
paramMap.put("INV_ID", inventoryId);
paramMap.put("DOCUMENT_NO", documentNo);
paramMap.put("CODE", inventoryId);
paramMap.put("VENDOR_BATCH", parentInventory.getVendorBatchNo());
String proDate = parentInventory.getProductionDate() == null ? "" : parentInventory.getProductionDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
paramMap.put("PRO_DATE", proDate);
if (isSecrecy) {
paramMap.put("UUID", inventoryId);
paramMap.put("QTY", documentSfc.getQty());
paramMap.put("CODE", inventoryId);
}else{
paramMap.put("ITEM", item);
paramMap.put("DES", itemDesc);
paramMap.put("DATE", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
paramMap.put("BATCH", parentInventory.getBatchNo());
paramMap.put("QTY", documentSfc.getQty());
paramMap.put("INV_ID", inventoryId);
paramMap.put("DOCUMENT_NO", documentNo);
paramMap.put("CODE", inventoryId);
paramMap.put("VENDOR_BATCH", parentInventory.getVendorBatchNo());
String proDate = parentInventory.getProductionDate() == null ? "" : parentInventory.getProductionDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
paramMap.put("PRO_DATE", proDate);
}
printData.add(paramMap);
}
}
@ -2175,7 +2181,7 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
jsonObject.put("LABEL_QTY", 1);
jsonObject.put("PRINT_NAME", printerName);
jsonObject.put("QUEUE_NAME", "");
jsonObject.put("TEMPLATE", "RAM_LABEL_001.lab");
jsonObject.put("TEMPLATE", isSecrecy ? "RAM_LABEL_002.lab" : "RAM_LABEL_001.lab");
remotePrintService.remotePrintSaveLog(jsonObject);
}
return null;

View File

@ -37,7 +37,6 @@ import com.foreverwin.mom.wms.service.ZWmsInventoryLogService;
import com.foreverwin.mom.wms.service.ZWmsInventoryService;
import com.foreverwin.mom.wms.util.StringUtil;
import com.foreverwin.nlv.print.feign.RemotePrintService;
import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -385,6 +384,11 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl<ZWmsInventoryMapper, I
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) {
return splitInventory(site, user, parentInventoryId, splitQty, splitNum, documentNo, documentType, storageBinBo, null, null, null, isSecrecy);
}
//@GlobalTransactional
@Override
@Transactional(rollbackFor = Exception.class)