存储位置增加车间和产线维护移动到wms模块

This commit is contained in:
彭枝刚 2024-11-23 17:25:50 +08:00
parent ca7f78f01f
commit 125558de26
6 changed files with 34 additions and 17 deletions

View File

@ -85,6 +85,9 @@ public class DocumentDetailed extends Model<DocumentDetailed> {
@ExcelProperty(value = "物料编号", index = 0)
private String item;
@TableField(exist = false)
private String itemBo;
/**
* 物料描述
*/

View File

@ -13,6 +13,8 @@ import java.util.Map;
public interface DocumentDetailedService extends IService<DocumentDetailed> {
List<DocumentDetailed> getDocumentDetailedInventoryList(String site, String documentNo);
/**
* 分页查询
* @param frontPage

View File

@ -41,6 +41,11 @@ public class DocumentDetailedServiceImpl extends ServiceImpl<DocumentDetailedMap
private final DocumentSfcMapper documentSfcMapper;
@Override
public List<DocumentDetailed> getDocumentDetailedInventoryList(String site,String documentNo){
return this.baseMapper.getDocumentDetailedInventoryList(site, documentNo);
}
@Override
public IPage<DocumentDetailed> selectPage(Page<DocumentDetailed> frontPage, DocumentDetailed documentDetailed) {
QueryWrapper<DocumentDetailed> queryWrapper = new QueryWrapper<>();

View File

@ -8,10 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.iep.prd.domain.GenerateNextNumberRequest;
import com.foreverwin.iep.prd.domain.GenerateNextNumberResponse;
import com.foreverwin.iep.prd.entity.Item;
import com.foreverwin.iep.prd.feign.RemoteItemService;
import com.foreverwin.iep.prd.feign.RemoteNextNumberService;
import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
import com.foreverwin.iep.qms.feign.RemoteQmsQcPlanTargetService;
import com.foreverwin.mom.common.core.constant.SecurityConstants;
import com.foreverwin.mom.common.core.exception.BusinessException;
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
@ -53,7 +51,7 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
private final ZWmsInventoryService zWmsInventoryService;
private final ZWmsInventoryLogService zWmsInventoryLogService;
private final WmsItemService wmsItemService;
private final RemoteQmsQcPlanTargetService remoteQmsQcPlanTargetService;
private final RemoteItemService remoteItemService;
// NLV 已使用 Snow
@Override
@ -63,7 +61,7 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
// 先创建单据号
Map map = new HashMap();
String documentType = "CD";
map.put("DOCUMENT_TYPE",documentType);
map.put("DOCUMENT_TYPE", documentType);
String documentNo = generatorDocumentNo("ZW_DOCUMENT_NO", map);
Document zwDocument = new Document();
zwDocument.setSite(site);
@ -79,7 +77,7 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
List<DocumentDetailed> newDocumentList = new ArrayList<>();
HashMap<Integer, BigDecimal> countQtyMap = new HashMap<>();
for (DocumentDetailed documentDetail : zwDocumentDetailList) {
if(StringUtils.isEmpty(documentDetail.getBatch())){
if (StringUtils.isEmpty(documentDetail.getBatch())) {
throw BusinessException.build("物料" + documentDetail.getItem() + "没有匹配到SAP的批次");
}
// 统计每行采购订单的总数量
@ -99,6 +97,7 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
documentDetail.setCreateDate(LocalDateTime.now());
documentDetail.setCreateUser(SecurityUtils.getUserName());
documentDetailedService.save(documentDetail);
newDocumentList.add(documentDetail);
}
// 更新采购订单的数量
QueryWrapper<PoOrderDetail> poWrap = new QueryWrapper<>();
@ -120,12 +119,10 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
}
// NLV 已使用 Snow
@Override
@Override
public List<DocumentDetailed> findDocumentDetailDataByDocumentNo(String documentNo) {
String site = TenantContextHolder.getTenantId();
QueryWrapper<DocumentDetailed> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(DocumentDetailed::getDocumentNo, documentNo).eq(DocumentDetailed::getSite, site);
return documentDetailedService.list(queryWrapper);
return documentDetailedService.getDocumentDetailedInventoryList(site, documentNo);
}
// NLV 已使用 Snow
@ -136,18 +133,15 @@ public class PoOrderServiceImpl extends ServiceImpl<PoOrderMapper, PoOrder> impl
// 单号+行号+物料号
wmsInventory.setInventoryId(documentNo + "-" + documentDetail.getSeq() + "-" + documentDetail.getItem());
wmsInventory.setHandle(Inventory.genHandle(site, wmsInventory.getInventoryId()));
QueryWrapper<Item> queryWrapper = new QueryWrapper<Item>();
queryWrapper.lambda().eq(Item::getItem, documentDetail.getItem()).eq(Item::getSite, site).eq(Item::getCurrentRevision, "Y");
Item itemObj = wmsItemService.selectCurrent(site, documentDetail.getItem());
if (itemObj == null) {
throw BusinessException.build("物料" + documentDetail.getItem() + "没有当前版本或不存在");
}
wmsInventory.setItemBo(itemObj.getHandle());
wmsInventory.setItemBo(documentDetail.getItemBo());
wmsInventory.setQtyOnHand(documentDetail.getApplicationsQuantity());
wmsInventory.setOriginalQty(documentDetail.getApplicationsQuantity());
wmsInventory.setParentInventoryBo(wmsInventory.getHandle());
wmsInventory.setStatus(documentDetail.getIqcStatus());
wmsInventory.setInventorySpecialMarking(documentDetail.getKnttp());
if (documentDetail.getProductionDate() != null) {
wmsInventory.setProductionDate(documentDetail.getProductionDate().atStartOfDay());
}
wmsInventory.setCreator(SecurityUtils.getUserName());
wmsInventory.setCreateTime(LocalDateTime.now());
wmsInventory.setBatchNo(documentDetail.getBatch());

View File

@ -21,6 +21,8 @@ import java.util.Map;
@Mapper
public interface DocumentDetailedMapper extends MomBaseMapper<DocumentDetailed> {
List<DocumentDetailed> getDocumentDetailedInventoryList(@Param("site") String site,@Param("documentNo") String documentNo);
List<Map<String, Object>> selectDocumentDetailed(@Param("site")String site, @Param("item")String item);
IPage selectRetrieve(IPage iPage,@Param("site")String site, @Param("documentType")String documentType,

View File

@ -47,6 +47,17 @@
<sql id="Base_Column_List">
HANDLE, SITE, DOCUMENT_TYPE, DOCUMENT_NO,CUSTOMER_ITEM,CUSTOMER_ITEM_DESC, STATE, ITEM, ITEM_DESCRIPTION, GROES, UNIT_OF_MEASURE, APPLICATIONS_QUANTITY, ACTUAL_QUANTITY, SOURCE_WAREHOUSE, SOURCE_LOCATION, TARGET_WAREHOUSE, TARGET_LOCATION, EXECUTIVE_WAREHOUSE, BAR_CODE, QTY, CREATE_USER, REMARKS, CREATE_DATE_TIME, MODIFY_DATE_TIME, MODIFY_USER
</sql>
<select id="getDocumentDetailedInventoryList" resultType="com.foreverwin.mom.wms.entity.DocumentDetailed">
select zdd.DOCUMENT_TYPE,zdd.DOCUMENT_NO,zdd.ITEM,zdd.ITEM_DESCRIPTION,zdd.STATE,zdd.STORAGE_LOCATION,zdd.SALES_BATCH,zdd.SALES_ORDER,zdd.SALES_ORDER_SEQ, zdd.APPLICATIONS_QUANTITY
,wi.INVENTORY_ID BATCH,wi.ERP_STORAGE_LOCATION TARGET_WAREHOUSE,wi.PRODUCTION_DATE,wi.VENDOR_BATCH_NO VENDOR_BATCH
from z_document_detailed zdd
left join wms_inventory wi on wi.INVENTORY_ID = concat(zdd.DOCUMENT_NO,'-',zdd.SEQ,'-',zdd.ITEM)
where DOCUMENT_NO = #{documentNo}
and zdd.SITE = #{site}
</select>
<select id="selectDocumentDetailed" resultMap="documentDetailedMap">
SELECT * FROM Z_DOCUMENT_DETAILED WHERE SITE =#{site} AND ITEM = #{item}
</select>