|
|
|
@ -871,21 +871,21 @@ public class IssureNotifyServiceImpl implements IssureNotifyService { |
|
|
|
// 用于存储最终结果:父集合和子集合 |
|
|
|
List<SOIssueNotifyOrderList> parentList = new ArrayList<>(); |
|
|
|
List<SOIssueNotifyOrderMaterialList> childList = new ArrayList<>(); |
|
|
|
int num = 0; |
|
|
|
BigDecimal nextItem=BigDecimal.ZERO; |
|
|
|
|
|
|
|
// 步骤2:遍历每个分组,生成父对象和子对象 |
|
|
|
List<ShoporderAndMaterialDto> groupDtos = data.getMaterialList(); |
|
|
|
|
|
|
|
// 2.1 生成父对象的唯一 itemNo(确保全局唯一,这里用 UUID 简化) |
|
|
|
if(num == 0){ |
|
|
|
SOIssueNotifyOrderList parentData = new SOIssueNotifyOrderList(); |
|
|
|
parentData.setSite(data.getSite()); |
|
|
|
parentData.setNotifyNo(data.getNotifyNo()); |
|
|
|
nextItem = issureNotifyMapper.getNextItemForSOIssueNotifyOrderList(parentData); |
|
|
|
}else{ |
|
|
|
|
|
|
|
SOIssueNotifyOrderList parentData = new SOIssueNotifyOrderList(); |
|
|
|
parentData.setSite(data.getSite()); |
|
|
|
parentData.setNotifyNo(data.getNotifyNo()); |
|
|
|
nextItem = issureNotifyMapper.getNextItemForSOIssueNotifyOrderList(parentData); |
|
|
|
if(nextItem == null) { |
|
|
|
nextItem = nextItem.add(BigDecimal.ONE); |
|
|
|
} |
|
|
|
|
|
|
|
String transType = Consts.VR; |
|
|
|
// 获取流水号,出错不回滚 |
|
|
|
TransNoControl transNo = transNoService.getTransNo(data.getSite(),transType,8); |
|
|
|
@ -893,6 +893,7 @@ public class IssureNotifyServiceImpl implements IssureNotifyService { |
|
|
|
|
|
|
|
// 2.2 构建SOIssueNotifyOrderList |
|
|
|
SOIssueNotifyOrderList parent = buildOnOrderParent(data.getNotifyNo(),data.getSite(),newOrderNo, data.getOrderType(), nextItem); |
|
|
|
parentList.add(parent); |
|
|
|
if("shoporder".equals(parent.getOrderType())){ |
|
|
|
parent.setProductionArea("Z301"); |
|
|
|
}else if ("shipment".equals(parent.getOrderType())){ |
|
|
|
|