| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.exception.money.TeamRewardDebtException;
|
| | | import com.yeshi.fanli.exception.order.TaoBaoOrderException;
|
| | | import com.yeshi.fanli.service.manger.order.TeamRewardManager;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | @Resource
|
| | | private UserOrderMsgNotificationService userOrderMsgNotificationService;
|
| | | private TeamRewardManager teamRewardManager;
|
| | |
|
| | | @Resource
|
| | | private MsgOrderDetailService msgOrderDetailService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderService commonOrderService;
|
| | |
| | | isUpdate = true;
|
| | | try {
|
| | | if (order.getState().contains("维权成功")) {
|
| | | // 更改CommonOrder的状态
|
| | | CommonOrder commonOrder = commonOrderService
|
| | | .selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
|
| | | if (commonOrder != null) {
|
| | | CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | updateCommonOrder.setState(CommonOrder.STATE_WQ);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | userOrderWeiQuanRecordService.addTaoBaoWeiQuan(taoBaoWeiQuanOrder);
|
| | | }
|
| | | weiQuanSuccess(order);
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | |
| | | id = order.getId();
|
| | | isAdd = true;
|
| | | if (order.getState().contains("维权成功")) {
|
| | | // 更改CommonOrder的状态
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getOrderItemId());
|
| | | if (commonOrder != null) {
|
| | | CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | updateCommonOrder.setState(CommonOrder.STATE_WQ);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | userOrderWeiQuanRecordService.addTaoBaoWeiQuan(order);
|
| | | }
|
| | | weiQuanSuccess(order);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 维权成功
|
| | | *
|
| | | * @param order
|
| | | */
|
| | | private void weiQuanSuccess(TaoBaoWeiQuanOrder order) {
|
| | | // 更改CommonOrder的状态
|
| | | CommonOrder commonOrder = commonOrderService.selectBySourceTypeAndTradeId(Constant.SOURCE_TYPE_TAOBAO,
|
| | | order.getOrderItemId());
|
| | | if (commonOrder != null) {
|
| | | CommonOrder updateCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | updateCommonOrder.setState(CommonOrder.STATE_WQ);
|
| | | updateCommonOrder.setUpdateTime(new Date());
|
| | | commonOrderService.updateByPrimaryKeySelective(updateCommonOrder);
|
| | | userOrderWeiQuanRecordService.addTaoBaoWeiQuan(order);
|
| | | try {
|
| | | teamRewardManager.weiQuan(order.getOrderId(), Constant.SOURCE_TYPE_TAOBAO, order.getOrderItemId());
|
| | | } catch (TaoBaoOrderException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TeamRewardDebtException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TaoBaoWeiQuanOrder> getWeiQuanSuccessOrders(String orderId) {
|
| | | return taoBaoWeiQuanOrderMapper.selectListByOrderIdAndState(orderId, "维权成功");
|