From 1fd77f77cb40a46ad3ed530e87849edbaa01b376 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期六, 31 十二月 2022 23:04:15 +0800
Subject: [PATCH] 器具状态;器具报废申请;器具寿命耗用;设备状态
---
Model/基础资料/基础资料/ClsGy_MouldStatus_Model.cs | 20
Model/生产管理/设备管理/ClsSb_EquipStatusChangeBillMain.cs | 16
Model/基础资料/基础资料/ClsGy_EquipStatus_Model.cs | 20
WebAPI/Controllers/MJGL/Sc_MouldStatusChangeBillController.cs | 286 ++++++
WebAPI/Controllers/基础资料/基础资料/Gy_EquipStatusController.cs | 311 +++++++
WebAPI/Controllers/MJGL/Sc_MouldLifeUseBillController.cs | 286 ++++++
Model/Model.csproj | 8
DAL/生产管理/模具管理/ClsSc_MouldStatusChangeBill.cs | 231 +++++
Model/生产管理/设备管理/ClsSb_EquipStatusChangeBillSub.cs | 18
WebAPI/Controllers/MJGL/Sc_MouldScrapRequestBillController.cs | 293 +++++++
DAL/基础资料/公用基础资料/ClsGy_EquipStatus_Ctl.cs | 103 ++
DAL/基础资料/公用基础资料/ClsGy_MouldStatus_Ctl.cs | 103 ++
WebAPI/ListModels.cs | 24
Model/生产管理/模具管理/ClsSc_MouldLifeUseBillMain.cs | 16
WebAPI/Controllers/基础资料/基础资料/Gy_MouldStatusController.cs | 313 +++++++
DAL/DAL.csproj | 3
Model/生产管理/模具管理/ClsSc_MouldStatusChangeBillSub.cs | 18
Model/生产管理/模具管理/ClsSc_MouldLifeUseBillSub.cs | 18
WebAPI/Controllers/SBGL/Sb_EquipStatusChangeBillController.cs | 287 +++++++
WebAPI/WebAPI.csproj | 12
Model/生产管理/模具管理/ClsSc_MouldStatusChangeBillMain.cs | 16
21 files changed, 2,402 insertions(+), 0 deletions(-)
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 18fd31d..f463d4e 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -86,6 +86,8 @@
<Compile Include="浠撳簱绠$悊\鏉$爜绠$悊\ClsKF_BarCodeStatusChangeBill.cs" />
<Compile Include="鍩虹璧勬枡\InterFace鍩虹璧勬枡\ClsIF_ORGANIZATIONS_View.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CustLocation_Ctl.cs" />
+ <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_EquipStatus_Ctl.cs" />
+ <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_MouldStatus_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_Operator_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_RateType_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_Staff_Ctl.cs" />
@@ -600,6 +602,7 @@
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldProdOutInBill.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldRepairInBill.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldRepairOutBill.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldStatusChangeBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipSparepartsBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipSparepartsChangeBill.cs" />
<Compile Include="璐ㄦ绠$悊\ClsQC_FirstPieceCheckBill.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_EquipStatus_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_EquipStatus_Ctl.cs"
new file mode 100644
index 0000000..845618e
--- /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_EquipStatus_Ctl.cs"
@@ -0,0 +1,103 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsGy_EquipStatus_Ctl : DBUtility.ClsGy_Base_Ctl
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
+ public string HOldNumber;
+ public Model.ClsGy_EquipStatus_Model oModel = new Model.ClsGy_EquipStatus_Model();
+ //鏂板
+ public override bool AddNew()
+ {
+
+ try
+ {
+ oCn.BeginTran();
+ oCn.RunProc($@"insert into Gy_EquipStatus(HNumber,HName ,HShortNumber ,HParentID ,HLevel
+ ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag
+ ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp
+ ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID)
+ values('{oModel.HNumber}','{oModel.HName}','{oModel.HShortNumber}',{oModel.HParentID},{oModel.HLevel}
+ ,{(oModel.HEndFlag == true ? 1 : 0)},{(oModel.HStopflag == true ? 1 : 0)},'{oModel.HRemark}','{oModel.HHelpCode}','{oModel.HUseFlag}'
+ ,GETDATE(),'{oModel.HMakeEmp}','','',''
+ ,'','','',{oModel.HUSEORGID},{oModel.HCREATEORGID})"
+ , 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 + "'" +
+ ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
+ ",HModifyTime =getdate()" +
+ " 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_EquipStatus_Ctl()
+ {
+ MvarItemKey = "Gy_EquipStatus";
+ MvarReportTitle = "璁惧鐘舵��";
+ oModel = new Model.ClsGy_EquipStatus_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_MouldStatus_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_MouldStatus_Ctl.cs"
new file mode 100644
index 0000000..5f75eb5
--- /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_MouldStatus_Ctl.cs"
@@ -0,0 +1,103 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsGy_MouldStatus_Ctl : DBUtility.ClsGy_Base_Ctl
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
+ public string HOldNumber;
+ public Model.ClsGy_MouldStatus_Model oModel = new Model.ClsGy_MouldStatus_Model();
+ //鏂板
+ public override bool AddNew()
+ {
+
+ try
+ {
+ oCn.BeginTran();
+ oCn.RunProc($@"insert into Gy_MouldStatus(HNumber,HName ,HShortNumber ,HParentID ,HLevel
+ ,HEndFlag ,HStopflag ,HRemark ,HHelpCode ,HUseFlag
+ ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp
+ ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID)
+ values('{oModel.HNumber}','{oModel.HName}','{oModel.HShortNumber}',{oModel.HParentID},{oModel.HLevel}
+ ,{(oModel.HEndFlag == true ? 1 : 0)},{(oModel.HStopflag == true ? 1 : 0)},'{oModel.HRemark}','{oModel.HHelpCode}','{oModel.HUseFlag}'
+ ,GETDATE(),'{oModel.HMakeEmp}','','',''
+ ,'','','',{oModel.HUSEORGID},{oModel.HCREATEORGID})"
+ , 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 + "'" +
+ ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
+ ",HModifyTime =getdate()" +
+ " 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_MouldStatus_Ctl()
+ {
+ MvarItemKey = "Gy_MouldStatus";
+ MvarReportTitle = "鍣ㄥ叿鐘舵��";
+ oModel = new Model.ClsGy_MouldStatus_Model();
+ }
+ }
+}
diff --git "a/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBill.cs" "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBill.cs"
new file mode 100644
index 0000000..7019639
--- /dev/null
+++ "b/DAL/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBill.cs"
@@ -0,0 +1,231 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+
+namespace DAL
+{
+ public class ClsSc_MouldStatusChangeBill : DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsSc_MouldStatusChangeBillMain omodel = new Model.ClsSc_MouldStatusChangeBillMain();
+ public List<Model.ClsSc_MouldStatusChangeBillSub> DetailColl = new List<Model.ClsSc_MouldStatusChangeBillSub>();
+
+ public ClsSc_MouldStatusChangeBill()
+ {
+ base.MvarItemKeySub = "Sc_MouldStatusChangeBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey = "Sc_MouldStatusChangeBillMain";
+ base.MvarReportTitle = "鍣ㄥ叿鐘舵�佸彉鏇村崟";
+ base.BillType = "3844";
+ base.HBillSubType = "3844";
+ }
+
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //
+ oCn.BeginTran();
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate Sc_MouldStatusChangeBillMain set " +
+ " HReason='" + omodel.HReason + "'" + //鍥哄畾璧嬪��===============
+ ",HExplanation='" + omodel.HExplanation + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HBillStatus=" + omodel.HBillStatus.ToString() +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HEmpID=" + omodel.HEmpID.ToString() +
+ ",HDeptID=" + omodel.HDeptID.ToString() +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsSc_MouldStatusChangeBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldStatusChangeBillSub " +
+ " (HInterID,HEntryID,HBillNo_bak,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo_bak + "','" + oSub.HRemark + "',"
+ + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HMaterID + "," + oSub.HUnitID + "," + 0 + "," + oSub.HQty + "," + oSub.HStatusID_Old + "," + oSub.HStatusID_New + ") ");
+ }
+ sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+ //寰楀埌mainid
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID))
+ {
+ omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+ }
+ if (IsExistMainID(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HInterID, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew))
+ {
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ //
+ oCn.BeginTran();
+ //涓昏〃
+ //oCN.RunProc(@"Insert Into Sc_MouldStatusChangeBillMain
+ // (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
+ // ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID
+ // ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo)
+ //",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+
+ oCn.RunProc("Insert Into Sc_MouldStatusChangeBillMain " +
+ "(HBillType,HBillSubType,HInterID,HYear,HPeriod,HDate,HBillNo,HBillStatus" +
+ ",HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID" +
+ ",HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo" +
+ ") " +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() +
+ "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HDate + "','" + omodel.HBillNo +
+ "'," + omodel.HBillStatus + ",'" + omodel.HRemark + "','" + omodel.HBackRemark + "','" + omodel.HMaker +
+ "','" + omodel.HMakeDate + "','" + omodel.HMainSourceBillType + "'," + omodel.HMainSourceInterID +
+ "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "'," + omodel.HPrintQty +
+ "," + omodel.HEmpID + "," + omodel.HDeptID + ",'" + omodel.HReason + "','" + omodel.HExplanation +
+ "','" + omodel.HInnerBillNo + "'" + ") ");
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsSc_MouldStatusChangeBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_MouldStatusChangeBillSub " +
+ " (HInterID,HEntryID,HBillNo_bak,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HBillNo_bak + "','" + oSub.HRemark + "',"
+ + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ "," + oSub.HMaterID + "," + oSub.HUnitID + "," + 0 + "," + oSub.HQty + "," + oSub.HStatusID_Old + "," + oSub.HStatusID_New + ") ");
+ }
+ sReturn = "鏂板鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+ //鏄剧ず鍗曟嵁
+ public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //鏌ヨ涓昏〃
+ DataSet Ds;
+ Ds = oCn.RunProcReturn("Select * from Sc_MouldStatusChangeBillMain Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStatusChangeBillMain");
+ if (Ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "鍗曟嵁鏈壘鍒帮紒";
+ return false;
+ }
+ //鍥哄畾璧嬪��===========================================
+ omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
+ omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
+ omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
+ omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
+ omodel.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
+ omodel.HDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
+ omodel.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
+ omodel.HBillStatus = 1;
+ omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
+ omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
+ omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
+ omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]);
+ omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]);
+ omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]);
+ omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]);
+ omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]);
+ omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]);
+ omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]);
+ omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]);
+ omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]);
+ omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]);
+ omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
+ omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]);
+ omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]);
+ omodel.HMainSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillType"]);
+ omodel.HMainSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceInterID"]);
+ omodel.HMainSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMainSourceEntryID"]);
+ omodel.HMainSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMainSourceBillNo"]);
+ omodel.HPrintQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPrintQty"]);
+ //========================================================
+ omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
+ omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+ omodel.HReason = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HReason"]);
+ omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
+ omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
+
+
+ //寰幆
+ DataSet DsSub;
+ DsSub = oCn.RunProcReturn("Select * from Sc_MouldStatusChangeBillSub Where HInterID=" + lngBillKey.ToString(), "Sc_MouldStatusChangeBillSub");
+ DetailColl.Clear();//娓呯┖
+ for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsSc_MouldStatusChangeBillSub oSub = new Model.ClsSc_MouldStatusChangeBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
+ oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
+ oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
+ oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
+ oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]);
+ oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]);
+ oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
+ oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
+ oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
+ oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
+ oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
+ oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]);
+ oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
+ //===================================================
+ oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
+ oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
+ oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]);
+ oSub.HStatusID_Old = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStatusID_Old"]);
+ oSub.HStatusID_New = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HStatusID_New"]);
+
+ DetailColl.Add(oSub);
+ }
+ sReturn = "鏄剧ず鍗曟嵁鎴愬姛锛�";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+ }
+}
diff --git a/Model/Model.csproj b/Model/Model.csproj
index 175151e..e169de9 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -330,6 +330,8 @@
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CareFor_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CheckToolsType_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_CustLocation_Model.cs" />
+ <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_EquipStatus_Model.cs" />
+ <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_MouldStatus_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_Operator_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_RateType_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_Staff_Model.cs" />
@@ -531,6 +533,8 @@
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldEntrustOutPlanBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldLifeChangeBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldLifeChangeBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldLifeUseBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldLifeUseBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMaintainBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMaintainBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMaintainPlanBillMain.cs" />
@@ -565,6 +569,8 @@
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldReportBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldScrapRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldScrapRequestBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldStatusChangeBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldStatusChangeBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldStockBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldStockBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipConkBookBillMain.cs" />
@@ -592,6 +598,8 @@
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipSparepartsBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipSparepartsChangeBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipSparepartsChangeBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipStatusChangeBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipStatusChangeBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSc_EquipMaintainBillSub_Item.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSc_EquipMaintainPlanBillSub_Item.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSc_ICMOBillMain.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_EquipStatus_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_EquipStatus_Model.cs"
new file mode 100644
index 0000000..e9ef4fd
--- /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_EquipStatus_Model.cs"
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsGy_EquipStatus_Model : DBUtility.ClsGy_Base_Model
+ {
+ public DateTime HMakeTime { get; set; }
+ public DateTime HCheckTime { get; set; }
+ public DateTime HModifyTime { get; set; }
+ public DateTime HStopTime { get; set; }
+ public string HMakeEmp { get; set; }
+ public string HCheckEmp { get; set; }
+ public string HModifyEmp { get; set; }
+ public string HStopEmp { get; set; }
+ public int HUSEORGID { get; set; }
+ public int HCREATEORGID { get; set; }
+ }
+}
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_MouldStatus_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_MouldStatus_Model.cs"
new file mode 100644
index 0000000..0dc2b61
--- /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_MouldStatus_Model.cs"
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsGy_MouldStatus_Model : DBUtility.ClsGy_Base_Model
+ {
+ public DateTime HMakeTime { get; set; }
+ public DateTime HCheckTime { get; set; }
+ public DateTime HModifyTime { get; set; }
+ public DateTime HStopTime { get; set; }
+ public string HMakeEmp { get; set; }
+ public string HCheckEmp { get; set; }
+ public string HModifyEmp { get; set; }
+ public string HStopEmp { get; set; }
+ public int HUSEORGID { get; set; }
+ public int HCREATEORGID { get; set; }
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillMain.cs"
new file mode 100644
index 0000000..74c8488
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillMain.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldLifeUseBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HPrintQty; //鎵撳嵃娆℃暟
+ public Int64 HMangerID; //璐熻矗浜�
+ public Int64 HDeptID; //閮ㄩ棬
+ public string HReason; //璋冩暣鍘熷洜
+ public string HExplanation; //鎽樿
+ public string HInnerBillNo; //鍐呴儴鍗曟嵁鍙�
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillSub.cs"
new file mode 100644
index 0000000..cc41cb7
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldLifeUseBillSub.cs"
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldLifeUseBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public string HBillNo_bak; //鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+ public Int64 HItemSubID; //鑷鍒�(GUID)
+ public Int64 HMaterID; //鍣ㄥ叿
+ public Int64 HUnitID; //鏂板櫒鍏�
+ public double HDesignLife; // --璁捐瀵垮懡
+ public double HLeaveLife; //--鍘熷墿浣欏鍛�
+ public double HUseLife; // --鏈鑰楃敤
+ public double HNewLeaveLife;// --鏈鍓╀綑瀵垮懡
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillMain.cs"
new file mode 100644
index 0000000..3e42ec1
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillMain.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldStatusChangeBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HPrintQty; //鎵撳嵃娆℃暟
+ public Int64 HEmpID; //鐢宠浜�
+ public Int64 HDeptID; //閮ㄩ棬
+ public string HReason; //鍙樻洿鍘熷洜
+ public string HExplanation; //鎽樿
+ public string HInnerBillNo; //鍐呴儴鍗曟嵁鍙�
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillSub.cs"
new file mode 100644
index 0000000..9dc5178
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\346\250\241\345\205\267\347\256\241\347\220\206/ClsSc_MouldStatusChangeBillSub.cs"
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_MouldStatusChangeBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public string HBillNo_bak; //鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+ public Int64 HItemSubID; //鑷鍒�(GUID)
+ public Int64 HMaterID;
+ public Int64 HUnitID;
+ public decimal HQtyMust;
+ public decimal HQty;
+ public Int64 HStatusID_Old;
+ public Int64 HStatusID_New;
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillMain.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillMain.cs"
new file mode 100644
index 0000000..54966e8
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillMain.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSb_EquipStatusChangeBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HPrintQty; //鎵撳嵃娆℃暟
+ public Int64 HEmpID; //鐢宠浜�
+ public Int64 HDeptID; //閮ㄩ棬
+ public string HReason; //鍙樻洿鍘熷洜
+ public string HExplanation; //鎽樿
+ public string HInnerBillNo; //鍐呴儴鍗曟嵁鍙�
+ }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillSub.cs"
new file mode 100644
index 0000000..ea61e07
--- /dev/null
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/\350\256\276\345\244\207\347\256\241\347\220\206/ClsSb_EquipStatusChangeBillSub.cs"
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSb_EquipStatusChangeBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public string HBillNo_bak; //鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級
+ public Int64 HItemSubID; //鑷鍒�(GUID)
+ public Int64 HEquipID;
+ public Int64 HUnitID;
+ public decimal HQtyMust;
+ public decimal HQty;
+ public Int64 HStatusID_Old;
+ public Int64 HStatusID_New;
+ }
+}
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldLifeUseBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldLifeUseBillController.cs
new file mode 100644
index 0000000..95b6fba
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldLifeUseBillController.cs
@@ -0,0 +1,286 @@
+锘縰sing DBUtility;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+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.MJGL
+{
+ public class Sc_MouldLifeUseBillController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region [鍣ㄥ叿瀵垮懡鑰楃敤鍗曞垪琛╙
+ [Route("Sc_MouldLifeUseBill/list")]
+ [HttpGet]
+ public object list(string sWhere, string user)
+ {
+ try
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBillList order by HMainID asc", "h_v_Sc_MouldLifeUseBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_MouldLifeUseBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by HMainID asc";
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldLifeUseBillList");
+ }
+
+ 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 [鏍规嵁ID鏌ユ壘璁板綍]
+ [Route("Sc_MouldLifeUseBill/cx")]
+ [HttpGet]
+ public object cx(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldLifeUseBillList where HMainID =" + HInterID, "h_v_Sc_MouldLifeUseBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "false锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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("Sc_MouldLifeUseBill/MouldLifeUseBillEdit")]
+ [HttpPost]
+ public object MouldLifeUseBillEdit([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMain(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ 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;
+ }
+ }
+
+ public json AddBillMain(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string msg3 = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ int OperationType = int.Parse(sArray[2].ToString()); // 鏁版嵁绫诲瀷 1娣诲姞 3淇敼
+ string user = sArray[3].ToString();
+
+ try
+ {
+ msg2 = "[" + msg2.ToString() + "]";
+ List<ClsSc_MouldLifeUseBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLifeUseBillMain>>(msg2);
+
+ long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
+ string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
+ long HBillStatus = 1;//鍗曟嵁鐘舵��
+ DateTime HDate = mainList[0].HDate;//鏃ユ湡
+ string HRemark = mainList[0].HRemark;//澶囨敞
+ long HMangerID = mainList[0].HMangerID;//璐熻矗浜�
+ long HDeptID = mainList[0].HDeptID;//閮ㄩ棬
+ string HReason = mainList[0].HReason;//鍙樻洿鍘熷洜
+ string HExplanation = mainList[0].HExplanation;//鎽樿
+ string HMaker = user;//鍒跺崟浜�
+
+ DateTime dt = DateTime.Now;
+
+
+
+ //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POOrderBillList");
+
+ if ((OperationType == 1 || OperationType == 2))//鏂板 && ds.Tables[0].Rows.Count == 0
+ {
+ //DataSet Ds;
+ //Int64 NewHInterID = 1;
+ //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain");
+ //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0)
+ //{
+ // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
+ // NewHInterID += 1;
+ //}
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sc_MouldLifeUseBillMain
+ (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
+ ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID
+ ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HMangerID,HDeptID,HReason,HExplanation,HInnerBillNo)
+ values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3845 + "','" +
+ mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark +
+ "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID +
+ "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HMangerID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")");
+ }
+ else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0
+ { //淇敼
+ oCN.RunProc("update Sc_MouldLifeUseBillMain set " +
+ "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason +
+ "',HExplanation='" + HExplanation + "',HMangerID=" + HMangerID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID);
+
+ //鍒犻櫎瀛愯〃
+ oCN.RunProc("delete from Sc_MouldLifeUseBillSub where HInterID='" + HInterID + "'");
+ }
+ //淇濆瓨瀛愯〃
+ objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo);
+
+ if (objJsonResult.code == "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ public json AddBillSub(string msg3, long HInterID, int OperationType, string HBillNo)
+ {
+ List<ClsSc_MouldLifeUseBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldLifeUseBillSub>>(msg3);
+
+
+
+ int i = 0;
+ foreach (ClsSc_MouldLifeUseBillSub oSub in DetailColl)
+ {
+ i++;
+
+ DataSet Cs;
+ Int64 NewHEntryID = 1;
+ Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldLifeUseBillSub", "Sc_MouldLifeUseBillSub");
+ if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
+ {
+ NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
+ NewHEntryID += 1;
+ }
+
+ oCN.RunProc($@"Insert into Sc_MouldLifeUseBillSub
+ (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty
+ ,HRelationMoney,HMaterID,HUnitID,HDesignLife,HLeaveLife,HUseLife,HNewLeaveLife)
+ values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID}
+ ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID},{oSub.HUnitID},{oSub.HDesignLife},{oSub.HLeaveLife},{oSub.HUseLife},{oSub.HNewLeaveLife})");
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ #endregion
+
+ #region [鍒犻櫎]
+ [Route("Sc_MouldLifeUseBill/Delete")]
+ [HttpGet]
+ public object Delete(string HInterID, string user)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Sc_MouldLifeUseBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Sc_MouldLifeUseBillSub where HInterID = " + HInterID);
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldScrapRequestBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldScrapRequestBillController.cs
new file mode 100644
index 0000000..cc4c6eb
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldScrapRequestBillController.cs
@@ -0,0 +1,293 @@
+锘縰sing DBUtility;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+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.MJGL
+{
+ public class Sc_MouldScrapRequestBillController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region [鍣ㄥ叿鎶ュ簾鐢宠鍗曞垪琛╙
+ [Route("Sc_MouldScrapRequestBill/list")]
+ [HttpGet]
+ public object list(string sWhere, string user)
+ {
+ try
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList order by HMainID asc", "h_v_Sc_MouldScrapRequestBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_MouldScrapRequestBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by HMainID asc";
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldScrapRequestBillList");
+ }
+
+ 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 [鏍规嵁ID鏌ユ壘璁板綍]
+ [Route("Sc_MouldScrapRequestBill/cx")]
+ [HttpGet]
+ public object cx(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldScrapRequestBillList where hmainid =" + HInterID, "h_v_Sc_MouldScrapRequestBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "false锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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("Sc_MouldScrapRequestBill/MouldScrapRequestBillEdit")]
+ [HttpPost]
+ public object MouldScrapRequestBillEdit([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMain(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ 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;
+ }
+ }
+
+ public json AddBillMain(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string msg3 = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ int OperationType = int.Parse(sArray[2].ToString()); // 鏁版嵁绫诲瀷 1娣诲姞 3淇敼
+ string user = sArray[3].ToString();
+
+ try
+ {
+ msg2 = "[" + msg2.ToString() + "]";
+ List<ClsSc_MouldScrapRequestBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldScrapRequestBillMain>>(msg2);
+
+ long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
+ string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
+ long HBillStatus = 1;//鍗曟嵁鍙�
+ long HPRDORGID = mainList[0].HPRDORGID;//缁勭粐
+ DateTime HDate = mainList[0].HDate;//鏃ユ湡
+ string HRemark = mainList[0].HRemark;//澶囨敞
+ long HEmpID = mainList[0].HEmpID;//鐢宠浜�
+ long HDeptID = mainList[0].HDeptID;//閮ㄩ棬
+ long HMangerID = mainList[0].HMangerID;//璐熻矗浜�
+ long HWHID = mainList[0].HWHID;//鎶ュ簾浠撳簱
+ string HReason = mainList[0].HReason;//鎶ュ簾鍘熷洜
+ string HMaker = user;//鍒跺崟浜�
+
+ DateTime dt = DateTime.Now;
+
+
+
+ //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POOrderBillList");
+
+ if ((OperationType == 1 || OperationType == 2))//鏂板 && ds.Tables[0].Rows.Count == 0
+ {
+ //DataSet Ds;
+ //Int64 NewHInterID = 1;
+ //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain");
+ //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0)
+ //{
+ // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
+ // NewHInterID += 1;
+ //}
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sc_MouldScrapRequestBillMain
+ (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
+ ,HReason,HExplanation,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceInterID
+ ,HMainSourceEntryID,HMainSourceBillNo,HEmpID,HDeptID,HMangerID,HWHID,HCheckItemNowID
+ ,HCheckItemNextID,HCheckFlowID,HBacker,HChecker,HUpDater,HCloseMan,HCloseType,HDeleteMan,HInnerBillNo)
+ values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3823 + "','" +
+ 3823 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HReason + "','" + mainList[0].HExplanation + "','" + mainList[0].HRemark +
+ "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "'," + mainList[0].HMainSourceInterID +
+ "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HEmpID + "," + mainList[0].HDeptID + "," + mainList[0].HMangerID + "," + mainList[0].HWHID + ",0,0,0" + ",'" + mainList[0].HBacker + "','" + mainList[0].HChecker + "','" + mainList[0].HUpDater + "','" + mainList[0].HCloseMan + "'," + 0 + ",'" + mainList[0].HDeleteMan + "','" + mainList[0].HInnerBillNo + "'" + ")");
+ }
+ else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0
+ { //淇敼
+ oCN.RunProc("update Sc_MouldScrapRequestBillMain set " +
+ "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" +
+ ",HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + ",HMangerID=" + HMangerID +
+ ",HReason='" + HReason + "'" +
+ ",HWHID=" + HWHID + " where HInterID=" + HInterID);
+
+ //鍒犻櫎瀛愯〃
+ oCN.RunProc("delete from Sc_MouldScrapRequestBillSub where HInterID='" + HInterID + "'");
+ }
+ //淇濆瓨瀛愯〃
+ objJsonResult = AddBillSub(msg3, HInterID, OperationType);
+
+ if (objJsonResult.code == "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ public json AddBillSub(string msg3, long HInterID, int OperationType)
+ {
+ List<ClsSc_MouldScrapRequestBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldScrapRequestBillSub>>(msg3);
+
+
+
+ int i = 0;
+ foreach (ClsSc_MouldScrapRequestBillSub oSub in DetailColl)
+ {
+ i++;
+
+ DataSet Cs;
+ Int64 NewHEntryID = 1;
+ Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldScrapRequestBillSub", "Sc_MouldScrapRequestBillSub");
+ if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
+ {
+ NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
+ NewHEntryID += 1;
+ }
+
+ oCN.RunProc($@"Insert into Sc_MouldScrapRequestBillSub
+ (HInterID,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty
+ ,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HWHID)
+ values({HInterID},{NewHEntryID},'{oSub.HRemark}',{oSub.HSourceInterID}
+ ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID}
+ ,{oSub.HPropertyID},{oSub.HSecUnitID},{oSub.HSecUnitRate},{oSub.HUnitID},0,{oSub.HQty},{oSub.HPrice},{oSub.HMoney},{oSub.HDesignLife}
+ ,{oSub.HLeaveLife},{oSub.HWHID})");
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ #endregion
+
+ #region [鍒犻櫎]
+ [Route("Sc_MouldScrapRequestBill/Delete")]
+ [HttpGet]
+ public object Delete(string HInterID, string user)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Sc_MouldScrapRequestBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Sc_MouldScrapRequestBillSub where HInterID = " + HInterID);
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/MJGL/Sc_MouldStatusChangeBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldStatusChangeBillController.cs
new file mode 100644
index 0000000..9ebcb05
--- /dev/null
+++ b/WebAPI/Controllers/MJGL/Sc_MouldStatusChangeBillController.cs
@@ -0,0 +1,286 @@
+锘縰sing DBUtility;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+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.MJGL
+{
+ public class Sc_MouldStatusChangeBillController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region [鍣ㄥ叿鐘舵�佸彉鏇村崟鍒楄〃]
+ [Route("Sc_MouldStatusChangeBill/list")]
+ [HttpGet]
+ public object list(string sWhere, string user)
+ {
+ try
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldStatusChangeBillList order by HMainID asc", "h_v_Sc_MouldStatusChangeBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_MouldStatusChangeBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by HMainID asc";
+ ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldStatusChangeBillList");
+ }
+
+ 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 [鏍规嵁ID鏌ユ壘璁板綍]
+ [Route("Sc_MouldStatusChangeBill/cx")]
+ [HttpGet]
+ public object cx(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from h_v_Sc_MouldStatusChangeBillList where HMainID =" + HInterID, "h_v_Sc_MouldStatusChangeBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "false锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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("Sc_MouldStatusChangeBill/MouldStatusChangeBillEdit")]
+ [HttpPost]
+ public object BarCodeStatusChangeBillEdit([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMain(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ 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;
+ }
+ }
+
+ public json AddBillMain(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string msg3 = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ int OperationType = int.Parse(sArray[2].ToString()); // 鏁版嵁绫诲瀷 1娣诲姞 3淇敼
+ string user = sArray[3].ToString();
+
+ try
+ {
+ msg2 = "[" + msg2.ToString() + "]";
+ List<ClsSc_MouldStatusChangeBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldStatusChangeBillMain>>(msg2);
+
+ long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
+ string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
+ long HBillStatus = 1;//鍗曟嵁鐘舵��
+ DateTime HDate = mainList[0].HDate;//鏃ユ湡
+ string HRemark = mainList[0].HRemark;//澶囨敞
+ long HEmpID = mainList[0].HEmpID;//璐熻矗浜�
+ long HDeptID = mainList[0].HDeptID;//閮ㄩ棬
+ string HReason = mainList[0].HReason;//鍙樻洿鍘熷洜
+ string HExplanation = mainList[0].HExplanation;//鎽樿
+ string HMaker = user;//鍒跺崟浜�
+
+ DateTime dt = DateTime.Now;
+
+
+
+ //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POOrderBillList");
+
+ if ((OperationType == 1 || OperationType == 2))//鏂板 && ds.Tables[0].Rows.Count == 0
+ {
+ //DataSet Ds;
+ //Int64 NewHInterID = 1;
+ //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain");
+ //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0)
+ //{
+ // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
+ // NewHInterID += 1;
+ //}
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sc_MouldStatusChangeBillMain
+ (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
+ ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID
+ ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo)
+ values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3844 + "','" +
+ mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark +
+ "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID +
+ "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")");
+ }
+ else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0
+ { //淇敼
+ oCN.RunProc("update Sc_MouldStatusChangeBillMain set " +
+ "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason +
+ "',HExplanation='" + HExplanation + "',HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID);
+
+ //鍒犻櫎瀛愯〃
+ oCN.RunProc("delete from Sc_MouldStatusChangeBillSub where HInterID='" + HInterID + "'");
+ }
+ //淇濆瓨瀛愯〃
+ objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo);
+
+ if (objJsonResult.code == "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ public json AddBillSub(string msg3, long HInterID, int OperationType,string HBillNo)
+ {
+ List<ClsSc_MouldStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSc_MouldStatusChangeBillSub>>(msg3);
+
+
+
+ int i = 0;
+ foreach (ClsSc_MouldStatusChangeBillSub oSub in DetailColl)
+ {
+ i++;
+
+ DataSet Cs;
+ Int64 NewHEntryID = 1;
+ Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sc_MouldStatusChangeBillSub", "Sc_MouldStatusChangeBillSub");
+ if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
+ {
+ NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
+ NewHEntryID += 1;
+ }
+
+ oCN.RunProc($@"Insert into Sc_MouldStatusChangeBillSub
+ (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty
+ ,HRelationMoney,HMaterID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New)
+ values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID}
+ ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HMaterID},{oSub.HUnitID},{0},{oSub.HQty},{oSub.HStatusID_Old},{oSub.HStatusID_New})");
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ #endregion
+
+ #region [鍒犻櫎]
+ [Route("Sc_MouldStatusChangeBill/Delete")]
+ [HttpGet]
+ public object Delete(string HInterID, string user)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Sc_MouldStatusChangeBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Sc_MouldStatusChangeBillSub where HInterID = " + HInterID);
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipStatusChangeBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipStatusChangeBillController.cs
new file mode 100644
index 0000000..ad4bd68
--- /dev/null
+++ b/WebAPI/Controllers/SBGL/Sb_EquipStatusChangeBillController.cs
@@ -0,0 +1,287 @@
+锘縰sing DBUtility;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+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.SBGL
+{
+ public class Sb_EquipStatusChangeBillController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region [璁惧鐘舵�佸彉鏇村崟鍒楄〃]
+ [Route("Sb_EquipStatusChangeBill/list")]
+ [HttpGet]
+ public object list(string sWhere, string user)
+ {
+ try
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStatusChangeBillList order by HMainID asc", "h_v_Sb_EquipStatusChangeBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sb_EquipStatusChangeBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by HMainID asc";
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipStatusChangeBillList");
+ }
+
+ 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 [鏍规嵁ID鏌ユ壘璁板綍]
+ [Route("Sb_EquipStatusChangeBill/cx")]
+ [HttpGet]
+ public object cx(long HInterID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStatusChangeBillList where HMainID =" + HInterID, "h_v_Sb_EquipStatusChangeBillList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "false锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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("Sb_EquipStatusChangeBill/EquipStatusChangeBillEdit")]
+ [HttpPost]
+ public object BarCodeStatusChangeBillEdit([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ oCN.BeginTran();
+ //淇濆瓨涓昏〃
+ objJsonResult = AddBillMain(msg1);
+ if (objJsonResult.code == "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ 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;
+ }
+ }
+
+ public json AddBillMain(string msg1)
+ {
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString(); //涓昏〃鏁版嵁
+ string msg3 = sArray[1].ToString(); //瀛愯〃鏁版嵁
+ int OperationType = int.Parse(sArray[2].ToString()); // 鏁版嵁绫诲瀷 1娣诲姞 3淇敼
+ string user = sArray[3].ToString();
+
+ try
+ {
+ msg2 = "[" + msg2.ToString() + "]";
+ List<ClsSb_EquipStatusChangeBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSb_EquipStatusChangeBillMain>>(msg2);
+
+ long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
+ string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
+ long HBillStatus = 1;//鍗曟嵁鐘舵��
+ DateTime HDate = mainList[0].HDate;//鏃ユ湡
+ string HRemark = mainList[0].HRemark;//澶囨敞
+ long HEmpID = mainList[0].HEmpID;//鐢宠浜�
+ long HDeptID = mainList[0].HDeptID;//閮ㄩ棬
+ string HReason = mainList[0].HReason;//鍙樻洿鍘熷洜
+ string HExplanation = mainList[0].HExplanation;//鎽樿
+ string HMaker = user;//鍒跺崟浜�
+
+ DateTime dt = DateTime.Now;
+
+
+
+ //ds = oCN.RunProcReturn("select * from h_v_IF_POOrderBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_IF_POOrderBillList");
+
+ if ((OperationType == 1 || OperationType == 2))//鏂板 && ds.Tables[0].Rows.Count == 0
+ {
+ //DataSet Ds;
+ //Int64 NewHInterID = 1;
+ //Ds = oCN.RunProcReturn("select MAX(HInterID)HInterID from Cg_POOrderBillMain", "Cg_POOrderBillMain");
+ //if (Ds.Tables[0].Rows.Count != 0 && ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString()) != 0)
+ //{
+ // NewHInterID = ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
+ // NewHInterID += 1;
+ //}
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sb_EquipStatusChangeBillMain
+ (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus
+ ,HRemark,HBackRemark,HMaker,HMakeDate,HMainSourceBillType,HMainSourceInterID
+ ,HMainSourceEntryID,HMainSourceBillNo,HPrintQty,HEmpID,HDeptID,HReason,HExplanation,HInnerBillNo)
+ values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 3844 + "','" +
+ mainList[0].HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + mainList[0].HRemark +
+ "','" + mainList[0].HBackRemark + "','" + mainList[0].HMaker + "','" + dt + "','" + mainList[0].HMainSourceBillType + "'," + mainList[0].HMainSourceInterID +
+ "," + mainList[0].HMainSourceEntryID + ",'" + mainList[0].HMainSourceBillNo + "'," + mainList[0].HPrintQty + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + HReason + "','" + HExplanation + "','" + mainList[0].HInnerBillNo + "'" + ")");
+ }
+ else if (OperationType == 3)//|| ds.Tables[0].Rows.Count != 0
+ { //淇敼
+ oCN.RunProc("update Sb_EquipStatusChangeBillMain set " +
+ "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + ",HReason='" + HReason +
+ "',HExplanation='" + HExplanation + "',HEmpID=" + HEmpID + ",HDeptID=" + HDeptID + " where HInterID=" + HInterID);
+
+ //鍒犻櫎瀛愯〃
+ oCN.RunProc("delete from Sb_EquipStatusChangeBillSub where HInterID='" + HInterID + "'");
+ }
+ //淇濆瓨瀛愯〃
+ objJsonResult = AddBillSub(msg3, HInterID, OperationType, HBillNo);
+
+ if (objJsonResult.code == "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = objJsonResult.Message;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ public json AddBillSub(string msg3, long HInterID, int OperationType, string HBillNo)
+ {
+ List<ClsSb_EquipStatusChangeBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsSb_EquipStatusChangeBillSub>>(msg3);
+
+
+
+ int i = 0;
+ foreach (ClsSb_EquipStatusChangeBillSub oSub in DetailColl)
+ {
+ i++;
+
+ DataSet Cs;
+ Int64 NewHEntryID = 1;
+ Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Sb_EquipStatusChangeBillSub", "Sb_EquipStatusChangeBillSub");
+ if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0)
+ {
+ NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
+ NewHEntryID += 1;
+ }
+
+ oCN.RunProc($@"Insert into Sb_EquipStatusChangeBillSub
+ (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty
+ ,HRelationMoney,HEquipID,HUnitID,HQtyMust,HQty,HStatusID_Old,HStatusID_New)
+ values({HInterID},{NewHEntryID},'{ HBillNo }','{oSub.HRemark}',{oSub.HSourceInterID}
+ ,{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HEquipID},{oSub.HUnitID},{0},{oSub.HQty},{oSub.HStatusID_Old},{oSub.HStatusID_New})");
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ #endregion
+
+ #region [鍒犻櫎]
+ [Route("Sb_EquipStatusChangeBill/Delete")]
+ [HttpGet]
+ public object Delete(string HInterID, string user)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Sb_EquipStatusChangeBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Sb_EquipStatusChangeBillSub where HInterID = " + HInterID);
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
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_EquipStatusController.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_EquipStatusController.cs"
new file mode 100644
index 0000000..45a9080
--- /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_EquipStatusController.cs"
@@ -0,0 +1,311 @@
+锘縰sing 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_EquipStatusController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region 璁惧鐘舵�� 鍒楄〃
+ [Route("Gy_EquipStatus/Gy_EquipStatusList")]
+ [HttpGet]
+ public object Gy_EquipStatusList(string sWhere, string user, string Organization)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql1 = string.Format(@"select * from h_v_Gy_EquipStatus where 浣跨敤缁勭粐='" + Organization + "'");
+
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipStatus");
+
+ //娣诲姞鍒楀悕
+ 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.list = columnNameList;
+ 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_EquipStatus/Gy_EquipStatusEdit")]
+ [HttpPost]
+ public object Gy_EquipStatusEdit([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 msg2 = sArray[1].ToString();
+ //string msg_HUSEORGID = sArray[2].ToString();
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ListModels oListModels = new ListModels();
+
+ try
+ {
+ DAL.ClsGy_EquipStatus_Ctl oBill = new DAL.ClsGy_EquipStatus_Ctl();
+ List<Model.ClsGy_EquipStatus_Model> lsmain = new List<Model.ClsGy_EquipStatus_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Gy_EquipStatus(msg1);
+ foreach (Model.ClsGy_EquipStatus_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_EquipStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_EquipStatus");
+ if (oItem.HItemID == 0)
+ {
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+
+
+ //鏂板鏃跺垽鏂�
+ #region 鐖剁骇鏍¢獙鏂规硶锛坅pi璋冪敤鍏堟敞閲婃帀锛岋級
+ /*
+ if (oItem.HItemID == 0)
+ {
+ if (ds == null || ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ else//缂栬緫鏃跺垽鏂�
+ {
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ */
+ #endregion
+ //寰楀埌鐭唬鐮�
+ 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_HUSEORGID); //缁勭粐id
+ oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+ oItem.HEndFlag = true;//鏈骇鏍囧織
+ oItem.HLevel = 1; //绛夌骇 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
+ oBill.oModel = oItem;
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.oModel.HItemID == 0)
+ {
+ bResult = oBill.AddNew();
+ }
+ else
+ {
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 璁惧鐘舵�� 鍒犻櫎
+ [Route("Gy_EquipStatus/Delete")]
+ [HttpGet]
+ public object Delete(string HItemID, string user)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Gy_EquipStatus where HItemID=" + HItemID, "Gy_EquipStatus");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ if (HStopflag)
+ {
+ oCN.RollBack();//鍥炴粴浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏁版嵁宸茬鐢ㄦ棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.RunProc("delete from Gy_EquipStatus where HItemID=" + HItemID);
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
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_MouldStatusController.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_MouldStatusController.cs"
new file mode 100644
index 0000000..6b8e122
--- /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_MouldStatusController.cs"
@@ -0,0 +1,313 @@
+锘縰sing 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_MouldStatusController : ApiController
+ {
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region 鍣ㄥ叿鐘舵�� 鍒楄〃
+ [Route("Gy_MouldStatus/Gy_MouldStatusList")]
+ [HttpGet]
+ public object Gy_MouldStatusList(string sWhere, string user, string Organization)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ string sql1 = string.Format(@"select * from h_v_Gy_MouldStatus where 浣跨敤缁勭粐='" + Organization + "'");
+
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldStatus");
+
+ //娣诲姞鍒楀悕
+ 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.list = columnNameList;
+ 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_MouldStatus/Gy_MouldStatusEdit")]
+ [HttpPost]
+ public object Gy_MouldStatusEdit([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 msg2 = sArray[1].ToString();
+ //string msg_HUSEORGID = sArray[2].ToString();
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ListModels oListModels = new ListModels();
+
+ try
+ {
+ DAL.ClsGy_MouldStatus_Ctl oBill = new DAL.ClsGy_MouldStatus_Ctl();
+ List<Model.ClsGy_MouldStatus_Model> lsmain = new List<Model.ClsGy_MouldStatus_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Gy_MouldStatus(msg1);
+ foreach (Model.ClsGy_MouldStatus_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_MouldStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_MouldStatus");
+ if (oItem.HItemID == 0)
+ {
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+
+
+ //鏂板鏃跺垽鏂�
+ #region 鐖剁骇鏍¢獙鏂规硶锛坅pi璋冪敤鍏堟敞閲婃帀锛岋級
+ /*
+ if (oItem.HItemID == 0)
+ {
+ if (ds == null || ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ else//缂栬緫鏃跺垽鏂�
+ {
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ */
+ #endregion
+ //寰楀埌鐭唬鐮�
+ 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_HUSEORGID); //缁勭粐id
+ oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+ oItem.HEndFlag = true;//鏈骇鏍囧織
+ oItem.HLevel = 1; //绛夌骇 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
+ oBill.oModel = oItem;
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.oModel.HItemID == 0)
+ {
+ bResult = oBill.AddNew();
+ }
+ else
+ {
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿鐘舵�� 鍒犻櫎
+ [Route("Gy_MouldStatus/Delete")]
+ [HttpGet]
+ public object Delete(string HItemID, string user)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Gy_MouldStatus where HItemID=" + HItemID, "Gy_MouldStatus");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ if (HStopflag)
+ {
+ oCN.RollBack();//鍥炴粴浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏁版嵁宸茬鐢ㄦ棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.RunProc("delete from Gy_MouldStatus where HItemID=" + HItemID);
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index cdd2748..5de991c 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -1016,6 +1016,30 @@
}
/// <summary>
+ /// 澶勭悊鍣ㄥ叿鐘舵�佽〃鐨刯son
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsGy_MouldStatus_Model> getObjectByJson_Gy_MouldStatus(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsGy_MouldStatus_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldStatus_Model>>(jsonString);
+ return list;
+ }
+
+ /// <summary>
+ /// 澶勭悊璁惧鐘舵�佽〃鐨刯son
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsGy_EquipStatus_Model> getObjectByJson_Gy_EquipStatus(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsGy_EquipStatus_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_EquipStatus_Model>>(jsonString);
+ return list;
+ }
+
+ /// <summary>
/// 澶勭悊鍗曟嵁绫诲瀷琛ㄧ殑json
/// </summary>
/// <param name="jsonString"></param>
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 9e9911b..522dcb0 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -392,9 +392,13 @@
<Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" />
<Compile Include="Controllers\CJGL\Sc_WorkBillAutoSortBillMainController.cs" />
<Compile Include="Controllers\Gy_MateMouldController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldLifeUseBillController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldScrapRequestBillController.cs" />
+ <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" />
<Compile Include="Controllers\Pay_ReportController.cs" />
<Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" />
<Compile Include="Controllers\SBGL\Sb_EquipSparepartsChangeBillController.cs" />
+ <Compile Include="Controllers\SBGL\Sb_EquipStatusChangeBillController.cs" />
<Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" />
<Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱DataHelper.cs" />
<Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱JIT_Cg_PODemandPlanBillController.cs" />
@@ -452,7 +456,9 @@
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_COMMONCONTACTBillController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_CustLocationController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_DutyBillController.cs" />
+ <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_EquipStatusController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MatePriceSupController.cs" />
+ <Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_MouldStatusController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_OperatorController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_PaymentConditionListBillController.cs" />
<Compile Include="Controllers\鍩虹璧勬枡\鍩虹璧勬枡\Gy_RateTypeController.cs" />
@@ -902,10 +908,12 @@
<Folder Include="Views\Gy_ConkType\" />
<Folder Include="Views\Gy_CustLocation\" />
<Folder Include="Views\Gy_DutyBill\" />
+ <Folder Include="Views\Gy_EquipStatus\" />
<Folder Include="Views\Gy_EquipType\" />
<Folder Include="Views\Gy_ICBomBill\" />
<Folder Include="Views\Gy_MateMould\" />
<Folder Include="Views\Gy_MatePriceSup\" />
+ <Folder Include="Views\Gy_MouldStatus\" />
<Folder Include="Views\Gy_Operator\" />
<Folder Include="Views\Gy_PackType\" />
<Folder Include="Views\Gy_PaymentConditionListBill\" />
@@ -942,13 +950,17 @@
<Folder Include="Views\Sb_EquipRepairSendWorkBill\" />
<Folder Include="Views\Sb_EquipSparepartsBill\" />
<Folder Include="Views\Sb_EquipSparepartsChangeBill\" />
+ <Folder Include="Views\Sb_EquipStatusChangeBill\" />
<Folder Include="Views\Sc_CallGoodsBackRequestBill\" />
<Folder Include="Views\Sc_ComplementGoodBill\" />
<Folder Include="Views\Sc_ComplementGoodBill_ZXBZ\" />
<Folder Include="Views\Sc_ComplementGoods\" />
<Folder Include="Views\Sc_JIT_ComplementGoodBill\" />
+ <Folder Include="Views\Sc_MouldLifeUseBill\" />
<Folder Include="Views\Sc_MouldRepairOutBill\" />
<Folder Include="Views\Sc_MouldRepairSendWorkBill\" />
+ <Folder Include="Views\Sc_MouldScrapRequestBill\" />
+ <Folder Include="Views\Sc_MouldStatusChangeBill\" />
<Folder Include="Views\Sc_WorkBillAutoSortBillMain\" />
<Folder Include="Views\Sc_WorkBillSortBill\" />
<Folder Include="Views\Sc_WorkDemandPlanBill\" />
--
Gitblit v1.9.1