| | |
| | | alter table InOutStorageDetail |
| | | add isSendToMes int NULL , -- æ¯å¦æ¨ç»MES ( 1:å¾
æ¨é 2ï¼æ¨éæå 3ï¼æ¨é失败 4ï¼å¼ºå¶å®æ) |
| | | SendToMesCount int NULL , -- æ¨ç»MESæ¬¡æ° |
| | | SendToMesTime datetime null, -- æ¨ç»MESæ¶é´ |
| | | isSendToMesStr NVARCHAR(128) null, -- æ¯å¦æ¨ç»MES ææ¬ |
| | | MesRet NVARCHAR(128) NULL -- MESè¿åç»æ |
| | |
| | | } |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// 导å
¥åºåºå-çæ¬1 |
| | | ///// </summary> |
| | | ///// <param name="inputmaterials"></param> |
| | | ///// <returns></returns> |
| | | //[HttpPost] |
| | | //public ActionResult importOutOrder(List<InputMaterialEntity> inputmaterials) |
| | | //{ |
| | | // var responseMessage = new ApiResponse<string>(); |
| | | // try |
| | | // { |
| | | // var msg = ""; |
| | | |
| | | // #region éªè¯ |
| | | // if (inputmaterials?.Count() == 0) |
| | | // { |
| | | // responseMessage = new ApiResponse<string>() |
| | | // { |
| | | // Code = 500, |
| | | // Success = false, |
| | | // Message = "æ°æ®æ¡æ°ä¸º0", |
| | | // Data = null, |
| | | // }; |
| | | // return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", ""); |
| | | // } |
| | | // if (inputmaterials.Select(x => x.ListNo).Distinct().Count() != 1) |
| | | // { |
| | | // responseMessage = new ApiResponse<string>() |
| | | // { |
| | | // Code = 500, |
| | | // Success = false, |
| | | // Message = "æ¬æ¬¡è¯·æ±åå·å¿
须为åä¸å¼", |
| | | // Data = null, |
| | | // }; |
| | | // return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", ""); |
| | | // } |
| | | // #endregion |
| | | |
| | | // #region ä¸å¡å¤ç |
| | | |
| | | // string typeName = "åºåº"; |
| | | // handler_importOutOrder(typeName, inputmaterials, out msg); |
| | | |
| | | // #endregion |
| | | |
| | | // if (!string.IsNullOrEmpty(msg)) |
| | | // { |
| | | // responseMessage = new ApiResponse<string>() |
| | | // { |
| | | // Code = 500, |
| | | // Success = false, |
| | | // Message = "çæåºåºä»»å¡å¼å¸¸:" + msg, |
| | | // Data = null, |
| | | // }; |
| | | // } |
| | | // else |
| | | // { |
| | | // responseMessage = new ApiResponse<string>() |
| | | // { |
| | | // Code = 200, |
| | | // Success = true, |
| | | // Message = "æå", |
| | | // Data = null, |
| | | // }; |
| | | // } |
| | | |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // responseMessage = new ApiResponse<string>() |
| | | // { |
| | | // Code = 500, |
| | | // Success = false, |
| | | // Message = "å¼å¸¸:" + ex.Message, |
| | | // Data = null, |
| | | // }; |
| | | // } |
| | | |
| | | // return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", ""); |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// 导å
¥åºåºå |
| | | /// 导å
¥åºåºå-çæ¬2 |
| | | /// </summary> |
| | | /// <param name="inputmaterials"></param> |
| | | /// <returns></returns> |
| | |
| | | return ApiResponseHelper.ReturnApiResponse(responseMessage, "importOutOrder", ""); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å
Œ
±å¯¼å
¥ å
¥åºåæåºåºå |
| | | /// </summary> |
| | |
| | | List<int> ids = new List<int>(); |
| | | var materials = InputMaterialService.GetInstance().GetIds(codes); |
| | | List<InOutListDetailEntity> detail = new List<InOutListDetailEntity>(); |
| | | if (materials?.Count == 0) |
| | | { |
| | | msg = ("ç©ææç»æ¥è¯¢ä¸ºç©ºï¼"); |
| | | return; |
| | | } |
| | | for (int i = 0; i < materials.Count; i++) |
| | | { |
| | | if (typeName == "å
¥åº") |
| | |
| | | <add name="DbModelLog" connectionString="data source=192.168.1.200;initial catalog=WGQ_WB19011_LOG;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> |
| | | <add name="DbModelCore" connectionString="data source=192.168.1.200;initial catalog=WGQ_WB19011_CORE;user id=sa;password=123abc.com;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" /> |
| | | </connectionStrings> |
| | | |
| | | <appSettings> |
| | | <!--MESå°å ãEditBy shaocx,2025-09-25ã--> |
| | | <add key="MesUrl" value="http://169.24.7.88:9083/"/> |
| | | </appSettings> |
| | | </configuration> |
| | |
| | | |
| | | namespace iWareCc.FinishStackerTask.Chain |
| | | { |
| | | public class ä¿ååºå
¥åºæç»ä¿¡æ¯ : IHandler |
| | | public class ä¿ååºå
¥åºæç»ä¿¡æ¯ : IHandler |
| | | { |
| | | /// <summary> |
| | | /// 该èç¹çä¸ä¸ä¸ªèç¹ |
| | |
| | | { |
| | | var task = DecompositionTaskContainer.PartTask; |
| | | int materid = 0; |
| | | using(var dbModelcore = new DbModelCore()) |
| | | using (var dbModelcore = new DbModelCore()) |
| | | { |
| | | var mater = dbModelcore.BASEMaterials.FirstOrDefault(x=>x.code==task.MaterialCode); |
| | | if (mater!=null) |
| | | var mater = dbModelcore.BASEMaterials.FirstOrDefault(x => x.code == task.MaterialCode); |
| | | if (mater != null) |
| | | { |
| | | materid = mater.id; |
| | | } |
| | | }; |
| | | int tp=0; |
| | | } |
| | | ; |
| | | int tp = 0; |
| | | int? _isSendToMes = null;//æ¯å¦åéç»MES ãEditby shaocx,2025-09-25ã |
| | | switch (task.MainTaskType) |
| | | { |
| | | case (int)EMainTaskType.å
¥åºä»»å¡: |
| | | tp = 0; |
| | | _isSendToMes = (int)EIsSendToMes.å¾
æ¨é; |
| | | break; |
| | | case (int)EMainTaskType.åºåºä»»å¡: |
| | | tp = 1; |
| | | _isSendToMes = (int)EIsSendToMes.å¾
æ¨é; |
| | | break; |
| | | case (int)EMainTaskType.ç§»åºä»»å¡: |
| | | tp = 2; |
| | |
| | | InOutStorageDetail iosd = new InOutStorageDetail() |
| | | { |
| | | fromplacecode = task.SourcePlace, |
| | | formplaceid=task.SourcePlaceId, |
| | | toplacecode=task.ToPlace, |
| | | toplaceid=task.ToPlaceId, |
| | | equipid=task.EquipId, |
| | | equipname=task.EquipName, |
| | | updatetime=DateTime.Now, |
| | | createtime=task.CreateTime, |
| | | materialcode=task.MaterialCode, |
| | | materialid=materid, |
| | | type = tp |
| | | formplaceid = task.SourcePlaceId, |
| | | toplacecode = task.ToPlace, |
| | | toplaceid = task.ToPlaceId, |
| | | equipid = task.EquipId, |
| | | equipname = task.EquipName, |
| | | updatetime = DateTime.Now, |
| | | createtime = task.CreateTime, |
| | | materialcode = task.MaterialCode, |
| | | materialid = materid, |
| | | type = tp, |
| | | isSendToMes = _isSendToMes //æ¯å¦åéç»MES ãEditby shaocx,2025-09-25ã |
| | | }; |
| | | dbModel.InOutStorageDetails.Add(iosd); |
| | | dbModel.SaveChanges(); |
| | |
| | | //StartThread(ReSendThread); |
| | | |
| | | //å¼å¯æ¨éç»MESçåºå
¥åºå®æçº¿ç¨ ãEditby shaocx,2025-09-17ã |
| | | new Thread(mesDataTranfficForRealMes.Handler).Start(); |
| | | new Thread(mesDataTranfficForRealMesThread.Handler).Start(); |
| | | |
| | | } |
| | | |
| | |
| | | using Newtonsoft.Json; |
| | | using iWareCommon.Utils; |
| | | using iWareLog.Report.Helper; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// </summary> |
| | | public class PushMesHandler |
| | | { |
| | | public static string mes_api_url = "";// ConfigHelper.GetConfigString("MesUrl");//ä¿®æ¹ä¸ºé
ç½®æä»¶ ãEditBy shaocx,2022-01-27ã |
| | | public static string mes_api_url = ConfigHelper.GetConfigString("MesUrl");//ä¿®æ¹ä¸ºé
ç½®æä»¶ ãEditBy shaocx,2022-01-27ã |
| | | static HTTPService mes_api = new HTTPService(mes_api_url);//mesåºå°å |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="pushData"></param> |
| | | /// <returns></returns> |
| | | public static ApiResponse<string> Mes_InStockSend(List<InboundStockInfoToMes> pushData) |
| | | public static ApiResponse<string> Mes_InStockSend(R_InOutStorageDetailResultForMes pushData) |
| | | { |
| | | ApiResponse<string> res = null; |
| | | var funName = "Mes_InStockSend"; |
| | | try |
| | | { |
| | | MesRequest<List<InboundStockInfoToMes>> mesRequest = new MesRequest<List<InboundStockInfoToMes>>(); |
| | | mesRequest.Datas = pushData; |
| | | mesRequest.TableName = "T_WMS_Inbound_Record"; |
| | | mesRequest.PrimaryKeys = "identifier"; |
| | | |
| | | string paprm = JsonConvert.SerializeObject(mesRequest); |
| | | string paprm = JsonConvert.SerializeObject(pushData); |
| | | //Log4NetHelper.WriteInfoLog(_logType, $"{funName},åå¤åæ°:{paprm}"); |
| | | Guid guid = System.Guid.NewGuid(); |
| | | |
| | | //模æ |
| | | if (1 == 2) |
| | | {//模æç¯å¢ |
| | | res = new ApiResponse<string>(); |
| | | res.Code = 500; |
| | | res.Success = false; |
| | | res.Message = "ç³»ç»æ¨¡æå®æ"; |
| | | } |
| | | else |
| | | { |
| | | var resStr = mes_api.postContentForString("", paprm, guid); |
| | | //Log4NetHelper.WriteInfoLog(_logType, $"{funName},ç»æè¿å:{resStr}"); |
| | | res = JsonConvert.DeserializeObject<ApiResponse<string>>(resStr); |
| | | } |
| | | var resStr = mes_api.postContentForString("materialBack", paprm, guid); |
| | | //Log4NetHelper.WriteInfoLog(_logType, $"{funName},ç»æè¿å:{resStr}"); |
| | | res = JsonConvert.DeserializeObject<ApiResponse<string>>(resStr); |
| | | |
| | | |
| | | //Log4NetHelper.WriteInfoLog(_logType, $"{funName},åæ°:{paprm},è¿å:{JsonConvert.SerializeObject(res)}"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using iWareCc.Properties; |
| | | using iWareCommon.Utils; |
| | | using iWareDataCore.ORM; |
| | | using iWareDataCore.TASK.EnumType; |
| | | using iWareLog.LOG.EnumType; |
| | | using iWareLog.ORM; |
| | | using iWareLog.Report.Helper; |
| | | using iWareLog.Report.Service; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWareCc |
| | | { |
| | | /// <summary> |
| | | /// MESåºå
¥åºæ°æ®ä¼ è¾(çæ£çMES)-çº¿ç¨ |
| | | /// </summary> |
| | | public class mesDataTranfficForRealMesThread |
| | | { |
| | | //public static LogType _logType = LogType.mesDataTranfficForRealMes; |
| | | public static async void Handler() |
| | | { |
| | | while (true) |
| | | { |
| | | try |
| | | { |
| | | Thread.Sleep(5000); |
| | | |
| | | List<InOutStorageDetailResultForMes> sendMesData = InOutService.GetInstance().GetInOutStorageDetailListForMes(); |
| | | |
| | | if (sendMesData.Count > 0) |
| | | { |
| | | //SystemWarningMsg.msg_mesDataTranfficForRealMes = $"{MyExtend.MsgTimeStr()},è¦æ¨é{sendMesData.Count()}æ¡!"; |
| | | foreach (var itemTask in sendMesData) |
| | | { |
| | | using (DbModelLog mod = new DbModelLog()) |
| | | { |
| | | try |
| | | { |
| | | ApiResponse<string> ret = null; |
| | | itemTask.Timestamp = DateTime.Now;//åéæ¶é´æ³å®æ¶ |
| | | |
| | | //è½¬æ¢ |
| | | var str_OccurrenceTime = ""; |
| | | if (itemTask.OccurrenceTime != null) |
| | | { |
| | | str_OccurrenceTime = ((DateTime)itemTask.OccurrenceTime).ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | R_InOutStorageDetailResultForMes r = new R_InOutStorageDetailResultForMes() |
| | | { |
| | | BusinessFlag = itemTask.BusinessFlag.ToString(), |
| | | Code = itemTask.Code, |
| | | IssueProjectNo = itemTask.IssueProjectNo, |
| | | PlaceCode = itemTask.PlaceCode, |
| | | SerialNo = itemTask.SerialNo, |
| | | Timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | OccurrenceTime = str_OccurrenceTime, |
| | | }; |
| | | |
| | | ret = PushMesHandler.Mes_InStockSend(r); |
| | | |
| | | //æ¥æ¾å¯¹è±¡ |
| | | var db_itemTask = mod.InOutStorageDetails.Where(x => x.id == itemTask.Id).FirstOrDefault(); |
| | | //SystemWarningMsg.msg_mesDataTranfficForRealMes = $"{MyExtend.MsgTimeStr()},å·²æ¨éç»æï¼è¿å:{JsonConvert.SerializeObject(ret)}"; |
| | | if (ret.Success) |
| | | { |
| | | db_itemTask.isSendToMes = (int)EIsSendToMes.æ¨éæå;//æ¨éæå |
| | | db_itemTask.isSendToMesStr = "æå"; |
| | | } |
| | | else |
| | | { |
| | | db_itemTask.isSendToMes = (int)EIsSendToMes.å¾
æ¨é;//å¾
æ¨é |
| | | db_itemTask.isSendToMesStr = "失败"; |
| | | } |
| | | db_itemTask.SendToMesTime = DateTime.Now; |
| | | db_itemTask.MesRet = ret.Message; |
| | | db_itemTask.SendToMesCount = (db_itemTask.SendToMesCount ?? 0) + 1; |
| | | if (db_itemTask.isSendToMes == (int)EIsSendToMes.å¾
æ¨é && db_itemTask.SendToMesCount > 100) |
| | | { |
| | | db_itemTask.isSendToMes = (int)EIsSendToMes.强å¶å®æ;//è¡¨ç¤ºå¼ºå¶æ¨éæå |
| | | db_itemTask.isSendToMesStr = "å¼ºå¶æå"; |
| | | } |
| | | mod.SaveChanges(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogTextHelper.WriteLine(Resources.LogDir + @"/MESåºå
¥åºæ°æ®ä¼ è¾/" + "mesDataTranfficForRealMesThread", "MESåºå
¥åºæ°æ®ä¼ è¾å¼å¸¸:{0}", JsonConvert.SerializeObject(ex)); |
| | | //LogTextHelper.WriteLog(Resources.LogDir, this.ToString(), "Handle", ex.Message); |
| | | //SystemWarningMsg.msg_mesDataTranfficForRealMes = $"{MyExtend.MsgTimeStr()},æ¨éç»MESæ°æ®å¼å¸¸:" + JsonConvert.SerializeObject(ex); |
| | | //Log4NetHelper.WriteErrorLog(_logType, //SystemWarningMsg.msg_mesDataTranfficForRealMes, ex); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogTextHelper.WriteLine(Resources.LogDir + @"/MESåºå
¥åºæ°æ®ä¼ è¾/" + "mesDataTranfficForRealMesThread", "(å¤é¨)MESåºå
¥åºæ°æ®ä¼ è¾å¼å¸¸:{0}", JsonConvert.SerializeObject(ex)); |
| | | //SystemWarningMsg.msg_mesDataTranfficForRealMes = $"{MyExtend.MsgTimeStr()},æ°æ®è¦æ¨éç»MESåºç°å¼å¸¸:" + ex.Message; |
| | | //Log4NetHelper.WriteErrorLog(_logType, //SystemWarningMsg.msg_mesDataTranfficForRealMes, ex); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="SystemInteraction\dto\InboundStockInfoToMes.cs" /> |
| | | <Compile Include="SystemInteraction\dto\MesRequest.cs" /> |
| | | <Compile Include="SystemInteraction\HTTPService.cs" /> |
| | | <Compile Include="SystemInteraction\mesDataTranfficForRealMes.cs" /> |
| | | <Compile Include="SystemInteraction\mesDataTranfficForRealMesThread.cs" /> |
| | | <Compile Include="SystemInteraction\PushMesHandler.cs" /> |
| | | <Compile Include="Task\Service\TaskService.cs" /> |
| | | <Compile Include="Util\OPCHelper.cs" /> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Configuration; |
| | | |
| | | namespace iWareCommon.Utils |
| | | { |
| | | /// <summary> |
| | | /// web.configæä½ç±» |
| | | /// Copyright (C) TBEA.WMS |
| | | /// </summary> |
| | | public sealed class ConfigHelper |
| | | { |
| | | /// <summary> |
| | | /// å¾å°AppSettingsä¸çé
ç½®åç¬¦ä¸²ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public static string GetConfigString(string key) |
| | | { |
| | | string CacheKey = "AppSettings-" + key; |
| | | object objModel = DataCache.GetCache(CacheKey); |
| | | if (objModel == null) |
| | | { |
| | | try |
| | | { |
| | | objModel = ConfigurationManager.AppSettings[key]; |
| | | if (objModel != null) |
| | | { |
| | | DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(180), TimeSpan.Zero); |
| | | } |
| | | } |
| | | catch |
| | | { } |
| | | } |
| | | return objModel.ToString(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¾å°AppSettingsä¸çé
ç½®Boolä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public static bool GetConfigBool(string key) |
| | | { |
| | | bool result = false; |
| | | string cfgVal = GetConfigString(key); |
| | | if(null != cfgVal && string.Empty != cfgVal) |
| | | { |
| | | try |
| | | { |
| | | result = bool.Parse(cfgVal); |
| | | } |
| | | catch(FormatException) |
| | | { |
| | | // Ignore format exceptions. |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | /// <summary> |
| | | /// å¾å°AppSettingsä¸çé
ç½®Decimalä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public static decimal GetConfigDecimal(string key) |
| | | { |
| | | decimal result = 0; |
| | | string cfgVal = GetConfigString(key); |
| | | if(null != cfgVal && string.Empty != cfgVal) |
| | | { |
| | | try |
| | | { |
| | | result = decimal.Parse(cfgVal); |
| | | } |
| | | catch(FormatException) |
| | | { |
| | | // Ignore format exceptions. |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | /// <summary> |
| | | /// å¾å°AppSettingsä¸çé
ç½®intä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="key"></param> |
| | | /// <returns></returns> |
| | | public static int GetConfigInt(string key) |
| | | { |
| | | int result = 0; |
| | | string cfgVal = GetConfigString(key); |
| | | if(null != cfgVal && string.Empty != cfgVal) |
| | | { |
| | | try |
| | | { |
| | | result = int.Parse(cfgVal); |
| | | } |
| | | catch(FormatException) |
| | | { |
| | | // Ignore format exceptions. |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Web; |
| | | |
| | | namespace iWareCommon.Utils |
| | | { |
| | | /// <summary> |
| | | /// ç¼åç¸å
³çæä½ç±» |
| | | /// Copyright (C) TBEA.WMS |
| | | /// </summary> |
| | | public class DataCache |
| | | { |
| | | /// <summary> |
| | | /// è·åå½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ |
| | | /// </summary> |
| | | /// <param name="CacheKey"></param> |
| | | /// <returns></returns> |
| | | public static object GetCache(string CacheKey) |
| | | { |
| | | System.Web.Caching.Cache objCache = HttpRuntime.Cache; |
| | | return objCache[CacheKey]; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置å½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ |
| | | /// </summary> |
| | | /// <param name="CacheKey"></param> |
| | | /// <param name="objObject"></param> |
| | | public static void SetCache(string CacheKey, object objObject) |
| | | { |
| | | System.Web.Caching.Cache objCache = HttpRuntime.Cache; |
| | | objCache.Insert(CacheKey, objObject); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置å½ååºç¨ç¨åºæå®CacheKeyçCacheå¼ |
| | | /// </summary> |
| | | /// <param name="CacheKey"></param> |
| | | /// <param name="objObject"></param> |
| | | public static void SetCache(string CacheKey, object objObject, DateTime absoluteExpiration,TimeSpan slidingExpiration ) |
| | | { |
| | | System.Web.Caching.Cache objCache = HttpRuntime.Cache; |
| | | objCache.Insert(CacheKey, objObject,null,absoluteExpiration,slidingExpiration); |
| | | } |
| | | } |
| | | } |
| | |
| | | </Reference> |
| | | <Reference Include="System" /> |
| | | <Reference Include="System.ComponentModel.DataAnnotations" /> |
| | | <Reference Include="System.Configuration" /> |
| | | <Reference Include="System.Core" /> |
| | | <Reference Include="System.Drawing" /> |
| | | <Reference Include="System.Web" /> |
| | |
| | | <DependentUpon>Resources.resx</DependentUpon> |
| | | </Compile> |
| | | <Compile Include="Utils\Base64Helper.cs" /> |
| | | <Compile Include="Utils\ConfigHelper.cs" /> |
| | | <Compile Include="Utils\DataCache.cs" /> |
| | | <Compile Include="Utils\DESHelper.cs" /> |
| | | <Compile Include="Utils\EntityPropHelper.cs" /> |
| | | <Compile Include="Utils\FileHelper.cs" /> |
| | |
| | | { |
| | | string sql = @"SELECT A.id, ISNULL(C.createtime,'1990-01-01') as createtime, ISNULL(C.updatetime,'1990-01-01') as updatetime, A.code AS placecode, A.status, |
| | | A.islock, A.isexecute, B.name as placetypename, B.remark as placetyperemark, D.name, D.code AS materialcode, D.description, D.typeremark, D.typename, |
| | | ISNULL(D.status,0) AS materialstatus, A.id as placeid, ISNULL(C.materialid,0) as materialid, D.remark, A.layer, A.col, A.row, A.typeid as placetypeid |
| | | ISNULL(D.status,0) AS materialstatus, A.id as placeid, ISNULL(C.materialid,0) as materialid, D.remark, A.layer, A.col, A.row, A.typeid as placetypeid, |
| | | D.thick, D.wide, D.length,D.IssueProjectNo,D.ProcurementProjectNo,D.SerialNo,D.ClassificationSociety,D.CuttingType,D.Version |
| | | FROM dbo.BASEPlace AS A LEFT OUTER JOIN |
| | | dbo.BASEPlaceType AS B ON A.typeid = B.id LEFT OUTER JOIN |
| | | dbo.BASEPlaceMaterial as C on A.id=C.placeid LEFT OUTER JOIN |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWareDataCore.TASK.EnumType |
| | | { |
| | | public enum EIsSendToMes |
| | | { |
| | | å¾
æ¨é = 1, |
| | | æ¨éæå = 2, |
| | | æ¨é失败 = 3, |
| | | 强å¶å®æ = 4 |
| | | } |
| | | } |
| | |
| | | <Compile Include="TASK\EnumType\EMainTaskCheck.cs" /> |
| | | <Compile Include="TASK\EnumType\EMainTaskPriority.cs" /> |
| | | <Compile Include="TASK\EnumType\EMainTaskStatus.cs" /> |
| | | <Compile Include="TASK\EnumType\EIsSendToMes.cs" /> |
| | | <Compile Include="TASK\EnumType\EMainTaskType.cs" /> |
| | | <Compile Include="TASK\EnumType\EInstorgNextNode.cs" /> |
| | | <Compile Include="TASK\EnumType\EPartTaskStatus.cs" /> |
| | |
| | | |
| | | public DateTime? updatetime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»åï¼æä¸¾ EMainTaskType |
| | | /// </summary> |
| | | public int type { get; set; } |
| | | |
| | | public int? equipid { get; set; } |
| | |
| | | |
| | | [StringLength(50)] |
| | | public string materialcode { get; set; } |
| | | |
| | | |
| | | public int? isSendToMes { get; set; } |
| | | |
| | | public string isSendToMesStr { get; set; } |
| | | |
| | | public int? SendToMesCount { get; set; } |
| | | |
| | | public DateTime? SendToMesTime { get; set; } |
| | | |
| | | public string MesRet { get; set; } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWareLog.Report.Helper |
| | | { |
| | | // 建议æ¾å¨ Models æ DTOs æä»¶å¤¹ä¸ |
| | | public class InOutStorageDetailResultForMes |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 表InOutStorageDetailçID |
| | | /// </summary> |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæå¯ä¸ç¼ç |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¹å·/忾工ç¨å· |
| | | /// </summary> |
| | | public string IssueProjectNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®µå· |
| | | /// </summary> |
| | | public string SerialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡æ è¯ï¼æä¸º A.typeï¼ |
| | | /// </summary> |
| | | public int? BusinessFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºä½ç¼ç ï¼æä¸º A.toplacecodeï¼ç®æ åºä½ï¼ |
| | | /// </summary> |
| | | public string PlaceCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åéæ¶é´æ³ï¼æä¸º A.createtimeï¼ |
| | | /// </summary> |
| | | public DateTime? Timestamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åçæ¶é´ï¼æä¸ Timestamp ä¸è´ï¼æå¯æ¿æ¢ä¸ºå
¶å®åæ®µï¼ |
| | | /// </summary> |
| | | public DateTime? OccurrenceTime { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace iWareLog.Report.Helper |
| | | { |
| | | // 建议æ¾å¨ Models æ DTOs æä»¶å¤¹ä¸ |
| | | public class R_InOutStorageDetailResultForMes |
| | | { |
| | | |
| | | /// <summary> |
| | | /// åæå¯ä¸ç¼ç |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¹å·/忾工ç¨å· |
| | | /// </summary> |
| | | public string IssueProjectNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®µå· |
| | | /// </summary> |
| | | public string SerialNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡æ è¯ï¼æä¸º A.typeï¼ |
| | | /// </summary> |
| | | public string BusinessFlag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºä½ç¼ç ï¼æä¸º A.toplacecodeï¼ç®æ åºä½ï¼ |
| | | /// </summary> |
| | | public string PlaceCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åéæ¶é´æ³ï¼æä¸º A.createtimeï¼ |
| | | /// </summary> |
| | | public string Timestamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åçæ¶é´ï¼æä¸ Timestamp ä¸è´ï¼æå¯æ¿æ¢ä¸ºå
¶å®åæ®µï¼ |
| | | /// </summary> |
| | | public string OccurrenceTime { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | string sql = @"select count(B.typename)quantity,B.typename materialcode from InOutStorageDetail A left join WGQ_WB19011_CORE.[dbo].[BASEMaterialView] B on A.materialid=B.id |
| | | where A.type=@p0 and A.updatetime>=@p1 and A.updatetime<@p2 group by B.typename"; |
| | | List<InOutHelper> data = context.Database.SqlQuery<InOutHelper>(sql,type, start, end).ToList(); |
| | | List<InOutHelper> data = context.Database.SqlQuery<InOutHelper>(sql, type, start, end).ToList(); |
| | | return data; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢åºå
¥åºæç»åç©æä¿¡æ¯ï¼èæ¥ InOutStorageDetail å BASEMaterialViewï¼ |
| | | /// </summary> |
| | | /// <returns>è¿åå
å«åæç¼ç ãè¹å·ãåæ®µå·ãä¸å¡æ è¯ãåºä½ãæ¶é´çä¿¡æ¯çå表</returns> |
| | | public List<InOutStorageDetailResultForMes> GetInOutStorageDetailListForMes() |
| | | { |
| | | using (DbModelLog context = new DbModelLog()) |
| | | { |
| | | try |
| | | { |
| | | string sql = @" |
| | | SELECT |
| | | A.id AS Id, |
| | | B.code AS Code, |
| | | B.issueprojectno AS IssueProjectNo, |
| | | B.serialno AS SerialNo, |
| | | A.type AS BusinessFlag, |
| | | A.toplacecode AS PlaceCode, |
| | | A.createtime AS Timestamp, |
| | | A.createtime AS OccurrenceTime |
| | | FROM |
| | | InOutStorageDetail A |
| | | INNER JOIN |
| | | WGQ_WB19011_CORE.[dbo].[BASEMaterialView] B |
| | | ON A.materialid = B.id And A.isSendToMes=1 "; |
| | | |
| | | // æ§è¡ SQL æ¥è¯¢ï¼å¹¶æ å°å°èªå®ä¹ç±» InOutStorageDetailResult |
| | | var data = context.Database.SqlQuery<InOutStorageDetailResultForMes>(sql).ToList(); |
| | | |
| | | return data; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // è®°å½å¼å¸¸æ¥å¿ï¼åä½ åææ¹æ³ä¿æä¸è´ï¼ |
| | | LogTextHelper.WriteLine("InOutService", "GetInOutStorageDetailList", ex.ToString()); |
| | | return null; // æè
è¿å new List<InOutStorageDetailResult>()ï¼æ ¹æ®ä½ çä¸å¡éæ± |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <DependentUpon>Resources.resx</DependentUpon> |
| | | </Compile> |
| | | <Compile Include="Report\Helper\AlertHelper.cs" /> |
| | | <Compile Include="Report\Helper\R_InOutStorageDetailResultForMes.cs" /> |
| | | <Compile Include="Report\Helper\InOutStorageDetailResultForMes.cs" /> |
| | | <Compile Include="Report\Helper\InOutHelper.cs" /> |
| | | <Compile Include="Report\Service\AlertService.cs" /> |
| | | <Compile Include="Report\Service\InOutService.cs" /> |