From 75fa0fb23f1e1a51df578c758feb0f4c2a5b4810 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期三, 30 八月 2023 14:34:11 +0800 Subject: [PATCH] 对色记录单,试样记录单pda新增 --- Model/质检管理/ClsQC_FirstPieceCheckBillMain.cs | 2 Model/车间管理/ClsQC_TestSampleCheckBillMain.cs | 63 +++++++ WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs | 298 +++++++++++++++++++++++++++++++++++++ Model/Model.csproj | 2 Model/车间管理/ClsQC_TestSampleCheckBillSub.cs | 56 +++++++ 5 files changed, 421 insertions(+), 0 deletions(-) diff --git a/Model/Model.csproj b/Model/Model.csproj index db8e158..1ce1147 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -717,7 +717,9 @@ <Compile Include="杞﹂棿绠$悊\ClsSc_StationEntrustOutBillSub_Item.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationInBillMain.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationInBillSub.cs" /> + <Compile Include="杞﹂棿绠$悊\ClsQC_TestSampleCheckBillMain.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationOutBillMain.cs" /> + <Compile Include="杞﹂棿绠$悊\ClsQC_TestSampleCheckBillSub.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationOutBillSub.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationOutBillSub_Emp.cs" /> <Compile Include="杞﹂棿绠$悊\ClsSc_StationOutBillSub_Item.cs" /> diff --git "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBillMain.cs" "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBillMain.cs" index ed85bf3..633a7d6 100644 --- "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBillMain.cs" +++ "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBillMain.cs" @@ -21,6 +21,8 @@ public Int64 HPrintQty; public Int64 HICMOEntryID; public Int64 HQCSchemeID; + public Int64 HUnitID; + public Int64 HProcID; } } diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillMain.cs" new file mode 100644 index 0000000..5020778 --- /dev/null +++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillMain.cs" @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsQC_TestSampleCheckBillMain : DBUtility.ClsXt_BaseBillMain + { + public Int64 HPrintQty; + public Int64 HICMOInterID; + public Int64 HICMOEntryID; + public String HICMOBillNo; + public Int64 HProcPlanInterID; + public Int64 HProcPlanEntryID; + public String HProcPlanBillNo; + public Int64 HProcExchInterID; + public Int64 HProcExchEntryID; + public String HProcExchBillNo; + public Int64 HMaterID; + public Int64 HUnitID; + public Int64 HProcID; + public Int64 HPayProcID; + public double HICMOQty; + public double HPlanQty; + public double HDSQty; + public DateTime HStationOutTime; + public Int64 HSourceID; + public Int64 HGroupID; + public Int64 HDeptID; + public Int64 HEmpID; + public String HReportType; + public String HBarCode; + public String HAddr; + public String HBarCodeMaker; + public DateTime HBarCodeMakeDate; + public Int64 HSupID; + public double HQty; + public double HPieceQty; + public double HPrice; + public double HMoney; + public double HBadCount; + public double HWasterQty; + public String HSourceName; + public double HPlanPieceQty; + public double HBadPNL; + public Int64 HCenterID; + public int HProcNo; + public string HOrderProcNO; + public bool HLastSubProc; + public double HChongQty; + public double HPriceRate; + public string HMouldNum;//模穴号 + public string HBarCode_Cus;//客户条码编码 + public Single HWorkTimes;//工时 + public Int64 HQCCheckID;//检验员 + public string HSourceNameList;//设备清单 + public Int64 HPersonNums; //人员数 + public Int64 HMachineNums; //机器数 + public string HEmpNum; //职员代码 + public string eventType { get; set; } + public Int64 HLastResult;//试样结论 + } +} diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillSub.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillSub.cs" new file mode 100644 index 0000000..a7a8880 --- /dev/null +++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsQC_TestSampleCheckBillSub.cs" @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsQC_TestSampleCheckBillSub : DBUtility.ClsXt_BaseBillSub + { + + public string HBillNo_bak;// varchar(50) --单据号(备份,以免内码丢失,找不到对应主表) + + public Int64 HProcID;// int --工序 + public Int64 HMaterID;// int --物料 + public Int64 HEmpID;// int --操作工 + public Int64 HSourceID;// int --生产资源ID(Gy_Source) + public Int64 HSourceID2;// int --生产资源ID(Gy_Source) + public Int64 HSourceID3;// int --生产资源ID(Gy_Source) + public Int64 HSourceID4;// int --生产资源ID(Gy_Source) + public Int64 HSourceID5;// int --生产资源ID(Gy_Source) + public DateTime HRelBeginDate;// datetime --实际开工日期 + public DateTime HRelEndDate;// datetime --实际完工日期 + public double HTimes;// money --实作时间 + public double HQty;// dec --实作数量 + public double HPieceQty;// dec --板数 + public double HCheckQty; //dec(18,8) --合格数量 + public double HBadCount; //不良品数 + public double HWasterQty;// 因工报废数量 + public double HWasterQty2;// 因料报废数量 + + public double HWeight;// dec(18,8) --重量 + public double HPrice;// dec(18,8) --工序工价 + public double HMoney;// money -- 计件金额 + public double HOtherDeduct;// money --其他扣款 + public double HRelPay;// money --实得工资 + public string HOtherItem1;// varchar(50) --其他属性1 + public string HOtherItem2;// varchar(50) --其他属性2 + public long HCheckEmpID;// int --检验员(gy_employee) + + public Int64 HProcPlanInterID;// int --工序计划单ID + public Int64 HProcPlanEntryID;// int --工序计划单子ID + public string HProcPlanBillNo;// varchar(50) --工序计划单号 + public Int64 HICMOInterID;// int --任务单ID + public string HICMOBillNo;// varchar(50) --任务单号 + public Int64 HSeOrderInterID;// int --销售订单主ID + public Int64 HSeOrderEntryID;// int --销售子ID + public string HSeOrderBillNo;// varchar(50) --销售订单号 + public Int64 HWWOrderInterID;// int --委外订单内码 + public Int64 HWWOrderEntryID;// int --委外订单子内码 + public string HWWOrderBillNo;// varchar(50) --委外订单号 + public Int64 HProcExchInterID;// int --工序流转卡ID + public Int64 HProcExchEntryID;// int --工序流转卡子ID + public string HProcExchBillNo;// varchar(50) --工序流转卡号 + public Int64 HProcNo;// int --工序号 + public string HSourceName;// 机台 + } +} diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs index 2940b96..bf47b86 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs @@ -316,6 +316,304 @@ } #endregion + #region 鎸囧紩鍗℃壂鐮佽幏鍙栦俊鎭� + [Route("MES_SampleRecordBill_PDA/SampleRecordBillHBarCode_KeyDown")] + [HttpGet] + public object SampleRecordBillHBarCode_KeyDown(string HBarCode, string HInterID, string UserID, string HBillType) + { + try + { + if (HBarCode == null || HBarCode.Equals("")) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "绌虹櫧鐮�,鏉″舰鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = null; + return objJsonResult; + } + //鎷嗗垎鏉″舰鐮� + string sBillBarCode = HBarCode.Trim(); + string[] NewBarCode; + if (sBillBarCode.CompareTo("#") > 0) + { + NewBarCode = sBillBarCode.Split(Convert.ToChar("#")); + sBillBarCode = NewBarCode[0]; + } + string sBillNo = sBillBarCode; //鏉″舰鐮� + + string[] arr = sBillNo.Split('&'); //浠ョ鍙封��&鈥欏垎鍓叉潯褰㈢爜 + string BillNo_PGD = arr[0]; //鍗曟嵁鍙� + string entryid_PGD = "";//瀛恑d + if (arr.Length > 1) + { + entryid_PGD = arr[1]; + } + + + //鎴彇鏉$爜绫诲瀷2 鍓嶅洓浣� + string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length)); + + switch (BillNoType2) + { + case "GXLX"://娴佽浆鍗� + string sErr = ""; + if (oSystemParameter.ShowBill(ref sErr)) + { + if (oSystemParameter.omodel.WMS_CampanyName == "涔斾竴") + { //绯荤粺鍙傛暟鏄惁涓哄彧鏄剧ず褰撳墠鐧诲綍鐢ㄦ埛鍏宠仈鐨勫伐搴忎俊鎭�,N涓哄惁锛孻涓烘槸 + ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where 鍗曟嵁鍙�= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList"); + } + else + { + ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList where 鍗曟嵁鍙�= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList"); + } + } + break; + default: + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏉$爜閿欒!"; + objJsonResult.data = null; + return objJsonResult; + } + + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 璇曟牱璁板綍鏂板淇濆瓨 + [Route("MES_SampleRecordBill_PDA/SampleRecordAddBill")] + [HttpPost] + public object ColorRecordAddBill([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + try + { + //鍙嶅簭鍒楀寲 + string msg2 = "[" + sArray[0].ToString() + "]"; + string user = sArray[1].ToString();//鐢ㄦ埛鍚� + string OperationType = sArray[2].ToString();//绫诲瀷 + + //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� + if (!DBUtility.ClsPub.Security_Log("QC_TestSampleCheckBill_Edit", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犵紪杈戞潈闄�!"; + objJsonResult.data = null; + return objJsonResult; + } + + List<Model.ClsQC_TestSampleCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_TestSampleCheckBillMain>>(msg2); + string BillType = "7510"; + string HBillSubType = "7510"; + string eventType = list[0].eventType; + long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = list[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + int HBillStatus = 1; + string HMaker = user;//鍒跺崟浜� + int HYear = DateTime.Now.Year; + double HPeriod = DateTime.Now.Month; + long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮 + long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D + string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗� + string HProcExchBillNo = list[0].HProcExchBillNo;//鎸囧紩鍗� + long HMaterID = list[0].HMaterID;//浜у搧ID + long HUnitID = list[0].HUnitID;//璁¢噺鍗曚綅 + long HProcID = list[0].HProcID;//宸ュ簭ID + long HPRDORGID = list[0].HPRDORGID;//缁勭粐ID + long HLastResult = list[0].HLastResult;//璇曟牱缁撹 + + //鍗曟嵁瀹屾暣鎬у垽鏂� + if (HProcExchBillNo =="") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娴佽浆鍗℃病鏈夐�夋嫨锛佽鎵弿鏉″舰鐮佹垨杈撳叆鏉″舰鐮佸悗鍥炶溅"; + objJsonResult.data = null; + return objJsonResult; + } + + var num = 0; + + oCN.BeginTran(); + if ("Add".Equals(eventType)) + { + num = 1; + + ds = oCN.RunProcReturn("select * from QC_TestSampleCheckBillMain where HBillNo='" + HBillNo + "'", "QC_TestSampleCheckBillMain"); + if (ds.Tables[0].Rows.Count == 1) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.RunProc("Insert Into QC_TestSampleCheckBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo,HUnitID" + + ",HPRDORGID,HLastResult)" + + " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + + "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'," + HUnitID + + "," + HPRDORGID + ",'" + HLastResult + "') "); + } + else + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.Commit(); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 瀵硅壊璁板綍鏂板淇濆瓨 + [Route("MES_SampleRecordBill_PDA/ColorRecordAddBill")] + [HttpPost] + public object SampleRecordAddBill([FromBody] JObject oMain) + { + var _value = oMain["oMain"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + try + { + //鍙嶅簭鍒楀寲 + string msg2 = "[" + sArray[0].ToString() + "]"; + string user = sArray[1].ToString();//鐢ㄦ埛鍚� + string OperationType = sArray[2].ToString();//绫诲瀷 + + //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄� + if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Edit", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犵紪杈戞潈闄�!"; + objJsonResult.data = null; + return objJsonResult; + } + + List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(msg2); + string BillType = "7505"; + string HBillSubType = "7505"; + long HInterID = list[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D + string HBillNo = list[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿 + int HBillStatus = 1; + string HMaker = user;//鍒跺崟浜� + int HYear = DateTime.Now.Year; + double HPeriod = DateTime.Now.Month; + long HSourceID = list[0].HSourceID;//鐢熶骇璧勬簮 + long HICMOInterID = list[0].HICMOInterID;//浠诲姟鍗旾D + string HICMOBillNo = list[0].HICMOBillNo;//浠诲姟鍗� + string HProcExchBillNo = list[0].HProcExchBillNo;//鎸囧紩鍗� + long HMaterID = list[0].HMaterID;//浜у搧ID + //long HUnitID = list[0].HUnitID;//璁¢噺鍗曚綅 + long HProcID = list[0].HProcID;//宸ュ簭ID + long HPRDORGID = list[0].HPRDORGID;//缁勭粐ID + bool HLastResult = list[0].HLastResult;//璇曟牱缁撹 + + //鍗曟嵁瀹屾暣鎬у垽鏂� + if (HProcExchBillNo == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娴佽浆鍗℃病鏈夐�夋嫨锛佽鎵弿鏉″舰鐮佹垨杈撳叆鏉″舰鐮佸悗鍥炶溅"; + objJsonResult.data = null; + return objJsonResult; + } + + var num = 0; + + oCN.BeginTran(); + if (OperationType=="1") + { + num = 1; + + ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HBillNo='" + HBillNo + "'", "QC_FirstPieceCheckBillMain"); + if (ds.Tables[0].Rows.Count == 1) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + + "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + + ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOBillNo,HProcExchBillNo" + + ",HPRDORGID,HLastResult)" + + " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + + "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + + "," + HPRDORGID + ",'" + HLastResult + "') "); + } + else + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎿嶄綔绫诲瀷鏃犳晥锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.Commit(); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鏂板鍗曟嵁鎴愬姛锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 鏍规嵁鐧诲綍鐢ㄦ埛鑾峰彇宸ュ簭 [Route("Sc_StationInBill/autoGetProcNo")] [HttpGet] -- Gitblit v1.9.1