| | |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.common.service.asrs.entity.Result; |
| | | import zy.cloud.wms.common.service.asrs.entity.Result1; |
| | | import zy.cloud.wms.common.service.asrs.entity.ResultLocDetl; |
| | | import zy.cloud.wms.common.service.asrs.entity.ResultSite; |
| | | import zy.cloud.wms.manager.entity.param.StockTransferParam; |
| | | import zy.cloud.wms.manager.utils.HttpHandler; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/3/20 |
| | |
| | | } |
| | | } |
| | | |
| | | /* 获取出库站点 */ |
| | | public ResultSite takeSite() { |
| | | try { |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(asrsBaseUrl) |
| | | .setPath("/open/api/available/take/site") |
| | | .setJson(JSON.toJSONString("")) |
| | | .build() |
| | | .doPost(); |
| | | return JSON.parseObject(response, ResultSite.class); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return new ResultSite(500, "服务器异常", null); |
| | | } |
| | | } |
| | | |
| | | /* 根据物料编码获取立库库存信息 */ |
| | | public ResultLocDetl getAsrsLocDetl(String matnr) { |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("matnr", matnr); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(asrsBaseUrl) |
| | | .setPath("/open/api/get/asrsLocDetl") |
| | | .setParams(map) |
| | | // .setJson(JSON.toJSONString(matnr)) |
| | | .build() |
| | | .doPost(); |
| | | return JSON.parseObject(response, ResultLocDetl.class); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | return new ResultLocDetl(500, "服务器异常", null); |
| | | } |
| | | } |
| | | } |
| | |
| | | package zy.cloud.wms.common.service.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | import zy.cloud.wms.manager.entity.Site; |
| | | import zy.cloud.wms.manager.entity.StoPreTab; |
| | | |
| | | import java.util.List; |
New file |
| | |
| | | package zy.cloud.wms.common.service.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | import zy.cloud.wms.manager.entity.AsrsLocDetl; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ResultLocDetl { |
| | | private Integer code; |
| | | |
| | | private String msg; |
| | | |
| | | private List<AsrsLocDetl> data; |
| | | |
| | | public ResultLocDetl() { |
| | | } |
| | | |
| | | public ResultLocDetl(Integer code, String msg, List<AsrsLocDetl> data) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.data = data; |
| | | } |
| | | } |
New file |
| | |
| | | package zy.cloud.wms.common.service.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | import zy.cloud.wms.manager.entity.Site; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ResultSite { |
| | | |
| | | private Integer code; |
| | | |
| | | private String msg; |
| | | |
| | | private List<Site> data; |
| | | |
| | | public ResultSite() { |
| | | } |
| | | |
| | | public ResultSite(Integer code, String msg, List<Site> data) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.data = data; |
| | | } |
| | | } |
| | |
| | | import com.core.common.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import zy.cloud.wms.common.service.asrs.AsrsService; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.entity.param.StockTransferParam; |
| | | import zy.cloud.wms.manager.service.MatService; |
| | | import zy.cloud.wms.manager.service.NodeService; |
| | | import zy.cloud.wms.manager.service.PriorService; |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private NodeService nodeService; |
| | | @Autowired |
| | | private AsrsService asrsService; |
| | | |
| | | /** |
| | | * 安全库存警告分页 |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/available/take/site") |
| | | @ManagerAuth |
| | | public R takeSite() { |
| | | Object response = asrsService.takeSite().getData(); |
| | | return R.ok(response); |
| | | } |
| | | |
| | | @RequestMapping(value = "/get/asrsLocDetl") |
| | | @ManagerAuth |
| | | public R getLocDetl(String matnr) { |
| | | Object response = asrsService.getAsrsLocDetl(matnr).getData(); |
| | | return R.ok(response); |
| | | } |
| | | } |
New file |
| | |
| | | package zy.cloud.wms.manager.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class AsrsLocDetl { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value= "库位号") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | @ApiModelProperty(value= "规格") |
| | | private String lgnum; |
| | | |
| | | @ApiModelProperty(value= "型号") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value= "条码") |
| | | private String color; |
| | | |
| | | @ApiModelProperty(value= "批号") |
| | | private String supplier; |
| | | |
| | | @ApiModelProperty(value= "单据编号") |
| | | private String warehouse; |
| | | |
| | | @ApiModelProperty(value= "品项数") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty(value= "单位") |
| | | private String altme; |
| | | |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | | |
| | | @ApiModelProperty(value= "客户名称") |
| | | private String bname; |
| | | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long modiUser; |
| | | |
| | | private String modiUser$; |
| | | |
| | | @ApiModelProperty(value= "修改时间") |
| | | private Date modiTime; |
| | | |
| | | private String modiTime$; |
| | | |
| | | @ApiModelProperty(value= "创建者") |
| | | private Long appeUser; |
| | | |
| | | private String appeUser$; |
| | | |
| | | @ApiModelProperty(value= "添加时间") |
| | | private Date appeTime; |
| | | |
| | | private String appeTime$; |
| | | } |
New file |
| | |
| | | package zy.cloud.wms.manager.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class Site { |
| | | private Integer siteId; |
| | | |
| | | private String desc; |
| | | } |
| | |
| | | ] |
| | | |
| | | |
| | | var popupRight; |
| | | var popupRight; |
| | | |
| | | function RequestParameter() { |
| | | var url = window.location.search; //获取url中"?"符后的字串 |
| | | var theRequest = new Object(); |
| | | if (url.indexOf("?") != -1) { |
| | | var str = url.substr(1); |
| | | var strs = str.split("&"); |
| | | for (var i = 0; i < strs.length; i++) { |
| | | theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | var locDetlData = []; |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'anfme', align: 'center',title: '数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'lgnum', align: 'center',title: '规格'} |
| | | ,{field: 'type', align: 'center',title: '型号', hide: true} |
| | | ,{field: 'color', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'supplier', align: 'center',title: '批号', hide: true} |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'warehouse', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'bname', align: 'center',title: '客户名称', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'memo', align: 'center', title: '备注', hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘码'} |
| | | ]; |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | var param = RequestParameter(); |
| | | debugger |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | url: baseUrl + '/get/asrsLocDetl', |
| | | where: { |
| | | matnr: 'LSH10648050', |
| | | }, |
| | | headers: {token: localStorage.getItem('token')}, |
| | | // data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'data': res.data |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | getOutBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | updateLocDetlData(obj.data.locNo, obj.data.matnr, Number(obj.value)); |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'stockOut': |
| | | alert("启动出库"); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | var data = locDetlData; |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (data.length === 0){ |
| | | layer.msg('请先添加库位物料'); |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count}); |
| | | }); |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetls |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | |
| | | switch (obj.event) { |
| | | // 补仓 |
| | | case 'allot': |
| | | layer.confirm(data.node_name +'补仓 '+ data.matnr + ',数量:' + (data.safe_qua - data.amount), function(){ |
| | | var index = layer.load(1, {shade: [0.1,'#000']}); |
| | | $.ajax({ |
| | | url: baseUrl+"/work/stock/transfer", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify({ |
| | | node_id: data.node_id, |
| | | matnr: data.matnr, |
| | | safe_qua: data.safe_qua, |
| | | amount: data.amount |
| | | }), |
| | | dataType:'json', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}) |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | }); |
| | | // layer.confirm(data.node_name +'补仓 '+ data.matnr + ',数量:' + (data.safe_qua - data.amount), function(){ |
| | | // var index = layer.load(1, {shade: [0.1,'#000']}); |
| | | // $.ajax({ |
| | | // url: baseUrl+"/work/stock/transfer", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // contentType:'application/json;charset=UTF-8', |
| | | // data: JSON.stringify({ |
| | | // node_id: data.node_id, |
| | | // matnr: data.matnr, |
| | | // safe_qua: data.safe_qua, |
| | | // amount: data.amount |
| | | // }), |
| | | // dataType:'json', |
| | | // method: 'POST', |
| | | // success: function (res) { |
| | | // if (res.code === 200) { |
| | | // layer.msg(res.msg, {icon: 1}) |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | // } else if (res.code === 403) { |
| | | // top.location.href = baseUrl+"/"; |
| | | // } else { |
| | | // layer.msg(res.msg, {icon: 2}) |
| | | // } |
| | | // layer.close(index); |
| | | // } |
| | | // }); |
| | | // }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '补仓', |
| | | offset: '100px', |
| | | area: ['90%', '80%'], |
| | | shadeClose: true, |
| | | content: 'locAllot.html?matnr=' + data.matnr, |
| | | success: function(layero, index){ |
| | | |
| | | } |
| | | }) |
| | | break; |
| | | } |
| | | }); |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title>补仓-立库出库</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | |
| | | <style> |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | </style> |
| | | |
| | | <body> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 1.选择出库口 --> |
| | | <span id="staNoSpan">出库口:</span> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <!-- 2.启动出库 --> |
| | | <button style="margin-left: 18px" class="layui-btn layui-btn-lg layui-btn-disabled" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="stockOut">出库</a> |
| | | </script> |
| | | |
| | | <table style="margin-top: -16px" class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <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> |
| | | <script type="text/javascript" src="../../static/js/safeSto/locAllot.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |