@Transactional private void addThirdOrder(OrderSubmitParam inputs, OrderBean orderBean, Timestamp curtime) { TradeThirdOrder tradeThirdOrder = inputs.getThirdOrderBean(); tradeThirdOrder.setPriceMark(orderBean.getPriceMark()); tradeThirdOrder.setCreateTime(curtime); tradeThirdOrder.setOrderNo(orderBean.getOrderNo()); tradeThirdOrder.setOrderStatus(ThirdOrderStatus.PAYSUCCESS.value); tradeThirdOrderMapper.insert(tradeThirdOrder); log.info("insert trade_trird_order [" + tradeThirdOrder + "]"); }
public TradeThirdOrder getThirdOrderBythirdTradeNo(Integer partner, String thirdTradeNo) { TradeThirdOrderExample tradeThirdOrderExample = new TradeThirdOrderExample(); TradeThirdOrderExample.Criteria criteria = tradeThirdOrderExample.createCriteria(); criteria.andThirdPartnerEqualTo(partner); criteria.andThirdTradeNoEqualTo(thirdTradeNo); List<TradeThirdOrder> tOrders = tradeThirdOrderMapper.selectByExample(tradeThirdOrderExample); if (tOrders == null || tOrders.size() == 0) { OrderBeanExample orderBeanExample = new OrderBeanExample(); orderBeanExample.createCriteria().andThirdTradeNoEqualTo(thirdTradeNo); List<OrderBean> olist = orderBeanMapper.selectByExample(orderBeanExample); if (olist.size() == 1) { TradeThirdOrder tradeThirdOrder = tradeThirdOrderMapper.selectByPrimaryKey(olist.get(0).getOrderNo()); return tradeThirdOrder; } return null; } else { return tOrders.get(0); } }