fix(工序出站):逻辑修改,添加末工序车间
refs:#43702
This commit is contained in:
parent
6688e5c3de
commit
efc1746e61
@ -13,5 +13,5 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
public interface ZLotMaterialCompleteTransactionService extends IService<ZLotMaterialCompleteTransaction> {
|
||||
|
||||
@Transactional
|
||||
void saveMaterialCompleteData(String site, String lotNo, String shopOrder);
|
||||
void saveMaterialCompleteData(String site, String lotNo, String shopOrder, String fabNo);
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ public class ZLotMaterialCompleteTransactionServiceImpl extends ServiceImpl<ZLot
|
||||
|
||||
@Override
|
||||
@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.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();
|
||||
mtrComTrans.setSid(UUID.randomUUID().toString());
|
||||
mtrComTrans.setSite(site);
|
||||
mtrComTrans.setFabNo(fabNo);
|
||||
// 根据工单找计划工作中心
|
||||
mtrComTrans.setInventoryLogSid(wmsInventoryLog.getUuid());
|
||||
mtrComTrans.setShopOrder(shopOrder);
|
||||
|
||||
@ -255,6 +255,19 @@ public class OperationOutServiceImpl extends ServiceImpl<OperationOutMapper, Ope
|
||||
String resrce = operationOutDTO.getResrce();
|
||||
// 资源主键
|
||||
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();
|
||||
// 使用 Stream API 按工单分组
|
||||
@ -495,19 +508,19 @@ public class OperationOutServiceImpl extends ServiceImpl<OperationOutMapper, Ope
|
||||
remotePrintService.remotePrint(printPortDTO, SecurityConstants.FROM_IN);
|
||||
}*/
|
||||
|
||||
// // 末工序需要报工
|
||||
// if ("E".equals(jsonObject.get("endOp"))) {
|
||||
// for(OperationOutListDTO operationOutListDTO : group) {
|
||||
// // 入仓库库存
|
||||
// String workCenter = createInventory(site, operationOutListDTO.getLotNo(), shopOrderObj, resrce, operationOutDTO.getRollType(), operationOutListDTO.getOutMeter());
|
||||
// // 报工物料消耗261,这里并不呼叫SAP,只是将数据存储到我们自己的数据表
|
||||
// zLotMaterialConsumptionTransactionService.saveMaterialConsumptionData(site, operationOutListDTO.getLotNo());
|
||||
// // 完工入库
|
||||
// zLotMaterialCompleteTransactionService.saveMaterialCompleteData(site, operationOutListDTO.getLotNo(), shopOrder);
|
||||
// // 生产工单报工
|
||||
// zShoporderStatisticsTransactionService.saveSoStatisticsTransData(site, operation, resrce, workCenter, shopOrder);
|
||||
// }
|
||||
// }
|
||||
// 末工序需要报工
|
||||
if ("E".equals(jsonObject.get("endOp"))) {
|
||||
for(OperationOutListDTO operationOutListDTO : group) {
|
||||
// 入仓库库存
|
||||
String workCenter = createInventory(site, operationOutListDTO.getLotNo(), shopOrderObj, resrce, operationOutDTO.getRollType(), operationOutListDTO.getOutMeter());
|
||||
// 报工物料消耗261,这里并不呼叫SAP,只是将数据存储到我们自己的数据表
|
||||
zLotMaterialConsumptionTransactionService.saveMaterialConsumptionData(site, operationOutListDTO.getLotNo());
|
||||
// 完工入库
|
||||
zLotMaterialCompleteTransactionService.saveMaterialCompleteData(site, operationOutListDTO.getLotNo(), shopOrder, fabNo);
|
||||
// 生产工单报工
|
||||
zShoporderStatisticsTransactionService.saveSoStatisticsTransData(site, operation, resrce, workCenter, shopOrder);
|
||||
}
|
||||
}
|
||||
|
||||
// 生产批主表修改数量
|
||||
List<LotBasis> lotBasisList = new ArrayList<>();
|
||||
|
||||
@ -38,4 +38,6 @@ public interface OperationOutMapper extends MomBaseMapper<OperationOutDTO> {
|
||||
OperationOutListDTO readOperationOutByBarCode(@Param("dto") OperationOutDTO operationOutDTO);
|
||||
|
||||
List<OperationOutBomComponentDTO> readBomComponent(@Param("site") String site, @Param("shopOrder") String shopOrder, @Param("operationBo") String operationBo);
|
||||
|
||||
List<String> findFabNo(@Param("resrceBo") String resrceBo);
|
||||
}
|
||||
|
||||
@ -259,4 +259,18 @@
|
||||
and bc.BOM_COMPONENT_TYPE not in ('B','C')
|
||||
and bc.OPERATION_BO = #{operationBo}
|
||||
</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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user