fix(工序出站):逻辑修改,添加末工序车间

refs:#43702
This commit is contained in:
liaohechuan 2024-11-18 10:51:38 +08:00
parent 6688e5c3de
commit efc1746e61
5 changed files with 45 additions and 15 deletions

View File

@ -13,5 +13,5 @@ import org.springframework.transaction.annotation.Transactional;
public interface ZLotMaterialCompleteTransactionService extends IService<ZLotMaterialCompleteTransaction> { public interface ZLotMaterialCompleteTransactionService extends IService<ZLotMaterialCompleteTransaction> {
@Transactional @Transactional
void saveMaterialCompleteData(String site, String lotNo, String shopOrder); void saveMaterialCompleteData(String site, String lotNo, String shopOrder, String fabNo);
} }

View File

@ -38,7 +38,7 @@ public class ZLotMaterialCompleteTransactionServiceImpl extends ServiceImpl<ZLot
@Override @Override
@Transactional @Transactional
public void saveMaterialCompleteData(String site, String lotNo, String shopOrder){ public void saveMaterialCompleteData(String site, String lotNo, String shopOrder, String fabNo){
// 先查询日志记录表 // 先查询日志记录表
QueryWrapper<WmsInventoryLog> queryWrapper = new QueryWrapper<>(); QueryWrapper<WmsInventoryLog> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WmsInventoryLog::getMaterialLot, lotNo).eq(WmsInventoryLog::getSite, site).orderByDesc(WmsInventoryLog::getDateCreate); queryWrapper.lambda().eq(WmsInventoryLog::getMaterialLot, lotNo).eq(WmsInventoryLog::getSite, site).orderByDesc(WmsInventoryLog::getDateCreate);
@ -61,6 +61,7 @@ public class ZLotMaterialCompleteTransactionServiceImpl extends ServiceImpl<ZLot
ZLotMaterialCompleteTransaction mtrComTrans = new ZLotMaterialCompleteTransaction(); ZLotMaterialCompleteTransaction mtrComTrans = new ZLotMaterialCompleteTransaction();
mtrComTrans.setSid(UUID.randomUUID().toString()); mtrComTrans.setSid(UUID.randomUUID().toString());
mtrComTrans.setSite(site); mtrComTrans.setSite(site);
mtrComTrans.setFabNo(fabNo);
// 根据工单找计划工作中心 // 根据工单找计划工作中心
mtrComTrans.setInventoryLogSid(wmsInventoryLog.getUuid()); mtrComTrans.setInventoryLogSid(wmsInventoryLog.getUuid());
mtrComTrans.setShopOrder(shopOrder); mtrComTrans.setShopOrder(shopOrder);

View File

@ -255,6 +255,19 @@ public class OperationOutServiceImpl extends ServiceImpl<OperationOutMapper, Ope
String resrce = operationOutDTO.getResrce(); String resrce = operationOutDTO.getResrce();
// 资源主键 // 资源主键
String resrceBo = Resrce.genHandle(site, resrce); String resrceBo = Resrce.genHandle(site, resrce);
// 车间
String fabNo;
// 通过资源主键查询车间
if ("E".equals(jsonObject.get("endOp"))) {
List<String> fabNoList = baseMapper.findFabNo(resrceBo);
if (CollectionUtils.isNotEmpty(fabNoList)) {
fabNo = fabNoList.get(0);
} else {
throw BusinessException.build("根据设备【"+ resrce +"】未查询到车间!");
}
} else {
fabNo = null;
}
// 产出物料数量 // 产出物料数量
List<OperationOutListDTO> operationOutListDTOList = operationOutDTO.getOperationOutListDTOList(); List<OperationOutListDTO> operationOutListDTOList = operationOutDTO.getOperationOutListDTOList();
// 使用 Stream API 按工单分组 // 使用 Stream API 按工单分组
@ -495,19 +508,19 @@ public class OperationOutServiceImpl extends ServiceImpl<OperationOutMapper, Ope
remotePrintService.remotePrint(printPortDTO, SecurityConstants.FROM_IN); remotePrintService.remotePrint(printPortDTO, SecurityConstants.FROM_IN);
}*/ }*/
// // 末工序需要报工 // 末工序需要报工
// if ("E".equals(jsonObject.get("endOp"))) { if ("E".equals(jsonObject.get("endOp"))) {
// for(OperationOutListDTO operationOutListDTO : group) { for(OperationOutListDTO operationOutListDTO : group) {
// // 入仓库库存 // 入仓库库存
// String workCenter = createInventory(site, operationOutListDTO.getLotNo(), shopOrderObj, resrce, operationOutDTO.getRollType(), operationOutListDTO.getOutMeter()); String workCenter = createInventory(site, operationOutListDTO.getLotNo(), shopOrderObj, resrce, operationOutDTO.getRollType(), operationOutListDTO.getOutMeter());
// // 报工物料消耗261,这里并不呼叫SAP,只是将数据存储到我们自己的数据表 // 报工物料消耗261,这里并不呼叫SAP,只是将数据存储到我们自己的数据表
// zLotMaterialConsumptionTransactionService.saveMaterialConsumptionData(site, operationOutListDTO.getLotNo()); zLotMaterialConsumptionTransactionService.saveMaterialConsumptionData(site, operationOutListDTO.getLotNo());
// // 完工入库 // 完工入库
// zLotMaterialCompleteTransactionService.saveMaterialCompleteData(site, operationOutListDTO.getLotNo(), shopOrder); zLotMaterialCompleteTransactionService.saveMaterialCompleteData(site, operationOutListDTO.getLotNo(), shopOrder, fabNo);
// // 生产工单报工 // 生产工单报工
// zShoporderStatisticsTransactionService.saveSoStatisticsTransData(site, operation, resrce, workCenter, shopOrder); zShoporderStatisticsTransactionService.saveSoStatisticsTransData(site, operation, resrce, workCenter, shopOrder);
// } }
// } }
// 生产批主表修改数量 // 生产批主表修改数量
List<LotBasis> lotBasisList = new ArrayList<>(); List<LotBasis> lotBasisList = new ArrayList<>();

View File

@ -38,4 +38,6 @@ public interface OperationOutMapper extends MomBaseMapper<OperationOutDTO> {
OperationOutListDTO readOperationOutByBarCode(@Param("dto") OperationOutDTO operationOutDTO); OperationOutListDTO readOperationOutByBarCode(@Param("dto") OperationOutDTO operationOutDTO);
List<OperationOutBomComponentDTO> readBomComponent(@Param("site") String site, @Param("shopOrder") String shopOrder, @Param("operationBo") String operationBo); List<OperationOutBomComponentDTO> readBomComponent(@Param("site") String site, @Param("shopOrder") String shopOrder, @Param("operationBo") String operationBo);
List<String> findFabNo(@Param("resrceBo") String resrceBo);
} }

View File

@ -259,4 +259,18 @@
and bc.BOM_COMPONENT_TYPE not in ('B','C') and bc.BOM_COMPONENT_TYPE not in ('B','C')
and bc.OPERATION_BO = #{operationBo} and bc.OPERATION_BO = #{operationBo}
</select> </select>
<!--通过资源主键查询车间-->
<select id="findFabNo" resultType="java.lang.String">
select
fb.FAB_NO
from
wip.work_center_member wcm
inner join wip.work_center wc on
wc.HANDLE = wcm.WORK_CENTER_BO
inner join wip.fab_basis fb on
fb.HANDLE = wc.FAB_BASIS_BO
where
wcm.WORK_CENTER_OR_RESOURCE_GBO = #{resrceBo}
</select>
</mapper> </mapper>