Helius
2021-03-11 a72aa4bb793ec765892406c842039a71b33215b1
zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -1,5 +1,6 @@
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;
@@ -95,10 +96,8 @@
    RabiitMqTemplate rabiitMqTemplate;
    @Autowired
    private SysProjUseDao sysProjUseDao;
    private SysProjServicesDao sysProjServicesDao;
    @Autowired
    private SysProjServicesService projServicesService;
    @Value("${evn}")
    private String evn;
@@ -479,8 +478,14 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "订单不存在!");
        }
//        SysProjServices sysProjServices = new SysProjServices();
//        projServicesService.findByModel()
        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);