643aa698 刘嘉

1.菠萝派接口-库存同步逻辑修改

2.开启前端事务
1 个父辈 0716a07e
......@@ -30,12 +30,12 @@
p:basePackage="com.sibu.orderHelper.hotel.dao" p:sqlSessionFactoryBeanName="sqlSessionFactory"/>
<!-- 对数据源进行事务管理 -->
<!--<bean id="transactionManager"-->
<!--class="org.springframework.jdbc.datasource.DataSourceTransactionManager"-->
<!--p:dataSource-ref="dynamicDataSource"/>-->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
p:dataSource-ref="dynamicDataSource"/>
<!-- 事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
<!--<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" mode="proxy"/>-->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" mode="proxy"/>
<!-- 配置事务的传播特性 -->
<!--<tx:advice id="txAdvice" transaction-manager="transactionManager">-->
......
......@@ -59,7 +59,7 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto
if(pineappleDao.updateSku(skuBean) > 0){
//根据产品ID获取所有SKU总数
List<SkuApiResponse> skuBeanList = pineappleDao.getSkuBeanListByMap(callRequest.getBizModel().getPlatProductID());
if(!StringUtil.isNull(skuBeanList)){
if(StringUtil.isNull(skuBeanList)){
log.error(String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU集合",callRequest.getRequest().getAppkey()));
throw new BizException((String.format("菠萝派商城appkey[%s]更新库存失败,查询不到该SKU集合",callRequest.getRequest().getAppkey())));
}
......@@ -113,6 +113,9 @@ public class SyncStockBizServiceImpl extends AbstractBizService<PineappleSyncSto
pineappleSyncStockResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
pineappleSyncStockResponse.setCode(PineappleEnum.SUCCESS.getCode());
return pineappleSyncStockResponse;
}else{
log.error(String.format("菠萝派商城appkey[%s]更新库存失败", callRequest.getRequest().getAppkey()));
throw new BizException((String.format("菠萝派商城更新sku库存失败", callRequest.getRequest().getAppkey())));
}
}
}
......