Merge branch 'gdasrs' of https://gitee.com/luxiaotao1123/zy-asrs into gdasrs
| | |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | | <cool.version>1.1.1</cool.version> |
| | | <cool.version>2.0.0</cool.version> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | <mybatis-plus.version>2.3.2</mybatis-plus.version> |
| | | <fastjson.version>1.2.58</fastjson.version> |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MobileService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.common.model.MobileLocDetlVo; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 库存查询(根据物料编码和库位查询库存数量和捡料数量) |
| | | * @param locNo |
| | | * @param matNo |
| | | * @return |
| | | */ |
| | | @RequestMapping("/locDetl/stockQuery") |
| | | @ManagerAuth |
| | | public R stockQuery(@RequestParam(required = false)String locNo, |
| | | @RequestParam(required = false)String matNo){ |
| | | if (!Cools.isEmpty(locNo)) { |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (null == locMast || !"F".equals(locMast.getLocSts())) { |
| | | return R.parse(BaseRes.EMPTY); |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", locNo).orderBy("appe_time", false)); |
| | | List<MobileLocDetlVo> res = new ArrayList<>(); |
| | | locDetls.forEach(locDetl -> { |
| | | MobileLocDetlVo vo = new MobileLocDetlVo(); |
| | | List<WrkDetl> wrkDetlsList = wrkDetlService.queryWrkDetl(locDetl.getMatnr(), locDetl.getLocNo()); |
| | | final Double[] pickNum = {0.0}; |
| | | wrkDetlsList.forEach(item -> { |
| | | pickNum[0] = pickNum[0] + item.getAnfme(); |
| | | }); |
| | | vo.setPickNum(pickNum[0]); |
| | | vo.setLocNo(locDetl.getLocNo()); |
| | | vo.setMatnr(locDetl.getMatnr()); |
| | | vo.setMaktx(locDetl.getMaktx()); |
| | | vo.setCount(locDetl.getAnfme()); |
| | | res.add(vo); |
| | | }); |
| | | return R.ok().add(res); |
| | | } |
| | | if (!Cools.isEmpty(matNo)) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("matnr", matNo).orderBy("appe_time", false)); |
| | | List<MobileLocDetlVo> res = new ArrayList<>(); |
| | | locDetls.forEach(locDetl -> { |
| | | MobileLocDetlVo vo = new MobileLocDetlVo(); |
| | | List<WrkDetl> wrkDetlsList = wrkDetlService.queryWrkDetl(locDetl.getMatnr(), locDetl.getLocNo()); |
| | | final Double[] pickNum = {0.0}; |
| | | wrkDetlsList.forEach(item -> { |
| | | pickNum[0] = pickNum[0] + item.getAnfme(); |
| | | }); |
| | | vo.setPickNum(pickNum[0]); |
| | | vo.setLocNo(locDetl.getLocNo()); |
| | | vo.setMatnr(locDetl.getMatnr()); |
| | | vo.setMaktx(locDetl.getMaktx()); |
| | | vo.setCount(locDetl.getAnfme()); |
| | | res.add(vo); |
| | | }); |
| | | return R.ok().add(res); |
| | | } |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | | @RequestMapping("/locDetl") |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WrkDetlMapper extends BaseMapper<WrkDetl> { |
| | | |
| | | List<WrkDetl> queryWrkDetl(@Param("matnr") String matnr,@Param("locNo") String locNo); |
| | | } |
| | |
| | | |
| | | void createWorkDetail(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, String barcode, Long userId); |
| | | |
| | | List<WrkDetl> queryWrkDetl(String matnr, String locNo); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public List<WrkDetl> queryWrkDetl(String matnr, String locNo) { |
| | | return baseMapper.queryWrkDetl(matnr, locNo); |
| | | } |
| | | } |
| | |
| | | |
| | | private Double count; |
| | | |
| | | private Double pickNum; |
| | | |
| | | public String getLocNo() { |
| | | return locNo; |
| | | } |
| | |
| | | public void setCount(Double count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Double getPickNum() { |
| | | return pickNum; |
| | | } |
| | | |
| | | public void setPickNum(Double pickNum) { |
| | | this.pickNum = pickNum; |
| | | } |
| | | } |
| | |
| | | <result column="appe_time" property="appeTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="queryWrkDetl" resultMap="BaseResultMap"> |
| | | select a.wrk_no, a.matnr, a.maktx, a.anfme |
| | | from asr_wrk_detl a left join asr_wrk_mast b on a.wrk_no = b.wrk_no |
| | | where 1=1 and a.matnr = #{matnr,jdbcType=VARCHAR} and (b.loc_no = #{locNo,jdbcType=VARCHAR} or b.source_loc_no = #{locNo,jdbcType=VARCHAR}) |
| | | </select> |
| | | </mapper> |
| | |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '库位名称'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ] |
| | | |
| | |
| | | {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | cols.push( |
| | | {field: 'memo', title:'备注', align: 'center'}, |
| | | {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | var data = obj.data; |
| | | |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | for (var i = matCodeData.length - 1; i >= 0; i--) { |
| | |
| | | // 覆盖render方法的done |
| | | }}); |
| | | break; |
| | | case 'memo': |
| | | var memoLayer = layer.open({ |
| | | type: 2, |
| | | title: '备注', |
| | | maxmin: true, |
| | | area: ['400px', '215px'], |
| | | shadeClose: false, |
| | | content: 'matMemo.html', |
| | | btn: ['保存', '取消'], |
| | | style: 'text-algin: center', |
| | | yes: function(index, layero){ |
| | | var memo = layer.getChildFrame('body', index).find("#memo")[0].value; |
| | | matCodeData.map(function (item) { |
| | | if (item.matNo === data.matNo) { |
| | | item.memo = memo; |
| | | } |
| | | }); |
| | | // 重置表格数据 |
| | | tableIns.reload({data: matCodeData,done:function (res) { |
| | | limit(); |
| | | getInBound(); |
| | | layer.close(memoLayer); |
| | | }}); |
| | | }, |
| | | success: function(layero, index){ |
| | | var iframeWin = window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象 |
| | | iframeWin.setMatMemo(data.memo); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | cols.push( |
| | | {field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | return cols; |
| | | } |
| | |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | cols.push( |
| | | {field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | return cols; |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>备注</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | </head> |
| | | <body> |
| | | <div style="text-align: center; padding: 5px"> |
| | | <textarea rows="6" style="width: 95%; resize: none" id="memo" type="text"></textarea> |
| | | </div> |
| | | </body> |
| | | <script> |
| | | function setMatMemo(val) { |
| | | $("#memo").val(val ? val : ''); |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="memo">备注</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li> |
| | | <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li> |
| | | <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li> |
| | | <li><a id="stockQuery" onclick="nav(this.id)" class="nav-unselect" href="#">库存查询</a></li> |
| | | </ul> |
| | | |
| | | <!-- 主体内容 --> |
| | |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> |
| | | <meta name="viewport" |
| | | content="width=device-width, target-densitydpi=high-dpi, initial-scale=1.0, user-scalable=no"/> |
| | | <title>库存明细详情</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | text-align: right; |
| | | width: 70px; |
| | | } |
| | | |
| | | .form-box input { |
| | | width: 120px; |
| | | margin-left: 10px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow:hidden; |
| | | white-space:nowrap; |
| | | text-overflow:ellipsis; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .number-tool { |
| | |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <button id="reduceBtn" onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <!-- <button onclick="add()">+</button>--> |
| | | <!-- <button onclick="add()">+</button>--> |
| | | </div> |
| | | </div> |
| | | <button class="form-button" id="save" onclick="save()">保存</button> |
| | |
| | | </body> |
| | | <script> |
| | | var countDom = $('#count'); |
| | | var flag = getQueryVariable("flag"); |
| | | |
| | | if (flag == '1') { |
| | | console.log('隐藏部分功能'); |
| | | $("#reduceBtn").css("display", "none"); |
| | | $("#remove").css("display", "none"); |
| | | $("#count").attr("disabled", "true"); |
| | | } |
| | | |
| | | function getQueryVariable(variable) { |
| | | var query = window.location.search.substring(1); |
| | | var vars = query.split("&"); |
| | | for (var i = 0; i < vars.length; i++) { |
| | | var pair = vars[i].split("="); |
| | | if (pair[0] == variable) { |
| | | return pair[1]; |
| | | } |
| | | } |
| | | return (false); |
| | | } |
| | | |
| | | function save() { |
| | | console.log(countDom.val()) |
| | |
| | | function add() { |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= 1) { |
| | | return; |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>库存查询</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">库位</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="number" id="locNo" onkeyup="findByLocNo(this)" autocomplete="off"> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">产品</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" type="text" id="matNo" onkeyup="findByMatNo(this)" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | </header> |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="dataByLoc" lay-filter="dataByLoc"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button id="reset" type="button" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | </body> |
| | | <script> |
| | | window.onload = function(){ |
| | | document.getElementById("locNo").focus(); |
| | | } |
| | | |
| | | /** |
| | | * 根据库位号查找库存明细 |
| | | */ |
| | | function findByLocNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#matNo").val(""); |
| | | find(el.value, $("#matNo").val()); |
| | | } |
| | | |
| | | /** |
| | | * 根据产品号查找库存明细 |
| | | */ |
| | | function findByMatNo(el){ |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | $("#locNo").val(""); |
| | | find($("#locNo").val(), el.value); |
| | | } |
| | | function find(locNo, matNo) { |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/locDetl/stockQuery", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | locNo: locNo, |
| | | matNo: matNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | locDetlData = res.data; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | $('#pakOut').focus(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 表格 |
| | | var locDetlData = []; |
| | | var tableIns; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | id: 'tableIdx', |
| | | elem: '#dataByLoc', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'pickNum', align: 'center', title: '拣料', event: 'detail', width:50}, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(dataByLoc)', function(obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库存明细', |
| | | shade: [0.3,'#000'], |
| | | area: ['90%', '70%'], |
| | | content: 'locDetlIframe.html?flag=1', |
| | | success: function(layero, index){ |
| | | // 设置弹窗样式 |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | // 注入值 |
| | | let el = layer.getChildFrame('.form-box', index); |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | } |
| | | }, |
| | | end: function () { |
| | | $('#pakOut').focus(); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 修改表格数据 |
| | | function updateTableData(data) { |
| | | for (var i=0;i<locDetlData.length;i++) { |
| | | if (data.matnr === locDetlData[i].matnr && data.locNo === locDetlData[i].locNo) { |
| | | locDetlData[i].count = data.count; |
| | | break |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | // 删除表格行 |
| | | function removeTableData(data) { |
| | | for (var i = locDetlData.length - 1; i >= 0; i--) { |
| | | if (locDetlData[i].locNo === data.locNo && locDetlData[i].matnr === data.matnr) { |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $("#matNo").val(""); |
| | | $("#locNo").val(""); |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | layui.form.render('select'); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色var字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn?2:1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#pakOut").focus(); |
| | | pakOut(); |
| | | } else if (key === 113) { |
| | | $("#locNo").val(""); |
| | | $("#locNo").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |