|
|
|
@ -245,7 +245,41 @@ public class ZyOrdersController extends JeecgController<ZyOrders, IZyOrdersServi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return Result.OK("成功"); |
|
|
|
|
List<String> ids = new ArrayList<>(); |
|
|
|
|
ZyOrders zos = new ZyOrders(); |
|
|
|
|
QueryWrapper<ZyOrders> queryWrapperzos = QueryGenerator.initQueryWrapper(zos, req.getParameterMap()); |
|
|
|
|
queryWrapperzos.eq("order_id",zyOrders.getId()); |
|
|
|
|
List<ZyOrders> listzos = zyOrdersService.list(queryWrapperzos); |
|
|
|
|
if(listzos.size()>0){ |
|
|
|
|
return Result.error("该订单已经拆分,不可以再次拆单!"); |
|
|
|
|
}else{ |
|
|
|
|
OrderGoods orderGoods = new OrderGoods(); |
|
|
|
|
QueryWrapper<OrderGoods> queryWrapperog = QueryGenerator.initQueryWrapper(orderGoods, req.getParameterMap()); |
|
|
|
|
queryWrapperog.eq("orders_id",zyOrders.getId()); |
|
|
|
|
List<OrderGoods> listog = orderGoodsService.list(queryWrapperog); |
|
|
|
|
if(listog.size()>0){ |
|
|
|
|
for (int i = 0 ; i < listog.size() ; i++){ |
|
|
|
|
ZyOrders zo = new ZyOrders(); |
|
|
|
|
zo = zyOrders; |
|
|
|
|
zo.setId(null); |
|
|
|
|
zo.setOrdersNum(getOrdersNum()); |
|
|
|
|
zo.setFreight(Double.parseDouble("0")); |
|
|
|
|
zo.setIschild(1); |
|
|
|
|
zo.setOrderId(zyOrders.getId()); |
|
|
|
|
zo.setMoney(listog.get(i).getTotalPrice()); |
|
|
|
|
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
|
|
|
|
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
|
|
|
|
zo.setGoodsQuantity(1); |
|
|
|
|
zyOrdersService.save(zo); |
|
|
|
|
ids.add(zo.getId()); |
|
|
|
|
OrderGoods og = new OrderGoods(); |
|
|
|
|
og = listog.get(i); |
|
|
|
|
og.setOrdersId(zo.getId()); |
|
|
|
|
orderGoodsService.updateById(og); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Result.OK(ids); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|