zs
2025-05-12 30334be4b684d639231e7cd721ca99f3fdb0f5ed
Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
已添加2个文件
已修改17个文件
766 ■■■■ 文件已修改
CommonDLL/CmsQueryExtensions.dll 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/PickInput.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IMesAppService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkPlanAppService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/MesAppService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | 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 266 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs 277 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Weben_CMS专用代码生成器/queryExtensions/CmsQueryExtensions/Entitys/MyCurrentUser.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CommonDLL/CmsQueryExtensions.dll
Binary files differ
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx
@@ -297,7 +297,7 @@
                å«æ–™ 
              </IconButton> 
              <el-divider direction="vertical" /> 
              <el-upload
              {/* <el-upload
                v-permission="callMaterialOrder-import" 
                name="file" 
                accept=".xlsx,.xls,.csv" 
@@ -309,7 +309,7 @@
                action="/api/v1/PipeLineLems/callMaterialOrder/import" 
              > 
                <IconButton icon="in">导入</IconButton> 
              </el-upload>
              </el-upload>  */}
 
              <IconButton 
                v-permission="callMaterialOrder-output" 
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx
@@ -271,7 +271,7 @@
 
          <div class={styles.headerContent}> 
            <div class={styles.header}> 
              <IconButton
              {/* <IconButton
                v-permission="callMaterialOrderRecord-add" 
                icon="add-p" 
                onClick={onAddCallMaterialOrderRecord} 
@@ -281,8 +281,8 @@
              </IconButton> 
              <el-divider direction="vertical" /> 
 
              <el-divider direction="vertical" />
              <el-upload
              <el-divider direction="vertical" />  */}
              {/* <el-upload
                v-permission="callMaterialOrderRecord-import" 
                name="file" 
                accept=".xlsx,.xls,.csv" 
@@ -294,7 +294,7 @@
                action="/api/v1/PipeLineLems/callMaterialOrderRecord/import" 
              > 
                <IconButton icon="in">导入</IconButton> 
              </el-upload>
              </el-upload>  */}
 
              <IconButton 
                v-permission="callMaterialOrderRecord-output" 
PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts
@@ -10,6 +10,21 @@
  width:160, 
}, 
  field: 'processName',
  title: '工序名称',
  width:160,
},
{
  field: 'pipeSpecCode',
  title: '管段编码',
  width:160,
},
{
  field: 'pipeSectionName',
  title: '管段名称',
  width:160,
},
{
  field: 'workPlanStatusDesc', 
  title: '计划状态', 
  width:160, 
@@ -109,11 +124,7 @@
  title: '工件名称', 
  width:160, 
}, 
{
  field: 'processName',
  title: '工序名称',
  width:160,
},
  field: 'pipeFittingCode', 
  title: '管件编码', 
@@ -124,16 +135,7 @@
  title: '顺序号', 
  width:160, 
}, 
{
  field: 'pipeSpecCode',
  title: '管段编码',
  width:160,
},
{
  field: 'pipeSectionName',
  title: '管段名称',
  width:160,
},
  field: 'outerDiameter', 
  title: '外径(mm)', 
PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx
@@ -304,7 +304,7 @@
 
          <div class={styles.headerContent}> 
            <div class={styles.header}> 
              <IconButton
              {/* <IconButton
                v-permission="workPlan-add" 
                icon="add-p" 
                onClick={onAddWorkPlan} 
@@ -313,7 +313,7 @@
                æ·»åŠ  
              </IconButton> 
 
              <el-divider direction="vertical" />
              <el-divider direction="vertical" />  */}
              <el-upload 
                v-permission="workPlan-import" 
                name="file" 
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs
@@ -29,10 +29,15 @@
        /// </summary>
        public int Quantity { get; set; }
        /// <summary>
        /// WMS返回结果
        /// </summary>
        public string? WmsRetResult { get; set; }
    /// <summary>
    /// åˆ›å»ºäºº
    /// </summary>
    public string CreatorName { get; set; }
    /// <summary>
    /// WMS返回结果
    /// </summary>
    public string? WmsRetResult { get; set; }
        /// <summary>
        /// WMS任务号
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/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs
@@ -183,11 +183,16 @@
        /// åˆ›å»ºäººID
        /// </summary>
        public string? CreatorId { get; set; }
    /// <summary>
    /// åˆ›å»ºäºº
    /// </summary>
    public string CreatorName { get; set; }
        /// <summary>
        /// ä¿®æ”¹äººID
        /// </summary>
        public string? LastModifierId { get; set; }
    /// <summary>
    /// ä¿®æ”¹äººID
    /// </summary>
    public string? LastModifierId { get; set; }
        /// <summary>
        /// åˆ é™¤æ—¶é—´
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.Contracts/Services/IWorkPlanAppService.cs
@@ -1,6 +1,7 @@
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services;
@@ -45,7 +46,7 @@
    /// </summary> 
    /// <param name="input"></param> 
    /// <returns></returns> 
    Task ImportAsync(WorkPlansImportModel input);
    Task ImportAsync(WorkPlansImportModel input, string userId,string userAccount);
    /// <summary> 
    /// å¯¼å‡ºä½œä¸šè®¡åˆ’表 
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/MesAppService.cs
@@ -8,10 +8,11 @@
using CMS.Plugin.ProductManagement.Abstractions;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Users;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
public class MesAppService : CMSPluginAppService
public class MesAppService : CMSPluginAppService,IMesAppService
{
    private readonly IServiceProvider _serviceProvider;
    private readonly WorkPlanAppService _workPlanAppService;
@@ -30,9 +31,9 @@
        _sharedService = sharedService;
    }
    public async Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input)
    public async Task<MesOrderResponse> CreateAsync(List<WorkPlanInput> input, string userId, string userAccount)
    {
        var response = await _sharedService.CommonCreatebyApsAsync(input, _serviceProvider, _workPlanAppService);
        var response = await _sharedService.CommonCreatebyApsAsync(input, _serviceProvider, _workPlanAppService, userId, userAccount);
        return response;
    }
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -15,6 +15,10 @@
using System.Text;
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;
@@ -23,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>
@@ -33,9 +65,11 @@
    /// <exception cref="UserFriendlyException"></exception>
    public async Task<MesOrderResponse> CommonCreatebyApsAsync(List<WorkPlanInput> input, IServiceProvider _serviceProvider,
        WorkPlanAppService workPlanAppService
        )
    WorkPlanAppService workPlanAppService,
    string userId, string userAccount
    )
    {
        if (input == null)
        {
            throw new UserFriendlyException("输入参数不能为空");
@@ -62,6 +96,7 @@
        var orderManager = _serviceProvider.GetRequiredService<IOrderManager>();
        var productProvider = _serviceProvider.GetRequiredService<IProductProvider>();
        var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>();
        List<OrderModel> orderModels = new List<OrderModel>();
        #region äº‹åŠ¡
@@ -177,6 +212,7 @@
                    CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.未执行,
                    DataIdentifier = gTask.Key,
                    MaterialMode = gTask.ToList().First().MaterialMode,
                    CreatorName = userAccount,
                    Quantity = 1
                };
@@ -185,7 +221,7 @@
            //throw new UserFriendlyException($"主动触发失败");
            //保存到  scms_workplans è¡¨ä¸­
            foreach (var item in input)
            {
@@ -194,6 +230,8 @@
                insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.未执行;
                insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.未生产;
                insertObj.Sort = 1;
                insertObj.CreatorName = userAccount;
                insertObj.Remark = "系统导入";
                await workPlanAppService.CreateAsync(insertObj);
            }
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs
@@ -10,6 +10,7 @@
using Volo.Abp.Data;
using Volo.Abp.ObjectExtending;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Users;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
@@ -307,13 +308,13 @@
    /// <param name="input"></param> 
    /// <returns></returns> 
    /// <exception cref="UserFriendlyException"></exception> 
    public async Task ImportAsync(WorkPlansImportModel input)
    public async Task ImportAsync(WorkPlansImportModel input, string userId,string userAccount)
    {
        //转换数据
        var result = ObjectMapper.Map<List<WorkPlansImportModel.WorkPlanImportModel>, List<WorkPlanInput>>(input.WorkPlans);
        //await CreatebyApsAsync(result);
        await _sharedService.CommonCreatebyApsAsync(result, _serviceProvider, this);
        await _sharedService.CommonCreatebyApsAsync(result, _serviceProvider, this, userId, userAccount);
        //        Check.NotNull(input, nameof(input)); 
        //        var workPlanCreateDtos = new List<(int RowIndex, WorkPlanCreateDto Item)>(); 
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
@@ -1,75 +1,79 @@
using Ao.Lang;
using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MiniExcelLibs;
using System.Reflection;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
namespace CMS.Plugin.PipeLineLems.Controller
{
using Ao.Lang;
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.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MiniExcelLibs;
using System.Reflection;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
namespace CMS.Plugin.PipeLineLems.Controller
{
    /// <summary> 
    /// ä½œä¸šè®¡åˆ’表服务 
    /// </summary> 
    [ApiController]
    [TypeFilter(typeof(CMSLanguageFilter))]
    [TypeFilter(typeof(CMSUowActionFilter))]
    [TypeFilter(typeof(CMSAuditActionFilter))]
    [TypeFilter(typeof(CMSExceptionFilter))]
    [Route("api/v{version:apiVersion}/PipeLineLems/[controller]")]
    public class WorkPlanController : ControllerBase
    {
        private readonly IWorkPlanAppService _workPlanAppService;
    [ApiController]
    [TypeFilter(typeof(CMSLanguageFilter))]
    [TypeFilter(typeof(CMSUowActionFilter))]
    [TypeFilter(typeof(CMSAuditActionFilter))]
    [TypeFilter(typeof(CMSExceptionFilter))]
    [Route("api/v{version:apiVersion}/PipeLineLems/[controller]")]
    public class WorkPlanController : ControllerBase
    {
        private readonly IWorkPlanAppService _workPlanAppService;
        private readonly ICurrentUser _currentUser;
        /// <summary> 
        /// Initializes a new instance of the <see cref="WorkPlanController"/> class. 
        /// </summary> 
        /// <param name="workPlanAppService">The workPlan application service.</param> 
        public WorkPlanController(IWorkPlanAppService workPlanAppService)
        {
            _workPlanAppService = workPlanAppService;
        }
        public WorkPlanController(IWorkPlanAppService workPlanAppService, ICurrentUser currentUser)
        {
            _workPlanAppService = workPlanAppService;
            _currentUser = currentUser;
        }
        /// <summary> 
        /// èŽ·å–ä½œä¸šè®¡åˆ’è¡¨ 
        /// </summary> 
        /// <param name="id">标识符.</param> 
        /// <returns></returns> 
        [HttpGet]
        [Route("{id}")]
        public virtual Task<WorkPlanDto> GetAsync(Guid id)
        {
            return _workPlanAppService.GetAsync(id);
        }
        [HttpGet]
        [Route("{id}")]
        public virtual Task<WorkPlanDto> GetAsync(Guid id)
        {
            return _workPlanAppService.GetAsync(id);
        }
        /// <summary> 
        /// åˆ†é¡µèŽ·å–ä½œä¸šè®¡åˆ’è¡¨çš„åˆ—è¡¨. 
        /// </summary> 
        /// <param name="input">输入.</param> 
        /// <returns></returns> 
        [HttpGet]
        [Route("Page")]
        public virtual Task<PagedResultDto<WorkPlanDto>> GetListAsync([FromQuery] GetWorkPlanInput input)
        {
            return _workPlanAppService.GetListAsync(input);
        }
        [HttpGet]
        [Route("Page")]
        public virtual Task<PagedResultDto<WorkPlanDto>> GetListAsync([FromQuery] GetWorkPlanInput input)
        {
            return _workPlanAppService.GetListAsync(input);
        }
        /// <summary> 
        /// åˆ›å»ºä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <param name="input">输入.</param> 
        /// <returns></returns> 
        //[Authorize] 
        [HttpPost]
        public virtual Task<WorkPlanDto> CreateAsync(WorkPlanCreateDto input)
        {
            return _workPlanAppService.CreateAsync(input);
        }
        [HttpPost]
        public virtual Task<WorkPlanDto> CreateAsync(WorkPlanCreateDto input)
        {
            return _workPlanAppService.CreateAsync(input);
        }
        /// <summary> 
        /// æ›´æ–°ä½œä¸šè®¡åˆ’表 
        /// </summary> 
@@ -77,112 +81,120 @@
        /// <param name="input">输入.</param> 
        /// <returns></returns> 
        //[Authorize] 
        [HttpPut]
        [Route("{id}")]
        public virtual Task<WorkPlanDto> UpdateAsync(Guid id, WorkPlanUpdateDto input)
        {
            return _workPlanAppService.UpdateAsync(id, input);
        }
        [HttpPut]
        [Route("{id}")]
        public virtual Task<WorkPlanDto> UpdateAsync(Guid id, WorkPlanUpdateDto input)
        {
            return _workPlanAppService.UpdateAsync(id, input);
        }
        /// <summary> 
        /// å…‹éš†ä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <param name="ids">Id集合.</param> 
        /// <returns></returns> 
        //[Authorize] 
        [HttpPost]
        [Route("Clone")]
        public virtual Task<List<WorkPlanDto>> CloneAsync([FromBody] IEnumerable<Guid> ids)
        {
            return _workPlanAppService.CloneAsync(ids);
        }
        [HttpPost]
        [Route("Clone")]
        public virtual Task<List<WorkPlanDto>> CloneAsync([FromBody] IEnumerable<Guid> ids)
        {
            return _workPlanAppService.CloneAsync(ids);
        }
        /// <summary> 
        /// åˆ é™¤ä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <param name="id">标识符.</param> 
        /// <returns></returns> 
        //[Authorize] 
        [HttpDelete]
        [Route("{id}")]
        public virtual Task DeleteAsync(Guid id)
        {
            return _workPlanAppService.DeleteAsync(id);
        }
        [HttpDelete]
        [Route("{id}")]
        public virtual Task DeleteAsync(Guid id)
        {
            return _workPlanAppService.DeleteAsync(id);
        }
        /// <summary> 
        /// æ‰¹é‡åˆ é™¤ä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <param name="ids">The ids.</param> 
        /// <returns></returns> 
        //[Authorize] 
        [HttpDelete]
        public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids)
        {
            return _workPlanAppService.DeleteManyAsync(ids);
        }
        [HttpDelete]
        public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids)
        {
            return _workPlanAppService.DeleteManyAsync(ids);
        }
        /// <summary> 
        /// è°ƒæ•´æŽ’序作业计划表 
        /// </summary> 
        /// <param name="id">标识符.</param> 
        /// <returns></returns> 
        [HttpPut]
        [Route("{id}/AdjustSort/{sort}")]
        public virtual Task AdjustSortAsync(Guid id, int sort)
        {
            return _workPlanAppService.AdjustSortAsync(id, sort);
        }
        [HttpPut]
        [Route("{id}/AdjustSort/{sort}")]
        public virtual Task AdjustSortAsync(Guid id, int sort)
        {
            return _workPlanAppService.AdjustSortAsync(id, sort);
        }
        /// <summary> 
        /// å¯¼å…¥ä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <returns></returns> 
        [Authorize]
        [HttpPost]
        [Route("Import")]
        public virtual async Task<IActionResult> ImportAsync(IFormFile file)
        {
            using var stream = new MemoryStream();
            await file.CopyToAsync(stream);
            stream.Seek(0L, SeekOrigin.Begin);
            var sheetNames = stream.GetSheetNames();
            var workPlanRows = sheetNames.Contains("配置") ? MiniExcel.Query<WorkPlansImportModel.WorkPlanImportModel>(stream, sheetName: "配置").ToList() : new();
            if (!workPlanRows.Any())
            {
                throw new UserFriendlyException("请检查导入的表格");
            }
            await _workPlanAppService.ImportAsync(new WorkPlansImportModel
            {
                WorkPlans = workPlanRows,
            });
            return Ok();
        }
        [Authorize]
        [HttpPost]
        [Route("Import")]
        public virtual async Task<IActionResult> ImportAsync(IFormFile file)
        {
            using var stream = new MemoryStream();
            await file.CopyToAsync(stream);
            stream.Seek(0L, SeekOrigin.Begin);
            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();
            if (!workPlanRows.Any())
            {
                throw new UserFriendlyException("请检查导入的表格");
            }
            await _workPlanAppService.ImportAsync(new WorkPlansImportModel
            {
                WorkPlans = workPlanRows,
            }, userId, userAccount);
            return Ok();
        }
        /// <summary> 
        /// å¯¼å‡ºä½œä¸šè®¡åˆ’表 
        /// </summary> 
        /// <returns></returns> 
        [HttpGet]
        [Route("Export")]
        public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWorkPlanInput input)
        {
            input.MaxResultCount = int.MaxValue;
            var exportData = await _workPlanAppService.ExportAsync(input);
            var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WorkPlan导出模板.xlsx");
            if (!System.IO.File.Exists(templatePath))
            {
                templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WorkPlan导出模板.xlsx");
            }
            var memoryStream = new MemoryStream();
            await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets);
            memoryStream.Seek(0L, SeekOrigin.Begin);
            return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" };
        }
    }
}
        [HttpGet]
        [Route("Export")]
        public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWorkPlanInput input)
        {
            input.MaxResultCount = int.MaxValue;
            var exportData = await _workPlanAppService.ExportAsync(input);
            var templatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources/Templates/WorkPlan导出模板.xlsx");
            if (!System.IO.File.Exists(templatePath))
            {
                templatePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty, $"Resources/Templates/WorkPlan导出模板.xlsx");
            }
            var memoryStream = new MemoryStream();
            await memoryStream.SaveAsByTemplateAsync(templatePath, exportData.Sheets);
            memoryStream.Seek(0L, SeekOrigin.Begin);
            return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") { FileDownloadName = $"{exportData.FileName}_{DateTime.Now:yyyyMMddhhmmss}.xlsx" };
        }
    }
}
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
@@ -20,6 +20,7 @@
using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
using System.Collections.Generic;
using CMS.Framework.AspNetCore.Users;
namespace CMS.Plugin.PipeLineLems.ProjectService
{
@@ -31,6 +32,7 @@
        private IServiceProvider _serviceProvider;
        private readonly ILogger<PipeLineLemsProjectService> _logger;
        private readonly IVariableDataCache _variableDataCache;
        /// <summary>
        /// å˜é‡æœåŠ¡
@@ -84,6 +86,8 @@
            _monitorVariableNames = new Dictionary<string, string>
            {
                { "打码进站信号", "打码进站信号(描述)" },
                { "请求生成打码产品码信号", "请求生成打码产品码信号(描述)" },
                { "请求生成切割产品码信号", "请求生成切割产品码信号(描述)" },
                { "切割进站信号", "切割进站信号(描述)" },
            };
@@ -142,6 +146,30 @@
                _logger.LogInformation($"{changed.Name} å˜é‡å€¼å‘生变化,旧值{oldValue}=新值{newValue},TraceId={traceId}");
                if (changed.Name == "请求生成打码产品码信号" && changed.New?.Value.SafeString().ToBool() == true)
                {
                    // TODO: å¤„理变量值变化
                    // Tips:https://cms-docs.shengyc.com/cms/api/%E5%90%8E%E7%AB%AF#3-%E5%8F%98%E9%87%8F%E6%A8%A1%E5%9D%97
                    /* è¯´æ˜Žï¼šé€šè¿‡è®¢é˜… IVariableDataCache.TagChanged äº‹ä»¶ï¼Œæ‚¨å¯ä»¥å®žæ—¶ç›‘控变量的变化。此事件会传递所有变量至事件处理函数,因此,业务层需在函数中筛选关注的变量。
                        æ³¨æ„äº‹é¡¹ï¼š
                        ï¼ˆ1)性能影响: å‘布事件时,事件的发送者将阻塞流程。因此,强烈建议避免在事件处理函数中执行 I/ O æ“ä½œã€HTTP æŽ¥å£è®¿é—®æˆ–其他耗时操作,以防止对系统性能产生严重影响,导致整个系统响应延迟。
                        ï¼ˆ2)高频率触发: ç”±äºŽäº‹ä»¶è®¢é˜…了全量变量,触发频率可能非常高。
                        ï¼ˆ3)异步处理: é‰´äºŽäº‹ä»¶è§¦å‘频率很高,建议业务层在筛选关注变量后,使用 Task å¯åŠ¨æ–°çº¿ç¨‹å¤„ç†ä¸šåŠ¡é€»è¾‘ï¼Œä»¥é¿å…é˜»å¡žæ ¸å¿ƒçš„å˜é‡ç›‘å¬åŠŸèƒ½ï¼Œå®žçŽ°ä¸šåŠ¡å±‚ä¸Žå¹³å°åŸºåº§çš„è§£è€¦ã€‚
                        ï¼ˆ4)并发管理: å¦‚果业务层并发量大,必须优化代码设计和实施,以减少在高并发情况下的系统资源消耗,防止系统性能问题。
                        ï¼ˆ5)代码安全: å®‰è£…并使用 CMS.CodeAnalysis åˆ†æžå™¨æ¥åˆ†æž IVariableDataCache.TagChanged çš„使用情况。该工具能在使用不当时提供编译错误,帮助您提高代码质量。*/
                    _ = Task.Run(async () =>
                    {
                        await HanlderForPringBarCodeByCreateProductAsync();
                        // ä¾‹1:同步处理
                        //await ProcessAsync();
                        // ä¾‹2:调用外部API
                        //await ExecuteExternalApiAsync();
                    });
                }
                if (changed.Name == "打码进站信号" && changed.New?.Value.SafeString().ToBool() == true)
                {
@@ -166,6 +194,8 @@
                    });
                }
                if (changed.Name == "切割进站信号" && changed.New?.Value.SafeString().ToBool() == true)
                {
@@ -182,6 +212,31 @@
                    _ = Task.Run(async () =>
                    {
                        await HanlderForCutAsync();
                        // ä¾‹1:同步处理
                        //await ProcessAsync();
                        // ä¾‹2:调用外部API
                        //await ExecuteExternalApiAsync();
                    });
                }
                if (changed.Name == "请求生成切割产品码信号" && changed.New?.Value.SafeString().ToBool() == true)
                {
                    // TODO: å¤„理变量值变化
                    // Tips:https://cms-docs.shengyc.com/cms/api/%E5%90%8E%E7%AB%AF#3-%E5%8F%98%E9%87%8F%E6%A8%A1%E5%9D%97
                    /* è¯´æ˜Žï¼šé€šè¿‡è®¢é˜… IVariableDataCache.TagChanged äº‹ä»¶ï¼Œæ‚¨å¯ä»¥å®žæ—¶ç›‘控变量的变化。此事件会传递所有变量至事件处理函数,因此,业务层需在函数中筛选关注的变量。
                        æ³¨æ„äº‹é¡¹ï¼š
                        ï¼ˆ1)性能影响: å‘布事件时,事件的发送者将阻塞流程。因此,强烈建议避免在事件处理函数中执行 I/ O æ“ä½œã€HTTP æŽ¥å£è®¿é—®æˆ–其他耗时操作,以防止对系统性能产生严重影响,导致整个系统响应延迟。
                        ï¼ˆ2)高频率触发: ç”±äºŽäº‹ä»¶è®¢é˜…了全量变量,触发频率可能非常高。
                        ï¼ˆ3)异步处理: é‰´äºŽäº‹ä»¶è§¦å‘频率很高,建议业务层在筛选关注变量后,使用 Task å¯åŠ¨æ–°çº¿ç¨‹å¤„ç†ä¸šåŠ¡é€»è¾‘ï¼Œä»¥é¿å…é˜»å¡žæ ¸å¿ƒçš„å˜é‡ç›‘å¬åŠŸèƒ½ï¼Œå®žçŽ°ä¸šåŠ¡å±‚ä¸Žå¹³å°åŸºåº§çš„è§£è€¦ã€‚
                        ï¼ˆ4)并发管理: å¦‚果业务层并发量大,必须优化代码设计和实施,以减少在高并发情况下的系统资源消耗,防止系统性能问题。
                        ï¼ˆ5)代码安全: å®‰è£…并使用 CMS.CodeAnalysis åˆ†æžå™¨æ¥åˆ†æž IVariableDataCache.TagChanged çš„使用情况。该工具能在使用不当时提供编译错误,帮助您提高代码质量。*/
                    _ = Task.Run(async () =>
                    {
                        await HanlderForCutByCreateProductAsync();
                        // ä¾‹1:同步处理
                        //await ProcessAsync();
@@ -229,7 +284,7 @@
        }
        /// <summary>
        /// æ‰“码
        /// æ‰“码进站信号
        /// </summary>
        /// <returns></returns>
        private async Task HanlderForPringBarCodeAsync()
@@ -268,40 +323,46 @@
                    var workPlanList = await workPlanAppService.FindByDataIdentifierAsync(callMaterialOrder.DataIdentifier);
                    if (workPlanList?.Count == 0) return;//结束
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = workPlanList.First().PipeSpecCode;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "打码_ProductID", productID},
                    };
                    var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    ////TODO:暂时生成产品ID
                    ////var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    //var productID = workPlanList.First().PipeSpecCode;
                    //Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    //{
                    //    { "打码_ProductID", productID},
                    //};
                    //var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    //更新为生产中
                    foreach (var item in workPlanList)
                    {
                        item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                    }
                    await workPlanRepository.UpdateManyAsync(workPlanList);
                    ////更新为生产中
                    //foreach (var item in workPlanList)
                    //{
                    //    item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                    //}
                    //await workPlanRepository.UpdateManyAsync(workPlanList);
                    //得到码值
                    var code1 = "";
                    var code2 = "";
                    var code3 = "";
                    var pipeSpecCode1 = "";
                    var pipeSpecCode2 = "";
                    var pipeSpecCode3 = "";
                    var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "切割").ToList();
                    for (int i = 0; i < new_workPlanList.Count; i++)
                    {
                        if (i == 0)
                        {
                            code1 = new_workPlanList[i].MarkingContent;
                            pipeSpecCode1 = new_workPlanList[i].PipeSpecCode;
                        }
                        if (i == 1)
                        {
                            code2 = new_workPlanList[i].MarkingContent;
                            pipeSpecCode2 = new_workPlanList[i].PipeSpecCode;
                        }
                        if (i == 2)
                        {
                            code3 = new_workPlanList[i].MarkingContent;
                            pipeSpecCode3 = new_workPlanList[i].PipeSpecCode;
                        }
                    }
                    Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?>
@@ -309,6 +370,9 @@
                        { "打码工件1",code1},
                        { "打码工件2", code2},
                        { "打码工件3", code3 },
                        { "打码管段编码1",pipeSpecCode1},
                        { "打码管段编码2", pipeSpecCode2},
                        { "打码管段编码3", pipeSpecCode3 },
                        { "打码管段编码", new_workPlanList.First().PipeSpecCode },
                        { "打码管段名称", new_workPlanList.First().PipeSectionName },
                        { "打码原料管型号", new_workPlanList.First().MaterialMode },
@@ -325,6 +389,75 @@
                    var ret2 = _variableService.WriteValueAsync(keyValuePairs);
                    uow.CompleteAsync();
                }
                catch (Exception)
                {
                    uow.RollbackAsync();
                    throw;
                }
            }
        }
        /// <summary>
        /// è¯·æ±‚生成打码产品码信号
        /// </summary>
        /// <returns></returns>
        private async Task HanlderForPringBarCodeByCreateProductAsync()
        {
            var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>();
            var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>();
            var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>();
            using var scope = _serviceProvider.CreateScope();
            var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
            using var uow = unitOfWorkManager.Begin(requiresNew: true);
            var plcTaskNo = await _variableService.ReadValueAsync("打码进站PLC任务号");
            if (string.IsNullOrEmpty(plcTaskNo?.Content?.Value.SafeString().ToString()))
            {
            }
            else
            {
                var myTaskNo = plcTaskNo.Content.Value.SafeString().ToString();
                CallMaterialOrder callMaterialOrder = null;
                try
                {
                    //根据wms任务号寻找 å«æ–™å·¥å•
                    callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
                    if (callMaterialOrder == null) return;//结束
                    //根据原料标识寻找 ä½œä¸šè®¡åˆ’
                    var workPlanList = await workPlanAppService.FindByDataIdentifierAsync(callMaterialOrder.DataIdentifier);
                    if (workPlanList?.Count == 0) return;//结束
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = callMaterialOrder.DataIdentifier;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "打码_ProductID", productID},
                    };
                    var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    //更新为生产中
                    var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "切割").ToList();
                    foreach (var item in new_workPlanList)
                    {
                        item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                    }
                    await workPlanRepository.UpdateManyAsync(new_workPlanList);
                    uow.CompleteAsync();
@@ -447,40 +580,46 @@
                    var workPlanList = await workPlanAppService.FindByDataIdentifierAsync(callMaterialOrder.DataIdentifier);
                    if (workPlanList?.Count == 0) return;//结束
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = workPlanList.First().PipeSpecCode;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "切割_ProductID", productID},
                    };
                    var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    ////TODO:暂时生成产品ID
                    ////var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    //var productID = workPlanList.First().PipeSpecCode;
                    //Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    //{
                    //    { "切割_ProductID", productID},
                    //};
                    //var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    //更新为生产中
                    foreach (var item in workPlanList)
                    {
                        item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                    }
                    await workPlanRepository.UpdateManyAsync(workPlanList);
                    ////更新为生产中
                    //foreach (var item in workPlanList)
                    //{
                    //    item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                    //}
                    //await workPlanRepository.UpdateManyAsync(workPlanList);
                    //得到码值
                    decimal code1 = 0;
                    decimal code2 = 0;
                    decimal code3 = 0;
                    var pipeSpecCode1 = "";
                    var pipeSpecCode2 = "";
                    var pipeSpecCode3 = "";
                    var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "装配").ToList();
                    for (int i = 0; i < new_workPlanList.Count; i++)
                    {
                        if (i == 0)
                        {
                            code1 = new_workPlanList[i].CuttingPosition;
                            pipeSpecCode1 = new_workPlanList[i].PipeSpecCode;
                        }
                        if (i == 1)
                        {
                            code2 = new_workPlanList[i].CuttingPosition;
                            pipeSpecCode2 = new_workPlanList[i].PipeSpecCode;
                        }
                        if (i == 2)
                        {
                            code3 = new_workPlanList[i].CuttingPosition;
                            pipeSpecCode3 = new_workPlanList[i].PipeSpecCode;
                        }
                    }
                    Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?>
@@ -488,6 +627,9 @@
                        { "切割位置1",code1},
                        { "切割位置2", code2},
                        { "切割位置3", code3 },
                        { "切割管段编码1",pipeSpecCode1},
                        { "切割管段编码2", pipeSpecCode2},
                        { "切割管段编码3", pipeSpecCode3 },
                        { "切割管段编码", new_workPlanList.First().PipeSpecCode },
                        { "切割管段名称", new_workPlanList.First().PipeSectionName },
                        { "切割原料管型号", new_workPlanList.First().MaterialMode },
@@ -515,5 +657,82 @@
                }
            }
        }
        /// <summary>
        /// è¯·æ±‚生成切割产品码信号
        /// </summary>
        /// <returns></returns>
        private async Task HanlderForCutByCreateProductAsync()
        {
            var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>();
            var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>();
            var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>();
            using var scope = _serviceProvider.CreateScope();
            var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
            using var uow = unitOfWorkManager.Begin(requiresNew: true);
            var plcTaskNo = await _variableService.ReadValueAsync("切割进站PLC任务号");
            if (string.IsNullOrEmpty(plcTaskNo?.Content?.Value.SafeString().ToString()))
            {
            }
            else
            {
                var myTaskNo = plcTaskNo.Content.Value.SafeString().ToString();
                CallMaterialOrder callMaterialOrder = null;
                try
                {
                    //根据wms任务号寻找 å«æ–™å·¥å•
                    callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
                    if (callMaterialOrder == null) return;//结束
                    //根据原料标识寻找 ä½œä¸šè®¡åˆ’
                    var workPlanList = await workPlanAppService.FindByDataIdentifierAsync(callMaterialOrder.DataIdentifier);
                    if (workPlanList?.Count == 0) return;//结束
                    //TODO:暂时生成产品ID
                    //var productID = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                    var productID = callMaterialOrder.DataIdentifier;
                    Dictionary<string, object?> keyValuePairs_productID = new Dictionary<string, object?>
                    {
                        { "切割_ProductID", productID},
                    };
                    var ret = _variableService.WriteValueAsync(keyValuePairs_productID);
                    var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "装配").ToList();
                    //更新为生产中
                    foreach (var item in new_workPlanList)
                    {
                        item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.生产中;
                        item.Remark = "更新生产中";
                    }
                    await workPlanRepository.UpdateManyAsync(new_workPlanList);
                    var new_workPlanList_printCode = workPlanList.Where(x => x.ProcessRouteNumber == "切割").ToList();
                    foreach (var item in new_workPlanList_printCode)
                    {
                        item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.已完成;
                        item.Remark = "更新已完成";
                    }
                    await workPlanRepository.UpdateManyAsync(new_workPlanList_printCode);
                    uow.CompleteAsync();
                }
                catch (Exception)
                {
                    uow.RollbackAsync();
                    throw;
                }
            }
        }
    }
}
Weben_CMSרÓôúÂëÉú³ÉÆ÷/queryExtensions/CmsQueryExtensions/Entitys/MyCurrentUser.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CmsQueryExtensions.Entitys
{
    /// <summary>
    /// å½“前登录用户对象
    /// </summary>
    [Serializable]
    public class MyCurrentUser
    {
        /// <summary>
        /// ç”¨æˆ·ID
        /// </summary>
        public string? UserId { get; set; }
        /// <summary>
        /// ç”¨æˆ·å
        /// </summary>
        public string? UserAccount { get; set; }
    }
}