| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | |
| | | @Autowired |
| | | RabiitMqTemplate rabiitMqTemplate; |
| | | |
| | | @Autowired |
| | | private SysProjServicesDao sysProjServicesDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | |
| | | SysUsers user = getMe(); |
| | | sysOrder.setShopId(user.getShopId()); |
| | | sysOrder.setOrderType(SysOrder.ORDER_TYPE_SEAL); |
| | | sysOrder.setIsHasRefund(SysOrder.IS_HAS_REFUND_N); |
| | | //校验订单是否满足结算调价,新订单则保存订单,已有订单则删除后更新 |
| | | sysOrder = orderService.checkAndSaveOrder(sysOrder); |
| | | orderService.updateReceiptMoney(sysOrder); |
| | |
| | | if (order == null) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "订单不存在!"); |
| | | } |
| | | orderService.cancelOrder(id); |
| | | if (del > 0) { |
| | | orderService.removeById(id); |
| | | result.setInfo("删除成功!"); |
| | | } else { |
| | | result.setInfo("取消成功!"); |
| | | |
| | | List<SysOrderItem> items = orderItemDao.selectByOrderId(id); |
| | | for (SysOrderItem item : items) { |
| | | List<SysProjServices> sysProjServices = sysProjServicesDao.selectProjServicesByOrderItemId(item.getId()); |
| | | if (CollUtil.isNotEmpty(sysProjServices)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "订单存在进行中的服务单无法取消/删除"); |
| | | } |
| | | } |
| | | |
| | | orderService.cancelOrder(id); |
| | | // if (del > 0) { |
| | | // orderService.removeById(id); |
| | | // result.setInfo("删除成功!"); |
| | | // } else { |
| | | result.setInfo("取消成功!"); |
| | | // } |
| | | result.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | |
| | | return result; |