自动化立体仓库 - WMS系统
skyouc
13 小时以前 1dca57c0f15c3cdfbebf14ad1e9e04d8c84e775c
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -31,7 +31,6 @@
import com.zy.common.utils.HttpHandler;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import com.zy.system.service.impl.ConfigServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -1328,8 +1327,12 @@
            throw new CoolException("请检查目标库位是否闲置中!!");
        }
        String taskType = "M2";
        if (!params.getIsNewIn().isEmpty()) {
            taskType = "M1";
        }
        try {
            generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId);
            generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId, taskType);
        } catch (Exception e) {
            throw new CoolException(e.getMessage());
        }
@@ -1420,7 +1423,7 @@
            generateCacheOutTask(station, locCache, userId);
            /**生成立库出库任务*/
            generateCRNOutTask(station, locCache, userId);
           // generateCRNOutTask(station, locCache, userId);
            return R.ok();
        }
@@ -1510,7 +1513,7 @@
        Task task = new Task();
        task.setWrkNo(workNo)
                .setIoTime(new Date())
                .setWrkSts(1L) // 工作状态:11.生成出库ID
                .setWrkSts(201L) // 工作状态:11.生成入库库ID
                .setIoType(1) // 入出库状态: 11.库格移载
                .setTaskType("agv")
                .setIoPri(10D)
@@ -1817,12 +1820,14 @@
            throw new CoolException("容器编码未维护,请维护后再操作!!");
        }
        Integer whsType = 1;
        Integer whsType = 2;
        Short lcoType = 1;
        //用于判断料箱托盘,料箱,笼框
        if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) {
            whsType = 3;
        } else if (container.getType().equals(ContainerType.CONTAINER_TYPE_CAGE.type)) {
        if (!container.getType().equals(ContainerType.CONTAINER_TYPE_BOX.type)) {
            whsType = 2;
            if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) {
                lcoType = 2;
            }
        }
        WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode()));
@@ -1855,7 +1860,7 @@
                    throw new CoolException("数据错误,组拖档已不存在!!");
                }
                WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, param.getLocType1(), userId);
                WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, lcoType, userId);
                response.put("taskNo", wrkMast.getWrkNo());
                response.put("locNo", wrkMast.getLocNo());
@@ -2484,7 +2489,7 @@
     * @version 1.0
     */
    @Transactional(rollbackFor = Exception.class)
    public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) {
    public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId, String isNewIn) {
        List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode));
        if (!tasks.isEmpty()) {
            throw new CoolException("托盘已在任务执行中..");
@@ -2499,6 +2504,7 @@
                .setIoType(1) // 入出库状态: 11.库格移载
                .setTaskType("agv")
                .setIoPri(10D)
                .setIsNewIn(isNewIn)
                .setLocNo(loc.getLocNo()) // 目标库位
                .setFullPlt("Y") // 满板:Y
                .setPicking("N") // 拣料
@@ -2665,7 +2671,7 @@
        try {
            //空台车回库
            generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId);
            generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId, "M2");
        } catch (Exception e) {
            e.printStackTrace();
            return R.error(e.getMessage());
@@ -2800,6 +2806,24 @@
    }
    /**
     * 获取缓存站点信息
     * @param type
     * @return
     */
    @Override
    public R getCacheSites(String type) {
        BasAreas areas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", type));
        if (Objects.isNull(areas)) {
            return R.error("库区不存在!");
        }
        List<BasStation> stations = basStationService.selectList(new EntityWrapper<BasStation>().eq("area_id", areas.getId()));
        if (Objects.isNull(stations) || stations.isEmpty()) {
            return R.error("站点不存在!");
        }
        return R.ok("查询成功").add(stations);
    }
    /**
     * 生成移库任务
     *
     * @param result