From 291668738caa2b9faac57cf6d1da7762efefb95d Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期三, 10 十二月 2025 17:16:57 +0800
Subject: [PATCH] 1
---
WebAPI/ListModels.cs | 25 +
Model/基础资料/基础资料/ClsCg_ContractTransportBillMain.cs | 22 +
WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs | 2
DAL/基础资料/公用基础资料/ClsCg_ContractTransportBillList.cs | 332 +++++++++++++++++++++++
DAL/DAL.csproj | 3
Model/Model.csproj | 6
Model/基础资料/基础资料/ClsCg_ContractTransportBillSub.cs | 27 +
WebAPI/WebAPI.csproj | 2
WebAPI/Controllers/Cg_ContractTransportBillListController.cs | 386 +++++++++++++++++++++++++++
9 files changed, 799 insertions(+), 6 deletions(-)
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 8dc9de5..425a405 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -85,6 +85,7 @@
<Compile Include="浠撳簱绠$悊\灏忚溅閿佸畾\ClsKf_TrolleyPositionBill.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_Driver_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_Car_Ctl_2.cs" />
+ <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsCg_ContractTransportBillList.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_PatrolCheckItemMethod_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_PatrolCheckItemClass_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_MaintainClass_Ctl.cs" />
@@ -113,7 +114,7 @@
<Compile Include="鐢熶骇绠$悊\鎺掍骇閿佸畾鐢宠鍗昞ClsJIT_LockRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBill.cs" />
- <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMoveStockRequestBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipPatrolCheckPlanBill.cs" />
<Compile Include="鐢熶骇绠$悊\璁惧绠$悊\ClsSb_EquipPatrolCheckBill.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/ClsCg_ContractTransportBillList.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/ClsCg_ContractTransportBillList.cs"
new file mode 100644
index 0000000..4e2de6c
--- /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/ClsCg_ContractTransportBillList.cs"
@@ -0,0 +1,332 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsCg_ContractTransportBillList : DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsCg_ContractTransportBillMain omodel = new Model.ClsCg_ContractTransportBillMain();
+ public List<Model.ClsCg_ContractTransportBillSub> DetailColl = new List<Model.ClsCg_ContractTransportBillSub>();
+
+ public ClsCg_ContractTransportBillList()
+ {
+ base.MvarItemKeySub = "Cg_ContractTransportBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey= "Cg_ContractTransportBillMain";
+ base.MvarReportTitle="鎵胯繍鍚堝悓";
+ base.BillType = "1117";
+ base.HBillSubType = "1117";
+
+ }
+
+ #region 鍥哄畾浠g爜
+
+ ~ClsCg_ContractTransportBillList()
+ {
+ DetailColl = null;
+ }
+
+ #endregion 鑷畾涔夋柟娉�
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+
+ oCn.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ DataSet ds = oCn.RunProcReturn("Exec h_p_Cg_ContractTransportBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Cg_ContractTransportBill_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ return false;
+ }
+ //=========================================================
+
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate Cg_ContractTransportBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ //",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + omodel.HMaker + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+
+ ",HContractDate ='" + omodel.HContractDate.ToString() +"',"+ "HSupID = "+ omodel.HSupID.ToString()+","+ "HContractNumber='"+ omodel.HContractNumber.ToString()+"',"+ "HContractName='"+ omodel.HContractName.ToString() + "',"+
+ "HAddress='"+ omodel.HAddress.ToString() + "',"+ "HSSID="+ omodel.HSSID.ToString() + "," + "HCurID=" + omodel.HCurID.ToString() + "," + "HEmpID=" + omodel.HEmpID.ToString() + "," + "HDeptID=" + omodel.HDeptID.ToString() + ""+
+ // ",HExplanation ='" + omodel.HExplanation.ToString() +"'"+ ",HInnerBillNo ='" + omodel.HInnerBillNo.ToString() + "'"+
+
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsCg_ContractTransportBillSub oSub in DetailColl)
+ {
+ string subSql = "insert into Cg_ContractTransportBillSub " +
+ "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+ ",HTransportLineName,HBeginAddr,HEndAddr,HTransportCar,HDistance,HTransportTimes ,HTransportTyep ,HMoney ,HMoney_His) " +
+ " values(" +
+ "" + omodel.HInterID.ToString() +
+ "," + oSub.HEntryID.ToString() +
+ "," + oSub.HSourceInterID +
+ "," + oSub.HSourceEntryID +
+ ",'" + (oSub.HSourceBillNo??"a") +
+ "','" + (oSub.HSourceBillType??"a") +
+ "','" + (oSub.HTransportLineName ?? "") +
+ "','" + (oSub.HBeginAddr ) +
+ "','" + (oSub.HEndAddr ) +
+ "','" + (oSub.HTransportCar) +
+ "','" + (oSub.HDistance ?? "") +
+ "','" + (oSub.HTransportTimes ?? "") +
+ "','" + (oSub.HTransportTyep ?? "") +
+ "','" + (oSub.HMoney??"") +
+ "','" + (oSub.HMoney_His??"") +
+ "')";
+ oCn.RunProc(subSql);
+ }
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Cg_ContractTransportBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Cg_ContractTransportBill_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
+ sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+
+ DataSet ds;
+
+ oCn.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ ds = oCn.RunProcReturn("Exec h_p_Cg_ContractTransportBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Cg_ContractTransportBill_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ sReturn = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ return false;
+ }
+ //=========================================================
+
+
+ //妫�鏌ヤ富琛ㄥ唴鐮佹槸鍚﹂噸澶嶏紝鑻ラ噸澶嶅垯閲嶆柊鐢熸垚骞剁户缁鏌ワ紝鐩村埌涓嶅啀閲嶅
+ while (true)
+ {
+ ds = oCn.RunProcReturn("select * from Cg_ContractTransportBillMain where HInterID = " + omodel.HInterID, "Cg_ContractTransportBillMain");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ //涓昏〃
+ string mainSql = "insert into Cg_ContractTransportBillMain" +
+ "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HRemark,HMaker,HMakeDate" +
+ ",HContractDate,HSupID,HContractNumber,HContractName,HAddress,HSSID,HCurID,HEmpID,HDeptID,HExplanation,HInnerBillNo) " +
+ "values(" +
+ "" + (omodel.HYear.ToString() != "0" ? omodel.HYear.ToString() : DateTime.Now.Year.ToString()) +
+ "," + omodel.HPeriod.ToString() +
+ ",'" + this.BillType +
+ "','" + this.HBillSubType +
+ "'," + omodel.HInterID +
+ ",'" + omodel.HDate +
+ "','" + omodel.HBillNo +
+ "','" + omodel.HRemark +
+ "','" + omodel.HMaker +
+ "','" + omodel.HMakeDate +
+ "','" + omodel.HContractDate +
+ "','" + omodel.HSupID +
+ "','" + omodel.HContractNumber +
+ "','" + omodel.HContractName +
+ "','" + omodel.HAddress +
+ "','" + omodel.HSSID +
+ "','" + omodel.HCurID +
+ "','" + omodel.HEmpID +
+ "','" + omodel.HDeptID +
+ "','" + omodel.HExplanation +
+ "','" + omodel.HInnerBillNo +
+ "')";
+
+ oCn.RunProc(mainSql);
+
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsCg_ContractTransportBillSub oSub in DetailColl)
+ {
+ string subSql = "insert into Cg_ContractTransportBillSub " +
+ "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRemark" +
+ ",HTransportLineName,HBeginAddr,HEndAddr,HTransportCar,HDistance,HTransportTimes,HTransportTyep,HMoney,HMoney_His) " +
+ " values(" +
+ "" + omodel.HInterID.ToString() +
+ "," + oSub.HEntryID.ToString() +
+ "," + oSub.HSourceInterID +
+ "," + oSub.HSourceEntryID +
+ ",'" + oSub.HSourceBillNo +
+ "','" + oSub.HSourceBillType +
+ "','" + oSub.HRemark +
+ "','" + oSub.HTransportLineName +
+ "','" + oSub.HBeginAddr +
+ "','" + oSub.HEndAddr +
+ "','" + oSub.HTransportCar +
+ "','" + oSub.HDistance +
+ "','" + oSub.HTransportTimes +
+ "','" + oSub.HTransportTyep +
+ "','" + oSub.HMoney +
+ "','" + oSub.HMoney_His +
+ "')";
+ oCn.RunProc(subSql);
+ }
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Cg_ContractTransportBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Cg_ContractTransportBill_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";
+ oCn.RollBack();
+ return false;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ sReturn = "淇濆瓨澶辫触2锛�" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ oCn.RollBack();
+ return false;
+ }
+ //============================
+
+ 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 Gy_MaterPreventErrMouldBillMain Where HInterID=" + lngBillKey.ToString(), "Gy_MaterPreventErrMouldBillMain");
+ // if(Ds.Tables[0].Rows.Count==0)
+ // {
+ // sReturn = "鍗曟嵁鏈壘鍒帮紒";
+ // return false;
+ // }
+ // //鍥哄畾璧嬪��===========================================
+ // omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
+ // omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
+ // omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
+ // omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
+ // omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
+ // 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 = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
+ // omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
+ // omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
+ // omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
+ // omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
+ // omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
+ // omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
+ // omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
+ // omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
+ // omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
+ // omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
+ // omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
+ // omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
+ // omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
+ // omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
+ // omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
+ // //========================================================
+
+ // //
+
+ // //寰幆
+ // DataSet DsSub ;
+ // DsSub = oCn.RunProcReturn("Select * from Gy_MaterPreventErrMouldBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_WorkBeginDotCheckBillSub");
+ // DetailColl.Clear();//娓呯┖
+ // for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ // {
+ // Model.ClsGy_MaterPreventErrMouldBillSub oSub = new Model.ClsGy_MaterPreventErrMouldBillSub();
+ // // 鍥哄畾璧嬪��===============================================
+ // 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 = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
+ // oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
+ // 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 = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
+ // //===================================================
+
+ // 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 dce765d..7521616 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -103,11 +103,13 @@
<Compile Include="浠撳簱绠$悊\ClsKf_TrolleyPositionBillSub.cs" />
<Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_PurPrice_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_MatePrice_Model.cs" />
+ <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsCg_ContractTransportBillSub.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_AssistantData.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_AssistantDataEntry.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_Car_Model_2.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_Driver_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_DiscountList.cs" />
+ <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsCg_ContractTransportBillMain.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_OperatorGroup.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsSc_PackUnionBillBarCode_temp_Model.cs" />
<Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_PatrolCheckItemClass_Model.cs" />
@@ -184,8 +186,8 @@
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldOutRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMaintainPlanBillSub_Plan.cs" />
- <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillMain.cs" />
- <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillSub.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillMain.cs" />
+ <Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsGy_QCVerificationBillSub.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldMoveStockRequestBillMain.cs" />
<Compile Include="鐢熶骇绠$悊\妯″叿绠$悊\ClsSc_MouldInRequestBillSub.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/ClsCg_ContractTransportBillMain.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/ClsCg_ContractTransportBillMain.cs"
new file mode 100644
index 0000000..21fce2a
--- /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/ClsCg_ContractTransportBillMain.cs"
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsCg_ContractTransportBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+
+ public string HContractDate;
+ public int HSupID;
+ public string HContractNumber;
+ public string HContractName;
+ public string HAddress;
+ public int HSSID;
+ public int HCurID;
+ public int HEmpID;
+ public int HDeptID;
+ public string HExplanation;
+ public string HInnerBillNo;
+ }
+}
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/ClsCg_ContractTransportBillSub.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/ClsCg_ContractTransportBillSub.cs"
new file mode 100644
index 0000000..79af6d8
--- /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/ClsCg_ContractTransportBillSub.cs"
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsCg_ContractTransportBillSub : DBUtility.ClsXt_BaseBillMain
+ {
+
+ public string HTransportLineName;
+ public int HEntryID;
+ public int HSourceInterID;
+ public int HSourceEntryID;
+ public string HSourceBillNo;
+ public string HSourceBillType;
+ public long HBeginAddr;
+ public long HEndAddr;
+ public long HTransportCar;
+ public string HDistance;
+ public string HTransportTimes;
+ public string HTransportTyep;
+ public string HMoney;
+ public string HMoney_His;
+
+
+ }
+}
diff --git a/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs b/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
index 2843114..a5177dd 100644
--- a/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -14614,7 +14614,7 @@
try
{
//瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Gy_ProjectMoney_Close", 1, false, CurUserName))
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_ItemMoney_Close", 1, false, CurUserName))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
diff --git a/WebAPI/Controllers/Cg_ContractTransportBillListController.cs b/WebAPI/Controllers/Cg_ContractTransportBillListController.cs
new file mode 100644
index 0000000..90f972d
--- /dev/null
+++ b/WebAPI/Controllers/Cg_ContractTransportBillListController.cs
@@ -0,0 +1,386 @@
+锘縰sing DBUtility;
+using Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Web;
+using System.Web.Http;
+using System.Windows.Forms;
+using WebAPI.Models;
+using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
+using System.IO;
+using SyntacticSugar.constant;
+namespace WebAPI.Controllers
+{
+ public class Cg_ContractTransportBillListController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛�
+ private json objJsonResult = new json();
+ public DataSet ds = new DataSet();
+ public DataSet ds1 = new DataSet();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ public DAL.ClsCg_ContractTransportBillList OBill = new DAL.ClsCg_ContractTransportBillList();
+ public DAL.ClsCg_ContractTransportBillList BillOld = new DAL.ClsCg_ContractTransportBillList();
+
+ #region 鍚堝悓鍒楄〃
+ [Route("Cg_ContractTransportBillListController/get锘縇ist")]
+ [HttpGet]
+ public object get锘縇ist(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Cg_ContractTransportBill_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Cg_ContractTransportBillList order by 鍗曟嵁鍙� desc", "锘縣_v_Cg_ContractTransportBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Cg_ContractTransportBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+ ds = oCN.RunProcReturn(sql, "锘縣_v_Cg_ContractTransportBillList");
+ }
+
+ //娣诲姞鍒楀悕
+ 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("Cg_ContractTransportBillListController/Delete锘緽ill")]
+ [HttpGet]
+ public object Delete(string HInterID, string user)
+ {
+ try
+ {
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Cg_ContractTransportBill_Delete", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (HInterID == null || HInterID.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (BillOld.ShowBill(Int64.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_Cg_ContractTransportBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql1, "h_p_Cg_ContractTransportBill_BeforeDelCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:鍒犻櫎鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ //鍒犻櫎鍗曟嵁锛堝寘鍚垹闄ゅ悗鎺у埗銆佸啓鍏ユ棩蹇楋級
+ if (!BillOld.DeleteBill(BillOld.omodel.HInterID, BillOld.omodel.HBillNo, "h_p_Cg_ContractTransportBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
+ oCN.Commit();
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ 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 鑾峰彇缂栬緫鍒楄〃鏁版嵁
+ [Route("Cg_ContractTransportBillListController/锘縀ditList")]
+ [HttpGet]
+ public object EditList(string HInterID, string User)
+ {
+ try
+ {
+ List<DataTable> tableList = new List<DataTable>();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Cg_ContractTransportBill_Edit", 1, false, User))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ澶辫触!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (HInterID == null || HInterID.Equals(""))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("select * from h_v_Cg_ContractTransportBillList where HInterID = " + HInterID, " h_v_Cg_ContractTransportBillList");
+
+ 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("Cg_ContractTransportBillListController/Save锘緾g_ContractTransportBillList")]
+ [HttpPost]
+ public object Save锘緾g_ContractTransportBillList([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+ string refSav = sArray[2].ToString();//鎿嶄綔鏂瑰紡鏁版嵁绫诲瀷 1娣诲姞 3淇敼 2 澶嶅埗
+ string user = sArray[3].ToString();//鐢ㄦ埛鍚�
+
+ string UserName = "";
+ string s = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ //淇濆瓨鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Cg_ContractTransportBill_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DAL.ClsCg_ContractTransportBillList oBill = new DAL.ClsCg_ContractTransportBillList();
+ List<Model.ClsCg_ContractTransportBillMain> lsmain = new List<Model.ClsCg_ContractTransportBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_ContractTransportBillMain(msg2);
+ foreach (Model.ClsCg_ContractTransportBillMain oItem in lsmain)
+ {
+ if (refSav == "Add")
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (OBill.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, OBill.omodel.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ if (refSav == "Update")
+ {
+ if (OBill.ShowBill(oItem.HInterID, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (OBill.omodel.HChecker != "" && OBill.omodel.HChecker != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (OBill.omodel.HBillStatus > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ }
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HBillType = "1117";
+ oItem.HBillSubType = "1117";
+
+
+
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+
+ if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oBill.omodel = oItem;
+ }
+ // 琛ㄤ綋鏁版嵁
+ //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆�
+ msg3 = msg3.Substring(1, msg3.Length - 2);
+ msg3 = msg3.Replace("\\", "");
+ msg3 = msg3.Replace("\n", ""); //\n
+ List<Model.ClsCg_ContractTransportBillSub> ls = new List<Model.ClsCg_ContractTransportBillSub>();
+ ls = oListModels.getObjectByJson_Cg_ContractTransportBillSub(msg3);
+ int i = 0;
+ foreach (Model.ClsCg_ContractTransportBillSub oItemSub in ls)
+ {
+ i++;
+ oItemSub.HEntryID = i;
+
+
+ //oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
+
+ oBill.DetailColl.Add(oItemSub);
+
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (refSav == "Add")
+ {
+
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else if (refSav == "Update")
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = false;
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ 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
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index df007fb..ddfa10a 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -3432,9 +3432,30 @@
List<Model.ClsGy_MaterPreventErrMouldBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MaterPreventErrMouldBillMain>>(jsonString);
return list;
}
-
-
/// <summary>
+ /// 澶勭悊鎵胯繍鍚堝悓娓呭崟涓昏〃鐨刯son
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsCg_ContractTransportBillMain> getObjectByJson_ContractTransportBillMain(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsCg_ContractTransportBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsCg_ContractTransportBillMain>>(jsonString);
+ return list;
+ }
+ /// <summary>ClsCg_ContractTransportBillSub
+ /// 澶勭悊鏂板鎵胯繍鍚堝悓瀛愯〃鐨刯son
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsCg_ContractTransportBillSub> getObjectByJson_Cg_ContractTransportBillSub(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsCg_ContractTransportBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsCg_ContractTransportBillSub>>(jsonString);
+ return list;
+ }
+
+ /// <summary>ClsCg_ContractTransportBillSub
/// 澶勭悊鏂板浜у搧鐘敊楠岃瘉娓呭崟瀛愯〃鐨刯son
/// </summary>
/// <param name="jsonString"></param>
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index b8b6acb..6a5a2ef 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -438,6 +438,7 @@
<Compile Include="Controllers\CGGL\Cg_POStockInChangeBillController.cs" />
<Compile Include="Controllers\CGGL\Cg_POOrderChangeBillController.cs" />
<Compile Include="Controllers\CGGL\Cg_POStockInBillList_SecController.cs" />
+ <Compile Include="Controllers\Cg_ContractTransportBillListController.cs" />
<Compile Include="Controllers\CJGL\Cj_CallGoodsBillBackController.cs" />
<Compile Include="Controllers\CJGL\Cj_CallGoodsBillMainController.cs" />
<Compile Include="Controllers\CJGL\Cj_CenterCheckBillController.cs" />
@@ -1235,6 +1236,7 @@
<Folder Include="bin\" />
<Folder Include="Controllers\椤圭洰绠$悊\鍩虹寤烘ā\" />
<Folder Include="obj\x86\Debug\" />
+ <Folder Include="Views\Cg_ContractTransportBillList\" />
<Folder Include="Views\Cg_PODemandPlanBill\" />
<Folder Include="Views\Cg_PurchaseReturn\" />
<Folder Include="Views\Cj_CallGoodsBillBack\" />
--
Gitblit v1.9.1