| | |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.hive.service.imp.SysOrderServiceHelper; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDetailsDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.rabbitmq.client.DeliverCallback; |
| | | import com.rabbitmq.client.Delivery; |
| | | import org.apache.logging.log4j.message.Message; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | |
| | | @Autowired |
| | | private SysOrderServiceHelper sysOrderServiceHelper; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void synchronizationOrderToErp(ShopOrder orderDto) { |
| | |
| | | orderItemDao.insert(orderItem); |
| | | } |
| | | break; |
| | | case Dictionary.SHOPPING_GOODS_TYPE_ZHK: |
| | | // 新增明细 |
| | | orderItem.setGoodsId(shoppingGoods.getId()); |
| | | // 每一个充值卡都看成一个单独的订单条目 |
| | | count = orderItem.getCount(); |
| | | for (int j = 0; j < count; j++) { |
| | | orderItem.setCount(1); |
| | | orderItem.setId(null); |
| | | orderItemDao.insert(orderItem); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | // 处理收款逻辑 |
| | | SysOrder sourceOrder = sysOrderDao.selectById(order.getId()); |
| | | sourceOrder.setItems(orderItemDao.selectByOrderId(order.getId())); |
| | | // 设置会员充值卡使用情况 |
| | | orderService.addMoneyCardUse(sourceOrder); |
| | | sysOrderServiceHelper.addMoneyCardUse(sourceOrder); |
| | | |
| | | // 改变客户项目套餐使用情况 |
| | | orderService.addTaocanProj(sourceOrder); |
| | | |
| | | // 设置销量 |
| | | orderService.setShopSelCount(sourceOrder); |
| | | sysOrderServiceHelper.addTaocanProj(sourceOrder); |
| | | |
| | | SysOrderFlow flow = new SysOrderFlow(); |
| | | flow.setFlowNo(codeService.getFlowCode() + "-" + i); |