From 5a871e40ec70a3e01a895dfc7f694adee5367a7d Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 18 5月 2025 15:05:18 +0800
Subject: [PATCH] 222

---
 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs |  113 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 107 insertions(+), 6 deletions(-)

diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
index e8c4fd2..c2ecf7d 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
+++ b/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
+                };
+            }
         }
     }
 }

--
Gitblit v1.9.3