| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasDevpMapper extends BaseMapper<BasDevp> { |
| | | |
| | | List<Integer> getAvailableDevp(); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BasDevpService extends IService<BasDevp> { |
| | | |
| | | List<Integer> getAvailableDevp(); |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("basDevpService") |
| | | public class BasDevpServiceImpl extends ServiceImpl<BasDevpMapper, BasDevp> implements BasDevpService { |
| | | |
| | | @Override |
| | | public List<Integer> getAvailableDevp() { |
| | | return this.baseMapper.getAvailableDevp(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.web.wms; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/10 |
| | | */ |
| | | @RestController |
| | | public class WorkController { |
| | | |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | @RequestMapping("available/put/site") |
| | | public R availablePutSite(){ |
| | | |
| | | // 获取有效的入库站点 |
| | | return R.ok().add(basDevpService.getAvailableDevp()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getAvailableDevp" resultType="java.lang.Integer"> |
| | | select |
| | | abd.dev_no |
| | | from asr_bas_devp abd |
| | | left join asr_sta_desc asd on abd.dev_no = asd.stn_no |
| | | where 1=1 |
| | | and asd.type_no = 1 |
| | | and abd.in_enable = 'Y' |
| | | group by abd.dev_no |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'comb': |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '组盘', |
| | | maxmin: true, |
| | | shadeClose: true, |
| | | content: $('#combDiv'), |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }) |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先添加物料"); |
| | | return; |
| | | } |
| | | layer.open({ |
| | | type: 1, |
| | | title: '选择入库站', |
| | | maxmin: true, |
| | | shadeClose: true, |
| | | content: $('#combDiv'), |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }) |
| | | break; |
| | | } |
| | | }); |
| | |
| | | toolbar: '#toolbar', |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'}, |
| | | {field: 'matNo', align: 'center', title: '物料编码', sort: 'true'}, |
| | | {field: 'matNo', align: 'center', title: '物料编码'}, |
| | | {field: 'barcode', align: 'center', title: '条码'}, |
| | | {field: 'matName', align: 'center', title: '物料名称'}, |
| | | {field: 'str1', align: 'center', title: '物料单位'}, |
| | |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(matCode)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | matQueryTable.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 3px; |
| | | margin: 0 10px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | .layui-layer-page .layui-layer-content { |
| | | position: relative; |
| | | overflow: visible !important; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | |
| | | <!-- 站点选择框 group by -- 空库位 --> |
| | | |
| | | <button id="mat-put" class="function-btn" onclick="putMat()">启动入库</button> |
| | | <!-- <button id="mat-put" class="function-btn" onclick="putMat()">启动入库</button>--> |
| | | </div> |
| | | |
| | | <hr> |
| | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-normal" id="btn-comb" lay-event="comb" style="">组盘</button> |
| | | <button class="layui-btn layui-btn-normal" id="btn-comb" lay-event="comb" style="">入库</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | <div id="combDiv" style="display: none; padding: 20px"> |
| | | <div class="layui-form"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" style="padding: 9px 0">托盘条码</label> |
| | | <label class="layui-form-label" style="padding: 9px 0">入库站点:</label> |
| | | <div class="layui-input-block" style="margin-left: 90px;"> |
| | | <input type="text" id="tray" placeholder="必填" autocomplete="off" class="layui-input"> |
| | | <select id="putSiteSelect" lay-verify="required" lay-search=""> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="text-align: center; margin-top: 20px"> |
| | | <button class="layui-btn layui-btn-radius layui-btn-normal" id="combDo" lay-submit lay-filter="combDo">组盘入库</button> |
| | | <button class="layui-btn layui-btn-radius layui-btn-normal" id="combDo" lay-submit lay-filter="combDo">启动入库</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | <script> |
| | | $(function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#putSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#putSiteSelect').append(html); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |