refactor(shipment): 替换物料数据类型以统一物料信息处理
- 将BomMaterialDTO替换为MaterialMainDTO,统一物料信息的数据结构 - 修改ShipmentMaterialControllerService中物料信息获取及匹配逻辑 - 更新ShipmentMaterialZipImportProcessor中物料编号处理和信息获取代码 - 增加了MaterialMainDTO相关的引入,移除对旧类型的依赖
This commit is contained in:
parent
629af521dc
commit
e47b1d621b
|
|
@ -12,6 +12,7 @@ import com.nflg.wms.common.pojo.vo.QmsPdiTaskRecordDetailVO;
|
|||
import com.nflg.wms.common.pojo.vo.QmsPdiTaskRecordDefectPageVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsPdiTaskRecordPageVO;
|
||||
import com.nflg.wms.common.pojo.vo.QmsPdiTaskRecordSummaryVO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.repository.entity.QmsPdiDetectionRules;
|
||||
import com.nflg.wms.repository.entity.QmsPdiDetectionRulesDeliveryItem;
|
||||
import com.nflg.wms.repository.entity.QmsPdiDetectionRulesStatusItem;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
|
|||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.common.pojo.dto.BomMaterialDTO;
|
||||
import com.nflg.wms.common.pojo.dto.MaterialMainDTO;
|
||||
import com.nflg.wms.repository.entity.WmsShipmentMaterial;
|
||||
import com.nflg.wms.repository.service.IWmsShipmentMaterialService;
|
||||
import com.nflg.wms.starter.service.BomMaterialService;
|
||||
|
|
@ -66,7 +67,7 @@ public class ShipmentMaterialZipImportProcessor implements BasicProcessor {
|
|||
}
|
||||
String materialNo = name.substring(0, name.lastIndexOf("."));
|
||||
omsLogger.info("物料编号:{}", materialNo);
|
||||
BomMaterialDTO bomMaterialDTO = bomMaterialService.getMaterialInfo(materialNo);
|
||||
MaterialMainDTO bomMaterialDTO = bomMaterialService.getMaterialInfo(materialNo);
|
||||
if (Objects.isNull(bomMaterialDTO)) {
|
||||
omsLogger.error("主数据中未查找到该物料:{}", materialNo);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ public class ShipmentMaterialControllerService {
|
|||
: new ArrayList<>();
|
||||
|
||||
// 从BOM系统获取物料信息
|
||||
List<BomMaterialDTO> bomMaterials = bomMaterialService.getList(
|
||||
List<MaterialMainDTO> bomMaterials = bomMaterialService.getList(
|
||||
data.stream().map(ShipmentMaterialExcelImportDTO::getNo).collect(Collectors.toSet())
|
||||
);
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ public class ShipmentMaterialControllerService {
|
|||
if (StrUtil.isBlank(dto.getNo())) {
|
||||
sb.append("物料编号不能为空;");
|
||||
} else {
|
||||
BomMaterialDTO bomMaterial = bomMaterials.stream()
|
||||
MaterialMainDTO bomMaterial = bomMaterials.stream()
|
||||
.filter(m -> StrUtil.equals(dto.getNo(), m.getMaterialNo()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
|
@ -300,7 +300,7 @@ public class ShipmentMaterialControllerService {
|
|||
VUtil.trueThrowBusinessError(StrUtil.isBlank(name)).throwMessage("文件名不能为空");
|
||||
|
||||
String materialNo = name.substring(0, name.lastIndexOf("."));
|
||||
BomMaterialDTO bomMaterialDTO = bomMaterialService.getMaterialInfo(materialNo);
|
||||
MaterialMainDTO bomMaterialDTO = bomMaterialService.getMaterialInfo(materialNo);
|
||||
|
||||
if (Objects.isNull(bomMaterialDTO)) {
|
||||
pics.add(name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue