Commit 121d18ed55ec4c1e38c0c95b877beb3c2201cfa1

Authored by 易文鹏
1 parent aa5f9cb3

feat:入库时不同的原仓库,物料不能入到同一个托盘内

src/main/java/com/huaheng/framework/config/ShiroConfig.java
@@ -274,6 +274,15 @@ public class ShiroConfig { @@ -274,6 +274,15 @@ public class ShiroConfig {
274 filterChainDefinitionMap.put("/manager/**", "anon"); 274 filterChainDefinitionMap.put("/manager/**", "anon");
275 filterChainDefinitionMap.put("/API/WMS/v2/**", "anon"); 275 filterChainDefinitionMap.put("/API/WMS/v2/**", "anon");
276 filterChainDefinitionMap.put("/mobile/receipt/batch/**", "anon"); 276 filterChainDefinitionMap.put("/mobile/receipt/batch/**", "anon");
  277 +
  278 + //todo pda出入库查询,测试后注释
  279 + filterChainDefinitionMap.put("/receipt/receiptHeader/listPda", "anon");
  280 + filterChainDefinitionMap.put("/receipt/receiptDetail/list", "anon");
  281 + filterChainDefinitionMap.put("/task/taskHeader/getTaskByTaskId", "anon");
  282 + filterChainDefinitionMap.put("/task/taskHeader/getTaskByShipmentCode", "anon");
  283 + filterChainDefinitionMap.put("/mobile/inventory/completeTaskListByWMS", "anon");
  284 +
  285 +
277 // 系统权限列表 286 // 系统权限列表
278 // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll()); 287 // filterChainDefinitionMap.putAll(SpringUtils.getBean(IMenuService.class).selectPermsAll());
279 288
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
@@ -107,6 +107,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai @@ -107,6 +107,9 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai
107 return AjaxResult.error("不允许超收"); 107 return AjaxResult.error("不允许超收");
108 } 108 }
109 109
  110 + //入库时不同的原仓库,物料不能入到同一个托盘内
  111 + checkWarehouse(receiptCode, containerCode);
  112 +
110 //检查容器编码合法性 113 //检查容器编码合法性
111 Integer taskType = checkContainer(containerCode, detail.getMaterialCode()); 114 Integer taskType = checkContainer(containerCode, detail.getMaterialCode());
112 if (taskType == 1) { 115 if (taskType == 1) {
@@ -232,6 +235,20 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai @@ -232,6 +235,20 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai
232 return ajaxResult; 235 return ajaxResult;
233 } 236 }
234 237
  238 + //入库时不同的原仓库,物料不能入到同一个托盘内
  239 + private void checkWarehouse(String receiptCode, String containerCode) {
  240 + String warehouse = receiptHeaderService.getReceiptHeaderByCode(receiptCode).getWarehouse();
  241 + if (StringUtils.isNotBlank(warehouse)) {
  242 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(new LambdaQueryWrapper<InventoryDetail>().eq(InventoryDetail::getContainerCode, containerCode));
  243 + if (!inventoryDetailList.isEmpty()) {
  244 + String inventoryDetailWarehouse = inventoryDetailList.get(0).getWarehouse();
  245 + if (!inventoryDetailWarehouse.equals(warehouse)) {
  246 + throw new ServiceException("入库时不同的原仓库:" + receiptCode + ",物料不能入到同一个托盘内:" + inventoryDetailWarehouse);
  247 + }
  248 + }
  249 + }
  250 + }
  251 +
235 @Transactional(rollbackFor = Exception.class) 252 @Transactional(rollbackFor = Exception.class)
236 @Override 253 @Override
237 public AjaxResult flatSaveContainer(String receiptCode, Integer receiptDetailId, String locationType, BigDecimal qty) { 254 public AjaxResult flatSaveContainer(String receiptCode, Integer receiptDetailId, String locationType, BigDecimal qty) {
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java
@@ -67,6 +67,11 @@ public class ReceiptHeaderService extends ServiceImpl&lt;ReceiptHeaderMapper, Recei @@ -67,6 +67,11 @@ public class ReceiptHeaderService extends ServiceImpl&lt;ReceiptHeaderMapper, Recei
67 @Resource 67 @Resource
68 private InventoryTransactionService inventoryTransactionService; 68 private InventoryTransactionService inventoryTransactionService;
69 69
  70 +
  71 + public ReceiptHeader getReceiptHeaderByCode(String receiptCode) {
  72 + return getOne(new LambdaQueryWrapper<ReceiptHeader>().eq(ReceiptHeader::getCode, receiptCode));
  73 + }
  74 +
70 /** 75 /**
71 * 保存入库单 76 * 保存入库单
72 * 77 *