feat: 单据创建 修改提交库存数量校验,增加逻辑如果销售订单和行号有值就写字段特殊库存标识INVENTORY_SPECIAL_MARKING为E
This commit is contained in:
parent
f48c908653
commit
cc13650083
@ -43,6 +43,8 @@ public interface Constant {
|
|||||||
String DOCUMENT_ENGINEER_RETURNED = "ENGINEER_RETURNED";//在建工程退料
|
String DOCUMENT_ENGINEER_RETURNED = "ENGINEER_RETURNED";//在建工程退料
|
||||||
String DOCUMENT_RANDD_RECEIVE = "RANDD_RECEIVE";//研发领料
|
String DOCUMENT_RANDD_RECEIVE = "RANDD_RECEIVE";//研发领料
|
||||||
String DOCUMENT_RAND_RETURNED = "RAND_RETURNED";//研发退料
|
String DOCUMENT_RAND_RETURNED = "RAND_RETURNED";//研发退料
|
||||||
|
String DOCUMENT_SECRECY_RECEIVE = "SECRECY_RECEIVE";//保密领料
|
||||||
|
String DOCUMENT_ATTRIBUTE_TRANSFER = "ATTRIBUTE_TRANSFER";//特殊库存转换
|
||||||
|
|
||||||
String PICKING_MACHINE = "PICKING_MACHINE"; //调机领料
|
String PICKING_MACHINE = "PICKING_MACHINE"; //调机领料
|
||||||
String RAW_MATERIALS_SCRAPPED = "RAW_MATERIALS_SCRAPPED"; //原材料报废
|
String RAW_MATERIALS_SCRAPPED = "RAW_MATERIALS_SCRAPPED"; //原材料报废
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.foreverwin.mom.wms.controller;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.foreverwin.iep.common.base.FrontPage;
|
||||||
import com.foreverwin.mom.common.core.util.R;
|
import com.foreverwin.mom.common.core.util.R;
|
||||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||||
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||||
@ -11,6 +12,7 @@ import com.foreverwin.mom.common.security.util.SecurityUtils;
|
|||||||
import com.foreverwin.mom.wms.dto.ListWithStringDTO;
|
import com.foreverwin.mom.wms.dto.ListWithStringDTO;
|
||||||
import com.foreverwin.mom.wms.dto.StorageBinDto;
|
import com.foreverwin.mom.wms.dto.StorageBinDto;
|
||||||
import com.foreverwin.mom.wms.entity.StorageBin;
|
import com.foreverwin.mom.wms.entity.StorageBin;
|
||||||
|
import com.foreverwin.mom.wms.entity.WareHouse;
|
||||||
import com.foreverwin.mom.wms.service.WmsStorageBinService;
|
import com.foreverwin.mom.wms.service.WmsStorageBinService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -187,4 +189,15 @@ public class WmsStorageBinController {
|
|||||||
storageBinService.unBind(site, user, inventoryIdList);
|
storageBinService.unBind(site, user, inventoryIdList);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询存储地点
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询存储地点", notes = "查询存储地点")
|
||||||
|
@GetMapping("/page/getStorageBin")
|
||||||
|
@SysLog("查询存储地点" )
|
||||||
|
public R getStorageBin(FrontPage page,StorageBinDto dto) {
|
||||||
|
storageBinService.getStorageBinPage(page,dto);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4068,6 +4068,9 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
|||||||
detailed.setSite(site);
|
detailed.setSite(site);
|
||||||
detailed.setCreateDate(document.getCreateDate());
|
detailed.setCreateDate(document.getCreateDate());
|
||||||
detailed.setState("SAVE");
|
detailed.setState("SAVE");
|
||||||
|
if (detailed.getSalesOrder() != null && detailed.getSalesOrderSeq() != null) {
|
||||||
|
detailed.setInventorySpecialMarking("E");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
documentDetailedService.saveBatch(list);
|
documentDetailedService.saveBatch(list);
|
||||||
@ -4266,12 +4269,23 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
|||||||
inventoryDto.setDnOrder(salesOrder);
|
inventoryDto.setDnOrder(salesOrder);
|
||||||
inventoryDto.setDnOrderSeq(orderSeq);
|
inventoryDto.setDnOrderSeq(orderSeq);
|
||||||
inventoryDto.setErpStorageLocation(sourceWarehouse);
|
inventoryDto.setErpStorageLocation(sourceWarehouse);
|
||||||
Inventory inventory = inventoryService.groupBy(inventoryDto);
|
if (Constant.DOCUMENT_STORES_REQUISITION.equals(detailed.getDocumentType())||
|
||||||
if (inventory == null) {
|
Constant.DOCUMENT_STORES_RETURNED.equals(detailed.getDocumentType()) ||
|
||||||
throw BusinessException.build("该物料在" + sourceWarehouse + "仓库没有足够库存!");
|
Constant.DOCUMENT_LOCAL_TRANSFER.equals(detailed.getDocumentType()) ||
|
||||||
}
|
Constant.DOCUMENT_STOR_REQUEST.equals(detailed.getDocumentType()) ||
|
||||||
if (detailed.getApplicationsQuantity().compareTo(inventory.getQtyOnHand()) > 0) {
|
Constant.DOCUMENT_TYPE_ME_COST_CENTER_RECEIVE.equals(detailed.getDocumentType()) ||
|
||||||
throw BusinessException.build("该物料在" + sourceWarehouse + "仓库没有足够库存!");
|
Constant.DOCUMENT_ENGINEER_RECEIVE.equals(detailed.getDocumentType()) ||
|
||||||
|
Constant.DOCUMENT_RANDD_RECEIVE.equals(detailed.getDocumentType()) ||
|
||||||
|
Constant.DOCUMENT_SCRAP_OUT.equals(detailed.getDocumentType()) ||
|
||||||
|
Constant.DOCUMENT_SECRECY_RECEIVE.equals(detailed.getDocumentType()) ||
|
||||||
|
Constant.DOCUMENT_ATTRIBUTE_TRANSFER.equals(detailed.getDocumentType())) {
|
||||||
|
Inventory inventory = inventoryService.groupBy(inventoryDto);
|
||||||
|
if (inventory == null) {
|
||||||
|
throw BusinessException.build("该物料在" + sourceWarehouse + "仓库没有足够库存!");
|
||||||
|
}
|
||||||
|
if (detailed.getApplicationsQuantity().compareTo(inventory.getQtyOnHand()) > 0) {
|
||||||
|
throw BusinessException.build("该物料在" + sourceWarehouse + "仓库没有足够库存!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//原材料报废或者半成品报废判断是否需要提交OA审批
|
//原材料报废或者半成品报废判断是否需要提交OA审批
|
||||||
// if (Constant.RAW_MATERIALS_SCRAPPED.equals(detailed.getDocumentType()) || Constant.SEMI_FINISHED_PRODUCTS_SCRAPPED.equals(detailed.getDocumentType())) {
|
// if (Constant.RAW_MATERIALS_SCRAPPED.equals(detailed.getDocumentType()) || Constant.SEMI_FINISHED_PRODUCTS_SCRAPPED.equals(detailed.getDocumentType())) {
|
||||||
@ -4417,6 +4431,9 @@ public class DocumentServiceImpl extends ServiceImpl<DocumentMapper, Document> i
|
|||||||
// detailed.setUpdateDate(now);
|
// detailed.setUpdateDate(now);
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
|
if (detailed.getSalesOrder() != null && detailed.getSalesOrderSeq() != null) {
|
||||||
|
detailed.setInventorySpecialMarking("E");
|
||||||
|
}
|
||||||
detailed.setState("SUBMIT");
|
detailed.setState("SUBMIT");
|
||||||
detailed.setUpdateUser(user);
|
detailed.setUpdateUser(user);
|
||||||
detailed.setUpdateDate(now);
|
detailed.setUpdateDate(now);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user