From f2b3c45b78bb9fc021869c4ae35e6de039b50bbf Mon Sep 17 00:00:00 2001 From: chengsc <Demo@DESKTOP-CPA90BF> Date: 星期五, 18 十月 2024 18:40:52 +0800 Subject: [PATCH] 修改问题 --- Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs | 7 Wms/Wms/Controllers/SysController.cs | 65 +++ Wms/WMS.IBLL/ILogServer/IOperationSysServer.cs | 26 HTML/views/WareHouseSetting/LocateEditArea.html | 178 +++++++++ Wms/WMS.BLL/SysServer/StorageLocatServer.cs | 113 ++++++ HTML/views/SystemSettings/LogOperation.html | 249 +++++++++++++ Wms/Model/ModelVm/SysVm/LocateVm.cs | 45 ++ Wms/WMS.BLL/LogServer/OperationSysServer.cs | 189 +++++++-- HTML/views/WareHouseSetting/Locate.html | 166 ++++++-- 9 files changed, 926 insertions(+), 112 deletions(-) diff --git a/HTML/views/SystemSettings/LogOperation.html b/HTML/views/SystemSettings/LogOperation.html index b2ed405..081cd9b 100644 --- a/HTML/views/SystemSettings/LogOperation.html +++ b/HTML/views/SystemSettings/LogOperation.html @@ -1,5 +1,252 @@ <!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"> + <link rel="stylesheet" href="../../css/public.css" media="all"> + + <script> + // 杩欓噷鏄渶瑕佸湪椤甸潰娓叉煋涔嬪墠鎵ц鐨勪唬鐮� + document.addEventListener("DOMContentLoaded", function () { + //鑾峰彇table榛樿鏄剧ず鏁� + pageCntFirst(); + //鍒ゆ柇鏄惁寮�鍚痶able鍒楄〃鍒楀璋冩暣鍔熻兘銆� + GetIsSetColW(); + }); + </script> + +</head> + +<body id="body"> + <div class="layui-card" style="padding-bottom: 0"> + <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top"> + <div class="layui-form-item"> + + <div class="layui-inline"> + <label class="layui-form-label">鑿滃崟鍚嶇О</label> + <div class="layui-input-inline"> + <input type="text" id="MenuName" name="MenuName" placeholder="璇疯緭鍏ヨ彍鍗曞悕绉�" autocomplete="off" + class="layui-input"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 45px;">绫诲瀷</label> + <div class="layui-input-inline"> + <select name="Type" id="Type" lay-verify="" lay-search> + <option value=""></option> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">鎿嶄綔鍐呭</label> + <div class="layui-input-inline"> + <input type="text" id="Msg" name="Msg" placeholder="璇疯緭鍏ユ搷浣滃唴瀹�" autocomplete="off" + class="layui-input"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">寮�濮嬫椂闂�</label> + <div class="layui-input-inline"> + <input type="text" autocomplete="off" name="StartTime" id="StartTime" class="layui-input" + placeholder="寮�濮嬫椂闂�"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label" style="width: 60px;">缁撴潫鏃堕棿</label> + <div class="layui-input-inline"> + <input type="text" autocomplete="off" name="EndTime" id="EndTime" class="layui-input" + placeholder="缁撴潫鏃堕棿"> + </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> + </div> + <div id="center"></div> + <div class="layui-card-body"> + <div class="position-relative"><!-- class="position-relative" --><!-- 鑷畾涔夎〃澶村姞涓� --> + <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> + <!-- #region 鑷畾涔夎〃澶� --> + <div class="headerSetIcon"> + <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols"> + <i class="layui-icon"></i> + </button> + </div> + <!-- #endregion --> + + <!-- #region 鑷畾涔夎〃澶� --> + <script type="text/html" id="templetCreateTime"> + {{# function GetBtn(d){ + return formatDate(d.CreateTime); + } + }} + {{ GetBtn(d) }} + </script> + <!-- #endregion --> + </div> + </div> + </div> + <script src="../../layuiadmin/layui/layui.js"></script> + <script src="../../js/jquery-3.5.1.min.js"></script> + <script src="../../js/jquery.cookie.js"></script> + <script src="../../js/public.js"></script> + + <script> + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index' //涓诲叆鍙fā鍧� + }).use(['index', 'table', 'laypage', 'layer', 'laydate'], function () { + var table = layui.table, + form = layui.form, + laypage = layui.laypage, + layer = layui.layer; + laydate = layui.laydate; + laydate.render({ + elem: '#StartTime' + , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� + }); + laydate.render({ + elem: '#EndTime' + , format: 'yyyy-MM-dd' //鍙换鎰忕粍鍚� + }); + + var h1 = GetTableHeight(); + + refreshTable(); + //鑾峰彇绫诲瀷鑿滃崟涓嬫媺 + + sendData(IP + "/Sys/GetDictionaryByParentNo", { parentNo: "LogType" }, 'get', function (res) { + var html = ''; + console.log(res); + if (res.code == 0) { //鎴愬姛 + var list = res.data; + for (var i = 0; i < list.length; i++) { + html += '<option value = "' + list[i].Id + '">' + list[i].DictName + '</option>'; + } + $("#Type").append(html); + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg('鑾峰彇鎿嶄綔绫诲瀷淇℃伅澶辫触锛�', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }); + } + }); + + //娓叉煋琛ㄦ牸 + //#region 鑷畾涔夎〃澶� + var TotalColsArr = [[ + { field: '', title: '搴忓彿', type: 'numbers', width: 65, align: 'center', fixed: 'left', "disabled": true }, + { field: 'ParentNo', title: '妯″潡鍙�', align: 'center', fixed: 'left', width: 80, "disabled": true }, + { field: 'MenuNo', title: '鑿滃崟鍙�', align: 'center', fixed: 'left', width: 80, "disabled": true }, + { field: 'MenuName', title: '鑿滃崟鍚嶇О', align: 'center', width: 190 }, + { field: 'FkNo', title: '鏁版嵁缂栧彿', align: 'center', width: 180 }, + { field: 'Type', title: '绫诲瀷', align: 'center', width: 100 }, + { field: 'Msg', title: '鎿嶄綔鍐呭', align: 'center' }, + { field: 'CreateUserName', title: '鍒涘缓浜�', align: 'center', width: 120 }, + { field: 'CreateTime', title: '鍒涘缓鏃堕棿', align: 'center', width: 160, templet: '#templetCreateTime' } + ]]; + var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//灏嗚〃澶存暟鎹繘琛寀rl缂栫爜 + + function refreshTable() { + + //#region 鑷畾涔夎〃澶� + var colsJson + var param1 = { + Href: 'Sys/GetLogOperationList' + }; + sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { + if (res.code == 0) { + if (res.data == '' || res.data == undefined || res.data == null) { + colsJson = TotalColsArr + } else { + colsJson = eval(res.data); + } + } else { + colsJson = TotalColsArr + } + var param = { + MenuName: $("#MenuName").val(), + Type: $("#Type").val(), + Msg: $("#Msg").val(), + StartTime: $("#StartTime").val(), + EndTime: $("#EndTime").val(), + }; + table.render({ + elem: '#LAY-app-content-list', + url: IP + "/Sys/GetLogOperationList", + method: 'POST', + height: h1, + id: 'LAY-app-content-list', + where: param, + contentType: 'application/json', + headers: { ToKen: $.cookie('token') }, + page: true, + limit: pageCnt, + limits: pageLimits, + cellMinWidth: 60, //鍏ㄥ眬瀹氫箟甯歌鍗曞厓鏍肩殑鏈�灏忓搴︼紝layui 2.2.1 鏂板 + cols: colsJson, + done: function (res) { + //鑷畾涔夊垪瀹� + SetTableColW('LAY-app-content-list', 'Sys/GetLogOperationList', TotalColsSysArr); + }, + }); + }); + //#endregion + + } + //鐩戝惉鎼滅储 + form.on('submit(LAY-app-contlist-search)', function (data) { + + refreshTable(); + }); + + //#region 鑷畾涔夎〃澶� + //鑷畾涔夎〃澶� + active = { + customCols: function () { + layer.open({ + type: 2, + title: '鑷畾涔夊垪', + content: '../SystemSettings/HeaderSetting.html?Href=Sys/GetLogOperationList&ColsSysArr=' + TotalColsSysArr, + maxmin: false, + resize: false, + area: ['970px', '650px'] + }); + } + }; + $('.layui-btn').on('click', function () { + var type = $(this).data('type'); + active[type] ? active[type].call(this) : ''; + }); + //#endregion + }); + </script> +</body> + +</html> + + + + + + + + +<!-- <!DOCTYPE html> +<html> <head> <meta charset="utf-8"> <title>鐢ㄦ埛淇℃伅鍒楄〃</title> @@ -200,4 +447,4 @@ }); </script> </body> -</html> +</html> --> \ No newline at end of file diff --git a/HTML/views/WareHouseSetting/Locate.html b/HTML/views/WareHouseSetting/Locate.html index 9f52be6..315d822 100644 --- a/HTML/views/WareHouseSetting/Locate.html +++ b/HTML/views/WareHouseSetting/Locate.html @@ -152,48 +152,12 @@ // 琛ㄥ崟闇�瑕佺殑鍙橀噺 var doing = true; active = { - + editList: function () { - var checkStatus = table.checkStatus('LAY-app-content-list'), - checkData = checkStatus.data; //寰楀埌閫変腑鐨勬暟鎹� - if (checkData.length === 0) { - return layer.msg('璇烽�夋嫨鏁版嵁'); - } - else if(checkData.length > 1) - { - var li = 0; - var ping = 0; - var WareNo = "W01"; - checkData.forEach(item => { - if (item.WareHouseName == "鍔涜绔嬩綋搴�") - { - li += 1; - WareNo = "W01"; - if (ping > 0) - { - return; - } - } - if (item.WareHouseName == "鍔涜骞冲簱") - { - ping += 1; - WareNo = "W02"; - if (li > 0) - { - return; - } - } - }); - if (li != 0 && ping != 0) - { - return layer.msg('璇峰嬁閫夋嫨澶氱浠撳簱锛�'); - } - } - layer.open({ type: 2, title: '缂栬緫鍌ㄤ綅鐘舵�侀泦鍚�', - content: 'LocateFrom.html?WareHouseNo='+WareNo, + content: 'LocateEditArea.html', maxmin: true, area: ['560px', '510px'], btn: ['纭畾', '鍙栨秷'], @@ -205,23 +169,23 @@ iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) { var field = data.field; //鑾峰彇鎻愪氦鐨勫瓧娈� console.log(field); - var msg = []; - for (var i = 0; i < checkData.length; i++) { - // msg.push(checkData[i].Id); - msg.push(checkData[i].Id) - } - console.log(msg); - + //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� var param = { - Id: msg, + RoadWayNo: field.RoadwayNo, + AreaNo:field.AreaNo, + Row:parseInt(field.Row), + Column:parseInt(field.Column), + Layer: parseInt(field.Layer), + Dept:parseInt(field.Depth), Status:field.Status, Flag:field.Flag, - Temperature:field.Temp + }; + console.log(param); if (doing) { doing = false; - sendData(IP + "/Sys/EditStorageLocatList", param, 'post', function (res) { + sendData(IP + "/Sys/EditStorageLocatListNew", param, 'post', function (res) { console.log(res); if (res.code == 0) { //鎴愬姛 layer.msg(res.msg, { @@ -249,13 +213,115 @@ } }); } - - //$.ajax({}); }); submit.trigger('click'); } }); } + + // editList: function () { + // var checkStatus = table.checkStatus('LAY-app-content-list'), + // checkData = checkStatus.data; //寰楀埌閫変腑鐨勬暟鎹� + // if (checkData.length === 0) { + // return layer.msg('璇烽�夋嫨鏁版嵁'); + // } + // else if(checkData.length > 1) + // { + // var li = 0; + // var ping = 0; + // var WareNo = "W01"; + // checkData.forEach(item => { + // if (item.WareHouseName == "鍔涜绔嬩綋搴�") + // { + // li += 1; + // WareNo = "W01"; + // if (ping > 0) + // { + // return; + // } + // } + // if (item.WareHouseName == "鍔涜骞冲簱") + // { + // ping += 1; + // WareNo = "W02"; + // if (li > 0) + // { + // return; + // } + // } + // }); + // if (li != 0 && ping != 0) + // { + // return layer.msg('璇峰嬁閫夋嫨澶氱浠撳簱锛�'); + // } + // } + + // layer.open({ + // type: 2, + // title: '缂栬緫鍌ㄤ綅鐘舵�侀泦鍚�', + // content: 'LocateFrom.html?WareHouseNo='+WareNo, + // maxmin: true, + // area: ['560px', '510px'], + // 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; //鑾峰彇鎻愪氦鐨勫瓧娈� + // console.log(field); + // var msg = []; + // for (var i = 0; i < checkData.length; i++) { + // // msg.push(checkData[i].Id); + // msg.push(checkData[i].Id) + // } + // console.log(msg); + + // //鎻愪氦 Ajax 鎴愬姛鍚庯紝闈欐�佹洿鏂拌〃鏍间腑鐨勬暟鎹� + // var param = { + // Id: msg, + // Status:field.Status, + // Flag:field.Flag, + // Temperature:field.Temp + // }; + // if (doing) { + // doing = false; + // sendData(IP + "/Sys/EditStorageLocatList", param, 'post', function (res) { + // console.log(res); + // if (res.code == 0) { //鎴愬姛 + // layer.msg(res.msg, { + // icon: 1, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function () { + // tableIns.reload({ + // page: { + // curr: 1 + // } + // }); + // layer.close(index); //鍏抽棴寮瑰眰 + // doing = true; + // }); + // } else if(res.code == 1){ + // layer.msg(res.msg, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {doing = true;}); + // } else { //涓嶆垚鍔� + // layer.msg(res.statusText, { + // icon: 2, + // time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + // }, function() {doing = true;}); + // } + // }); + // } + + // //$.ajax({}); + // }); + // submit.trigger('click'); + // } + // }); + // } }; $('.layui-btn.layuiadmin-btn-list').on('click', function () { var type = $(this).data('type'); diff --git a/HTML/views/WareHouseSetting/LocateEditArea.html b/HTML/views/WareHouseSetting/LocateEditArea.html new file mode 100644 index 0000000..1d84444 --- /dev/null +++ b/HTML/views/WareHouseSetting/LocateEditArea.html @@ -0,0 +1,178 @@ +<!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"> + </head> + <body> + <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" + style="padding: 20px 30px 0 0;"> + + + <div class="layui-form-item"> + <label class="layui-form-label">鎵�灞炲贩閬�</label> + <div class="layui-input-inline"> + <select name="RoadwayNo" id="RoadwayNo" lay-filter="getRoadwayNo" lay-search > + <option value=""></option> + </select> + </div> + <label class="layui-form-label">鎵�灞炲尯鍩�</label> + <div class="layui-input-inline"> + <select name="AreaNo" id="AreaNo" lay-filter="getAreaNo" lay-search> + <option value=""></option> + </select> + </div> + </div> + + <div class="layui-form-item"> + <label class="layui-form-label">  鍌ㄦ帓</label> + <div class="layui-input-inline"> + <input type="number" id="Row" name="Row" placeholder="鎺捖仿仿�" autocomplete="off" + class="layui-input" > + </div> + <label class="layui-form-label">  鍌ㄥ垪</label> + <div class="layui-input-inline"> + <input type="number" id="Column" name="Column" placeholder="鍒椔仿仿�" autocomplete="off" + class="layui-input" > + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label">  鍌ㄥ眰</label> + <div class="layui-input-inline"> + <input type="number" id="Layer" name="Layer" placeholder="灞偮仿仿�" autocomplete="off" + class="layui-input" > + </div> + <label class="layui-form-label">鍌ㄤ綅娣卞害</label> + <div class="layui-input-inline"> + <input type="number" id="Depth" name="Depth" placeholder="鍌ㄤ綅娣卞害路路路" autocomplete="off" + class="layui-input" oninput="value=value.replace(/^[0-9]+$/,'')" + onafterpaste="this.value=this.value.replace(/^[0-9]+$/,'')"> + </div> + + </div> + <div class="layui-form-item"> + <label class="layui-form-label">鍌ㄤ綅鐘舵��</label> + <div class="layui-input-inline"> + <select name="Status" id="Status" lay-filter="getStatus" lay-search > + <option value=""></option> + <option value="0">绌哄偍浣�</option> + <option value="1">鏈夌墿鍝�</option> + <option value="2">姝e湪鍏ュ簱</option> + <option value="3">姝e湪鍑哄簱</option> + <option value="4">姝e湪绉诲叆</option> + <option value="5">姝e湪绉诲嚭</option> + </select> + </div> + <label class="layui-form-label">鍌ㄤ綅鏍囧織</label> + <div class="layui-input-inline"> + <select name="Flag" id="Flag" lay-filter="getFlag" lay-search > + <option value=""></option> + <option value="0">姝e父</option> + <option value="1">灞忚斀</option> + <option value="2">鎹熷潖</option> + </select> + </div> + </div> + + <!-- --> + <div class="layui-form-item layui-hide"> + <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit" + value="纭娣诲姞"> + <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" + value="纭缂栬緫"> + </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> + var uid = $.cookie('userId'); + if(uid==null){ + alert('璇风櫥褰曞悗鎿嶄綔'); + window.parent.location.href='../Login.html' + } + layui.config({ + base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰� + }).extend({ + index: 'lib/index' //涓诲叆鍙fā鍧� + }).use(['index', 'form', 'layer'], function() { + var $ = layui.$, + form = layui.form, + layer = layui.layer; + + //var no = getQueryString('WareHouseNo'); + GetRoadway(""); + + GetArea(''); + + //鑾峰彇鍖哄煙 + function GetArea(val){ + + var param = { + wareHouseNo: "W01" //绔嬪簱W01 + } + sendData(IP + "/Sys/GetStorageAreaByHouseNo", param, 'get', function(res) { + console.log(res) + if (res.code == 0) { //鎴愬姛 + $("#AreaNo").empty(); + $("#AreaNo").append('<option value =""></option>'); + for (var i = 0; i < res.data.length; i++) { + $("#AreaNo").append('<option value =' + res.data[i].AreaNo + '>' + res.data[i].AreaNo + '-' + + res.data[i].AreaName + '</option>'); + } + $("select[name='AreaNo']").val(val); + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg('鑾峰彇鍖哄煙淇℃伅澶辫触', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + //鍥炶皟 + form.render('select'); + }); + } + }); + } + //鑾峰彇宸烽亾 + function GetRoadway(val){ + sendData(IP + "/Sys/GetStorageRoadwayByHouseNo", {}, 'get', function(res) { + + if (res.code == 0) { //鎴愬姛 + $("#RoadwayNo").empty(); + $("#RoadwayNo").append('<option value =""></option>'); + for (var i = 0; i < res.data.length; i++) { + $("#RoadwayNo").append('<option value =' + res.data[i].RoadwayNo + '>' + res.data[i].RoadwayNo + '-' + + res.data[i].RoadwayName + '</option>'); + } + $("select[name='RoadwayNo']").val(val); + form.render('select'); + } else { //涓嶆垚鍔� + layer.msg('鑾峰彇宸烽亾淇℃伅澶辫触', { + icon: 2, + time: 2000 //2绉掑叧闂紙濡傛灉涓嶉厤缃紝榛樿鏄�3绉掞級 + }, function() { + //鍥炶皟 + form.render('select'); + }); + } + }); + } + + //鑾峰彇娴忚鍣ㄥ弬鏁� + function getQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); + var r = window.location.search.substr(1).match(reg); + if (r != null) return unescape(r[2]); + return null; + } + + }) + </script> + </body> +</html> diff --git a/Wms/Model/ModelVm/SysVm/LocateVm.cs b/Wms/Model/ModelVm/SysVm/LocateVm.cs index de363a7..cfd673b 100644 --- a/Wms/Model/ModelVm/SysVm/LocateVm.cs +++ b/Wms/Model/ModelVm/SysVm/LocateVm.cs @@ -38,12 +38,57 @@ [MaxLength(3)] [Required] public string Flag { get; set; } + /// <summary> /// 瀛樺偍鐜 /// </summary> [MaxLength(3)] public string Temperature { get; set; } + } + + + /// <summary> + /// 淇敼鍌ㄤ綅闆嗗悎model + /// </summary> + public class EditLocateListNewVm + { + /// <summary> + /// 鐘舵�� + /// </summary> + public string Status { get; set; } + /// <summary> + /// 鍌ㄤ綅鏍囧織 + /// </summary> + public string Flag { get; set; } + + /// <summary> + /// 宸烽亾 + /// </summary> + public string RoadWayNo { get; set; } + + /// <summary> + /// 鍖哄煙 + /// </summary> + public string AreaNo { get; set; } + /// <summary> + /// 鎺� + /// </summary> + public int? Row { get; set; } + /// <summary> + /// 鍒� + /// </summary> + public int? Column { get; set; } + /// <summary> + /// 灞� + /// </summary> + public int? Layer { get; set; } + /// <summary> + /// 娣卞害 + /// </summary> + public int? Dept { get; set; } + } + /// <summary> /// 淇敼鍌ㄤ綅model /// </summary> diff --git a/Wms/WMS.BLL/LogServer/OperationSysServer.cs b/Wms/WMS.BLL/LogServer/OperationSysServer.cs index abbf1fa..7d2d0fd 100644 --- a/Wms/WMS.BLL/LogServer/OperationSysServer.cs +++ b/Wms/WMS.BLL/LogServer/OperationSysServer.cs @@ -33,55 +33,148 @@ } - ///// <summary> - ///// 鏌ヨ鎿嶄綔鏃ュ織 - ///// </summary> - ///// <param name="menuName">鑿滃崟鍚嶇О</param> - ///// <param name="type">绫诲瀷</param> - ///// <param name="msg">鍐呭</param> - ///// <param name="startTime">寮�濮嬫棩鏈�</param> - ///// <param name="endTime">缁撴潫鏃ユ湡</param> - ///// <param name="page"></param> - ///// <param name="limit"></param> - ///// <param name="count"></param> - ///// <returns></returns> - //public List<OperationDto> GetOperationSysList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count) - //{ - // try - // { - // Expression<Func<LogOperationSys, bool>> item = Expressionable.Create<LogOperationSys>() - // .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) - // .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) - // .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) - // .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) - // .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(startTime).AddDays(1)) - // .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + /// <summary> + /// 鏌ヨ鎿嶄綔鏃ュ織 + /// </summary> + /// <param name="menuName">鑿滃崟鍚嶇О</param> + /// <param name="type">绫诲瀷</param> + /// <param name="msg">鍐呭</param> + /// <param name="startTime">寮�濮嬫棩鏈�</param> + /// <param name="endTime">缁撴潫鏃ユ湡</param> + /// <param name="page"></param> + /// <param name="limit"></param> + /// <param name="count"></param> + /// <returns></returns> + public List<OperationDto> GetOperationList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count) + { + try + { + var total = 0; + #region asn - // var data = GetAllWhereAsync(item) - // .Includes(x => x.TypeInfo) - // .Includes(x => x.CreateUserInfo) - // .Includes(x => x.UpdateUserInfo).ToList(); - // count = data.Count; - // return data.Select(m => new OperationDto() - // { - // Id = m.Id, - // ParentNo = m.ParentNo, - // MenuNo = m.MenuNo, - // MenuName = m.MenuName, - // FkNo = m.FkNo, - // Type = m.TypeInfo == null ? "" : m.TypeInfo.DictName, - // Msg = m.Msg, - // CreateTime = m.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), - // CreateUserName = m.CreateUserInfo == null ? "" : m.CreateUserInfo.UserName, - // UpdateTime = m.UpdateTime == null ? "" : ((DateTime)m.UpdateTime).ToString("yyyy-MM-dd HH:mm:ss"), - // UpdateUserName = m.UpdateUserInfo == null ? "" : m.UpdateUserInfo.UserName - // }).ToList(); - // } - // catch (Exception e) - // { - // throw new Exception(e.Message); - // } - //} + var item = Expressionable.Create<LogOperationASN>() + .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) + .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) + .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(endTime).AddDays(1)) + .And(it=>it.IsDel == "0") + .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + + var list = Db.Queryable<LogOperationASN>().Where(item) + .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) + .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) + .Select((it, dic, users) => new OperationDto() + { + Id = it.Id, + ParentNo = it.ParentNo, + MenuNo = it.MenuNo, + MenuName = it.MenuName, + FkNo = it.FkNo, + Type = dic.DictName, + Msg = it.Msg, + CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), + CreateUserName = users.RealName, + }); + + #endregion + + #region so + + var item2 = Expressionable.Create<LogOperationSO>() + .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) + .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) + .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(endTime).AddDays(1)) + .And(it => it.IsDel == "0") + .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + + var list2 = Db.Queryable<LogOperationSO>().Where(item2) + .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) + .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) + .Select((it, dic, users) => new OperationDto() + { + Id = it.Id, + ParentNo = it.ParentNo, + MenuNo = it.MenuNo, + MenuName = it.MenuName, + FkNo = it.FkNo, + Type = dic.DictName, + Msg = it.Msg, + CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), + CreateUserName = users.RealName, + }); + + #endregion + + #region cr + + var item3 = Expressionable.Create<LogOperationCR>() + .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) + .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) + .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(endTime).AddDays(1)) + .And(it => it.IsDel == "0") + .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + + var list3 = Db.Queryable<LogOperationCR>().Where(item3) + .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) + .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) + .Select((it, dic, users) => new OperationDto() + { + Id = it.Id, + ParentNo = it.ParentNo, + MenuNo = it.MenuNo, + MenuName = it.MenuName, + FkNo = it.FkNo, + Type = dic.DictName, + Msg = it.Msg, + CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), + CreateUserName = users.RealName, + }); + + #endregion + + #region sys + + var item4 = Expressionable.Create<LogOperationSys>() + .AndIF(!string.IsNullOrWhiteSpace(menuName), it => it.MenuName.Contains(menuName.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(type), it => it.Type == type) + .AndIF(!string.IsNullOrWhiteSpace(msg), it => it.Msg.Contains(msg.Trim())) + .AndIF(!string.IsNullOrWhiteSpace(startTime), it => it.CreateTime >= Convert.ToDateTime(startTime)) + .AndIF(!string.IsNullOrWhiteSpace(endTime), it => it.CreateTime <= Convert.ToDateTime(startTime).AddDays(1)) + .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + + var list4 = Db.Queryable<LogOperationSys>().Where(item4) + .LeftJoin<SysDictionary>((it, dic) => it.Type == dic.Id.ToString()) + .LeftJoin<SysUserInfor>((it, dic, users) => it.CreateUser == users.Id) + .Select((it, dic, users) => new OperationDto() + { + Id = it.Id, + ParentNo = it.ParentNo, + MenuNo = it.MenuNo, + MenuName = it.MenuName, + FkNo = it.FkNo, + Type = dic.DictName, + Msg = it.Msg, + CreateTime = it.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), + CreateUserName = users.RealName, + }); + + #endregion + + var data = Db.UnionAll(list, list2, list3, list4).OrderByDescending(it => it.CreateTime) + .ToOffsetPage(page, limit, ref total); + count = total; + return data.OrderByDescending(m => m.CreateTime).ToList(); + } + catch (Exception e) + { + throw new Exception(e.Message); + } + } /// <summary> /// 娣诲姞鎿嶄綔鏃ュ織 diff --git a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs index e87f209..318052b 100644 --- a/Wms/WMS.BLL/SysServer/StorageLocatServer.cs +++ b/Wms/WMS.BLL/SysServer/StorageLocatServer.cs @@ -2,16 +2,19 @@ using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; +using System.Runtime.Intrinsics.X86; using System.Text; using System.Threading.Tasks; using Model.ModelDto.SysDto; using Model.ModelVm.SysVm; using SqlSugar; +using WMS.BLL.LogServer; using WMS.DAL; using WMS.Entity.BllAsnEntity; using WMS.Entity.Context; using WMS.Entity.DataEntity; using WMS.Entity.SysEntity; +using WMS.IBLL.ILogServer; using WMS.IBLL.ISysServer; using WMS.IDAL.ISysInterface; @@ -298,6 +301,116 @@ throw new Exception(e.Message); } } + public bool EditStorageLocatListNew(EditLocateListNewVm model, int userId) + { + try + { + if (string.IsNullOrWhiteSpace(model.RoadWayNo)) + { + throw new Exception("宸烽亾涓嶈兘涓虹┖"); + } + bool isRow = false; + if (model.Row != null) + { + if (model.Row <= 0) + { + throw new Exception("鎺掗渶瑕佸ぇ浜�0"); + } + isRow = true; + } + bool isColumn = false; + if (model.Column != null) + { + if (model.Column <= 0) + { + throw new Exception("鍒楅渶瑕佸ぇ浜�0"); + } + isColumn = true; + } + bool isLayer = false; + if (model.Layer != null ) + { + if (model.Column <= 0) + { + throw new Exception("灞傞渶瑕佸ぇ浜�0"); + } + isLayer = true; + } + bool isDepth = false; + if (model.Dept != null) + { + if (model.Dept != 1 && model.Dept != 2) + { + throw new Exception("娣卞害鍙兘涓�1鎴�2"); + } + isDepth = true; + } + Expression<Func<SysStorageLocat, bool>> item = Expressionable.Create<SysStorageLocat>() //鍒涘缓琛ㄨ揪寮� + .AndIF(isRow, it => it.Row == model.Row) + .AndIF(isColumn, it => it.Column == model.Column) + .AndIF(isLayer, it => it.Layer == model.Layer) + .AndIF(isDepth, it => it.Depth == "0"+model.Dept) + .AndIF(!string.IsNullOrWhiteSpace(model.RoadWayNo), it => it.RoadwayNo == model.RoadWayNo) + .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏� + var locateList = Db.Queryable<SysStorageLocat>().Where(item).ToList(); + if (locateList.Count == 0) + { + throw new Exception($"鏈煡璇㈠埌鐩稿搴旂殑鍌ㄤ綅淇℃伅"); + } + + var com = new Common(); + var i = 0; + Db.BeginTran(); + foreach (var locate in locateList) + { + if (model.Flag == "2" && locate.Depth == "01")//鏍囪瘑鏄崯鍧忎笖娣卞害鏄�01鏃� 闇�鎶婃繁搴︿负2鐨勫偍浣嶇粰灞忚斀 + { + var locate2 = com.GetLocateNoDepth2(locate.WareHouseNo, locate.LocatNo); + if (locate2.Flag == "0" && !locateList.Contains(locate2)) + { + locate2.Flag = "1"; + locate2.UpdateUser = userId; + locate2.UpdateTime = DateTime.Now; + var m = Db.Updateable(locate2).ExecuteCommand(); + } + + } + if (model.Flag == "0" && locate.Depth == "02")//鏍囪瘑鏄甯镐笖娣卞害鏄�02鏃� 闇�鍒ゆ柇娣卞害涓�1鐨勫偍浣嶇姸鎬佹槸鍚︽甯� + { + var locate1 = com.GetLocateNoDepth1(locate.WareHouseNo, locate.LocatNo); + + if (locate1.Flag == "2") + { + throw new Exception($"闇�鍏堜慨鏀箋locate1.LocatNo}鐨勫偍浣嶆爣璇嗕负涓嶆槸鎹熷潖"); + } + } + + if (!string.IsNullOrEmpty(model.Status)) + { + locate.Status = model.Status; + } + if (!string.IsNullOrEmpty(model.Flag)) + { + locate.Flag = model.Flag; + } + if (!string.IsNullOrEmpty(model.AreaNo)) + { + locate.AreaNo = model.AreaNo; + } + locate.UpdateUser = userId; + locate.UpdateTime = DateTime.Now; + i = Db.Updateable(locate).ExecuteCommand(); + } + Db.CommitTran(); + return i > 0; + + } + catch (Exception e) + { + Db.RollbackTran(); + throw new Exception(e.Message); + } + } /// <summary> /// 鏌ヨ鍌ㄤ綅鐘舵�� diff --git a/Wms/WMS.IBLL/ILogServer/IOperationSysServer.cs b/Wms/WMS.IBLL/ILogServer/IOperationSysServer.cs index 488b4cd..6f73bc6 100644 --- a/Wms/WMS.IBLL/ILogServer/IOperationSysServer.cs +++ b/Wms/WMS.IBLL/ILogServer/IOperationSysServer.cs @@ -10,19 +10,19 @@ { public interface IOperationSysServer { - ///// <summary> - ///// 鏌ヨ鎿嶄綔鏃ュ織 - ///// </summary> - ///// <param name="menuName">鑿滃崟鍚嶇О</param> - ///// <param name="type">绫诲瀷</param> - ///// <param name="msg">鍐呭</param> - ///// <param name="startTime">寮�濮嬫棩鏈�</param> - ///// <param name="endTime">缁撴潫鏃ユ湡</param> - ///// <param name="page"></param> - ///// <param name="limit"></param> - ///// <param name="count"></param> - ///// <returns></returns> - //List<OperationDto> GetOperationSysList(string menuName,string type,string msg,string startTime,string endTime,int page,int limit,out int count); + /// <summary> + /// 鏌ヨ鎿嶄綔鏃ュ織 + /// </summary> + /// <param name="menuName">鑿滃崟鍚嶇О</param> + /// <param name="type">绫诲瀷</param> + /// <param name="msg">鍐呭</param> + /// <param name="startTime">寮�濮嬫棩鏈�</param> + /// <param name="endTime">缁撴潫鏃ユ湡</param> + /// <param name="page"></param> + /// <param name="limit"></param> + /// <param name="count"></param> + /// <returns></returns> + List<OperationDto> GetOperationList(string menuName, string type, string msg, string startTime, string endTime, int page, int limit, out int count); /// <summary> /// 娣诲姞鎿嶄綔鏃ュ織 diff --git a/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs b/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs index fe4f801..177cceb 100644 --- a/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs +++ b/Wms/WMS.IBLL/ISysServer/IStorageLocatServer.cs @@ -81,6 +81,13 @@ /// <param name="userId">鎿嶄綔浜�</param> /// <returns></returns> bool EditStorageLocatList(EditLocateListVm model, int userId); + /// <summary> + /// 鎵归噺淇敼鍌ㄤ綅淇℃伅 鐘舵�併�佹爣璇嗐�佸尯鍩� + /// </summary> + /// <param name="model"></param> + /// <param name="userId"></param> + /// <returns></returns> + bool EditStorageLocatListNew(EditLocateListNewVm model, int userId); /// <summary> /// 鑾峰彇鍌ㄤ綅淇℃伅 diff --git a/Wms/Wms/Controllers/SysController.cs b/Wms/Wms/Controllers/SysController.cs index a77e393..43f7184 100644 --- a/Wms/Wms/Controllers/SysController.cs +++ b/Wms/Wms/Controllers/SysController.cs @@ -21,6 +21,7 @@ using Model.ModelDto; using Model.ModelDto.LogDto; using Newtonsoft.Json.Linq; +using Model.ModelVm.LogVm; namespace Wms.Controllers { @@ -1260,6 +1261,47 @@ return Ok(new { code = 1, msg = "鏁版嵁鏍煎紡閿欒" }); } } + + /// <summary> + /// 淇敼鍌ㄤ綅鐘舵�佹爣璇嗕俊鎭泦鍚� + /// </summary> + /// <param name="model">妯″瀷</param> + /// <returns></returns> + [HttpPost] + public IActionResult EditStorageLocatListNew (EditLocateListNewVm model) + { + 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 = "涓鸿幏鍙栧埌褰撳墠鎿嶄綔浜轰俊鎭�" }); + } + var bolls = _locatSvc.EditStorageLocatListNew(model, int.Parse(userId)); + if (bolls) + { + _operation.InsertOperation("浠撳簱璁剧疆", "鍌ㄤ綅绠$悊", "", "淇敼", $"淇敼宸烽亾锛歿model.RoadWayNo}銆佹帓:{model.Row}銆佸垪:{model.Column}銆佸眰:{model.Layer}銆佹繁搴︼細{model.Dept}鐨勫尯鍩燂細{model.AreaNo}銆佺姸鎬�:{model.Status}銆佹爣璇嗭細{model.Flag}鐨勫偍浣嶄俊鎭� ", Convert.ToInt32(userId)); + + return Ok(new { code = 0, msg = "缂栬緫鎴愬姛", data = "" }); + } + else + { + return Ok(new { code = 1, msg = "缂栬緫澶辫触", data = "" }); + } + + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } + } + #endregion #region 鎵樼洏鏉$爜绠$悊 @@ -2001,7 +2043,30 @@ #endregion + #region 鎿嶄綔鏃ュ織 + /// <summary> + /// 鑾峰彇鎿嶄綔鏃ュ織淇℃伅 + /// </summary> + /// <param name="model"></param> + /// <returns></returns> + [AllowAnonymous] + [HttpPost] + public IActionResult GetLogOperationList(GetOperationVm model) + { + try + { + var bolls = _operation.GetOperationList(model.MenuName, model.Type, model.Msg, model.StartTime, model.EndTime, model.Page, model.Limit, out int count); + + return Ok(new { code = 0, count, msg = "鎿嶄綔鏃ュ織淇℃伅", data = bolls }); + } + catch (Exception e) + { + return Ok(new { code = 1, msg = e.Message }); + } + } + + #endregion #region 鏁版嵁琛ㄦ牸琛ㄥご鑷畾涔�(閫氱敤鏂规硶) /// <summary> -- Gitblit v1.8.0