|
|
|
@ -56,6 +56,8 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
private EntityManager entityManager;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SnowflakeIdMaker snowflakeIdMaker;
|
|
|
|
|
@Autowired
|
|
|
|
|
protected MesContainerPackageDetailFeedingRepository packageDetailFeedingRDao;
|
|
|
|
|
|
|
|
|
|
private MesContainerPackage getContainerPackage(MesContainerSnBindModel model, String containerSn) {
|
|
|
|
|
MesContainerPackage containerPackage = containerPackageRDao.getByProperty(
|
|
|
|
@ -239,6 +241,16 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
List<MesContainerPackageDetail> packageDetails = containerPackageDetailRDao.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "pid", "snStatus"},
|
|
|
|
|
new Object[]{model.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), containerPackage.getId(), MesExtEnumUtil.CONTAINER_BARCODE_STATUS.STATUS_10.getValue()});
|
|
|
|
|
for (MesContainerPackageDetail detail : packageDetails) {
|
|
|
|
|
if (detail.getQty() == null) {
|
|
|
|
|
detail.setQty(0.0);
|
|
|
|
|
}
|
|
|
|
|
MesContainerPackageDetailFeeding feeding = packageDetailFeedingRDao.getByProperty(new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "pid", "sourceId"},
|
|
|
|
|
new Object[]{model.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), detail.getPid(), detail.getId()});
|
|
|
|
|
if (feeding != null && feeding.getQty() != null) {
|
|
|
|
|
detail.setQty(detail.getQty() - feeding.getQty());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
model.setPackageDetails(packageDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|