自动化立体仓库 - WMS系统
18516761980
2022-08-13 2e586ec3808b5a6d170aba9ddcbf5ef7b69f9eef
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.annotations.ManagerAuth;
import com.core.common.*;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
@@ -11,6 +12,8 @@
import com.zy.asrs.entity.param.MobileAdjustParam;
import com.zy.asrs.entity.param.OpenOrderPakinParam;
import com.zy.asrs.service.*;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WorkLogHandler;
import com.zy.asrs.utils.MatUtils;
import com.zy.common.CodeRes;
import com.zy.common.constant.MesConstant;
@@ -23,6 +26,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.ArrayList;
import java.util.Date;
@@ -73,6 +78,10 @@
    private NodeService nodeService;
    @Autowired
    private ManLocDetlService manLocDetlService;
    @Autowired
    private TestMastService testMastService;
    @Autowired
    private WorkLogHandler workLogHandler;
    @Override
@@ -592,4 +601,44 @@
            throw new CoolException(locDetl.getLocNo() + "库位不是在库状态");
        }
    }
    /*...........................赣州新增..............以下.............赣州新增...........................*/
    @Override
    @Transactional
    public void startUpTestPACK(TestMast testMast) {
        //启动测试请求
        ReturnT<String> result=workLogHandler.startUpTestPACK(testMast);
        if (!result.isSuccess()) {
            log.error("测试申请失败", testMast.getBarcode());
//            throw new CoolException("测试申请失败");
        }
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()));
        if (Cools.isEmpty(locMast)) {
            throw new CoolException(BaseRes.PARAM);
        }
        Date now = new Date();
        testMast.setChannel(1);
        testMast.setStatus(1);
        testMast.setModiTime(now);
        testMast.setAppeTime(now);
        if (!testMastService.insert(testMast)){
            throw new CoolException("添加testMast失败");
        }
        locMast.setPackStatus(2);
        locMast.setModiTime(now);
        if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){
            throw new CoolException("申请测试失败");
        }
    }
    @Override
    @Transactional
    public void suspendTestPACK() {
        ReturnT<String> result=workLogHandler.suspendTestPACK();
        if (!result.isSuccess()) {
            log.error("测试申请失败");
        }
    }
    /*...........................赣州新增..............以上.............赣州新增...........................*/
}