From 426134e8a0dbb5fc63a0bc64eeff2de6aac4b81a Mon Sep 17 00:00:00 2001 From: yuyou_x <2336760928@qq.com> Date: 星期三, 31 一月 2024 08:42:46 +0800 Subject: [PATCH] 1 --- HTML/views/WareHouseSetting/StorageLegend.html | 337 +++++++++++-- Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs | 4 Wms/WMS.BLL/SysServer/MaterialCategory.cs | 218 ++++++++ Wms/Model/ModelDto/SysDto/MaterialCategoryDto.cs | 73 ++ Wms/Wms/Controllers/SysController.cs | 195 +++++++ Wms/WMS.BLL/SysServer/StorageLocatServer.cs | 13 Wms/WMS.Entity/SysEntity/MaterialCategory.cs | 38 + HTML/views/SystemSettings/Category.html | 539 +++++++++++++++++++++ Wms/WMS.IBLL/ISysServer/IMaterialCategory.cs | 47 + 9 files changed, 1,390 insertions(+), 74 deletions(-) diff --git a/HTML/views/SystemSettings/Category.html b/HTML/views/SystemSettings/Category.html new file mode 100644 index 0000000..017b503 --- /dev/null +++ b/HTML/views/SystemSettings/Category.html @@ -0,0 +1,539 @@ +<!DOCTYPE html> +<html> + <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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> + <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> + <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> + <script> + // 杩欓噷鏄渶瑕佸湪椤甸潰娓叉煋涔嬪墠鎵ц鐨勪唬鐮� + document.addEventListener("DOMContentLoaded", function() { + + //鑾峰彇table榛樿鏄剧ず鏁� + pageCntFirst(); + }); + </script> + </head> + <body> + <div class="layui-fluid" style="padding-bottom: 0;"> + <div class="layui-card"> + <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="border-bottom:1px solid #CCC"> + <div class="layui-form-item"> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">绫诲埆鍚嶇О</label> + <div class="layui-input-inline"> + <input type="text" id="DictName" name="DictName" placeholder="璇疯緭鍏ュ姛鑳藉悕绉�" autocomplete="off" class="layui-input"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 70px;">鐖剁骇瀛楀吀鍙�</label> + <div class="layui-input-inline"> + <select name="ParentNo" id="ParentNo" lay-verify="" lay-search=""> + <option value=""></option> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 45px;">鍖哄煙</label> + <div class="layui-input-inline"> + <select name="Level" id="Level" lay-verify="" lay-search> + <option value=""></option> + <option value="0">鏍圭洰褰�</option> + <option value="1">涓嬬骇鐩綍</option> + </select> + </div> + </div> + <!-- <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">鏄惁鍏紑</label> + <div class="layui-input-inline"> + <select name="IsPublic" id="IsPublic" lay-verify="" lay-search> + <option value=""></option> + <option value="0">鍏紑</option> + <option value="1">涓嶅叕寮�</option> + </select> + </div> + </div> --> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">鍏佽缂栬緫</label> + <div class="layui-input-inline"> + <select name="IsEdit" id="IsEdit" lay-verify="" lay-search> + <option value=""></option> + <option value="0">鍏佽</option> + <option value="1">涓嶅厑璁�</option> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">鍏佽澧炲姞</label> + <div class="layui-input-inline"> + <select name="IsAdd" id="IsAdd" lay-verify="" lay-search> + <option value=""></option> + <option value="0">鍏佽</option> + <option value="1">涓嶅厑璁�</option> + </select> + </div> + </div> + <div class="layui-inline"> + <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search"> + <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>鎼滅储 + </button> + </div> + <div class="layui-inline"> + <button class="layui-btn layui-btn-sm layuiadmin-btn-list approvalBtn" data-type="add" id="approvalBtn"> + <i class="layui-icon layuiadmin-button-btn"></i>娣诲姞 + </button> + </div> + </div> + </div> + <div class="layui-card-body"> + <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> + <!-- 鏄惁鍏紑 --> + <script type="text/html" id="buttonIsPublic"> + {{# if(d.IsPublic=='0'){ }} + <button class="layui-btn layui-btn-radius layui-btn-xs">鍏紑</button> + {{# } else if(d.IsPublic=='1') { }} + <button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">涓嶅叕寮�</button> + {{# } }} + </script> + + <!-- 灞傜骇 --> + <script type="text/html" id="buttonLevel"> + {{# if(d.Level=='0'){ }} + <button class="layui-btn layui-btn-radius layui-btn-xs">鏍圭洰褰�</button> + {{# } else if(d.Level=='1') { }} + <button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">涓嬬骇鐩綍</button> + {{# } }} + </script> + + <!-- 鍏佽缂栬緫 --> + <script type="text/html" id="buttonIsEdit"> + {{# if(d.IsEdit=='0'){ }} + <p>鍏佽</p> + {{# } else if(d.IsEdit=='1') { }} + <p>涓嶅厑璁�</p> + {{# } }} + </script> + + <!-- 鍏佽娣诲姞 --> + <script type="text/html" id="buttonIsAdd"> + {{# if(d.IsAdd=='0'){ }} + <p>鍏佽</p> + {{# } else if(d.IsAdd=='1') { }} + <p>涓嶅厑璁�</p> + {{# } }} + </script> + <!-- 鎿嶄綔 --> + <script type="text/html" id="table-content-list"> + {{# if(d.IsEdit=='0'){ }} + <a class="layui-btn layui-btn-normal layui-btn-xs approvalBtnupt" lay-event="edit"> + <i class="layui-icon layui-icon-edit"></i>缂栬緫 + </a> + {{# } else if(d.IsEdit=='1') }} + + <a class="layui-btn layui-btn-danger layui-btn-xs approvalBtndel" lay-event="del"> + <i class="layui-icon layui-icon-delete"></i>鍒犻櫎 + </a> + </script> + </div> + </div> + </div> + <script src="../../layuiadmin/layui/layui.js"></script> + <script src="../../js/public.js"></script> + <script src="../../js/jquery-3.5.1.min.js"></script> + <script src="../../js/jquery.cookie.js"></script> + <script> + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index' //涓诲叆鍙fā鍧� + }).use(['index', 'table', 'laypage', 'layer'], function() { + var table = layui.table, + form = layui.form, + laypage = layui.laypage, + layer = layui.layer; + + var tableIns; + + //鑾峰彇鐖剁骇瀛楀吀鍙� + sendData(IP + "/sys/GetDicParentListByLevel",{},'get',function(res){ + if (res.code == 0) //鎴愬姛 + { + parentnohtml = '<option value =""></option>'; + for (var i = 0; i < res.data.length; i++) { + //鍒ゆ柇灞傜骇涓嶆槸鎸夐挳 + if (res.data[i].Level == '0') + { + //鏍圭洰褰� + parentnohtml = parentnohtml + '<option value =' + res.data[i].DictNo + '>' + res.data[i].DictName + '</option>' + } + } + $("#ParentNo").append(parentnohtml); + form.render('select'); + } + }) + + function refreshTable(DictName,DictNo,Level,IsEdit,IsAdd) { + var param = { + DictName: DictName, + DictNo: DictNo, + Level: Level, + IsEdit: IsEdit, + IsAdd: IsAdd + }; + + sendData(IP + "/Sys/GetDicList?DictName="+DictName+"&&DictNo="+DictNo+"&&Level="+Level+"&&IsEdit="+IsEdit+"&&IsAdd="+IsAdd, {}, 'get', function(res) { + if (res.code == 0) { //鎴愬姛 + var list = res.data; + $.extend(infoOptions, { + data: list + }); + infoOptions.page = { + curr: 1 + } + tableIns = table.render(infoOptions); + } + else //涓嶆垚鍔� + { + layer.msg('鑾峰彇瀛楀吀鍒楄〃淇℃伅澶辫触锛�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {}); + } + }); + } + sendData(IP + "/basis/GetRoleRightList", {}, 'get', function(res) { + $(function() { + $("#approvalBtn").hide(); + }); + $(function() { + $(".approvalBtnupt").hide(); + }); + $(function() { + $(".approvalBtndel").hide(); + }); + if (res.code == 0) { //鎴愬姛 + for (var k = 0; k < res.data.length; k++) { + if (res.data[k].MenuName == "娣诲姞瀛楀吀") { + $(function() { + $("#approvalBtn").show(); + }); + } + if (res.data[k].MenuName == "鍒犻櫎瀛楀吀") { + $(function() { + $(".approvalBtndel").show(); + }); + } + if (res.data[k].MenuName == "缂栬緫瀛楀吀") { + $(function() { + $(".approvalBtnupt").show(); + }); + } + } + } + else + { //涓嶆垚鍔� + layer.msg('鑾峰彇淇℃伅澶辫触', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + //鍥炶皟 + }); + } + }); + + var infoOptions = { + elem: "#LAY-app-content-list", + height: "full-95", + id: "LAY-app-content-list", + page: true, + limit: pageCnt, + limits: pageLimits, + even: true, + cellMinWidth: 80, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板 + cols: [[ + { + title: '搴忓彿', type: 'numbers', fixed: 'left', width:65 + }, + { + field: 'DictNo', title: '瀛楀吀缂栧彿', align: 'center', fixed: 'left' + }, + { + field: 'DictName', title: '瀛楀吀鍚嶇О', align: 'center' + }, + { + field: 'ParentNo', title: '鐖剁骇瀛楀吀鍙�', align: 'center' + }, + { + field: 'Ord', title: '鏄剧ず椤哄簭', align: 'center' + }, + { + field: 'Level', title: '灞傜骇', align: 'center', templet: '#buttonLevel' + }, + { + field: 'IsPublic', templet: '#buttonIsPublic', title: '鏄惁鍏紑', align: 'center' + }, + { + field: 'IsEdit', title: '鍏佽缂栬緫', align: 'center', templet: '#buttonIsEdit' + }, + { + field: 'IsAdd', title: '鍏佽澧炲姞', align: 'center', templet: '#buttonIsAdd' + }, + { + field: 'CreateName', title: '鍒涘缓浜�', align: 'center' + }, + { + field: 'CreateTime', title: '鍒涘缓鏃ユ湡', align: 'center', + templet: function (d) { + return formatDate(d.CreateTime); + } + }, + { + title: '鎿嶄綔', fixed: 'right', align: 'center', width: 200 , toolbar: '#table-content-list' + } + ]], + }; + + //鐩戝惉鎼滅储 + form.on('submit(LAY-app-contlist-search)', function(data) { + console.log(data) + var DictName = data.field.DictName; + var DictNo = data.field.ParentNo; + var Level = data.field.Level; + var IsEdit = data.field.IsEdit; + var IsAdd = data.field.IsAdd; + refreshTable(DictName,DictNo,Level,IsEdit,IsAdd); + }); + var doing = true; + var $ = layui.$, + active = { + //鏂板 + add: function() { + layer.open({ + type: 2, + title: '娣诲姞瀛楀吀淇℃伅', + content: 'DictionaryForm.html', + maxmin: true, + area: ['530px', '530px'], + btn: ['纭畾', '鍙栨秷'], + yes: function(index, layero) { + var iframeWindow = window['layui-layer-iframe' + index], + submitID = 'layuiadmin-app-form-submit', + submit = layero.find('iframe').contents().find('#' + submitID); + //鐩戝惉鎻愪氦 + iframeWindow.layui.form.on('submit(' + submitID + ')', function(data) { + var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈� + //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� + var param = { + DictNo: field.DictNo, //瀛楀吀缂栧彿 + DictName: field.DictName, //瀛楀吀鍚嶇О + ParentNo: field.ParentNo, //鐖剁骇瀛楀吀鍙� + Ord: field.Ord, //鏄剧ず椤哄簭 + Level: field.Level, //灞傜骇 + IsPublic: field.IsPublic, //鏄惁鍏紑 + IsEdit: field.IsEdit, //鍏佽缂栬緫 + IsAdd: field.IsAdd //鍏佽娣诲姞 + }; + if(field.Level == '1') + { + if(field.ParentNo == '') + { + layer.msg("褰撳眰绾т负瀛愮骇鏃讹紝鐖剁骇鐩綍涓嶅彲涓虹┖锛�", { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {doing = true;}); + } + else + { + console.log(11) + if(doing){ + doing = false; + sendData(IP + "/sys/AddDic", param, 'post',function(res) { + console.log(res); + if (res.code == 0) { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + layer.close(index); //鍏抽棴寮瑰眰 + refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val()); + doing = true; + }); + } + else + { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {doing = true;}); + } + }); + } + else + { + console.log(123); + } + } + } + + }); + submit.trigger('click'); + } + }); + } + }; + $('.layui-btn.layuiadmin-btn-list').on('click', function() { + var type = $(this).data('type'); + active[type] ? active[type].call(this) : ''; + }); + + var element = layui.element; + var houseId = 0; + var param = { + Id: $.cookie('userId') + } + var xml = ''; + function getchiled(data, mainId) { + if (data) + { + var list = data.filter(item => item.ParentId == mainId); + if (list) + { + for (var i = 0; i < list.length; i++) { + var id = list[i].Id; + //鏌ヨ鏈夋棤瀛愯彍鍗� + var count = data.filter(item => item.ParentId == id).length; + if (count > 0) + { + xml = xml + '<dd>' + '<a href="javascript:;">' + list[i].Name + '</a>' + '<dl class="layui-nav-child">'; + getchiled(data, id); + xml = xml + '</dl></dd>'; + + } + else + { + xml = xml + '<dd>' + '<a lay-href="' + list[i].Url + '">' + list[i].Name + '</a>' + '</dd>'; + } + } + } + } + } + var uid = $.cookie('userId'); + refreshTable("","","","",""); + table.on('tool(LAY-app-content-list)', function(obj) { + var data = obj.data; + //鍒犻櫎 + if (obj.event === 'del') + { + layer.confirm('纭畾鍒犻櫎閫変腑鐨勫瓧鍏革紵', function(index) { + // console.log(data); + cusid = data.Id; + var arr = []; + arr.push(cusid); //灞炴�� + var param = { + Ids: arr + }; + if(doing) + { + doing = false; + sendData(IP + "/sys/DelDic?Id="+data.Id+"", {} , 'get', function(res) { + console.log(res); + if (res.code == 0) + { //鎴愬姛 + layer.msg(res.msg, { + icon: 1, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val()); + //table.reload('LAY-app-content-list'); //鏁版嵁鍒锋柊 + doing = true; + }); + } + else + { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {doing = true;}); + } + }); + } + else + { + console.log(123); + } + + }); + } + //缂栬緫 + else if (obj.event === 'edit') + { + cusId = data.Id; + layer.open({ + type: 2, + title: '缂栬緫瀛楀吀淇℃伅', + content: 'DictionaryForm.html?id=' + cusId, + maxmin: true, + area: ['500px', '450px'], + btn: ['纭畾', '鍙栨秷'], + yes: function(index, layero) { + var iframeWindow = window['layui-layer-iframe' + index], + submitID = 'layuiadmin-app-form-edit', + submit = layero.find('iframe').contents().find('#' + submitID); + //鐩戝惉鎻愪氦 + iframeWindow.layui.form.on('submit(' + submitID + ')', function(data) { + var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈� + //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� + var param = { + Id: cusId, + DictNo: field.DictNo, + DictName: field.DictName, + ParentNo: field.ParentNo, + Ord: field.Ord, + Level: field.Level, + IsPublic: field.IsPublic, + IsEdit: field.IsEdit, + IsAdd: field.IsAdd + }; + if(doing) + { + doing = false; + sendData(IP + "/sys/ExitDic", param, 'post', + function(res) { + if (res.code == 0) + { //鎴愬姛 + layer.msg("淇敼鎴愬姛", { + icon: 1, + time: 1000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + layer.close(index); //鍏抽棴寮瑰眰 + refreshTable($("#DictName").val(),$("#ParentNo").val(),$("#Level").val(), $("#IsEdit").val(), $("#IsAdd").val()); + //table.reload('LAY-app-content-list'); //鏁版嵁鍒锋柊 + doing = true; + }); + } + else + { //涓嶆垚鍔� + layer.msg(res.msg, { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() {doing = true;}); + } + }); + } + else + { + console.log(123); + } + }); + submit.trigger('click'); + } + }); + } + }); + }); + </script> + </body> +</html> diff --git a/HTML/views/WareHouseSetting/StorageLegend.html b/HTML/views/WareHouseSetting/StorageLegend.html index f3ac81a..c58250d 100644 --- a/HTML/views/WareHouseSetting/StorageLegend.html +++ b/HTML/views/WareHouseSetting/StorageLegend.html @@ -83,6 +83,7 @@ Opacity: .8; } + .btnShow { width: 20px; height: 15px; @@ -120,13 +121,22 @@ <div class="layui-inline"> <label class="layui-form-label">鎺�</label> <div class="layui-input-inline"> - <select name="Detph" id="Detph" lay-filter="SelectLayer"> - <option value="1">绗竴鎺�</option> - <option value="2">绗簩鎺�</option> + <select name="Row" id="Row" lay-filter="SelectLayer"> + <!-- <option value="1">绗竴鎺�</option> + <option value="2">绗簩鎺�</option> --> </select> </div> </div> - <!-- 瀹氭椂鑷埛鏂板簱浣嶅浘渚� --> + <div class="layui-inline"> + <label class="layui-form-label">娣卞害</label> + <div class="layui-input-inline"> + <select name="Depth" id="Depth" lay-filter="SelectDepth"> + <option value="01" selected>娣卞害1</option> + <option value="02" id="shendu2">娣卞害2</option> + </select> + </div> + </div> + <!-- //瀹氭椂鑷埛鏂板簱浣嶅浘渚� --> <div class="layui-inline" style="float: right;"> <label class="layui-form-label" style="margin-top: 10px;">鑷姩鍒锋柊</label> <div class="layui-input-inline" style="width: auto;"> @@ -212,8 +222,8 @@ var cengShu = "1"; var dom = $('#LAY_app_tabsheader', parent.document).children();//.find(s=>s.s.nodeType == 1 && className == "layui-this") - - //绠楀嚭button鐧惧垎姣斿ぇ灏� + var xianga = ""; + var xiangb = ""; //鑾峰彇浠撳簱涓嬫媺妗嗕俊鎭� synData(IP + "/Sys/GetWarehouseDic", {}, 'get', function (res) { @@ -238,25 +248,150 @@ } }); getRoadway(); - var svmwidth = 0; - GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Detph").val()); + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); GetSlotChart($("#WareHouseNo").val()); GetSlotChartz($("#WareHouseNo").val(), $("#RoadwayNo").val()) // 鏌ヨ浜嬩欢 form.on('select(getWareHouseNo)', function (data) { - GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Detph").val()); + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); getRoadway() GetSlotChart($("#WareHouseNo").val()) }); form.on('select(getRoadwayNo)', function (data) { + if (data.value == "R01") + { + xianga = "宸烽亾1鎺�"; + xiangb = "宸烽亾2鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='1']").attr("selected", "selected") + $("#Row").append('<option value =1>绗�1鎺�</option>'); + $("#Row").append('<option value =2>绗�2鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R02") + { + xianga = "宸烽亾3鎺�"; + xiangb = "宸烽亾4鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='3']").attr("selected", "selected") + $("#Row").append('<option value =3>绗�3鎺�</option>'); + $("#Row").append('<option value =4>绗�4鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R03") + { + + xianga = "宸烽亾5鎺�"; + xiangb = "宸烽亾6鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='5']").attr("selected", "selected") + $("#Row").append('<option value =5>绗�5鎺�</option>'); + $("#Row").append('<option value =6>绗�6鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R04") + { + + xianga = "宸烽亾7鎺�"; + xiangb = "宸烽亾8鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='7']").attr("selected", "selected") + $("#Row").append('<option value =7>绗�7鎺�</option>'); + $("#Row").append('<option value =8>绗�8鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R05") + { + + xianga = "宸烽亾9鎺�"; + xiangb = "宸烽亾10鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='9']").attr("selected", "selected") + $("#Row").append('<option value =9>绗�9鎺�</option>'); + $("#Row").append('<option value =10>绗�10鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R06") + { + + xianga = "宸烽亾11鎺�"; + xiangb = "宸烽亾12鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='11']").attr("selected", "selected") + $("#Row").append('<option value =11>绗�11鎺�</option>'); + $("#Row").append('<option value =12>绗�12鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R07") + { + + xianga = "宸烽亾13鎺�"; + xiangb = "宸烽亾14鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='13']").attr("selected", "selected") + $("#Row").append('<option value =13>绗�13鎺�</option>'); + $("#Row").append('<option value =14>绗�14鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R08") + { + + xianga = "宸烽亾15鎺�"; + xiangb = "宸烽亾16鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='15']").attr("selected", "selected") + $("#Row").append('<option value =15>绗�15鎺�</option>'); + $("#Row").append('<option value =16>绗�16鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R09") + { + + xianga = "宸烽亾17鎺�"; + xiangb = "宸烽亾18鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='17']").attr("selected", "selected") + $("#Row").append('<option value =17>绗�17鎺�</option>'); + $("#Row").append('<option value =18>绗�18鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R10") + { + + xianga = "宸烽亾19鎺�"; + xiangb = "宸烽亾20鎺�"; + $("#Row").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Row option[value ='19']").attr("selected", "selected") + $("#Row").append('<option value =19>绗�19鎺�</option>'); + $("#Row").append('<option value =>绗�20鎺�</option>'); + form.render('select'); + } GetSlotChartz($("#WareHouseNo").val(), $("#RoadwayNo").val()) - GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Detph").val()); + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); + }) form.on('select(SelectLayer)', function (data) { - GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Detph").val()); + if($("#Row").val() == "2" || $("#Row").val() == "5" || $("#Row").val() == "9" || $("#Row").val() == "13" || $("#Row").val() == "17") + { + $("#Depth").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Depth option[value ='01']").attr("selected", "selected") + $("#Depth").append('<option value =01>娣卞害1</option>'); + } + else + { + $("#Depth").empty();//娓呯┖涓婁竴涓煡璇笅鎷夊�� + $("#Depth option[value ='01']").attr("selected", "selected") + $("#Depth").append('<option value =01>娣卞害1</option>'); + $("#Depth").append('<option value =02>娣卞害2</option>'); + } + form.render('select'); + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); + }); + form.on('select(SelectDepth)', function (data) { + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); }); //鑾峰彇浠撳簱宸烽亾 @@ -268,10 +403,109 @@ for (var i = 0; i < res.data.length; i++) { $("#RoadwayNo").append('<option value =' + res.data[i].RoadwayNo + '>' + - res.data[i].RoadwayName + '</option>'); + res.data[i].RoadwayName + '</option>'); } $("#RoadwayNo option[value='" + res.data[0].RoadwayNo + "']").attr("selected", "selected") + $("#Depth option[value ='01']").attr("selected", "selected") form.render('select'); + if ($("#RoadwayNo").val() == "R01") + { + xianga = "宸烽亾1鎺�"; + xiangb = "宸烽亾2鎺�"; + $("#Row option[value ='1']").attr("selected", "selected") + $("#Row").append('<option value =1>绗�1鎺�</option>'); + $("#Row").append('<option value =2>绗�2鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R02") + { + xianga = "宸烽亾3鎺�"; + xiangb = "宸烽亾4鎺�"; + $("#Row option[value ='3']").attr("selected", "selected") + $("#Row").append('<option value =3>绗�3鎺�</option>'); + $("#Row").append('<option value =4>绗�4鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R03") + { + + xianga = "宸烽亾5鎺�"; + xiangb = "宸烽亾6鎺�"; + $("#Row option[value ='5']").attr("selected", "selected") + $("#Row").append('<option value =5>绗�5鎺�</option>'); + $("#Row").append('<option value =6>绗�6鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R04") + { + + xianga = "宸烽亾7鎺�"; + xiangb = "宸烽亾8鎺�"; + $("#Row option[value ='7']").attr("selected", "selected") + $("#Row").append('<option value =7>绗�7鎺�</option>'); + $("#Row").append('<option value =8>绗�8鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R05") + { + + xianga = "宸烽亾9鎺�"; + xiangb = "宸烽亾10鎺�"; + $("#Row option[value ='9']").attr("selected", "selected") + $("#Row").append('<option value =9>绗�9鎺�</option>'); + $("#Row").append('<option value =10>绗�10鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R06") + { + + xianga = "宸烽亾11鎺�"; + xiangb = "宸烽亾12鎺�"; + $("#Row option[value ='11']").attr("selected", "selected") + $("#Row").append('<option value =11>绗�11鎺�</option>'); + $("#Row").append('<option value =12>绗�12鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R07") + { + + xianga = "宸烽亾13鎺�"; + xiangb = "宸烽亾14鎺�"; + $("#Row option[value ='13']").attr("selected", "selected") + $("#Row").append('<option value =13>绗�13鎺�</option>'); + $("#Row").append('<option value =14>绗�14鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R08") + { + + xianga = "宸烽亾15鎺�"; + xiangb = "宸烽亾16鎺�"; + $("#Row option[value ='15']").attr("selected", "selected") + $("#Row").append('<option value =15>绗�15鎺�</option>'); + $("#Row").append('<option value =16>绗�16鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R09") + { + + xianga = "宸烽亾17鎺�"; + xiangb = "宸烽亾18鎺�"; + $("#Row option[value ='17']").attr("selected", "selected") + $("#Row").append('<option value =17>绗�17鎺�</option>'); + $("#Row").append('<option value =18>绗�18鎺�</option>'); + form.render('select'); + } + else if ($("#RoadwayNo").val() == "R10") + { + + xianga = "宸烽亾19鎺�"; + xiangb = "宸烽亾20鎺�"; + $("#Row option[value ='19']").attr("selected", "selected") + $("#Row").append('<option value =19>绗�19鎺�</option>'); + $("#Row").append('<option value =>绗�20鎺�</option>'); + form.render('select'); + } } else { //涓嶆垚鍔� layer.msg(res.msg, { icon: 2, @@ -283,11 +517,12 @@ } //鑾峰彇鏁版嵁娓叉煋搴撲綅鍥� - function GetSlotVm(houseNo, roadway, row) { + function GetSlotVm(houseNo, roadway, row, depth) { var param = { WareHouseNo: houseNo, roadway: roadway, - Row: row + Row: row, + Depth: depth } sendData(IP + "/Sys/GetStorageLocatLists", param, 'get', function (res) { if (res.code == 0) { @@ -306,6 +541,7 @@ var statu = list.find(r => r.Column == a && r.Layer == i); if (statu != undefined) { + //鍒ゆ柇鍌ㄤ綅鏍囪瘑鏄惁涓�0 if(statu.Flag != '0') { html += '<td><button value=' + statu.LocatNo + ' class="btnShow filg" ></button></td>' @@ -313,24 +549,25 @@ } //绌哄偍浣� 0 if (statu.Status == 0) { - html += '<td><button value=' + statu.LocatNo + ' class="btnShow zero" ></button></td>' + html += '<td><button value=' + statu.LocatNo + ' class="btnShow zero" ></button></td>' continue; } //鏈夌墿鍝� 1 if (statu.Status == 1) { - html += '<td><button value=' + statu.LocatNo + ' class="btnShow one" ></button></td>' + html += '<td><button value=' + statu.LocatNo + ' class="btnShow one" ></button></td>' continue; } //鍏ュ簱涓� 2 if (statu.Status == 2) { - html += '<td><button value=' + statu.LocatNo + ' class="btnShow two" ></button></td>' + html += '<td><button value=' + statu.LocatNo + ' class="btnShow two" ></button></td>' continue; } //鍑哄簱涓� 3 if (statu.Status == 3) { - html += '<td><button value=' + statu.LocatNo + ' class="btnShow three" ></button></td>' + html += '<td><button value=' + statu.LocatNo + ' class="btnShow three" ></button></td>' continue; } + //绉诲叆涓� 4 // if (statu.Status == 4) { // html += '<td style="height:auto;width:auto"><button value=' + statu.LocatNo + ' class="btnShow four" style="height:' + height3 + 'px;width:' + svmwidth + 'px"></button></td>' @@ -353,13 +590,12 @@ let num = 1; if (i == 1) { html += '<tr style="height:10px;"><td></td>' + for (let aa = 0; aa < list.length; aa++) { //let num = Number(aa) + 1; if (list[aa].Layer == i) { - html += '<td><p> ' + num + '</p></td>' num = Number(num) + 1; - } } html += '</tr>' @@ -376,31 +612,19 @@ }); } + // 鍔犺浇浠撳簱鍥句緥 //鍦� function GetSlotChart(warehouseNo) { sendData(IP + "/Sys/GetStorageProportion?WareHouseNo=" + warehouseNo, {}, 'get', function (res) { + // console.log("鍥暟鎹�",res) if (res.code == 0) { var LayerName = res.data[0].warehouseNo; var list = res.data; //0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 6: 鎹熷潖\灞忚斀 var key = ['绌哄偍浣�', '鏈夌墿鍝�', '鍏ュ簱涓�', '鍑哄簱涓�', '鎹熷潖\灞忚斀']; - // var value = []; - // var a = 0; - // for (var i = 0; i < key.length; i++) { - - // if (a < list.length) { - // if (i == list[a].Status) { - // value.push(list[a].StatusNum) - // a = a + 1; - // } - // } - // else { - // value.push(0) - // } - // } var value = [0,0,0,0,0,0,0]; list.forEach(item => { value[item.Status] = item.StatusNum; @@ -409,13 +633,13 @@ this.chartLine2 = echarts.init(document.getElementById("yuan")); var option2 = { color: [ - '#5470c6', //绌哄偍浣� - '#91cc75', //鏈夌墿鍝� - '#ffdc60', //鍏ュ簱涓� - '#ee6666', //鍑哄簱涓� - // '#ffff7f', //绉诲叆涓� - // '#ee23ee' //绉诲嚭涓� - '#808080', //鎹熷潖灞忚斀 + '#5470c6', + '#91cc75', + '#ffdc60', + '#ee6666', + // '#ffff7f', + // '#ee23ee', + '#808080', ], title: { text: LayerName, @@ -437,10 +661,10 @@ radius: '85%', data: [ - { value: value[0], name: key[0] }, - { value: value[1], name: key[1] }, - { value: value[2], name: key[2] }, - { value: value[3], name: key[3] }, + { value: value[0], name: key[0] }, //绌哄偍浣� + { value: value[1], name: key[1] }, //鏈夌墿鍝� + { value: value[2], name: key[2] }, //鍏ュ簱涓� + { value: value[3], name: key[3] }, //鍑哄簱涓� // { value: value[4], name: key[4] }, // { value: value[5], name: key[5] }, { value: value[6], name: key[4] }, //鎹熷潖\灞忚斀 @@ -473,12 +697,11 @@ if (res.code == 0) { var list = res.data; - console.log(list) //0锛氱┖鍌ㄤ綅 1锛氭湁鐗╁搧 2锛氬叆搴撲腑 3锛氬嚭搴撲腑 4锛氱Щ鍏ヤ腑 5锛氱Щ鍑轰腑 6锛氭崯鍧廫灞忚斀 var key = ['绌哄偍浣�', '鏈夌墿鍝�', '鍏ュ簱涓�', '鍑哄簱涓�','鎹熷潖\灞忚斀']; this.chartLine2 = echarts.init(document.getElementById("zhu")); //宸烽亾 - var roarylist = ['宸烽亾1鎺�', '宸烽亾2鎺�']; + var roarylist = [xianga, xiangb]; //鍚勫偍浣嶇姸鎬佹暟閲� var status0 = []; var status1 = []; @@ -512,7 +735,6 @@ status6.push(list[i].StatusNum) } } - console.log(status3.length) if (status0.length == 0) { status0.push(0) @@ -622,8 +844,8 @@ focus: 'series' }, data: status3 - }, - // ,{ + }, + // { // name: '绉诲叆涓�', // type: 'bar', // color: '#ffff7f', @@ -678,27 +900,28 @@ var className=$(that)[0].className; if(className=='btnShow zero'){ html = "<p style='word-wrap:break-word;width: 100%;height:100%;line-height:24px;font-size:18px'>鍌ㄤ綅缂栫爜锛�" + locatNo + "<br/>鍌ㄤ綅鐘舵�侊細绌哄偍浣�</p>"; - tipsVal=layer.tips(html,that,{tips:[1,"rgb(58, 61, 73)"],area: ['200px'],time: 0}); + tipsVal=layer.tips(html,that,{tips:[1,"rgb(58, 61, 73)"],area: ['220px'],time: 0}); }else{ var param={ locatNo:locatNo } sendData(IP + "/Sys/GetLocateInfo", param, 'get', function (res) { + console.log(res) if (res.code == 0) { html = "<p style='word-wrap:break-word;width: 100%;height:100%;line-height:24px;font-size:18px;'>"; html += "鍌ㄤ綅缂栫爜锛�" + locatNo; html += "<br/>鍌ㄤ綅鐘舵�侊細"+res.data.Status; if (res.data.GoodsInfoList != null) { + html += "<br/>鎵樼洏鍙凤細 "+res.data.PalletNo; for(var i=0;i<res.data.GoodsInfoList.length;i++){ - html += "<br/>鎵樼洏鍙凤細 "+res.data.PalletNo; html += "<br/><br/>鐗╂枡缂栫爜锛�"+res.data.GoodsInfoList[i].SkuNo; html += "<br/>鐗╂枡鍚嶇О锛�"+res.data.GoodsInfoList[i].SkuName; html += "<br/>鎵规鍙凤細 "+res.data.GoodsInfoList[i].LotNo; html += "<br/>鏁伴噺锛� "+res.data.GoodsInfoList[i].Qty; } - } - html += "</p>" + html += "</p>" + } tipsVal=layer.tips(html,that,{tips:[1,"rgb(58, 61, 73)"],area: ['260px'],time: 0}); } else { layer.msg(res.msg, { @@ -716,7 +939,7 @@ }); //#endregion - //#region 瀹氭椂鍒锋柊搴撲綅鍥句緥 + // #region 瀹氭椂鍒锋柊搴撲綅鍥句緥 //鑾峰彇鏄惁鑷姩鍒锋柊 var autoRefresh=$('#autoRefresh').prop('checked'); //缁戝畾鑷姩鍒锋柊change浜嬩欢鐩戝惉鍣� @@ -726,12 +949,12 @@ //瀹氭椂鍣� setInterval(function(){ if(autoRefresh){ - GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Detph").val()); + GetSlotVm($("#WareHouseNo").val(), $("#RoadwayNo").val(), $("#Row").val(), $("#Depth").val()); //var currentDate = new Date(); //console.log('鑷姩鍒锋柊浜嗭紝'+currentDate) } },10000)//10绉掕嚜鍔ㄥ埛鏂颁竴娆� - //#endregion + // #endregion }); </script> </body> diff --git a/Wms/Model/ModelDto/SysDto/MaterialCategoryDto.cs b/Wms/Model/ModelDto/SysDto/MaterialCategoryDto.cs new file mode 100644 index 0000000..58ad8a3 --- /dev/null +++ b/Wms/Model/ModelDto/SysDto/MaterialCategoryDto.cs @@ -0,0 +1,73 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Model.ModelDto.SysDto +{ + public class MaterialCategoryDto + { + /// <summary> + /// Id + /// </summary> + public int Id { get; set; } + + /// <summary> + /// 绫诲埆鍙� + /// </summary> + public string CategoryNo { get; set; } + + /// <summary> + /// 绫诲埆鍚嶇О + /// </summary> + public string CategoryName { get; set; } + + /// <summary> + /// 鍖哄煙缂栫爜 + /// </summary> + public string AreaNo { get; set; } + + /// <summary> + /// 鍖哄煙鍚嶇О + /// </summary> + public string AreaName { get; set; } + + /// <summary> + /// 鎵�灞炰粨搴� + /// </summary> + public string WareHouseNo { get; set; } + + /// <summary> + /// 浠撳簱鍚嶇О + /// </summary> + public string WareHouseName { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + public string Demo { get; set; } + /// <summary> + /// 鍒涘缓鏃ユ湡 + /// </summary> + public DateTime CreateTime { get; set; } = DateTime.Now; + + /// <summary> + /// 鏇存柊鏃ユ湡 + /// </summary> + public DateTime? UpdateTime { get; set; } + + /// <summary> + /// 鏄惁鍒犻櫎 + /// </summary> + public string IsDel { get; set; } = "0"; + + /// <summary> + /// 鍒涘缓浜� + /// </summary> + public int CreateUser { get; set; } + + /// <summary> + /// 鏇存柊浜� + /// </summary> + public int? UpdateUser { get; set; } + } +} diff --git a/Wms/WMS.BLL/SysServer/MaterialCategory.cs b/Wms/WMS.BLL/SysServer/MaterialCategory.cs new file mode 100644 index 0000000..2800158 --- /dev/null +++ b/Wms/WMS.BLL/SysServer/MaterialCategory.cs @@ -0,0 +1,218 @@ +锘縰sing Model.ModelDto; +using Model.ModelDto.SysDto; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using WMS.DAL; +using WMS.Entity.BllSoEntity; +using WMS.Entity.Context; +using WMS.Entity.SysEntity; +using WMS.IBLL.ISysServer; + +namespace WMS.BLL.SysServer +{ + /// <summary> + /// 鐗╂枡绫诲埆绠$悊鏂规硶 + /// </summary> + public class MaterialCategory : DbHelper<SysMaterialCategory>, IMaterialCategory + { + + private static readonly SqlSugarScope Db = DataContext.Db; + public MaterialCategory() : base(Db) + { + } + + /// <summary> + /// 鑾峰彇鐗╂枡绫诲埆淇℃伅 + /// </summary> + /// <param name="categoryName">绫诲埆鍚嶇О</param> + /// <param name="areaNo">鍖哄煙缂栫爜</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public List<MaterialCategoryDto> GetMaterialCategories(string categoryName, string areaNo) + { + try + { + var list = Db.Queryable<MaterialCategoryDto>() + .WhereIF(!string.IsNullOrWhiteSpace(categoryName), a => a.CategoryName == categoryName) + .WhereIF(!string.IsNullOrWhiteSpace(areaNo), a => a.AreaNo == areaNo) + .Where(a => a.IsDel == "0").ToList(); + + return list; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } + + /// <summary> + /// 鏂板绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public string InsertMaterialCategories(SysMaterialCategory category) + { + try + { + string msg = ""; + //鑾峰彇绫诲埆淇℃伅 + var categoryInfo = Db.Queryable<SysMaterialCategory>().First(a => a.IsDel == "0" && a.CategoryNo == category.CategoryNo); + //鑾峰彇鍖哄煙淇℃伅 + var area = Db.Queryable<SysStorageArea>().First(a => a.AreaNo == category.AreaNo && a.IsDel == "0"); + + if (categoryInfo != null) + { + msg = "褰撳墠绫诲埆淇℃伅宸茶鍒涘缓锛岃閲嶆柊濉啓淇℃伅锛�"; + return msg; + } + if (area == null) + { + msg = "褰撳墠閫夋嫨鍖哄煙淇℃伅寮傚父锛岃閲嶆柊閫夋嫨鎴栬仈绯荤鐞嗗憳锛�"; + return msg; + } + + Db.BeginTran(); + SysMaterialCategory list = new SysMaterialCategory() + { + CategoryNo = category.CategoryNo, //绫诲埆鍙� + CategoryName = category.CategoryName, //绫诲埆鍚嶇О + + AreaNo = category.AreaNo, //鍖哄煙缂栫爜 + WareHouseNo = area.WareHouseNo, //鎵�灞炰粨搴� + Demo = category.Demo, //澶囨敞 + + IsDel = "0", //鏄惁鍒犻櫎 + CreateUser = category.CreateUser, //鍒涘缓浜� + CreateTime = Db.GetDate(), //鍒涘缓鏃堕棿 + }; + + Db.Insertable(list).ExecuteCommand(); + + + Db.CommitTran(); + + msg = "鏂板绫诲埆淇℃伅鎴愬姛锛�"; + return msg; + + + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + } + + /// <summary> + /// 缂栬緫绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public string ExitMaterialCategories(SysMaterialCategory category) + { + try + { + string msg = ""; + //鑾峰彇绫诲埆淇℃伅 + var categoryInfo = Db.Queryable<SysMaterialCategory>().First(a => a.IsDel == "0" && a.CategoryNo == category.CategoryNo); + //鑾峰彇鍖哄煙淇℃伅 + var area = Db.Queryable<SysStorageArea>().First(a => a.AreaNo == category.AreaNo && a.IsDel == "0"); + + if (categoryInfo != null) + { + msg = "褰撳墠绫诲埆淇℃伅宸茶鍒涘缓锛岃閲嶆柊濉啓淇℃伅锛�"; + return msg; + } + + if (area == null) + { + msg = "褰撳墠閫夋嫨鍖哄煙淇℃伅寮傚父锛岃閲嶆柊閫夋嫨鎴栬仈绯荤鐞嗗憳锛�"; + return msg; + } + + Db.BeginTran(); + categoryInfo = new SysMaterialCategory() + { + CategoryNo = category.CategoryNo, //绫诲埆鍙� + CategoryName = category.CategoryName, //绫诲埆鍚嶇О + + AreaNo = category.AreaNo, //鍖哄煙缂栫爜 + WareHouseNo = area.WareHouseNo, //鎵�灞炰粨搴� + Demo = category.Demo, //澶囨敞 + + IsDel = "0", //鏄惁鍒犻櫎 + UpdateUser = category.CreateUser, //鏇存敼浜� + UpdateTime = Db.GetDate(), //鏇存敼鏃堕棿 + }; + + Db.Updateable(categoryInfo).ExecuteCommand(); + + Db.CommitTran(); + + msg = "缂栬緫绫诲埆淇℃伅鎴愬姛锛�"; + return msg; + + + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + } + + /// <summary> + /// 鍒犻櫎绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + public string DeleteMaterialCategories(SysMaterialCategory category) + { + try + { + string msg = ""; + //鑾峰彇绫诲埆淇℃伅 + var categoryInfo = Db.Queryable<SysMaterialCategory>().First(a => a.IsDel == "0" && a.CategoryNo == category.CategoryNo); + //鑾峰彇鍖哄煙淇℃伅 + var area = Db.Queryable<SysStorageArea>().First(a => a.AreaNo == category.AreaNo && a.IsDel == "0"); + + + if (categoryInfo != null) + { + msg = "褰撳墠绫诲埆淇℃伅宸茶鍒犻櫎锛岃閲嶆柊閫夋嫨锛�"; + return msg; + } + if (area == null) + { + msg = "褰撳墠閫夋嫨鍖哄煙淇℃伅寮傚父锛岃閲嶆柊閫夋嫨鎴栬仈绯荤鐞嗗憳锛�"; + return msg; + } + + Db.BeginTran(); + + categoryInfo.IsDel = "1"; + + Db.Updateable(categoryInfo).ExecuteCommand(); + + Db.CommitTran(); + + msg = "鍒犻櫎绫诲埆淇℃伅鎴愬姛锛�"; + return msg; + + + } + catch (Exception ex) + { + Db.RollbackTran(); + throw new Exception(ex.Message); + } + } + } +} diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs index 128feea..0b17705 100644 --- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs +++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs @@ -306,17 +306,14 @@ /// <param name="wareHouseNo">浠撳簱</param> /// <param name="roadway">宸烽亾鍙�</param> /// <param name="row">鎺� 1 or 2</param> + /// <param name="depth">娣卞害</param> /// <returns></returns> - public List<SysStorageLocat> GetStorageLocatLists(string wareHouseNo, string roadway, string row) + public List<SysStorageLocat> GetStorageLocatLists(string wareHouseNo, string roadway, string row, string depth) { try { - var road = roadway.Substring(1, roadway.Length - 1); - var num = int.Parse(road); - var rows = (num - 1) * 2 + int.Parse(row);//鎺� - var list = Db.Queryable<SysStorageLocat>().Where(m => - m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == rows).ToList(); + m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row) && m.Depth == depth).ToList(); return list; } @@ -343,7 +340,7 @@ var rows = (num - 1) * 2 + int.Parse(row);//鎺� var maxLayer = Db.Queryable<SysStorageLocat>().Where(m => - m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == rows).Max(m=>m.Layer); + m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row)).Max(m=>m.Layer); return maxLayer; } @@ -369,7 +366,7 @@ var rows = (num - 1) * 2 + int.Parse(row);//鎺� var maxColumn = Db.Queryable<SysStorageLocat>().Where(m => - m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == rows).Max(m => m.Column); + m.IsDel == "0" && m.WareHouseNo == wareHouseNo && m.RoadwayNo == roadway && m.Row == int.Parse(row)).Max(m => m.Column); return maxColumn; } diff --git a/Wms/WMS.Entity/SysEntity/MaterialCategory.cs b/Wms/WMS.Entity/SysEntity/MaterialCategory.cs new file mode 100644 index 0000000..0490f6f --- /dev/null +++ b/Wms/WMS.Entity/SysEntity/MaterialCategory.cs @@ -0,0 +1,38 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace WMS.Entity.SysEntity +{ + /// <summary> + /// 鐗╂枡绫诲埆琛� + /// </summary> + public class SysMaterialCategory : BaseEntity + { + /// <summary> + /// 绫诲埆鍙� + /// </summary> + public string CategoryNo { get; set; } + + /// <summary> + /// 绫诲埆鍚嶇О + /// </summary> + public string CategoryName { get; set; } + + /// <summary> + /// 鍖哄煙缂栫爜 + /// </summary> + public string AreaNo { get; set; } + + /// <summary> + /// 鎵�灞炰粨搴� + /// </summary> + public string WareHouseNo { get; set; } + + /// <summary> + /// 澶囨敞 + /// </summary> + public string Demo { get; set; } + + } +} diff --git a/Wms/WMS.IBLL/ISysServer/IMaterialCategory.cs b/Wms/WMS.IBLL/ISysServer/IMaterialCategory.cs new file mode 100644 index 0000000..b709004 --- /dev/null +++ b/Wms/WMS.IBLL/ISysServer/IMaterialCategory.cs @@ -0,0 +1,47 @@ +锘縰sing Model.ModelDto.SysDto; +using System; +using System.Collections.Generic; +using System.Text; +using WMS.Entity.SysEntity; + +namespace WMS.IBLL.ISysServer +{ + /// <summary> + /// 鐗╂枡绫诲埆绠$悊鏂规硶 + /// </summary> + public interface IMaterialCategory + { + /// <summary> + /// 鑾峰彇鐗╂枡绫诲埆淇℃伅 + /// </summary> + /// <param name="categoryName">绫诲埆鍚嶇О</param> + /// <param name="areaNo">鍖哄煙缂栫爜</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + List<MaterialCategoryDto> GetMaterialCategories(string categoryName, string areaNo); + + /// <summary> + /// 鏂板绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + string InsertMaterialCategories(SysMaterialCategory category); + + /// <summary> + /// 缂栬緫绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + string ExitMaterialCategories(SysMaterialCategory category); + + /// <summary> + /// 鍒犻櫎绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + string DeleteMaterialCategories(SysMaterialCategory category); + } +} diff --git a/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs b/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs index b6c049a..cc0419f 100644 --- a/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs +++ b/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs @@ -70,8 +70,10 @@ /// <param name="wareHouseNo">浠撳簱</param> /// <param name="roadway">宸烽亾鍙�</param> /// <param name="row">鎺�</param> + /// <param name="depth">娣卞害</param> /// <returns></returns> - List<SysStorageLocat> GetStorageLocatLists(string wareHouseNo, string roadway,string row); + + List<SysStorageLocat> GetStorageLocatLists(string wareHouseNo, string roadway,string row, string depth); /// <summary> /// 鑾峰彇鏈�澶у眰绾� diff --git a/Wms/Wms/Controllers/SysController.cs b/Wms/Wms/Controllers/SysController.cs index 8ef43b0..fe4cd03 100644 --- a/Wms/Wms/Controllers/SysController.cs +++ b/Wms/Wms/Controllers/SysController.cs @@ -41,6 +41,9 @@ private readonly IOperationSysServer _operation; //鎿嶄綔鏃ュ織 private readonly IExceptionServer _table; //寮傚父澶勭悊 private readonly IHeaderSettingsServer _headerSet;//琛ㄥご璁剧疆 + + private readonly IMaterialCategory _category;//鐗╂枡绫诲埆 + /// <summary> /// 鏋勯�犲嚱鏁� /// </summary> @@ -54,7 +57,8 @@ /// <param name="dic">鏁版嵁瀛楀吀</param> /// <param name="operation">鎿嶄綔鏃ュ織</param> /// <param name="table">寮傚父澶勭悊</param> - public SysController(IWareHouseServer wareHouseSvc, IStorageAreaServer areaSvc, IStorageRoadwayServer roadwaySvc, IStorageLocatServer locatSvc, IPalletsServer palletSvc, IPalletTrackServer palletTrackSvc, IMenuServer menuSvc, IDictionaryServer dic, IOperationSysServer operation, IExceptionServer table, IHeaderSettingsServer headerSet) + /// <param name="category">鐗╂枡绫诲埆</param> + public SysController(IWareHouseServer wareHouseSvc, IStorageAreaServer areaSvc, IStorageRoadwayServer roadwaySvc, IStorageLocatServer locatSvc, IPalletsServer palletSvc, IPalletTrackServer palletTrackSvc, IMenuServer menuSvc, IDictionaryServer dic, IOperationSysServer operation, IExceptionServer table, IHeaderSettingsServer headerSet, IMaterialCategory category) { _wareHouseSvc = wareHouseSvc; //浠撳簱 _areaSvc = areaSvc; //鍖哄煙 @@ -69,6 +73,7 @@ _table = table; //寮傚父澶勭悊 _headerSet = headerSet;//琛ㄥご璁剧疆 + _category = category;//鐗╂枡绫诲埆 } #region 鑿滃崟绠$悊 @@ -225,7 +230,7 @@ } catch (Exception ex) { - return Ok(new { data = "", code = 3, msg = "鏂板鑿滃崟淇℃伅寮傚父锛�"+ ex.Message }); + return Ok(new { data = "", code = 3, msg = "鏂板鑿滃崟淇℃伅寮傚父锛�" + ex.Message }); } } @@ -1138,7 +1143,7 @@ { _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", storage.LocatNo, "淇敼", "淇敼鍌ㄤ綅淇℃伅 鍌ㄤ綅鍙凤細" + storage.LocatNo, Convert.ToInt32(userId)); } - + return Ok(new { code = 0, msg = "缂栬緫鎴愬姛", data = "" }); } else @@ -1384,11 +1389,11 @@ int uid = Convert.ToInt32(userId); //鏇存敼浜� tabledto.UpdateUser = uid; - string strMesage = _table.EditStatus(tabledto); + string strMesage = _table.EditStatus(tabledto); if (strMesage == "") { return Ok(new { code = 0, msg = "澶勭悊鎴愬姛" }); - } + } else { return Ok(new { code = 1, msg = strMesage }); @@ -1444,12 +1449,13 @@ /// <param name="wareHouseNo">浠撳簱</param> /// <param name="roadway">宸烽亾鍙�</param> /// <param name="row">鎺�</param> + /// <param name="depth">娣卞害</param> /// <returns></returns> [HttpGet] - public IActionResult GetStorageLocatLists(string wareHouseNo, string roadway,string row) + public IActionResult GetStorageLocatLists(string wareHouseNo, string roadway, string row, string depth) { //鑾峰彇鍌ㄤ綅淇℃伅 - List<SysStorageLocat> storagelist = _locatSvc.GetStorageLocatLists(wareHouseNo, roadway, row); + List<SysStorageLocat> storagelist = _locatSvc.GetStorageLocatLists(wareHouseNo, roadway, row, depth); //鑾峰彇鏈�澶у眰绾� int maxLayer = _locatSvc.GetMaxLayer(wareHouseNo, roadway, row); @@ -1527,7 +1533,7 @@ [HttpGet] public IActionResult GetStorageProportion1(string wareHouseNo, string roadwayNo) { - List<GetLocateVm> getLocateVms = _locatSvc.GetStorageProportion1(wareHouseNo,roadwayNo); + List<GetLocateVm> getLocateVms = _locatSvc.GetStorageProportion1(wareHouseNo, roadwayNo); return Ok(new { data = getLocateVms, @@ -1586,6 +1592,179 @@ #endregion + #region 鐗╂枡绫诲埆 + + /// <summary> + /// 鑾峰彇鐗╂枡绫诲埆淇℃伅 + /// </summary> + /// <param name="categoryName">绫诲埆鍚嶇О</param> + /// <param name="areaNo">鍖哄煙缂栫爜</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + [HttpGet] + public IActionResult GetMaterialCategories(string categoryName, string areaNo) + { + try + { + var list = _category.GetMaterialCategories(categoryName, areaNo); + return Ok(new + { + data = list, + code = 1, + msg = "鑾峰彇鐗╂枡绫诲埆淇℃伅鎴愬姛" + }); + } + catch (Exception ex) + { + return Ok(new + { + data = "", + code = 0, + msg = "鑾峰彇鐗╂枡绫诲埆淇℃伅寮傚父" + }); + } + } + + /// <summary> + /// 鏂板绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + [HttpPost] + public IActionResult InsertMaterialCategories(SysMaterialCategory category) + { + try + { + //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D + var claimsIdentity = this.User.Identity as ClaimsIdentity; + if (claimsIdentity == null) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; + if (string.IsNullOrWhiteSpace(userId)) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + category.CreateUser = int.Parse(userId); + + var list = _category.InsertMaterialCategories(category); + + return Ok(new + { + data = list, + code = 1, + msg = "鏂板鐗╂枡绫诲埆淇℃伅鎴愬姛" + }); + + + } + catch (Exception ex) + { + return Ok(new + { + data = "", + code = 0, + msg = "鏂板鐗╂枡绫诲埆淇℃伅寮傚父" + }); + } + } + + /// <summary> + /// 缂栬緫绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + [HttpPost] + public IActionResult ExitMaterialCategories(SysMaterialCategory category) + { + try + { + //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D + var claimsIdentity = this.User.Identity as ClaimsIdentity; + if (claimsIdentity == null) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; + if (string.IsNullOrWhiteSpace(userId)) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + category.UpdateUser = int.Parse(userId); + + var list = _category.ExitMaterialCategories(category); + + return Ok(new + { + data = list, + code = 1, + msg = "缂栬緫鐗╂枡绫诲埆淇℃伅鎴愬姛" + }); + + + } + catch (Exception ex) + { + return Ok(new + { + data = "", + code = 0, + msg = "缂栬緫鐗╂枡绫诲埆淇℃伅寮傚父" + }); + } + } + + /// <summary> + /// 鍒犻櫎绫诲埆淇℃伅 + /// </summary> + /// <param name="category">鐗╂枡绫诲埆瀹炰綋</param> + /// <returns></returns> + /// <exception cref="Exception"></exception> + [HttpPost] + public IActionResult DeleteMaterialCategories(SysMaterialCategory category) + { + try + { + //鑾峰彇褰撳墠鐧诲綍鐨勭敤鎴稩D + var claimsIdentity = this.User.Identity as ClaimsIdentity; + if (claimsIdentity == null) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var userId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; + if (string.IsNullOrWhiteSpace(userId)) + { + return Ok(new { code = 1, msg = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + category.UpdateUser = int.Parse(userId); + + var list = _category.DeleteMaterialCategories(category); + + return Ok(new + { + data = list, + code = 1, + msg = "鍒犻櫎鐗╂枡绫诲埆淇℃伅鎴愬姛" + }); + + + } + catch (Exception ex) + { + return Ok(new + { + data = "", + code = 0, + msg = "鍒犻櫎鐗╂枡绫诲埆淇℃伅寮傚父" + }); + } + } + + #endregion + #region 鏁版嵁琛ㄦ牸琛ㄥご鑷畾涔�(閫氱敤鏂规硶) -- Gitblit v1.8.0