| | |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItem; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItemsVo; |
| | | import com.matrix.system.hive.service.*; |
| | |
| | | @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult refundOrder(@RequestBody SysOrder sysOrder) { |
| | | //储值卡订单不能通过退款渠道退款 |
| | | if(CollectionUtils.isNotEmpty(sysOrder.getItems())){ |
| | | List<SysOrderItem> orderItem = orderItemService.findByOrderId(sysOrder.getItems().get(0).getOrderId()); |
| | | if(orderItem.size()==1){ |
| | | if(orderItem.get(0).getShoppingGoods().getCode().equals("vipCzk")){ |
| | | return AjaxResult.buildFailInstance("充值订单请直接冲负数金额退款!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | SysUsers user = getMe(); |
| | | sysOrder.setShopId(user.getShopId()); |
| | | sysOrder.setStatu(Dictionary.ORDER_STATU_TK); |
| | | sysOrder.setOrderTime(new Date()); |
| | | |
| | | |
| | | //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 |
| | | sysOrder = orderService.checkAndSaveOrder(sysOrder); |
| | | orderService.refundOrderMoney(sysOrder); |
| | |
| | | MoneyCardUse cardUseInfo = cardUseService.findByVipId(order.getVipId()); |
| | | |
| | | if (cardUseInfo == null) { |
| | | cardUseInfo = new MoneyCardUse(); |
| | | cardUseInfo.setVipId(order.getVipId()); |
| | | cardUseInfo.setCardName("储值卡"); |
| | | cardUseInfo.setIsVipCar(Dictionary.FLAG_YES_Y); |
| | | cardUseInfo.setRealMoney(0D); |
| | | cardUseInfo.setGiftMoney(0D); |
| | | cardUseInfo.setSource("-"); |
| | | cardUseInfo.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | | cardUseInfo.setFailTime(DateUtil.stringToDate("2050-01-01 00:00",DateUtil.DATE_FORMAT_MM)); |
| | | moneyCardUseDao.insert(cardUseInfo); |
| | | cardUseInfo=sysVipInfoService.addVipDefaultCard(order.getVipId()); |
| | | } |
| | | |
| | | //打印需求加入门店信息 |