From 87329193080f2ee0ea68988a29604bbbbb5dabd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Sat, 28 Jan 2023 16:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8E=E6=B8=AFPDA=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E5=8F=8A=E6=9D=A1=E4=BB=B6=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vol.Vue/src/extension/wms/OP_WMS_OUT_PLAN.js | 9 +- .../wms/OP_WMS_OUT_PLANModelBody.vue | 134 ++++++++++++++- Vol.Vue/src/views/wms/OP_WMS_OUT_PLAN.vue | 2 +- .../Controllers/Basic/ApiBaseController.cs | 2 +- .../DomainModels/WMS/Vw_Op_Wms_Physics.cs | 22 ++- .../DomainModels/WMSOUT/OP_WMS_OUT_PLAN.cs | 8 +- .../WMS/Partial/IOp_Wms_LogicService.cs | 3 + .../Services/WMS/Op_Wms_LogicService.cs | 10 ++ .../WMS/Partial/Op_Wms_LogicService.cs | 33 +++- .../WMSOUT/Partial/OP_WMS_OUT_PLANService.cs | 157 +++++++++++++++++- .../Partial/OP_WMS_OUT_PLAN_DETAILService.cs | 2 +- .../WMS/Partial/Op_Wms_LogicController.cs | 8 + .../Partial/VW_OP_WMS_IN_PLANController.cs | 79 +++++++++ 13 files changed, 447 insertions(+), 22 deletions(-) diff --git a/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLAN.js b/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLAN.js index b2f53387..b55e3c9b 100644 --- a/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLAN.js +++ b/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLAN.js @@ -353,6 +353,7 @@ let extension = { this.$refs.modelBody.$refs.table1.reset(); this.$refs.modelBody.$refs.table2.reset(); this.$refs.modelBody.$refs.tab_truck.reset(); + this.$refs.modelBody.$refs.tab_condition.reset(); this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.reset(); } else { @@ -360,6 +361,7 @@ let extension = { this.$refs.modelBody.$refs.table1.load(); this.$refs.modelBody.$refs.table2.reset(); this.$refs.modelBody.$refs.tab_truck.load(); + this.$refs.modelBody.$refs.tab_condition.load(); this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.load(); @@ -379,12 +381,14 @@ let extension = { return true; }, setFormData(formData) { + console.log('条件数据',this.$refs.modelBody.$refs.tab_condition.rowData) //新建或编辑时,将从表1、2的数据提交到后台 //后台从对象里直接取extra的值 let extra = { table1List: this.$refs.modelBody.$refs.table1.rowData, table3List: this.$refs.modelBody.$refs.tab_truck.rowData, - table4List: this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.rowData + table4List: this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.rowData, + table6List: this.$refs.modelBody.$refs.tab_condition.rowData, } formData.extra = JSON.stringify(extra); @@ -425,6 +429,7 @@ let extension = { this.$refs.modelBody.$refs.table1.load(); //this.$refs.modelBody.$refs.table2.load(); this.$refs.modelBody.$refs.tab_truck.load(); + this.$refs.modelBody.$refs.tab_condition.load(); this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.load(); formData.mainData.MBLNO = this._mblno; @@ -435,6 +440,7 @@ let extension = { this.$refs.modelBody.$refs.table1.load(); //this.$refs.modelBody.$refs.table2.load(); this.$refs.modelBody.$refs.tab_truck.load(); + this.$refs.modelBody.$refs.tab_condition.load(); this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.load(); return true; }, @@ -575,6 +581,7 @@ let extension = { this.$refs.modelBody.$refs.table1.load(); this.$refs.modelBody.$refs.tab_chfee.$refs.tab_chfee.load(); this.$refs.modelBody.$refs.tab_truckinfo.$refs.tab_truckinfo.load(); + this.$refs.modelBody.$refs.tab_condition.$refs.tab_condition.load(); this.$refs.modelBody.$refs.tab_infofiles.$refs.tab_infofiles.load(); return true; diff --git a/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLANModelBody.vue b/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLANModelBody.vue index c43178c6..81b87cb2 100644 --- a/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLANModelBody.vue +++ b/Vol.Vue/src/extension/wms/OP_WMS_OUT_PLANModelBody.vue @@ -58,7 +58,7 @@ @loadAfter="loadTableAfter1" > -
+
@@ -153,7 +153,7 @@
+ + + +
+ + +
+ + + + +
+
+ +
@@ -554,7 +579,19 @@ export default { {field:'IMGPATH',title:this.$t('Img')+this.$t('Path'),type:'img',width:220,align:'left'} ] - ,loadKey: true + // 出库条件 + ,tab_conditionUrl: "api/Op_Wms_Logic/GetPageData", //GetPageData + //表配置的字段注意要与后台返回的查询字段大小写一致 + tableColumns4: [ + {field:'WMSLOGICID',title:'GID',type:'guid',width:90,hidden:true,readonly:true,require:true,align:'left'}, + // {field:'WMSPLANID',title:'WMSPLANID',type:'guid',width:90,hidden:true,align:'left'}, + { field: "VALUE", title: '条件', type: "text", width: 120,bind:{ key:'ConditionStock',data:[]}, edit: { type: "select", keep: true }, hidden: false,sort:true //keep:true始终开启编辑,false双击才能编辑 + }, + { field: "VALUE2", title: '值', type: "text", width: 120, edit: { type: "text", keep: true }, hidden: false,sort:true//keep:true始终开启编辑,false双击才能编辑 + }, + // {field:'truckteam',title:'车队',type: "text", edit: { type: "text", keep: true },width:90,align:'left',sortable:true}, + + ],loadKey: true ,isFEST:false ,CNTRNOList:[] ,PRINTINFOList: [], //打印格式列表 @@ -571,12 +608,14 @@ export default { }, GoodsModelShow:{}, options:[], + conditionList:[], // isBatchStock:false }; }, created() { this.getCustName(); + // this.getConditionList(); //this.searchField_planlist.PLANTIME window.Bodyhead = this; window.Listhead = this.$store.getters.data().outplan_parent_head; @@ -617,6 +656,9 @@ export default { if(x.label=="费用"){ x.disabled=true; } + // if(x.label=="出库条件" && !isBatchStock){ + // x.disabled=true; + // } } }); @@ -734,7 +776,27 @@ export default { param.wheres.push({ Name:"WMSPLANID",Value:headid,displayType:'='}); }, + loadTableBefore_tab_condition(param, callBack) { + let _this=this.$store.getters.data().outplan_parent_head; + if (_this.currentAction == "Add") { + return callBack(false); + } + param.wheres=[]; + let headid =this.getheadid() + param.wheres.push({ Name:"PID",Value:headid,displayType:'='}); + }, + loadTableAfter_tab_condition(data, callBack) { + // if(this.isFEST){ + + // let trucklist=[]; + // data.forEach((x)=>{ + // trucklist.push({key:x.TRUCKNO,value:x.TRUCKNO}); + // }) + // this.$refs.tab_infofiles.setTruckinfo(trucklist); + // } + return true; + }, //从后台加载从表数据后 loadTableAfter1(data, callBack) { this.getphysics(data); @@ -785,7 +847,7 @@ export default { setFormData(formData){ let extra = { table1List: this.$refs.table1.rowData, - tab_truckList: this.$refs.tab_truck.rowData + tab_truckList: this.$refs.tab_truck.rowData, } formData.extra = JSON.stringify(extra); return formData; @@ -1096,6 +1158,70 @@ export default { this.CustomerList=selectCustName.data; } }, + getConditionList() { + + if(this.conditionList.length==0){ + + let selectCondition= this.getOption("ConditionStock"); + this.conditionList=selectCondition.data; + } + }, + addcondition(){ + // let _headform=this.$store.getters.data().inplan_head; + // let editFormFields = _headform.geteditformfield(); + this.$refs.tab_condition.addRow({WMSLOGICID:'00000000-0000-0000-0000-000000000000',WMSID:'00000000-0000-0000-0000-000000000000',NAME:'批量出库条件',VALUE:'',PID:this.getheadid() + ,VALUE2:'' + ,VALUE3:'' + }); + }, + delcondition() { + let _this=this; + if(!this.check()) + return; + let rows = this.$refs.tab_condition.getSelected(); + if (rows.length == 0) { + return this.$Message.error(this.$t('MSG.PleaseSelectRow')); + } + let delKeys = rows.map(x => { + return x['WMSLOGICID']; + }); + let headid = this.getheadid(); + let formData = { + mainData: {PID:headid}, + detailData: null, + delKeys: delKeys, + workKeys: null, + extra:null + }; + let tigger = false; + let delmsg = this.$t('MSG.DeleteAlertConfirm'); + this.$Modal.confirm({ + title: this.$t('MSG.DeleteAlert'), + content: + '

'+delmsg+'?

', + onOk: () => { + if (tigger) return; + tigger = true; + + + //如果是新建功能,禁止从后台查询 + if (_this.currentAction == "Add") { + // this.$refs.table1.reset(); + _this.$refs.tab_condition.delRow(rows); + }else{ + + let url = "api/Op_Wms_Logic/DelDetail"; + this.http.post(url, formData, this.$t('MSG.DeleteingData')).then(x => { + if (!x.status) return this.$Message.error(x.message); + tigger = false; + _this.$refs.tab_condition.delRow(rows); + + //this.refresh(); + }); + } + } //, onCancel: () => {} + }); + }, getphysics(datalist){ // let rows= this.$refs.table1.rowData; // let workKeys = rows.map(x => { diff --git a/Vol.Vue/src/views/wms/OP_WMS_OUT_PLAN.vue b/Vol.Vue/src/views/wms/OP_WMS_OUT_PLAN.vue index 4d1720a4..bd8d1236 100644 --- a/Vol.Vue/src/views/wms/OP_WMS_OUT_PLAN.vue +++ b/Vol.Vue/src/views/wms/OP_WMS_OUT_PLAN.vue @@ -84,7 +84,7 @@ ,{"title":"BILLTYPE","field":"BILLTYPE","type":"text","hidden":true} ] - ,[{"title":"是否批次出库","field":"ISBATCHSTOCK","type":"switch"}] + ,[{"title":"是否条件出库","field":"ISBATCHSTOCK","type":"switch"}] ], searchFormFields: {"PLANTIME":"","CUSTOMERNAME":"","CORPID":"","CUSTOMNO":""}, searchFormOptions: [ diff --git a/Vue.Net/VOL.Core/Controllers/Basic/ApiBaseController.cs b/Vue.Net/VOL.Core/Controllers/Basic/ApiBaseController.cs index 29fc73e7..aab71b52 100644 --- a/Vue.Net/VOL.Core/Controllers/Basic/ApiBaseController.cs +++ b/Vue.Net/VOL.Core/Controllers/Basic/ApiBaseController.cs @@ -95,7 +95,7 @@ public virtual ActionResult GetPageData([FromBody] PageDataOptions loadData) { return Json(InvokeService("Upload", new object[] { files })); } - + [HttpPost, Route("CommonUpload"), AllowAnonymous] public virtual IActionResult CommonUpload(IEnumerable file) diff --git a/Vue.Net/VOL.Entity/DomainModels/WMS/Vw_Op_Wms_Physics.cs b/Vue.Net/VOL.Entity/DomainModels/WMS/Vw_Op_Wms_Physics.cs index 3f36727c..7d598ca5 100644 --- a/Vue.Net/VOL.Entity/DomainModels/WMS/Vw_Op_Wms_Physics.cs +++ b/Vue.Net/VOL.Entity/DomainModels/WMS/Vw_Op_Wms_Physics.cs @@ -257,6 +257,26 @@ namespace VOL.Entity.DomainModels [Column(TypeName="varchar(50)")] public string ARCLIENTWMSOUT { get; set; } - + /// + /// 原箱号 + /// + public string OLD_CNTRNO { get; set; } + /// + /// 品牌 + /// + public string GOODSMODEL { get; set; } + /// + /// 幅宽/规格 + /// + public string GOODSMODEL2 { get; set; } + /// + /// 克重 + /// + public string GOODSMODEL3 { get; set; } + /// + /// 合同号 + /// + public string GOODSMODEL4 { get; set; } + } } \ No newline at end of file diff --git a/Vue.Net/VOL.Entity/DomainModels/WMSOUT/OP_WMS_OUT_PLAN.cs b/Vue.Net/VOL.Entity/DomainModels/WMSOUT/OP_WMS_OUT_PLAN.cs index 4b2c0060..db547f21 100644 --- a/Vue.Net/VOL.Entity/DomainModels/WMSOUT/OP_WMS_OUT_PLAN.cs +++ b/Vue.Net/VOL.Entity/DomainModels/WMSOUT/OP_WMS_OUT_PLAN.cs @@ -315,13 +315,11 @@ namespace VOL.Entity.DomainModels public bool? ISSPENUM { get; set; } /// - ///是否批次出库 + ///是否条件出库 /// - [Display(Name = "是否批次出库")] + [Display(Name = "是否条件出库")] [Column(TypeName = "bit")] [Editable(true)] - public bool ISBATCHSTOCK { get; set; } = false; - - + public bool? ISBATCHSTOCK { get; set; } } } diff --git a/Vue.Net/VOL.WMS/IServices/WMS/Partial/IOp_Wms_LogicService.cs b/Vue.Net/VOL.WMS/IServices/WMS/Partial/IOp_Wms_LogicService.cs index 061bd134..1167a63e 100644 --- a/Vue.Net/VOL.WMS/IServices/WMS/Partial/IOp_Wms_LogicService.cs +++ b/Vue.Net/VOL.WMS/IServices/WMS/Partial/IOp_Wms_LogicService.cs @@ -6,6 +6,7 @@ using VOL.Entity.DomainModels; using VOL.Core.Utilities; using System.Linq.Expressions; using System; +using System.Threading.Tasks; namespace VOL.WMS.IServices { @@ -24,6 +25,8 @@ namespace VOL.WMS.IServices public WebResponseContent 建立客户订单项(Guid PID, Guid WMSID, string Value); + public WebResponseContent GetConditionList(PageDataOptions options); + public bool 有加班(Guid PID); diff --git a/Vue.Net/VOL.WMS/Services/WMS/Op_Wms_LogicService.cs b/Vue.Net/VOL.WMS/Services/WMS/Op_Wms_LogicService.cs index 301ed86e..4f65754e 100644 --- a/Vue.Net/VOL.WMS/Services/WMS/Op_Wms_LogicService.cs +++ b/Vue.Net/VOL.WMS/Services/WMS/Op_Wms_LogicService.cs @@ -9,6 +9,15 @@ using VOL.WMS.IServices; using VOL.Core.BaseProvider; using VOL.Core.Extensions.AutofacManager; using VOL.Entity.DomainModels; +using System; +using VOL.Core.Utilities; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using VOL.WMS.Repositories; +using System.Linq; +using ConvertHelper; +using System.Collections.Generic; +using static VOL.Entity.DomainModels.OP_WMS_TRUCK; +using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; namespace VOL.WMS.Services { @@ -23,5 +32,6 @@ namespace VOL.WMS.Services { get { return AutofacContainerModule.GetService(); } } + } } diff --git a/Vue.Net/VOL.WMS/Services/WMS/Partial/Op_Wms_LogicService.cs b/Vue.Net/VOL.WMS/Services/WMS/Partial/Op_Wms_LogicService.cs index 11cf0623..12bdc274 100644 --- a/Vue.Net/VOL.WMS/Services/WMS/Partial/Op_Wms_LogicService.cs +++ b/Vue.Net/VOL.WMS/Services/WMS/Partial/Op_Wms_LogicService.cs @@ -28,10 +28,41 @@ namespace VOL.WMS.Services public override PageGridData GetPageData(PageDataOptions options) { + QueryRelativeExpression = (IQueryable queryable) => + { + //如果该用户被限制于本公司 则必须 + + #region 查询 + var PID = string.Empty; + var searchParametersList = options.Wheres.DeserializeObject>(); + if (searchParametersList.Exists(x => x.Name == "PID")) + { + PID = searchParametersList.First(x => x.Name == "PID").Value; + queryable = queryable.Where(x => x.PID == Guid.Parse(PID) && x.NAME == "批量出库条件"); + + } + #endregion + return queryable; + }; + + var _r = base.GetPageData(options); return _r; } + + public WebResponseContent GetConditionList(PageDataOptions options) + { + var res = new WebResponseContent(); + + var searchParametersList = options.Wheres.DeserializeObject>(); + var PID = Guid.Parse(searchParametersList.First(x => x.Name == "PID").Value); + var data = Op_Wms_LogicRepository.Instance.FindAsIQueryable(x => x.PID == PID && x.NAME == "批量出库条件").ToList(); + + + res.OK("获取数据成功", data); + return res; + } public WebResponseContent DelDetail(SaveModel saveModel) { var canchange = BaseCheck.CanChange(saveModel); @@ -72,7 +103,7 @@ namespace VOL.WMS.Services //如果没有 新增一条 - if (string.IsNullOrWhiteSpace(saveModel.getMainDataValueStr("WMSLOGICID"))) + if (string.IsNullOrWhiteSpace(saveModel.getMainDataValueStr(" "))) { var newrec = new Op_Wms_Logic(); newrec.WMSLOGICID = new Guid(); diff --git a/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLANService.cs b/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLANService.cs index e740c9cc..3f5b12fc 100644 --- a/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLANService.cs +++ b/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLANService.cs @@ -28,6 +28,8 @@ using VOL.Core.Services; using ConvertHelper; using static VOL.Entity.DomainModels.OP_WMS_TRUCK; using VOL.Core.Configuration; +using FastReport.Editor; +using System.Windows.Forms; namespace VOL.WMS.Services { @@ -256,6 +258,10 @@ namespace VOL.WMS.Services public List Table4List { get; set; } public List Table5List { get; set; } + /// + /// 出库条件 + /// + public List Table6List { get; set; } } @@ -444,6 +450,83 @@ namespace VOL.WMS.Services if (!_r.Status) return _r; } + List ConditionList = tableExtra.Table6List; + if (!ConditionList.isNullorEmpty()) + { + var dealedconditionlist = new List>(); + dealedconditionlist = DealBodyList(head.WMSPLANID, ConditionList, "OP_WMS_OUT_PLAN"); + //var _r = AddTruckFile(saveDataModel, dealedbodylist2[0], dealedbodylist2[1], FileList, head); + + //if (!_r.Status) return _r; + Op_Wms_LogicRepository.Instance.AddRange(dealedconditionlist[0]); + Op_Wms_LogicRepository.Instance.UpdateRange(dealedconditionlist[1]); + Op_Wms_LogicRepository.Instance.SaveChanges(); + #region 产生条件出库范围 + + var 物理库存List = Vw_Op_Wms_PhysicsRepository.Instance.FindAsIQueryable(x => (x.KGS > 0 || x.CBM > 0 || x.PKGS > 0 || x.STORAGEUNITCOUNT > 0)).ToList(); + + foreach (var item in ConditionList) + { + if (item.VALUE == "MBLNO") + { + 物理库存List = 物理库存List.Where(x => x.MBLNO == item.VALUE2).ToList(); + } + if (item.VALUE == "GOODSMODEL") + { + 物理库存List = 物理库存List.Where(x => x.GOODSMODEL == item.VALUE2).ToList(); + } + if (item.VALUE == "GOODSMODEL2") + { + 物理库存List = 物理库存List.Where(x => x.GOODSMODEL2 == item.VALUE2).ToList(); + } + if (item.VALUE == "GOODSMODEL3") + { + 物理库存List = 物理库存List.Where(x => x.GOODSMODEL3 == item.VALUE2).ToList(); + } + if (item.VALUE == "GOODSMODEL4") + { + 物理库存List = 物理库存List.Where(x => x.GOODSMODEL4 == item.VALUE2).ToList(); + } + if (item.VALUE == "OLD_CNTRNO") + { + 物理库存List = 物理库存List.Where(x => x.OLD_CNTRNO == item.VALUE2).ToList(); + } + if (item.VALUE == "CUSTOMERNAME") + { + 物理库存List = 物理库存List.Where(x => x.CUSTOMERNAME == item.VALUE2).ToList(); + } + if (item.VALUE == "GOODSOWNER") + { + 物理库存List = 物理库存List.Where(x => x.GOODSOWNER == item.VALUE2).ToList(); + } + } + + //找到目前出库计划里已有的计划明细 + + var batchList = Op_Wms_LogicRepository.Instance.FindAsIQueryable(x => x.PID == head.WMSPLANID && x.NAME == "批量出库范围").ToList(); + + foreach (var item in 物理库存List) + { + if (batchList.Where(x => batchList.Select(s => Guid.Parse(s.VALUE)).Contains(item.WMSPHYSICSID)).Count() > 0) continue; + + + var logic = new Op_Wms_Logic() + { + WMSLOGICID = new Guid(), + WMSID = item.WMSID, + PID = head.WMSPLANID, + VALUE = item.WMSPHYSICSID.ToString(), + NAME = "批量出库范围" + }; + Op_Wms_LogicRepository.Instance.Add(logic); + } + + Op_Wms_LogicRepository.Instance.SaveChanges(); + + #endregion + } + + Logger.ADD_PUB("出库通知", head, saveDataModel.Extra.ToString()); return WebResponseContent.Instance.OK(); @@ -509,14 +592,14 @@ namespace VOL.WMS.Services LockList.Remove(headid); return _webResponse; } - //取值 是否批次出库 + //取值 是否条件出库 var isBatchStock = saveModel.getMainDataValueStr("ISBATCHSTOCK") == "1" ? true : false; var outplan = OP_WMS_OUT_PLANRepository.Instance.FindFirst(x => x.WMSPLANID ==Guid.Parse(headid)); if (outplan.ISBATCHSTOCK != isBatchStock) { LockList.Remove(headid); - return _webResponse.Error("批量出库标识不一致,请恢复"); + return _webResponse.Error("条件出库标识不一致,请恢复"); } //取出校验完成后的从表1.2的数据 @@ -616,6 +699,63 @@ namespace VOL.WMS.Services if (!_r.Status) return _r; } + List ConditionList = tableExtra.Table6List; + if (!ConditionList.isNullorEmpty()) + { + var dealedconditionlist = new List>(); + dealedconditionlist = DealBodyList(head.WMSPLANID, ConditionList, "OP_WMS_OUT_PLAN"); + //var _r = AddTruckFile(saveDataModel, dealedbodylist2[0], dealedbodylist2[1], FileList, head); + + //if (!_r.Status) return _r; + Op_Wms_LogicRepository.Instance.AddRange(dealedconditionlist[0]); + Op_Wms_LogicRepository.Instance.UpdateRange(dealedconditionlist[1]); + Op_Wms_LogicRepository.Instance.SaveChanges(); + #region 产生条件出库范围 + + var 物理库存List = Vw_Op_Wms_PhysicsRepository.Instance.FindAsIQueryable(x => (x.KGS > 0 || x.CBM > 0 || x.PKGS > 0 || x.STORAGEUNITCOUNT > 0)).ToList(); + + foreach (var item in ConditionList) + { + if (item.VALUE == "MBLNO") + { + 物理库存List = 物理库存List.Where(x => x.MBLNO == item.VALUE2).ToList(); + } + } + + //找到目前出库计划里已有的计划明细 + + //var batchList = Op_Wms_LogicRepository.Instance.FindAsIQueryable(x => x.PID == head.WMSPLANID && x.NAME == "批量出库范围").ToList(); + + string sql = $"DELETE FROM Op_Wms_Logic where PID ='{head.WMSPLANID}' AND NAME ='批量出库范围';"; + + Op_Wms_LogicRepository.Instance.ExecuteSqlCommand(sql); + + //foreach (var item in batchList) + //{ + // Op_Wms_LogicRepository.Instance.Delete(item); + //} + //Op_Wms_LogicRepository.Instance.SaveChanges(); + + foreach (var item in 物理库存List) + { + //if (batchList.Where(x => batchList.Select(s => Guid.Parse(s.VALUE)).Contains(item.WMSPHYSICSID)).Count() > 0) continue; + + + var logic = new Op_Wms_Logic() + { + WMSLOGICID = new Guid(), + WMSID = item.WMSID, + PID = head.WMSPLANID, + VALUE = item.WMSPHYSICSID.ToString(), + NAME = "批量出库范围" + }; + Op_Wms_LogicRepository.Instance.Add(logic); + } + + Op_Wms_LogicRepository.Instance.SaveChanges(); + + #endregion + } Logger.ADD_PUB("出库通知", head, saveModel.Extra.ToString()); return WebResponseContent.Instance.OK(); @@ -693,6 +833,9 @@ namespace VOL.WMS.Services return _webResponse.OK("保存成功"); } + + + public WebResponseContent GetNewOutPlan() { var result = new OP_WMS_OUT_PLAN(); @@ -1210,7 +1353,7 @@ namespace VOL.WMS.Services { keys[i] = outplangoods_list[i].WMSOUTDETAILID.ToString(); } - //只有正常业务才产生出库明细 批次出库不用产生 + //只有正常业务才产生出库明细 条件出库不用产生 if (!(bool)head.ISBATCHSTOCK) { List outdogoods_list = VW_OP_WMS_OUT_DO_GOODSRepository.Instance.FindAsIQueryable(x => x.WMSPLANDETAILID == new Guid(keys[0])).ToList(); @@ -1481,7 +1624,7 @@ namespace VOL.WMS.Services if (outplan != null && outplan.ISBATCHSTOCK != isBatchStock) { - return _webResponse.Error("批量出库标识不一致,请恢复"); + return _webResponse.Error("条件出库标识不一致,请恢复"); } if (!isBatchStock) //原有业务逻辑 @@ -1575,9 +1718,9 @@ namespace VOL.WMS.Services } else { - // 批次出库逻辑 + // 条件出库逻辑 //找到目前出库计划里已有的计划明细 - + var batchList = Op_Wms_LogicRepository.Instance.FindAsIQueryable(x => x.PID == wmsplanid).ToList(); foreach (var item in 物理库存List) @@ -1884,7 +2027,7 @@ namespace VOL.WMS.Services else if (ctninfo.Count > 0) { - //只有正常业务才产生出库明细 批次出库不用产生 + //只有正常业务才产生出库明细 条件出库不用产生 if (!(bool)head.ISBATCHSTOCK) { MakeOutDoDetail(head, ctninfo, newoutdo.WMSDOID); diff --git a/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLAN_DETAILService.cs b/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLAN_DETAILService.cs index 3be9306b..9eda3632 100644 --- a/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLAN_DETAILService.cs +++ b/Vue.Net/VOL.WMS/Services/WMSOUT/Partial/OP_WMS_OUT_PLAN_DETAILService.cs @@ -41,7 +41,7 @@ namespace VOL.WMS.Services if (outplan != null && outplan.ISBATCHSTOCK != isBatchStock) { - return _webResponse.Error("批量出库标识不一致,请恢复"); + return _webResponse.Error("条件出库标识不一致,请恢复"); } if (!isBatchStock)//原有业务逻辑 diff --git a/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/Op_Wms_LogicController.cs b/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/Op_Wms_LogicController.cs index 0db8236c..b3370a77 100644 --- a/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/Op_Wms_LogicController.cs +++ b/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/Op_Wms_LogicController.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using VOL.Core.Enums; using VOL.Core.Filters; +using VOL.Core.Utilities; using VOL.Entity.DomainModels; namespace VOL.WMS.Controllers @@ -20,5 +21,12 @@ namespace VOL.WMS.Controllers { return Json( Service.SaveLogicList(saveModel)); } + + [Route("GetConditionList"), HttpPost, ApiActionPermission()] + + public IActionResult GetConditionList([FromBody] PageDataOptions options) + { + return Json(Service.GetConditionList(options)); + } } } diff --git a/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/VW_OP_WMS_IN_PLANController.cs b/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/VW_OP_WMS_IN_PLANController.cs index 2eb0cde1..16c719ec 100644 --- a/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/VW_OP_WMS_IN_PLANController.cs +++ b/Vue.Net/VOL.WebApi/Controllers/WMS/Partial/VW_OP_WMS_IN_PLANController.cs @@ -3,15 +3,94 @@ *如果接口需要做Action的权限验证,请在Action上使用属性 *如: [ApiActionPermission("VW_OP_WMS_IN_PLAN",Enums.ActionPermissionOptions.Search)] */ +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using System; using System.Collections.Generic; +using System.IO; +using System.Linq; using System.Threading.Tasks; +using VOL.Core.Extensions; +using VOL.Core.Utilities; using VOL.Entity.DomainModels; +using VOL.WMS.Repositories; namespace VOL.WMS.Controllers { public partial class VW_OP_WMS_IN_PLANController { + /// + /// 默认上传文件大小限制3M + /// + protected int LimitUpFileSizee { get; set; } = 5; + /// + /// 上传文件-华港 + /// + /// + /// + [HttpPost, Route("UploadHGTY"), AllowAnonymous] + public WebResponseContent UploadHGTY(List files) + { + WebResponseContent webResponseContent = WebResponseContent.Instance; + if (files == null || files.Count == 0) return webResponseContent.Error("请上传文件"); + + //跟前端的控件名称保持一致 + var WMSDOID = Request.Form["WMSDOID"]; + + var limitFiles = files.Where(x => x.Length > LimitUpFileSizee * 1024 * 1024).Select(s => s.FileName); + if (limitFiles.Count() > 0) + { + return webResponseContent.Error($"文件大小不能超过:{LimitUpFileSizee}M,{string.Join(",", limitFiles)}"); + } + string filePath = $"Upload/Tables/INFO_FILES/{DateTime.Now.ToString("yyyMMddHHmmsss") + new Random().Next(1000, 9999)}/"; + string fullPath = filePath.MapPath(true); + int i = 0; + // List fileNames = new List(); + try + { + if (!Directory.Exists(fullPath)) Directory.CreateDirectory(fullPath); + for (i = 0; i < files.Count; i++) + { + string fileName = files[i].FileName; + //if (fileNames.Contains(fileName)) + //{ + // fileName += $"({i}){fileName}"; + //} + //fileNames.Add(fileName); + using (var stream = new FileStream(fullPath + fileName, FileMode.Create)) + { + files[i].CopyTo(stream); + } + + var infoFile = new INFO_FILES() + { + GID = Guid.NewGuid(), + CNTRNO = "", + PID = Guid.Parse(WMSDOID), + FILENAME = fileName, + IMGPATH = filePath + fileName, + FILETYPE = "入库执行单", + PWORKTYPE = "入库执行", + CORPID = "", + ModifyDate = DateTime.Now, + CreateDate = DateTime.Now, + UPLOADEMPLY = "PDA", + }; + INFO_FILESRepository.Instance.Add(infoFile); + } + + + //最终保存 + INFO_FILESRepository.Instance.SaveChanges(); + + return webResponseContent.OK("文件上传成功"); + } + catch (Exception ex) + { + return webResponseContent.Error("文件上传失败"); + } + + } } }