1、代码片段
// 子单据状态更新
List<OutboundOrderDetails> updateOutboundOrderDetailsList = Lists.newArrayList();
outboundOrderDetailsList.forEach(val -> {
OutboundOrderDetails updateEntity = new OutboundDetailVO();
updateEntity.setId(val.getId());
updateEntity.setStatus(OutboundOrderDetails.STATUS_LOCK);
updateEntity.preUpdate();
updateOutboundOrderDetailsList.add(updateEntity);
});
outboundOrderDetailsService.updateBatchById(updateOutboundOrderDetailsList);
新增 updateEntity.setRowNum(val.getRowNum());
// 子单据状态更新
List<OutboundOrderDetails> updateOutboundOrderDetailsList = Lists.newArrayList();
outboundOrderDetailsList.forEach(val -> {
OutboundOrderDetails updateEntity = new OutboundDetailVO();
updateEntity.setId(val.getId());
updateEntity.setStatus(OutboundOrderDetails.STATUS_LOCK);
updateEntity.setRowNum(val.getRowNum());
updateEntity.preUpdate();
updateOutboundOrderDetailsList.add(updateEntity);
});
outboundOrderDetailsService.updateBatchById(updateOutboundOrderDetailsList);
标签:默认值,val,updateOutboundOrderDetailsList,updateEntity,005,new,OutboundOrderDetails
From: https://www.cnblogs.com/Code-Rain/p/16577085.html