From ed05efdc17aab076146b134ebe105b6382f221d7 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期四, 10 七月 2025 10:09:29 +0800 Subject: [PATCH] 格式化代码 --- MESApplication/Controllers/BasicData/MesDeliveryNoteBarcodeController.cs | 160 ++++++++++++++++------------------------------------ 1 files changed, 50 insertions(+), 110 deletions(-) diff --git a/MESApplication/Controllers/BasicData/MesDeliveryNoteBarcodeController.cs b/MESApplication/Controllers/BasicData/MesDeliveryNoteBarcodeController.cs index bd5d18b..c55bfbe 100644 --- a/MESApplication/Controllers/BasicData/MesDeliveryNoteBarcodeController.cs +++ b/MESApplication/Controllers/BasicData/MesDeliveryNoteBarcodeController.cs @@ -20,7 +20,8 @@ private readonly string TableName = "MES_DELIVERY_NOTE_BARCODE"; - private readonly string URL = "http://localhost:10054/api/MesDeliveryNoteBarcode/"; + private readonly string URL = + "http://localhost:10054/api/MesDeliveryNoteBarcode/"; [HttpPost("Save")] public ResponseResult Save(ErpBarcode barcode) @@ -108,19 +109,28 @@ } } - /***杩涘叆妯$増绠$悊鍙互淇敼妯$増***/ - - /// <summary> - /// 鑾峰彇鎵�鏈� - /// </summary> - /// <returns></returns> - [HttpPost("GetList")] - public ResponseResult GetList() + [HttpPost("Delete")] + public ResponseResult Delete(DelBarcode barcode) { + var entity = new MessageCenter(); + entity.TableName = TableName; + entity.Url = URL + "Delete"; + entity.Method = METHOD; + entity.Data = JsonConvert.SerializeObject(barcode); + entity.Status = 1; + entity.CreateBy = "PL017"; try { dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.GetList(); + var save = m.Delete(barcode); + resultInfos.tbBillList = save; + + entity.Result = 0; + if (save) entity.Result = 1; + + entity.DealWith = 1; + _manager.save(entity); + return new ResponseResult { status = 0, @@ -130,22 +140,40 @@ } catch (Exception ex) { + entity.Result = 0; + + entity.DealWith = 0; + + entity.ResultData = ex.Message; + + _manager.save(entity); + return ResponseResult.ResponseError(ex); } } - - /// <summary> - /// 鏍规嵁涓婚敭鑾峰彇 - /// </summary> - /// <returns></returns> - [HttpPost("GetById")] - public ResponseResult GetById(int id) + [HttpPost("DeleteList")] + public ResponseResult DeleteList(List<DelBarcode> barcodes) { + var entity = new MessageCenter(); + entity.TableName = TableName; + entity.Url = URL + "DeleteList"; + entity.Method = METHOD; + entity.Data = JsonConvert.SerializeObject(barcodes); + entity.Status = 1; + entity.CreateBy = "PL017"; try { dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.GetById(id); + var save = m.DeleteList(barcodes); + resultInfos.tbBillList = save; + + entity.Result = 0; + if (save) entity.Result = 1; + + entity.DealWith = 1; + _manager.save(entity); + return new ResponseResult { status = 0, @@ -155,102 +183,14 @@ } catch (Exception ex) { - return ResponseResult.ResponseError(ex); - } - } + entity.Result = 0; - /// <summary> - /// 鏍规嵁涓婚敭鍒犻櫎 - /// </summary> - /// <returns></returns> - [HttpPost("DeleteByIds")] - public ResponseResult DeleteByIds([FromBody] object[] ids) - { - try - { - dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.DeleteByIds(ids); - return new ResponseResult - { - status = 0, - message = "OK", - data = resultInfos - }; - } - catch (Exception ex) - { - return ResponseResult.ResponseError(ex); - } - } + entity.DealWith = 0; - /// <summary> - /// 娣诲姞 - /// </summary> - /// <returns></returns> - [HttpPost("Insert")] - public ResponseResult Add([FromBody] MesDeliveryNoteBarcode data) - { - try - { - dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.Insert(data); - return new ResponseResult - { - status = 0, - message = "OK", - data = resultInfos - }; - } - catch (Exception ex) - { - return ResponseResult.ResponseError(ex); - } - } + entity.ResultData = ex.Message; - /// <summary> - /// 娣诲姞杩斿洖鑷 - /// </summary> - /// <returns></returns> - [HttpPost("InsertReturnIdentity")] - public ResponseResult InsertReturnIdentity([FromBody] MesDeliveryNoteBarcode data) - { - try - { - dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.InsertReturnIdentity(data); - return new ResponseResult - { - status = 0, - message = "OK", - data = resultInfos - }; - } - catch (Exception ex) - { - return ResponseResult.ResponseError(ex); - } - } + _manager.save(entity); - /// <summary> - /// 淇敼 - /// </summary> - /// <returns></returns> - [HttpPost("Update")] - public ResponseResult Update([FromBody] MesDeliveryNoteBarcode data) - { - try - { - dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.Update(data); - return new ResponseResult - { - status = 0, - message = "OK", - data = resultInfos - }; - } - catch (Exception ex) - { return ResponseResult.ResponseError(ex); } } -- Gitblit v1.9.3