From e92210a6fe4b72f098eaea62df2d8e5af16d0ffa Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期二, 07 五月 2024 15:49:40 +0800 Subject: [PATCH] 点检项目分类;点检方法;三个检验单加字段,点检项目加字段 --- DAL/质检管理/ClsQC_FirstPieceCheckBill.cs | 6 Model/基础资料/基础资料/ClsGy_DotCheckItemClass_Model.cs | 11 Model/质检管理/ClsQC_FirstPieceCheckBillMain.cs | 2 Model/Model.csproj | 2 DAL/基础资料/公用基础资料/ClsGy_DotCheckItemClass_Ctl.cs | 97 +++++ Model/基础资料/基础资料/ClsGy_DotCheckItemMethod_Model.cs | 11 Model/质检管理/ClsQC_PatrolProcCheckBillMain.cs | 2 DAL/基础资料/公用基础资料/ClsGy_DotCheckItemMethod_Ctl.cs | 98 +++++ WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckBillController.cs | 10 WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs | 6 WebAPI/ListModels.cs | 24 + WebAPI/Models/ClsGy_DotCheck.cs | 1 DAL/质检管理/ClsQC_ProcessCheckBill.cs | 6 WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckItemClassController.cs | 379 +++++++++++++++++++++ DAL/DAL.csproj | 2 WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs | 2 WebAPI/WebAPI.csproj | 2 WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckItemMethodController.cs | 379 +++++++++++++++++++++ Model/质检管理/ClsQC_ProcessCheckBillMain.cs | 3 WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs | 2 20 files changed, 1,035 insertions(+), 10 deletions(-) diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj index 3f645de..ea11ba7 100644 --- a/DAL/DAL.csproj +++ b/DAL/DAL.csproj @@ -108,8 +108,10 @@ <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CardStatus_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CardAddress_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CustLocation_Ctl.cs" /> + <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_DotCheckItemMethod_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_EquipStatus_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CardType_Ctl.cs" /> + <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_DotCheckItemClass_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_MouldStatus_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_Operator_Ctl.cs" /> <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_RateType_Ctl.cs" /> diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Ctl.cs" new file mode 100644 index 0000000..0b3d5f8 --- /dev/null +++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Ctl.cs" @@ -0,0 +1,97 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace DAL +{ + public class ClsGy_DotCheckItemClass_Ctl:DBUtility.ClsGy_Base_Ctl + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩� + public string HOldNumber; + public Model.ClsGy_DotCheckItemClass_Model oModel = new Model.ClsGy_DotCheckItemClass_Model(); + //鏂板 + public override bool AddNew() + { + try + { + oCn.BeginTran(); + oCn.RunProc("Insert into Gy_DotCheckItemClass (" + + "HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark" + + ",HMakeTime,HMakeEmp,HCREATEORGID,HUSEORGID) " + + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + + ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "',getdate()" + ",'" + oModel.HMakeEmp + "'," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + + //淇敼 + public override bool ModifyByID(Int64 sItemID) + { + try + { + oCn.BeginTran(); + oCn.RunProc("Update " + MvarItemKey + " set " + + " HNumber='" + oModel.HNumber + "'" + + ",HName='" + oModel.HName + "'" + + ",HShortNumber='" + oModel.HShortNumber + "'" + + ",HParentID=" + oModel.HParentID.ToString() + + ",HLevel=" + oModel.HLevel.ToString() + + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + + ",HRemark= '" + oModel.HRemark + "'" + + ",HHelpCode='" + oModel.HHelpCode + "'" + + " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + //鏍规嵁浠g爜鍒ゆ柇淇℃伅 + public override bool HavParentCode(string sCode, Int64 sItemID) + { + DataSet DS; + try + { + DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); + if (DS.Tables[0].Rows.Count == 0) + return false; + else + { + oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); + return true; + } + } + catch (Exception e) + { + throw (e); + } + } + //鏋勯�犲嚱鏁� + public ClsGy_DotCheckItemClass_Ctl() + { + MvarItemKey = "Gy_DotCheckItemClass"; + MvarReportTitle = "鐐规椤圭洰鍒嗙被"; + oModel = new Model.ClsGy_DotCheckItemClass_Model(); + } + } +} diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Ctl.cs" new file mode 100644 index 0000000..edca622 --- /dev/null +++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Ctl.cs" @@ -0,0 +1,98 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using System.Data; + +namespace DAL +{ + public class ClsGy_DotCheckItemMethod_Ctl:DBUtility.ClsGy_Base_Ctl + { + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩� + public string HOldNumber; + public Model.ClsGy_DotCheckItemMethod_Model oModel = new Model.ClsGy_DotCheckItemMethod_Model(); + //鏂板 + public override bool AddNew() + { + + try + { + oCn.BeginTran(); + oCn.RunProc("Insert into Gy_DotCheckItemMethod (" + + "HNumber,HName,HHelpCode,HShortNumber,HParentID" + + ",HLevel,HEndFlag,HStopflag,HRemark" + + ",HMakeTime,HMakeEmp,HCREATEORGID,HUSEORGID) " + + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + + ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" + oModel.HMakeTime + "','" + oModel.HMakeEmp + "'," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼涓婄骇涓洪潪鏈骇浠g爜 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + + //淇敼 + public override bool ModifyByID(Int64 sItemID) + { + try + { + oCn.BeginTran(); + oCn.RunProc("Update " + MvarItemKey + " set " + + " HNumber='" + oModel.HNumber + "'" + + ",HName='" + oModel.HName + "'" + + ",HShortNumber='" + oModel.HShortNumber + "'" + + ",HParentID=" + oModel.HParentID.ToString() + + ",HLevel=" + oModel.HLevel.ToString() + + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + + ",HRemark= '" + oModel.HRemark + "'" + + ",HHelpCode='" + oModel.HHelpCode + "'" + + " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCn.Commit(); + return true; + } + catch (Exception e) + { + oCn.RollBack(); + throw (e); + } + } + //鏍规嵁浠g爜鍒ゆ柇淇℃伅 + public override bool HavParentCode(string sCode, Int64 sItemID) + { + DataSet DS; + try + { + DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); + if (DS.Tables[0].Rows.Count == 0) + return false; + else + { + oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); + return true; + } + } + catch (Exception e) + { + throw (e); + } + } + //鏋勯�犲嚱鏁� + public ClsGy_DotCheckItemMethod_Ctl() + { + MvarItemKey = "Gy_DotCheckItemMethod"; + MvarReportTitle = "鐐规鏂规硶"; + oModel = new Model.ClsGy_DotCheckItemMethod_Model(); + } + } +} diff --git "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs" "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs" index 3494e2f..57ad084 100644 --- "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs" +++ "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_FirstPieceCheckBill.cs" @@ -92,6 +92,8 @@ ",HMaterID=" + omodel.HMaterID.ToString() + ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() + ",HLastResult=" + DBUtility.ClsPub.BoolToString(omodel.HLastResult) + + ",HShiftsID=" + omodel.HShiftsID.ToString() + + ",HErrTreatment='" + omodel.HErrTreatment + "'" + " where HInterID=" + lngBillKey.ToString()); //鍒犻櫎鍏宠仈 DeleteRelation(ref sReturn, lngBillKey); @@ -204,13 +206,13 @@ ",HYear,HPeriod,HRemark" + ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" + ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" + - ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID" + + ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" + "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + ", " + DBUtility.ClsPub.BoolToString(omodel.HLastResult) + - "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + + "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" + ") "); //鎻掑叆瀛愯〃 foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in DetailColl) diff --git "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBill.cs" "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBill.cs" index 56431ed..115aa38 100644 --- "a/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBill.cs" +++ "b/DAL/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBill.cs" @@ -106,6 +106,8 @@ ",HRoutingInterID=" + omodel.HRoutingInterID.ToString() + ",HDrawingDireID='" + omodel.HDrawingDireID + "'" + ",HPackTypeID=" + omodel.HPackTypeID.ToString() + + ",HShiftsID=" + omodel.HShiftsID.ToString() + + ",HErrTreatment='" + omodel.HErrTreatment + "'" + " where HInterID=" + lngBillKey.ToString()); //鍒犻櫎鍏宠仈 DeleteRelation(ref sReturn, lngBillKey); @@ -206,7 +208,7 @@ ",HBarCode,HLBatchNo,HCusID,HSortBillNo,HContrctBatchNo" + ",HProdAreaID,HProdTypeID,HProdStoveNo,HRecipeID,HDiameter1" + ",HDiameter2,HRoutingInterID,HDrawingDireID,HPackTypeID" + - ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty" + + ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty,HShiftsID,HErrTreatment" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+ @@ -216,7 +218,7 @@ ",'" + omodel.HBarCode + "','" + omodel.HLBatchNo + "'," + omodel.HCusID.ToString() + ",'" + omodel.HSortBillNo + "','" + omodel.HContrctBatchNo + "'" + "," + omodel.HProdAreaID.ToString() + "," + omodel.HProdTypeID.ToString() + ",'" + omodel.HProdStoveNo + "'," + omodel.HRecipeID.ToString() + "," + omodel.HDiameter1.ToString() + "," + omodel.HDiameter2.ToString() + "," + omodel.HRoutingInterID.ToString() + ",'" + omodel.HDrawingDireID + "'," + omodel.HPackTypeID.ToString() + - "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HICMOQty + "," + omodel.HProcExchQty + + "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HICMOQty + "," + omodel.HProcExchQty + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" + ") "); //鎻掑叆瀛愯〃 foreach (Model.ClsQC_ProcessCheckBillSub oSub in DetailColl) diff --git a/Model/Model.csproj b/Model/Model.csproj index f0533f1..d285e15 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -361,6 +361,8 @@ <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CardStatus_Model.cs" /> <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CardAddress_Model.cs" /> <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CardType_Model.cs" /> + <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_DotCheckItemMethod_Model.cs" /> + <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_DotCheckItemClass_Model.cs" /> <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_ErrMsgBackType_Model.cs" /> <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_TaskClass_Model.cs" /> <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_ProjectClass_Model.cs" /> diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Model.cs" new file mode 100644 index 0000000..d644a4f --- /dev/null +++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemClass_Model.cs" @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsGy_DotCheckItemClass_Model : DBUtility.ClsGy_Base_Model + { + // + } +} diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Model.cs" new file mode 100644 index 0000000..58501fd --- /dev/null +++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_DotCheckItemMethod_Model.cs" @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Model +{ + public class ClsGy_DotCheckItemMethod_Model : DBUtility.ClsGy_Base_Model + { + // + } +} 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 633a7d6..54afc0b 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" @@ -24,5 +24,7 @@ public Int64 HUnitID; public Int64 HProcID; + public Int64 HShiftsID; + public string HErrTreatment; } } diff --git "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_PatrolProcCheckBillMain.cs" "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_PatrolProcCheckBillMain.cs" index 1b73614..658e8c0 100644 --- "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_PatrolProcCheckBillMain.cs" +++ "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_PatrolProcCheckBillMain.cs" @@ -21,5 +21,7 @@ public Int64 HMainProcID; public Int64 HLastResult; + public Int64 HShiftsID; + public string HErrTreatment; } } diff --git "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBillMain.cs" "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBillMain.cs" index c42294f..ecf88d1 100644 --- "a/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBillMain.cs" +++ "b/Model/\350\264\250\346\243\200\347\256\241\347\220\206/ClsQC_ProcessCheckBillMain.cs" @@ -43,5 +43,8 @@ public Int64 HICMOQty; public Int64 HProcExchQty; + + public Int64 HShiftsID; + public string HErrTreatment; } } diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" index b960379..09e616b 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" @@ -778,6 +778,8 @@ BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID); BillNew.omodel.HBillStatus = 1; BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID); + BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID); + BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment); List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg3); BillNew.DetailColl = new List<Model.ClsQC_ProcessCheckBillSub>(); for (int i = 0; i < subList.ToArray().Length; i++) diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" index e39b759..217a3a1 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" @@ -200,6 +200,8 @@ BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType); BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID); BillNew.omodel.HBillStatus = 1; + BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID); + BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment); List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3); BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>(); for (int i = 0; i < subList.ToArray().Length; i++) diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs" index 59ba13f..2a4ac0d 100644 --- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs" @@ -132,7 +132,7 @@ { try { - ds = oCN.RunProcReturn("select * from Gy_DotCheck where HItemID=" + HInterID, "Gy_DotCheck"); + ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheck_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheck_Edit"); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -178,6 +178,7 @@ string HRemark = list[0].HRemark; bool HStopflag = list[0].HStopflag; string HUseFlag = list[0].HUseFlag; + Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID; //鍒ゆ柇鏉冮檺 if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3)) @@ -218,6 +219,7 @@ ",HShortNumber='" + HShortNumber + "'" + ",HHelpCode='" + HHelpCode + "'" + ",HStopflag='" + HStopflag + "'" + + ",HDotCheckItemClassID=" + HDotCheckItemClassID + ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); //淇敼瀛愰」鐩唬鐮� //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); @@ -268,7 +270,7 @@ bool HStopflag = list[0].HStopflag; string HUseFlag = list[0].HUseFlag; bool HEndFlag = list[0].HEndFlag; - + Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID; //鍒ゆ柇鏉冮檺 if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3)) { @@ -295,9 +297,9 @@ //涓昏〃 oCN.RunProc("Insert into Gy_DotCheck " + " (HNumber,HName,HHelpCode,HShortNumber" + - ",HLevel,HEndFlag,HStopflag,HRemark,HParentID) " + + ",HLevel,HEndFlag,HStopflag,HRemark,HParentID,HDotCheckItemClassID ) " + " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + - +HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',0)", ref DBUtility.ClsPub.sExeReturnInfo); + +HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',0," + HDotCheckItemClassID + ")", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCN.Commit(); diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemClassController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemClassController.cs" new file mode 100644 index 0000000..2764735 --- /dev/null +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemClassController.cs" @@ -0,0 +1,379 @@ +锘縰sing DBUtility; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + + +namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡 +{ + public class Gy_DotCheckItemClassController : ApiController + { + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + public DAL.ClsGy_DotCheckItemClass_Ctl BillOld = new DAL.ClsGy_DotCheckItemClass_Ctl(); + + #region 鐐规椤圭洰鍒嗙被鍒楄〃鏁版嵁 + [Route("Gy_DotCheckItemClass/GetDotCheckItemClassList")] + [HttpGet] + public object GetDotCheckItemClassList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemClass_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemClassList where 1=1 " + sWhere + " order by HItemID", "h_v_Gy_DotCheckItemClassList"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 淇敼鐐规椤圭洰鍒嗙被鑾峰彇缁戝畾鏁版嵁 + [Route("Gy_DotCheckItemClass/EditDotCheckItemClass")] + [HttpGet] + public object EditDotCheck(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemClass_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheckItemClass_Edit"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + 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("Gy_DotCheckItemClass/SaveGy_DotCheckItemClassList")] + [HttpPost] + public object SaveGy_DotCheckItemClassList([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg_HUserName = sArray[1].ToString(); + string msg_HCreateORGID = sArray[2].ToString(); + string msg_OperationType = sArray[3].ToString(); + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + //缂栬緫鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemClass_Edit", 1, false, msg_HUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_DotCheckItemClass ", "Gy_DotCheckItemClass"); + if ((Maxds != null || Maxds.Tables[0].Rows.Count > 0) && ( Maxds.Tables[0].Rows[0]["HItemID"] != null && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "" && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "undefined") ) + { + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + else + { + HItemID = 1; + } + ListModels oListModels = new ListModels(); + + try + { + DAL.ClsGy_DotCheckItemClass_Ctl oBill = new DAL.ClsGy_DotCheckItemClass_Ctl(); + List<Model.ClsGy_DotCheckItemClass_Model> lsmain = new List<Model.ClsGy_DotCheckItemClass_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_DotCheckItemClass(msg1); + foreach (Model.ClsGy_DotCheckItemClass_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + ds = oCN.RunProcReturn("select * from Gy_DotCheckItemClass where HStopflag = 0 and HNumber = '" + oItem.HNumber.Trim() + "'", "Gy_DotCheckItemClass"); + + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItem.HUSEORGID = Convert.ToInt32(msg_HCreateORGID); //缁勭粐id + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇 + oItem.HMakeEmp = msg_HUserName; //鍒跺崟浜� + oItem.HCREATEORGID = Convert.ToInt32(msg_HCreateORGID); //鍒涘缓缁勭粐 + oBill.oModel = oItem; + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (msg_OperationType == 1.ToString() || msg_OperationType == 2.ToString()) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = ""; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = ""; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = ""; + return objJsonResult; + } + } + #endregion + + #region 鐐规椤圭洰鍒嗙被鍒犻櫎 + [Route("Gy_DotCheckItemClass/DeleteDotCheckItemClass")] + [HttpGet] + public object DeleteDotCheckItemClass(long HItemID, string User) + { + + try + { + if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemClass_Delete", 1, false, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn("Select * from Gy_DotCheckItemClass Where HItemID='" + HItemID + "'", "Gy_DotCheckItemClass", ref DBUtility.ClsPub.sExeReturnInfo); + if (ds.Tables[0].Rows.Count != 0) + { + ds = oCN.RunProcReturn("Delete from Gy_DotCheckItemClass Where HItemID='" + HItemID + "'", "Gy_DotCheckItemClass", ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鐐规椤圭洰鍒嗙被瀹℃牳銆佸弽瀹℃牳 + /// <summary> + /// + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param> + /// <param name="CurUserName">瀹℃牳浜�</param> + /// <returns></returns> + [Route("Gy_DotCheckItemClass/AuditGy_DotCheckItemClass")] + [HttpGet] + public object AuditGy_DotCheckItemClass(string HInterID, int Type, string user) + { + try + { + //瀹℃牳鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemClass_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 + DataSet ds; + string sql = "select * from Gy_DotCheckItemClass where HItemID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳鍗曟嵁 + if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍� + DataSet ds; + string sql = "select * from Gy_DotCheckItemClass where HItemID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿崟鎹� + if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + } +} diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemMethodController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemMethodController.cs" new file mode 100644 index 0000000..c4c949e --- /dev/null +++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckItemMethodController.cs" @@ -0,0 +1,379 @@ +锘縰sing DBUtility; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using WebAPI.Models; + + +namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡 +{ + public class Gy_DotCheckItemMethodController : ApiController + { + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + public DAL.ClsGy_DotCheckItemMethod_Ctl BillOld = new DAL.ClsGy_DotCheckItemMethod_Ctl(); + + #region 鐐规鏂规硶鍒楄〃鏁版嵁 + [Route("Gy_DotCheckItemMethod/GetDotCheckItemMethodList")] + [HttpGet] + public object GetDotCheckItemMethodList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemMethod_Query", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemMethodList where 1=1 " + sWhere + " order by HItemID", "h_v_Gy_DotCheckItemMethodList"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 淇敼鐐规鏂规硶鑾峰彇缁戝畾鏁版嵁 + [Route("Gy_DotCheckItemMethod/EditDotCheckItemMethod")] + [HttpGet] + public object EditDotCheckItemMethod(long HInterID) + { + try + { + ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemMethod_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheckItemMethod_Edit"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + 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("Gy_DotCheckItemMethod/SaveGy_DotCheckItemMethodList")] + [HttpPost] + public object SaveGy_DotCheckItemMethodList([FromBody] JObject msg) + { + DataSet ds; + var _value = msg["msg"].ToString(); + string msg3 = _value.ToString(); + string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg1 = sArray[0].ToString(); + string msg_HUserName = sArray[1].ToString(); + string msg_HCreateORGID = sArray[2].ToString(); + string msg_OperationType = sArray[3].ToString(); + + Int64 HItemID = 0; + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + + //缂栬緫鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemMethod_Edit", 1, false, msg_HUserName)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + + //鑾峰彇鏈�澶D鍊艰祴鍊� + DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_DotCheckItemMethod ", "Gy_DotCheckItemMethod"); + if ((Maxds != null || Maxds.Tables[0].Rows.Count > 0) && (Maxds.Tables[0].Rows[0]["HItemID"] != null && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "" && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "undefined")) + { + var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); + maxid += 1; + HItemID = maxid; + } + else + { + HItemID = 1; + } + ListModels oListModels = new ListModels(); + + try + { + DAL.ClsGy_DotCheckItemMethod_Ctl oBill = new DAL.ClsGy_DotCheckItemMethod_Ctl(); + List<Model.ClsGy_DotCheckItemMethod_Model> lsmain = new List<Model.ClsGy_DotCheckItemMethod_Model>(); + msg1 = msg1.Replace("\\", ""); + msg1 = msg1.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_Gy_DotCheckItemMethod(msg1); + foreach (Model.ClsGy_DotCheckItemMethod_Model oItem in lsmain) + { + if (oItem.HNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + if (oItem.HName.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒"; + objJsonResult.data = 1; + return objJsonResult; + } + + //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮� + ds = oCN.RunProcReturn("select * from Gy_DotCheckItemMethod where HStopflag =0 and HNumber = '" + oItem.HNumber.Trim() + "'", "Gy_DotCheckItemMethod"); + + //寰楀埌鐭唬鐮� + string sShortNumber; + sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); + if (sShortNumber.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItem.HUSEORGID = Convert.ToInt32(msg_HCreateORGID); //缁勭粐id + oItem.HShortNumber = sShortNumber;//鐭唬鐮� + oItem.HEndFlag = true;//鏈骇鏍囧織 + oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇 + oItem.HMakeEmp = msg_HUserName; //鍒跺崟浜� + oItem.HCREATEORGID = Convert.ToInt32(msg_HCreateORGID); //鍒涘缓缁勭粐 + oBill.oModel = oItem; + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (msg_OperationType == 1.ToString() || msg_OperationType == 2.ToString()) + { + bResult = oBill.AddNew(); + } + else + { + bResult = oBill.ModifyByID(oBill.oModel.HItemID); + } + if (bResult) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = ""; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = ""; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = ""; + return objJsonResult; + } + } + #endregion + + #region 鐐规鏂规硶鍒犻櫎 + [Route("Gy_DotCheckItemMethod/DeleteDotCheckItemMethod")] + [HttpGet] + public object DeleteDotCheckItemMethod(long HItemID, string User) + { + + try + { + if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemMethod_Delete", 1, false, User)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn("Select * from Gy_DotCheckItemMethod Where HItemID='" + HItemID + "'", "Gy_DotCheckItemMethod", ref DBUtility.ClsPub.sExeReturnInfo); + if (ds.Tables[0].Rows.Count != 0) + { + ds = oCN.RunProcReturn("Delete from Gy_DotCheckItemMethod Where HItemID='" + HItemID + "'", "Gy_DotCheckItemMethod", ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�"; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鐐规鏂规硶瀹℃牳銆佸弽瀹℃牳 + /// <summary> + /// + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param> + /// <param name="CurUserName">瀹℃牳浜�</param> + /// <returns></returns> + [Route("Gy_DotCheckItemMethod/AuditGy_DotCheckItemMethod")] + [HttpGet] + public object AuditGy_DotCheckItemMethod(string HInterID, int Type, string user) + { + try + { + //瀹℃牳鏉冮檺 + if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemMethod_Check", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + ClsPub.CurUserName = user; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 + DataSet ds; + string sql = "select * from Gy_DotCheckItemMethod where HItemID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.data = null; + return objJsonResult; + } + //瀹℃牳鍗曟嵁 + if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍� + DataSet ds; + string sql = "select * from Gy_DotCheckItemMethod where HItemID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!"; + objJsonResult.data = null; + return objJsonResult; + } + //鍙嶅鏍稿崟鎹� + if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + } + + oCN.Commit();//鎻愪氦浜嬪姟 + + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + } +} diff --git a/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs b/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs index 8372902..e8511ee 100644 --- a/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs +++ b/WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs @@ -94,6 +94,8 @@ //",HMaterID=" + omodel.HMaterID.ToString() + ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() + ",HMainProcID=" + omodel.HMainProcID.ToString() + + ",HShiftsID=" + omodel.HShiftsID.ToString() + + ",HErrTreatment='" + omodel.HErrTreatment + "'" + " where HInterID=" + lngBillKey.ToString(); //鏇存柊涓昏〃 oCn.RunProc(sqlerro); @@ -223,12 +225,12 @@ "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + ",HYear,HPeriod,HRemark" + ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" + - ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HMainProcID,HLastResult" + + ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HMainProcID,HLastResult,HShiftsID,HErrTreatment" + ") " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" + "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + - ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + "," + omodel.HMainProcID +" ,"+ omodel.HLastResult + + ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + "," + omodel.HMainProcID +" ,"+ omodel.HLastResult + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" + ") "); //鎻掑叆瀛愯〃 foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl) diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index 1d17cd2..b4c6991 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -1796,6 +1796,30 @@ } /// <summary> + /// 澶勭悊鏂板鐐规椤圭洰鍒嗙被琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsGy_DotCheckItemClass_Model> getObjectByJson_Gy_DotCheckItemClass(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsGy_DotCheckItemClass_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_DotCheckItemClass_Model>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板鐐规鏂规硶琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsGy_DotCheckItemMethod_Model> getObjectByJson_Gy_DotCheckItemMethod(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsGy_DotCheckItemMethod_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_DotCheckItemMethod_Model>>(jsonString); + return list; + } + + /// <summary> /// 澶勭悊鏂板鏉$爜鎷嗙爜鐨刯son /// </summary> /// <param name="jsonString"></param> diff --git a/WebAPI/Models/ClsGy_DotCheck.cs b/WebAPI/Models/ClsGy_DotCheck.cs index 9f84d7c..280788c 100644 --- a/WebAPI/Models/ClsGy_DotCheck.cs +++ b/WebAPI/Models/ClsGy_DotCheck.cs @@ -19,5 +19,6 @@ public string HRemark; //澶囨敞 public string HUseFlag = "鏈娇鐢�"; + public Int64 HDotCheckItemClassID; //鐐规椤圭洰鍒嗙被 } } \ No newline at end of file diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index 1492e0a..2fa77fe 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -524,6 +524,8 @@ <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CardTypeController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_COMMONCONTACTBillController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CustLocationController.cs" /> + <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DotCheckItemMethodController.cs" /> + <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DotCheckItemClassController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DutyBillController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_EquipStatusController.cs" /> <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MatePriceSupController.cs" /> -- Gitblit v1.9.1