自动化立体仓库 - WMS系统
skyouc
3 天以前 1671e387d03c8e7eabd81e97e4721a86f7b69a83
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());
        }
@@ -2484,7 +2487,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 +2502,7 @@
                .setIoType(1) // 入出库状态: 11.库格移载
                .setTaskType("agv")
                .setIoPri(10D)
                .setIsNewIn(isNewIn)
                .setLocNo(loc.getLocNo()) // 目标库位
                .setFullPlt("Y") // 满板:Y
                .setPicking("N") // 拣料
@@ -2665,7 +2669,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 +2804,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