From 42ffec0ec04bf485268722cdd610e8d18dafd0d5 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期三, 14 一月 2026 10:20:26 +0800
Subject: [PATCH] 员工签到记录表
---
Model/车间管理/ClsSc_EmployeeSignInNoteBill.cs | 27 ++
Model/车间管理/ClsSc_EmployeeSignInNoteBillSub.cs | 16 +
WebAPI/ListModels.cs | 27 +
WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs | 402 ++++++++++++++++++++++++++++++
DAL/车间管理/ClsSc_EmployeeSignInNoteBill.cs | 295 ++++++++++++++++++++++
DAL/DAL.csproj | 1
Model/Model.csproj | 2
WebAPI/WebAPI.csproj | 1
8 files changed, 768 insertions(+), 3 deletions(-)
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index 87c6dcd..3e613d5 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -721,6 +721,7 @@
<Compile Include="璐ㄦ绠$悊\ClsCrm_CustomerAppealBill.cs" />
<Compile Include="璐ㄦ绠$悊\ClsGy_EnvironmentTestSchemeBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsGy_MaterPreventErrMouldBillMain.cs" />
+ <Compile Include="杞﹂棿绠$悊\ClsSc_EmployeeSignInNoteBill.cs" />
<Compile Include="杞﹂棿绠$悊\ClsQc_PreventErrMouldCheckBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsGy_WorkBeginDotCheckListBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsCJ_WIPBeginStockBill.cs" />
diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs"
new file mode 100644
index 0000000..32d2976
--- /dev/null
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs"
@@ -0,0 +1,295 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsSc_EmployeeSignInNoteBill : DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsSc_EmployeeSignInNoteBill omodel = new Model.ClsSc_EmployeeSignInNoteBill();
+ public List<Model.ClsSc_EmployeeSignInNoteBillSub> DetailColl = new List<Model.ClsSc_EmployeeSignInNoteBillSub>();
+
+
+ public ClsSc_EmployeeSignInNoteBill()
+ {
+ base.MvarItemKeySub = "Sc_EmployeeSignInNoteBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey= "Sc_EmployeeSignInNoteBillMain";
+ base.MvarReportTitle = "鍛樺伐绛惧埌璁板綍鍗�";
+ base.BillType = "4616";
+ base.HBillSubType = "4616";
+
+ }
+
+ #region 鍥哄畾浠g爜
+
+ ~ClsSc_EmployeeSignInNoteBill()
+ {
+ DetailColl = null;
+ }
+
+ #endregion 鑷畾涔夋柟娉�
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //
+ oCn.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Gy_QCVerificationBill_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 Sc_EmployeeSignInNoteBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + omodel.HDate + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HChecker=" + omodel.HCheckEmp.ToString() +
+ ",HDeptID=" + omodel.HDeptID.ToString() +
+ ",HMainSourceBillType='"+ omodel.HMainSourceBillType+"'"+
+ ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
+ ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString()+
+ ",HEquipID =" + omodel.HEquipID.ToString()+
+ ",HMouldID =" + omodel.HMouldID.ToString()+
+ ",HSourceID =" + omodel.HSourceID.ToString()+
+ ",HProcID =" + omodel.HProcID.ToString()+
+ ",HGroupID =" + omodel.HGroupID.ToString()+
+ ",HShiftsID =" + omodel.HShiftsID.ToString()+
+ ",HSignInReason ='" + omodel.HSignInReason.ToString()+"'"+
+ ",HEmpID ='" + omodel.HEmpID.ToString()+ "'" +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ oCn.RunProc("delete from Sc_EmployeeSignInNoteBillSub where HInterID=" + lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsSc_EmployeeSignInNoteBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Sc_EmployeeSignInNoteBillSub " +
+ " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ ") ");
+ }
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Gy_QCVerificationBill_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
+ {
+ //寰楀埌mainid
+ omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ DataSet ds = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_QCVerificationBill_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.BeginTran();
+ oCn.RunProc("Insert Into Sc_EmployeeSignInNoteBillMain " +
+ "(HBillType,HBillSubType,HBillNo,HDate" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate," +
+ "HMainSourceBillType,HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID," +
+ "HEquipID,HMouldID,HSourceID,HProcID,HGroupID,HShiftsID,HSignInReason,HSignRemark," +
+ "HChecker,HDeptID,HEmpID,HOrgID) " +
+ "values('" + (this.BillType ?? "") + "','" + (this.HBillSubType ?? "") + "'," +
+ "'" + (omodel.HBillNo ?? "") + "','" + (omodel.HDate.ToString() ?? "") + "'" +
+ "," + (omodel.HYear.ToString() ?? "0") + "," + (omodel.HPeriod.ToString() ?? "0") +
+ ",'" + (omodel.HRemark ?? "") + "','" + (omodel.HMaker ?? "") + "',getdate(),'" +
+ (omodel.HMainSourceBillType ?? "") + "','" + (omodel.HMainSourceBillNo ?? "") + "'," +
+ (omodel.HMainSourceInterID.ToString() ?? "0") + "," + (omodel.HMainSourceEntryID.ToString() ?? "0") + "," +
+ (omodel.HEquipID.ToString() ?? "0") + "," + (omodel.HMouldID.ToString() ?? "0") + "," +
+ (omodel.HSourceID.ToString() ?? "0") + "," + (omodel.HProcID.ToString() ?? "0") + "," +
+ (omodel.HGroupID.ToString() ?? "0") + "," + (omodel.HShiftsID.ToString() ?? "0") + ",'" +
+ (omodel.HSignInReason?.ToString() ?? "0") + "','" + (omodel.HSignRemark?.ToString() ?? "") + "'," +
+ (omodel.HCheckEmp.ToString() ?? "0") + "," + (omodel.HDeptID.ToString() ?? "0") + "," + (omodel.HEmpID.ToString() ?? "0") + "," + (omodel.HOrgID.ToString() ?? "0") + ")");
+ //涓昏〃
+ //鎻掑叆瀛愯〃
+
+ foreach (Model.ClsSc_EmployeeSignInNoteBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into Gy_QCVerificationBillSub " +
+ " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ "" +
+ ") values("
+ + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate.ToShortDateString() + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+ "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+ ") ");
+ }
+
+ //=========================淇濆瓨鍚庢帶鍒�
+ DataSet ds2 = oCn.RunProcReturn("Exec h_p_Gy_QCVerificationBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1", "h_p_Gy_QCVerificationBill_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_QCVerificationBillMain Where HInterID=" + lngBillKey.ToString(), "Gy_QCVerificationBillMain");
+ 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 = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
+ omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
+ 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.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.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.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
+ omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
+ omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
+ omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
+ omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
+ //========================================================
+ omodel.HCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckEmp"]);
+ omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+
+
+ //
+
+ //寰幆
+ DataSet DsSub ;
+ DsSub = oCn.RunProcReturn("Select * from Gy_QCVerificationBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_MouldRepairWorkBillSub");
+ DetailColl.Clear();//娓呯┖
+ for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsSc_EmployeeSignInNoteBillSub oSub = new Model.ClsSc_EmployeeSignInNoteBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ 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 fca16fa..06e2e92 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -771,6 +771,8 @@
<Compile Include="璐ㄦ绠$悊\ClsGy_EnvironmentTestSchemeBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsGy_MaterPreventErrMouldBillMain.cs" />
<Compile Include="璐ㄦ绠$悊\ClsGy_EnvironmentTestSchemeBillSub.cs" />
+ <Compile Include="杞﹂棿绠$悊\ClsSc_EmployeeSignInNoteBillSub.cs" />
+ <Compile Include="杞﹂棿绠$悊\ClsSc_EmployeeSignInNoteBill.cs" />
<Compile Include="杞﹂棿绠$悊\ClsQc_PreventErrMouldCheckBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsGy_WorkBeginDotCheckListBillMain.cs" />
<Compile Include="杞﹂棿绠$悊\ClsCJ_WIPBeginStockBillMain.cs" />
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs"
new file mode 100644
index 0000000..92b5f5e
--- /dev/null
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBill.cs"
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_EmployeeSignInNoteBill : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HCheckEmp;//
+ public Int64 HDeptID;//
+ public Int64 HEmpID;//
+ public Int64 HOrgID;
+ public Int64 HEquipID;
+ public Int64 HMouldID;
+ public Int64 HSourceID;
+ public Int64 HProcID;
+ public Int64 HGroupID;
+ public Int64 HShiftsID;
+ public string HSignInReason;
+ public string HSignRemark;
+
+
+
+
+
+ }
+}
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBillSub.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBillSub.cs"
new file mode 100644
index 0000000..20abbb8
--- /dev/null
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_EmployeeSignInNoteBillSub.cs"
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsSc_EmployeeSignInNoteBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+
+
+
+
+
+
+ }
+}
diff --git a/WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs b/WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs
new file mode 100644
index 0000000..9782b1f
--- /dev/null
+++ b/WebAPI/Controllers/Sc_EmployeeSignInNoteBillController.cs
@@ -0,0 +1,402 @@
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers
+{
+ public class Sc_EmployeeSignInNoteBillController : 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();
+
+
+ #region 鍒嗛〉鍒楄〃
+ [Route("Sc_EmployeeSignInNoteBillController/GetListPage")]
+ [HttpGet]
+ public object GetListPage(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Query", 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_Sc_EmployeeSignInNoteBill order by 鍗曟嵁鍙� desc", "锘縣_v_Sc_EmployeeSignInNoteBill");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sc_EmployeeSignInNoteBill where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+ ds = oCN.RunProcReturn(sql, "锘縣_v_Sc_EmployeeSignInNoteBill");
+ }
+
+
+ //娣诲姞鍒楀悕
+ 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 ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+ #region 鏍规嵁婧愬崟浼犵墿鏂欏垪琛�
+ [Route("WLYayBillController/GetMesByOrginBill_1")]
+ [HttpGet]
+ public object GetMesByOrginBill_1(string ListMaterial)
+ {
+ try
+ {
+ if (ListMaterial.EndsWith(";"))
+ {
+ ListMaterial = ListMaterial.Remove(ListMaterial.Length - 1);
+ }
+ ListMaterial = ListMaterial.Replace(';', ',');
+ List<object> columnNameList = new List<object>();
+
+
+
+ ds = oCN.RunProcReturn("select a.*,b.HUnitID from h_v_Gy_MaterialPackingRelationList_Edit a left JOIN Gy_Material b on a.HMaterID=b.HItemID where HDefaultSendPackFlag=1 and 瀹℃牳浜�='' and HMaterID in (" + ListMaterial + ")", "锘縣_v_Gy_MaterialPackingRelationList");
+
+
+ //娣诲姞鍒楀悕
+ 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 ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+ #region 淇濆瓨/缂栬緫
+
+ [Route("Sc_EmployeeSignInNoteBillController/SaveBill")]
+ [HttpPost]
+ public object SaveBill([FromBody] JObject msg)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+ string msg4 = sArray[2].ToString();
+
+
+ ListModels oListModels = new ListModels();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Edit", 1, false, msg4))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DAL.ClsSc_EmployeeSignInNoteBill oBill = new DAL.ClsSc_EmployeeSignInNoteBill();
+ List<Model.ClsSc_EmployeeSignInNoteBill> lsmain = new List<Model.ClsSc_EmployeeSignInNoteBill>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Sc_EmployeeSignInNoteBill(msg2);
+ foreach (Model.ClsSc_EmployeeSignInNoteBill oItem in lsmain)
+ {
+ oItem.HMaker = msg4;
+ DBUtility.ClsPub.CurUserName = msg4; //鍒跺崟浜�
+ oItem.HBillType = "4616";
+ oItem.HBillSubType = "4616";
+ oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
+ oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+ oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ oItem.HCheckEmp = oItem.HEmpID;
+ 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
+ ////msg2 = msg2.Replace("'", "鈥�");
+ //List<Model.ClsSc_EmployeeSignInNoteBillSub> ls = new List<Model.ClsSc_EmployeeSignInNoteBillSub>();
+ //ls = oListModels.getObjectByJson_Sc_EmployeeSignInNoteBillSub(msg3);
+ //int i = 0;
+ //foreach (Model.ClsSc_EmployeeSignInNoteBillSub oItem in ls)
+ //{
+
+ // i++;
+ // oItem.HEntryID = i;
+ // oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ // oItem.HCloseType = false; //鍏抽棴绫诲瀷
+ // oBill.DetailColl.Add(oItem);
+
+ //}
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ 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
+
+
+ #region[缂栬緫鏃惰幏鍙栨暟鎹甝
+ [Route("Sc_EmployeeSignInNoteBillController/Sc_EmployeeSignInNoteBilldetail")]
+ [HttpGet]
+ public ApiResult<DataSet> Sc_EmployeeSignInNoteBilldetail(string HID)
+ {
+ if (string.IsNullOrEmpty(HID))
+ return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ var dataSet = oCN.RunProcReturn("select * from h_v_Sc_EmployeeSignInNoteBill where HInterID= " + HID + " ", "h_v_Sc_EmployeeSignInNoteBill");
+ if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+ return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ崟鍙�" };
+ return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+ }
+ #endregion
+
+
+ #region 瀹℃牳銆佸弽瀹℃牳
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("WLYayBillController/AuditWLYayBill1")]
+ [HttpGet]
+ public object AuditWLYayBill(int HInterID, int IsAudit, string CurUserName)
+ {
+ try
+ {
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ {
+ oCN.RunProc("update WL_YayBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() ,HBillStatus=2 where HInterID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ {
+ oCN.RunProc("update WL_YayBillMain set HChecker='',HCheckDate=null,HBillStatus=1 where HInterID=" + HInterID);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ //#region
+ //[Route("Sc_EmployeeSignInNoteBillController/APP_Edit_json")]
+ //[HttpPost]
+ //public object APP_Edit_json(int HInterID,string HBarCode)
+ //{
+ // DataSet ds = oCN.RunProcReturn("select * from Gy_EquipFileBillMain where HBarCode='"+ HBarCode+"'", "Gy_EquipFileBillMain");
+ // if(ds!=null||ds.Tables.Count>0)
+ // {
+ // var EquipmentID = ds.Tables[0].Rows[0]["HInterID"];
+ // DataSet dds = oCN.RunProcReturn("exec h_p_SB_HEquipHMould_Query "+ EquipmentID, "h_p_SB_HEquipHMould_Query");
+ // if(dds != null || dds.Tables.Count > 0)
+ // {
+
+ // }
+ // }
+ //}
+ //#endregion
+
+
+
+
+
+
+
+ [Route("WLYayBillController/updateBillMEs1")]
+ [HttpGet]
+ public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName)
+ {
+ var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID, "WL_YayBillMain");
+ if (ds != null || ds.Tables[0].Rows.Count <= 0)
+ {
+ oCN.BeginTran();
+ oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID+ "and HEntryID="+ HEntryID);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛";
+ objJsonResult.data = null;
+ oCN.Commit();
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏇存柊澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+}
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index 8deb00e..d9d4662 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -700,7 +700,7 @@
}
/// <summary>
- /// 澶勭悊妫�楠屼华鍣ㄨ褰曞崟鐨刯son
+ /// 澶勭悊妫�楠屼华鍣ㄨ褰曞崟鐨刯son
/// </summary>
/// <param name="jsonString"></param>
/// <returns></returns>
@@ -708,6 +708,17 @@
{
jsonString = "[" + jsonString.ToString() + "]";
List<Model.ClsGy_QCVerificationBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillMain>>(jsonString);
+ return list;
+ }
+ /// <summary>
+ /// 澶勭悊妫�楠屼华鍣ㄨ褰曞崟鐨刯son ClsSc_EmployeeSignInNoteBill
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsSc_EmployeeSignInNoteBill> getObjectByJson_Sc_EmployeeSignInNoteBill(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsSc_EmployeeSignInNoteBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_EmployeeSignInNoteBill>>(jsonString);
return list;
}
/// <summary>
@@ -755,8 +766,18 @@
List<Model.ClsGy_QCVerificationBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_QCVerificationBillSub>>(jsonString);
return list;
}
-
-
+ /// <summary>
+ /// 澶勭悊鏂板妯″叿缁翠慨瀛愯〃閰嶄欢淇℃伅鐨刯son
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsSc_EmployeeSignInNoteBillSub> getObjectByJson_Sc_EmployeeSignInNoteBillSub(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsSc_EmployeeSignInNoteBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_EmployeeSignInNoteBillSub>>(jsonString);
+ return list;
+ }
+
public List<Model.ClsWL_YayBillMainBillSub> getObjectByJson_WL_YayBillMainBillSub(string jsonString)
{
jsonString = "[" + jsonString.ToString() + "]";
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index af48005..960cb57 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -477,6 +477,7 @@
<Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱JIT_DayPlanPlatFormBill_TKController.cs" />
<Compile Include="Controllers\SCGL\鏃ヨ鍒掔鐞哱Xs_SendGoodsPlanBillController.cs" />
<Compile Include="Controllers\WLGL\Cg_CarTrajectoryBillController.cs" />
+ <Compile Include="Controllers\Sc_EmployeeSignInNoteBillController.cs" />
<Compile Include="Controllers\XSGL\Crm_ComplainVisitBillController.cs" />
<Compile Include="Controllers\XSGL\Xs_SellOutBillList_SecController.cs" />
<Compile Include="Controllers\XSGL\Xs_SeQuotationBillController.cs" />
--
Gitblit v1.9.1