|
|
|
@ -104,56 +104,29 @@ public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailSe
|
|
|
|
|
filterInvProductDetailRequest.setMainAction(ConstantType.TYPE_PUT);
|
|
|
|
|
List<InvProductDetailEntity> datas = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
|
|
|
|
|
if (CollUtil.isEmpty(datas)) {
|
|
|
|
|
filterInvProductDetailRequest.setOriginCode(null);
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
|
|
|
|
|
if (StrUtil.isNotEmpty(udiEntity.getBatchNo()))
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(udiEntity.getBatchNo());
|
|
|
|
|
else
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo("empty");
|
|
|
|
|
|
|
|
|
|
filterInvProductDetailRequest.setProductionDate(udiEntity.getProduceDate());
|
|
|
|
|
filterInvProductDetailRequest.setExpireDate(udiEntity.getExpireDate());
|
|
|
|
|
datas = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
|
|
|
|
|
// filterInvProductDetailRequest.setOriginCode(null);
|
|
|
|
|
// UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
|
|
|
|
|
// if (StrUtil.isNotEmpty(udiEntity.getBatchNo()))
|
|
|
|
|
// filterInvProductDetailRequest.setBatchNo(udiEntity.getBatchNo());
|
|
|
|
|
// else
|
|
|
|
|
// filterInvProductDetailRequest.setBatchNo("empty");
|
|
|
|
|
//
|
|
|
|
|
// filterInvProductDetailRequest.setProductionDate(udiEntity.getProduceDate());
|
|
|
|
|
// filterInvProductDetailRequest.setExpireDate(udiEntity.getExpireDate());
|
|
|
|
|
// datas = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isNotEmpty(datas)) {
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = datas.get(0);
|
|
|
|
|
String bacthNo = null;
|
|
|
|
|
if (StrUtil.isEmpty(invProductDetailEntity.getBatchNo())) {
|
|
|
|
|
bacthNo = "empty";
|
|
|
|
|
} else {
|
|
|
|
|
bacthNo = invProductDetailEntity.getBatchNo();
|
|
|
|
|
}
|
|
|
|
|
// InvProductEntity invProductEntity = invPreInProductDao.selectByUuid(invProductDetailEntity.getProductIdFk(), bacthNo, invProductDetailEntity.getSupId(), invProductDetailEntity.getInvStorageCode(), invProductDetailEntity.getInvWarehouseCode());
|
|
|
|
|
// invProductDetailEntity.setCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
for (int i = 1; i < datas.size(); i++) {
|
|
|
|
|
invProductDetailEntity.setCount(invProductDetailEntity.getCount() + datas.get(i).getCount());
|
|
|
|
|
}
|
|
|
|
|
return invProductDetailEntity;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Map<String, InvProductDetailEntity> invProductDetailEntityMap = new HashMap<>();
|
|
|
|
|
// for (InvProductDetailEntity invProductDetailEntity : datas) {
|
|
|
|
|
// InvProductDetailEntity temp = invProductDetailEntityMap.get(invProductDetailEntity.getOriginCode());
|
|
|
|
|
// if (temp == null) {
|
|
|
|
|
// invProductDetailEntityMap.put(invProductDetailEntity.getOriginCode(), invProductDetailEntity);
|
|
|
|
|
// } else {
|
|
|
|
|
// int count1 = 0;
|
|
|
|
|
// int count2 = 0;
|
|
|
|
|
// if (temp.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
|
// count1 = temp.getCount();
|
|
|
|
|
// } else {
|
|
|
|
|
// count1 = 0 - temp.getCount();
|
|
|
|
|
// }
|
|
|
|
|
// if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
|
// count2 = invProductDetailEntity.getCount();
|
|
|
|
|
// } else {
|
|
|
|
|
// count2 = 0 - invProductDetailEntity.getCount();
|
|
|
|
|
// }
|
|
|
|
|
// temp.setCount(count1 + count2);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean deleteByOrderIdFk(String orderIdFk) {
|
|
|
|
|