33
schangxiang@126.com
2025-05-18 daf2a4075e8ce949cda132de6a03b7ea86597b37
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
@@ -3,6 +3,7 @@
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.Mvc;
using System.Reflection;
@@ -46,7 +47,7 @@
        [HttpPost]
        public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input)
        {
            return await _mesAppService.CreateAsync(input,"","");
            return await _mesAppService.CreateAsync(input, "", "");
        }
        /// <summary>
@@ -54,16 +55,116 @@
        /// </summary>
        /// <param name="input">标识符.</param>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        [Route("Pick")]
        public virtual async Task<MesOrderResponse> Pick([FromBody] PickInput input)
        {
            MyCurrentUser myCurrentUser = new MyCurrentUser()
            try
            {
                UserAccount = _currentUser.UserAccount,
                UserId = _currentUser.UserId
            };
            return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser);
                MyCurrentUser myCurrentUser = new MyCurrentUser()
                {
                    UserAccount = _currentUser.UserAccount,
                    UserId = _currentUser.UserId
                };
                return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser);
            }
            catch (Exception ex)
            {
                return new MesOrderResponse()
                {
                    Code = "400",
                    Message = ex.Message
                };
            }
        }
        /// <summary>
        /// 叫料
        /// </summary>
        /// <param name="input">标识符.</param>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        [Route("CallMaterial")]
        public virtual async Task<MesOrderResponse> CallMaterial([FromBody] CallMaterialByDataIdentifierInput input)
        {
            try
            {
                MyCurrentUser myCurrentUser = new MyCurrentUser()
                {
                    UserAccount = _currentUser.UserAccount,
                    UserId = _currentUser.UserId
                };
                return await sharedService.CallMaterial(input, _serviceProvider, myCurrentUser);
            }
            catch (Exception ex)
            {
                return new MesOrderResponse()
                {
                    Code = "400",
                    Message = ex.Message
                };
            }
        }
        /// <summary>
        /// 开工
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        [Route("StartProduction")]
        public virtual async Task<MesOrderResponse> StartProduction([FromBody] StartProductionInput input)
        {
            try
            {
                MyCurrentUser myCurrentUser = new MyCurrentUser()
                {
                    UserAccount = _currentUser.UserAccount,
                    UserId = _currentUser.UserId
                };
                return await sharedService.StartProduction(input, _serviceProvider, myCurrentUser);
            }
            catch (Exception ex)
            {
                return new MesOrderResponse()
                {
                    Code = "400",
                    Message = ex.Message
                };
            }
        }
        /// <summary>
        /// 完工
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [Authorize]
        [HttpPost]
        [Route("FinishProduction")]
        public virtual async Task<MesOrderResponse> FinishProduction([FromBody] CompleteAssemblyProcessInput input)
        {
            try
            {
                MyCurrentUser myCurrentUser = new MyCurrentUser()
                {
                    UserAccount = _currentUser.UserAccount,
                    UserId = _currentUser.UserId
                };
                return await sharedService.CompleteAssemblyProcess(_serviceProvider, input, myCurrentUser);
            }
            catch (Exception ex)
            {
                return new MesOrderResponse()
                {
                    Code = "400",
                    Message = ex.Message
                };
            }
        }
    }
}