222
schangxiang@126.com
2025-05-12 727ed59c834554dfea2afc77a883f1545c9165a5
222
已添加1个文件
已修改8个文件
117 ■■■■ 文件已修改
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/PickInput.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IMesAppService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/MesAppService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/PickInput.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan
{
    /// <summary>
    /// åˆ†æ‹£è¾“入参数模型
    /// </summary>
    [Serializable]
    public class PickInput
    {
        /// <summary>
        /// ç®¡æ®µç¼–码
        /// </summary>
        public string PipeSpecCode { get; set; }
    }
}
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IMesAppService.cs
@@ -9,5 +9,6 @@
/// </summary>
public interface IMesAppService
{
    Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input);
    Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input, string userId, string userAccount);
}
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/MesAppService.cs
@@ -12,7 +12,7 @@
namespace CMS.Plugin.PipeLineLems.Application.Implements;
public class MesAppService : CMSPluginAppService
public class MesAppService : CMSPluginAppService,IMesAppService
{
    private readonly IServiceProvider _serviceProvider;
    private readonly WorkPlanAppService _workPlanAppService;
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -16,6 +16,9 @@
using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
using Volo.Abp.Users;
using CmsQueryExtensions.Entitys;
using CMS.Unit.RuntimeValue.Abstractions;
using CMS.Extensions.Variable;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
@@ -24,6 +27,34 @@
/// </summary> 
public class SharedService : CMSPluginAppService
{
    public async Task<MesOrderResponse> CommonPick(IServiceProvider _serviceProvider, PickInput input, MyCurrentUser myCurrentUser)
    {
        //1、记录分拣记录表
        //2、更新作业计划表的状态 =已分拣
        //3、写入 åˆ†æ‹£å˜é‡
        VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>();
        Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?>
                    {
                        { "分拣托盘号","托盘1"},
                        { "分拣方向", "短管装配"},
                        { "分拣人", myCurrentUser.UserAccount }
                    };
        _variableService.WriteValueAsync(keyValuePairs);
        var response = new MesOrderResponse
        {
            Code = "000000",
            Data = "",
            Fail = false,
            Mesg = "处理成功",
            Success = true,
            Time = DateTime.UtcNow
        };
        return response;
    }
    /// <summary>
    /// åˆ›å»ºä½œä¸šè®¡åˆ’
    /// </summary>
@@ -34,11 +65,11 @@
    /// <exception cref="UserFriendlyException"></exception>
    public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider,
        WorkPlanAppService workPlanAppService,
        string userId, string userAccount
        )
    WorkPlanAppService workPlanAppService,
    string userId, string userAccount
    )
    {
        if (input == null)
        {
            throw new UserFriendlyException("输入参数不能为空");
@@ -198,7 +229,6 @@
                insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.未执行;
                insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.未生产;
                insertObj.Sort = 1;
                insertObj.CreatorId = userId;
                insertObj.CreatorName = userAccount;
                await workPlanAppService.CreateAsync(insertObj);
            }
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj
@@ -56,6 +56,12 @@
    </ItemGroup>
    <ItemGroup>
      <Reference Include="CmsQueryExtensions">
        <HintPath>..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath>
      </Reference>
    </ItemGroup>
    <ItemGroup>
      <Resource Include="Flows\50001_1.pfd">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      </Resource>
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs
@@ -49,7 +49,7 @@
        context.Services.AddScoped<IProjectRuntimeMigrator, CMSPluginRuntimeMigrator>();
        context.Services.AddSingleton<IProjectService, PipeLineLemsProjectService>();
        context.Services.AddScoped<IMesAppService, MesAppService>();
        context.Services.AddScoped<IWorkPlanAppService, WorkPlanAppService>();
        context.Services.AddScoped<IEFDataProvider>(p =>
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanController.cs
@@ -3,6 +3,7 @@
using CMS.Framework.AspNetCore.Users;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using CmsQueryExtensions.Entitys;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@@ -152,6 +153,11 @@
            var userAccount = _currentUser.UserAccount;
            var userId = _currentUser.UserId;
            MyCurrentUser myCurrentUser = new MyCurrentUser()
            {
                UserAccount = _currentUser.UserAccount,
                UserId = _currentUser.UserId
            };
            var sheetNames = stream.GetSheetNames();
            var workPlanRows = sheetNames.Contains("配置") ? MiniExcel.Query<WorkPlansImportModel.WorkPlanImportModel>(stream, sheetName: "配置").ToList() : new();
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
@@ -1,6 +1,8 @@
using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
using CMS.Framework.AspNetCore.Users;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using CmsQueryExtensions.Entitys;
using Microsoft.AspNetCore.Mvc;
using System.Reflection;
@@ -19,13 +21,21 @@
    {
        private readonly IMesAppService _mesAppService;
        private readonly ICurrentUser _currentUser;
        private readonly Application.Implements.SharedService sharedService;
        private IServiceProvider _serviceProvider;
        /// <summary>
        /// Initializes a new instance of the <see cref="TestEntityNameController"/> class.
        /// </summary>
        /// <param name="testentitynameAppService">The testentityname application service.</param>
        public WorkPlanPublicController(IMesAppService mesAppService)
        public WorkPlanPublicController(IMesAppService mesAppService, ICurrentUser currentUser, Application.Implements.SharedService _sharedService,
            IServiceProvider serviceProvider)
        {
            _mesAppService = mesAppService;
            _currentUser = currentUser;
            sharedService = _sharedService;
            _serviceProvider = serviceProvider;
        }
        /// <summary>
@@ -36,9 +46,24 @@
        [HttpPost]
        public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input)
        {
            return await _mesAppService.CreateAsync(input);
            return await _mesAppService.CreateAsync(input,"","");
        }
        /// <summary>
        /// åˆ†æ‹£
        /// </summary>
        /// <param name="input">标识符.</param>
        /// <returns></returns>
        [HttpPost]
        [Route("Pick")]
        public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input)
        {
            MyCurrentUser myCurrentUser = new MyCurrentUser()
            {
                UserAccount = _currentUser.UserAccount,
                UserId = _currentUser.UserId
            };
            return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser);
        }
    }
}
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
@@ -443,7 +443,7 @@
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = workPlanList.First().PipeSpecCode;
                    var productID = callMaterialOrder.DataIdentifier;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "打码_ProductID", productID},
@@ -698,7 +698,7 @@
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = workPlanList.First().PipeSpecCode;
                    var productID = callMaterialOrder.DataIdentifier;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "切割_ProductID", productID},