| | |
| | | import com.zy.asrs.entity.LocCache; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.enums.LocAreaType; |
| | | import com.zy.asrs.service.LocCacheService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | |
| | | if (Cools.isEmpty(locCache) || null==locCache.getLocNo()){ |
| | | return R.error(); |
| | | } |
| | | locCacheService.updateById(locCache); |
| | | LocCache cache = locCacheService.selectOne(new EntityWrapper<LocCache>() |
| | | .eq("loc_no", locCache.getLocNo())); |
| | | if (Cools.isEmpty(cache)){ |
| | | return R.error("库位不存在"); |
| | | } |
| | | cache.setSort(locCache.getSort()); |
| | | if (!locCacheService.updateById(cache)) { |
| | | return R.error("更新失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.ok("组托成功"); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @description: 呼叫AGV返回 |
| | | * @version 1.0 |
| | | */ |
| | | @ManagerAuth(memo = "呼叫AGV返回") |
| | | @RequestMapping("/agv/call/back") |
| | | public R callAgvBack(@RequestBody AgvCallParams callAgvBackParam) { |
| | | if (Objects.isNull(callAgvBackParam.getOrgSite())) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | return mobileService.agvCallback(callAgvBackParam, getUserId()); |
| | | } |
| | | |
| | | |
| | | @ManagerAuth(memo = "缓冲库确认上架(模拟物理按钮)") |
| | | @RequestMapping("/cache/comb/pub") |
| | | public R cacheCombPub(@RequestBody CompleteParam combParam) { |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.BasWhsTypeService; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | |
| | | @ApiModelProperty("主键ID") |
| | | @TableId |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_D.type)) { |
| | | return LocStsType.LOC_STS_TYPE_D.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | return LocStsType.LOC_STS_TYPE_F.desc; |
| | | return LocStsType.LOC_STS_TYPE_O.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | return LocStsType.LOC_STS_TYPE_R.desc; |
| | | } else if (locSts.equals(LocStsType.LOC_STS_TYPE_S.type)) { |
| | |
| | | public enum LocStsType { |
| | | |
| | | //空板 |
| | | LOC_STS_TYPE_D("D", "空板"), |
| | | LOC_STS_TYPE_D("D", "D.空板"), |
| | | //在库 |
| | | LOC_STS_TYPE_F("F", "在库"), |
| | | LOC_STS_TYPE_F("F", "F.在库"), |
| | | //空库 |
| | | LOC_STS_TYPE_O("O", "空库"), |
| | | LOC_STS_TYPE_O("O", "O.空库"), |
| | | //禁用 |
| | | LOC_STS_TYPE_X("X", "禁用"), |
| | | LOC_STS_TYPE_X("X", "X.禁用"), |
| | | //入库预约 |
| | | LOC_STS_TYPE_S("S", "入库预约"), |
| | | LOC_STS_TYPE_S("S", "S.入库预约"), |
| | | //出库预约 |
| | | LOC_STS_TYPE_R("R", "出库预约"), |
| | | LOC_STS_TYPE_R("R", "R.出库预约"), |
| | | ; |
| | | |
| | | public String type; |
| | |
| | | R collectionPakin(CollectionPakinParams params, Long userId); |
| | | |
| | | R collectionPakinView(CollectionPakinParams params); |
| | | |
| | | /** |
| | | * 呼叫AGV返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @param callAgvBackParam |
| | | * @return com.core.common.R |
| | | */ |
| | | R agvCallback(AgvCallParams callAgvBackParam, Long userId); |
| | | } |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 呼叫AGV返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * @param callAgvBackParam |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R agvCallback(AgvCallParams callAgvBackParam, Long userId) { |
| | | if (Objects.isNull(callAgvBackParam.getOrgSite())) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | // 按当前查找库位顺序,查到一个后,不再往下查询 |
| | | LocCache locCache = findPriorityLocCache(); |
| | | |
| | | if (Objects.isNull(locCache)) { |
| | | return R.error("未查询到可用库位"); |
| | | } |
| | | |
| | | try { |
| | | generateAgvTask("agv", locCache, callAgvBackParam.getOrgSite(), callAgvBackParam.getBarcode(), userId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | |
| | | return R.ok(locCache); |
| | | } |
| | | |
| | | /** |
| | | * 按优先级查找可用库位 |
| | | * 顺序:入库缓存区 -> SO区 -> EO区 |
| | | */ |
| | | private LocCache findPriorityLocCache() { |
| | | // 1. Try Inbound Cache Area |
| | | LocCache loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_IN_CACHE); |
| | | if (loc != null) return loc; |
| | | |
| | | // 2. Try SO Area |
| | | loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_SO); |
| | | if (loc != null) return loc; |
| | | |
| | | // 3. Try EO Area |
| | | loc = findAvailableLocByAreaType(LocAreaType.LOC_AREA_TYPE_EO); |
| | | return loc; |
| | | } |
| | | |
| | | /** |
| | | * 根据区域类型查找可用库位 |
| | | */ |
| | | private LocCache findAvailableLocByAreaType(LocAreaType areaType) { |
| | | BasAreas area = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", areaType.type)); |
| | | if (area == null) { |
| | | return null; |
| | | } |
| | | return locCacheService.selectOne(new EntityWrapper<LocCache>() |
| | | .eq("area_id", area.getId()) |
| | | .eq("frozen", 0) |
| | | .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type) |
| | | .orderAsc(Arrays.asList("loc_no")) |
| | | .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY")); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/25 |
| | | * @description: AGV出库任务 |
| | | * @description: AGV出库任 |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '库位号', width: 120} |
| | | , {field: 'barcode', align: 'center', title: '托盘码'} |
| | | , {field: 'areaName', align: 'center', title: '库区名称'} |
| | | // , {field: 'whsType$', align: 'center', title: '库位类型'} |
| | | , {field: 'locSts', align: 'center', title: '库位状态'} |
| | | , {field: 'locSts$', align: 'center', title: '库位状态'} |
| | | , {field: 'row1', align: 'center', title: '排'} |
| | | , {field: 'bay1', align: 'center', title: '列'} |
| | | , {field: 'lev1', align: 'center', title: '层'} |
| | | // , {field: 'locType', align: 'center', title: '库位类型'} |
| | | , {field: 'sort', align: 'center', title: '优先级'} |
| | | , {field: 'sort', align: 'center', title: '优先级', sort: true} |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员'} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间'} |
| | | , {field: 'appeUser$', align: 'center', title: '创建者'} |
| | |
| | | , {field: 'frozenMemo', align: 'center', title: '冻结备注', hide: true} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 160}] |
| | | ], |
| | | |
| | | |
| | | request: { |
| | | pageName: 'curr', pageSize: 'limit' |
| | | }, |
| | |
| | | }) |
| | | }); |
| | | |
| | | // 修改优先级 |
| | | form.on('submit(updateProi)', function (data) { |
| | | var checkStatus = table.checkStatus('locCache').data; |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择需要修改的数据信息', {icon: 2}); |
| | | return false; |
| | | } |
| | | var sortVal = data.field.identifying; |
| | | var loadIndex = layer.load(2); |
| | | var promises = checkStatus.map(function (item) { |
| | | return new Promise(function (resolve, reject) { |
| | | $.ajax({ |
| | | url: baseUrl + "/locCache/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: item.id, |
| | | locNo: item.locNo, |
| | | sort: sortVal |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) resolve(res); |
| | | else reject(res); |
| | | }, |
| | | error: function (err) { |
| | | reject(err); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | Promise.all(promises).then(function () { |
| | | layer.close(loadIndex); |
| | | layer.closeAll(); |
| | | layer.msg("修改成功"); |
| | | tableReload(false); |
| | | }).catch(function (err) { |
| | | layer.close(loadIndex); |
| | | layer.msg("修改失败: " + (err.msg || "未知错误")); |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | function batchModifies() { |
| | | layer.open({ |
| | | type: 1, |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="area_name"> |
| | | <option value="">库区名称</option> |
| | | <option value="入库区">入库区</option> |
| | | <option value="集货区">集货区</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" |
| | | autocomplete="off"> |
| | | </div> |
| | |
| | | <div class="layui-form layui-form-pane"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>库区名称:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="identifying" name="identifying" class="layui-input" type="text" style="display: none"> |
| | | <input id="identifying$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" |
| | | type="text" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basAreasQueryBywhsType" |
| | | onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basAreasQueryBywhsTypeSelect" |
| | | onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | <label class="layui-form-label"><span class="not-null">*</span>优先级:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="identifying" name="identifying" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 库位类型 --> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">高低类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType1"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">低库位</option> |
| | | <option value="2">高库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">宽窄类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType2"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">窄库位</option> |
| | | <option value="2">宽库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">轻重类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType3"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</option> |
| | | <option value="1">轻库位</option> |
| | | <option value="2">重库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div style="text-align: center; margin-top: 20px"> |
| | | <button class="layui-btn layui-btn-normal" id="initDo" lay-submit lay-filter="initDo"> |
| | | <button class="layui-btn layui-btn-normal" id="updateProi" lay-submit lay-filter="updateProi"> |
| | | 确定 |
| | | </button> |
| | | </div> |