Authored by mali

下单bug

... ... @@ -37,16 +37,13 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
public void doSumbitOrder(OrderBuilder orderBuilder){
// 减库存
productProxyService.subtractStorage(orderBuilder.getProductId(), orderBuilder.getSkup());
// 创建订单
orderCreateService.createOrder(orderBuilder);
if (productProxyService.subtractStorage(orderBuilder.getProductId(), orderBuilder.getSkup())) {
// 创建订单
orderCreateService.createOrder(orderBuilder);
}
}
@Service
public static class OrderCreateService{
... ... @@ -75,6 +72,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
* @param orderBuilder
*/
@Transactional(propagation = Propagation.REQUIRED)
@Database(ForceMaster=true, DataSource="ufo_order")
public void createOrder(OrderBuilder orderBuilder){
try{
... ...