|
|
@@ -129,13 +129,15 @@ public class DefaultOrderSaveImpl implements IOrderSave {
|
|
|
}
|
|
|
order.setSysNo((String) billNo.getData());
|
|
|
R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(order.getCorpId());
|
|
|
- /* //生成订单号
|
|
|
- R clientBillNo = serialClient.getBillNo(corpMessage.getData().getCode(),order.getTradeType());
|
|
|
+ if (StringUtils.isBlank(order.getOrderNo())){
|
|
|
+ //生成订单号
|
|
|
+ R clientBillNo = serialClient.getBillNo(corpMessage.getData().getCode(),order.getTradeType(),order.getTradeType());
|
|
|
if (!clientBillNo.isSuccess()){
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
throw new SecurityException("生成订单号失败");
|
|
|
}
|
|
|
- order.setOrderNo((String) clientBillNo.getData());*/
|
|
|
+ order.setOrderNo((String) clientBillNo.getData());
|
|
|
+ }
|
|
|
//判断贸易类型
|
|
|
if(order.getTradeType().equals("JK"))
|
|
|
{
|
|
|
@@ -174,16 +176,20 @@ public class DefaultOrderSaveImpl implements IOrderSave {
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(itemsVOList)) {
|
|
|
itemsVOList.forEach(li -> {
|
|
|
+ String billNo = null;
|
|
|
+ if (StringUtils.isNotBlank(li.getBillNo())){
|
|
|
+ billNo = li.getBillNo().toUpperCase();
|
|
|
+ }
|
|
|
li.setPid(id);
|
|
|
if (Objects.isNull(li.getId())) {
|
|
|
li.setCreateTime(new Date());
|
|
|
li.setCreateUser(AuthUtil.getUserId());
|
|
|
- li.setBillNo(li.getBillNo().toUpperCase());
|
|
|
+ li.setBillNo(billNo);
|
|
|
orderItemsMapper.insert(li);
|
|
|
} else {
|
|
|
li.setUpdateTime(new Date());
|
|
|
li.setUpdateUser(AuthUtil.getUserId());
|
|
|
- li.setBillNo(li.getBillNo().toUpperCase());
|
|
|
+ li.setBillNo(billNo);
|
|
|
orderItemsMapper.updateById(li);
|
|
|
}
|
|
|
});
|