|
|
|
@ -156,31 +156,31 @@ public class ProOrderServiceImpl implements IProOrderService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 关闭订单,判断是否拆分完成
|
|
|
|
|
ProOrder order = proOrderMapper.selectProOrderById(splitOrderDTO.getProduct().getId());
|
|
|
|
|
Long quantitySplit = order.getQuantitySplit();
|
|
|
|
|
Long quantity1 = order.getQuantity();
|
|
|
|
|
if (quantity1.equals(quantitySplit)) {
|
|
|
|
|
// 需要关闭订单的codeList
|
|
|
|
|
List<String> orderCodes = new ArrayList<>();
|
|
|
|
|
// 临时存放code
|
|
|
|
|
StringBuilder orderCode = new StringBuilder();
|
|
|
|
|
orderCode.append(order.getOrderCode());
|
|
|
|
|
while(true) {
|
|
|
|
|
orderCodes.add(orderCode.toString());
|
|
|
|
|
String selectOrderCode = proOrderMapper.selectChildProOrderCodeByCode(orderCode.toString());
|
|
|
|
|
if (selectOrderCode == null) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
orderCode.setLength(0);
|
|
|
|
|
orderCode.append(selectOrderCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 关闭订单
|
|
|
|
|
for (String code : orderCodes) {
|
|
|
|
|
remoteSapService.sapCloseOrder(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// ProOrder order = proOrderMapper.selectProOrderById(splitOrderDTO.getProduct().getId());
|
|
|
|
|
// Long quantitySplit = order.getQuantitySplit();
|
|
|
|
|
// Long quantity1 = order.getQuantity();
|
|
|
|
|
// if (quantity1.equals(quantitySplit)) {
|
|
|
|
|
// // 需要关闭订单的codeList
|
|
|
|
|
// List<String> orderCodes = new ArrayList<>();
|
|
|
|
|
// // 临时存放code
|
|
|
|
|
// StringBuilder orderCode = new StringBuilder();
|
|
|
|
|
// orderCode.append(order.getOrderCode());
|
|
|
|
|
// while(true) {
|
|
|
|
|
// orderCodes.add(orderCode.toString());
|
|
|
|
|
// String selectOrderCode = proOrderMapper.selectChildProOrderCodeByCode(orderCode.toString());
|
|
|
|
|
// if (selectOrderCode == null) {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// orderCode.setLength(0);
|
|
|
|
|
// orderCode.append(selectOrderCode);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 关闭订单
|
|
|
|
|
// for (String code : orderCodes) {
|
|
|
|
|
// remoteSapService.sapCloseOrder(code);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
return success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|