|
|
|
@ -381,6 +381,7 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
@Override
|
|
|
|
|
public MesContainerSnBindModel doScanBarcode(MesContainerSnBindModel model, boolean bStep) {
|
|
|
|
|
final String organizeCode = model.getOrganizeCode();
|
|
|
|
|
String barcode = model.getBarCode();
|
|
|
|
|
//校验容器条码
|
|
|
|
|
MesContainerSn containerSn = containerSnService.checkContainerSn(organizeCode, model.getContainerSn());
|
|
|
|
|
MesContainerType containerType = containerTypeRDao.getByProperty(
|
|
|
|
@ -428,7 +429,6 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
}
|
|
|
|
|
bottomPackageDetails = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
String barcode = model.getBarCode();
|
|
|
|
|
if (!CollectionUtils.isEmpty(bottomPackageDetails)) {
|
|
|
|
|
barcode = bottomPackageDetails.get(0).getBarCode();
|
|
|
|
|
}
|
|
|
|
@ -472,6 +472,7 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MesContainerPackageDetailBinding binding = createContainerPackageDetailBinding(packageDetail, MesExtEnumUtil.CONTAINER_RAW_SN_BINDING_STATUS.BINDING, model.getUserName());
|
|
|
|
|
bindContainerSnStation(organizeCode, model.getContainerSn(), model.getBarCode(), model.getUserName());
|
|
|
|
|
|
|
|
|
|
packageDetails.add(packageDetail);
|
|
|
|
|
model.setContainerPackage(containerPackage);
|
|
|
|
@ -483,6 +484,35 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void bindContainerSnStation(String organizeCode, String containerSn, String barCode, String userName) {
|
|
|
|
|
MesContainerPackage barcodePackage = containerPackageRDao.getByProperty(
|
|
|
|
|
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(), barCode});
|
|
|
|
|
if (barcodePackage == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String topContainerSn = getTopContainerSn(organizeCode, containerSn);
|
|
|
|
|
MesContainerSnStation containerSnStation = containerSnStationRDao.getByProperty(new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "topContainerSn"},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), topContainerSn});
|
|
|
|
|
if (containerSnStation == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<MesContainerPackageDetail> bottomPackageDetailList = new ArrayList<>();
|
|
|
|
|
getBottomPackageDetails(organizeCode, barcodePackage, bottomPackageDetailList);
|
|
|
|
|
final Set<String> containerSnSet = bottomPackageDetailList.stream().map(MesContainerPackageDetail::getContainerSn).collect(Collectors.toSet());
|
|
|
|
|
for (String bottomContainerSn : containerSnSet) {
|
|
|
|
|
MesContainerSnStation snStation = new MesContainerSnStation();
|
|
|
|
|
snStation.setOrganizeCode(organizeCode);
|
|
|
|
|
snStation.setStation(containerSnStation.getStation());
|
|
|
|
|
snStation.setContainerSn(bottomContainerSn);
|
|
|
|
|
snStation.setTopContainerSn(topContainerSn);
|
|
|
|
|
snStation.setSeq(1);
|
|
|
|
|
ConvertBean.serviceModelInitialize(snStation, userName);
|
|
|
|
|
containerSnStationRDao.insert(snStation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void saveContainerPackage(MesContainerSnBindModel model) {
|
|
|
|
|
MesContainerPackage containerPackage = model.getContainerPackage();
|
|
|
|
|
if (containerPackage != null) {
|
|
|
|
|