已删除16个文件
已修改7个文件
已重命名52个文件
已添加16个文件
| | |
| | | EndProject |
| | | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-åå
æµè¯", "05-åå
æµè¯", "{CF29B377-FE5A-488A-AF99-DF9D9C6FCA95}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiger.Business.MES", "Tiger.Business.MES\Tiger.Business.MES.csproj", "{3848BCAB-4E77-4D5E-8BF0-2A747981C1B4}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tiger.Business.MES", "Tiger.Business.MES\Tiger.Business.MES.csproj", "{3848BCAB-4E77-4D5E-8BF0-2A747981C1B4}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiger.Business.MengQi", "Tiger.Business.MengQi\Tiger.Business.MengQi.csproj", "{DD5B5282-B673-45CB-8608-3AAEB4A469B9}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tiger.Business.MengQi", "Tiger.Business.MengQi\Tiger.Business.MengQi.csproj", "{DD5B5282-B673-45CB-8608-3AAEB4A469B9}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tiger.Business.WMS", "Tiger.Business.WMS\Tiger.Business.WMS.csproj", "{83F123C4-3E7A-485E-A99C-3FE66CA5867E}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | |
| | | {DD5B5282-B673-45CB-8608-3AAEB4A469B9}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {DD5B5282-B673-45CB-8608-3AAEB4A469B9}.Release|x86.ActiveCfg = Release|Any CPU |
| | | {DD5B5282-B673-45CB-8608-3AAEB4A469B9}.Release|x86.Build.0 = Release|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Debug|Any CPU.Build.0 = Debug|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Debug|x86.ActiveCfg = Debug|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Debug|x86.Build.0 = Debug|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|Any CPU.ActiveCfg = Release|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|Any CPU.Build.0 = Release|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|x86.ActiveCfg = Release|Any CPU |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E}.Release|x86.Build.0 = Release|Any CPU |
| | | EndGlobalSection |
| | | GlobalSection(SolutionProperties) = preSolution |
| | | HideSolutionNode = FALSE |
| | |
| | | {60FA322B-9B03-4380-803C-63B1F240E453} = {70881CAB-17ED-4C46-895A-62F2CE39A607} |
| | | {3848BCAB-4E77-4D5E-8BF0-2A747981C1B4} = {70881CAB-17ED-4C46-895A-62F2CE39A607} |
| | | {DD5B5282-B673-45CB-8608-3AAEB4A469B9} = {70881CAB-17ED-4C46-895A-62F2CE39A607} |
| | | {83F123C4-3E7A-485E-A99C-3FE66CA5867E} = {70881CAB-17ED-4C46-895A-62F2CE39A607} |
| | | EndGlobalSection |
| | | GlobalSection(ExtensibilityGlobals) = postSolution |
| | | SolutionGuid = {797A1D83-9F3C-4AEC-8A83-E3468102DBD1} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Rhea.Common; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// æ´æ°é¢æåç¶æ |
| | | /// </summary> |
| | | public partial class AGV |
| | | { |
| | | public ApiAction UpdateStatus(AgvMRUpdateInput input) |
| | | { |
| | | ApiAction response = new(); |
| | | try |
| | | { |
| | | DbClient db = Biz.DataSource["WMS57"].Client; |
| | | BIZ_ERP_PROD_OUT entity = new BIZ_ERP_PROD_OUT(); |
| | | BIZ_ERP_PROD_OUT entity_x = db.Queryable<BIZ_ERP_PROD_OUT>().Where(x => x.SOURCECODE.Contains(input.taskId)).First(); |
| | | |
| | | if (entity_x != null) |
| | | { |
| | | entity = entity_x; |
| | | } |
| | | else |
| | | { |
| | | response.IsSuccessed = false; |
| | | response.Message = $"ä»»å¡ID[{input.taskId}]å¨é¢æå䏿¥ä¸å°è®°å½"; |
| | | return response; |
| | | } |
| | | entity.STATUS = BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue(); |
| | | entity.ERP_BILL_CODE = "æå·¥è¿è´¦"; |
| | | |
| | | //ä¿åæ°æ®åº |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(entity).UpdateColumns(x => new { x.STATUS, x.ERP_BILL_CODE }).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | response.GetResponse().CatchExceptionWithLog(dbTran.ErrorException); |
| | | } |
| | | response.Message = $"颿å[{entity.BILLCODE}]æ´æ°ç¶ææåï¼agv坿¸
é¤"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | response.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | return response; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Rhea.Common; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.Design; |
| | | using System.Linq; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class AGV : IAGV |
| | | { |
| | | /// <summary> |
| | | /// AGVæ¥å£URL |
| | | /// </summary> |
| | | public static string agvurl { get; set; } = @$"{Biz.SysParamOld["agvUrl", "AgvApiAddress"].PARAM_VALUE}"; //@"http://10.12.16.249:10007/rcs/order/"; |
| | | |
| | | /// <summary> |
| | | /// 夿宿éç¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public AgvActionResult materialPreparation(AgvMPInput input) |
| | | { |
| | | AgvActionResult result = new AgvActionResult(); |
| | | Work.DoAsync |
| | | (() => |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(input); |
| | | var response = HttpHelper.PostAsync(agvurl + "materialPreparation", requestJson).Result; |
| | | var result1 = JsonConvert.DeserializeObject<AgvActionResult>(response.Message); |
| | | Logger.Interface.Info("AGVè¿åï¼" + response.Message); |
| | | }); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | public AgvActionResult materialPreparation(AgvMPInput input, string agvApi) |
| | | { |
| | | AgvActionResult result = new AgvActionResult(); |
| | | Work.DoAsync |
| | | (() => |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(input); |
| | | var response = HttpHelper.PostAsync(agvApi + "materialPreparation", requestJson).Result; |
| | | var result1 = JsonConvert.DeserializeObject<AgvActionResult>(response.Message); |
| | | Logger.Interface.Info("AGVè¿åï¼" + response.Message); |
| | | }); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¾è¡ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public AgvActionResultBase carPass(AgvMPInput input) |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(input); |
| | | var response = HttpHelper.PostAsync(agvurl + "carPass", requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<AgvActionResultBase>(response.Message); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Apache.NMS; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.IBusiness.WMS.T100ToWMS; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class BS |
| | | { |
| | | /// <summary> |
| | | /// å建çç¹åå· |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAction CreateBillCode() |
| | | { |
| | | var action = new ApiAction(); |
| | | |
| | | Result ruleResult = Biz.CodeRule["PD001"].Generate("PD"); //iWMS.GetBillNoByType("CI"); |
| | | if (!ruleResult.IsSuccessed) |
| | | { |
| | | throw new Exception(ruleResult.ExceptionMsg.Message); |
| | | } |
| | | |
| | | |
| | | action.Data = ruleResult.Data; |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// çç¹åæç» |
| | | /// </summary> |
| | | /// <param name="count"></param> |
| | | /// <returns></returns> |
| | | public ApiAction SummaryCount(WMS_COUNT count) |
| | | { |
| | | var action = new ApiAction(); |
| | | |
| | | var items = Biz.Db.Queryable<V_ITEM_COUNT>().Where(q => q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue() && q.AUTH_ORG == count.AUTH_ORG) |
| | | .WhereIF(count.ItemCodeList.Any(), q => count.ItemCodeList.Contains(q.ITEM_CODE)) |
| | | .Where(q => (count.WhIdList.Contains(q.WH_ID) || count.RegionIdList.Contains(q.REGION_ID) || count.ShelfIdList.Contains(q.SHELF_ID))).GroupBy(q => q.ITEM_CODE).Select(q => new |
| | | { |
| | | ITEM_CODE = q.ITEM_CODE, |
| | | ITEM_NAME = SqlFunc.AggregateMax(q.ITEM_NAME), |
| | | ITEM_DESC = SqlFunc.AggregateMax(q.ITEM_DESC), |
| | | QTY = SqlFunc.AggregateSum(q.QTY), |
| | | SN_COUNT = SqlFunc.AggregateCount(q.SN), |
| | | }).OrderBy(q => q.ITEM_CODE).ToList(); |
| | | |
| | | |
| | | action.Data = items; |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çç¹åæç» |
| | | /// </summary> |
| | | /// <param name="count"></param> |
| | | /// <param name="_data"></param> |
| | | /// <returns></returns> |
| | | public ApiAction GenerateCount(WMS_COUNT count, List<SaleOutInfoDetailDTO> _data) |
| | | { |
| | | var action = new ApiAction(); |
| | | List<WMS_COUNT_MDTL> Count_mdtls = new(); |
| | | List<WMS_COUNT_LDTL> Count_ldtls = new(); |
| | | List<WMS_COUNT_SUM> Count_sums = new(); |
| | | var startTime = DateTime.Now; |
| | | //ç©åæç» |
| | | var mdtls = Biz.Db.Queryable<WMS_ITEM>().Where(q => q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | .WhereIF(count.ItemCodeList.Any(), q => count.ItemCodeList.Contains(q.ITEM_CODE)) |
| | | .Where(q => (count.WhIdList.Contains(q.WH_ID) || count.RegionIdList.Contains(q.REGION_ID) || count.ShelfIdList.Contains(q.SHELF_ID))) |
| | | .Select(q => new WMS_COUNT_MDTL() |
| | | { |
| | | CREATE_USER = count.CREATE_USER, |
| | | CREATE_TIME = DateTime.Now, |
| | | UPDATE_USER = count.UPDATE_USER, |
| | | UPDATE_TIME = DateTime.Now, |
| | | AUTH_ORG = count.AUTH_ORG, |
| | | COUNT_NO = count.COUNT_NO, |
| | | ITEM_CODE = q.ITEM_CODE, |
| | | SN = q.SN, |
| | | UNIT = q.UNIT, |
| | | QTY = q.QTY, |
| | | PROD_DATE = q.PROD_DATE, |
| | | FIRST_IN_DATE = q.FIRST_IN_DATE, |
| | | SUPP_CODE = q.SUPP_CODE, |
| | | SUPP_LOTNO = q.SUPP_LOTNO, |
| | | WH_ID = q.WH_ID, |
| | | REGION_ID = q.REGION_ID, |
| | | SHELF_ID = q.SHELF_ID, |
| | | LOCATION_ID = q.LOCATION_ID, |
| | | ERP_WH = q.ERP_WH, |
| | | }) |
| | | .OrderBy(q => q.ITEM_CODE).ToList(); |
| | | if (mdtls.Count > 0) |
| | | { |
| | | Count_mdtls = mdtls; |
| | | } |
| | | //å¨ä½æç» |
| | | var ldtls = Biz.Db.Queryable<WMS_ITEM>().Where(q => q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | .WhereIF(count.ItemCodeList.Any(), q => count.ItemCodeList.Contains(q.ITEM_CODE)) |
| | | .Where(q => (count.WhIdList.Contains(q.WH_ID) || count.RegionIdList.Contains(q.REGION_ID) || count.ShelfIdList.Contains(q.SHELF_ID))) |
| | | .GroupBy(q => new { q.ITEM_CODE, q.WH_ID, q.REGION_ID, q.SHELF_ID, q.LOCATION_ID, q.ERP_WH }) |
| | | .Select(q => new WMS_COUNT_LDTL() |
| | | { |
| | | CREATE_USER = count.CREATE_USER, |
| | | CREATE_TIME = DateTime.Now, |
| | | UPDATE_USER = count.UPDATE_USER, |
| | | UPDATE_TIME = DateTime.Now, |
| | | COUNT_NO = count.COUNT_NO, |
| | | AUTH_ORG = count.AUTH_ORG, |
| | | WH_ID = q.WH_ID, |
| | | SHELF_ID = q.SHELF_ID, |
| | | REGION_ID = q.REGION_ID, |
| | | LOCATION_ID = q.LOCATION_ID, |
| | | ERP_WH = q.ERP_WH, |
| | | ITEM_CODE = q.ITEM_CODE, |
| | | UNIT = SqlFunc.AggregateMax(q.UNIT), |
| | | SN_QTY = SqlFunc.AggregateCount(q.SN), |
| | | QTY = SqlFunc.AggregateSum(q.QTY), |
| | | }).OrderBy(q => q.ITEM_CODE).ToList(); |
| | | if (ldtls.Count() > 0) |
| | | { |
| | | Count_ldtls = ldtls; |
| | | } |
| | | //ç»ææç» |
| | | var sums = Biz.Db.Queryable<WMS_ITEM>().Where(q => q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | .WhereIF(count.ItemCodeList.Any(), q => count.ItemCodeList.Contains(q.ITEM_CODE)) |
| | | .Where(q => (count.WhIdList.Contains(q.WH_ID) || count.RegionIdList.Contains(q.REGION_ID) || count.ShelfIdList.Contains(q.SHELF_ID))) |
| | | .GroupBy(q => new { q.ITEM_CODE, q.ERP_WH }) |
| | | .Select(q => new WMS_COUNT_SUM() |
| | | { |
| | | CREATE_USER = count.CREATE_USER, |
| | | CREATE_TIME = DateTime.Now, |
| | | UPDATE_USER = count.UPDATE_USER, |
| | | UPDATE_TIME = DateTime.Now, |
| | | AUTH_ORG = count.AUTH_ORG, |
| | | COUNT_NO = count.COUNT_NO, |
| | | ERP_WH = q.ERP_WH, |
| | | ITEM_CODE = q.ITEM_CODE, |
| | | UNIT = SqlFunc.AggregateMax(q.UNIT), |
| | | QTY = SqlFunc.AggregateSum(q.QTY), |
| | | SN_QTY = SqlFunc.AggregateCount(q.SN), |
| | | }).OrderBy(q => q.ITEM_CODE).ToList(); |
| | | //t100åºåæ°é |
| | | |
| | | //var t100_sums = _stockBus.GetStockInfo(_data); |
| | | |
| | | |
| | | |
| | | if (sums.Count > 0) |
| | | { |
| | | foreach (var sum in sums) |
| | | { |
| | | foreach (var item in _data) |
| | | { |
| | | if (sum.ITEM_CODE == item.inag001 && sum.ERP_WH == item.inag004) |
| | | { |
| | | sum.ERP_QTY = item.inag009; |
| | | } |
| | | } |
| | | } |
| | | Count_sums = sums; |
| | | } |
| | | |
| | | //ä¿åæ°æ®åº |
| | | var startSaveTime = DateTime.Now; |
| | | var db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Deleteable<WMS_COUNT_LDTL>(false).Where(q => q.COUNT_NO == count.COUNT_NO).ExecuteCommand(); |
| | | db.Deleteable<WMS_COUNT_MDTL>(false).Where(q => q.COUNT_NO == count.COUNT_NO).ExecuteCommand(); |
| | | db.Deleteable<WMS_COUNT_SUM>(false).Where(q => q.COUNT_NO == count.COUNT_NO).ExecuteCommand(); |
| | | db.Fastest<WMS_COUNT_LDTL>().BulkCopy(Count_ldtls); |
| | | db.Fastest<WMS_COUNT_MDTL>().BulkCopy(Count_mdtls); |
| | | db.Fastest<WMS_COUNT_SUM>().BulkCopy(Count_sums); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(dbTran.ErrorException, $"çæçç¹å[{count.COUNT_NO}]æç»å¼å¸¸"); |
| | | } |
| | | action.Message = $"çæçç¹å[{count.COUNT_NO}]æç»æåï¼æ»èæ¶{(DateTime.Now - startTime).TotalSeconds}毫ç§ï¼ä¿åèæ¶{(DateTime.Now - startSaveTime).TotalSeconds}毫ç§"; |
| | | return action; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Apache.NMS; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | using System.Xml.Linq; |
| | | using System.Collections; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class BS |
| | | { |
| | | /// <summary> |
| | | /// å®å·¥å
¥åºï¼ç©æè½¬å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAction MaterialResale(string billcode, string whcode, string org_code) |
| | | { |
| | | try |
| | | { |
| | | var action = new ApiAction(); |
| | | var wh_id = GetWmsCode(whcode);//åºä½id |
| | | var items = Biz.Db.Queryable<WMS_ITEM>().Where(q => q.TRANS_NO == billcode).ToList(); |
| | | var items_pkg = Biz.Db.Queryable<WMS_ITEM_PKG>().Where(q => q.TRANS_NO == billcode).ToList(); |
| | | var ProdIn = Biz.Db.Queryable<BIZ_ERP_PROD_IN>().Where(q => q.BILLCODE == billcode).First(); |
| | | if (items.Count() == 0) |
| | | { |
| | | action.Message = "åºåè¡¨æ¥æ æ°æ®"; |
| | | action.IsSuccessed = false; |
| | | return action; |
| | | } |
| | | if (items_pkg.Count() == 0) |
| | | { |
| | | action.Message = "å
è£
è¡¨æ¥æ æ°æ®"; |
| | | action.IsSuccessed = false; |
| | | return action; |
| | | } |
| | | if (ProdIn.IsNullOrEmpty()) |
| | | { |
| | | action.Message = "æ¥æ æ¤åæ®"; |
| | | action.IsSuccessed = false; |
| | | return action; |
| | | } |
| | | foreach (var item in items) |
| | | { |
| | | item.AUTH_ORG = org_code; |
| | | item.WH_ID = wh_id.Result; |
| | | item.ERP_WH = whcode; |
| | | } |
| | | foreach (var item in items_pkg) |
| | | { |
| | | item.AUTH_ORG = org_code; |
| | | item.WH_ID = wh_id.Result; |
| | | item.ERP_WH = whcode; |
| | | } |
| | | ProdIn.STATUS = BIZ_ERP_PROD_IN.STATUSs.COMPLETE.GetValue(); |
| | | |
| | | var db = Business.Biz.Db; |
| | | //å
¥åº |
| | | |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(items).ExecuteCommand(); |
| | | db.Updateable(items_pkg).ExecuteCommand(); |
| | | db.Updateable(ProdIn).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.Message = "转å失败"; |
| | | } |
| | | else |
| | | { |
| | | action.Message = "转åæå"; |
| | | } |
| | | |
| | | return action; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Apache.NMS; |
| | | using Newtonsoft.Json; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.ComponentModel.Design; |
| | | using System.Drawing; |
| | | using System.Drawing.Drawing2D; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class BS |
| | | { |
| | | /// <summary> |
| | | /// éæ°è¿è´¦ |
| | | /// </summary> |
| | | /// <param name="User"></param> |
| | | /// <param name="BillCode"></param> |
| | | /// <param name="Auth_Org"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> UpdateReq(string User, string BillCode, string Auth_Org) |
| | | { |
| | | MReqPostParam mRegPostParam = new() |
| | | { |
| | | BillCode = BillCode, |
| | | CompanyId = Auth_Org |
| | | }; |
| | | DI.Resolve<IiWMS>().MaterialReqToErpNew(mRegPostParam); |
| | | Thread.Sleep(10 * 1000); |
| | | var data = Biz.Db.Queryable<BIZ_ERP_PROD_OUT>().Where(q => q.BILLCODE == BillCode && q.AUTH_ORG == Auth_Org).First(); |
| | | data.COMMIT_MSG = "ç¨æ·ï¼" + User + "确认T100å·²ç»è¿è´¦ï¼" + data.COMMIT_MSG; |
| | | data.COMMIT_JSON = "ç¨æ·ï¼" + User + "确认T100å·²ç»è¿è´¦ï¼" + data.COMMIT_JSON; |
| | | Biz.Db.Updateable(data).ExecuteCommand(); |
| | | return null; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Apache.NMS; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class BS |
| | | { |
| | | /// <summary> |
| | | /// åå»ºè°æ¨åå· |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAction CreateTFBillCode() |
| | | { |
| | | var action = new ApiAction(); |
| | | |
| | | Result ruleResult = Biz.CodeRule["TF001"].Generate("TF"); //iWMS.GetBillNoByType("CI"); |
| | | if (!ruleResult.IsSuccessed) |
| | | { |
| | | throw new Exception(ruleResult.ExceptionMsg.Message); |
| | | } |
| | | |
| | | |
| | | action.Data = ruleResult.Data; |
| | | return action; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Tiger.IBusiness; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class BS : IBS |
| | | { |
| | | /// <summary> |
| | | /// è·åææä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="name"></param> |
| | | /// <param name="status"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> GetHouseModel(string name, string status) |
| | | { |
| | | var data = new List<OrgItemH>(); |
| | | V_WH_TREE func = null; |
| | | if (!string.IsNullOrEmpty(name)) |
| | | { |
| | | func = Biz.Db.Queryable<V_WH_TREE>().Where(x => x.NAME == name).First(); |
| | | } |
| | | var items = await Biz.Db.Queryable<V_WH_TREE>() |
| | | .Where(q => q.TYPE != "Location") |
| | | .OrderBy(x => x.CODE) |
| | | .Distinct().ToListAsync(); |
| | | //æ²¡ææ¥è¯¢çæ¶å |
| | | if (func == null) |
| | | { |
| | | List<V_WH_TREE> entities = items.OrderBy(x => x.CODE).ToList().FindAll(t => t.PARENT_ID.IsNullOrEmpty()); |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.TYPE.ToString().FirstOrDefault() + item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.AUTH_ORG + ":" + item.CODE + "(" + item.NAME + ")"; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //hosueItem.remark = item.REMARK; |
| | | //hosueItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItem(items, item.ID, ref houseItem); |
| | | data.Add(houseItem); |
| | | } |
| | | } |
| | | //ææ¥è¯¢æ¡ä»¶çæ¶å |
| | | else |
| | | { |
| | | |
| | | } |
| | | |
| | | //转æ¢Jsonæ¶ï¼å»é¤å¼ä¸ºnullç屿§ |
| | | var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; |
| | | var json = JsonConvert.SerializeObject(data, Formatting.Indented, jsonSetting); |
| | | return json; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½è¿åç»ç»æºæ |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <param name="parent"></param> |
| | | /// <param name="pOrgItem"></param> |
| | | private static void GetOrgItem(List<V_WH_TREE> data, string parent, ref OrgItemH pOrgItem) |
| | | { |
| | | List<V_WH_TREE> entities = data.OrderBy(x => x.CODE).ToList().FindAll(t => t.PARENT_ID == parent).Distinct().ToList(); |
| | | if (entities.Count > 0) |
| | | { |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.TYPE.ToString().FirstOrDefault() + item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.AUTH_ORG + ":" + item.CODE + "(" + item.NAME + ")"; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //houseItem.remark = item.REMARK; |
| | | //houseItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItem(data, item.ID, ref houseItem); |
| | | pOrgItem.children.Add(houseItem); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="listItem"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> GetHouseModelOrg(HouseListItem listItem) |
| | | { |
| | | var data = new List<OrgItemH>(); |
| | | V_WH_TREE func = null; |
| | | var items = await Biz.Db.Queryable<V_WH_TREE>() |
| | | .Where(q => q.TYPE != "Location" && q.AUTH_ORG == listItem.AUTH_ORG) |
| | | .OrderBy(x => x.CODE) |
| | | .Distinct().ToListAsync(); |
| | | //æ²¡ææ¥è¯¢çæ¶å |
| | | if (func == null) |
| | | { |
| | | List<V_WH_TREE> entities = items.OrderBy(x => x.CODE).ToList().FindAll(t => t.PARENT_ID.IsNullOrEmpty()); |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.AUTH_ORG + ":" + item.CODE + "(" + item.NAME + ")"; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //hosueItem.remark = item.REMARK; |
| | | //hosueItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItemOrg(items, item.ID, ref houseItem); |
| | | data.Add(houseItem); |
| | | } |
| | | } |
| | | //ææ¥è¯¢æ¡ä»¶çæ¶å |
| | | else |
| | | { |
| | | |
| | | } |
| | | |
| | | //转æ¢Jsonæ¶ï¼å»é¤å¼ä¸ºnullç屿§ |
| | | var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; |
| | | var json = JsonConvert.SerializeObject(data, Formatting.Indented, jsonSetting); |
| | | return json; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½è¿åç»ç»æºæ |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <param name="parent"></param> |
| | | /// <param name="pOrgItem"></param> |
| | | private static void GetOrgItemOrg(List<V_WH_TREE> data, string parent, ref OrgItemH pOrgItem) |
| | | { |
| | | List<V_WH_TREE> entities = data.OrderBy(x => x.CODE).ToList().FindAll(t => t.PARENT_ID == parent).Distinct().ToList(); |
| | | if (entities.Count > 0) |
| | | { |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.AUTH_ORG + ":" + item.CODE + "(" + item.NAME + ")"; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //houseItem.remark = item.REMARK; |
| | | //houseItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItemOrg(data, item.ID, ref houseItem); |
| | | pOrgItem.children.Add(houseItem); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä»åºä»£ç åç±»åå é¤ä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="wareHouse"></param> |
| | | /// <returns></returns> |
| | | public ApiAction DelWareHouseModel(DelWareHouseModelEntity wareHouse) |
| | | { |
| | | var action = new ApiAction(); |
| | | List<string> locaIds = new(); |
| | | List<string> shelfIds = new(); |
| | | List<string> regIds = new(); |
| | | List<string> wareIds = new(); |
| | | var db = Biz.Db; |
| | | List<V_WH_UNIT> uNITs = new List<V_WH_UNIT>(); |
| | | if (wareHouse.Type == "Warehouse") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.WH_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.WH_ID == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | regIds.AddRange(unit.Where(q => !q.REGION_ID.IsNullOrEmpty()).Select(s => s.REGION_ID).Distinct()); |
| | | wareIds.AddRange(unit.Where(q => !q.WH_ID.IsNullOrEmpty()).Select(s => s.WH_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "ä»åºé颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else if (wareHouse.Type == "Region") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.REGION_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.REGION_ID == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | regIds.AddRange(unit.Where(q => !q.REGION_ID.IsNullOrEmpty()).Select(s => s.REGION_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "å¨åºé颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else if (wareHouse.Type == "Shelf") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.SHELF_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.SHELF_ID == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "è´§æ¶é颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | //å å¨ä½ |
| | | if (locaIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_LOCATION>().Where(it => locaIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å è´§æ¶ |
| | | if (shelfIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_SHELF>().Where(it => shelfIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å å¨åº |
| | | if (regIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_REGION>().Where(it => regIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å ä»åº |
| | | if (wareIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_WAREHOUSE>().Where(it => wareIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// çæå¨ä½å表 |
| | | /// </summary> |
| | | /// <param name="locations"></param> |
| | | /// <returns></returns> |
| | | public ApiAction AddLocationModel(List<AddLocationModelEntity> locations) |
| | | { |
| | | var action = new ApiAction(); |
| | | List<WMS_LOCATION> Locations = new List<WMS_LOCATION>(); |
| | | foreach (var item in locations) |
| | | { |
| | | WMS_LOCATION location = new WMS_LOCATION() |
| | | { |
| | | LOCATION_CODE = item.LOCATION_CODE, |
| | | LOCATION_NAME = item.LOCATION_CODE, |
| | | IS_ACTIVE = "Y", |
| | | AUTH_ORG = item.AUTH_ORG, |
| | | ORG_CODE = item.ORG_CODE, |
| | | SHELF_ID = item.SHELF_ID, |
| | | IS_MIX = item.ISMIX, |
| | | IS_SINGLE = item.ISMIX == "N" ? "Y" : "N", |
| | | FLOOR_NO = item.FLOOR_NO, |
| | | SEQ_NO = item.SEQ_NO, |
| | | LEDID = item.LEDID |
| | | }; |
| | | Locations.Add(location); |
| | | } |
| | | var db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Deleteable<WMS_LOCATION>().Where(q => q.SHELF_ID == locations[0].SHELF_ID).ExecuteCommand(); |
| | | db.Insertable<WMS_LOCATION>(Locations).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(dbTran.ErrorException, $"æ°å¢å¨ä½å¼å¸¸"); |
| | | } |
| | | |
| | | action.LocaleMsg = Biz.L("WMS.WareHouse.VerifyException", Locations[0].ORG_CODE); |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// æ¥è¯¢è´§æ¶æ¯å¦æä¸è¥¿ |
| | | /// </summary> |
| | | /// <param name="shelf"></param> |
| | | /// <returns></returns> |
| | | public ApiAction CheckLocation(DelWareHouseModelEntity shelf) |
| | | { |
| | | var action = new ApiAction(); |
| | | var db = Biz.Db; |
| | | if (shelf.Type == "shelf") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.SHELF_ID == shelf.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | action.IsSuccessed = true; |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = Biz.L("WMS.WareHouse.æ£æ¥å¨ä½åå§å", shelf.ID); |
| | | } |
| | | } |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»åºæ®ç¹ï¼åä¸çº§å
¨é¨ä¿®æ¹ |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> GetUpdateOrg(string id) |
| | | { |
| | | var db = Biz.Db; |
| | | List<WMS_SHELF> shelfs = new(); |
| | | List<WMS_LOCATION> locations = new(); |
| | | var warehouse = db.Queryable<WMS_WAREHOUSE>().Where(q => q.ID == id).First(); |
| | | if (warehouse != null) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.WH_ID == id).ToList(); |
| | | var regionids = unit.Select(q => q.REGION_ID).Distinct().ToList(); |
| | | var shelfids = unit.Select(q => q.SHELF_ID).Distinct().ToList(); |
| | | //var locationids=unit.Select(q=>q.LOCATION_ID).Distinct().ToList(); |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable<WMS_REGION>().SetColumns(q => q.AUTH_ORG == warehouse.AUTH_ORG).Where(q => q.WH_ID == warehouse.ID).ExecuteCommand(); |
| | | |
| | | db.Updateable<WMS_SHELF>().SetColumns(q => q.AUTH_ORG == warehouse.AUTH_ORG) |
| | | .Where(q => regionids.Any(o => o == q.REGION_ID)).ExecuteCommand(); |
| | | db.Updateable<WMS_LOCATION>().SetColumns(q => q.AUTH_ORG == warehouse.AUTH_ORG) |
| | | .Where(q => SqlFunc.Subqueryable<WMS_SHELF>().Where(s => regionids.Any(o => o == s.REGION_ID) && q.SHELF_ID == s.ID).Any()).ExecuteCommand(); |
| | | }); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®idè·åCode |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public async Task<string> GetWmsCode(string id) |
| | | { |
| | | var db = Biz.Db; |
| | | var ID = ""; |
| | | var warehouse = db.Queryable<WMS_WAREHOUSE>().Where(q => q.WH_CODE == id).First(); |
| | | if (warehouse != null) |
| | | { |
| | | ID = warehouse.ID; |
| | | } |
| | | return ID; |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Tiger.Model; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | //public static async Task<List<K3_VWHEADER>> GetInCommingList(string FBILLNO) |
| | | //{ |
| | | // var query = Biz.Db.Queryable<K3_VWHEADER>().Where(q => q.STATUS < (int)K3_VWHEADER.STATUSs.Completed) |
| | | // .WhereIF(!string.IsNullOrEmpty(FBILLNO), q => q.FBILLNO == FBILLNO || q.FSOURCEBILLNO == FBILLNO) |
| | | // .OrderBy(q => q.STATUS, OrderByType.Desc).OrderBy(q => q.FBILLNO, OrderByType.Asc); |
| | | // return await query.ToListAsync(); |
| | | //} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Rhea.Common; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.Design; |
| | | using System.Linq; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class ErpT100 |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä»T100è·åä¾åºåæ¥å£ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public T100ActionResult<resultStd_data<VenderParameterR>> GetVenderInfo(VenderInputParameter input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<VenderParameter>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "MES", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_erp_wms_getven" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<VenderParameter>> |
| | | { |
| | | std_data = new actionStd_data<VenderParameter> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<VenderParameterR>>>(response.Message); |
| | | return result; |
| | | } |
| | | |
| | | public ApiAction GetVenderInfoToDDL(iVenderParams input) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | var t100Res = GetVenderInfo(new VenderInputParameter |
| | | { |
| | | parameter = new VenderParameter |
| | | { |
| | | site = input.company, |
| | | startdt = input.startDate, |
| | | enddt = input.endDate |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = input.company |
| | | } |
| | | }); |
| | | if (t100Res.payload.std_data.execution.code == "0") |
| | | { |
| | | var list = t100Res.payload.std_data.parameter.@return; |
| | | action.Data = list; |
| | | List<BAS_SUPPLIER> suppliers = new List<BAS_SUPPLIER>(); |
| | | var allList = Biz.Db.Queryable<BAS_SUPPLIER>().Where(x => x.AUTH_ORG == input.company).ToList(); |
| | | foreach (var item in list) |
| | | { |
| | | var query = allList.Where(x => x.SUPP_CODE == item.pmab001).FirstOrDefault(); |
| | | BAS_SUPPLIER entity = query ?? new BAS_SUPPLIER() |
| | | { |
| | | SUPP_CODE = item.pmab001, |
| | | SUPP_NAME_CN = item.pmaal003, |
| | | AUTH_ORG = input.company |
| | | }; |
| | | suppliers.Add(entity); |
| | | } |
| | | var db = Business.Biz.Db; |
| | | //æ°æ®åºå¤çæä½ |
| | | if (action.IsSuccessed) |
| | | { |
| | | action.Message = $"ä¾åºåä¿¡æ¯åæ¥æå"; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Storageable(suppliers, "Interface").ExecuteCommand(); |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"T100è¿åä¿¡æ¯é误:{t100Res.payload.std_data.execution.description}"; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, $"æ°æ®å¤ç失败"); |
| | | } |
| | | return action; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Apache.NMS.ActiveMQ.Commands; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using Rhea.Common; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel.Design; |
| | | using System.Drawing.Drawing2D; |
| | | using System.Linq; |
| | | using System.Security.Policy; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class ErpT100 : IErpT100 |
| | | { |
| | | /// <summary> |
| | | /// T100æ¥å£URL |
| | | /// </summary> |
| | | public static string t100Url { get; set; } = @"http://172.18.8.11/wstopprd/ws/r/awsp920"; |
| | | |
| | | public static List<string> curDeliveryNoList { get; set; } = new List<string>(); |
| | | |
| | | /// <summary> |
| | | /// ä»T100è·åäºçº§ä¾åºåæ¥å£ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static T100ActionResult<resultStd_data<Parameter3>> GetSecondarySupplyInfo(SupplierInputParameter input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<SupplierParameter>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | //datakey = new Datakey |
| | | //{ |
| | | // EntId = "88", |
| | | // CompanyId = "XCSJ" //æ®ç¹ DGXC |
| | | //}, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_ge_pmaauc" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<SupplierParameter>> |
| | | { |
| | | std_data = new actionStd_data<SupplierParameter> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<Parameter3>>>(response.Message); |
| | | Logger.Interface.Info($"T100è·åäºçº§ä¾åºåæäº¤Json: {requestJson}ï¼è¿åJson: {response.Message}"); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæå®¢ä¾æå°è´§å |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static T100ActionResult<resultStd_data<Parameter>> GenerateCustReceipt(CustReceiptInputParameter input) |
| | | { |
| | | try |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<Parameter<Detail>>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | //datakey = new Datakey |
| | | //{ |
| | | // EntId = "108", //æ£å¼ 88 |
| | | // CompanyId = "XCSJ" //æ®ç¹ DGXC |
| | | //}, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_gen_apmt520" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<Parameter<Detail>>> |
| | | { |
| | | std_data = new actionStd_data<Parameter<Detail>> |
| | | { |
| | | parameter = input.parameter |
| | | //parameter = new Parameter<Detail> |
| | | //{ |
| | | // pmds000 = "2", |
| | | // pmdsdocno = "3453", |
| | | // pmdsdocdt = "2023-04-26", //å½å¤©æ¶é´ |
| | | // pmds002 = "L36783", //ç¨æ·ID |
| | | // pmds003 = "", |
| | | // pmds007 = "C0006", //ä¾åºå代ç |
| | | // pmds010 = "æµè¯å®¢ä¾ææ éè´æ¶è´§", //éè´§åå· |
| | | // pmdsud001 = "CM017", //äºçº§ä¾åºç¼å· |
| | | // detail = new List<Detail> |
| | | //{ |
| | | // new Detail |
| | | // { |
| | | // pmdtseq= "1", |
| | | // pmdt001= "", |
| | | // pmdt002= "", |
| | | // pmdt003= "", |
| | | // pmdt004= "", |
| | | // pmdt006= itemcode, //"K7015AA016141", |
| | | // pmdt020= qty, //"100.00000", |
| | | // pmdtud011= "0" |
| | | // } |
| | | //} |
| | | //} |
| | | } |
| | | } |
| | | }; |
| | | |
| | | //妿éè´§åå·²ç»å¨å¤çï¼åä¸è½åé夿é |
| | | if (!curDeliveryNoList.Contains(input.parameter.pmds010) || input.parameter.pmds010.IsNullOrEmpty()) |
| | | { |
| | | if (!input.parameter.pmds010.IsNullOrEmpty()) |
| | | { |
| | | curDeliveryNoList.Add(input.parameter.pmds010); |
| | | } |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<Parameter>>>(response.Message); |
| | | Logger.Interface.Info($"çæå°è´§åæäº¤Json: {requestJson}ï¼è¿åJson: {response.Message}"); |
| | | curDeliveryNoList.Remove(input.parameter.pmds010); |
| | | Logger.Interface.Info($"æä½åå·å表移é¤å½åæä½åå·[{input.parameter.pmds010}]"); |
| | | return result; |
| | | } |
| | | else |
| | | { |
| | | T100ActionResult<resultStd_data<Parameter>> ret = new(); |
| | | ret.payload.std_data.execution.code = "-1"; |
| | | ret.payload.std_data.execution.description = $"æ¤å[{input.parameter.pmds010}]æ£å¨æ¨éå°T100ï¼ä¸è½é夿¨éï¼"; |
| | | Logger.Interface.Warn($"çæå°è´§åå¼å¸¸ï¼è¿å: {ret.payload.std_data.execution.description}"); |
| | | return ret; |
| | | } |
| | | |
| | | #region æµè¯ä»£ç |
| | | |
| | | //var result = new T100ActionResult<resultStd_data<Parameter>>() |
| | | //{ |
| | | // payload = new() |
| | | // { |
| | | // std_data = new() |
| | | // { |
| | | // execution = new() |
| | | // { |
| | | // code = "0", |
| | | // sql_code = "0", |
| | | // description = "æ§è¡æåï¼", |
| | | // }, |
| | | // parameter = new() |
| | | // { |
| | | // docno = $"DGrec-{DateTime.Now:yyMMddHHmm}", |
| | | // } |
| | | // } |
| | | // } |
| | | //}; |
| | | //Logger.Interface.Info($"çæå®¢ä¾æå°è´§åæäº¤Json: {requestJson}ï¼è¿åJson: {{JsonConvert.SerializeObject(result)}}"); |
| | | |
| | | #endregion æµè¯ä»£ç |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | curDeliveryNoList.Remove(input.parameter.pmds010); |
| | | Logger.Interface.Error($"çæå°è´§åå¼å¸¸ï¼è¿å: {ex.Message}"); |
| | | } |
| | | |
| | | return new(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»T100è·åäºçº§ä¾åºåæ¥å£è¿åiDropdownlistå表 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public List<iDropdownlist> GetSecondarySupplyInfoToDDL(SupplierInputParameter input) |
| | | { |
| | | List<iDropdownlist> iDropdownlists = new List<iDropdownlist>(); |
| | | var list = GetSecondarySupplyInfo(input).payload.std_data.parameter.@return; |
| | | foreach (var item in list) |
| | | { |
| | | iDropdownlist _iDropdownlist = new() |
| | | { |
| | | label = item.pmaauc003, |
| | | value = $"{item.pmaauc002},{item.pmaauc001}", |
| | | }; |
| | | iDropdownlists.Add(_iDropdownlist); |
| | | } |
| | | return iDropdownlists; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæéæ£å |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static T100ActionResult<resultStd_data<Parameter>> GenerateInspection(InsInputParameter input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<InsParameter>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | //datakey = new Datakey |
| | | //{ |
| | | // EntId = "108", //æ£å¼ 88 |
| | | // CompanyId = "XCSJ" //æ®ç¹ DGXC |
| | | //}, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_gen_aqct300" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<InsParameter>> |
| | | { |
| | | std_data = new actionStd_data<InsParameter> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<Parameter>>>(response.Message); |
| | | Logger.Interface.Info($"çæéæ£åæäº¤Json: {requestJson}ï¼è¿åJson: {response.Message}"); |
| | | |
| | | #region æµè¯ä»£ç |
| | | |
| | | //var result = new T100ActionResult<resultStd_data<Parameter>>() |
| | | //{ |
| | | // payload = new() |
| | | // { |
| | | // std_data = new() |
| | | // { |
| | | // execution = new() |
| | | // { |
| | | // code = "0", |
| | | // sql_code = "0", |
| | | // description = "æ§è¡æåï¼", |
| | | // }, |
| | | // parameter = new() |
| | | // { |
| | | // docno = $"DGtest-{DateTime.Now:yyMMddHHmm}", |
| | | // } |
| | | // } |
| | | // } |
| | | //}; |
| | | //Logger.Interface.Info($"çæéæ£åæäº¤Json: {requestJson}ï¼è¿åJson: {JsonConvert.SerializeObject(result)}"); |
| | | |
| | | #endregion æµè¯ä»£ç |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæå
¶ä»å
¥åºå |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static T100ActionResult<resultStd_data<Parameter>> GenerateOtherIn(OtherInputParameter<Detail4> input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<InParameter<Detail4>>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_gen_apmt570" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<InParameter<Detail4>>> |
| | | { |
| | | std_data = new actionStd_data<InParameter<Detail4>> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<Parameter>>>(response.Message); |
| | | if (result.payload.std_data.execution.code != "0") |
| | | { |
| | | throw new Exception($"T100çæå
¥åºå失败ï¼å¤±è´¥åå ï¼{result.payload.std_data.execution.description}"); |
| | | } |
| | | Logger.Interface.Info($"çæå
¥åºå请æ±T100ï¼ä¼ å
¥åæ°Json:{requestJson}ï¼è¿å:{response.Message}"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®é¢æåå·æå身 |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public T100ActionResult<resultStd_data<reqParameter1>> GetMaterialReqDetail(ReqInputParameter input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<reqParameter>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_erp_wms_getwoissd" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<reqParameter>> |
| | | { |
| | | std_data = new actionStd_data<reqParameter> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<reqParameter1>>>(response.Message); |
| | | Logger.Interface.Info($"æ ¹æ®é¢æåå·æå身æäº¤Json: {requestJson}ï¼è¿åJson: {response.Message}"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 颿åè¿è´¦ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static T100ActionResult<resultStd_data<Parameter>> MaterialReqToErp(ReqErpInputParameter input) |
| | | { |
| | | var t100Action = new T100Action<actionStd_data<Parameter4>> |
| | | { |
| | | key = Guid.NewGuid().ToString("N"), |
| | | type = "sync", |
| | | host = new host |
| | | { |
| | | prod = "WMS", |
| | | ip = "", |
| | | lang = "zh_CN", |
| | | acct = "tiptop", |
| | | timestamp = DateTime.Now.ToString("yyyyMMddHHMMssfff"), |
| | | }, |
| | | datakey = input.datakey, |
| | | service = new Service |
| | | { |
| | | ip = "", |
| | | prod = "T100", |
| | | id = "topprd", |
| | | name = "wms_gen_asft310" |
| | | }, |
| | | payload = new PayloadData<actionStd_data<Parameter4>> |
| | | { |
| | | std_data = new actionStd_data<Parameter4> |
| | | { |
| | | parameter = input.parameter |
| | | } |
| | | } |
| | | }; |
| | | var requestJson = JsonConvert.SerializeObject(t100Action); |
| | | var response = HttpHelper.PostAsync(t100Url, requestJson).Result; |
| | | var result = JsonConvert.DeserializeObject<T100ActionResult<resultStd_data<Parameter>>>(response.Message); |
| | | Logger.Interface.Info($"颿åè¿è´¦æäº¤Json: {requestJson}ï¼è¿åJson: {response.Message}"); |
| | | if (input.datakey.CompanyId == "DGXC") |
| | | { |
| | | Logger.Interface.Info($"颿å[{input.parameter.sfdadocno}]è¿è´¦Jsonä¿åå°æ°æ®åºå¼å§"); |
| | | DbClient db = ApiConfig.IsOldVersion ? Biz.DataSource["WMS57"].Client : Business.Biz.Db; |
| | | BIZ_ERP_PROD_OUT entity_h = db.Queryable<BIZ_ERP_PROD_OUT>().Where(x => x.BILLCODE == input.parameter.sfdadocno && x.ERP_BILL_CODE == null).First(); |
| | | if (entity_h != null) |
| | | { |
| | | entity_h.COMMIT_JSON = requestJson; |
| | | entity_h.COMMIT_MSG = response.Message; |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | if (entity_h != null) |
| | | { |
| | | db.Updateable(entity_h).UpdateColumns(q => new { q.COMMIT_JSON, q.COMMIT_MSG }).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | Logger.Interface.Error(dbTran.ErrorException); |
| | | throw dbTran.ErrorException; |
| | | } |
| | | Logger.Interface.Info($"颿å[{input.parameter.sfdadocno}]è¿è´¦Jsonä¿åå°æ°æ®åºç»æ"); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Rhea.Common; |
| | | using Tiger.Model; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading.Tasks; |
| | | using System.Linq; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common.Authorization; |
| | | using Newtonsoft.Json.Linq; |
| | | using Tiger.Model.Minsun; |
| | | using Tiger.IBusiness; |
| | | using System.Data.Entity; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class KanBan : IKanBan |
| | | { |
| | | /// <summary> |
| | | /// warehousingçæ¿å
¨é¨æ°æ®å¯¹æ¥ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<MaterialKBOutput> GetReceiptDetail(MaterialKBInput input) |
| | | { |
| | | try |
| | | { |
| | | DateTime dateTime = DateTime.Now.AddDays(-2); |
| | | int nYear = DateTime.Now.Year; |
| | | //var sql = $"SELECT SUM(INSTOCKQTY) as Total, convert(varchar(100),datepart(mm, LastModificationTime))+'æ' as Month FROM WMS_RECEIPT_D WHERE LINESTATUS=8 and datepart(yy,LastModificationTime)=@nYear GROUP BY datepart(mm, LastModificationTime)"; |
| | | |
| | | //var sList = Db.Queryable<BIZ_ERP_RECEIPT_DTL, V_USER_ORG>((d, r) => |
| | | // new JoinQueryInfos( |
| | | // JoinType.Left, d.CREATE_USER == r.USER_ID |
| | | // )) |
| | | // .Where((d, r) => d.LINESTATUS == 2 && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | // //.GroupBy((d, r) => d.UPDATE_TIME) |
| | | // .Select((d, r) => new TotalByMonth |
| | | // { |
| | | // Total = SqlFunc.AggregateSum(d.INSTOCKQTY), |
| | | // Month = $"{d.UPDATE_TIME.Month}æ" |
| | | // }) |
| | | //.ToList(); |
| | | |
| | | var sList = Biz.Db.Queryable<V_MONTH_IN_SUM>().ToList(); |
| | | |
| | | //var sList = Db.Queryable<BIZ_ERP_RECEIPT_DTL>() |
| | | // .LeftJoin<V_USER_ORG>((d, r) => d.CREATE_USER==r.USER_ID) |
| | | // .GroupBy((d, r) => d.UPDATE_TIME.Month) |
| | | // .Where((d, r) => d.LINESTATUS == 1 && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | // //.GroupBy((d, r) => new { Month = d.UPDATE_TIME.Month }) |
| | | // .Select((d, r) => new TotalByMonth |
| | | // { |
| | | // Total = SqlFunc.AggregateSum(d.INSTOCKQTY), |
| | | // Month = $"{d.UPDATE_TIME.Month}æ" |
| | | // }) |
| | | // .ToList(); |
| | | |
| | | //SqlParameter[] nParams = new SqlParameter[] |
| | | //{ |
| | | // new SqlParameter("@nYear",System.Data.SqlDbType.Int), |
| | | //}; |
| | | //nParams[0].Value = nYear; |
| | | |
| | | //var sList = SqlQuery<TotalByMonth>(sql, nParams).ToList(); |
| | | |
| | | //var taskTotalSql = $"SELECT SUM(QTY-INSTOCKQTY) as Total,'' as Month FROM WMS_RECEIPT_D WHERE LINESTATUS = 4 and datepart(yy,LastModificationTime)=@nYear "; |
| | | |
| | | var sTaskTotal = Biz.Db.Queryable<BIZ_ERP_RECEIPT_DTL, V_USER_ORG>((d, r) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, d.CREATE_USER == r.USER_ID |
| | | )) |
| | | .Where((d, r) => (d.LINESTATUS == 1) && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | .Select((d, r) => new TotalByMonth |
| | | { |
| | | Total = SqlFunc.RowCount(), |
| | | Month = "" |
| | | }).First(); |
| | | |
| | | //SqlParameter[] nParams2 = new SqlParameter[] |
| | | //{ |
| | | //new SqlParameter("@nYear",System.Data.SqlDbType.Int), |
| | | //}; |
| | | //nParams2[0].Value = nYear; |
| | | |
| | | //var sTaskTotal = this._receiptDetailRepository.SqlQuery<TotalByMonth>(taskTotalSql, nParams2).FirstOrDefault(); |
| | | |
| | | //var unChecklSql = $"SELECT SUM(QTY) as Total,'' as Month FROM WMS_RECEIPT_D WHERE LINESTATUS = 2 and datepart(yy,LastModificationTime)=@nYear "; |
| | | |
| | | var sUnCheckNumber = Biz.Db.Queryable<BIZ_ERP_RECEIPT_DTL, V_USER_ORG>((d, r) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, d.CREATE_USER == r.USER_ID |
| | | )) |
| | | .Where((d, r) => d.LINESTATUS == 1 && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | .Select((d, r) => new TotalByMonth |
| | | { |
| | | Total = SqlFunc.AggregateSum(d.QTY), |
| | | Month = "" |
| | | }).First(); |
| | | |
| | | //SqlParameter[] nParams3 = new SqlParameter[] |
| | | //{ |
| | | //new SqlParameter("@nYear",System.Data.SqlDbType.Int), |
| | | //}; |
| | | //nParams3[0].Value = nYear; |
| | | |
| | | //var sUnCheckNumber = this._receiptDetailRepository.SqlQuery<TotalByMonth>(unChecklSql, nParams3).FirstOrDefault(); |
| | | |
| | | //var sTotalSql = $"SELECT SUM(INSTOCKQTY) as Total,'' as Month FROM WMS_RECEIPT_D WHERE LINESTATUS in (4, 8) and datepart(yy,LastModificationTime)=@nYear "; |
| | | //ç»æä»æ°é |
| | | var Structure = Biz.Db.Queryable<BIZ_ERP_RECEIPT_DTL, V_USER_ORG>((d, r) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, d.CREATE_USER == r.USER_ID |
| | | )) |
| | | .Where((d, r) => (d.LINESTATUS == 2) && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | .Select((d, r) => new TotalByMonth |
| | | { |
| | | Total = SqlFunc.AggregateSum(d.INSTOCKQTY), |
| | | Month = "" |
| | | }).First(); |
| | | |
| | | //çµå仿°é |
| | | var Electron = Biz.Db.Queryable<BIZ_ERP_RECEIPT_DTL, V_USER_ORG>((d, r) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, d.CREATE_USER == r.USER_ID |
| | | )) |
| | | .Where((d, r) => (d.LINESTATUS == 2) && d.UPDATE_TIME.Year == nYear && r.USERGROUP_CODE == "æ¸
溪çµåä»") |
| | | .Select((d, r) => new TotalByMonth |
| | | { |
| | | Total = SqlFunc.AggregateSum(d.INSTOCKQTY), |
| | | Month = "" |
| | | }).First(); |
| | | //SqlParameter[] nParams4 = new SqlParameter[] |
| | | //{ |
| | | //new SqlParameter("@nYear",System.Data.SqlDbType.Int), |
| | | //}; |
| | | //nParams4[0].Value = nYear; |
| | | |
| | | //var sTotal = this._receiptDetailRepository.SqlQuery<TotalByMonth>(sTotalSql, nParams4).FirstOrDefault(); |
| | | |
| | | var nOutput = new MaterialKBOutput() |
| | | { |
| | | Structure = Structure.Total, |
| | | Electron = Electron.Total, |
| | | UnCheckNumber = sUnCheckNumber.Total, |
| | | TaskTotal = sTaskTotal.Total, |
| | | TotalByMonthList = sList, |
| | | // IncomingRptList = nResult |
| | | }; |
| | | return nOutput; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// warehousingå
¥åºæç»ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<MaterialKBOutput> GetIncomingDetail(MaterialKBInput input) |
| | | { |
| | | |
| | | int pagenumber = Convert.ToInt16(input.Barcode); // pagenumberæ¯ä»1å¼å§ç䏿¯ä»é¶å¼å§ç |
| | | int pageSize = 10; |
| | | int totalCount = 0; |
| | | |
| | | DateTime dateTime = DateTime.Now.AddDays(-2); |
| | | //å
¥åºä¿¡æ¯ |
| | | var nResult = Biz.Db.Queryable<BIZ_ERP_RECEIPT_DTL, BAS_ITEM, V_USER_ORG>((r, m, s) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, r.ITEM_CODE == m.ITEM_CODE, |
| | | JoinType.Left, r.CREATE_USER == s.USER_ID |
| | | )) |
| | | .Where((r, m, s) => r.CREATE_TIME > dateTime && s.USERGROUP_CODE == "æ¸
æºªç»æä»") |
| | | .OrderByDescending((r, m, s) => r.CREATE_TIME) |
| | | .Select((r, m, s) => new IncomingRptOutput |
| | | { |
| | | CreationTime = r.CREATE_TIME, |
| | | BillCode = r.SOURCECODE, |
| | | WarehouseCode = r.WAREHOUSECODE, |
| | | MaterialCode = r.ITEM_CODE, |
| | | MaterialName = m.ITEM_NAME, |
| | | Status = r.LINESTATUS, |
| | | Qty = r.QTY, |
| | | InstockQty = r.INSTOCKQTY, |
| | | LeftQty = r.QTY - r.INSTOCKQTY |
| | | }) |
| | | .ToPageList(pagenumber, pageSize, ref totalCount); |
| | | //nResult = nResult.OrderByDescending(q=>q.CreationTime).ToList(); |
| | | //totalCount = 21; |
| | | if (totalCount > pageSize * pagenumber) |
| | | { |
| | | pagenumber += 1; |
| | | } |
| | | else |
| | | { |
| | | pagenumber = 1; |
| | | } |
| | | var nOutput = new MaterialKBOutput() |
| | | { |
| | | Structure = pagenumber, |
| | | IncomingRptList = nResult |
| | | }; |
| | | return nOutput; |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/Minsun/CustSupplyChecking.cs ÐÞ¸Ä |
| | |
| | | action.Message = $"æ¡ç ä¸è½ä¸ºç©ºï¼"; |
| | | return action; |
| | | } |
| | | Result<InputBarcodeDto> result = Biz.iWMS.SplitFullBarcode(input.SN); |
| | | Result<InputBarcodeDto> result = iWMS.SplitFullBarcode(input.SN); |
| | | if (result.Flag != Result.Flags.Success) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //var nWarehouseCodes = nScannedBarcodes.Select(x => x.WarehouseCode).Distinct().ToList(); |
| | | |
| | | //æ°å»ºå
¶ä»å
¥åºåæ®å¤´ OtherInstockHeader |
| | | string billCode = Biz.iWMS.GetBillNoByType("CI"); |
| | | string billCode = iWMS.GetBillNoByType("CI"); |
| | | var nBillHeader = new WMS_OTHERINSTOCK_H |
| | | { |
| | | CreationTime = DateTime.Now, |
| | |
| | | } |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = Biz.ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | |
| | | #region çæéæ£å |
| | | foreach (var item in iqcHeaders) |
| | | { |
| | | var retIns = Biz.ErpT100.GenerateInspection(new InsInputParameter |
| | | var retIns = ErpT100.GenerateInspection(new InsInputParameter |
| | | { |
| | | parameter = new InsParameter |
| | | { |
| | |
| | | |
| | | var nIqcHeader = new WMS_IQC_H |
| | | { |
| | | BILLCODE = Biz.iWMS.GetBillNoByType("IQC"), |
| | | BILLCODE = iWMS.GetBillNoByType("IQC"), |
| | | SOURCETYPE = (int)InventoryTransferSides.BillType.CustSupplyInStock, |
| | | SOURCECODE = detail.BILLCODE, |
| | | SOURCELINE = detail.BILLLINE, |
ÎļþÃû´Ó Tiger.Business/WMS/Minsun/CustomerSupplyIn.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | var nLocation = new Model.Minsun.WMS_LOCATION(); |
| | | var nDisassembleBarcode = Biz.iWMS.SplitFullBarcode(sn).Data; |
| | | var nDisassembleBarcode = iWMS.SplitFullBarcode(sn).Data; |
| | | //éªè¯æ¡ç æ¯å¦å·²ç»åå¨ |
| | | var nBarcode = Biz.Db.Queryable<WMS_BARCODE>().Where(t => t.BARCODE.ToUpper() == nDisassembleBarcode.Barcode.ToUpper()).First(); |
| | | if (nBarcode != null) |
| | |
| | | // 夿æ¯å¦æºè½è´§æ¶ |
| | | if (CustomerSupplyPuton.IsSmartRack) |
| | | { |
| | | Result<ShelfOperateOutput> result = await Biz.Shelf.UpShelf(new ShelfOperateInput |
| | | Result<ShelfOperateOutput> result = await Shelf.UpShelf(new ShelfOperateInput |
| | | { |
| | | ShelfNo = CustomerSupplyPuton.RackCode, |
| | | OperateType = "1" |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | action = Biz.iWMS.MultiInStorageAsync(new MultiInvInStorageInput |
| | | action = iWMS.MultiInStorageAsync(new MultiInvInStorageInput |
| | | { |
| | | InvBarcodes = new List<WMS_BARCODE>() { nBarcode }, |
| | | InvBarcodeLogs = new List<WMS_BARCODE_LOG> |
| | |
| | | pmdt018 = billHeader.REMARK |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | var ret = ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | { |
| | | parameter = new InParameter<Detail4> |
| | | { |
| | |
| | | StateFlag = nDisassembleBarcode.StateFlag, |
| | | LocationCode = nLocation.LOCATIONCODE, |
| | | ReceiptCode = barcodeScanned?.BUSINESSCODE, |
| | | IncompleteTips = isCompleted? "æ°éï¼0 (0ç)" : Biz.iWMS.GetIncompleteTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.MATERIALCODE), |
| | | IncompleteTips = isCompleted? "æ°éï¼0 (0ç)" : iWMS.GetIncompleteTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.MATERIALCODE), |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | pmdt018 ="åç±³ç§æ" |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | var ret = ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | { |
| | | parameter = new InParameter<Detail4> |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Rhea.Common; |
| | | using Tiger.Model; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading.Tasks; |
| | | using System.Linq; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common.Authorization; |
| | | using Newtonsoft.Json.Linq; |
| | | using Tiger.Model.Minsun; |
| | | using System.Globalization; |
| | | using System.Data; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class iWMS |
| | | { |
| | | /// <summary> |
| | | /// éç¨æ¹éå
¥åº |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction MultiInStorageAsync(MultiInvInStorageInput input) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | string flag = ""; |
| | | //ä¿åå°æ°æ®åº |
| | | var db = Business.Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | //æå
¥ææ´æ° InvBarcode |
| | | var x = db.Storageable(input.InvBarcodes) |
| | | .WhereColumns(t => new { t.BARCODE }) |
| | | .ToStorage(); |
| | | x.AsInsertable.ExecuteCommand(); |
| | | x.AsUpdateable.IgnoreColumns(t => t.Id).ExecuteCommand(); |
| | | flag = "InvBarcodeæ´æ°æå"; |
| | | #region æå
¥ InvStorageLotInfo |
| | | var y = db.Storageable(input.InvStorageLotInfos) |
| | | .WhereColumns(t => new { t.BARCODE }) |
| | | .ToStorage(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(t => t.Id).ExecuteCommand(); |
| | | flag += "; InvStorageLotInfoæ´æ°æå"; |
| | | #endregion |
| | | |
| | | #region æå
¥ InvStorageInfo |
| | | var z = db.Storageable(input.InvStorageInfos) |
| | | .WhereColumns(t => new { t.WAREHOUSECODE, t.MATERIALCODE }) |
| | | .ToStorage(); |
| | | z.AsInsertable.ExecuteCommand(); |
| | | z.AsUpdateable.IgnoreColumns(t => t.Id).ExecuteCommand(); |
| | | #endregion |
| | | flag += "; InvStorageInfoæ´æ°æå"; |
| | | #region æå
¥ InvScanMain å InvScanDetail |
| | | |
| | | var m = db.Storageable(input.InvScanMains) |
| | | .ToStorage(); |
| | | m.AsInsertable.IgnoreColumns(t => t.LastModificationTime).ExecuteCommand(); |
| | | |
| | | var o = db.Storageable(input.InvScanDetails) |
| | | .WhereColumns(t => new { t.SCANMAINID, t.SOURCEDETAILLINE, t.WAREHOUSECODE, t.MATERIALCODE }) |
| | | .ToStorage(); |
| | | o.AsInsertable.ExecuteCommand(); |
| | | o.AsUpdateable.IgnoreColumns(t => t.Id).ExecuteCommand(); |
| | | #endregion |
| | | flag += "; InvScanMainæ´æ°æå"; |
| | | #region æå
¥ InvBarcodeLog |
| | | db.Insertable(input.InvBarcodeLogs).ExecuteCommand(); |
| | | #endregion |
| | | flag += "; å
¥åºæå"; |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"{flag} Error:{dbTran.ErrorException.Message}"; |
| | | action.Data = new MultiInvInStorageOutput |
| | | { |
| | | Message = $"{flag} Error:{dbTran.ErrorException.Message}", |
| | | InvBarcodes = input.InvBarcodes |
| | | }; |
| | | //throw dbTran.ErrorException; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, $"å
¥åºå¼å¸¸"); |
| | | } |
| | | action.Message = "OK"; |
| | | action.Data = new MultiInvInStorageOutput |
| | | { |
| | | Message = "OK", |
| | | InvBarcodes = input.InvBarcodes |
| | | }; |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å¾å°è´§åå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetERP_RECEIPTTips(string billcode, string materialCode) |
| | | { |
| | | var tips = ""; |
| | | var otherInDetails = Biz.Db.Queryable<BIZ_ERP_RECEIPT_SN>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | //if (otherInDetails.Any()) |
| | | { |
| | | tips += $"æ°éï¼{otherInDetails.Sum(q => q.SCANQTY):N0}"; |
| | | } |
| | | var otherInScanList = Biz.Db.Queryable<BIZ_ERP_RECEIPT_SN>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper()).ToList(); |
| | | //if (otherInScanList.Any()) |
| | | { |
| | | tips += $" ({otherInScanList.Count()} ç)"; |
| | | } |
| | | return tips; |
| | | } |
| | | /// <summary> |
| | | /// è·å¾å°è´§åå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetERP_ReturnTips(string billcode, string materialCode) |
| | | { |
| | | var tips = ""; |
| | | var otherInDetails = Biz.Db.Queryable<BIZ_ERP_PROD_RETURN_SN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | //&& t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | //if (otherInDetails.Any()) |
| | | { |
| | | tips += $"æ°éï¼{otherInDetails.Sum(q => q.QTY):N0}"; |
| | | } |
| | | var otherInScanList = Biz.Db.Queryable<BIZ_ERP_PROD_RETURN_SN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue() |
| | | //&& t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | ).ToList(); |
| | | //if (otherInScanList.Any()) |
| | | { |
| | | tips += $" ({otherInScanList.Count()} ç)"; |
| | | } |
| | | return tips; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å¾å
¶ä»å
¥åºåå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetERP_OTH_INTips(string billcode, string materialCode) |
| | | { |
| | | var tips = ""; |
| | | var otherInDetails = Biz.Db.Queryable<BIZ_ERP_OTH_IN_DTL>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | && t.LINESTATUS == BIZ_ERP_OTH_IN.STATUSs.WORKING.GetValue()).OrderBy(t => new { t.BILLCODE, t.BILLLINE }).ToList(); |
| | | //if (otherInDetails.Any()) |
| | | { |
| | | tips += $"æ°éï¼{otherInDetails.Sum(q => q.PRQTY - q.QTY):N0}"; |
| | | } |
| | | var otherInScanList = Biz.Db.Queryable<BIZ_ERP_OTH_IN_SN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper()).ToList(); |
| | | //if (otherInScanList.Any()) |
| | | { |
| | | tips += $" ({otherInScanList.Count()} ç)"; |
| | | } |
| | | return tips; |
| | | } |
| | | /// <summary> |
| | | /// è·å¾å
¶ä»å
¥åºåå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetFinishedTips(string billcode, string materialCode) |
| | | { |
| | | var tips = ""; |
| | | var otherInDetails = Biz.Db.Queryable<BIZ_ERP_PROD_IN_DTL>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | && t.LINESTATUS == BIZ_ERP_OTH_IN.STATUSs.WORKING.GetValue()).OrderBy(t => new { t.BILLCODE, t.BILLLINE }).ToList(); |
| | | //if (otherInDetails.Any()) |
| | | { |
| | | tips += $"æ°éï¼{otherInDetails.Sum(q => q.PRQTY - q.INVENTORYQTY):N0}"; |
| | | } |
| | | var otherInScanList = Biz.Db.Queryable<BIZ_ERP_PROD_IN_SN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue() |
| | | && t.ITEM_CODE.ToUpper() == materialCode.ToUpper()).ToList(); |
| | | //if (otherInScanList.Any()) |
| | | { |
| | | tips += $" ({otherInScanList.Count()} ç)"; |
| | | } |
| | | return tips; |
| | | } |
| | | /// <summary> |
| | | /// è·å¾å
¶ä»å
¥åºåå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetBIZ_ERP_PROD_INips(string billcode) |
| | | { |
| | | var tips = ""; |
| | | //var otherInDetails = Biz.Db.Queryable<BIZ_ERP_OTH_IN_DTL>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | // && t.ITEM_CODE.ToUpper() == materialCode.ToUpper() |
| | | // && t.LINESTATUS == BIZ_ERP_OTH_IN.STATUSs.WORKING.GetValue()).OrderBy(t => new { t.BILLCODE, t.BILLLINE }).ToList(); |
| | | ////if (otherInDetails.Any()) |
| | | //{ |
| | | // tips += $"æ°éï¼{otherInDetails.Sum(q => q.PRQTY - q.QTY):N0}"; |
| | | //} |
| | | var otherInScanList = Biz.Db.Queryable<BIZ_ERP_PROD_IN_SN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | && t.STATUS <= WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | //if (otherInScanList.Any()) |
| | | { |
| | | tips += $" æ»æ°ï¼({otherInScanList.Count()})"; |
| | | } |
| | | return tips; |
| | | } |
| | | /// <summary> |
| | | /// è·å¾å®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <param name="materialCode"></param> |
| | | /// <returns></returns> |
| | | public static string GetIncompleteTips(string billcode, string materialCode) |
| | | { |
| | | var tips = ""; |
| | | var otherInDetails = Biz.Db.Queryable<WMS_OTHERINSTOCK_D>().Where(t => t.BILLCODE.ToUpper() == billcode.ToUpper() |
| | | && t.MATERIALCODE.ToUpper() == materialCode.ToUpper() |
| | | && t.LINESTATUS == OtherInstockSides.Status.WORKING.ToString()).OrderBy(t => new { t.BILLCODE, t.BILLLINE }).ToList(); |
| | | if (otherInDetails.Any()) |
| | | { |
| | | tips += $"æ°éï¼{otherInDetails.Sum(q => q.PRQTY - q.QTY):N0}"; |
| | | } |
| | | var otherInScanList = Biz.Db.Queryable<WMS_OTHERINSTOCK_SCAN>().Where(t => t.BUSINESSCODE.ToUpper() == billcode.ToUpper() |
| | | && t.MATERIALCODE.ToUpper() == materialCode.ToUpper()).OrderBy(t => new { t.BUSINESSCODE, t.BUSINESSLINE }).ToList(); |
| | | if (otherInScanList.Any()) |
| | | { |
| | | tips += $" ({otherInScanList.Count()} ç)"; |
| | | } |
| | | return tips; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 客便å
¥åºå®æä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public async Task<CustSupplyInOutput> CustSupplyInIncompleteList(CustSupplyIncompleteInput input) |
| | | { |
| | | var otherInScanList = await Biz.Db.Queryable<WMS_OTHERINSTOCK_SCAN>() |
| | | .Where(t => t.BUSINESSCODE.ToUpper() == input.receiptNo.ToUpper() |
| | | && t.MATERIALCODE.ToUpper() == input.materialCode.ToUpper()) |
| | | .ToListAsync(); |
| | | var incompleteList = otherInScanList.OrderBy(q => q.STATUS == "Billed" ? 1 : (q.STATUS == "Complete" ? 3 : 2)) |
| | | .Select(q => new |
| | | { |
| | | Barcode = q.BARCODE, |
| | | Qty = (int)q.QTY, |
| | | Status = q.STATUS == "Billed" ? "å¾
å
¥åº" : (q.STATUS == "Complete" ? "å·²å
¥åº" : $"å
¶ä»({q.STATUS})") |
| | | }); |
| | | return new CustSupplyInOutput() { result = JsonConvert.SerializeObject(incompleteList) }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading.Tasks; |
| | | using System.Linq; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common.Authorization; |
| | | using Newtonsoft.Json.Linq; |
| | | using Tiger.Model.Minsun; |
| | | using System.Globalization; |
| | | using System.Data; |
| | | using System.Text.RegularExpressions; |
| | | using System.Text; |
| | | using System.DirectoryServices.ActiveDirectory; |
| | | using Dm; |
| | | using Tiger.Model.DigitalTwin; |
| | | using System.IO; |
| | | using System.Net; |
| | | using Rhea.Common; |
| | | using static Tiger.Model.Minsun.IqcManagementSides; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public static partial class Shelf |
| | | { |
| | | public static long UserId { get; set; } |
| | | public static string _shelfApiUrl { get; set; } = GetSysCodeText("ShelfSetting", "ShelfApiUrl"); |
| | | private static string _shelfLightColor { get; set; } = GetSysCodeText("ShelfSetting", "ShelfLightColor"); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 䏿¶ |
| | | /// </summary> |
| | | /// <param name="operateInput"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfOperateOutput>> UpShelf(ShelfOperateInput operateInput) |
| | | { |
| | | Result<ShelfOperateOutput> result = new(Result.Flags.Success, $"æå䏿¶"); |
| | | string uniqueID = Guid.NewGuid().ToString(); |
| | | // 1. åé䏿¶æä»¤ |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | |
| | | var data1 = new |
| | | { |
| | | shelfNo = operateInput.ShelfNo, |
| | | operateType = 1, |
| | | pdaid = string.IsNullOrEmpty(operateInput.PdaId) ? UserId.ToString() : operateInput.PdaId, |
| | | keepSeconds = 30, |
| | | uniqueNumber = uniqueID |
| | | }; |
| | | |
| | | string apiUrl1 = _shelfApiUrl + "/OperateConfig"; |
| | | var jsonString1 = JsonConvert.SerializeObject(data1); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl1, jsonString1); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | JObject resp1 = result1.Data; |
| | | ShelfApiResult apiResult = new ShelfApiResult(); |
| | | apiResult.IsSuccess = resp1["OperateConfigResult"]["IsSuccess"].ToString(); |
| | | apiResult.ItemCode = resp1["OperateConfigResult"]["ItemCode"].ToString(); |
| | | apiResult.ResultValue = resp1["OperateConfigResult"]["ResultValue"].ToString(); |
| | | apiResult.Type = resp1["OperateConfigResult"]["Type"].ToString(); |
| | | |
| | | //å®ä¹è¿ååæ° |
| | | ShelfOperateOutput shelfOperateOutput = new ShelfOperateOutput(); |
| | | |
| | | // 妿䏿¶æä½æä»¤æå |
| | | if (apiResult.IsSuccess.ToUpper() == "TRUE") |
| | | { |
| | | // 2. åé GetOperateChuteChangeInfo æä»¤ï¼è·å䏿¶ä½ç½®ï¼ledAddrï¼å uniqueNumber |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data2 = new |
| | | { |
| | | shelfNo = operateInput.ShelfNo, |
| | | operateType = operateInput.OperateType |
| | | }; |
| | | |
| | | string apiUrl2 = _shelfApiUrl + "/GetOperateChuteChangeInfo"; |
| | | var jsonString2 = JsonConvert.SerializeObject(data2); |
| | | |
| | | shelfOperateOutput.IsSuccess = "FALSE"; |
| | | DateTime timeStart = DateTime.Now; |
| | | TimeSpan timeSpan = DateTime.Now - timeStart; |
| | | while (shelfOperateOutput.IsSuccess.ToUpper() != "TRUE" && timeSpan.TotalSeconds < 30) |
| | | { |
| | | DateTime timeEnd = DateTime.Now; |
| | | timeSpan = DateTime.Now - timeStart; |
| | | |
| | | Result<JObject> result2 = await PostShelfApi(apiUrl2, jsonString2); |
| | | if (result2.Flag == Result.Flags.Success) |
| | | { |
| | | JObject resp2 = result2.Data; |
| | | |
| | | shelfOperateOutput.IsSuccess = resp2["GetOperateChuteChangeInfoResult"]["IsSuccess"].ToString(); |
| | | string resultValue = resp2["GetOperateChuteChangeInfoResult"]["ResultValue"].ToString(); |
| | | |
| | | if (shelfOperateOutput.IsSuccess.ToUpper() == "TRUE" && !String.IsNullOrEmpty(resultValue)) |
| | | { |
| | | JObject jo = JObject.Parse(resultValue); |
| | | shelfOperateOutput.ShelfNo = jo["shelfNo"].ToString(); |
| | | shelfOperateOutput.OperateType = jo["operateType"].ToString(); |
| | | shelfOperateOutput.LedAddr = jo["ledAddr"].ToString(); |
| | | shelfOperateOutput.PdaId = jo["pdaid"].ToString(); |
| | | shelfOperateOutput.UniqueNumber = jo["uniqueNumber"].ToString(); |
| | | |
| | | if (uniqueID != shelfOperateOutput.UniqueNumber) |
| | | { |
| | | shelfOperateOutput.IsSuccess = "False"; |
| | | shelfOperateOutput.Message = "UniqueNumber ä¸å"; |
| | | }; |
| | | |
| | | if (operateInput.ShelfNo != shelfOperateOutput.ShelfNo) |
| | | { |
| | | shelfOperateOutput.IsSuccess = "False"; |
| | | shelfOperateOutput.Message = "ShelfNo ä¸å"; |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 3. ç»æä¸æ¶ |
| | | var data3 = new |
| | | { |
| | | shelfNo = data1.shelfNo, |
| | | operateType = 7, |
| | | pdaid = data1.pdaid, |
| | | keepSeconds = 30, |
| | | uniqueNumber = data1.uniqueNumber, |
| | | }; |
| | | string apiUrl3 = _shelfApiUrl + "/OperateConfig"; |
| | | var jsonString3 = JsonConvert.SerializeObject(data3); |
| | | Result<JObject> result3 = await PostShelfApi(apiUrl3, jsonString3); |
| | | if (result3.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result3.Message; |
| | | return result; |
| | | } |
| | | JObject resp3 = result3.Data; |
| | | if (timeSpan.TotalSeconds >= 30) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"䏿¶æä½è¶
æ¶"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | // æ´æ°åºä½ä»£ç ï¼LocationCode |
| | | WMS_LOCATION locOut = await Biz.Db.Queryable<WMS_LOCATION>().Where(t => t.RACKCODE == shelfOperateOutput.ShelfNo |
| | | && t.LedAddr.ToString() == shelfOperateOutput.LedAddr).FirstAsync(); |
| | | if (locOut != null) |
| | | shelfOperateOutput.LocationCode = locOut.LOCATIONCODE; |
| | | result.Data = shelfOperateOutput; |
| | | return result; |
| | | |
| | | } |
| | | |
| | | // è¯»åæ°æ®åå
¸ï¼æ ¹æ®CodeType,CodeValueè·ååæ°Text |
| | | private static string GetSysCodeText(string codeType, string codeValue) |
| | | { |
| | | var code = Biz.Db.Queryable<Sys_Code>().Where(x => x.CodeType.ToUpper() == codeType && x.Value.ToUpper() == codeValue).First(); |
| | | return code?.Text; |
| | | } |
| | | |
| | | // Http Post ShelfApi |
| | | private static async Task<Result<JObject>> PostShelfApi(string apiUrl, string strJson) |
| | | { |
| | | Result<JObject> result = new(Result.Flags.Success, $"è´§æ¶APIè¿åæå"); |
| | | HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(apiUrl); |
| | | httpWebRequest.ContentType = "application/json;charset=utf-8"; |
| | | httpWebRequest.Method = "POST"; |
| | | httpWebRequest.Timeout = 10000; |
| | | |
| | | byte[] btBodys = Encoding.UTF8.GetBytes(strJson); |
| | | httpWebRequest.ContentLength = btBodys.Length; |
| | | //Logger.Default.Info(string.Format("æºè½è´§æ¶ï¼å¼å§è¯·æ±{0}ï¼åæ°{1}", apiUrl, strJson)); |
| | | try |
| | | { |
| | | httpWebRequest.GetRequestStream().Write(btBodys, 0, btBodys.Length); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Default.Info(string.Format("æºè½è´§æ¶ï¼è¯·æ±å¼å¸¸ï¼è¿åä¿¡æ¯ï¼{0}", JsonConvert.SerializeObject(ex))); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æºè½è´§æ¶ï¼è¯·æ±å¼å¸¸ï¼è¿åä¿¡æ¯ï¼{JsonConvert.SerializeObject(ex)}"; |
| | | return result; |
| | | } |
| | | |
| | | HttpWebResponse httpResponse; |
| | | string respnsetContent; |
| | | try |
| | | { |
| | | httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); |
| | | if (httpResponse.StatusCode != HttpStatusCode.OK) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æºè½è´§æ¶APIé讯å¼å¸¸ï¼è¯·æ£æ¥è´§æ¶æ¯å¦æ£å¸¸"; |
| | | return result; |
| | | } |
| | | |
| | | StreamReader streamReader = new StreamReader(httpResponse.GetResponseStream()); |
| | | respnsetContent = streamReader.ReadToEnd(); |
| | | |
| | | httpResponse.Close(); |
| | | streamReader.Close(); |
| | | httpWebRequest.Abort(); |
| | | |
| | | //Logger.Default.Info(string.Format("æºè½è´§æ¶ï¼è¯·æ±æåï¼è¿åä¿¡æ¯ï¼{0}", respnsetContent)); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Default.Info(string.Format("æºè½è´§æ¶ï¼è¯·æ±å¼å¸¸ï¼è¿åä¿¡æ¯ï¼{0}", JsonConvert.SerializeObject(ex))); |
| | | //ä¸æè·æä»¤ååºåçå¼å¸¸ |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æºè½è´§æ¶ï¼è¯·æ±å¼å¸¸ï¼è¿åä¿¡æ¯ï¼{JsonConvert.SerializeObject(ex)}"; |
| | | return result; |
| | | } |
| | | |
| | | JObject jo = JObject.Parse(respnsetContent); |
| | | result.Data = jo; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | #region è´§æ¶äº®ç¯ |
| | | /// <summary> |
| | | /// å
¨é¨äº®ç¯ |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> LightAll(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"å
¨é¨äº®ç¯æå"); |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | color = lightParam.LightColor, |
| | | isCover = lightParam.IsCover, |
| | | shelfType = "sensor_shelf" |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/LightAll"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Light All", |
| | | IsSuccess = result1.Data["LightAllResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["LightAllResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["LightAllResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["LightAllResult"]["Type"].ToString(), |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¨é¨çç¯ |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> DownAll(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"å
¨é¨çç¯æå"); |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | shelfType = "sensor_shelf" |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/DownAll"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Down All", |
| | | IsSuccess = result1.Data["DownAllResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["DownAllResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["DownAllResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["DownAllResult"]["Type"].ToString(), |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç¯äº® |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> LightSingle(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"åç¯äº®æå"); |
| | | //å¦æåæ°ä¼ å
¥LocationCode |
| | | var nLocation = await Biz.Db.Queryable<WMS_LOCATION>().Where(t => t.LOCATIONCODE == lightParam.LocationCode).FirstAsync(); |
| | | |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | ledAddr = (nLocation == null) ? lightParam.LedAddr : nLocation.LedAddr.ToString(), |
| | | color = lightParam.LightColor.IsNullOrEmpty() ? _shelfLightColor : lightParam.LightColor, |
| | | isCover = lightParam.IsCover.IsNullOrEmpty() ? "1" : lightParam.IsCover, |
| | | shelfType = "sensor_shelf" |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/LightSingle"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Light Single", |
| | | IsSuccess = result1.Data["LightSingleResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["LightSingleResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["LightSingleResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["LightSingleResult"]["Type"].ToString(), |
| | | }; |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åç¯ç |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> DownSingle(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"åç¯çæå"); |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | ledAddr = lightParam.LedAddr, |
| | | shelfType = "sensor_shelf" |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/DownSingle"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult() |
| | | { |
| | | LightType = "Down Single", |
| | | IsSuccess = result1.Data["DownSingleResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["DownSingleResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["DownSingleResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["DownSingleResult"]["Type"].ToString(), |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤ç¯äº® |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> LightMulti(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"å¤ç¯äº®æå"); |
| | | // åºä½å表 LedAddrList |
| | | List<Object> ledList = new List<object>(); |
| | | foreach (string led_addr in lightParam.LedAddrList) |
| | | { |
| | | //ledList.Add(new { ledAddr = led_addr, uniqueNumber = "" }); |
| | | ledList.Add(new { ledAddress = led_addr, uniqueNumber = "" }); |
| | | } |
| | | |
| | | // è´§æ¶åºä½å表 |
| | | List<Object> shelfLedAddr = new List<Object>(); |
| | | shelfLedAddr.Add( |
| | | new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | shelfType = "sensor_shelf", |
| | | ledAddressList = ledList |
| | | } |
| | | ); |
| | | |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfLedAddressList = shelfLedAddr, |
| | | parameters = new |
| | | { |
| | | pdaId = "WMS_PDA", |
| | | orderCode = "WMS_PDA", |
| | | userItem1 = "", |
| | | userItem2 = "", |
| | | userItem3 = "", |
| | | userItem4 = "", |
| | | userItem5 = "", |
| | | }, |
| | | operateType = 0, |
| | | color = lightParam.LightColor.IsNullOrEmpty() ? _shelfLightColor : lightParam.LightColor, |
| | | isCover = lightParam.IsCover.IsNullOrEmpty() ? "1" : lightParam.IsCover, |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/LightMulti"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Light Multi", |
| | | IsSuccess = result1.Data["LightMultiResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["LightMultiResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["LightMultiResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["LightMultiResult"]["Type"].ToString(), |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤ç¯ç |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> DownMulti(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"å¤ç¯çæå"); |
| | | // åºä½å表 LedAddrList |
| | | List<Object> ledList = new List<object>(); |
| | | foreach (string led_addr in lightParam.LedAddrList) |
| | | { |
| | | //ledList.Add(new { ledAddr = led_addr, uniqueNumber = "" }); |
| | | ledList.Add(new { ledAddress = led_addr, uniqueNumber = "" }); |
| | | } |
| | | |
| | | // è´§æ¶åºä½å表 |
| | | List<Object> shelfLedAddr = new List<Object>(); |
| | | shelfLedAddr.Add( |
| | | new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | shelfType = "sensor_shelf", |
| | | ledAddressList = ledList |
| | | } |
| | | ); |
| | | |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfLedAddressList = shelfLedAddr, |
| | | parameters = new |
| | | { |
| | | pdaId = "", |
| | | orderCode = "", |
| | | userItem1 = "", |
| | | userItem2 = "" |
| | | }, |
| | | operateType = lightParam.OperateType, |
| | | color = lightParam.LightColor, |
| | | isCover = lightParam.IsCover, |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/DownMulti"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Down Multi", |
| | | IsSuccess = result1.Data["DownMultiResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["DownMultiResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["DownMultiResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["DownMultiResult"]["Type"].ToString(), |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æä½è´§æ¶ç¯å¡ |
| | | /// </summary> |
| | | /// <param name="lightParam"></param> |
| | | /// <returns></returns> |
| | | public static async Task<Result<ShelfApiResult>> OperateTowerLight(ShelfLightParam lightParam) |
| | | { |
| | | Result<ShelfApiResult> result = new(Result.Flags.Success, $"å¤ç¯çæå"); |
| | | // åå¤ POST è¯·æ± body åæ° |
| | | var data = new |
| | | { |
| | | shelfNo = lightParam.ShelfNo, |
| | | color = 3, |
| | | operEnum = lightParam.OperEnum, |
| | | shelfType = "sensor_shelf" |
| | | }; |
| | | |
| | | string apiUrl = _shelfApiUrl + "/OperateTowerLight"; |
| | | var jsonString = JsonConvert.SerializeObject(data); |
| | | |
| | | Result<JObject> result1 = await PostShelfApi(apiUrl, jsonString); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = result1.Message; |
| | | return result; |
| | | } |
| | | result.Data = new ShelfApiResult |
| | | { |
| | | LightType = "Operate TowerLight", |
| | | IsSuccess = result1.Data["OperateTowerLightResult"]["IsSuccess"].ToString(), |
| | | ItemCode = result1.Data["OperateTowerLightResult"]["ItemCode"].ToString(), |
| | | ResultValue = result1.Data["OperateTowerLightResult"]["ResultValue"].ToString(), |
| | | Type = result1.Data["OperateTowerLightResult"]["Type"].ToString() |
| | | }; |
| | | return result; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Rhea.Common; |
| | | using Tiger.Model; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Threading.Tasks; |
| | | using System.Linq; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common.Authorization; |
| | | using Newtonsoft.Json.Linq; |
| | | using Tiger.Model.Minsun; |
| | | using System.Globalization; |
| | | using System.Data; |
| | | using System.Text.RegularExpressions; |
| | | using System.Text; |
| | | using System.DirectoryServices.ActiveDirectory; |
| | | using Dm; |
| | | using System.Reflection; |
| | | using Apache.NMS.ActiveMQ.Commands; |
| | | using Apache.NMS; |
| | | using System.Configuration; |
| | | using System.Reflection.PortableExecutable; |
| | | using Tiger.Business.WMS.Transaction; |
| | | using System.Threading; |
| | | using System.Drawing.Drawing2D; |
| | | using System.Collections; |
| | | using Tiger.IBusiness; |
| | | using Autofac; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class iWMS |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | |
| | | /// <summary> |
| | | /// ç©æå
è£
管ç ç©æå
è£
å±çº§:å°å
å½å±äºåªä¸ªä¸å
ãä¸å
å½å±äºåªä¸ªå¤å
wms_barcode æ |
| | | /// </summary> |
| | | /// <param name="sn"></param> |
| | | /// <returns></returns> |
| | | public List<iPackageInfo> GetPackageInfo(string sn) |
| | | { |
| | | var query = new List<iPackageInfo>(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æå
¥åºä¿¡æ¯ ç©æåç§°ãç©æä»£ç ãç©æä¾åºåãæ°éãåºä½ãå¨ä½ãæ¹æ¬¡ãå
¥åºæ¶é´ |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public List<iInStoreInfo> GetInStoreInfo(iParams param) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_STORAGELOTINFO, WMS_BARCODE, WMS_BARCODE_LOG, WMS_MesMaterial>((t, b, l, m) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.BARCODE == b.BARCODE, |
| | | JoinType.Left, t.BARCODE == l.BARCODE, |
| | | JoinType.Left, t.MATERIALCODE == m.MCode |
| | | )) |
| | | .Where((t, b, l, m) => l.INOUTTYPE == 10) |
| | | .WhereIF(!string.IsNullOrEmpty(param.sn), (t, b, l, m) => t.BARCODE == param.sn) |
| | | .WhereIF(!string.IsNullOrEmpty(param.startDate), (t, b, l, m) => l.CreationTime >= Convert.ToDateTime(param.startDate)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.endDate), (t, b, l, m) => l.CreationTime < Convert.ToDateTime(param.endDate)) |
| | | .Select((t, b, l, m) => new iInStoreInfo |
| | | { |
| | | sn = t.BARCODE, |
| | | MaterialCode = t.MATERIALCODE, |
| | | MaterialName = m.MDesc, |
| | | VendorCode = b.SUPPLIERCODE, |
| | | WarehouseCode = t.WAREHOUSECODE, |
| | | LocationCode = t.LOCATIONCODE, |
| | | LotNo = b.LOTNO, |
| | | SourceCode = b.SOURCEBARCODE, |
| | | QTY = t.QTY, |
| | | CreateDate = l.CreationTime, |
| | | UpdateDate = l.LastModificationTime |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æåºåºä¿¡æ¯ 颿åå·ã颿æå·ãæ°éãåºä½ãå¨ä½ãåºåºæ¶é´ |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public List<iOutStoreInfo> GetOutStoreInfo(iParams param) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_BARCODE_LOG, WMS_MesMaterial>((t, m) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.MATERIALCODE == m.MCode |
| | | )) |
| | | .Where((t, m) => t.INOUTTYPE == 20 && !SqlFunc.IsNullOrEmpty(t.BILLCODE)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.sn), (t, m) => t.BARCODE == param.sn) |
| | | .WhereIF(!string.IsNullOrEmpty(param.startDate), (t, m) => t.CreationTime >= Convert.ToDateTime(param.startDate)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.endDate), (t, m) => t.CreationTime < Convert.ToDateTime(param.endDate)) |
| | | .Select((t, m) => new iOutStoreInfo |
| | | { |
| | | sn = t.BARCODE, |
| | | MaterialCode = t.MATERIALCODE, |
| | | MaterialName = m.MDesc, |
| | | WarehouseCode = t.WAREHOUSECODE, |
| | | LocationCode = t.LOCATIONCODE, |
| | | BillCode = t.BILLCODE, |
| | | QTY = t.QTY, |
| | | CreateDate = t.CreationTime, |
| | | UpdateDate = t.LastModificationTime |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æéæä¿¡æ¯ éææå·ãéææ¶é´ãéææ¡ç ãéæåºä½ãç§°éæ¸
ç¹ç»æ |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public List<iReturnInfo> GetReturnInfo(iParamsBase param) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_BARCODE_LOG, WMS_MesMaterial>((t, m) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.MATERIALCODE == m.MCode |
| | | )) |
| | | .Where(t => t.SOURCEBILLTYPE == 25) |
| | | .WhereIF(!string.IsNullOrEmpty(param.startDate), (t, m) => t.CreationTime >= Convert.ToDateTime(param.startDate)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.endDate), (t, m) => t.CreationTime < Convert.ToDateTime(param.endDate)) |
| | | .Select((t, m) => new iReturnInfo |
| | | { |
| | | sn = t.BARCODE, |
| | | MaterialCode = t.MATERIALCODE, |
| | | MaterialName = m.MDesc, |
| | | WarehouseCode = t.WAREHOUSECODE, |
| | | CreateDate = t.CreationTime |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©æåºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public List<iStorageInfo> GetStorageInfo(iParamsBase param) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_STORAGELOTINFO, WMS_BARCODE, WMS_MesMaterial, MesVender>((t, b, m, v) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.BARCODE == b.BARCODE, |
| | | JoinType.Left, t.MATERIALCODE == m.MCode, |
| | | JoinType.Left, b.SUPPLIERCODE == v.VenderCode |
| | | )) |
| | | .WhereIF(!string.IsNullOrEmpty(param.startDate), (t, b, m, v) => t.CreationTime >= Convert.ToDateTime(param.startDate)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.endDate), (t, b, m, v) => t.CreationTime < Convert.ToDateTime(param.endDate)) |
| | | .Select((t, b, m, v) => new iStorageInfo |
| | | { |
| | | MaterialCode = t.MATERIALCODE, |
| | | MaterialName = m.MDesc, |
| | | VenderCode = b.SUPPLIERCODE, |
| | | VenderName = v.VenderName, |
| | | Unit = m.MUom, |
| | | QTY = t.QTY, |
| | | UpdateDate = t.LastModificationTime ?? t.CreationTime |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 夿åå
è£
ä¿¡æ¯ æå
夿ï¼éæ°ç»å
çå
è£
å·å
³ç³»ï¼æå
ç¼å·ãç»å
åç¼å·ãç»å
åæ°éãå¤é¢æåå·ãæå· |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public List<iSplitInfo> GetSplitInfo(iParams param) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_BARCODE, WMS_MesMaterial>((t, m) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.MATERIALCODE == m.MCode |
| | | )) |
| | | .WhereIF(!string.IsNullOrEmpty(param.sn), (t, m) => t.BARCODE.Contains(param.sn)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.startDate), (t, m) => t.CreationTime >= Convert.ToDateTime(param.startDate)) |
| | | .WhereIF(!string.IsNullOrEmpty(param.endDate), (t, m) => t.CreationTime < Convert.ToDateTime(param.endDate)) |
| | | .Select((t, m) => new iSplitInfo |
| | | { |
| | | sn = t.BARCODE, |
| | | MaterialCode = t.MATERIALCODE, |
| | | MaterialName = m.MDesc, |
| | | ParentBoxBarcode = t.PARENTBOXBARCODE, |
| | | SourceCode = t.SOURCECODE, |
| | | QTY = t.PACKQTY, |
| | | UpdateDate = t.LastModificationTime |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | private static readonly IReceiptInfo _IReceiptInfo = BizContext.Container.Resolve<IReceiptInfo>(); |
| | | /// <summary> |
| | | /// å°è´§åçææ¥å£ æ¸
ç¹ç³»ç» --> wms, æ¥å£éwmså®ä¹ |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | public ApiAction GenerateReceipt(iReceiptInput input) |
| | | { |
| | | var action = new ApiAction(); |
| | | bool isIQCOk = true; |
| | | try |
| | | { |
| | | string msg = ""; |
| | | if (!input.iReceipts.Any()) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}没æå¯ä»¥æäº¤çæ¸
ç¹æ°æ®"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | |
| | | var judian = BizConfig.Configuration["JuDian"]; |
| | | var requestJson = JsonConvert.SerializeObject(input); |
| | | var response = HttpHelper.PostAsync("http://172.18.8.56:9631/api/WMS/GenerateReceiptNew/", requestJson).Result; |
| | | action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | return action; |
| | | //if (input.StrongHold != judian) |
| | | //{ |
| | | // var requestJson = JsonConvert.SerializeObject(input); |
| | | // //if (input.StrongHold == "AHXC") |
| | | // //{ |
| | | // // var response = HttpHelper.PostAsync("http://172.18.8.56:9529/api/WMS/GenerateReceipt", requestJson).Result; |
| | | // // action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // // return action; |
| | | // //} |
| | | // if (input.StrongHold == "DGXC" || input.StrongHold == "AHXC") |
| | | // { |
| | | // //return _IReceiptInfo.GenerateReceipt(input); |
| | | |
| | | // var response = HttpHelper.PostAsync("http://172.18.8.56:9631/api/WMS/GenerateReceiptNew/", requestJson).Result; |
| | | // action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // return action; |
| | | // } |
| | | // if (input.StrongHold == "XCSJ") |
| | | // { |
| | | // var response = HttpHelper.PostAsync("http://172.18.8.56:9527/api/WMS/GenerateReceipt/", requestJson).Result; |
| | | // action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // return action; |
| | | // } |
| | | //} |
| | | var usercode = "00000"; |
| | | switch (input.CompanyCode) |
| | | { |
| | | case "XCQX": |
| | | usercode = "LX0001"; |
| | | break; |
| | | case "XCHF": |
| | | usercode = "AA0001"; |
| | | break; |
| | | case "XCTH": |
| | | //usercode = "AA0001"; |
| | | break; |
| | | case "XCTX": |
| | | usercode = "TA0001"; |
| | | break; |
| | | } |
| | | //å¾
æäº¤æ°æ®ææ¥æºåå·åç»ï¼ASN/POï¼ |
| | | var srcBills = input.iReceipts |
| | | .Select(p => new { BillCode = p.DeliveryNo }) |
| | | .GroupBy(p => p.BillCode) |
| | | .ToList(); |
| | | List<WMS_RECEIPT_H> receiptHeaders = new List<WMS_RECEIPT_H>(); |
| | | List<WMS_RECEIPT_D> receiptDetails = new List<WMS_RECEIPT_D>(); |
| | | List<WMS_RECEIPT_SCAN> receiptScans = new List<WMS_RECEIPT_SCAN>(); |
| | | List<Detail> details = new List<Detail>(); |
| | | List<WMS_IQC_H> iqcHeaders = new List<WMS_IQC_H>(); |
| | | List<WMS_PO_D> poDetails = new List<WMS_PO_D>(); |
| | | int billid = 1; |
| | | foreach (var srcBill in srcBills) |
| | | { |
| | | var asnHeader = Biz.Db.Queryable<WMS_SRM_ASN>().Where(x => x.DeliveryNo == srcBill.Key).First(); |
| | | if (asnHeader == null) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}SRM䏿¥ä¸å°æ°æ®"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | //è·åASNè¡æç» |
| | | var asnLines = Biz.Db.Queryable<WMS_SRM_ASN_LINES>().Where(x => x.DeliveryNo == srcBill.Key).ToList(); |
| | | if (asnLines == null) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}SRM䏿¥ä¸å°ASNè¡æç»"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | var asnBarcodeList = Biz.Db.Queryable<WMS_SRMSNList>().Where(x => x.DeliveryNo == srcBill.Key).ToList(); |
| | | if (asnBarcodeList == null) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}SRM䏿¥ä¸å°ASNè¡æç»"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | |
| | | if (asnBarcodeList.Count > input.iReceipts.Where(x => x.DeliveryNo == srcBill.Key).ToList().Count) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}éè´§å[{srcBill.Key}]è¿ææ¡ç æªæ«ææ¸
ç¹ï¼ä¸è½çæå°è´§å"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | if (Biz.Db.Queryable<WMS_RECEIPT_SCAN>().Where(x => x.BILLCODE == srcBill.Key).Any()) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}éè´§å[{srcBill.Key}]å·²ç»æ«æè¿ä¸è½åæ«æ"; |
| | | action.Message = msg; |
| | | return action; |
| | | } |
| | | List<string> asnLinesNum = new List<string>(); |
| | | asnLinesNum = asnLines.Select(x => x.productCode).Distinct().ToList(); |
| | | |
| | | List<string> tempBarcodesNum = new List<string>(); |
| | | tempBarcodesNum = input.iReceipts.Where(x => x.DeliveryNo == srcBill.Key).ToList().Select(x => x.MaterialCode).Distinct().ToList(); |
| | | |
| | | if (asnLinesNum.Count > tempBarcodesNum.Count) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}éè´§å[{srcBill.Key}]è¿ææå·æªæ«ææ¸
ç¹ï¼ä¸è½çæå°è´§å"; |
| | | return action; |
| | | } |
| | | |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}éè´§å[{srcBill.Key}]æ»æ°[{asnBarcodeList.Count}]ï¼æ«ææ»æ°[{input.iReceipts.Where(x => x.DeliveryNo == srcBill.Key).ToList().Count}]"; |
| | | |
| | | // çææ¶æå |
| | | // æ°å»ºä¸ä¸ª Header |
| | | var nReceiptHeader = new WMS_RECEIPT_H |
| | | { |
| | | BILLCODE = GetBillNoByType("RECEIPT"), |
| | | BILLDATE = DateTime.Now, |
| | | STATUS = (int)WMS_RECEIPT_H.ReceiptStatus.Add, |
| | | BIZTYPE = (int)WMS_RECEIPT_H.ReceiptBizType.PO, |
| | | SUPPLIERCODE = asnHeader.innerVendorCode, |
| | | CreationTime = DateTime.Now, |
| | | CreatorUserId = 1 |
| | | }; |
| | | var nHeaderId = Biz.Db.Insertable(nReceiptHeader).ExecuteReturnBigIdentity(); |
| | | nReceiptHeader.Id = nHeaderId; |
| | | |
| | | // çææ¶æåè¡æç» |
| | | var nLineSeq = 1; |
| | | foreach (var asnLine in asnLines) |
| | | { |
| | | //订åç©æè¡(å¯ä¸) |
| | | int poline = Convert.ToInt32(asnLine.poLineNo.Split('-')[0]); |
| | | var nOrderDetail = Biz.Db.Queryable<WMS_PO_D>().Where(x => x.BILLCODE.ToUpper() == asnLine.poErpNo.ToUpper() && x.BILLLINE == poline).First(); |
| | | if (asnBarcodeList == null) |
| | | { |
| | | action.IsSuccessed = false; |
| | | msg += $"{msg.IsNullOrEmpty("", "ï¼")}订å䏿¥ä¸å°æ°æ®"; |
| | | return action; |
| | | } |
| | | nOrderDetail.ARRIVALQTY = (nOrderDetail.ARRIVALQTY ?? 0) + asnLine.deliveryQty; |
| | | poDetails.Add(nOrderDetail); |
| | | |
| | | //æå
¥æ¶æåè¡ |
| | | var nReceiptDetail = new WMS_RECEIPT_D |
| | | { |
| | | BILLCODE = nReceiptHeader.BILLCODE, |
| | | BILLLINE = nLineSeq++, |
| | | BILLID = nHeaderId, |
| | | LINESTATUS = (int)WMS_RECEIPT_H.ReceiptLineStatus.Add, |
| | | MATERIALCODE = asnLine.productCode, |
| | | UNITCODE = "", |
| | | QTY = asnLine.deliveryQty, |
| | | QTYPASS = 0, |
| | | INSTOCKQTY = 0, |
| | | RETURNQTY = 0, |
| | | PRINTQTY = 0, |
| | | ISGIVEAWAY = false, |
| | | SOURCETYPE = (int)WMS_RECEIPT_H.SourceType.Asn, |
| | | SOURCECODE = asnLine.DeliveryNo, |
| | | SOURCELINE = string.IsNullOrEmpty(asnLine.extendN01) ? asnLine.lineNo : Convert.ToInt32(asnLine.extendN01 ?? "0"), //asnLine.lineNo, |
| | | PONO = asnLine.poErpNo, |
| | | POLINE = poline, |
| | | LastModificationTime = DateTime.Now, |
| | | CreationTime = DateTime.Now, |
| | | CreatorUserId = 1 |
| | | }; |
| | | receiptDetails.Add(nReceiptDetail); |
| | | details.Add(new Detail |
| | | { |
| | | pmdtseq = nLineSeq.ToString(), |
| | | pmdt001 = string.IsNullOrEmpty(nReceiptDetail.PONO) ? asnLine.DeliveryNo : asnLine.poErpNo, |
| | | pmdt002 = asnLine.lineNo.ToString(), //string.IsNullOrEmpty(nReceiptDetail.PONO) ? asnLine.lineNo.ToString() : poline.ToString(), éè´é¡¹æ¬¡ |
| | | pmdt003 = "1", |
| | | pmdt004 = asnLine.poLineNo.Split('-').Length > 2 ? asnLine.poLineNo.Split('-')[2] : (asnLine.poLineNo ?? "1"), //éè´åæ¹åº |
| | | pmdt006 = asnLine.productCode, //"K7015AA016141", |
| | | //pmdt018 = "åç±³ç§æ", |
| | | pmdt020 = asnLine.deliveryQty.ToString(), //"100.00000", |
| | | pmdtud011 = "0" |
| | | }); |
| | | |
| | | //åå»ºéæ£å |
| | | Result<WMS_IQC_H> result = CreateIqcHeader(nReceiptDetail, "Y", Biz.Db); |
| | | if (result.Flag != Result.Flags.Success) |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = result.Message; |
| | | return action; |
| | | } |
| | | iqcHeaders.Add(result.Data); |
| | | billid++; |
| | | } |
| | | |
| | | //var asnScanTemp = await _tempRepository.GetAll().Where(x => x.CreatorUserId == (AbpSession.UserId ?? 0) && x.BillCode.ToUpper() == srcBill.Key.ToUpper()).ToListAsync(); |
| | | foreach (var scanTemp in input.iReceipts.Where(x => x.DeliveryNo == srcBill.Key).ToList()) |
| | | { |
| | | WMS_RECEIPT_SCAN scanObj = new WMS_RECEIPT_SCAN |
| | | { |
| | | Id = Guid.NewGuid().ToString(), |
| | | BILLCODE = scanTemp.DeliveryNo, |
| | | BILLLINE = 0, |
| | | SOURCETYPE = (int)WMS_RECEIPT_H.SourceType.Asn, |
| | | MATERIALCODE = scanTemp.MaterialCode, |
| | | BARCODE = scanTemp.SmallBarcode, |
| | | SCAN_BARCODE = scanTemp.SCAN_BARCODE, |
| | | CARTON = scanTemp.BigBarcode, |
| | | PALLET = scanTemp.OuterBarcode, |
| | | SUPPLIERCODE = scanTemp.innerVendorCode, |
| | | DATECODE = DateTime.Now, |
| | | //LOTNO = scanTemp.LotNo, |
| | | SCANQTY = scanTemp.SCANQTY, |
| | | //UNIT = scanTemp.Unit, |
| | | //ISGIVEAWAY = scanTemp.IsGiveAway, |
| | | RECEIPTNO = nReceiptHeader.BILLCODE, |
| | | RECEIPTLINE = 0, |
| | | STATEFLAG = WMS_RECEIPT_H.ReceiptLineStatus.PreInstock.ToString(), |
| | | LastModificationTime = DateTime.Now, |
| | | CreationTime = DateTime.Now, |
| | | CreatorUserId = 1 |
| | | }; |
| | | receiptScans.Add(scanObj); |
| | | } |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | | pmds000 = "1", |
| | | pmdsdocno = "3438", |
| | | pmdsdocdt = DateTime.Now.ToString("yyyy-MM-dd"), //"2023-04-26", //å½å¤©æ¶é´ |
| | | pmds002 = usercode, // "00000", //UserCode == "admin" ? "00000" : UserCode, //"L36783", //ç¨æ·ID |
| | | pmds003 = "", |
| | | pmds007 = nReceiptHeader.SUPPLIERCODE, //"C0006", //ä¾åºå代ç |
| | | pmds010 = srcBill.Key, //"æµè¯å®¢ä¾ææ éè´æ¶è´§", //éè´§åå· |
| | | //pmdsud001 = SecondVenderCode, //"CM017", //äºçº§ä¾åºç¼å· |
| | | detail = details |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = input.StrongHold |
| | | } |
| | | }); |
| | | if (ret.payload.std_data.execution.code == "0") //æå |
| | | { |
| | | nReceiptHeader.ERP_BILL_CODE = ret.payload.std_data.parameter.docno; |
| | | nReceiptHeader.STATUS = 3; |
| | | receiptHeaders.Add(nReceiptHeader); |
| | | action.Message += $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçæ¶è´§åå·ï¼[{ret.payload.std_data.parameter.docno}]"; |
| | | |
| | | #region çæéæ£å |
| | | foreach (var item in iqcHeaders) |
| | | { |
| | | var retIns = ErpT100.GenerateInspection(new InsInputParameter |
| | | { |
| | | parameter = new InsParameter |
| | | { |
| | | pmdsdocno = ret.payload.std_data.parameter.docno, |
| | | pmdsdocdt = DateTime.Now.ToString("yyyy-MM-dd"), |
| | | pmdtseq = item.SOURCELINE.ToString(), |
| | | pmdt020 = item.QCQTY.ToString(), |
| | | qcbadocno = "3701", |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = input.StrongHold |
| | | } |
| | | }); |
| | | if (retIns.payload.std_data.execution.code != "0") |
| | | { |
| | | isIQCOk = false; |
| | | action.IsSuccessed = false; |
| | | action.Message = $"å°è´§å[{ret.payload.std_data.parameter.docno}]ï¼å½åç¨æ·[{usercode}]ï¼ä¾åºåç¼å·[{nReceiptHeader.SUPPLIERCODE}]ï¼è¿åçä¿¡æ¯:{retIns.payload.std_data.execution.description}"; ; |
| | | //return action; |
| | | } |
| | | else |
| | | { |
| | | action.Message += $"å°è´§å[{ret.payload.std_data.parameter.docno}]ï¼å½åç¨æ·[{usercode}]ï¼ä¾åºåç¼å·[{nReceiptHeader.SUPPLIERCODE}]ï¼è¿åçä¿¡æ¯:{retIns.payload.std_data.execution.description}"; |
| | | item.ERP_BILL_CODE = retIns.payload.std_data.parameter.docno; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | else //失败 |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"å½åç¨æ·[{usercode}]ï¼ä¾åºåç¼å·[{nReceiptHeader.SUPPLIERCODE}]ï¼è¿åçä¿¡æ¯:{ret.payload.std_data.execution.description}"; |
| | | return action; |
| | | } |
| | | } |
| | | var db = Business.Biz.Db; |
| | | //ä¿åå°æ°æ®åº |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | if (receiptHeaders.Any()) |
| | | { |
| | | db.Updateable(receiptHeaders, "system").ExecuteCommand(); |
| | | } |
| | | if (poDetails.Any()) |
| | | { |
| | | db.Updateable(poDetails, "system").ExecuteCommand(); |
| | | } |
| | | if (receiptDetails.Any()) |
| | | { |
| | | db.Insertable(receiptDetails, "system").ExecuteCommand(); |
| | | } |
| | | if (receiptScans.Any()) |
| | | { |
| | | db.Insertable(receiptScans, "system").ExecuteCommand(); |
| | | } |
| | | if (action.IsSuccessed && isIQCOk) |
| | | { |
| | | db.Insertable(iqcHeaders).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | if (receiptHeaders.Any()) |
| | | { |
| | | db.Deleteable(receiptHeaders).ExecuteCommand(); |
| | | } |
| | | action.GetResponse().CatchExceptionWithLog(dbTran.ErrorException, $"å°è´§åçæå¼å¸¸"); |
| | | } |
| | | action.Message += $"{msg.IsNullOrEmpty("", "ï¼")}å°è´§åå鿣åçææåï¼"; |
| | | return action; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return action.GetResponse().CatchExceptionWithLog(ex, $"å°è´§åçæå¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | private static readonly IProdMaterialReq _IProdMaterialReq = BizContext.Container.Resolve<IProdMaterialReq>(); |
| | | /// <summary> |
| | | /// è·åT100é¢æåæ°æ® |
| | | /// </summary> |
| | | /// <param name="prd_hs"></param> |
| | | /// <returns></returns> |
| | | public ApiAction GetMaterialReq(List<WMS_PRDPICK_H> prd_hs) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | if (prd_hs.Count > 0) |
| | | { |
| | | Work.DoAsync(() => |
| | | { |
| | | Logger.Interface.Info($"å¼å§å¼æ¥æ¨éå°æ°æ°æ®åº"); |
| | | _IProdMaterialReq.GetMaterialReq(prd_hs); |
| | | }); |
| | | return action; |
| | | //var judian = BizConfig.Configuration["JuDian"]; |
| | | //foreach (var group in prd_hs.Select(q => q.ENTERPRISECODE).Distinct()) |
| | | //{ |
| | | // List<WMS_PRDPICK_H> entity_h = new(); |
| | | // List<WMS_PRDPICK_D> entity_d = new(); |
| | | // //æ¥è¯¢åºæ¥çå表 |
| | | // List<WMS_PRDPICK_D> list_d = new(); |
| | | // DbClient db; |
| | | // List<WMS_PRDPICK_H> dtls=new(); |
| | | // if (group == 88) |
| | | // { |
| | | // dtls = prd_hs.Where(q=>q.STRONGHOID== judian && q.ENTERPRISECODE==group).ToList(); |
| | | // db = Business.Biz.Db; |
| | | // foreach (var ju in prd_hs.Where(q=>q.STRONGHOID!=judian).Select(q => q.STRONGHOID).Distinct()) |
| | | // { |
| | | // if (ju == "AHXC") |
| | | // { |
| | | // var requestJson = JsonConvert.SerializeObject(prd_hs.Where(q => q.STRONGHOID == ju && q.ENTERPRISECODE == group).ToList()); |
| | | // var response = HttpHelper.PostAsync("http://172.18.8.56:9529/api/WMS/GetMaterialReq", requestJson).Result; |
| | | // action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // } |
| | | // if (ju == "DGXC") |
| | | // { |
| | | // //var requestJson = JsonConvert.SerializeObject(prd_hs.Where(q => q.STRONGHOID == ju && q.ENTERPRISECODE == group).ToList()); |
| | | // //var response = HttpHelper.PostAsync("http://172.18.8.56:9528/api/WMS/GetMaterialReq/", requestJson).Result; |
| | | // //action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // } |
| | | // if (ju == "XCSJ") |
| | | // { |
| | | // var requestJson = JsonConvert.SerializeObject(prd_hs.Where(q => q.STRONGHOID == ju && q.ENTERPRISECODE == group).ToList()); |
| | | // var response = HttpHelper.PostAsync("http://172.18.8.56:9527/api/WMS/GetMaterialReq/", requestJson).Result; |
| | | // action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // //dtls = prd_hs.Where(q => q.ENTERPRISECODE !=88 ).ToList(); |
| | | // db = Biz.DataSource["Test"].Client; |
| | | // } |
| | | // foreach (var item_h in dtls) |
| | | // { |
| | | // var prd_h = Biz.Db.Queryable<WMS_PRDPICK_H>().Where(s => s.BILLCODE == item_h.BILLCODE).Single(); |
| | | // if (prd_h?.STATUS != "COMPLETE") |
| | | // { |
| | | // prd_h = prd_h ?? new WMS_PRDPICK_H() |
| | | // { |
| | | // STATUS = "INIT", |
| | | // BIZTYPE = "1", |
| | | // CreationTime = DateTime.Now, |
| | | // CreatorUserId = 1, |
| | | // }; |
| | | // prd_h.BILLCODE = item_h.BILLCODE; |
| | | // prd_h.BILLDATE = item_h.BILLDATE; |
| | | // prd_h.SOURCETYPE = item_h.SOURCETYPE; |
| | | // prd_h.STATUS = prd_h.STATUS == "DELETE"? "INIT": prd_h.STATUS; |
| | | // prd_h.REMARK = item_h.REMARK; |
| | | // prd_h.SOURCECODE = item_h.SOURCECODE; |
| | | // prd_h.LastModificationTime = DateTime.Now; |
| | | // //prd_h.ENTERPRISECODE = item_h.ENTERPRISECODE; |
| | | // //prd_h.STRONGHOID = item_h.STRONGHOID; |
| | | |
| | | // entity_h.Add(prd_h); |
| | | // } |
| | | // } |
| | | |
| | | // //ä¿åå°æ°æ®åº |
| | | // var dbTran = db.UseTran(() => |
| | | // { |
| | | // db.Storageable(entity_h, "system").ExecuteCommand(); |
| | | |
| | | // }); |
| | | // if (!dbTran.IsSuccess) |
| | | // { |
| | | // action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®ä¿å失败"); |
| | | // } |
| | | |
| | | // //弿¥æåå身å表 |
| | | // Work.DoAsync(() => |
| | | // { |
| | | // GenerateReqDetail(dtls,db); |
| | | // }); |
| | | // action.Message += $"æå颿åå头宿ï¼è°ç¨å¼æ¥æå身ã"; |
| | | //} |
| | | |
| | | } |
| | | |
| | | return action; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return action.GetResponse().CatchExceptionWithLog(ex, $"颿åçæå¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®é¢æå头æå身 |
| | | /// </summary> |
| | | /// <param name="dtls"></param> |
| | | /// <param name="db"></param> |
| | | /// <returns></returns> |
| | | private static ApiAction GenerateReqDetail(List<WMS_PRDPICK_H> dtls, DbClient db) |
| | | { |
| | | Thread.Sleep(5000); |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | var judian = BizConfig.Configuration["JuDian"]; |
| | | List<WMS_PRDPICK_H> entity_h = new(); |
| | | List<WMS_PRDPICK_D> entity_d = new(); |
| | | List<WMS_TRANSFER_H> transferH = new(); |
| | | List<WMS_SCTRWO_TRANSFER> sctrwos = new(); |
| | | //æ¥è¯¢åºæ¥çå表 |
| | | List<WMS_PRDPICK_D> list_dOld = new(); |
| | | foreach (var item_h in dtls) |
| | | { |
| | | var prd_h = Biz.Db.Queryable<WMS_PRDPICK_H>().Where(s => s.BILLCODE == item_h.BILLCODE).Single(); |
| | | if (prd_h?.STATUS != "COMPLETE") |
| | | { |
| | | var list_d = Biz.Db.Queryable<WMS_PRDPICK_D>().Where(s => s.BILLCODE == item_h.BILLCODE).ToList(); |
| | | |
| | | var item_h_list = new List<WMS_PRDPICK_D>(); |
| | | var ret = DI.Resolve<IErpT100>().GetMaterialReqDetail(new ReqInputParameter |
| | | { |
| | | parameter = new reqParameter { sfdcdocno = item_h.BILLCODE }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = item_h.ENTERPRISECODE.ToString(), |
| | | CompanyId = judian |
| | | } |
| | | }); |
| | | List<reqParameterReturn> ret_list = new List<reqParameterReturn>(); |
| | | if (ret.payload.std_data.execution.code != "0") |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"é误信æ¯ï¼[{ret.payload.std_data.execution.description}]"; |
| | | Logger.Default.Info(action.Message); |
| | | var dt = DateTime.Now; |
| | | while ((dt - DateTime.Now).TotalSeconds < 10) |
| | | { |
| | | |
| | | } |
| | | var ret1 = DI.Resolve<IErpT100>().GetMaterialReqDetail(new ReqInputParameter |
| | | { |
| | | parameter = new reqParameter { sfdcdocno = item_h.BILLCODE }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = item_h.ENTERPRISECODE.ToString(), |
| | | CompanyId = judian |
| | | } |
| | | }); |
| | | if (ret1.payload.std_data.execution.code != "0") |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"é误信æ¯ï¼[{ret1.payload.std_data.execution.description}]"; |
| | | Logger.Default.Info(action.Message); |
| | | return action; |
| | | } |
| | | else |
| | | { |
| | | ret_list = ret1.payload.std_data.parameter.@return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ret_list = ret.payload.std_data.parameter.@return; |
| | | } |
| | | foreach (var item in ret_list) |
| | | { |
| | | WMS_PRDPICK_D d = new WMS_PRDPICK_D |
| | | { |
| | | BILLCODE = item.sfdcdocno, |
| | | BILLLINE = Convert.ToInt32(item.sfdcseq), |
| | | UNITCODE = item.sfdc006, |
| | | MATERIALCODE = item.sfdc004, |
| | | PRQTY = Convert.ToDecimal(item.sfdc007), |
| | | DELIVERYDATE = Convert.ToDateTime(item.sfdareqdt), |
| | | WAREHOUSECODE = item.sfdc012, |
| | | SOURCETYPE = Convert.ToInt32(item.sfdc003), |
| | | SOURCECODE = item.sfdc001, |
| | | SOURCELINE = Convert.ToInt32(item.sfdc002), |
| | | }; |
| | | item_h_list.Add(d); |
| | | } |
| | | |
| | | //ä¿åå§å¤å·¥åå·å¯¹åºå
³ç³» |
| | | WMS_SCTRWO_TRANSFER sctr = new WMS_SCTRWO_TRANSFER |
| | | { |
| | | ID = Guid.NewGuid().ToString("N"), |
| | | ORIGINAL_WORKORDER = ret_list[0]?.sfdc001, |
| | | TARGET_WORKORDER = ret_list[0]?.sfdc001_1 |
| | | }; |
| | | sctrwos.Add(sctr); |
| | | action.Message += $"ï¼é¢æåæç»è·åæåï¼[{string.Join(",", item_h_list.Select(x => x.BILLCODE + ";" + x.MATERIALCODE).ToList())},è·åæ»æ°[{item_h_list.Count}]ï¼æ°æ®åºä¸æ»æ°[{list_d.Count}]"; |
| | | action.Message += $"ï¼å§å¤å·¥åï¼[{string.Join(",", sctrwos.Select(x => x.ORIGINAL_WORKORDER + ";" + x.TARGET_WORKORDER).ToList())}"; |
| | | if (list_d.Count != item_h_list.Count) |
| | | { |
| | | foreach (var d in list_d) { d.PRQTY = 0; } //éæ±æ°éé½å¼æ0 |
| | | } |
| | | int n = 0; |
| | | List<WMS_PRDPICK_D> prdDList = new List<WMS_PRDPICK_D>(); |
| | | foreach (var item_d in item_h_list) |
| | | { |
| | | //æ ¹æ®åæ®éæ°å°æ°æ®æ¥æ¾ç¸åºçåæ®æç» |
| | | var prd_d = list_d.Where(s => s.BILLCODE == item_d.BILLCODE && s.BILLLINE == item_d.BILLLINE).FirstOrDefault(); |
| | | prd_d = prd_d ?? new WMS_PRDPICK_D() |
| | | { |
| | | LINESTATUS = "INIT", |
| | | QTY = Convert.ToDecimal(0), |
| | | CreationTime = DateTime.Now, |
| | | CreatorUserId = 1, |
| | | }; |
| | | prd_d.BILLCODE = item_d.BILLCODE; |
| | | prd_d.BILLLINE = item_d.BILLLINE; |
| | | prd_d.UNITCODE = item_d.UNITCODE; |
| | | prd_d.MATERIALCODE = item_d.MATERIALCODE; |
| | | prd_d.PRQTY = Convert.ToDecimal(item_d.PRQTY); |
| | | prd_d.DELIVERYDATE = Convert.ToDateTime(item_d.DELIVERYDATE); |
| | | prd_d.WAREHOUSECODE = item_d.WAREHOUSECODE; |
| | | prd_d.LINESTATUS = prd_d.PRQTY == prd_d.QTY ? "COMPLETE" : Convert.ToDecimal(item_d.PRQTY) == 0 ? "COMPLETE" : prd_d.LINESTATUS == "DELETE" ? "INIT" : prd_d.LINESTATUS; |
| | | prd_d.SOURCETYPE = item_d.SOURCETYPE; |
| | | prd_d.SOURCECODE = item_d.SOURCECODE; |
| | | prd_d.SOURCELINE = item_d.SOURCELINE; |
| | | prd_d.LastModificationTime = item_d.LastModificationTime; |
| | | list_d.RemoveAll(q => q.BILLCODE == item_d.BILLCODE && q.BILLLINE == item_d.BILLLINE); |
| | | if (prd_d.LINESTATUS == "COMPLETE") { n++; } |
| | | prdDList.Add(prd_d); |
| | | entity_d.Add(prd_d); |
| | | } |
| | | if (prdDList.Count == n) { prd_h.STATUS = "COMPLETE"; } |
| | | entity_h.Add(prd_h); |
| | | list_dOld.AddRange(list_d); |
| | | //æ£æ¥ææ²¡æè°æ¨åï¼æå°±æ´æ°ç¶æä¸ºå®æ |
| | | var transferList = Biz.Db.Queryable<WMS_TRANSFER_H>().Where(s => s.SOURCECODE == prd_h.BILLCODE).ToList(); |
| | | if (transferList.Any()) |
| | | { |
| | | foreach (var item in transferList) |
| | | { |
| | | item.STATUS = "COMPLETE2"; |
| | | item.LastModificationTime = DateTime.Now; |
| | | item.SOURCECODE = prd_h.BILLCODE; |
| | | transferH.Add(item); |
| | | action.Message += $"ï¼é¢æå[{prd_h.BILLCODE}]对åºè°æ¨å[{item.BILLCODE}]宿"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //ä¿åå°æ°æ®åº |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Storageable(entity_h, "system").ExecuteCommand(); |
| | | db.Storageable(entity_d, "system").ExecuteCommand(); |
| | | if (transferH.Any()) |
| | | { |
| | | db.Updateable(transferH).ExecuteCommand(); |
| | | } |
| | | if (sctrwos.Any()) |
| | | { |
| | | //db.Insertable(sctrwos).ExecuteCommand(); |
| | | var y = db.Storageable(sctrwos) |
| | | .WhereColumns(t => new { t.ORIGINAL_WORKORDER, t.TARGET_WORKORDER }) |
| | | .ToStorage(); |
| | | y.AsInsertable.ExecuteCommand(); |
| | | y.AsUpdateable.IgnoreColumns(t => t.ID).ExecuteCommand(); |
| | | } |
| | | if (list_dOld.Any()) |
| | | { |
| | | db.Deleteable(list_dOld).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®ä¿å失败"); |
| | | } |
| | | Logger.Default.Info(action.Message); |
| | | return action; |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | return action.GetResponse().CatchExceptionWithLog(ex, $"颿åçæå¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æè§£æ¡ç |
| | | /// </summary> |
| | | /// <param name="nFullBarcode"></param> |
| | | /// <param name="nPackageBarcode"></param> |
| | | /// <returns></returns> |
| | | public static Result<InputBarcodeDto> SplitFullBarcode(string nFullBarcode, bool nPackageBarcode = false) |
| | | { |
| | | Result<InputBarcodeDto> result = new(Result.Flags.Success, $"è§£ææ¡ç [{nFullBarcode}]æå"); |
| | | //è¯å«æ°çè¯å«äºç»´ç è§åï¼ä»¥Vå¼å¤´ï¼å¦åææ§è¯å«æ¨¡å¼ |
| | | if (nFullBarcode.Substring(0, 1).ToUpper() == "V") |
| | | { |
| | | return SplitFullBarcodeNew(nFullBarcode, nPackageBarcode); |
| | | } |
| | | |
| | | // æ§æ ¼å¼æ¡ç ï¼é½æ¯æå°æ¹æ¬¡æ ç¾ï¼éå
è£
æ ç¾ |
| | | nPackageBarcode = false; |
| | | |
| | | //æ°æ¡ç è§£æ |
| | | var nSplitArray = nFullBarcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); |
| | | if (nSplitArray.Length == 1) //ä¸ç»´ç |
| | | { |
| | | result.Data = new InputBarcodeDto |
| | | { |
| | | Barcode = nFullBarcode |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | var nOrderNo = ""; |
| | | var nMaterialCode = ""; |
| | | var nBarcodeLotNo = ""; |
| | | var nLotQty = ""; |
| | | var nLotDate = ""; |
| | | var nStateFlag = ""; |
| | | bool isBox = false; |
| | | var nLotNo = ""; |
| | | |
| | | |
| | | foreach (string item in nSplitArray) |
| | | { |
| | | string itemKey = item.Substring(0, 1).ToUpper(); |
| | | string itemValue = item.Substring(1); |
| | | if (itemKey == "V") |
| | | { //éè´è®¢åå· |
| | | nOrderNo = itemValue; |
| | | } |
| | | else if (itemKey == "P") |
| | | { //æ¡ç æå· |
| | | nMaterialCode = itemValue; |
| | | } |
| | | else if (itemKey == "S") |
| | | { //æ¥æå¤å
æ¡ç |
| | | nBarcodeLotNo = itemValue; |
| | | //nBarcodeLotNo = item;//PAG ID è§£æåºæ¥çæ°æ®åç¼âSâä¸ç¨å»æ |
| | | //if (itemValue.StartsWith("C") || itemValue.StartsWith("P")) //ä¸ç®±ï¼Cï¼åæ æ¿ï¼Pï¼ï¼éè¦åæ¬¡å»æä¸ä½ |
| | | // nBarcodeLotNo = itemValue.Substring(1); |
| | | } |
| | | else if (itemKey == "Q") |
| | | { //æ¡ç æ°é |
| | | nLotQty = itemValue; |
| | | } |
| | | else if (itemKey == "D") |
| | | { //çäº§æ¥æ(廿-ï¼å
¼å®¹å¸¦-çæ¶é´æ ¼å¼ï¼åé¢ç»ä¸æ¶é´è§£æ) |
| | | nLotDate = itemValue; |
| | | //nLotDate = itemValue.Replace("-", ""); |
| | | } |
| | | else if (itemKey == "L") |
| | | { //æ¹å· |
| | | nLotNo = itemValue; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if (nMaterialCode == "" || nLotQty == "" || nBarcodeLotNo == "") |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ°æ®æè¯¯"; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | // 夿æ ç¾æ°éæ¯å¦åæ³ |
| | | if (!decimal.TryParse(nLotQty, out decimal nBarcodeQty)) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¡ç æ°é"; |
| | | return result; |
| | | } |
| | | |
| | | // è§£æDateCode |
| | | DateTime nDateCode = DateTime.MinValue; |
| | | if (nLotDate != "") |
| | | { |
| | | //string dateTimeStr = nLotDate.Substring(0, 4) + "-" + nLotDate.Substring(4, 2) + "-" + nLotDate.Substring(6, 2); |
| | | |
| | | //if (!DateTime.TryParse(dateTimeStr, out nDateCode)) |
| | | ////if (!DateTime.TryParse(nLotDate, out DateTime nDateCode)) |
| | | //{ |
| | | // throw new UserFriendlyException("æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æ"); |
| | | //} |
| | | |
| | | /// åå§DateCode ä¸ºæ¥æ |
| | | if (nLotDate.Length > 6) |
| | | { |
| | | var sDate = nLotDate; |
| | | if (nLotDate.Length == 7) { sDate = $"{nLotDate.Substring(0, 4)}0{nLotDate.Substring(4)}"; } |
| | | IFormatProvider ifp = new CultureInfo("zh-CN", true); |
| | | DateTime.TryParseExact(sDate, "yyyyMMdd", ifp, DateTimeStyles.None, out nDateCode); |
| | | } |
| | | |
| | | /// åå§DateCode 为年ã卿¬¡ï¼YYYYWW / YYWWï¼ |
| | | int yw = 0; |
| | | if (nLotDate.Length <= 6 && int.TryParse(nLotDate, out yw)) |
| | | { |
| | | nDateCode = GetWeekStartTime(nLotDate); |
| | | } |
| | | |
| | | if (nDateCode == DateTime.MinValue) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æ"; |
| | | return result; |
| | | } |
| | | |
| | | } |
| | | |
| | | // å¤æç©æä»£ç æ¯å¦åæ³ |
| | | var nMaterial = Biz.Db.Queryable<WMS_MesMaterial>().Where(q => q.MCode.ToUpper() == nMaterialCode.ToUpper() || q.MCode.ToUpper() == "K" + nMaterialCode.ToUpper()).First(); |
| | | if (nMaterial == null) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç 对åºçç©æä¸åå¨"; |
| | | return result; |
| | | } |
| | | |
| | | // 夿å
è£
æ¡ç æ ¼å¼æ¯å¦åæ³ |
| | | if (nPackageBarcode && nBarcodeLotNo.Length != 12) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¥æå¤å
æ¡ç æ ¼å¼é误ï¼åºå
å«12ä½åç¬¦çæ¹æ¬¡å·"; |
| | | return result; |
| | | } |
| | | |
| | | if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_semimanufacture" && nBarcodeLotNo.Length < 16) //5ä½ä¾åºå+8使¥æ+3使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"åæåæ¡ç çæ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«16ä½å符"; |
| | | return result; |
| | | } |
| | | |
| | | if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_finishedproduct" && nBarcodeLotNo.Length < 17) //5ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æåç®±å·æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«17ä½å符"; |
| | | return result; |
| | | } |
| | | |
| | | if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_rawmaterial" && nBarcodeLotNo.Length < 15)//4ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"ç©ææ¡ç æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«15ä½å符"; |
| | | return result; |
| | | } |
| | | result.Data = new InputBarcodeDto |
| | | { |
| | | OrderNo = nOrderNo, |
| | | Barcode = nBarcodeLotNo, |
| | | MaterialCode = nMaterial?.MCode, |
| | | MaterialName = nMaterial?.MName, |
| | | MaterialStandard = nMaterial?.MDesc, |
| | | MGroupCode = nMaterial?.MGroupCode, |
| | | Unit = nMaterial?.MUom, |
| | | LotQty = nBarcodeQty, |
| | | LotDate = nDateCode, |
| | | LotDateString = nLotDate, |
| | | PeriodDays = nMaterial.PERIODDAYS, |
| | | FIFO = nMaterial.FIFO, |
| | | SafeStorageQty = nMaterial.SAFEQTY, |
| | | StateFlag = nStateFlag, |
| | | IsBox = isBox, |
| | | //SnList = snList, |
| | | LotNo = nBarcodeLotNo, |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ææ°è§£ç è§å,SRM æ ç¾ |
| | | /// æè§£æ¡ç |
| | | /// 便¬¡æ¯ï¼ |
| | | ///Vï¼POï¼MOï¼ |
| | | ///Pï¼C P/Nï¼æå· |
| | | ///Nï¼Nameï¼ç©æåç§°ï¼ |
| | | ///Qï¼QTYï¼æ°éï¼ |
| | | ///Uï¼Unitï¼åä½ï¼ |
| | | ///Mï¼Mfr P/Nï¼ä¾åºåå
é¨ç®¡æ§çç©æçæå·ï¼ |
| | | ///Dï¼Date Codeï¼çäº§æ¥æï¼ç©æççäº§æ¥æï¼ |
| | | ///Lï¼Lot Codeï¼çäº§çæ¹æ¬¡ï¼ |
| | | ///Sï¼PAG IDï¼å°å
æ¹æ¬¡ä»£ç ï¼ä¹å°±æ¯æ¥æå¤å
æ¡ç ï¼ |
| | | /// </summary> |
| | | /// <param name="nFullBarcode"></param> |
| | | /// <param name="nPackageBarcode"></param> |
| | | /// <returns></returns> |
| | | public static Result<InputBarcodeDto> SplitFullBarcodeNew(string nFullBarcode, bool nPackageBarcode = false) |
| | | { |
| | | Result<InputBarcodeDto> result = new(Result.Flags.Success, $"è§£ææ¡ç [{nFullBarcode}]æå"); |
| | | var nSplitArray = nFullBarcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); |
| | | |
| | | var nOrderNo = ""; |
| | | var nMaterialCode = ""; |
| | | var nBarcodeLotNo = ""; |
| | | var nLotQty = ""; |
| | | var nLotDate = ""; |
| | | var nStateFlag = ""; |
| | | bool isBox = false; |
| | | var nLotNo = ""; |
| | | |
| | | List<Tuple<string, decimal>> snList = new List<Tuple<string, decimal>>(); |
| | | |
| | | |
| | | foreach (string item in nSplitArray) |
| | | { |
| | | string itemKey = item.Substring(0, 1).ToUpper(); |
| | | string itemValue = item.Substring(1); |
| | | if (itemKey == "V") |
| | | { //éè´è®¢åå· |
| | | nOrderNo = itemValue; |
| | | } |
| | | else if (itemKey == "P") |
| | | { //æ¡ç æå· |
| | | nMaterialCode = itemValue; |
| | | } |
| | | else if (itemKey == "S") |
| | | { //æ¥æå¤å
æ¡ç |
| | | nBarcodeLotNo = itemValue; |
| | | } |
| | | else if (itemKey == "Q") |
| | | { //æ¡ç æ°é |
| | | nLotQty = itemValue; |
| | | } |
| | | else if (itemKey == "D") |
| | | { |
| | | //çäº§æ¥æ(廿-ï¼å
¼å®¹å¸¦-çæ¶é´æ ¼å¼ï¼åé¢ç»ä¸æ¶é´è§£æ) |
| | | nLotDate = Regex.Replace(itemValue, @"[^0-9]+", ""); |
| | | } |
| | | else if (itemKey == "L") |
| | | { //æ¹å· |
| | | nLotNo = itemValue; |
| | | } |
| | | |
| | | } |
| | | |
| | | //夿æ¡ç æ¯å¦æåè¿ï¼æåè¿çä¸å¤ææ¯å¦ä¸ºASN 2022/12/17 Ben Lin |
| | | //if (!nBarcodeLotNo.Contains("-1") && !nBarcodeLotNo.Contains("-2")) |
| | | if (nBarcodeLotNo.Substring(nBarcodeLotNo.Length - 3, 2) != "-1" && nBarcodeLotNo.Substring(nBarcodeLotNo.Length - 3, 2) != "-2") //è°æ´å¤ææå
æ ç¾çæ å2023-1-2ï¼weikaiyong |
| | | { |
| | | // 夿忮ç¼å·æ¯å¦ä¸ºASN, 妿æ¯ASNï¼è°ç¨ASNæ ç¾è§£æ |
| | | if (BillIsAsn(nOrderNo)) |
| | | { |
| | | return SplitFullBarcodeAsn(nSplitArray, nPackageBarcode); |
| | | } |
| | | } |
| | | |
| | | if (nMaterialCode == "" || nLotQty == "" || nBarcodeLotNo == "") |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ°æ®æè¯¯"; |
| | | return result; |
| | | } |
| | | |
| | | var nInputSnDto = Biz.Db.Queryable<WMS_SRMSNList>().Where(q => q.OuterBarcode == nBarcodeLotNo || q.BigBarcode == nBarcodeLotNo).ToList(); |
| | | if (nInputSnDto.Any()) |
| | | { |
| | | isBox = true; |
| | | snList = nInputSnDto.Select(t => new Tuple<string, decimal>(t.SmallBarcode, t.IncludeQty)).ToList(); |
| | | } |
| | | |
| | | |
| | | if (!decimal.TryParse(nLotQty, out decimal nBarcodeQty)) |
| | | { |
| | | //throw new UserFriendlyException("æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¡ç æ°é"); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ°æ®æè¯¯"; |
| | | return result; |
| | | } |
| | | DateTime nDateCode = DateTime.Now; |
| | | if (nLotDate != "") |
| | | { |
| | | // åå§DateCode ä¸ºæ¥æ |
| | | if (nLotDate.Length > 6) |
| | | { |
| | | IFormatProvider ifp = new CultureInfo("zh-CN", true); |
| | | DateTime.TryParseExact(nLotDate, "yyyyMMdd", ifp, DateTimeStyles.None, out nDateCode); |
| | | } |
| | | |
| | | // åå§DateCode 为年ã卿¬¡ï¼YYYYWW / YYWWï¼ |
| | | int yw = 0; |
| | | if (nLotDate.Length <= 6 && int.TryParse(nLotDate, out yw)) |
| | | { |
| | | nDateCode = GetWeekStartTime(nLotDate); |
| | | } |
| | | |
| | | if (nDateCode == DateTime.MinValue) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç [{nFullBarcode}]æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æ"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | |
| | | var nMaterial = Biz.Db.Queryable<WMS_MesMaterial>().Where(q => q.MCode.ToUpper() == nMaterialCode.ToUpper()).First(); |
| | | if (nMaterial == null) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç 对åºçç©æä¸åå¨"; |
| | | return result; |
| | | } |
| | | if (!nPackageBarcode) |
| | | { |
| | | if (nPackageBarcode && nBarcodeLotNo.Length != 12) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¥æå¤å
æ¡ç æ ¼å¼é误ï¼åºå
å«12ä½åç¬¦çæ¹æ¬¡å·"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_semimanufacture" && nBarcodeLotNo.Length < 16) //5ä½ä¾åºå+8使¥æ+3使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"åæåæ¡ç çæ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«16ä½å符"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_finishedproduct" && nBarcodeLotNo.Length < 17) //5ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æåç®±å·æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«17ä½å符"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_rawmaterial" && nBarcodeLotNo.Length < 15)//4ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"ç©ææ¡ç æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«15ä½å符"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | result.Data = new InputBarcodeDto |
| | | { |
| | | OrderNo = nOrderNo, |
| | | Barcode = nBarcodeLotNo, |
| | | MaterialCode = nMaterialCode, |
| | | MaterialName = nMaterial?.MName, |
| | | MaterialStandard = nMaterial?.MDesc, |
| | | MGroupCode = nMaterial?.MGroupCode, |
| | | Unit = nMaterial?.MUom, |
| | | LotQty = nBarcodeQty, |
| | | LotDateString = nLotDate, |
| | | LotDate = nDateCode, |
| | | PeriodDays = nMaterial.PERIODDAYS, |
| | | FIFO = nMaterial.FIFO, |
| | | SafeStorageQty = nMaterial.SAFEQTY, |
| | | StateFlag = nStateFlag, |
| | | IsBox = isBox, |
| | | SnList = snList, |
| | | LotNo = nBarcodeLotNo, |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ASNæ ç¾æ¡ç è§£æ |
| | | /// æè§£æ¡ç ï¼ä¾æ¬¡æ¯ï¼ |
| | | /// Vï¼POï¼MOï¼ |
| | | /// Pï¼C P/Nï¼æå· |
| | | /// Nï¼Nameï¼ç©æåç§°ï¼ |
| | | /// Qï¼QTYï¼æ°éï¼ |
| | | /// Uï¼Unitï¼åä½ï¼ |
| | | /// Mï¼Mfr P/Nï¼ä¾åºåå
é¨ç®¡æ§çç©æçæå·ï¼ |
| | | /// Dï¼Date Codeï¼çäº§æ¥æï¼ç©æççäº§æ¥æï¼ |
| | | /// Lï¼Lot Codeï¼çäº§çæ¹æ¬¡ï¼ |
| | | /// Sï¼PAG IDï¼å°å
æ¹æ¬¡ä»£ç ï¼ä¹å°±æ¯æ¥æå¤å
æ¡ç ï¼ |
| | | /// </summary> |
| | | /// <param name="nFullBarcode"></param> |
| | | /// <param name="nBarcodeType"></param> |
| | | /// <returns></returns> |
| | | public static Result<InputBarcodeDto> SplitFullBarcodeAsn(string[] nSplitArray, bool nPackageBarcode = false) |
| | | { |
| | | Result<InputBarcodeDto> result = new(Result.Flags.Success, $"è§£æAsnæ¡ç æå"); |
| | | #region æ¹æ³åé |
| | | // æ¡ç åé |
| | | var nAsnNo = ""; |
| | | var nVendorCode = ""; |
| | | var nMaterialCode = ""; |
| | | var nBarcodeLotNo = ""; |
| | | var nLotQty = ""; |
| | | var nLotDate = ""; |
| | | var nStateFlag = ""; |
| | | bool isBox = false; |
| | | var nLotNo = ""; |
| | | |
| | | // æå°å
è£
æ¡ç å表 |
| | | List<Tuple<string, decimal>> snList = new List<Tuple<string, decimal>>(); |
| | | // éè´§åè¡æç» |
| | | List<InputAsnLineDto> asnLineList = new List<InputAsnLineDto>(); |
| | | // æå°å
è£
æ¡ç æç» |
| | | List<WMS_SRMSNList> snBarcodeList = new List<WMS_SRMSNList>(); |
| | | var nCartonNo = ""; |
| | | var nPalletNo = ""; |
| | | |
| | | // åéèµå¼ |
| | | foreach (string item in nSplitArray) |
| | | { |
| | | string itemKey = item.Substring(0, 1).ToUpper(); |
| | | string itemValue = item.Substring(1); |
| | | if (itemKey == "V") |
| | | { //éè´§åå· |
| | | nAsnNo = itemValue; |
| | | } |
| | | else if (itemKey == "P") |
| | | { //æ¡ç æå· |
| | | nMaterialCode = itemValue; |
| | | } |
| | | else if (itemKey == "S") |
| | | { //æ¥æå¤å
æ¡ç |
| | | nBarcodeLotNo = itemValue; |
| | | //nBarcodeLotNo = item;//PAG ID è§£æåºæ¥çæ°æ®åç¼âSâä¸ç¨å»æ |
| | | //if(itemValue.StartsWith("C")|| itemValue.StartsWith("P")) //ä¸ç®±ï¼Cï¼åæ æ¿ï¼Pï¼ï¼éè¦åæ¬¡å»æä¸ä½ |
| | | // nBarcodeLotNo = itemValue.Substring(1); |
| | | } |
| | | else if (itemKey == "Q") |
| | | { //æ¡ç æ°é |
| | | nLotQty = itemValue; |
| | | } |
| | | else if (itemKey == "D") |
| | | { //çäº§æ¥æ(廿-ï¼å
¼å®¹å¸¦-çæ¶é´æ ¼å¼ï¼åé¢ç»ä¸æ¶é´è§£æ) |
| | | //nLotDate = itemValue.Replace("-", ""); |
| | | nLotDate = Regex.Replace(itemValue, @"[^0-9]+", ""); |
| | | } |
| | | else if (itemKey == "L") |
| | | { //æ¹å· |
| | | nLotNo = itemValue; |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ¡ç æ°æ®æ ¡éª |
| | | if (nMaterialCode == "" || nLotQty == "" || nBarcodeLotNo == "") |
| | | { |
| | | //throw new UserFriendlyException("æ¡ç æ°æ®æè¯¯"); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ°æ®æè¯¯"; |
| | | return result; |
| | | } |
| | | |
| | | // è·åæ¡ç å表 snBarcodeList |
| | | snBarcodeList = GetSrmBarcodeList(nBarcodeLotNo); |
| | | |
| | | // 妿æå°å
è£
æ ç¾è®°å½æ°å¤§äº1ï¼å为å
è£
æ ç¾ï¼å¦å为æå°å
è£
æ ç¾ |
| | | if (BarcodeIsBox(nBarcodeLotNo)) |
| | | { |
| | | isBox = true; |
| | | } |
| | | |
| | | if (snBarcodeList.Any()) |
| | | { |
| | | snList = snBarcodeList.Select(t => new Tuple<string, decimal>(t.SmallBarcode, t.IncludeQty)).ToList(); |
| | | snBarcodeList = snBarcodeList.Select(t => new WMS_SRMSNList |
| | | { |
| | | BILLCODE = t.BILLCODE, |
| | | MATERIALCODE = t.MATERIALCODE, |
| | | SmallBarcode = t.SmallBarcode, |
| | | BigBarcode = t.BigBarcode, |
| | | OuterBarcode = t.OuterBarcode, |
| | | IncludeQty = t.IncludeQty |
| | | }).ToList(); |
| | | |
| | | // 夿æ ç¾æ¡ç ç±»å |
| | | // æ¯æå°å
è£
æ¡ç |
| | | var smallBarcode = snBarcodeList.Where(t => t.SmallBarcode == nBarcodeLotNo).FirstOrDefault(); |
| | | if (smallBarcode != null && !smallBarcode.SmallBarcode.IsNullOrEmpty()) |
| | | { |
| | | isBox = false; |
| | | nCartonNo = smallBarcode.BigBarcode; |
| | | nPalletNo = smallBarcode.OuterBarcode; |
| | | } |
| | | |
| | | // æ¯å¤ç®±æ¡ç |
| | | var bigBarcode = snBarcodeList.Where(t => t.BigBarcode == nBarcodeLotNo).FirstOrDefault(); |
| | | if (bigBarcode != null && !bigBarcode.BigBarcode.IsNullOrEmpty()) |
| | | { |
| | | isBox = true; |
| | | nCartonNo = bigBarcode.BigBarcode; |
| | | nPalletNo = bigBarcode.OuterBarcode; |
| | | } |
| | | |
| | | // æ¯æ æ¿æ¡ç |
| | | var outerBarcode = snBarcodeList.Where(t => t.OuterBarcode == nBarcodeLotNo).FirstOrDefault(); |
| | | if (outerBarcode != null && !outerBarcode.OuterBarcode.IsNullOrEmpty()) |
| | | { |
| | | isBox = true; |
| | | nCartonNo = outerBarcode.BigBarcode; |
| | | nPalletNo = outerBarcode.OuterBarcode; |
| | | } |
| | | } |
| | | |
| | | // éªè¯æ¡ç æ ç¾æ°éæ ¼å¼æ¯å¦æ£ç¡® |
| | | if (!decimal.TryParse(nLotQty, out decimal nBarcodeQty)) |
| | | { |
| | | //throw new UserFriendlyException("æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¡ç æ°é"); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¡ç æ°é"; |
| | | return result; |
| | | } |
| | | |
| | | // éªè¯æ¡ç æ ç¾æ°éä¸SRM æå°å
è£
æ°éå计æ¯å¦ä¸è´ |
| | | decimal snQtyTotal = snBarcodeList.Sum(t => t.IncludeQty); |
| | | if (nBarcodeQty != snQtyTotal) |
| | | { |
| | | //throw new UserFriendlyException("æ ç¾æ°éä¸SRMæå°å
è£
æ»æ°éä¸ä¸è´"); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ ç¾æ°éä¸SRMæå°å
è£
æ»æ°éä¸ä¸è´"; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | DateTime nDateCode = DateTime.Now; |
| | | if (nLotDate != "") |
| | | { |
| | | //å¢å å¤ææ¥æçæéæç¤º 2022/07/27 Ben Lin, 2022/07/29 Ben Lin 忬¡æ´æ° |
| | | try |
| | | { |
| | | string dateTimeStr = nLotDate.Substring(0, 4) + "-" + nLotDate.Substring(4, 2) + "-" + nLotDate.Substring(6, 2); |
| | | if (nLotDate.Length < 7) |
| | | { |
| | | if (nLotDate.StartsWith("2") && nLotDate.Length == 6) |
| | | { |
| | | dateTimeStr = $"20{nLotDate.Substring(0, 2)}-{nLotDate.Substring(2, 2)}-{nLotDate.Substring(4, 2)}"; |
| | | } |
| | | else |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç [{nBarcodeLotNo}]æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æ"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | if (!DateTime.TryParse(dateTimeStr, out nDateCode)) |
| | | //if (!DateTime.TryParse(nLotDate, out DateTime nDateCode)) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç [{nBarcodeLotNo}]æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æ"; |
| | | return result; |
| | | } |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | //Logger.Info($"ASNæ ç¾æ¡ç è§£æ =>æ¡ç [{nBarcodeLotNo}]æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æï¼{ex.Message}"); |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡æ¡ç [{nBarcodeLotNo}]æ ¼å¼éè¯¯ï¼æªåå°æ£ç¡®çæ¹æ¬¡æ¥æï¼{ex.Message}"; |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | var nMaterial = Biz.Db.Queryable<WMS_MesMaterial>().Where(t => t.MCode.ToUpper() == nMaterialCode.ToUpper()).First(); |
| | | if (nMaterial == null) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¡ç 对åºçç©æ[{nMaterialCode}]ä¸åå¨"; |
| | | return result; |
| | | } |
| | | if (!nPackageBarcode) |
| | | { |
| | | if (nPackageBarcode && nBarcodeLotNo.Length != 12) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æ¥æå¤å
æ¡ç æ ¼å¼é误ï¼åºå
å«12ä½åç¬¦çæ¹æ¬¡å·"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_semimanufacture" && nBarcodeLotNo.Length < 16) //5ä½ä¾åºå+8使¥æ+3使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"åæåæ¡ç çæ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«16ä½å符"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_finishedproduct" && nBarcodeLotNo.Length < 17) //5ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æåç®±å·æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«17ä½å符"; |
| | | return result; |
| | | } |
| | | else if (!nPackageBarcode && nMaterial.MtypeCode == "itemtype_rawmaterial" && nBarcodeLotNo.Length < 15)//4ä½ä¾åºå+8使¥æ+4使µæ°´ç |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"ç©ææ¡ç æ¹æ¬¡æ ¼å¼é误ï¼åºè³å°å
å«15ä½å符"; |
| | | return result; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region è·åéè´§åæ°æ® |
| | | // 妿æ ç¾æ²¡æéè´§åå·ï¼æ ¹æ®æ ç¾æ¡ç è·åéè´§åå· |
| | | if (nAsnNo.IsNullOrEmpty()) |
| | | { |
| | | var asnList = GetSrmAsn(nBarcodeLotNo); |
| | | var asn = asnList.FirstOrDefault(); |
| | | if (asn != null) |
| | | { |
| | | nAsnNo = asn.DeliveryNo; |
| | | nVendorCode = asn.VendorCode; |
| | | } |
| | | } |
| | | |
| | | // è·åéè´§åè¡æç» poLineList |
| | | List<InputAsnLineDto> asnLines = GetSrmAsnLines(nAsnNo, nMaterialCode); |
| | | |
| | | if (asnLines != null && asnLines.Count > 0) |
| | | { |
| | | foreach (var line in asnLines) |
| | | { |
| | | // åå²poLineNoï¼1-1-1ï¼ï¼ç¨-åå²ï¼åç¬¬ä¸æ®µï¼è·å PoErpLine |
| | | string[] splitLineNo = line.PoLineNo.Split('-'); |
| | | |
| | | if (splitLineNo != null && splitLineNo.Count() > 0) |
| | | { |
| | | int erpPoLine = 0; |
| | | int.TryParse(splitLineNo[0], out erpPoLine); |
| | | line.PoErpLine = erpPoLine; |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | result.Data = new InputBarcodeDto |
| | | { |
| | | AsnNo = nAsnNo, |
| | | Barcode = nBarcodeLotNo, |
| | | VendorCode = nVendorCode, |
| | | MaterialCode = nMaterialCode, |
| | | MaterialName = nMaterial?.MName, |
| | | MaterialStandard = nMaterial?.MDesc, |
| | | MGroupCode = nMaterial?.MGroupCode, |
| | | Unit = nMaterial?.MUom, |
| | | LotQty = nBarcodeQty, |
| | | LotDateString = nLotDate, |
| | | LotDate = nDateCode, |
| | | PeriodDays = nMaterial.PERIODDAYS, |
| | | FIFO = nMaterial.FIFO, |
| | | SafeStorageQty = nMaterial.SAFEQTY, |
| | | StateFlag = nStateFlag, |
| | | IsBox = isBox, |
| | | SnList = snList, |
| | | LotNo = nBarcodeLotNo, |
| | | AsnLineList = asnLines, |
| | | SnBarcodeList = snBarcodeList, |
| | | CartonNo = nCartonNo, |
| | | PalletNo = nPalletNo |
| | | }; |
| | | return result; |
| | | } |
| | | |
| | | |
| | | private static bool BarcodeIsBox(string barcode) |
| | | { |
| | | bool isBox = false; |
| | | |
| | | // ä»WMS_SRM_ASNè¡¨æ¥æ¾åæ®ç¼å·ï¼å¤ææ¯å¦ä¸ºASN |
| | | if (Biz.Db.Queryable<WMS_SRMSNList>().Where(t => t.OuterBarcode == barcode || t.BigBarcode == barcode).Any()) |
| | | isBox = true; |
| | | |
| | | return isBox; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="inputBarcode"></param> |
| | | /// <returns></returns> |
| | | public static List<SRMSNStatus> GetSrmAsn(string inputBarcode) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_SRMSNList, WMS_SRM_ASN>((t, m) => |
| | | new JoinQueryInfos( |
| | | JoinType.Left, t.DeliveryNo == m.DeliveryNo |
| | | )) |
| | | .Where((t, m) => t.SmallBarcode == inputBarcode || t.BigBarcode == inputBarcode || t.OuterBarcode == inputBarcode) |
| | | .Select((t, m) => new SRMSNStatus |
| | | { |
| | | DeliveryNo = t.DeliveryNo, |
| | | VendorCode = m.innerVendorCode, |
| | | Status = m.status |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å SRM ASN è¡ |
| | | /// </summary> |
| | | /// <param name="inputAsnNo"></param> |
| | | /// <returns></returns> |
| | | public static List<InputAsnLineDto> GetSrmAsnLines(string inputAsnNo) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_SRM_ASN_LINES>() |
| | | .Where(t => t.DeliveryNo == inputAsnNo) |
| | | .Select(t => new InputAsnLineDto |
| | | { |
| | | DeliveryNo = t.DeliveryNo, |
| | | LineNo = t.lineNo, |
| | | ProductCode = t.productCode, |
| | | PurchaseType = t.purchaseType, |
| | | PoErpNo = t.poErpNo, |
| | | PoLineNo = t.poLineNo, |
| | | DeliveryQty = t.deliveryQty |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å SRM ASN è¡ |
| | | /// </summary> |
| | | /// <param name="inputAsnNo"></param> |
| | | /// <param name="inputMaterialCode"></param> |
| | | /// <returns></returns> |
| | | public static List<InputAsnLineDto> GetSrmAsnLines(string inputAsnNo, string inputMaterialCode) |
| | | { |
| | | var query = Biz.Db.Queryable<WMS_SRM_ASN_LINES>() |
| | | .Where(t => t.DeliveryNo == inputAsnNo && t.productCode == inputMaterialCode) |
| | | .Select(t => new InputAsnLineDto |
| | | { |
| | | DeliveryNo = t.DeliveryNo, |
| | | LineNo = t.lineNo, |
| | | ProductCode = t.productCode, |
| | | PurchaseType = t.purchaseType, |
| | | PoErpNo = t.poErpNo, |
| | | PoLineNo = t.poLineNo, |
| | | DeliveryQty = t.deliveryQty |
| | | }) |
| | | .ToList(); |
| | | return query; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·å SRM æ¡ç å表 |
| | | /// </summary> |
| | | /// <param name="inputBarcode"></param> |
| | | /// <returns></returns> |
| | | public static List<WMS_SRMSNList> GetSrmBarcodeList(string inputBarcode) |
| | | { |
| | | return Biz.Db.Queryable<WMS_SRMSNList>().Where(t => t.OuterBarcode == inputBarcode || t.BigBarcode == inputBarcode || t.SmallBarcode == inputBarcode).ToList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å½åå¨ç第ä¸å¤©(ææä¸) |
| | | /// </summary> |
| | | /// <param name="yearWeek">卿°ï¼æ ¼å¼ï¼yyyywww</param> |
| | | /// <returns></returns> |
| | | private static DateTime GetWeekStartTime(string yearWeek) |
| | | { |
| | | //年份 |
| | | int year = 0; |
| | | //卿° |
| | | int weekNum = 0; |
| | | |
| | | if (yearWeek.Length == 4) |
| | | { |
| | | year = 2000 + int.Parse(yearWeek.Substring(0, 2)); |
| | | weekNum = int.Parse(yearWeek.Substring(2)); |
| | | } |
| | | |
| | | if (yearWeek.Length == 6) |
| | | { |
| | | year = int.Parse(yearWeek.Substring(0, 4)); |
| | | weekNum = int.Parse(yearWeek.Substring(4)); |
| | | } |
| | | //æ¬å¹´1æ1æ¥ |
| | | DateTime firstOfYear = new DateTime(year, 1, 1); |
| | | //æ¬å¹´1æ1æ¥ä¸æ¬å¨ææä¸ç¸å·®çå¤©æ° |
| | | int dayDiff = (firstOfYear.DayOfWeek == DayOfWeek.Sunday ? 7 : Convert.ToInt32(firstOfYear.DayOfWeek)) - 1; |
| | | //第ä¸å¨çææä¸ |
| | | DateTime firstDayOfFirstWeek = firstOfYear.AddDays(-dayDiff); |
| | | //å½åå¨çææä¸ |
| | | DateTime firstDayOfThisWeek = firstDayOfFirstWeek.AddDays((weekNum - 1) * 7); |
| | | return firstDayOfThisWeek; |
| | | } |
| | | |
| | | // æ ¹æ®åæ®ç¼å·å¤ææ¯é½ä¸º ASN |
| | | private static bool BillIsAsn(string billCode) |
| | | { |
| | | // ä»WMS_SRM_ASNè¡¨æ¥æ¾åæ®ç¼å·ï¼å¤ææ¯å¦ä¸ºASN |
| | | return Biz.Db.Queryable<WMS_SRMSNList>().Where(q => q.DeliveryNo == billCode).Any(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·ååå·æ ¹æ®åæ®ç±»å |
| | | /// </summary> |
| | | /// <param name="billType"></param> |
| | | /// <returns></returns> |
| | | public static string GetBillNoByType(string billType) |
| | | { |
| | | //æ ¹æ®BillTypeå»è¡¨ä¸æ¾å°ç¸å
³åç¼ãæ¥æç ãæµæ°´å·ãé¿åº¦ |
| | | var billNoRule = Biz.Db.Queryable<MesBillNoHelper>().Where(t => t.BillType.Equals(billType)).ToList(); |
| | | if (billNoRule.Count == 1) |
| | | { |
| | | var nowRule = billNoRule[0]; |
| | | string prefix = nowRule.BillPrefix.Trim(); |
| | | string datecode = nowRule.DateCode.Trim(); |
| | | string today = DateTime.Now.ToString("yyyyMMdd"); |
| | | int serial = nowRule.SerialNo; |
| | | int maxSerial = GetMaxNumByLength(nowRule.SerialNoLength); |
| | | if (serial >= maxSerial) |
| | | { |
| | | return "over"; |
| | | } |
| | | else |
| | | { |
| | | if (datecode != string.Empty && datecode != today) |
| | | { |
| | | serial = 0; |
| | | datecode = today; |
| | | } |
| | | string serialNo = (serial + 1).ToString().PadLeft(nowRule.SerialNoLength, '0'); |
| | | //update serialNo |
| | | nowRule.DateCode = datecode; |
| | | nowRule.SerialNo = serial + 1; |
| | | Biz.Db.Updateable(nowRule).ExecuteCommand(); |
| | | //è¿åç¼å· |
| | | return prefix + datecode + serialNo; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ""; |
| | | } |
| | | } |
| | | private static int GetMaxNumByLength(int length) |
| | | { |
| | | if (length == 0) |
| | | { |
| | | return 0; |
| | | } |
| | | else |
| | | { |
| | | string strNum = string.Empty; |
| | | for (int i = 1; i <= length; i++) |
| | | { |
| | | strNum += "9"; |
| | | } |
| | | return Convert.ToInt32(strNum); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæéæ£å |
| | | /// </summary> |
| | | /// <param name="detail"></param> |
| | | /// <param name="nUrgent"></param> |
| | | /// <returns></returns> |
| | | private static Result<WMS_IQC_H> CreateIqcHeader(WMS_RECEIPT_D detail, string nUrgent, DbClient db) |
| | | { |
| | | Result<WMS_IQC_H> result = new(Result.Flags.Success, $"çæéæ£åæå"); |
| | | var nMaterial = Biz.Db.Queryable<WMS_MesMaterial>().Where(t => t.MCode.ToUpper() == detail.MATERIALCODE.ToUpper()).First(); |
| | | var nAql = Biz.Db.Queryable<WMS_IQCMATERIAL_AQL>().Where(t => t.MATERIALID.Equals(nMaterial.Id)).First(); |
| | | |
| | | var nIqcHeader = new WMS_IQC_H |
| | | { |
| | | BILLCODE = iWMS.GetBillNoByType("IQC"), |
| | | SOURCETYPE = (int)InventoryTransferSides.BillType.CustSupplyInStock, |
| | | SOURCECODE = detail.BILLCODE, |
| | | SOURCELINE = detail.BILLLINE, |
| | | PONO = detail.SOURCECODE, |
| | | POLINE = detail.POLINE ?? 0, |
| | | MEASURE = nUrgent, |
| | | QCTIMES = 0, |
| | | QCSTATUS = (int)IqcManagementSides.QCStatus.UnFinish, /*(int)IqcManagementSides.QCStatus.UnFinish,*/ |
| | | QCRESULT = (int)IqcManagementSides.QCResult.Wait, |
| | | QCREVIEW = (int)IqcManagementSides.QCReview.UnReview, |
| | | CreationTime = DateTime.Now, |
| | | CreatorUserId = 1, |
| | | MATERIALCODE = detail.MATERIALCODE |
| | | //ReceiveQty = detail.Qty, //çæéæ£åå 䏿¥æ¶æ°é 2022/07/27 Ben Lin 2022/09/03 Ben Lin 注é |
| | | }; |
| | | |
| | | var nIQCMaterial = Biz.Db.Queryable<WMS_IQCMATERIAL>().Where(t => t.MATERIALID.Equals(nMaterial.Id)).First(); |
| | | |
| | | if (nIQCMaterial == null) |
| | | { |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.NormalI; |
| | | } |
| | | //å
æ£ |
| | | else if (nIQCMaterial.CHECKTYPE == "Exemption") |
| | | { |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.Exemption; |
| | | } |
| | | //æ½æ£ |
| | | else if (nIQCMaterial.CHECKTYPE == "Sampling") |
| | | { |
| | | var nIQCMaterial2AQL = Biz.Db.Queryable<WMS_IQCMATERIAL_AQL>().Where(t => t.IQCMATERIALID.Equals(nIQCMaterial.Id)).ToList(); |
| | | if (nIQCMaterial2AQL.Any()) |
| | | { |
| | | var nIQCMaterial2CheckItem = Biz.Db.Queryable<WMS_IQCMATERIAL_CHECKITEM>().Where(t => t.IQCMATERIALID.Equals(nIQCMaterial.Id)).ToList(); |
| | | if (nIQCMaterial2CheckItem.Any()) |
| | | { |
| | | //髿£IIï¼æ½æ£ç©æï¼AQL忣éªé¡¹ç®é½ç»´æ¤äº |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.HighII; |
| | | Result<WMS_IQC_H> result1 = GetAqlSettingAsync(nAql, nIqcHeader, detail, db); |
| | | if (result1.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = result1.Flag; |
| | | result.Message = result1.Message; |
| | | } |
| | | else |
| | | { |
| | | nIqcHeader = result1.Data; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //髿£Iï¼æ½æ£ç©æï¼ç»´æ¤äºAQLã使¯æ²¡æç»´æ¤æ£éªé¡¹ç® |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.HighI; |
| | | Result<WMS_IQC_H> result2 = GetAqlSettingAsync(nAql, nIqcHeader, detail, db); |
| | | if (result2.Flag != Result.Flags.Success) |
| | | { |
| | | result.Flag = result2.Flag; |
| | | result.Message = result2.Message; |
| | | } |
| | | else |
| | | { |
| | | nIqcHeader = result2.Data; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var nIQCMaterial2CheckItem = Biz.Db.Queryable<WMS_IQCMATERIAL_CHECKITEM>().Where(t => t.IQCMATERIALID.Equals(nIQCMaterial.Id)).ToList(); |
| | | if (nIQCMaterial2CheckItem.Any()) |
| | | { |
| | | //æ®æ£IIï¼æ½æ£ç©æï¼æ²¡æç»´æ¤AQLã使¯ç»´æ¤äºæ£éªé¡¹ç® |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.NormalII; |
| | | } |
| | | else |
| | | { |
| | | //æ®æ£Iï¼æ½æ£ç©æï¼ä½æ¯æ²¡æç»´æ¤AQL忣éªé¡¹ç® |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.NormalI; |
| | | } |
| | | } |
| | | } |
| | | //å
¨æ£ |
| | | else if (nIQCMaterial.CHECKTYPE == "FullInspection") |
| | | { |
| | | nIqcHeader.QCLEVEL = (int)IqcManagementSides.QCLevel.FullInspection; |
| | | nIqcHeader.SAMPLENGQTY = detail.QTY; |
| | | } |
| | | result.Data = nIqcHeader; |
| | | return result; |
| | | } |
| | | |
| | | private static Result<WMS_IQC_H> GetAqlSettingAsync(WMS_IQCMATERIAL_AQL nAql, WMS_IQC_H nIqcHeader, WMS_RECEIPT_D nDetail, DbClient db) |
| | | { |
| | | Result<WMS_IQC_H> result = new(Result.Flags.Success, $"è·åAqlæå"); |
| | | if (nAql.AUTOSTRICT == true) |
| | | { |
| | | nIqcHeader.STRICTLEVEL = nAql.CURRENTSTRICT.IsNullOrEmpty() ? nAql.DEFAULTSTRICT : nAql.CURRENTSTRICT; |
| | | nIqcHeader.LEVELCODE = nIqcHeader.STRICTLEVEL.ToUpper() == "NORMAL" ? nAql.NORMALLEVEL : (nIqcHeader.STRICTLEVEL.ToUpper() == "STRICT" ? nAql.STRICTLEVEL : nAql.RELAXLEVEL); |
| | | nIqcHeader.AQL = nIqcHeader.STRICTLEVEL.ToUpper() == "NORMAL" ? nAql.NORMALAQLLEVEL : (nIqcHeader.STRICTLEVEL.ToUpper() == "STRICT" ? nAql.STRICTAQLLEVEL : nAql.RELAXAQLLEVEL); |
| | | } |
| | | else |
| | | { |
| | | nIqcHeader.STRICTLEVEL = nAql.DEFAULTSTRICT; |
| | | nIqcHeader.LEVELCODE = nAql.DEFAULTLEVEL; |
| | | nIqcHeader.AQL = nAql.DEFAULTAQL; |
| | | } |
| | | |
| | | //æ¾å°è¯¥ LevelCodeåAqlCodeé
ç½®ä¸ï¼ç¬¦åçæ¹æ¬¡æ°éèå´ |
| | | var nAqlDetail = Biz.Db.Queryable<WMS_AQL_D>() |
| | | .Where(t => t.LEVELCODE.ToUpper() == nIqcHeader.LEVELCODE.ToUpper() && t.AQLCODE.ToUpper() == nIqcHeader.AQL.ToUpper()) |
| | | .Where(t => t.LOTMAXQTY >= nDetail.QTY && t.LOTMAXQTY <= nDetail.QTY) |
| | | .First(); |
| | | |
| | | if (nAqlDetail == null) |
| | | { |
| | | result.Flag = Result.Flags.Failed; |
| | | result.Message = $"æªè½å¨æ°´å[{nIqcHeader.LEVELCODE}]ä¸çAQL[{nIqcHeader.AQL}]䏿¾å°ç¬¦å[{nDetail.QTY}]çæ¹æ¬¡èå´"; |
| | | } |
| | | |
| | | nIqcHeader.BEGINQTY = nAqlDetail.LOTMINQTY; |
| | | nIqcHeader.ENDQTY = nAqlDetail.LOTMAXQTY; |
| | | nIqcHeader.SAMPLEQTY = nAqlDetail.SAMPLEQTY > nDetail.QTY ? nDetail.QTY : nAqlDetail.SAMPLEQTY; |
| | | result.Data = nIqcHeader; |
| | | |
| | | return result; |
| | | } |
| | | |
| | | }//endClass |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/MaterialInfoBusiness.cs ÐÞ¸Ä |
| | |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.SqlSugarHepler; |
| | | using Tiger.Business.WMS.iSRM; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | using Tiger.Model.DTO; |
| | | using Tiger.Model.Entitys.MES; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/OtherOutInfoBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Extensions; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/ProductInputBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.MES; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/ProductOutputtBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/ReworkBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Extensions; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/SplitBoxBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/StockInfoBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/WMS/T100ToWMS/TrasferInfoBusiness.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Extensions; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// |
ÎļþÃû´Ó Tiger.Business/TSK/DBBackup/Jobs.DbBackupJob.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// å¤ä»½å®æ¶ä»»å¡ |
ÎļþÃû´Ó Tiger.Business/TSK/ERP/Jobs.ProdMaterialReqToErpJob.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// 颿å宿¶è¿è´¦ |
ÎļþÃû´Ó Tiger.Business/TSK/ERP/Jobs.ReceiptHToErpJob.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.DTOS; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// XCXJæ®ç¹å°è´§åæ¨T100 |
| | |
| | | { |
| | | try |
| | | { |
| | | var result = Biz.iWMS.ReceiptHToErp("XCSJ", context.Trigger.ConvertToMonitor()); |
| | | var result = iWMS.ReceiptHToErp("XCSJ", context.Trigger.ConvertToMonitor()); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | Logger.Scheduler.Error($"çæå°è´§å¼å¸¸:{result.Message}"); |
| | |
| | | { |
| | | try |
| | | { |
| | | var result = Biz.iWMS.ReceiptHToErp("DGXC", context.Trigger.ConvertToMonitor()); |
| | | var result = iWMS.ReceiptHToErp("DGXC", context.Trigger.ConvertToMonitor()); |
| | | //Thread.Sleep(10*60*1000); |
| | | if (!result.IsSuccessed) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | var result = Biz.iWMS.ReceiptHToErp("AHXC", context.Trigger.ConvertToMonitor()); |
| | | var result = iWMS.ReceiptHToErp("AHXC", context.Trigger.ConvertToMonitor()); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | Logger.Scheduler.Error($"çæå°è´§å¼å¸¸:{result.Message}"); |
ÎļþÃû´Ó Tiger.Business/TSK/ERP/Jobs.VenderFromErpJob.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// XCXJæ®ç¹å°è´§åæ¨T100 |
ÎļþÃû´Ó Tiger.Business/TSK/iSRM/Jobs.QqtSrmJob.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// ä¼ä¼éSRMä½ä¸ |
| | |
| | | startDate = LastRunTime.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | endDate = LastRunTime.AddMinutes(30).ToString("yyyy-MM-dd HH:mm:ss") |
| | | }; |
| | | var result = Biz.iSRM.GetSuppDlvy(iSrmParams); |
| | | var result = iSRM.GetSuppDlvy(iSrmParams); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | Logger.Scheduler.Error($"è·åéè´§åå¼å¸¸:{result.Message}"); |
| | |
| | | var LastRunTime = LastRun.IsNullOrEmpty() ? DateTime.Now.AddMinutes(-30) : LastRun.Text.ToDateTime(); |
| | | if ((DateTime.Now - LastRunTime).TotalMinutes > 30) |
| | | { |
| | | Biz.iSRM.GetNoList(LastRunTime, LastRunTime.AddMinutes(30)); |
| | | iSRM.GetNoList(LastRunTime, LastRunTime.AddMinutes(30)); |
| | | } |
| | | //SaveLog(context, "SRMæ¥å£ä»»å¡"); |
| | | } |
| | |
| | | var dlvyList = Biz.Db.Queryable<WMS_SRMRcece>().Where(q => q.FLAW == "N").ToList(); |
| | | foreach (var dlvy in dlvyList) |
| | | { |
| | | Biz.iSRM.GetDetail(dlvy); |
| | | iSRM.GetDetail(dlvy); |
| | | } |
| | | Logger.Scheduler.Info($"SRM Get Delivery List[{dlvyList.Count}] done"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <Project Sdk="Microsoft.NET.Sdk"> |
| | | |
| | | <PropertyGroup> |
| | | <TargetFramework>net6.0</TargetFramework> |
| | | <ImplicitUsings>enable</ImplicitUsings> |
| | | <Nullable>enable</Nullable> |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\Tiger.Business\Tiger.Business.csproj" /> |
| | | <ProjectReference Include="..\Tiger.IBusiness\Tiger.IBusiness.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <Target Name="PostBuild" AfterTargets="PostBuildEvent"> |
| | | <Exec Command="xcopy /r/y/i $(ProjectDir)$(OutDir)$(AssemblyName).dll $(SolutionDir)Tiger.Api\$(OutDir)
xcopy /r/y/i $(ProjectDir)$(OutDir)$(AssemblyName).pdb $(SolutionDir)Tiger.Api\$(OutDir)
xcopy /r/y/i $(ProjectDir)$(OutDir)BizSettings.json $(SolutionDir)Tiger.Api\$(OutDir)" /> |
| | | </Target> |
| | | |
| | | </Project> |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/CustSupplyCheckingNew.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | input.AuthOption.OrgCode = input.AuthOption.OrgCode.IsNullOrEmpty() ? input.AuthOption.CurOrg : input.AuthOption.OrgCode; |
| | | Result<Inventory> result = Biz.WmsItem.GetK(input.SN, input.AuthOption, false); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.GetK(input.SN, input.AuthOption, false); |
| | | if (result.Flag != Result.Flags.Success) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //var nWarehouseCodes = nScannedBarcodes.Select(x => x.WarehouseCode).Distinct().ToList(); |
| | | |
| | | //æ°å»ºå
¶ä»å
¥åºåæ®å¤´ OtherInstockHeader |
| | | Result ruleResult = Biz.CodeRule["CI001"].Generate("CI"); //Biz.iWMS.GetBillNoByType("CI"); |
| | | Result ruleResult = Biz.CodeRule["CI001"].Generate("CI"); //iWMS.GetBillNoByType("CI"); |
| | | if (!ruleResult.IsSuccessed) |
| | | { |
| | | throw new Exception(ruleResult.ExceptionMsg.Message); |
| | |
| | | var customsData = Biz.Db.Queryable<BIZ_ERP_CUSTOMS>().Where(i => sns.Contains(i.Barcodes)).First(); |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = Biz.ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | |
| | | |
| | | foreach (var item in iqcHeaders) |
| | | { |
| | | var retIns = Biz.ErpT100.GenerateInspection(new InsInputParameter |
| | | var retIns = ErpT100.GenerateInspection(new InsInputParameter |
| | | { |
| | | parameter = new InsParameter |
| | | { |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/CustomerSupplyInNew.cs ÐÞ¸Ä |
| | |
| | | pmdt018 = billHeader.REMARK |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | var ret = ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | { |
| | | parameter = new InParameter<Detail4> |
| | | { |
| | |
| | | } |
| | | var nLocation = new WMS_LOCATION(); |
| | | input.AuthOption.OrgCode.IsNullOrEmpty(input.AuthOption.CurOrg); |
| | | Result<Inventory> result = Biz.WmsItem.GetK(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.GetK(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!onResult.IsSuccessed) { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = onResult.LocaleMsg; |
| | |
| | | pmdt018 = billHeader.REMARK |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | var ret = ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | { |
| | | parameter = new InParameter<Detail4> |
| | | { |
| | |
| | | //StateFlag = inv.StateFlag, |
| | | LocationCode = nLocation.LOCATION_CODE, |
| | | ReceiptCode = barcodeScanned?.BUSINESSCODE, |
| | | IncompleteTips = Biz.iWMS.GetERP_OTH_INTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IncompleteTips = iWMS.GetERP_OTH_INTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IsScanShelf = false |
| | | }; |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/InFinished.cs ÐÞ¸Ä |
| | |
| | | BillCode = input.FinishedNo; |
| | | action.Data = new FinishedInput |
| | | { |
| | | IncompleteTips = Biz.iWMS.GetBIZ_ERP_PROD_INips(BillCode),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IncompleteTips = iWMS.GetBIZ_ERP_PROD_INips(BillCode),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | }; |
| | | action.LocaleMsg = Biz.L("éæ©å®å·¥å
¥åºåæå"); |
| | | } |
| | |
| | | return action; |
| | | } |
| | | var nLocation = new WMS_LOCATION(); |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!onResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //StateFlag = inv.StateFlag, |
| | | LocationCode = nLocation.LOCATION_CODE, |
| | | ReceiptCode = barcodeScanned?.BUSINESSCODE, |
| | | IncompleteTips = Biz.iWMS.GetFinishedTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IncompleteTips = iWMS.GetFinishedTips(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IsScanShelf = false |
| | | }; |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/InMatStorage.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | var nLocation = new WMS_LOCATION(); |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!onResult.IsSuccessed) { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = onResult.LocaleMsg; |
| | |
| | | pmdt018 = billHeader.REMARK |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | var ret = ErpT100.GenerateOtherIn(new OtherInputParameter<Detail4> |
| | | { |
| | | parameter = new InParameter<Detail4> |
| | | { |
| | |
| | | itemDesc = inv.ItemInfo.SPEC, |
| | | qty = inv.CurPkg.QTY, |
| | | dateCode = inv.Barcode.ProdDate.ToString()??DateTime.MinValue.ToString(), |
| | | Tips = Biz.iWMS.GetERP_RECEIPTTips(barcodeScanneds[0]?.BILLCODE, barcodeScanneds[0]?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | Tips = iWMS.GetERP_RECEIPTTips(barcodeScanneds[0]?.BILLCODE, barcodeScanneds[0]?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IsScanShelf = false |
| | | }; |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/InProductionReturn.cs ÐÞ¸Ä |
| | |
| | | Result<Inventory> result = new(); |
| | | if (WarehouseName.Contains("客ä¾")) |
| | | { |
| | | result = Biz.WmsItem.GetK(input.SN, input.AuthOption, true); |
| | | result = WMS_ITEM_Biz.WmsItem.GetK(input.SN, input.AuthOption, true); |
| | | } |
| | | else |
| | | { |
| | | result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | } |
| | | if (!result.IsSuccessed) |
| | | { |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!onResult.IsSuccessed) { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = onResult.LocaleMsg; |
| | |
| | | qty = inv.CurPkg.QTY, |
| | | |
| | | dateCode = inv.Barcode.ProdDate.ToString()??DateTime.MinValue.ToString(), |
| | | Tips = Biz.iWMS.GetERP_ReturnTips(barcodeScanneds?.BUSINESSCODE, barcodeScanneds?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | Tips = iWMS.GetERP_ReturnTips(barcodeScanneds?.BUSINESSCODE, barcodeScanneds?.ITEM_CODE),//isCompleted ? "æ°éï¼0 (0ç)" : |
| | | IsScanShelf = false |
| | | }; |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/InReceipt.cs ÐÞ¸Ä |
| | |
| | | #endregion æ¥å
³åå·å¤æ |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, false); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, false); |
| | | if (result.Flag != Result.Flags.Success) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = Biz.ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | |
| | | |
| | | foreach (var item in iqcHeaders_n) |
| | | { |
| | | var retIns = Biz.ErpT100.GenerateInspection(new InsInputParameter |
| | | var retIns = ErpT100.GenerateInspection(new InsInputParameter |
| | | { |
| | | parameter = new InsParameter |
| | | { |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/LocationTransfer.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, target?.LOCATION_CODE, true); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, target?.LOCATION_CODE, true); |
| | | if (!onResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OtherInLocation.cs ÐÞ¸Ä |
| | |
| | | Result<Inventory> res = new(); |
| | | if (WarehouseName.Contains("客ä¾")) |
| | | { |
| | | res = Biz.WmsItem.GetK(input.SN, new() { UserId = "admin" }, true); |
| | | res = WMS_ITEM_Biz.WmsItem.GetK(input.SN, new() { UserId = "admin" }, true); |
| | | } |
| | | else |
| | | { |
| | | res = Biz.WmsItem.Get(input.SN, new() { UserId = "admin" }, true); |
| | | res = WMS_ITEM_Biz.WmsItem.Get(input.SN, new() { UserId = "admin" }, true); |
| | | } |
| | | //夿æ¯å¦ä¸ç»´ç |
| | | if (!res.Data.IsQRCode) |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> putonResult = Biz.WmsItem.PutOn(res.Data, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> putonResult = WMS_ITEM_Biz.WmsItem.PutOn(res.Data, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!putonResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //SourceBillCode = billCode, |
| | | LocationCode = nLocation.LOCATION_CODE, |
| | | //ReceiptCode = barcodeScanned?.BUSINESSCODE, |
| | | //IncompleteTips = isCompleted ? "æ°éï¼0 (0ç)" : Biz.iWMS.GetIncompleteTipsNew(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE), |
| | | //IncompleteTips = isCompleted ? "æ°éï¼0 (0ç)" : iWMS.GetIncompleteTipsNew(barcodeScanned?.BUSINESSCODE, barcodeScanned?.ITEM_CODE), |
| | | IsScanShelf = false |
| | | }; |
| | | action.LocaleMsg = Biz.L("å
¥åºæå{0}", res.Data.SN); |
| | |
| | | //å
¶ä»å
¥åº |
| | | if (input.ReqType == 1) |
| | | { |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | } |
| | | |
| | | //æ§è¡å
¥åº |
| | | Result<PutOnInfo> onResult = Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | Result<PutOnInfo> onResult = WMS_ITEM_Biz.WmsItem.PutOn(inv, input.AuthOption, nLocation.LOCATION_CODE); |
| | | if (!onResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //SourceBillLine = Convert.ToInt32(billLine), |
| | | LocationCode = nLocation.LOCATION_CODE, |
| | | //ReceiptCode = barcodeScanned?.BUSINESSCODE, |
| | | IncompleteTips = isCompleted ? "æ°éï¼0 (0ç)" : Biz.iWMS.GetERP_OTH_INTips(billCode, inv.ItemInfo?.ITEM_CODE), |
| | | IncompleteTips = isCompleted ? "æ°éï¼0 (0ç)" : iWMS.GetERP_OTH_INTips(billCode, inv.ItemInfo?.ITEM_CODE), |
| | | IsScanShelf = false |
| | | }; |
| | | action.Message = $"å
¶ä»å
¥åºå[{billCode}]ï¼æ¡ç [{inv.SN}],䏿¶æå"; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OtherInLocationChecking.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | input.AuthOption.OrgCode = input.AuthOption.OrgCode.IsNullOrEmpty() ? input.AuthOption.CurOrg : input.AuthOption.OrgCode; |
| | | Result<Inventory> result = WarehouseName.Contains("客ä¾") ? Biz.WmsItem.GetK(input.SN, input.AuthOption, false) : Biz.WmsItem.Get(input.SN, input.AuthOption, false); |
| | | Result<Inventory> result = WarehouseName.Contains("客ä¾") ? WMS_ITEM_Biz.WmsItem.GetK(input.SN, input.AuthOption, false) : WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, false); |
| | | if (result.Flag != Result.Flags.Success) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | //var nWarehouseCodes = nScannedBarcodes.Select(x => x.WarehouseCode).Distinct().ToList(); |
| | | |
| | | //æ°å»ºå
¶ä»å
¥åºåæ®å¤´ OtherInstockHeader |
| | | Result ruleResult = Biz.CodeRule["OI001"].Generate("OI"); //Biz.iWMS.GetBillNoByType("CI"); |
| | | Result ruleResult = Biz.CodeRule["OI001"].Generate("OI"); //iWMS.GetBillNoByType("CI"); |
| | | if (!ruleResult.IsSuccessed) |
| | | { |
| | | throw new Exception(ruleResult.ExceptionMsg.Message); |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutNoBillcode.cs ÐÞ¸Ä |
| | |
| | | UserCode = userCode; |
| | | ApiHost = apiHost; |
| | | OrgCode = orgCode; |
| | | Result ruleResult = Biz.CodeRule["NB001"].Generate("NB"); //Biz.iWMS.GetBillNoByType("CI"); |
| | | Result ruleResult = Biz.CodeRule["NB001"].Generate("NB"); //iWMS.GetBillNoByType("CI"); |
| | | if (!ruleResult.IsSuccessed) |
| | | { |
| | | throw new Exception(ruleResult.ExceptionMsg.Message); |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutOther.cs ÐÞ¸Ä |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, req.Dtls.Where(q=>q.ITEM_CODE==item.Key.ItemCode).Select(s=>s.WAREHOUSECODE).FirstOrDefault(), null, null, null, input.AuthOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, req.Dtls.Where(q=>q.ITEM_CODE==item.Key.ItemCode).Select(s=>s.WAREHOUSECODE).FirstOrDefault(), null, null, null, input.AuthOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | item.TRANS_NO = req.BILLCODE; |
| | | item.TRANS_LINE = string.Join(",", dtls.Select(x => x.BILLLINE)); |
| | | } |
| | | Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | if (!downResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutSale.cs ÐÞ¸Ä |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | item.TRANS_NO = req.BILLCODE; |
| | | item.TRANS_LINE = string.Join(",", dtls.Select(x => x.BILLLINE)); |
| | | } |
| | | Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | if (!downResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | CompanyId = OrgCode |
| | | }; |
| | | //弿¥è°ç¨T100è¿è´¦ |
| | | //Biz.iWMS.MaterialReqToErpNew(mReqPostParam); |
| | | //iWMS.MaterialReqToErpNew(mReqPostParam); |
| | | } |
| | | |
| | | action.LocaleMsg = Biz.L($"éå®åºåº =>éå®åºåºå®æï¼åå·ï¼[{req.BILLCODE}]ï¼ç¶æ:{req.STATUS.GetEnumDesc<BIZ_ERP_SALE_OUT.STATUSs>()}"); |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutSplit.cs ÐÞ¸Ä |
| | |
| | | return action; |
| | | } |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | var sctrwo = query != null ? (query.TARGET_WORKORDER.IsNullOrEmpty() ? sourcecode : query.TARGET_WORKORDER) : sourcecode; |
| | | toMes = new ProductionPickToMes() |
| | | { |
| | | qrcode = Biz.WmsItem.GetQRCode(nSplitBarcode1.SN), |
| | | qrcode = WMS_ITEM_Biz.WmsItem.GetQRCode(nSplitBarcode1.SN), |
| | | wo = sctrwo, // nCurrentLines.First().SourceCode, |
| | | pkgid = nSplitBarcode1.SN, |
| | | mfrkp = CurInv.Barcode.OEMItemCode, |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutTransfer.cs ÐÞ¸Ä |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | // item.SOURCE_CODE = "WORK_ORDER"; |
| | | // item.SOURCE_ORDER = dtls.First().SOURCECODE; |
| | | //} |
| | | //Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended); |
| | | //Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended); |
| | | //if (!downResult.IsSuccessed) |
| | | //{ |
| | | // action.IsSuccessed = false; |
| | |
| | | item.SOURCE_CODE = "WORK_ORDER"; |
| | | item.SOURCE_ORDER = dtls.First().SOURCECODE; |
| | | } |
| | | Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | if (!downResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/OutWorkOrder.cs ÐÞ¸Ä |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | item.SOURCE_CODE = "WORK_ORDER"; |
| | | item.SOURCE_ORDER = dtls.First().SOURCECODE; |
| | | } |
| | | Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | if (!downResult.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/ProductionMaterialReq.cs ÐÞ¸Ä |
| | |
| | | if (CurReqType == ReqType.IsAgv) |
| | | { |
| | | //æ¨èç©æ |
| | | Result<List<SuggestItem>> result = Biz.WmsItem.Suggest(req.BILLCODE, req.Dtls[0].ITEM_CODE, req.Dtls[0].WAREHOUSECODE, null, null, null, input.AuthOption, 1); |
| | | Result<List<SuggestItem>> result = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, req.Dtls[0].ITEM_CODE, req.Dtls[0].WAREHOUSECODE, null, null, null, input.AuthOption, 1); |
| | | action.LocaleMsg = result.LocaleMsg; |
| | | if (result.IsException) |
| | | { |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, 1); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, 1); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, item.Key.WarehouseCode, null, null, null, input.AuthOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | { |
| | | lock (item.Key.lockObj) |
| | | { |
| | | dic[item.Key] = Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, req.Dtls[0].WAREHOUSECODE, null, null, null, SelectOrderOption, item.Key.actQty); |
| | | dic[item.Key] = WMS_ITEM_Biz.WmsItem.Suggest(req.BILLCODE, item.Key.ItemCode, req.Dtls[0].WAREHOUSECODE, null, null, null, SelectOrderOption, item.Key.actQty); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | item.SOURCE_CODE = "WORK_ORDER"; |
| | | item.SOURCE_ORDER = dtls.First().SOURCECODE; |
| | | } |
| | | Result<TakeDownInfo> downResult = Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | Result<TakeDownInfo> downResult = WMS_ITEM_Biz.WmsItem.TakeDown(CurInv, input.AuthOption, WMS_ITEM.STATUSs.Sended, !isCutting); |
| | | if (!downResult.IsSuccessed) |
| | | { |
| | | ProcessingSn = ""; |
ÎļþÃû´Ó Tiger.Business/WMS/Transaction/WmsCount.cs ÐÞ¸Ä |
| | |
| | | } |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/Biz.WMS_ITEM.cs ÐÞ¸Ä |
| | |
| | | using Microsoft.CodeAnalysis; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | using System.DirectoryServices.ActiveDirectory; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.WMS; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class Biz |
| | | public class WMS_ITEM_Biz |
| | | { |
| | | private static _Biz_WmsItem _WmsItem = new(); |
| | | |
| | |
| | | var unPackQty = result.Data.Items.Sum(q => q.QTY); |
| | | db.Updateable<WMS_ITEM_PKG>().SetColumns(q => q.PARENT_SN == null).Where(q => q.ID == query.ID).ExecuteCommand(); |
| | | db.Updateable<WMS_ITEM_PKG>().SetColumns(q => q.QTY == q.QTY - unPackQty).Where(q => q.ID == query.Parent.ID).ExecuteCommand(); |
| | | if (!db.Queryable<WMS_ITEM_PKG>().Any(q => q.PARENT_SN == query.PARENT_SN && q.SN != query.SN)) |
| | | if (!Biz.Db.Queryable<WMS_ITEM_PKG>().Any(q => q.PARENT_SN == query.PARENT_SN && q.SN != query.SN)) |
| | | { |
| | | db.Deleteable(query.Parent); |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.Barcode.GetException", sn)); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.Barcode.GetException", sn)); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | var unPackQty = result.Data.Items.Sum(q => q.QTY); |
| | | db.Updateable<WMS_ITEM_PKG>().SetColumns(q => q.PARENT_SN == null).Where(q => q.ID == query.ID).ExecuteCommand(); |
| | | db.Updateable<WMS_ITEM_PKG>().SetColumns(q => q.QTY == q.QTY - unPackQty).Where(q => q.ID == query.Parent.ID).ExecuteCommand(); |
| | | if (!db.Queryable<WMS_ITEM_PKG>().Any(q => q.PARENT_SN == query.PARENT_SN && q.SN != query.SN)) |
| | | if (!Biz.Db.Queryable<WMS_ITEM_PKG>().Any(q => q.PARENT_SN == query.PARENT_SN && q.SN != query.SN)) |
| | | { |
| | | db.Deleteable(query.Parent); |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.Barcode.GetException", sn)); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.Barcode.GetException", sn)); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.PutOn.Exception", inventory.SN, targetLocation)); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.PutOn.Exception", inventory.SN, targetLocation)); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.TakeDown.Exception", inventory.SN, inventory?.Location?.LOCATION_CODE)); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.TakeDown.Exception", inventory.SN, inventory?.Location?.LOCATION_CODE)); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.Suggest.Exception")); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.Suggest.Exception")); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, L("WMS.WmsItem.Suggest.Exception")); |
| | | result.CatchExceptionWithLog(ex, Biz.L("WMS.WmsItem.Suggest.Exception")); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public string GetQRCode(string sn) |
| | | { |
| | | return Db.Queryable<WMS_ITEM>().Where(q => q.SN == sn).First()?.GetQRCode(); |
| | | return Biz.Db.Queryable<WMS_ITEM>().Where(q => q.SN == sn).First()?.GetQRCode(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var action = new ApiAction<PageAble<V_WMS_ITEM>>(); |
| | | if (input.Code != "") |
| | | { |
| | | var query = Db.Queryable<V_WMS_ITEM>().ByAuth(input.AuthOption).Where(q => q.LOCATION_CODE == input.Code).ToPage(input.pageIndex, input.pageSize); |
| | | var query = Biz.Db.Queryable<V_WMS_ITEM>().ByAuth(input.AuthOption).Where(q => q.LOCATION_CODE == input.Code).ToPage(input.pageIndex, input.pageSize); |
| | | if (query.data.Count > 0) |
| | | { |
| | | action.Data = query; |
| | |
| | | /// <returns></returns> |
| | | public PageAble<V_WMS_ITEM> QueryItemSum(QueryItemInputDtl input) |
| | | { |
| | | var ItemCode = Db.Queryable<WMS_ITEM_PKG>().ByAuth(input.AuthOption).Where(q => q.SN == input.Code).First()?.ITEM_CODE ?? |
| | | var ItemCode = Biz.Db.Queryable<WMS_ITEM_PKG>().ByAuth(input.AuthOption).Where(q => q.SN == input.Code).First()?.ITEM_CODE ?? |
| | | (input.IsK.IsNullOrEmpty() ? input.Code : (((bool)input.IsK ? "K" : "") + new Barcode(input.Code).ItemCode)); |
| | | var itemInfo = Db.Queryable<BAS_ITEM>().Where(q => q.ITEM_CODE == ItemCode).First(); |
| | | var itemInfo = Biz.Db.Queryable<BAS_ITEM>().Where(q => q.ITEM_CODE == ItemCode).First(); |
| | | if (!itemInfo.IsNullOrEmpty()) |
| | | { |
| | | var sumInfo = Db.Queryable<V_WMS_ITEM>().Where(q => q.ITEM_CODE == ItemCode && q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | var sumInfo = Biz.Db.Queryable<V_WMS_ITEM>().Where(q => q.ITEM_CODE == ItemCode && q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | .ByAuth(input.AuthOption).GroupBy(q => new { q.WH_CODE, q.ITEM_CODE }).Select(q => new { WH_CODE = q.WH_CODE, SumQty = SqlFunc.AggregateSum(q.QTY) }).ToList(); |
| | | var items = Db.Queryable<V_WMS_ITEM>().Where(q => q.ITEM_CODE == ItemCode && q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | var items = Biz.Db.Queryable<V_WMS_ITEM>().Where(q => q.ITEM_CODE == ItemCode && q.STATUS == WMS_ITEM.STATUSs.InStore.GetValue()) |
| | | .ByAuth(input.AuthOption).ToPage(input.pageIndex, input.pageSize); |
| | | items.data2 = new { ItemCode = ItemCode, ItemName = itemInfo.ITEM_NAME, SumInfo = $"{string.Join("\r\n", sumInfo.Select(q => $"{q.WH_CODE}æ»åºå: {(double)q.SumQty}"))}" }; |
| | | return items; |
| | |
| | | public static List<string> GetOrgList() |
| | | { |
| | | var DB = Biz.DataSource["WMS57"].Client; |
| | | var dataList = DB.Queryable<SYS_ORGANIZATION>().Select(i => i.ORG_CODE).Distinct().ToList();// è·åç»ç»ç¼ç |
| | | var dataList = Biz.Db.Queryable<SYS_ORGANIZATION>().Select(i => i.ORG_CODE).Distinct().ToList();// è·åç»ç»ç¼ç |
| | | |
| | | return dataList; |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/iSRM/SrmDataToSiHua.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public class SrmDataToSiHua : ISrmDataToSiHua |
| | | { |
ÎļþÃû´Ó Tiger.Business/WMS/iSRM/SrmParam.cs ÐÞ¸Ä |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace Tiger.Business.WMS.iSRM |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public class SrmParam |
| | | { |
ÎļþÃû´Ó Tiger.Business/WMS/iSRM/SrmToWms.cs ÐÞ¸Ä |
| | |
| | | using SqlSugar; |
| | | using Org.BouncyCastle.Ocsp; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public class SrmToWms : ISrmToWms |
| | | { |
| | |
| | | asn.innerVendorName = dlvy.supplierName; |
| | | //asn.deliveryType = dlvy["deliveryType"]?.ToInt32() ?? 0; |
| | | //asn.logisticsStatus = dlvy["logisticsStatus"]?.ToInt32() ?? 0; |
| | | asn.deliveryDate = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)); |
| | | asn.planArrivedDate = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)); |
| | | asn.deliveryDate = iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)); |
| | | asn.planArrivedDate = iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)); |
| | | asn.CreationTime = DateTime.Now; |
| | | asn.LastModificationTime = DateTime.Now; |
| | | //asn.updateTime = FromUnixTime(dlvy["updateTime"]?.ToInt64()); |
| | |
| | | SUPP_CODE = dlvy.supplierCode, |
| | | HANDLED = 0, |
| | | SUPP_NAME = dlvy.supplierName, |
| | | DELIVERY_DATE = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)), |
| | | PLANARRIVED_DATE = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)), |
| | | DELIVERY_DATE = iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)), |
| | | PLANARRIVED_DATE = iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)), |
| | | AUTH_ORG = dlvy.company, |
| | | }; |
| | | dlvyList.Add(_dlvy); |
| | |
| | | SUPP_CODE = dlvy.supplierCode, |
| | | HANDLED = 0, |
| | | SUPP_NAME = dlvy.supplierName, |
| | | DELIVERY_DATE = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)), |
| | | PLANARRIVED_DATE = Biz.iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)), |
| | | DELIVERY_DATE = iSRM.FromUnixTime(Convert.ToInt64(dlvy.deliveryDate)), |
| | | PLANARRIVED_DATE = iSRM.FromUnixTime(Convert.ToInt64(dlvy.bookDeliveryDate)), |
| | | AUTH_ORG = dlvy.company, |
| | | }; |
| | | if (statusitem == 0) |
ÎļþÃû´Ó Tiger.Business/WMS/iSRM/Biz.iSRM.cs ÐÞ¸Ä |
| | |
| | | using Rhea.Common.Authorization; |
| | | using Tiger.Model.Minsun; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Business.WMS.iSRM; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class Biz |
| | | { |
| | | /// <summary> |
| | | /// SRMæ°æ®æ¥å£ |
| | | /// </summary> |
| | |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | } |
ÎļþÃû´Ó Tiger.Business/WMS/iWMS/Biz.InventroyInfo.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// åºåä¿¡æ¯æ¥å£ |
ÎļþÃû´Ó Tiger.Business/WMS/iWMS/Biz.ProdMaterialReq.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public class ProdMaterialReq : IProdMaterialReq |
| | | { |
| | |
| | | if (req != null && dtlList.Where(x => x.LINESTATUS == BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue()).Count() == dtlList.Count) |
| | | { |
| | | Logger.Interface.Info($"颿å[{reqNo}]éæ°è¿è´¦åå¤è¿å
¥è¿è´¦è¿ç¨"); |
| | | Biz.iWMS.MaterialReqOldToErpNew(new MReqPostParam() {BillCode = req.BILLCODE, CompanyId=req.AUTH_ORG}); |
| | | iWMS.MaterialReqOldToErpNew(new MReqPostParam() {BillCode = req.BILLCODE, CompanyId=req.AUTH_ORG}); |
| | | } |
| | | } |
| | | Logger.Interface.Info(action.Message); |
| | |
| | | sfdc007 = qty, |
| | | }); |
| | | } |
| | | var ret = Biz.ErpT100.MaterialReqToErp(new ReqErpInputParameter |
| | | var ret = ErpT100.MaterialReqToErp(new ReqErpInputParameter |
| | | { |
| | | parameter = new Parameter4 |
| | | { |
ÎļþÃû´Ó Tiger.Business/WMS/iWMS/Biz.RePrintBarcode.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model.Entitys.WMS.Api; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | /// <summary> |
| | | /// è¡¥å°æ¡ç |
| | |
| | | OrgCode = input.AuthOption.OrgCode; |
| | | |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.SN, input.AuthOption, true); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
| | |
| | | return action; |
| | | } |
| | | |
| | | var nDisassembleBarcode = Biz.iWMS.SplitFullBarcode(input.Barcode).Data; //await _commonService.SplitFullBarcode(input.Barcode, true); |
| | | var nDisassembleBarcode = iWMS.SplitFullBarcode(input.Barcode).Data; //await _commonService.SplitFullBarcode(input.Barcode, true); |
| | | WMS_PO_H nOrderHeader = null; |
| | | List<WMS_PO_D> nOrderDetails = new List<WMS_PO_D>(); |
| | | if (nDisassembleBarcode.OrderNo != null) |
| | |
| | | return action; |
| | | } |
| | | //è§£ææ¡ç |
| | | Result<Inventory> result = Biz.WmsItem.Get(input.Barcode, new AuthOption { ByOrg = true, CurOrg = "DGXC", UserId = "admin" }, false); |
| | | Result<Inventory> result = WMS_ITEM_Biz.WmsItem.Get(input.Barcode, new AuthOption { ByOrg = true, CurOrg = "DGXC", UserId = "admin" }, false); |
| | | if (!result.IsSuccessed) |
| | | { |
| | | action.IsSuccessed = false; |
ÎļþÃû´Ó Tiger.Business/WMS/iWMS/Biz.ReceiptInfo.cs ÐÞ¸Ä |
| | |
| | | using Tiger.Model; |
| | | using Tiger.Model.Minsun; |
| | | |
| | | namespace Tiger.Business |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public class ReceiptInfo : IReceiptInfo |
| | | { |
| | |
| | | } |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = Biz.ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | |
| | | |
| | | foreach (var item in iqcHeaders) |
| | | { |
| | | var retIns = Biz.ErpT100.GenerateInspection(new InsInputParameter |
| | | var retIns = ErpT100.GenerateInspection(new InsInputParameter |
| | | { |
| | | parameter = new InsParameter |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Autofac; |
| | | using Newtonsoft.Json; |
| | | using Rhea.Common; |
| | | using SqlSugar; |
| | | using Swifter.Tools; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model; |
| | | |
| | | namespace Tiger.Business.WMS |
| | | { |
| | | public partial class iWMS : IiWMS |
| | | { |
| | | /// <summary> |
| | | /// åæååæ¶å®¡æ ¸ |
| | | /// </summary> |
| | | /// <param name="sn"></param> |
| | | /// <returns></returns> |
| | | public ApiAction MaterialRem(Model.Minsun.MaterialRem parameter) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | if (!parameter.IsNullOrEmpty()) |
| | | { |
| | | var judian = BizConfig.Configuration["JuDian"]; |
| | | Model.Minsun.WMS_PRDPICK_H entity_h = new(); |
| | | List<Model.Minsun.WMS_PRDPICK_D> entity_d = new(); |
| | | DbClient db = Business.Biz.Db; |
| | | if (parameter.ENTERPRISECODE == 88) |
| | | { |
| | | //夿æ¯ä¸æ¯æ¬æ®ç¹s |
| | | if (parameter.STRONGHOID != judian) |
| | | { |
| | | if (parameter.STRONGHOID == "AHXC") |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(parameter); |
| | | var response = HttpHelper.PostAsync("http://172.18.8.56:9529/api/WMS/parameterRem", requestJson).Result; |
| | | action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | } |
| | | if (parameter.STRONGHOID == "DGXC") |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(parameter); |
| | | var response = HttpHelper.PostAsync("http://172.18.8.56:9528/api/WMS/parameterRem", requestJson).Result; |
| | | action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | } |
| | | if (parameter.STRONGHOID == "XCSJ") |
| | | { |
| | | var requestJson = JsonConvert.SerializeObject(parameter); |
| | | var response = HttpHelper.PostAsync("http://172.18.8.56:9527/api/WMS/parameterRem/", requestJson).Result; |
| | | action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //æµè¯ |
| | | db = Biz.DataSource["Test"].Client; |
| | | } |
| | | entity_h = db.Queryable<Model.Minsun.WMS_PRDPICK_H>().Where(q => q.BILLCODE == parameter.BILLCODE).First(); |
| | | entity_d = db.Queryable<Model.Minsun.WMS_PRDPICK_D>().Where(q => q.BILLCODE == parameter.BILLCODE).ToList(); |
| | | if (!entity_h.IsNullOrEmpty()) |
| | | { |
| | | if (entity_h.STATUS == "COMPLETE") |
| | | { |
| | | action.Message = $"颿å{entity_h.BILLCODE}å·²ç»åæï¼ä¸è½åæ¶"; |
| | | action.IsSuccessed = false; |
| | | Logger.Interface.Info("å头ï¼" + action.Message); |
| | | } |
| | | else |
| | | { |
| | | entity_h.STATUS = "DELETE"; |
| | | } |
| | | if (entity_d.Count > 0) |
| | | { |
| | | foreach (var item in entity_d) |
| | | { |
| | | if (item.LINESTATUS == "COMPLETE" || item.QTY > 0) |
| | | { |
| | | action.Message = $"颿å{item.BILLCODE}å·²ç»åæï¼ä¸è½åæ¶"; |
| | | action.IsSuccessed = false; |
| | | Logger.Interface.Info("å身ï¼" + action.Message); |
| | | } |
| | | else |
| | | { |
| | | item.LINESTATUS = "DELETE"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | if (action.IsSuccessed) |
| | | { |
| | | action.Message = $"颿å{entity_h.BILLCODE}åæ¶å®¡æ ¸æå"; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(entity_h).ExecuteCommand(); |
| | | db.Updateable(entity_d).ExecuteCommand(); |
| | | //db.Storageable(entity_h, "system").ExecuteCommand(); |
| | | //db.Storageable(entity_d, "system").ExecuteCommand(); |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | } |
| | | } |
| | | Logger.Interface.Info(action.Message); |
| | | } |
| | | return action; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return action.GetResponse().CatchExceptionWithLog(ex, $"åæååæ¶å®¡æ ¸å¼å¸¸"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 颿åè¿è´¦å°T100 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public ApiAction MaterialReqToErp(MReqPostParam param) |
| | | { |
| | | var action = new ApiAction(); |
| | | Work.DoAsync(() => |
| | | { |
| | | Thread.Sleep(3000); |
| | | try |
| | | { |
| | | Model.Minsun.WMS_PRDPICK_H entity_h = Biz.Db.Queryable<Model.Minsun.WMS_PRDPICK_H>().Where(x => x.BILLCODE == param.BillCode && x.ERP_BILL_CODE == null).First(); |
| | | List<Model.Minsun.WMS_PRDPICK_D> entity_d = Biz.Db.Queryable<Model.Minsun.WMS_PRDPICK_D>().Where(x => x.BILLCODE == param.BillCode && Convert.ToInt32(x.PRQTY) != 0).ToList(); |
| | | List<Detail5> details = new List<Detail5>(); |
| | | foreach (var item in entity_d) |
| | | { |
| | | //è®¡ç®æ°é |
| | | var qty = item.QTY > item.PRQTY ? item.PRQTY.ToString() : item.QTY.ToString(); |
| | | details.Add(new Detail5 |
| | | { |
| | | sfdcseq = item.BILLLINE.ToString(), |
| | | sfdc001 = item.SOURCECODE, |
| | | sfdc002 = item.SOURCELINE.ToString(), |
| | | sfdc003 = item.SOURCETYPE.ToString(), |
| | | sfdc007 = qty, |
| | | }); |
| | | } |
| | | var ret = ErpT100.MaterialReqToErp(new ReqErpInputParameter |
| | | { |
| | | parameter = new Parameter4 |
| | | { |
| | | sfdatype = entity_h.SOURCETYPE.ToString(), |
| | | sfdadocno = entity_h.BILLCODE, |
| | | detail = details |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = param.CompanyId |
| | | } |
| | | }); |
| | | if (ret.payload.std_data.execution.code == "0") //æå |
| | | { |
| | | entity_h.ERP_BILL_CODE = ret.payload.std_data.parameter.docno; |
| | | entity_h.LastModificationTime = DateTime.Now; |
| | | action.Message += $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçERP_BILL_CODEï¼[{ret.payload.std_data.parameter.docno}]"; |
| | | Logger.Interface.Info(action.Message); |
| | | } |
| | | else //失败 |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message += $"ï¼é¢æå{entity_h.BILLCODE}è¿è´¦å¤±è´¥ï¼è¿åçä¿¡æ¯:{ret.payload.std_data.execution.description}"; |
| | | Logger.Interface.Error(action.Message); |
| | | //return action; |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | DbClient db = Business.Biz.Db; |
| | | if (action.IsSuccessed) |
| | | { |
| | | action.Message += $"ï¼é¢æå{entity_h.BILLCODE}è¿è´¦æå"; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(entity_h).ExecuteCommand(); |
| | | db.Updateable(entity_d).ExecuteCommand(); |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | Logger.Interface.Error(action.Message); |
| | | } |
| | | } |
| | | Logger.Interface.Info(action.Message); |
| | | //return action; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(ex, $"åæåè¿è´¦å¼å¸¸"); |
| | | Logger.Interface.Error(action.Message); |
| | | } |
| | | }); |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// æ°æ¡æ¶-颿åè¿è´¦å°T100 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public ApiAction MaterialReqToErpNew(MReqPostParam param) |
| | | { |
| | | var action = new ApiAction(); |
| | | Work.DoAsync(() => |
| | | { |
| | | Thread.Sleep(3000); |
| | | Logger.Interface.Info($"颿åè¿è´¦å°T100 =>å¼å§è¿è´¦ï¼åå·ï¼[{param.BillCode}ï¼{param.CompanyId}]"); |
| | | try |
| | | { |
| | | BIZ_ERP_PROD_OUT entity_h = Biz.Db.Queryable<BIZ_ERP_PROD_OUT>().Where(x => x.BILLCODE == param.BillCode && SqlFunc.IsNullOrEmpty(x.ERP_BILL_CODE)).First(); |
| | | List<BIZ_ERP_PROD_OUT_DTL> entity_d = Biz.Db.Queryable<BIZ_ERP_PROD_OUT_DTL>().Where(x => x.BILLCODE == param.BillCode && Convert.ToInt32(x.PRQTY) > 0).ToList(); |
| | | List<Detail5> details = new List<Detail5>(); |
| | | if (entity_h != null) |
| | | { |
| | | foreach (var item in entity_d) |
| | | { |
| | | //è®¡ç®æ°é |
| | | var qty = item.QTY > item.PRQTY ? item.PRQTY.ToString() : item.QTY.ToString(); |
| | | details.Add(new Detail5 |
| | | { |
| | | sfdcseq = item.BILLLINE, |
| | | sfdc001 = item.SOURCECODE, |
| | | sfdc002 = item.SOURCELINE.ToString(), |
| | | sfdc003 = item.SOURCETYPE.ToString(), |
| | | sfdc007 = qty, |
| | | }); |
| | | } |
| | | var ret = ErpT100.MaterialReqToErp(new ReqErpInputParameter |
| | | { |
| | | parameter = new Parameter4 |
| | | { |
| | | sfdatype = entity_h.SOURCETYPE.ToString(), |
| | | sfdadocno = entity_h.BILLCODE, |
| | | detail = details |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = "88", // ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = param.CompanyId |
| | | } |
| | | }); |
| | | if (ret.payload.std_data.execution.code == "0") //æå |
| | | { |
| | | entity_h.ERP_BILL_CODE = ret.payload.std_data.parameter.docno; |
| | | entity_h.UPDATE_TIME = DateTime.Now; |
| | | entity_h.HANDLED = 0; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | action.Message += $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçERP_BILL_CODEï¼[{ret.payload.std_data.parameter.docno}]"; |
| | | } |
| | | else if (ret.payload.std_data.execution.code == "S" || ret.payload.std_data.execution.code == "ain-00222") |
| | | { |
| | | entity_h.ERP_BILL_CODE = "æ¤ç¬èµæå·²è¿è´¦-system"; |
| | | entity_h.UPDATE_TIME = DateTime.Now; |
| | | entity_h.HANDLED = 0; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | action.IsSuccessed = false; |
| | | action.Message = $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçERP_BILL_CODEï¼[{ret.payload.std_data.parameter?.docno}]"; |
| | | } |
| | | else //失败 |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"颿å{entity_h.BILLCODE}è¿è´¦å¤±è´¥ï¼è¿åçä¿¡æ¯:{ret.payload.std_data.execution.description}"; |
| | | |
| | | //大äº5次就ä¸åé®ä»¶ |
| | | if (entity_h.HANDLED < 6) |
| | | { |
| | | Work.DoAsync(() => |
| | | { |
| | | MailServiceApi _IMailServiceApi = new MailServiceApi(); |
| | | _IMailServiceApi.SendMail(new MailBodyEntity |
| | | { |
| | | MailTextBody = $"Hi Allï¼<br/><br/> 颿å[{entity_h.BILLCODE}]è¿è´¦å¤±è´¥ï¼<br/> T100è¿åæ¶æ¯ï¼{ret.payload.std_data.execution.description}", |
| | | MailBodyType = "Html", |
| | | MailFilePath = null, |
| | | Recipients = Biz.SysParam.Params.Where(q => q.PRMG_CODE == "PickingEmailGroup").Select(q => q.PARAM_VALUE).ToList(), // new List<string> { "ben.lin@tigerclouds.com", "dyfang@sharetronic.com", "dianzicang@sharetronic.com" }, |
| | | Cc = new List<string>(), |
| | | Sender = "WMS Email Admin", |
| | | SenderAddress = "xcerp@sharetronic.com", |
| | | Subject = $"颿å[{entity_h.BILLCODE}]è¿è´¦å¤±è´¥", |
| | | Body = "" |
| | | }, |
| | | new SendServerConfigurationEntity |
| | | { |
| | | SmtpHost = "mail.sharetronic.com", |
| | | SmtpPort = 25, |
| | | SenderAccount = "xcerp@sharetronic.com", |
| | | SenderPassword = "sha66666", |
| | | MailEncoding = "utf-8", |
| | | IsSsl = false |
| | | }); |
| | | }); |
| | | } |
| | | entity_h.HANDLED++; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | DbClient db = Business.Biz.Db; |
| | | action.Message += action.IsSuccessed ? $"ï¼é¢æå{entity_h.BILLCODE}è¿è´¦æå" : ""; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(entity_h).UpdateColumns(q => new { q.ERP_BILL_CODE, q.UPDATE_TIME, q.HANDLED, q.HANDLED_DATE }).ExecuteCommand(); |
| | | //db.Updateable(entity_d).ExecuteCommand(); |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | Logger.Interface.Error(action.Message); |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Interface.Info(action.Message); |
| | | Logger.Scheduler.Info(action.Message); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"æ¥ä¸å°ç¬¦åæ¡ä»¶ç颿éè¦è¿è´¦"; |
| | | Logger.Interface.Error(action.Message); |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(ex, $"åæåè¿è´¦å¼å¸¸"); |
| | | Logger.Interface.Error(action.Message); |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | }); |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 颿åè¿è´¦å°T100 |
| | | /// </summary> |
| | | /// <param name="param"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction MaterialReqOldToErpNew(MReqPostParam param) |
| | | { |
| | | var action = new ApiAction(); |
| | | Work.DoAsync(() => |
| | | { |
| | | Thread.Sleep(3000); |
| | | Logger.Interface.Info($"颿åè¿è´¦å°T100 =>å¼å§è¿è´¦ï¼åå·ï¼[{param.BillCode}ï¼{param.CompanyId}]"); |
| | | DbClient db = Biz.DataSource["WMS57"].Client; |
| | | try |
| | | { |
| | | BIZ_ERP_PROD_OUT entity_h = db.Queryable<BIZ_ERP_PROD_OUT>().Where(x => x.BILLCODE == param.BillCode && SqlFunc.IsNullOrEmpty(x.ERP_BILL_CODE)).First(); |
| | | List<BIZ_ERP_PROD_OUT_DTL> entity_d = db.Queryable<BIZ_ERP_PROD_OUT_DTL>().Where(x => x.BILLCODE == param.BillCode && Convert.ToInt32(x.PRQTY) > 0).ToList(); |
| | | List<Detail5> details = new List<Detail5>(); |
| | | |
| | | if (entity_h != null) |
| | | { |
| | | foreach (var item in entity_d) |
| | | { |
| | | //è®¡ç®æ°é |
| | | var qty = item.QTY > item.PRQTY ? item.PRQTY.ToString() : item.QTY.ToString(); |
| | | details.Add(new Detail5 |
| | | { |
| | | sfdcseq = item.BILLLINE, |
| | | sfdc001 = item.SOURCECODE, |
| | | sfdc002 = item.SOURCELINE.ToString(), |
| | | sfdc003 = item.SOURCETYPE.ToString(), |
| | | sfdc007 = qty, |
| | | }); |
| | | } |
| | | var ret = ErpT100.MaterialReqToErp(new ReqErpInputParameter |
| | | { |
| | | parameter = new Parameter4 |
| | | { |
| | | sfdatype = entity_h.SOURCETYPE.ToString(), |
| | | sfdadocno = entity_h.BILLCODE, |
| | | detail = details |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = "88", // ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = param.CompanyId |
| | | } |
| | | }); |
| | | if (ret.payload.std_data.execution.code == "0") //æå |
| | | { |
| | | entity_h.ERP_BILL_CODE = ret.payload.std_data.parameter.docno; |
| | | entity_h.UPDATE_TIME = DateTime.Now; |
| | | entity_h.HANDLED = 0; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | action.Message += $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçERP_BILL_CODEï¼[{ret.payload.std_data.parameter.docno}]"; |
| | | Logger.Interface.Info(action.Message); |
| | | } |
| | | else if (ret.payload.std_data.execution.code == "S" || ret.payload.std_data.execution.code == "ain-00222") |
| | | { |
| | | entity_h.ERP_BILL_CODE = "æ¤ç¬èµæå·²è¿è´¦-system"; |
| | | entity_h.UPDATE_TIME = DateTime.Now; |
| | | entity_h.HANDLED = 0; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | action.IsSuccessed = false; |
| | | action.Message = $"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼è¿åçERP_BILL_CODEï¼[{ret.payload.std_data.parameter.docno}]"; |
| | | Logger.Interface.Info(action.Message); |
| | | } |
| | | else //失败 |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"颿å{entity_h.BILLCODE}è¿è´¦å¤±è´¥ï¼è¿åçä¿¡æ¯:{ret.payload.std_data.execution.description}"; |
| | | Logger.Interface.Error(action.Message); |
| | | |
| | | //大äº5次就ä¸åé®ä»¶ |
| | | if (entity_h.HANDLED < 6) |
| | | { |
| | | Work.DoAsync(() => |
| | | { |
| | | MailServiceApi _IMailServiceApi = new MailServiceApi(); |
| | | _IMailServiceApi.SendMail(new MailBodyEntity |
| | | { |
| | | MailTextBody = $"Hi Allï¼<br/><br/> 颿å[{entity_h.BILLCODE}]è¿è´¦å¤±è´¥ï¼<br/> T100è¿åæ¶æ¯ï¼{ret.payload.std_data.execution.description}", |
| | | MailBodyType = "Html", |
| | | MailFilePath = null, |
| | | Recipients = Biz.SysParamOld.Params.Where(q => q.PRMG_CODE == "PickingEmailGroup").Select(q => q.PARAM_VALUE).ToList(), // new List<string> { "ben.lin@tigerclouds.com", "dyfang@sharetronic.com", "dianzicang@sharetronic.com" }, |
| | | Cc = new List<string>(), |
| | | Sender = "WMS Email Admin", |
| | | SenderAddress = "xcerp@sharetronic.com", |
| | | Subject = $"颿å[{entity_h.BILLCODE}]è¿è´¦å¤±è´¥", |
| | | Body = "" |
| | | }, |
| | | new SendServerConfigurationEntity |
| | | { |
| | | SmtpHost = "mail.sharetronic.com", |
| | | SmtpPort = 25, |
| | | SenderAccount = "xcerp@sharetronic.com", |
| | | SenderPassword = "sha66666", |
| | | MailEncoding = "utf-8", |
| | | IsSsl = false |
| | | }); |
| | | }); |
| | | } |
| | | entity_h.HANDLED++; |
| | | entity_h.HANDLED_DATE = DateTime.Now; |
| | | //return action; |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | db = Biz.DataSource["WMS57"].Client; |
| | | action.Message += action.IsSuccessed ? $"ï¼é¢æå{entity_h.BILLCODE}è¿è´¦æå" : ""; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(entity_h).UpdateColumns(q => new { q.ERP_BILL_CODE, q.UPDATE_TIME, q.HANDLED, q.HANDLED_DATE }).ExecuteCommand(); |
| | | //db.Updateable(entity_d).ExecuteCommand(); |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | Logger.Interface.Error(action.Message); |
| | | } |
| | | Logger.Interface.Info(action.Message); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = $"æ¥ä¸å°ç¬¦åæ¡ä»¶ç颿éè¦è¿è´¦"; |
| | | Logger.Interface.Error(action.Message); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(ex, $"åæåè¿è´¦å¼å¸¸"); |
| | | Logger.Interface.Error(action.Message); |
| | | } |
| | | }); |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <returns></returns> |
| | | public static async Task<string> GetHouseModel(string name, string status) |
| | | { |
| | | var data = new List<OrgItemH>(); |
| | | V_WH_TREE func = null; |
| | | if (!string.IsNullOrEmpty(name)) |
| | | { |
| | | func = Biz.Db.Queryable<V_WH_TREE>().Where(x => x.NAME == name).First(); |
| | | } |
| | | var items = await Biz.Db.Queryable<V_WH_TREE>() |
| | | .Where(q => q.TYPE != "Location") |
| | | .OrderBy(x => x.NAME) |
| | | .Distinct().ToListAsync(); |
| | | //æ²¡ææ¥è¯¢çæ¶å |
| | | if (func == null) |
| | | { |
| | | List<V_WH_TREE> entities = items.OrderBy(x => x.NAME).ToList().FindAll(t => t.PARENT_ID.IsNullOrEmpty()); |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.NAME; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //hosueItem.remark = item.REMARK; |
| | | //hosueItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItem(items, item.CODE, ref houseItem); |
| | | data.Add(houseItem); |
| | | } |
| | | } |
| | | //ææ¥è¯¢æ¡ä»¶çæ¶å |
| | | else |
| | | { |
| | | |
| | | } |
| | | |
| | | //转æ¢Jsonæ¶ï¼å»é¤å¼ä¸ºnullç屿§ |
| | | var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; |
| | | var json = JsonConvert.SerializeObject(data, Formatting.Indented, jsonSetting); |
| | | return json; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½è¿åç»ç»æºæ |
| | | /// </summary> |
| | | /// <param name="data"></param> |
| | | /// <param name="parent"></param> |
| | | /// <param name="pOrgItem"></param> |
| | | private static void GetOrgItem(List<V_WH_TREE> data, string parent, ref OrgItemH pOrgItem) |
| | | { |
| | | List<V_WH_TREE> entities = data.OrderBy(x => x.NAME).ToList().FindAll(t => t.PARENT_ID == parent).Distinct().ToList(); |
| | | if (entities.Count > 0) |
| | | { |
| | | foreach (var item in entities) |
| | | { |
| | | OrgItemH houseItem = new(); |
| | | houseItem.id = item.ID; |
| | | houseItem.houseCode = item.CODE; |
| | | houseItem.houseName = item.NAME; |
| | | houseItem.PARENT_HOUSE = item.PARENT_ID; |
| | | houseItem.createTime = DateTime.Now.ToString("yyyy-MM-dd mm:dd:ss"); |
| | | houseItem.houseType = item.TYPE; |
| | | //houseItem.remark = item.REMARK; |
| | | //houseItem.orderNo = item.SEQ_NO; |
| | | houseItem.children = new(); |
| | | if (item.TYPE != "Shelf") GetOrgItem(data, item.CODE, ref houseItem); |
| | | pOrgItem.children.Add(houseItem); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="serverId"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction ReceiptHToErp(string serverId, string triggerDetail) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | Logger.Scheduler.Info(triggerDetail); |
| | | DbClient db = Business.Biz.Db; |
| | | var CompanyId = ""; |
| | | switch (serverId) |
| | | { |
| | | case "55": |
| | | db = Biz.DataSource["Test"].Client; |
| | | CompanyId = "XCSJ"; |
| | | break; |
| | | case "XCSJ": |
| | | db = Biz.DataSource["XCSJ"].Client; |
| | | CompanyId = "XCSJ"; |
| | | break; |
| | | case "DGXC": |
| | | db = Biz.DataSource["DGXC"].Client; |
| | | CompanyId = "DGXC"; |
| | | break; |
| | | case "AHXC": |
| | | db = Biz.DataSource["AHXC"].Client; |
| | | CompanyId = "AHXC"; |
| | | break; |
| | | } |
| | | var entity_h = db.Queryable<Model.Minsun.WMS_RECEIPT_H>().Where(x => x.STATUS == 2 && x.ERP_BILL_CODE == null).ToList(); |
| | | List<Model.Minsun.WMS_RECEIPT_H> receiptList = new List<Model.Minsun.WMS_RECEIPT_H>(); |
| | | foreach (var h in entity_h) |
| | | { |
| | | List<Detail> details = new List<Detail>(); |
| | | var userid = db.Queryable<Model.Minsun.Sys_Users>().Where(c => c.Id.Equals(h.CreatorUserId)).ToList(); |
| | | var CreatorUserId = userid[0].UserName == "admin" ? "00000" : userid[0].UserName; |
| | | List<Model.Minsun.WMS_RECEIPT_D> entity_d = db.Queryable<Model.Minsun.WMS_RECEIPT_D>().Where(x => x.BILLCODE == h.BILLCODE).ToList(); |
| | | foreach (var item in entity_d) |
| | | { |
| | | var line = db.Queryable<Model.Minsun.WMS_SRM_ASN_LINES>().Where(c => c.DeliveryNo.Equals(item.SOURCECODE.ToString()) && c.extendN01 == item.SOURCELINE.ToString() && c.productCode == item.MATERIALCODE).First(); //æ°SRM |
| | | if (line == null) { line = db.Queryable<Model.Minsun.WMS_SRM_ASN_LINES>().Where(c => c.DeliveryNo.Equals(item.SOURCECODE.ToString()) && c.lineNo == item.SOURCELINE && c.productCode == item.MATERIALCODE).First(); } //æ§SRM |
| | | var pmdt004 = line != null ? ((line.poLineNo ?? "1").Split('-').Length > 2 ? (line.poLineNo ?? "1").Split('-')[2] : (line.poLineNo ?? "1")) : "1"; |
| | | |
| | | details.Add(new Detail |
| | | { |
| | | pmdtseq = item.BILLLINE.ToString(), |
| | | pmdt001 = string.IsNullOrEmpty(item.PONO) ? item.SOURCECODE : item.PONO, |
| | | pmdt002 = string.IsNullOrEmpty(item.PONO) ? $"{item.SOURCELINE}" : $"{item.POLINE}", |
| | | pmdt003 = "1", |
| | | pmdt004 = pmdt004, |
| | | pmdt006 = item.MATERIALCODE, |
| | | //pmdt018 = "åç±³ç§æ", |
| | | pmdt020 = $"{item.QTY}", |
| | | pmdtud011 = "0" |
| | | }); |
| | | } |
| | | var XSOURCECODE = entity_d[0].SOURCECODE.ToString(); |
| | | |
| | | //è°ç¨T100æ¥å£çæå°è´§å |
| | | var ret = ErpT100.GenerateCustReceipt(new CustReceiptInputParameter |
| | | { |
| | | parameter = new Parameter<Detail> |
| | | { |
| | | pmds000 = "1", |
| | | pmdsdocno = "3438", |
| | | pmdsdocdt = DateTime.Now.ToString("yyyy-MM-dd"), //"2023-04-26", //å½å¤©æ¶é´ |
| | | pmds002 = CreatorUserId, //ç¨æ·ID |
| | | pmds003 = "", |
| | | pmds007 = h.SUPPLIERCODE, //"C0006", //ä¾åºå代ç |
| | | pmds010 = XSOURCECODE, //éè´§åå· |
| | | //pmdsud001 = SecondVenderCode, //"CM017", //äºçº§ä¾åºç¼å· |
| | | detail = details |
| | | }, |
| | | datakey = new Datakey |
| | | { |
| | | EntId = ApiConfig.IsTestServer ? "108" : "88", |
| | | CompanyId = CompanyId |
| | | } |
| | | }); |
| | | if (ret.payload.std_data.execution.code == "0") //æå |
| | | { |
| | | Logger.Scheduler.Info($"{action.Message.IsNullOrEmpty("", "ï¼")}{ret.payload.std_data.execution.description}ï¼æ®ç¹[{CompanyId}]ï¼æ¶è´§åå·[{h.BILLCODE}]ï¼å½åç¨æ·[{CreatorUserId}]ï¼ä¾åºåç¼å·[{h.SUPPLIERCODE}]ï¼è¿åçæ¶è´§åå·ï¼[{ret.payload.std_data.parameter.docno}]"); |
| | | h.ERP_BILL_CODE = ret.payload.std_data.parameter.docno; |
| | | h.STATUS = 3; |
| | | h.LastModificationTime = DateTime.Now; |
| | | receiptList.Add(h); |
| | | } |
| | | else //失败 |
| | | { |
| | | Logger.Scheduler.Info($"失败信æ¯ï¼æ®ç¹[{CompanyId}]ï¼æ¶è´§åå·[{h.BILLCODE}]ï¼å½åç¨æ·[{CreatorUserId}]ï¼ä¾åºåç¼å·[{h.SUPPLIERCODE}]ï¼è¿åçä¿¡æ¯:{ret.payload.std_data.execution.description}"); |
| | | //return action; |
| | | } |
| | | } |
| | | //æ°æ®åºå¤çæä½ |
| | | action.Message = $"ï¼å°è´§åæ¨T100宿"; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | if (receiptList.Any()) |
| | | { |
| | | db.Updateable(receiptList).ExecuteCommand(); |
| | | } |
| | | |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | Logger.Scheduler.Info(action.Message); |
| | | //return action; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(ex, $"çæå°è´§åå¼å¸¸"); |
| | | Logger.Scheduler.Error(action.Message); |
| | | } |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®ä»åºä»£ç åç±»åå é¤ä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction DelWareHouseModel(DelWareHouseModelEntity wareHouse) |
| | | { |
| | | var action = new ApiAction(); |
| | | List<string> locaIds = new(); |
| | | List<string> shelfIds = new(); |
| | | List<string> regIds = new(); |
| | | List<string> wareIds = new(); |
| | | var db = Biz.Db; |
| | | List<V_WH_UNIT> uNITs = new List<V_WH_UNIT>(); |
| | | if (wareHouse.Type == "Warehouse") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.WH_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.WH_CODE == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | regIds.AddRange(unit.Where(q => !q.REGION_ID.IsNullOrEmpty()).Select(s => s.REGION_ID).Distinct()); |
| | | wareIds.AddRange(unit.Where(q => !q.WH_ID.IsNullOrEmpty()).Select(s => s.WH_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "ä»åºé颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else if (wareHouse.Type == "Region") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.REGION_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.REGION_CODE == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | regIds.AddRange(unit.Where(q => !q.REGION_ID.IsNullOrEmpty()).Select(s => s.REGION_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "å¨åºé颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else if (wareHouse.Type == "Shelf") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.SHELF_ID == wareHouse.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | var unit = db.Queryable<V_WH_UNIT>().Where(q => q.SHELF_CODE == wareHouse.ID).ToList(); |
| | | locaIds.AddRange(unit.Where(q => !q.LOCATION_ID.IsNullOrEmpty()).Select(s => s.LOCATION_ID).Distinct()); |
| | | shelfIds.AddRange(unit.Where(q => !q.SHELF_ID.IsNullOrEmpty()).Select(s => s.SHELF_ID).Distinct()); |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.Message = "è´§æ¶é颿ä¸è¥¿ï¼ä¸è½å é¤ï¼"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | } |
| | | //å å¨ä½ |
| | | if (locaIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_LOCATION>().Where(it => locaIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å è´§æ¶ |
| | | if (shelfIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_SHELF>().Where(it => shelfIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å å¨åº |
| | | if (regIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_REGION>().Where(it => regIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | //å ä»åº |
| | | if (wareIds.Any()) |
| | | { |
| | | db.Deleteable<Model.WMS_WAREHOUSE>().Where(it => wareIds.Contains(it.ID)).ExecuteCommand(); |
| | | } |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// æ ¹æ®ä»åºä»£ç åç±»åå é¤ä»åºæºæå表 |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction AddLocationModel(List<AddLocationModelEntity> locations) |
| | | { |
| | | var action = new ApiAction(); |
| | | List<Model.WMS_LOCATION> Locations = new List<Model.WMS_LOCATION>(); |
| | | foreach (var item in locations) |
| | | { |
| | | Model.WMS_LOCATION location = new Model.WMS_LOCATION() |
| | | { |
| | | LOCATION_CODE = item.LOCATION_CODE, |
| | | LOCATION_NAME = item.LOCATION_CODE, |
| | | IS_ACTIVE = "Y", |
| | | ORG_CODE = item.ORG_CODE, |
| | | SHELF_ID = item.SHELF_ID, |
| | | IS_MIX = item.ISMIX, |
| | | FLOOR_NO = item.FLOOR_NO, |
| | | SEQ_NO = item.SEQ_NO, |
| | | LEDID = item.SEQ_NO |
| | | }; |
| | | Locations.Add(location); |
| | | } |
| | | var db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Deleteable<Model.WMS_LOCATION>(Locations.Select(it => it.ID)).ExecuteCommand(); |
| | | db.Insertable(Locations).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.GetResponse().CatchExceptionWithLog(dbTran.ErrorException, $"æ°å¢å¨ä½å¼å¸¸"); |
| | | } |
| | | |
| | | action.LocaleMsg = Biz.L("WMS.WareHouse.VerifyException", Locations[0].ORG_CODE); |
| | | return action; |
| | | } |
| | | /// <summary> |
| | | /// æ¥è¯¢è´§æ¶æ¯å¦æä¸è¥¿ |
| | | /// </summary> |
| | | /// <param name="billcode"></param> |
| | | /// <returns></returns> |
| | | public static ApiAction CheckLocation(DelWareHouseModelEntity shelf) |
| | | { |
| | | var action = new ApiAction(); |
| | | var db = Biz.Db; |
| | | if (shelf.Type == "shelf") |
| | | { |
| | | var res = db.Queryable<WMS_ITEM>().Where(q => q.STATUS > 2 && q.SHELF_ID == shelf.ID).ToList(); |
| | | if (res.IsNullOrEmpty()) |
| | | { |
| | | action.IsSuccessed = true; |
| | | } |
| | | else |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = Biz.L("WMS.WareHouse.æ£æ¥å¨ä½åå§å", shelf.ID); |
| | | } |
| | | } |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åT100æ£éªåæ°æ®2023.07.23ï¼by weikaiyong |
| | | /// </summary> |
| | | /// <param name="iqcs"></param> |
| | | /// <returns></returns> |
| | | public ApiAction GetQcReq(List<BIZ_ERP_IQC> iqcs) |
| | | { |
| | | var action = new ApiAction(); |
| | | try |
| | | { |
| | | List<BIZ_ERP_IQC> iqcs_new = new List<BIZ_ERP_IQC>(); |
| | | List<WMS_ITEM> saveItems = new(); |
| | | List<BIZ_ERP_OTH_IN_SN> othSns = new(); |
| | | List<BIZ_ERP_RECEIPT_SN> reqSns = new(); |
| | | List<WMS_ITEM_HIS> saveHis = new(); |
| | | DbClient db = Biz.DataSource["WMS57"].Client; |
| | | var iqcEntitys = db.Queryable<BIZ_ERP_IQC>().Where(x => iqcs.Select(q => q.ERP_BILL_CODE).Contains(x.ERP_BILL_CODE)).ToList(); |
| | | foreach (var iqc in iqcs) |
| | | { |
| | | var entity = iqcEntitys.Where(x => x.ERP_BILL_CODE == iqc.ERP_BILL_CODE).FirstOrDefault(); |
| | | if (!entity.IsNullOrEmpty()) |
| | | { |
| | | entity.QCRESULT = iqc.QCRESULT; |
| | | entity.QCSTATUS = 3; |
| | | entity.RECEIVEQTY = iqc.RECEIVEQTY; |
| | | entity.REJECTQTY = iqc.REJECTQTY; |
| | | entity.UPDATE_TIME = DateTime.Now; |
| | | iqcs_new.Add(entity); |
| | | |
| | | var items = db.Queryable<WMS_ITEM>().Where(q => (q.TRANS_CODE == nameof(BIZ_ERP_OTH_IN) || q.TRANS_CODE == nameof(BIZ_ERP_RECEIPT)) |
| | | && q.TRANS_NO == entity.SOURCECODE && q.STATUS < WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | //if (items.Count>0) |
| | | { |
| | | foreach (var item in items) |
| | | { |
| | | item.UPDATE_TIME = DateTime.Now; |
| | | item.UPDATE_USER = "Interface"; |
| | | item.STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(); |
| | | saveItems.Add(item); |
| | | saveHis.Add(new WMS_ITEM_HIS(item, $"æ£éªåT100审åéè¿ï¼æ¡ç å¾
å
¥åº[{WMS_ITEM.STATUSs.WaitIn.GetDesc()}]")); |
| | | } |
| | | |
| | | othSns = db.Queryable<BIZ_ERP_OTH_IN_SN>().Where(q => q.BUSINESSCODE == entity.SOURCECODE && q.STATUS < WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | foreach (var item in othSns) |
| | | { |
| | | item.UPDATE_TIME = DateTime.Now; |
| | | item.UPDATE_USER = "Interface"; |
| | | item.STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(); |
| | | } |
| | | reqSns = db.Queryable<BIZ_ERP_RECEIPT_SN>().Where(q => q.BILLCODE == entity.SOURCECODE && q.STATUS < WMS_ITEM.STATUSs.WaitIn.GetValue()).ToList(); |
| | | foreach (var item in reqSns) |
| | | { |
| | | item.UPDATE_TIME = DateTime.Now; |
| | | item.UPDATE_USER = "Interface"; |
| | | item.STATUS = WMS_ITEM.STATUSs.WaitIn.GetValue(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | action.Message += $"æ¾ä¸å°å¯¹åºçWMSæ£éªå{iqc.ERP_BILL_CODE}"; |
| | | action.IsSuccessed = false; |
| | | } |
| | | } |
| | | |
| | | //æ°æ®åºå¤çæä½ |
| | | if (action.IsSuccessed) |
| | | { |
| | | action.Message = $"鿣å[{string.Join(",", iqcEntitys.Select(q => $"{q.ERP_BILL_CODE}"))}]ååWMSæå"; |
| | | var _db = Biz.DataSource["WMS57"].Client; |
| | | var dbTran = _db.UseTran(() => |
| | | { |
| | | _db.Updateable(iqcs_new, "Interface").ExecuteCommand(); |
| | | if (saveItems.Count > 100) |
| | | { |
| | | db.Fastest<WMS_ITEM>().BulkUpdate(saveItems, new string[] { "ID" }, new string[] { "STATUS", "UPDATE_TIME", "UPDATE_USER" }); |
| | | Logger.Interface.Info($"åºå[{string.Join(",", saveItems.Select(q => $"{q.TRANS_NO}"))}]FastestååWMSæå"); |
| | | } |
| | | else |
| | | { |
| | | _db.Updateable(saveItems, "Interface").UpdateColumns(q => new { q.STATUS, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand(); |
| | | Logger.Interface.Info($"åºå[{string.Join(",", saveItems.Select(q => $"{q.TRANS_NO}"))}]UpdateableååWMSæå"); |
| | | |
| | | } |
| | | if (saveHis.Count > 100) |
| | | { |
| | | db.Fastest<WMS_ITEM_HIS>().BulkCopy(saveHis); |
| | | } |
| | | else |
| | | { |
| | | db.Insertable(saveHis, "Interface").ExecuteCommand(); |
| | | } |
| | | if (othSns.Count > 100) |
| | | { |
| | | db.Fastest<BIZ_ERP_OTH_IN_SN>().BulkUpdate(othSns); |
| | | } |
| | | else |
| | | { |
| | | db.Updateable(othSns, "Interface").ExecuteCommand(); |
| | | } |
| | | if (reqSns.Count > 100) |
| | | { |
| | | db.Fastest<BIZ_ERP_RECEIPT_SN>().BulkUpdate(reqSns); |
| | | } |
| | | else |
| | | { |
| | | db.Updateable(reqSns, "Interface").ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | action.CatchExceptionWithLog(dbTran.ErrorException, $"æ°æ®å¤ç失败"); |
| | | } |
| | | Logger.Interface.Info($"鿣å[{string.Join(",", iqcEntitys.Select(q => $"{q.ERP_BILL_CODE}"))}]ååWMSæå"); |
| | | } |
| | | action.IsSuccessed = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | action.CatchExceptionWithLog(ex, $"æ°æ®å¤ç失败"); |
| | | } |
| | | return action; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åéå®åºåºå表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAction<PageAble<BIZ_ERP_SALE_OUT>> GetOutSaleList(int pageIndex, int pageSize, string orgcode, string billcode) |
| | | { |
| | | var action = new ApiAction<PageAble<BIZ_ERP_SALE_OUT>>(); |
| | | var query = Biz.Db.Queryable<BIZ_ERP_SALE_OUT>().Where(x => |
| | | (x.STATUS == BIZ_ERP_SALE_OUT.STATUSs.INIT.GetValue() |
| | | || x.STATUS == BIZ_ERP_SALE_OUT.STATUSs.WORKING.GetValue()) |
| | | && x.AUTH_ORG == orgcode) |
| | | .WhereIF(!billcode.IsNullOrEmpty(), x => x.BILLCODE.Contains(billcode)) |
| | | .OrderByDescending(x => x.UPDATE_TIME.ToString("yyyy-MM-dd")) |
| | | .OrderBy(x => x.REMARK == "L40774" ? 0 : 1) |
| | | .OrderBy(x => x.SOURCECODE == null ? 1 : 0) |
| | | .OrderBy(x => x.CREATE_TIME) |
| | | .ToPage(pageIndex, pageSize); |
| | | |
| | | action.Data = query; |
| | | return action; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using Tiger.Business.WMS.Transaction; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business |
| | |
| | | using System.Linq; |
| | | using Newtonsoft.Json; |
| | | using Tiger.Business.DbCache; |
| | | using Tiger.Business.WMS.iSRM; |
| | | using System.Text.RegularExpressions; |
| | | using System.Diagnostics; |
| | | using System.Threading; |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.Auto; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business |
| | |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.WMS; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business |
| | |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using Tiger.Business.WMS; |
| | | using Tiger.IBusiness; |
| | | |
| | | namespace Tiger.Business |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Remove="BAS\**" /> |
| | | <Compile Remove="EMS\**" /> |
| | | <Compile Remove="Language\Automate\**" /> |
| | | <Compile Remove="Language\Common\**" /> |
| | | <Compile Remove="Language\EMS\**" /> |
| | | <Compile Remove="Language\MES\**" /> |
| | | <Compile Remove="Language\Monitors\**" /> |
| | | <Compile Remove="Language\QMS\**" /> |
| | | <Compile Remove="Language\TSK\**" /> |
| | | <Compile Remove="QMS\**" /> |
| | | <Compile Remove="RTest\**" /> |
| | | <EmbeddedResource Remove="BAS\**" /> |
| | | <EmbeddedResource Remove="EMS\**" /> |
| | | <EmbeddedResource Remove="Language\Automate\**" /> |
| | | <EmbeddedResource Remove="Language\Common\**" /> |
| | | <EmbeddedResource Remove="Language\EMS\**" /> |
| | | <EmbeddedResource Remove="Language\MES\**" /> |
| | | <EmbeddedResource Remove="Language\Monitors\**" /> |
| | | <EmbeddedResource Remove="Language\QMS\**" /> |
| | | <EmbeddedResource Remove="Language\TSK\**" /> |
| | | <EmbeddedResource Remove="QMS\**" /> |
| | | <EmbeddedResource Remove="RTest\**" /> |
| | | <None Remove="BAS\**" /> |
| | | <None Remove="EMS\**" /> |
| | | <None Remove="Language\Automate\**" /> |
| | | <None Remove="Language\Common\**" /> |
| | | <None Remove="Language\EMS\**" /> |
| | | <None Remove="Language\MES\**" /> |
| | | <None Remove="Language\Monitors\**" /> |
| | | <None Remove="Language\QMS\**" /> |
| | | <None Remove="Language\TSK\**" /> |
| | | <None Remove="QMS\**" /> |
| | | <None Remove="RTest\**" /> |
| | | </ItemGroup> |
| | | |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="BAS\" /> |
| | | <Folder Include="EMS\" /> |
| | | <Folder Include="Language\Automate\" /> |
| | | <Folder Include="Language\Common\" /> |
| | | <Folder Include="Language\EMS\" /> |
| | | <Folder Include="Language\MES\" /> |
| | | <Folder Include="Language\Monitors\" /> |
| | | <Folder Include="Language\QMS\" /> |
| | | <Folder Include="Language\TSK\" /> |
| | | <Folder Include="QMS\" /> |
| | | <Folder Include="RTest\" /> |
| | | <Folder Include="WMS\MengQi\" /> |
| | | <Folder Include="WMS\" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |