diff --git a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeDaqListOutput.cs b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeDaqListOutput.cs index b938e836..a176a856 100644 --- a/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeDaqListOutput.cs +++ b/PerMgr/Tnb.PerMgr.Entities/Dto/ProcessParamTypeDaqListOutput.cs @@ -4,5 +4,6 @@ namespace Tnb.PerMgr.Entities.Dto { public string? id { get; set; } public string? label_name { get; set; } + public string? label_point { get; set; } } } \ No newline at end of file diff --git a/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs b/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs index 39b798ad..e71ed103 100644 --- a/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs +++ b/PerMgr/Tnb.PerMgr/PerProcessParamTypeService.cs @@ -49,6 +49,7 @@ namespace Tnb.PerMgr { id = a.id, label_name = a.label_name, + label_point = a.label_point, }), children = SqlFunc.Subqueryable() .LeftJoin((y, z) => y.tolerance_category_id == z.id) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index f266d8f2..67086b5c 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -31,7 +31,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs; namespace Tnb.ProductionMgr { /// - /// mes生产入库申请 + /// mes鐢熶骇鍏ュ簱鐢宠 /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] @@ -111,7 +111,7 @@ namespace Tnb.ProductionMgr if (string.IsNullOrEmpty(input.station_id)) { - throw Oops.Bah("请先选择工位"); + throw Oops.Bah("璇峰厛閫夋嫨宸ヤ綅"); } DbResult result = await db.Ado.UseTranAsync(async () => @@ -225,11 +225,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "保存成功" : result2.ErrorMessage); + return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "淇濆瓨鎴愬姛" : result2.ErrorMessage); } /// - /// 入库申请同步 + /// 鍏ュ簱鐢宠鍚屾 /// /// source_id /// @@ -259,7 +259,7 @@ namespace Tnb.ProductionMgr } /// - /// 注塑满箱到位后入库申请 + /// 娉ㄥ婊$鍒颁綅鍚庡叆搴撶敵璇 /// /// /// @@ -272,12 +272,12 @@ namespace Tnb.ProductionMgr string warehouse_id = "2"; if (string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("璇蜂紶鏈哄彴鍙"); } if (string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("璇蜂紶鏍囩鍙"); } ISqlSugarClient db = _repository.AsSugarClient(); @@ -286,7 +286,7 @@ namespace Tnb.ProductionMgr { equipment = await db.Queryable() .LeftJoin((x, y) => x.id == y.equip_id) - .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "注塑空满箱请求") + .Where((x, y) => y.equip_code == equip_code && y.label_point == label_code && y.label_name.Contains("娉ㄥ绌烘弧绠辫姹")) .Select((x, y) => x) .FirstAsync(); } @@ -297,18 +297,18 @@ namespace Tnb.ProductionMgr } if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("鏈壘鍒版満鍙"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } PrdReport prdReport = await db.Queryable() @@ -319,7 +319,7 @@ namespace Tnb.ProductionMgr string org_id = user.OrganizeId; if (prdReport == null) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("鏈壘鍒版彁鎶ヨ褰"); } @@ -423,18 +423,18 @@ namespace Tnb.ProductionMgr { _ = await db.Insertable(prdInstockDs).ExecuteCommandAsync(); } - //todo 入库申请后是否修改提报记录状态 + //todo 鍏ュ簱鐢宠鍚庢槸鍚︿慨鏀规彁鎶ヨ褰曠姸鎬 }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功"; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "鎴愬姛"; } // [HttpPost] // public async Task InstockTubeOne(PrdReport prdReport) // { // ISqlSugarClient db = _repository.AsSugarClient(); - // string location_code = "ZCR01";//todo 短管挤出件目标库位之后改 + // string location_code = "ZCR01";//todo 鐭鎸ゅ嚭浠剁洰鏍囧簱浣嶄箣鍚庢敼 // string warehouse_id = "2"; // // PrdInstockH? prdInstockH = null; @@ -548,17 +548,17 @@ namespace Tnb.ProductionMgr string label_code = input.label_code; if (string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("璇蜂紶鏈哄彴鍙"); } if (string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("璇蜂紶鏍囩鍙"); } ISqlSugarClient db = _repository.AsSugarClient(); - // string location_code = "ZCR01";//todo 短管挤出件目标库位之后改 - //todo 入库仓库确定后再改 + // string location_code = "ZCR01";//todo 鐭鎸ゅ嚭浠剁洰鏍囧簱浣嶄箣鍚庢敼 + //todo 鍏ュ簱浠撳簱纭畾鍚庡啀鏀 string warehouse_id = "2"; PrdInstockH? prdInstockH = null; @@ -569,7 +569,7 @@ namespace Tnb.ProductionMgr { equipment = await db.Queryable() .LeftJoin((x, y) => x.id == y.equip_id) - .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "挤出空满箱请求") + .Where((x, y) => y.equip_code == equip_code && y.label_point == label_code && y.label_name.Contains("鎸ゅ嚭绌烘弧绠辫姹")) .Select((x, y) => x) .FirstAsync(); } @@ -580,18 +580,18 @@ namespace Tnb.ProductionMgr } if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("鏈壘鍒版満鍙"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } string location_code = basLocation.location_code; @@ -703,11 +703,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功"; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "鎴愬姛"; } /// - /// 长管管挤出入库申请 + /// 闀跨绠℃尋鍑哄叆搴撶敵璇 /// /// /// @@ -715,7 +715,7 @@ namespace Tnb.ProductionMgr { ISqlSugarClient db = _repository.AsSugarClient(); string location_code = prdReport.location_code; - string warehouse_id = "27209786980373";//长件挤出缓存仓 + string warehouse_id = "27209786980373";//闀夸欢鎸ゅ嚭缂撳瓨浠 PrdInstockH? prdInstockH = null; List prdInstockDs = new() { }; @@ -819,11 +819,11 @@ namespace Tnb.ProductionMgr }); } - return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "成功"; + return !result2.IsSuccess ? string.IsNullOrEmpty(result2.ErrorMessage) ? throw Oops.Oh(ErrorCode.COM1008) : throw Oops.Bah(result2.ErrorMessage) : "鎴愬姛"; } /// - /// 外包装入库申请 + /// 澶栧寘瑁呭叆搴撶敵璇 /// /// /// @@ -831,39 +831,39 @@ namespace Tnb.ProductionMgr { string equip_code = input.equip_code; string label_code = input.label_code; - string warehouse_id = "26103367464997";//四楼解析库 + string warehouse_id = "26103367464997";//鍥涙ゼ瑙f瀽搴 if (!string.IsNullOrEmpty(equip_code)) { - throw Oops.Bah("请传机台号"); + throw Oops.Bah("璇蜂紶鏈哄彴鍙"); } if (!string.IsNullOrEmpty(label_code)) { - throw Oops.Bah("请传标签号"); + throw Oops.Bah("璇蜂紶鏍囩鍙"); } ISqlSugarClient db = _repository.AsSugarClient(); EqpEquipment equipment = await db.Queryable() .LeftJoin((x, y) => x.id == y.equip_id) - .Where((x, y) => y.equip_code == equip_code && y.label_name == label_code && y.label_point == "外包装成品码垛点位") + .Where((x, y) => y.equip_code == equip_code && y.label_point == label_code && y.label_name == "澶栧寘瑁呮垚鍝佺爜鍨涚偣浣") .Select((x, y) => x) .FirstAsync(); if (equipment == null) { - throw Oops.Bah("未找到机台"); + throw Oops.Bah("鏈壘鍒版満鍙"); } if (string.IsNullOrEmpty(equipment.as_location_id)) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } BasLocation basLocation = await db.Queryable().SingleAsync(x => x.id == equipment.as_location_id); if (basLocation == null) { - throw Oops.Bah("未找到入库库位"); + throw Oops.Bah("鏈壘鍒板叆搴撳簱浣"); } OrganizeEntity station = await db.Queryable() @@ -872,19 +872,19 @@ namespace Tnb.ProductionMgr if (station == null) { - throw Oops.Bah("未找到工位"); + throw Oops.Bah("鏈壘鍒板伐浣"); } PrdOutPacking prdOutPacking = await db.Queryable().Where(x => x.station_id == station.Id && x.status == "0").OrderByDescending(x => x.create_time).FirstAsync(); if (prdOutPacking == null) { - throw Oops.Bah("未找到托盘"); + throw Oops.Bah("鏈壘鍒版墭鐩"); } var prdOutPackMarkLabelList = await db.Queryable().Where(x => x.station_id == station.Id && x.status == "1").ToListAsync(); if (prdOutPackMarkLabelList == null || prdOutPackMarkLabelList.Count <= 0) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("鏈壘鍒版彁鎶ヨ褰"); } List reportIds = prdOutPackMarkLabelList.Select(x => x.report_id).ToList(); @@ -894,7 +894,7 @@ namespace Tnb.ProductionMgr if (prdReports == null || prdReports.Count <= 0) { - throw Oops.Bah("未找到提报记录"); + throw Oops.Bah("鏈壘鍒版彁鎶ヨ褰"); } string create_id = prdReports[0].create_id; UserEntity user = await db.Queryable().SingleAsync(x => x.Id == create_id); @@ -1014,11 +1014,11 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.status == "2") .Where(x => x.station_id == station.Id && x.status == "1").ExecuteCommandAsync(); - //todo 入库申请后是否修改提报记录状态 + //todo 鍏ュ簱鐢宠鍚庢槸鍚︿慨鏀规彁鎶ヨ褰曠姸鎬 }); } - return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "申请成功" : result2.ErrorMessage); + return !result2.IsSuccess ? throw Oops.Oh(ErrorCode.COM1008) : (dynamic)(result2.IsSuccess ? "鐢宠鎴愬姛" : result2.ErrorMessage); } } } \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs index 1fbee1b4..3c2dbd24 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdPackReportService.cs @@ -420,7 +420,7 @@ namespace Tnb.ProductionMgr .LeftJoin((a, b, c, d, e, f, g, h, i) => a.process_id == i.process_id && i.enabled == 1 && a.schedule_type==1) .LeftJoin((a, b, c, d, e, f, g, h, i, j) => a.mo_id == j.id) .LeftJoin((a, b, c, d, e, f, g, h, i, j, k) => a.material_id == k.material_id && k.auxiliary_unit_id == "kg") - .LeftJoin((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_point == "娉ㄥ绌烘弧绠辫姹") + .LeftJoin((a, b, c, d, e, f, g, h, i, j, k, l) => a.eqp_id == l.equip_id && l.enabled == 1 && l.label_name.Contains("鍏佽绉伴噸"))//娉ㄥ绌烘弧绠辫姹 .Where((a, b) => a.workstation_id == input.stationId) .WhereIF(!string.IsNullOrEmpty(mo_task_code), a => a.mo_task_code.Contains(mo_task_code)) //.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status==mo_task_status) @@ -468,7 +468,7 @@ namespace Tnb.ProductionMgr main_num = k.number_of_primary_unit, deputy_num = k.number_of_auxiliary_unit, third_equip_code = l.equip_code, - weight_name = l.label_name, + weight_name = l.label_point, category_id = b.category_id, as_location_id = f.as_location_id }) diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs index fd7cad38..1caf8b9c 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs @@ -1,18 +1,24 @@ 锘縰sing System.Reflection; +using JNPF; using JNPF.Common.Cache; using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; +using JNPF.Logging; using JNPF.VisualDev; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SqlSugar; +using Tnb.Common.Extension; using Tnb.Common.Redis; using Tnb.ProductionMgr.Entities; using Tnb.ProductionMgr.Interfaces; +using Tnb.WarehouseMgr.Entities.Configs; +using Tnb.Common.Utils; +using Tnb.EquipMgr.Entities; namespace Tnb.ProductionMgr { @@ -27,6 +33,7 @@ namespace Tnb.ProductionMgr private const string ModuleId = "30062789830933"; private readonly RedisData _redisData; private readonly ISqlSugarRepository _repository; + private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build(); public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); public RedisDataService(RedisData redisData, ISqlSugarRepository repository) { @@ -54,14 +61,60 @@ namespace Tnb.ProductionMgr [HttpPost] public async Task GetWeight(string device, string jihao) { - bool flag = await _redisData.HashExist(device, jihao); + EqpDaq eqpDaq1 = await _repository.AsSugarClient().Queryable().Where(x => x.equip_code == device && x.label_name.Contains("鍏佽绉伴噸")).FirstAsync(); + if (eqpDaq1 == null) + { + throw Oops.Bah("鏈湪鏁版嵁閲囬泦涓缃厑璁哥О閲嶆爣绛剧偣"); + } + Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = device, + ["token"] = _eleCtlCfg.token, + ["TagName"] = eqpDaq1.label_point, + ["Value"] = "true", + }; + Log.Information($"纭绉伴噸鍙傛暟:{JsonConvert.SerializeObject(dicCommand)}"); + var str = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand); + + EqpDaq eqpDaq2 = await _repository.AsSugarClient().Queryable().Where(x => x.equip_code == device && x.label_name.Contains("褰撳墠閲嶉噺")).FirstAsync(); + if (eqpDaq2 == null) + { + throw Oops.Bah("鏈湪鏁版嵁閲囬泦涓缃綋鍓嶉噸閲忔爣绛剧偣"); + } + + bool flag = await _redisData.HashExist(device, eqpDaq2.label_point); if (!flag) { - throw Oops.Bah("娌℃湁鎵惧埌" + device + "----" + jihao + "鐨勬暟鎹"); + throw Oops.Bah("娌℃湁鎵惧埌" + device + "----" + eqpDaq2.label_point + "鐨勬暟鎹"); } - string data = await _redisData.GetHash(device, jihao); + string data = await _redisData.GetHash(device, eqpDaq2.label_point); JObject? res = JsonConvert.DeserializeObject(data); + + decimal result = res != null && res["Value"] != null ? decimal.Parse(res["Value"]!.ToString()) : throw Oops.Bah("鏁版嵁鏍煎紡閿欒"); + if (result > 0) + { + EqpDaq eqpDaq3 = await _repository.AsSugarClient().Queryable().Where(x => x.equip_code == device && x.label_name.Contains("绉伴噸瀹屾垚")).FirstAsync(); + + if (eqpDaq3 == null) + { + throw Oops.Bah("鏈湪鏁版嵁閲囬泦涓缃О閲嶅畬鎴愭爣绛剧偣"); + } + + Dictionary dicCommand2 = new(StringComparer.OrdinalIgnoreCase) + { + ["DevName"] = device, + ["token"] = _eleCtlCfg.token, + ["TagName"] = eqpDaq3.label_point, + ["Value"] = "false", + }; + Log.Information($"绉伴噸瀹屾垚鍙傛暟:{JsonConvert.SerializeObject(dicCommand)}"); + for (int i = 0; i < 5; i++) + { + await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand); + } + } + return result; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index db804733..cf8f8a35 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -88,8 +88,9 @@ namespace Tnb.ProductionMgr /// [HttpGet] [AllowAnonymous] - public async Task EmptyCarryOutStk() + public async Task EmptyCarryOutStk() { + string result = ""; bool? cs01 = await _redisData.TryGetValueByKeyField("YTCS", "CallCtuEmptyIn_CS01"); bool? cs03 = await _redisData.TryGetValueByKeyField("YTCS", "CallCtuEmptyIn_CS03"); bool cs01Flag = _redisData.Get("YTCS_CallCtuEmptyIn_CS01_flag"); @@ -97,24 +98,29 @@ namespace Tnb.ProductionMgr if (cs01==true && !cs01Flag) { BasFactoryConfig config = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN); - HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-left"); - // HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-left"); + string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-left"); + // string response = HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-left"); + AuthResponse authResponse = JsonConvert.DeserializeObject(response); + result += authResponse.data.ToString(); } if (cs03==true && !cs03Flag) { BasFactoryConfig config = await _repository.AsSugarClient().Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN); - HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-right"); - // HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-right"); + string response = HttpUtils.RequestGet($"{config.value}/api/production/time-work/empty-carry-out-stk-right"); + // string response = HttpUtils.RequestGet($"http://localhost:9232/api/production/time-work/empty-carry-out-stk-right"); + AuthResponse authResponse = JsonConvert.DeserializeObject(response); + result += authResponse.data.ToString(); } - return Task.CompletedTask; + return result; } [HttpGet] [AllowAnonymous] - public async Task EmptyCarryOutStkLeft() + public async Task EmptyCarryOutStkLeft() { + string msg = ""; MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput(); input.org_id = WmsWareHouseConst.AdministratorOrgId; input.location_code = "SSX-021-001"; @@ -126,20 +132,23 @@ namespace Tnb.ProductionMgr Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input); if (result.code == HttpStatusCode.OK) { + msg = "宸﹁緭閫佺嚎绌虹鍏ュ懠鍙垚鍔"; Log.Information("銆怑mptyCarryOutStk銆戝乏杈撻佺嚎绌虹鍏ュ懠鍙垚鍔"); //_redisData.Set("YTCS_CallCtuEmptyIn_CS01_flag", true, TimeSpan.FromMinutes(20)); } else { + msg = $"宸﹁緭閫佺嚎绌虹鍏ュ懠鍙け璐:{result.msg}"; Log.Error($"銆怑mptyCarryOutStk銆戝乏杈撻佺嚎绌虹鍏ュ懠鍙け璐:{result.msg}"); } - return Task.CompletedTask; + return msg; } [HttpGet] [AllowAnonymous] - public async Task EmptyCarryOutStkRight() + public async Task EmptyCarryOutStkRight() { + string msg = ""; MESEmptyCarryOutStkInput input = new MESEmptyCarryOutStkInput(); input.org_id = WmsWareHouseConst.AdministratorOrgId; input.location_code = "SSX-021-003"; @@ -151,20 +160,23 @@ namespace Tnb.ProductionMgr Result result = await _wmsEmptyOutstockService.MESEmptyCarryOutStk(input); if (result.code == HttpStatusCode.OK) { + msg = "鍙宠緭閫佺嚎绌虹鍏ュ懠鍙垚鍔"; Log.Information("銆怑mptyCarryOutStk銆戝彸杈撻佺嚎绌虹鍏ュ懠鍙垚鍔"); //_redisData.Set("YTCS_CallCtuEmptyIn_CS03_flag", true, TimeSpan.FromMinutes(20)); } else { + msg = $"鍙宠緭閫佺嚎绌虹鍏ュ懠鍙け璐:{result.msg}"; Log.Error($"銆怑mptyCarryOutStk銆戝彸杈撻佺嚎绌虹鍏ュ懠鍙け璐:{result.msg}"); } - return Task.CompletedTask; + return msg; } [HttpGet] [AllowAnonymous] - public async Task FixedPointDelivery() + public async Task FixedPointDelivery() { + string msg = ""; bool? value = await _redisData.TryGetValueByKeyField("hxjC", "DB100.132.3"); bool valueFlag = _redisData.Get("hxjC_DB100.132.3_flag"); if (value==true && !valueFlag) @@ -175,7 +187,7 @@ namespace Tnb.ProductionMgr if (startLocationCode.IsEmpty()) { Log.Error($"璧峰搴撲綅涓虹┖"); - return Task.CompletedTask; + return "璧峰搴撲綅涓虹┖"; } var db = _repository.AsSugarClient(); @@ -184,7 +196,7 @@ namespace Tnb.ProductionMgr if (equipment == null) { Log.Error($"鏈壘鍒拌澶囩紪鍙蜂负TYZS001鐨勮澶"); - return Task.CompletedTask; + return "鏈壘鍒拌澶囩紪鍙蜂负TYZS001鐨勮澶"; } CommonCreatePretaskInput postData = new CommonCreatePretaskInput(); @@ -195,21 +207,23 @@ namespace Tnb.ProductionMgr Log.Information($"銆怓ixedPointDelivery銆戞敞濉戝畾鐐归厤閫,鍙傛暟:{JsonConvert.SerializeObject(postData)}"); BasFactoryConfig config = await db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN); string sendResult = HttpUtils.RequestPost($"{config.value}/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null); - + // string sendResult = HttpUtils.RequestPost($"http://localhost:9232/api/wms/ware-house/common-create-pretask", JsonConvert.SerializeObject(postData), null); AuthResponse authResponse = JsonConvert.DeserializeObject(sendResult); if(authResponse.code == 200 && authResponse.data.ObjToBool()) { + msg = "娉ㄥ瀹氱偣閰嶉佹垚鍔"; Log.Information("銆怓ixedPointDelivery銆戞敞濉戝畾鐐归厤閫佹垚鍔"); //_redisData.Set("hxjC_DB100.132.3_flag", true, TimeSpan.FromMinutes(20)); } else { + msg = $"娉ㄥ瀹氱偣閰嶉佸け璐:{authResponse.msg}"; Log.Error($"銆怓ixedPointDelivery銆戞敞濉戝畾鐐归厤閫佸け璐:{authResponse.msg}"); } } - return Task.CompletedTask; + return msg; } }