|
|
|
@ -20,6 +20,7 @@ import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -240,20 +241,25 @@ public class MesContainerSnBindServiceImpl implements IMesContainerSnBindService
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, "containerSn"},
|
|
|
|
|
new Object[]{model.getOrganizeCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), containerSn.getContainerSn()});
|
|
|
|
|
if (containerPackage != null) {
|
|
|
|
|
List<MesContainerPackageDetail> newPackageDetails = new ArrayList<>();
|
|
|
|
|
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);
|
|
|
|
|
MesContainerPackageDetail newDetail = new MesContainerPackageDetail();
|
|
|
|
|
BeanUtils.copyProperties(detail, newDetail);
|
|
|
|
|
|
|
|
|
|
if (newDetail.getQty() == null) {
|
|
|
|
|
newDetail.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());
|
|
|
|
|
newDetail.setQty(newDetail.getQty() - feeding.getQty());
|
|
|
|
|
}
|
|
|
|
|
newPackageDetails.add(newDetail);
|
|
|
|
|
}
|
|
|
|
|
model.setPackageDetails(packageDetails);
|
|
|
|
|
model.setPackageDetails(newPackageDetails);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.setContainerPackage(containerPackage);
|
|
|
|
|