| | |
| | | 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; |
| | | |
| | |
| | | /// </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> |
| | |
| | | /// <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("输入参数不能为空"); |
| | |
| | | var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); |
| | | var productProvider = _serviceProvider.GetRequiredService<IProductProvider>(); |
| | | var formulaProvider = _serviceProvider.GetRequiredService<IFormulaProvider>(); |
| | | |
| | | List<OrderModel> orderModels = new List<OrderModel>(); |
| | | |
| | | #region 事务 |
| | |
| | | CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.未执行, |
| | | DataIdentifier = gTask.Key, |
| | | MaterialMode = gTask.ToList().First().MaterialMode, |
| | | CreatorName = userAccount, |
| | | Quantity = 1 |
| | | }; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | //throw new UserFriendlyException($"主动触发失败"); |
| | | //保存到 scms_workplans 表中 |
| | | foreach (var item in input) |
| | | { |
| | |
| | | insertObj.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.未执行; |
| | | insertObj.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.未生产; |
| | | insertObj.Sort = 1; |
| | | insertObj.CreatorName = userAccount; |
| | | insertObj.Remark = "系统导入"; |
| | | await workPlanAppService.CreateAsync(insertObj); |
| | | } |
| | | |