|
|
|
@ -344,11 +344,17 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "containerSn"},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), containerSn.getContainerSn()});
|
|
|
|
|
}
|
|
|
|
|
for (MesContainerPackageDetail packageDetail : packageDetails) {
|
|
|
|
|
if (Objects.equals(packageDetail.getBarCode(), model.getBarCode())) {
|
|
|
|
|
MesPcnException.throwMesBusiException("容器条码【%s】与条码【%s】已绑定,请检查数据", containerSn.getContainerSn(), model.getBarCode());
|
|
|
|
|
}
|
|
|
|
|
MesContainerPackageDetail barcodePackageDetail = containerPackageDetailRDao.getByProperty(new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "barCode"},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), model.getBarCode()});
|
|
|
|
|
if (barcodePackageDetail != null) {
|
|
|
|
|
MesPcnException.throwMesBusiException("条码【%s】已被容器【%s】绑定,请检查数据!", model.getBarCode(), barcodePackageDetail.getContainerSn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// for (MesContainerPackageDetail packageDetail : packageDetails) {
|
|
|
|
|
// if (Objects.equals(packageDetail.getBarCode(), model.getBarCode())) {
|
|
|
|
|
// MesPcnException.throwMesBusiException("容器条码【%s】与条码【%s】已绑定,请检查数据!", containerSn.getContainerSn(), model.getBarCode());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
List<MesContainerPackageDetail> oldPackageDetails = new ArrayList<>();
|
|
|
|
|
getBottomPackageDetails(organizeCode, containerSn.getContainerSn(), oldPackageDetails);
|
|
|
|
|
|
|
|
|
@ -357,17 +363,15 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
MesContainerSn childContainerSn = containerSnService.getContainerSn(organizeCode, model.getBarCode());
|
|
|
|
|
if (childContainerSn != null) {
|
|
|
|
|
if (!Objects.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), containerType.getIsAllowRecursion())) {
|
|
|
|
|
MesPcnException.throwBusiException("扫描的容器条码:%s,不允许绑定容器!", containerSn.getContainerSn());
|
|
|
|
|
MesPcnException.throwBusiException("容器条码【%s】不能绑定容器,请重新扫描!", containerSn.getContainerSn());
|
|
|
|
|
}
|
|
|
|
|
bottomPackageDetails = checkContainerBarcode(organizeCode, model.getBarCode(), oldPackageDetails);
|
|
|
|
|
} else {
|
|
|
|
|
if (Objects.equals(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), containerType.getIsAllowRecursion())) {
|
|
|
|
|
MesPcnException.throwBusiException("容器条码【%s】不能零件条码,请重新扫描!", containerSn.getContainerSn());
|
|
|
|
|
}
|
|
|
|
|
bottomPackageDetails = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MesContainerSnBindModel containerResult = packageContainerSnService.packageContain(organizeCode, model.getUserName(), model.getContainerSn(), model.getBarCode());
|
|
|
|
|
// if (containerResult != null) {
|
|
|
|
|
// return containerResult;
|
|
|
|
|
// }
|
|
|
|
|
String barcode = model.getBarCode();
|
|
|
|
|
if (!CollectionUtils.isEmpty(bottomPackageDetails)) {
|
|
|
|
|
barcode = bottomPackageDetails.get(0).getBarCode();
|
|
|
|
@ -523,6 +527,11 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
if (!Objects.equals(containerPackage.getPackageStatus(), MesExtEnumUtil.CONTAINER_PACKAGE_STATUS.STATUS_20.getValue())) {
|
|
|
|
|
MesPcnException.throwMesBusiException("容器条码【%s】未关箱,不能执行开箱操作!", containerSn.getContainerSn());
|
|
|
|
|
}
|
|
|
|
|
MesContainerPackageDetail packageDetail = containerPackageDetailRDao.getByProperty(new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "barCode"},
|
|
|
|
|
new Object[]{model.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), containerSn.getContainerSn()});
|
|
|
|
|
if (packageDetail != null) {
|
|
|
|
|
MesPcnException.throwMesBusiException("容器条码【%s】已被容器【%s】绑定,请先解绑再执行开箱操作!", containerSn.getContainerSn(), packageDetail.getContainerSn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
containerPackage.setPackageStatus(MesExtEnumUtil.CONTAINER_PACKAGE_STATUS.STATUS_10.getValue());
|
|
|
|
|
ConvertBean.serviceModelUpdate(containerPackage, model.getUserName());
|
|
|
|
@ -551,7 +560,7 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
MesPcnException.throwMesBusiException("容器条码【%s】或容器类型代码【%s】未维护与零件关系,请检查数据", containerSn.getContainerSn(), containerSn.getContainerTypeCode());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isEmpty(selectPartNo) && !Objects.equals(selectPartNo, model.getPartNo())) {
|
|
|
|
|
MesPcnException.throwMesBusiException("条码【%s】的零件号【%s】与选择的零件不匹配,请检查数据", barCode, produceSn.getPartNo());
|
|
|
|
|
MesPcnException.throwMesBusiException("条码【%s】的零件号【%s】与选择的零件不匹配,请检查数据", barCode, model.getPartNo());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return model;
|
|
|
|
|