using System; using System.Collections.Generic; using System.Data.SqlClient; namespace Jingyao.AIEmployee { public sealed partial class PersonalInboxHandler { static readonly Dictionary MesWorkRoutes = new Dictionary(StringComparer.Ordinal) { { "ai_APS下达待接收箱_送达", "/mes/aps-receipt-inbox" }, { "ai_APS下达待接收箱_办理", "/mes/aps-receipt-inbox" }, { "ai_工单草稿审核_提交", "/mes/work-order-draft-review" }, { "ai_工单草稿审核_办理", "/mes/work-order-draft-review" }, { "ai_待派工池_建立", "/mes/dispatch-pool" }, { "ai_待派工池_办理", "/mes/dispatch-pool" }, { "ai_开工前门禁_建立", "/mes/start-gate" }, { "ai_开工前门禁_登记检查", "/mes/start-gate" }, { "ai_开工前门禁_办理", "/mes/start-gate" }, { "ai_返工接收与重新送检_建立接收", "/mes/rework-receipt" }, { "ai_返工接收与重新送检_接收办理", "/mes/rework-receipt" }, { "ai_返工接收与重新送检_工单办理", "/mes/rework-receipt" } }; static void BindMesWork(SqlCommand command,string name,Dictionary inputs) { switch(name) { case "ai_APS下达待接收箱_送达": Only(inputs,"MES下达申请流水号","幂等键"); ReworkKey(command,inputs,"MES下达申请流水号"); break; case "ai_APS下达待接收箱_办理": Only(inputs,"MES接收流水号","动作","意见","幂等键"); ReworkKey(command,inputs,"MES接收流水号"); AddText(command,inputs,"动作",20,null,"REJECT","RESUBMIT","RECEIVE"); AddText(command,inputs,"意见",1000,""); break; case "ai_工单草稿审核_提交": Only(inputs,"MES工单草稿流水号","预期MES接收版本","预期工单版本","幂等键"); ReworkKey(command,inputs,"MES工单草稿流水号"); MesVersion(command,inputs,"预期MES接收版本"); MesVersion(command,inputs,"预期工单版本"); break; case "ai_工单草稿审核_办理": Only(inputs,"工单审核流水号","动作","意见","预期版本","幂等键"); ReworkKey(command,inputs,"工单审核流水号"); AddText(command,inputs,"动作",20,null,"RESUBMIT","REJECT","APPROVE"); AddText(command,inputs,"意见",1000,""); MesVersion(command,inputs,"预期版本"); break; case "ai_待派工池_建立": Only(inputs,"工单审核流水号","预期工单审核版本","预期工单版本","幂等键"); ReworkKey(command,inputs,"工单审核流水号"); MesVersion(command,inputs,"预期工单审核版本"); MesVersion(command,inputs,"预期工单版本"); break; case "ai_待派工池_办理": Only(inputs,"待派工流水号","动作","意见","确认声明","预期版本","幂等键"); ReworkKey(command,inputs,"待派工流水号"); AddText(command,inputs,"动作",30,null,"RESUBMIT","REJECT","CONFIRM","DISPATCH"); AddText(command,inputs,"意见",1000,""); AddText(command,inputs,"确认声明",100,""); MesVersion(command,inputs,"预期版本"); break; case "ai_开工前门禁_建立": Only(inputs,"待派工流水号","预期待派工版本","预期工单审核版本","预期工单版本","幂等键"); ReworkKey(command,inputs,"待派工流水号"); MesVersion(command,inputs,"预期待派工版本"); MesVersion(command,inputs,"预期工单审核版本"); MesVersion(command,inputs,"预期工单版本"); break; case "ai_开工前门禁_登记检查": Only(inputs,"开工门禁流水号","门禁代码","检查结果","检查证据","预期门禁版本","预期门禁项版本","幂等键"); ReworkKey(command,inputs,"开工门禁流水号"); AddText(command,inputs,"门禁代码",40,null); AddText(command,inputs,"检查结果",20,null,"PASSED","BLOCKED"); AddText(command,inputs,"检查证据",1000,null); MesVersion(command,inputs,"预期门禁版本"); MesVersion(command,inputs,"预期门禁项版本"); break; case "ai_开工前门禁_办理": Only(inputs,"开工门禁流水号","动作","意见","确认声明","预期版本","幂等键"); ReworkKey(command,inputs,"开工门禁流水号"); AddText(command,inputs,"动作",30,null,"SUBMIT","APPROVE","START","REJECT","REVISE"); AddText(command,inputs,"意见",1000,""); AddText(command,inputs,"确认声明",100,""); MesVersion(command,inputs,"预期版本"); break; case "ai_返工接收与重新送检_建立接收": Only(inputs,"返工候选流水号","幂等键"); ReworkKey(command,inputs,"返工候选流水号"); break; case "ai_返工接收与重新送检_接收办理": Only(inputs,"返工接收流水号","动作","意见","幂等键"); ReworkKey(command,inputs,"返工接收流水号"); AddText(command,inputs,"动作",30,null,"REJECT","RESUBMIT","RECEIVE"); AddText(command,inputs,"意见",1000,""); break; case "ai_返工接收与重新送检_工单办理": Only(inputs,"返工工单草稿流水号","动作","实际返工数量","证据","意见","确认声明","幂等键"); ReworkKey(command,inputs,"返工工单草稿流水号"); AddText(command,inputs,"动作",30,null,"SUBMIT_COMPLETION","APPROVE_COMPLETION","REJECT_COMPLETION","SEND_QMS"); object quantity; if (inputs.TryGetValue("实际返工数量",out quantity) && quantity!=null && !Object.Equals(quantity,"")) MesQuantity(command,inputs,"实际返工数量",4); AddText(command,inputs,"证据",1000,""); AddText(command,inputs,"意见",1000,""); AddText(command,inputs,"确认声明",100,""); break; default: throw BadInput(); } BindIdempotency(command,inputs,true); } } }