From c21c4880ccb8fd06c1647d3a84d330c42ebf9ee5 Mon Sep 17 00:00:00 2001 From: 杨张扬 <634643841@qq.com> Date: 星期一, 28 七月 2025 10:25:09 +0800 Subject: [PATCH] 删除人工次品回炉PDA功能 --- api/ApiHelper.cs | 172 ------------------------------------------- api/MoboxController.cs | 12 --- 2 files changed, 0 insertions(+), 184 deletions(-) diff --git a/api/ApiHelper.cs b/api/ApiHelper.cs index ef52fbb..b12c74c 100644 --- a/api/ApiHelper.cs +++ b/api/ApiHelper.cs @@ -634,178 +634,6 @@ } /// <summary> - /// 浜哄伐娆″搧鍥炵倝 - /// </summary> - /// <param name="model"></param> - /// <returns></returns> - internal static SimpleResult PDAReturnReset(PDAReturnResetInfo model) - { - LogHelper.Info("瑙﹀彂API锛氫汉宸ユ鍝佸洖鐐� + JsonConvert.SerializeObject(model), "API"); - - var result = new SimpleResult();//杩斿洖缁撴灉 - - try - { - var db = new SqlHelper<object>().GetInstance(); - - var startLoc = db.Queryable<TN_Location>().First(o => o.S_CODE == model.startLoc && o.N_CURRENT_NUM ==0 && o.N_LOCK_STATE == 0 && o.S_LOCK_STATE=="鏃� && o.S_AREA_CODE == Settings.Areas[4]); - if (startLoc == null) - { - result.resultCode = 1; - result.resultMsg = $"鏈壘鍒板悎閫傜殑璧风偣淇℃伅锛岃姹傦細o.S_CODE == { model.startLoc} && o.N_CURRENT_NUM ==0 && o.N_LOCK_STATE == 0 && o.S_LOCK_STATE == 鏃�&& o.S_AREA_CODE == {Settings.Areas[4]}"; - LogHelper.Info(result.resultMsg); - return result; - } - - var endLoc = db.Queryable<TN_Location>(). - Where(o =>o.S_AREA_CODE == Settings.Areas[11] - && o.N_CURRENT_NUM == 0 - && o.N_LOCK_STATE == 0 && o.S_LOCK_STATE == "鏃� - && SqlFunc.Subqueryable<TN_Loc_Container>().Where(b => b.S_LOC_CODE == o.S_CODE).NotAny() - ).First(); - - if (endLoc == null) - { - result.resultCode = 2; - result.resultMsg = $"鏈壘鍒板悎閫傜殑缁堢偣淇℃伅锛岃姹傦細o.S_AREA_CODE == {Settings.Areas[11]} && o.N_CURRENT_NUM == 0 && o.N_LOCK_STATE == 0 && o.S_LOCK_STATE == 鏃�; - LogHelper.Info(result.resultMsg); - return result; - } - - var cgInfo = db.Queryable<TN_CG_Detail>().First(a=>a.S_CNTR_CODE == model.rfId); - if (cgInfo == null) - { - result.resultCode = 3; - result.resultMsg = $"鏈壘鍒板搴旂殑鐗╂枡淇℃伅锛岃姹傦細a.S_CNTR_CODE == {model.rfId}"; - LogHelper.Info(result.resultMsg); - return result; - } - - var task1 = new TN_Task() - { - S_CODE = WCSHelper.GenerateTaskNo(), - S_START_AREA = startLoc.S_AREA_CODE, - S_END_AREA = endLoc.S_AREA_CODE, - S_START_LOC = startLoc.S_CODE, - S_END_LOC = endLoc.S_CODE, - S_TYPE = "浜哄伐娆″搧鍥炵倝", - N_B_STATE = 0, - S_B_STATE = "绛夊緟", - S_CNTR_CODE = model.rfId, - S_SPEC = cgInfo.S_ITEM_SPEC, - }; - - startLoc.N_LOCK_STATE = 2; - startLoc.S_LOCK_STATE = "鍑哄簱閿�; - startLoc.N_CURRENT_NUM = 1; - startLoc.T_MODIFY = System.DateTime.Now; - - endLoc.N_LOCK_STATE = 1; - endLoc.S_LOCK_STATE = "鍏ュ簱閿�; - endLoc.T_MODIFY = System.DateTime.Now; - - using (var tran = db.Ado.UseTran()) - { - var locCnt = db.Queryable<TN_Loc_Container>().First(o => o.S_CNTR_CODE == model.rfId && o.S_LOC_CODE != model.startLoc); - TN_Location locOld = null; - if (locCnt != null) - { - locOld = db.Queryable<TN_Location>().First(o => o.S_CODE == locCnt.S_LOC_CODE); - if (locOld != null) - { - locOld.N_CURRENT_NUM = 0; - if (db.Updateable<TN_Location>(locOld).UpdateColumns(it => new { it.N_CURRENT_NUM }).ExecuteCommand() <= 0) - { - tran.RollbackTran(); - result.resultCode = 4; - result.resultMsg = $"鏇存柊鏃ц揣浣嶅け璐ワ紝{locOld.S_CODE}"; - LogHelper.Info(result.resultMsg); - return result; - } - } - - locCnt.S_LOC_CODE = model.startLoc; - if (db.Updateable<TN_Loc_Container>(locCnt).UpdateColumns(it => new { it.S_LOC_CODE }).ExecuteCommand() <= 0) - { - tran.RollbackTran(); - result.resultCode = 5; - result.resultMsg = $"鏇存柊璐т綅瀹瑰櫒鍏崇郴琛紙鎹㈢粦锛夊け璐ワ紝{model.startLoc}"; - LogHelper.Info(result.resultMsg); - return result; - } - } - else - { - locCnt = new TN_Loc_Container() - { - S_LOC_CODE = model.startLoc, - S_CNTR_CODE = model.rfId, - }; - if (db.Insertable<TN_Loc_Container>(locCnt).ExecuteCommand() <= 0) - { - tran.RollbackTran(); - result.resultCode = 6; - result.resultMsg = $"鎻掑叆璐т綅瀹瑰櫒鍏崇郴琛紙缁戝畾锛夊け璐ワ紝{model.startLoc}"; - LogHelper.Info(result.resultMsg); - return result; - } - } - - if (db.Insertable<TN_Task>(task1).ExecuteCommand() > 0 && - db.Updateable<TN_Location>(startLoc).ExecuteCommand() > 0 && - db.Updateable<TN_Location>(endLoc).ExecuteCommand() > 0) - { - - Task task99 = Task.Run(() => - { - WMSHelper.InsertOpInfo(model.staff, "浜哄伐娆″搧鍥炵倝", locCnt.S_CNTR_CODE); - }); - - Task task2 = Task.Run(() => - { - var target = new TN_RemeltDetail() - { - TASKNO = task1.S_CODE, - CNTCODE = model.rfId, - STARTLOC = model.startLoc, - LOGINNAME = model.staff, - ITEMCODE = cgInfo.S_ITEM_CODE, - SPEC = cgInfo.S_SPE, - CARCODE = cgInfo.S_CAR_CODE, - WEIGHT = cgInfo.F_QTY, - REMELTTIME = DateTime.Now, - SHIFT = model.shift, - }; - SpecHelper.InsertRemeltDetail(target); - }); - - tran.CommitTran(); - result.resultCode = 0; - result.resultMsg = "鎴愬姛"; - LogHelper.Info($"鐢熸垚浜哄伐娆″搧鍥炵倝浠诲姟鎴愬姛锛屽鍣細{model.rfId}锛岃捣鐐癸細{model.startLoc}锛岀粓鐐癸細{endLoc.S_CODE}"); - return result; - } - else - { - tran.RollbackTran(); - result.resultCode = 7; - result.resultMsg = $"鐢熸垚浜哄伐娆″搧鍥炵倝浠诲姟澶辫触锛屽鍣細{model.rfId}锛岃捣鐐癸細{model.startLoc}锛岀粓鐐癸細{endLoc.S_CODE}"; - LogHelper.Info(result.resultMsg); - return result; - } - } - - } - catch(Exception ex) - { - result.resultCode = -1; - result.resultMsg = $"鐢熸垚浜哄伐娆″搧鍥炵倝浠诲姟澶辫触锛屽彂鐢熶簡寮傚父锛歿ex.Message}"; - LogHelper.Info(result.resultMsg); - return result; - } - } - - /// <summary> /// 鏄剧ず婊℃墭缂撳瓨搴撳綋鍓嶈鏍肩殑鎵樼洏鏁伴噺 /// </summary> /// <param name="model"></param> diff --git a/api/MoboxController.cs b/api/MoboxController.cs index 1dc0148..ead375f 100644 --- a/api/MoboxController.cs +++ b/api/MoboxController.cs @@ -202,18 +202,6 @@ } /// <summary> - /// 浜哄伐娆″搧鍥炵倝 - /// </summary> - /// <param name="model"></param> - /// <returns></returns> - [HttpPost] - [Route("PDAReturnReset")] - public SimpleResult PDAReturnReset(PDAReturnResetInfo model) - { - return ApiHelper.PDAReturnReset(model); - } - - /// <summary> /// 浜哄伐鍒涘缓鐐瑰埌鐐逛换鍔� /// </summary> /// <param name="model"></param> -- Gitblit v1.9.1