自动化立体仓库 - WMS系统
#
lty
2 天以前 d8c9b9afb41c368a08d7e05d0f624c98bf72042a
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -17,6 +17,7 @@
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
import com.zy.common.utils.NodeUtils;
import com.zy.third.erp.task.ERPOutHedTBScheduler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -76,6 +77,9 @@
    @Resource
    private WrkMastService wrkMastService;
    @Resource
    private ERPOutHedTBScheduler erpOutHedTBScheduler;
    @Override
@@ -214,6 +218,27 @@
        // 获取单据
        Order order = orderService.selectByNo(orderNo);
        if (order == null) {
            erpOutHedTBScheduler.OutHedTBScheduler(orderNo);
            order = orderService.selectByNo(orderNo);
//            int i = 30;
//            while (i >= 0) {
//                try {
//                    Thread.sleep(1000);
//                    System.out.println(i);
//                } catch (InterruptedException e) {
//                    throw new RuntimeException(e);
//                }
//                order = orderService.selectByNo(orderNo);
//                if (order != null) {
//                    break;
//                }
//                i--;
//            }
        }
        if (order == null) {
            return R.parse("单据不存在:" + orderNo);
        }
        // 获取单据明细
        List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId());
@@ -287,6 +312,8 @@
        }
        return R.ok("出库成功");
    }
    @Override
    @Transactional
@@ -679,12 +706,12 @@
    @Override
    @Transactional
    public void syncMat(MatSyncParam param) {
        if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <=0 ) {
        if (Cools.isEmpty(param.getMatDetails()) || param.getMatDetails().size() <= 0) {
            throw new CoolException("商品数据为空");
        }
        for(MatSyncParam.MatParam matParam : param.getMatDetails()){
            if(Cools.isEmpty(matParam.getMatnr())){
        for (MatSyncParam.MatParam matParam : param.getMatDetails()) {
            if (Cools.isEmpty(matParam.getMatnr())) {
                throw new CoolException("商品编码不能为空");
            }
@@ -777,7 +804,7 @@
                }
            } else {
                mat.sync(param);
                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr",matParam.getMatnr()))) {
                if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", matParam.getMatnr()))) {
                    throw new CoolException("更新已存在商品信息失败,请联系管理员");
                }
            }