sjz
2025-03-18 795fa3a0ce15e32463a444c2b3fc1468596afba2
Merge branch 'master' of http://43.142.96.171:8080/r/~sjz/YC
已添加8个文件
已修改8个文件
382 ■■■■■ 文件已修改
MES.Service/Dto/webApi/ErpProductionOrder.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Dto/webApi/ProductionOrder.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Modes/ProductionOrders.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Modes/SentLaboratoryTestingItems.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/ProductionOrderManager.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/SentLaboratoryTestingItemsManager.cs 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/Controllers/BasicData/ProductionOrderController.cs 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/Controllers/BasicData/SentLaboratoryTestingItemsControllor.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MES.Service.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.dll 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.exe 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/bin/Debug/net8.0/MESApplication.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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.dll
Binary files differ
MES.Service/bin/Debug/net8.0/MES.Service.pdb
Binary 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.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MES.Service.pdb
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.dll
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.exe
Binary files differ
MESApplication/bin/Debug/net8.0/MESApplication.pdb
Binary 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>
                èŽ·å–æ‰€æœ‰