MES.Service/Dto/webApi/ErpProductionOrder.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ namespace MES.Service.Dto.webApi { public class ErpProductionOrder { //public string? Id { get; set; } public string? SalesOrder { get; set; } public string? ImageUrl { get; set; } } } MES.Service/Dto/webApi/ProductionOrder.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MES.Service.Dto.webApi { public class ProductionOrder { public ErpProductionOrder erpProductionOrder { get; set; } } } MES.Service/Modes/ProductionOrders.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ using SqlSugar; namespace MES.Service.Modes; //éè´§å头 [SugarTable("MES_PRODUCTION_ORDER")] public class ProductionOrders { //SEQ_MES_SCZZD [SugarColumn(ColumnName = "ID", IsPrimaryKey = true, OracleSequenceName = "SEQ_MES_SCZZD")] public decimal Id { get; set; } //éè´§åå· [SugarColumn(ColumnName = "SALES_ORDER")] public string? SalesOrder { get; set; } //ä¾åºå [SugarColumn(ColumnName = "IMAGE_URL")] public string? ImageUrl { get; set; } } MES.Service/Modes/SentLaboratoryTestingItems.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,23 @@ using SqlSugar; namespace MES.Service.Modes; /// <summary> /// å®éªå®¤éæ£é¡¹ç®è¡¨ /// </summary> [SugarTable("MES_QMS_SAMPLE_CHECK")] public class SentLaboratoryTestingItems { /// <summary> /// SEQ_salesåºå /// </summary> [SugarColumn(ColumnName = "ID")] public decimal Id { get; set; } /// <summary> /// éæ£é¡¹ç® /// </summary> [SugarColumn(ColumnName = "INSPECTION_ITEMS")] public string? InspectionItems { get; set; } } MES.Service/bin/Debug/net8.0/MES.Service.dllBinary files differ
MES.Service/bin/Debug/net8.0/MES.Service.pdbBinary files differ
MES.Service/service/BasicData/ProductionOrderManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,47 @@ using MES.Service.DB; using MES.Service.Dto.webApi; using MES.Service.Dto.webApi.DeliveryNote; using MES.Service.Modes; using MES.Service.Modes.DeliveryNote; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; public class ProductionOrderManager : Repository<ProductionOrders> { public dynamic Save(ErpProductionOrder erpProductionOrder) { //var erpProductionOrder = productionOrder.erpProductionOrder; var mesProductionOrder = GetMesProductionOrder(erpProductionOrder); return UseTransaction(db => { return SaveOrUpdateData(db, mesProductionOrder) ? 1 : 0; }) > 0; } public dynamic SaveList(List<ErpProductionOrder> erpProductionOrder) { var result = erpProductionOrder.Select(Save).ToList(); return result.All(b => b); } public ProductionOrders GetMesProductionOrder(ErpProductionOrder erpProductionOrder) { var mesProductionOrders = new ProductionOrders { ImageUrl = erpProductionOrder.ImageUrl, SalesOrder = erpProductionOrder.SalesOrder }; return mesProductionOrders; } private bool SaveOrUpdateData(SqlSugarScope db, ProductionOrders productionOrders) { var orUpdate = base.Insert(productionOrders); if (orUpdate) return true; throw new NotImplementedException("æå ¥ææ´æ°å¤±è´¥"); } } MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,75 @@ using MES.Service.DB; using MES.Service.Modes; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MES.Service.service.BasicData; public class SentLaboratoryTestingItemsManager : Repository<SentLaboratoryTestingItems> { /// <summary> /// ä»å¨æ¹æ³æ»¡è¶³ä¸äºå¤æä¸å¡éæ±ï¼ä¸å¡ä»£ç 请å¨è¿éé¢å®ä¹æ¹æ³ /// </summary> public void Study() { /*********æ¥è¯¢*********/ var data1 = base.GetById(1); //æ ¹æ®IDæ¥è¯¢ var data2 = base.GetList(); //æ¥è¯¢ææ var data3 = base.GetList(it => 1 == 1); //æ ¹æ®æ¡ä»¶æ¥è¯¢ //var data4 = base.GetSingle(it => 1 == 1);//æ ¹æ®æ¡ä»¶æ¥è¯¢ä¸æ¡,å¦æè¶ è¿ä¸æ¡ä¼æ¥é var p = new PageModel { PageIndex = 1, PageSize = 2 }; // å页æ¥è¯¢ var data5 = base.GetPageList(it => 1 == 1, p); Console.Write(p.TotalCount); //è¿åæ»æ° var data6 = base.GetPageList(it => 1 == 1, p, it => SqlFunc.GetRandom()); // å页æ¥è¯¢å æåº Console.Write(p.TotalCount); //è¿åæ»æ° var conModels = new List<IConditionalModel>(); //ç»è£ æ¡ä»¶æ¥è¯¢ä½ä¸ºæ¡ä»¶å®ç° å页æ¥è¯¢å æåº conModels.Add(new ConditionalModel { FieldName = typeof(SalesOrder).GetProperties()[0].Name, ConditionalType = ConditionalType.Equal, FieldValue = "1" }); //id=1 var data7 = base.GetPageList(conModels, p, it => SqlFunc.GetRandom()); AsQueryable().Where(x => 1 == 1) .ToList(); //æ¯æäºè½¬æ¢æqueryable,æä»¬å¯ä»¥ç¨queryableå®ç°å¤æåè½ /*********æå ¥*********/ var insertData = new SentLaboratoryTestingItems(); //æµè¯åæ° var insertArray = new[] { insertData }; base.Insert(insertData); //æå ¥ base.InsertRange(insertArray); //æ¹éæå ¥ var id = base.InsertReturnIdentity(insertData); //æå ¥è¿åèªå¢å AsInsertable(insertData).ExecuteCommand(); //æä»¬å¯ä»¥è½¬æ Insertableå®ç°å¤ææå ¥ /*********æ´æ°*********/ var updateData = new SentLaboratoryTestingItems(); //æµè¯åæ° var updateArray = new[] { updateData }; //æµè¯åæ° base.Update(updateData); //æ ¹æ®å®ä½æ´æ° base.UpdateRange(updateArray); //æ¹éæ´æ° //base.Update(it => new SalesOrder() { ClassName = "a", CreateTime = DateTime.Now }, it => it.id==1);// åªæ´æ°ClassNameååCreateTimeåï¼å ¶å®å䏿´æ°ï¼æ¡ä»¶id=1 AsUpdateable(updateData).ExecuteCommand(); //转æUpdateableå¯ä»¥å®ç°å¤æçæå ¥ /*********å é¤*********/ var deldata = new SentLaboratoryTestingItems(); //æµè¯åæ° base.Delete(deldata); //æ ¹æ®å®ä½å é¤ base.DeleteById(1); //æ ¹æ®ä¸»é®å é¤ base.DeleteById(new[] { 1, 2 }); //æ ¹æ®ä¸»é®æ°ç»å é¤ base.Delete(it => 1 == 2); //æ ¹æ®æ¡ä»¶å é¤ AsDeleteable().Where(it => 1 == 2) .ExecuteCommand(); //转æDeleteableå®ç°å¤æçæä½ } } MESApplication/Controllers/BasicData/ProductionOrderController.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,135 @@ using MES.Service.Dto.webApi; using MES.Service.Dto.webApi.DeliveryNote; using MES.Service.Modes; using MES.Service.service; using MES.Service.util; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System.Dynamic; namespace MESApplication.Controllers.BasicData; [ApiController] [Route("api/ProductionOrder")] public class ProductionOrderController : ControllerBase { private readonly MessageCenterManager _manager = new(); private readonly ProductionOrderManager m = new(); private readonly string METHOD = "POST"; private readonly string TableName = "MES_PRODUCTION_ORDER"; private readonly string URL = "http://localhost:10054/api/ProductionOrder/"; /// <summary> /// è·åææ /// </summary> /// <returns></returns> [HttpPost("GetList")] public ResponseResult GetList() { try { dynamic resultInfos = new ExpandoObject(); resultInfos.tbBillList = m.GetList(); return new ResponseResult { status = 0, message = "OK", data = resultInfos }; } catch (Exception ex) { return ResponseResult.ResponseError(ex); } } [HttpPost("Save")] public ResponseResult Save(ErpProductionOrder erpProductionOrder) { var entity = new MessageCenter(); entity.TableName = TableName; entity.Url = URL + "Save"; entity.Method = METHOD; entity.Data = JsonConvert.SerializeObject(erpProductionOrder); entity.Status = 1; entity.CreateBy = "PL017"; try { dynamic resultInfos = new ExpandoObject(); var save = m.Save(erpProductionOrder); resultInfos.tbBillList = save; entity.Result = 0; if (save) entity.Result = 1; entity.DealWith = 1; _manager.save(entity); return new ResponseResult { status = 0, message = "OK", data = resultInfos }; } catch (Exception ex) { entity.Result = 0; entity.DealWith = 0; entity.ResultData = ex.Message; _manager.save(entity); return ResponseResult.ResponseError(ex); } } [HttpPost("SaveList")] public ResponseResult SaveList(List<ErpProductionOrder> erpProductionOrder) { var entity = new MessageCenter(); entity.TableName = TableName; entity.Url = URL + "SaveList"; entity.Method = METHOD; entity.Data = JsonConvert.SerializeObject(erpProductionOrder); entity.Status = 1; entity.CreateBy = "PL017"; try { dynamic resultInfos = new ExpandoObject(); var save = m.SaveList(erpProductionOrder); resultInfos.tbBillList = save; entity.Result = 0; if (save) entity.Result = 1; entity.DealWith = 1; _manager.save(entity); return new ResponseResult { status = 0, message = "OK", data = resultInfos }; } catch (Exception ex) { entity.Result = 0; entity.DealWith = 0; entity.ResultData = ex.Message; _manager.save(entity); return ResponseResult.ResponseError(ex); } } } MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,48 @@ using System.Dynamic; using MES.Service.Dto.webApi; using MES.Service.Modes; using MES.Service.service; using MES.Service.service.BasicData; using MES.Service.util; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; namespace MESApplication.Controllers.BasicData; [ApiController] [Route("api/[controller]")] public class SentLaboratoryTestingItemsControllor : ControllerBase { private readonly MessageCenterManager _manager = new(); private readonly SentLaboratoryTestingItemsManager m = new(); private readonly string METHOD = "POST"; private readonly string TableName = "MES_QMS_SAMPLE_CHECK"; private readonly string URL = "http://localhost:10054/api/SentLaboratoryTestingItems/"; /// <summary> /// è·åææ /// </summary> /// <returns></returns> [HttpPost("GetList")] public ResponseResult GetList() { try { dynamic resultInfos = new ExpandoObject(); resultInfos.tbBillList = m.GetList(); return new ResponseResult { status = 0, message = "OK", data = resultInfos }; } catch (Exception ex) { return ResponseResult.ResponseError(ex); } } } MESApplication/bin/Debug/net8.0/MES.Service.dllBinary files differ
MESApplication/bin/Debug/net8.0/MES.Service.pdbBinary files differ
MESApplication/bin/Debug/net8.0/MESApplication.dllBinary files differ
MESApplication/bin/Debug/net8.0/MESApplication.exeBinary files differ
MESApplication/bin/Debug/net8.0/MESApplication.pdbBinary files differ
MESApplication/bin/Debug/net8.0/MESApplication.xml
@@ -462,6 +462,12 @@ </summary> <returns></returns> </member> <member name="M:MESApplication.Controllers.BasicData.ProductionOrderController.GetList"> <summary> è·åææ </summary> <returns></returns> </member> <member name="M:MESApplication.Controllers.BasicData.SalesDeliveryNoticeController.Save(MES.Service.Dto.webApi.SaleDeliveryNotice)"> <summary> åæ¡ä¸»è¡¨æ°æ®ä¿åæä½ @@ -714,6 +720,12 @@ </summary> <returns></returns> </member> <member name="M:MESApplication.Controllers.BasicData.SentLaboratoryTestingItemsControllor.GetList"> <summary> è·åææ </summary> <returns></returns> </member> <member name="M:MESApplication.Controllers.BasicData.ShipmentDetailController.GetList"> <summary> è·åææ