From b386a0c4ce29a5ae61ee900fdb2522d8e6b52ca2 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期一, 06 十二月 2021 13:59:08 +0800
Subject: [PATCH] 工资结算单(个人)
---
/dev/null | 339 ------------------------
WebAPI/Models/工资管理/ClsPay_SingleBalBillMain.cs | 17 +
WebAPI/ListModels.cs | 41 +-
WebAPI/Controllers/工资管理/Pay_SingleBalBillController.cs | 370 ++++++++++++++++++++++++++
WebAPI/Models/工资管理/ClsPay_SingleBalBillSub.cs | 42 +++
WebAPI/DLL/ClsPay_SingleBalBill.cs | 12
WebAPI/WebAPI.csproj | 4
7 files changed, 453 insertions(+), 372 deletions(-)
diff --git a/WebAPI/Controllers/Pay_SingleBalBillController.cs b/WebAPI/Controllers/Pay_SingleBalBillController.cs
deleted file mode 100644
index e9a97f2..0000000
--- a/WebAPI/Controllers/Pay_SingleBalBillController.cs
+++ /dev/null
@@ -1,339 +0,0 @@
-锘縰sing Newtonsoft.Json.Linq;
-using Pub_Class;
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Data;
-using System.Data.SqlClient;
-using System.Web.Http;
-using WebAPI.Models;
-
-namespace WebAPI.Controllers
-{
-
- public class Pay_SingleBalBillController : ApiController
- {
- public DBUtility.ClsPub.Enum_BillStatus BillStatus;
-
- private json objJsonResult = new json();
- public DataSet ds = new DataSet();
- public WebServer webserver = new WebServer();
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- //DataSet ds;
-
-
- /// <summary>
- /// 杩斿洖宸ヨ祫缁撶畻涓汉鍒楄〃
- ///鍙傛暟锛歴tring sql銆�
- ///杩斿洖鍊硷細object銆�
- /// </summary>
- [Route("Pay_SingleBalBill/GetSingleBalBill")]
- [HttpGet]
- public object GetSingleBalBill(string sWhere)
- {
- try
- {
-
- ds = Sc_GetSingleBalBill(sWhere);
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
- catch (Exception ex)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
- objJsonResult.data = null;
- return objJsonResult;
- }
- }
-
- public static DataSet Sc_GetSingleBalBill(string sWhere)
- {
- if (sWhere == null || sWhere.Equals(""))
- {
- return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_SingleBalBillList order by 鏃ユ湡 desc", "h_v_Pay_SingleBalBillList");
- }
- else
- {
- string sql1 = "select * from h_v_Pay_SingleBalBillList where 1 = 1 ";
- string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
- return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_SingleBalBillList");
- }
-
- }
-
- #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
- [Route("Pay_SingleBalBill/Pay_SingleBalBillListCheckDetail")]
- [HttpGet]
- public ApiResult<DataSet> Pay_SingleBalBillListCheckDetail(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 top 1 * from h_v_Pay_SingleBalBillList where hmainid= " + HID + " ", "h_v_Pay_SingleBalBillList");
- 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[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁]
- [Route("Pay_SingleBalBill/Pay_SingleBalBillListProjectDetai")]
- [HttpGet]
- public object Pay_SingleBalBillListProjectDetai(string sqlWhere)
- {
- DataSet ds;
- try
- {
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql1 = "SELECT HMaterID,HMaterCode,HMaterName, HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬" +
- ",HGroupID,鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡" +
- ",瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID,HProcNumber,HProcName" +
- ",HEmpID,HEmpNumber,HEmpName,宸ユ椂,鏁伴噺,宸ヤ环,閲戦 FROM h_v_Pay_SingleBalBillList where 1 = 1 ";
- string sql = sql1 + sqlWhere;
- ds = oCN.RunProcReturn(sql, "h_v_Pay_SingleBalBillList");
- objJsonResult.code = "0";
- objJsonResult.count = 1;
- objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
- objJsonResult.data = ds.Tables[0];
- }
- catch (Exception e)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
- objJsonResult.data = null;
- }
- return objJsonResult;
- }
- #endregion
- /// <summary>
- /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
- ///鍙傛暟锛歴tring sql銆�
- ///杩斿洖鍊硷細object銆�
- /// </summary>
- [Route("Pay_SingleBalBill/AddBill")]
- [HttpPost]
- public object AddBill([FromBody] JObject sMainSub)
- {
- 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;
- }
-
- public json AddBillMain(string msg1)
- {
- string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
- string msg2 = sArray[0].ToString();
- string msg3 = sArray[1].ToString();
- try
- {
- msg2 = "[" + msg2.ToString() + "]";
- List<Pay_SingleBalBill> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_SingleBalBill>>(msg2);
- string HBillType = "2205";
- long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
- string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
- DateTime HDate = mainList[0].HDate;//鏃ユ湡
- int HYear = 2021;
- double HPeriod = 1;
- string HRemark = mainList[0].HRemark;//澶囨敞
- string HBillSubType = "2205";
- string HMaker = mainList[0].HMaker;
- string HExplanation = "0";
- string HInnerBillNo = "0";
- long HMaterID = mainList[0].HMaterID;//浜у搧ID
- long HGroupID = mainList[0].HGroupID;
- long HDeptID = mainList[0].HDeptID;
- long HProcID = mainList[0].HProcID;
- long HEmpID = mainList[0].HEmpID;
- long HPayType = mainList[0].HPayType;
- //long HMaterTypeID = 0;
- int HPRDORGID = mainList[0].HPRDORGID; //缁勭粐
-
- //涓昏〃
- oCN.RunProc(" Insert Into Pay_SingleBalBillMain " +
- "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
- ",HYear,HPeriod,HRemark,HMaker" +
- ",HGroupID,HDeptID,HEmpID,HPayType,HInnerBillNo,HExplanation" + ")" +
- "values('" + HBillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "','" + HDate +
- "','" + HYear + "'," + HPeriod + ",'" + HRemark + "','" + HMaker + "'," + HGroupID + ", " + HDeptID +
- "," + HEmpID + ",'"+ HPayType +"','" + HInnerBillNo + "'," + HExplanation +
- ") ");
-
- //淇濆瓨瀛愯〃
- objJsonResult = AddBillSub(msg3, HInterID);
- 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)
- {
- List<Pay_SingleBalBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_SingleBalBillSub>>(msg3);
- for (int i = 0; i < subList.ToArray().Length; i++)
- {
- long HEntryID = subList[0].HEntryID;//宸ユID
- string HCloseMan = subList[0].HCloseMan;
- long HCloseType = subList[0].HCloseType;
- string HRemark = subList[0].HRemark;
- long HSourceInterID = subList[0].HSourceInterID;
- long HSourceEntryID = subList[0].HSourceEntryID;
- string HSourceBillNo = subList[0].HSourceBillNo;
- string HSourceBillType = subList[0].HSourceBillType;
- decimal HRelationQty = subList[0].HRelationQty;
- decimal HRelationMoney = subList[0].HRelationMoney;
- long HSourceID = subList[0].HSourceID;
- long HSqty = subList[0].HSqty;
- long HSubsidyID = subList[0].HSubsidyID;
- long HDeuctID = subList[0].HDeuctID;
- long HMaterID = subList[0].HMaterID;
- long HProcID = subList[0].HProcID;
- long HEmpID = subList[0].HEmpID;
- decimal HTimes = subList[0].HTimes;
- decimal HQty = subList[0].HQty;
- decimal HPrice = subList[0].HPrice;
- decimal HPackQty = subList[0].HPackQty;
- decimal HPackPrice = subList[0].HPackPrice;
- decimal HPackMoney = subList[0].HPackMoney;
- long HPackMaterID = subList[0].HPackMaterID;
- decimal HPriceRate = subList[0].HPriceRate;
- decimal HSubsidyTotal = subList[0].HSubsidyTotal;
- decimal HDeuctTotal = subList[0].HDeuctTotal;
- decimal HSubsidyQty = subList[0].HSubsidyQty;
- decimal HSubsidyMoney = subList[0].HSubsidyMoney;
- decimal HMoney = subList[0].HMoney;
- long HICMOInterID = subList[0].HICMOInterID;
- string HICMOBillNo = subList[0].HICMOBillNo;
- long HProcReportInterID = subList[0].HProcReportInterID;
- long HProcReportEntryID = subList[0].HProcReportEntryID;
- long HProcPlanInterID = subList[0].HProcPlanInterID;
- long HProcPlanEntryID = subList[0].HProcPlanEntryID;
- string HProcReportBillNo = subList[0].HProcReportBillNo;
- string HProcPlanBillNo = subList[0].HProcPlanBillNo;
-
- string sql = "Insert into Pay_SingleBalBillSub " +
- " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
- ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
- ",HMaterID,HProcID,HEmpID,HSourceID,HTimes,HQty,HPrice,HSqty" +
- ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" +
- ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo" +
- ",HPriceRate,HSubsidyTotal,HDeuctTotal,HSubsidyID,HDeuctID" +
- ",HPackQty,HPackPrice,HPackMoney,HPackMaterID,HSubsidyQty,HSubsidyMoney" +
- ") values("
- + HInterID.ToString() + "," + HEntryID.ToString() + ",'" + HCloseMan + "',''," + HCloseType + ",'" + HRemark + "'" +
- "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'," + HRelationQty.ToString() + "," + HRelationMoney.ToString() +
- "," + HMaterID.ToString() + "," + HProcID.ToString() + "," + HEmpID.ToString() + "," + HSourceID.ToString()
- + "," + HTimes.ToString() + "," + HQty.ToString() + "," + HPrice.ToString() + "," + HSqty.ToString() +
- "," +HMoney.ToString() + "," + HICMOInterID.ToString() + ",'" + HICMOBillNo + "'," + HProcReportInterID.ToString() + "," + HProcReportEntryID.ToString() + ",'" + HProcReportBillNo + "'" +
- "," +HProcPlanInterID.ToString() + "," + HProcPlanEntryID.ToString() + ",'" + HProcPlanBillNo + "'" +
- "," + HPriceRate.ToString() + "," + HSubsidyTotal.ToString() + "," + HDeuctTotal.ToString() + "," + HSubsidyID.ToString() + "," + HDeuctID.ToString() +
- "," + HPackQty.ToString() + "," + HPackPrice.ToString() + "," + HPackMoney.ToString() + "," + HPackMaterID.ToString() + "," + HSubsidyQty.ToString() + "," + HSubsidyMoney.ToString() +
- ") ";
- oCN.RunProc(sql);
- }
-
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = null;
- objJsonResult.data = null;
- return objJsonResult;
- }
- /// <summary>
- ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳�
- /// </summary>
- /// <returns></returns>
- [Route("Pay_SingleBalBill/DeltetSingleBalBill")]
- [HttpGet]
- public object Pay_SingleBalBill(string HInterID)
- {
- try
- {
- oCN.BeginTran();
- oCN.RunProc("Delete From Pay_SingleBalBillMain where HInterID = " + HInterID);
- oCN.RunProc("Delete From Pay_SingleBalBillSub 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;
- }
- }
-
-
- [Route("Pay_SingleBalBill/getSingleBalBillPrice")]
- [HttpGet]
- public object getSingleBalBillPrice(string HMaterID,string HProcID)
- {
- try
- {
- DataSet ds = oCN.RunProcReturn("select 鍗曚环 from h_v_Gy_ProcPriceList where HMaterID='" + HMaterID + "' and HProcID='" + HProcID + "'", "h_v_Gy_ProcPriceList");
- 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;
- }
- }
- //
- }
-}
\ No newline at end of file
diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs"
new file mode 100644
index 0000000..4354e70
--- /dev/null
+++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_SingleBalBillController.cs"
@@ -0,0 +1,370 @@
+锘縰sing Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers
+{
+
+ public class Pay_SingleBalBillController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+ private json objJsonResult = new json();
+ public DataSet ds = new DataSet();
+ public WebServer webserver = new WebServer();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ public DLL.ClsPay_SingleBalBill BillNew0 = new DLL.ClsPay_SingleBalBill(); //
+ public DLL.ClsPay_SingleBalBill BillOld0 = new DLL.ClsPay_SingleBalBill(); //
+
+ /// <summary>
+ /// 杩斿洖宸ヨ祫缁撶畻涓汉鍒楄〃
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ [Route("Pay_SingleBalBill/GetSingleBalBill")]
+ [HttpGet]
+ public object GetSingleBalBill(string sWhere)
+ {
+ try
+ {
+
+ ds = Sc_GetSingleBalBill(sWhere);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ public static DataSet Sc_GetSingleBalBill(string sWhere)
+ {
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_SingleBalBillList order by 鏃ユ湡 desc", "h_v_Pay_SingleBalBillList");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Pay_SingleBalBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
+ return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_SingleBalBillList");
+ }
+
+ }
+
+ #region[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄥご鏁版嵁]
+ [Route("Pay_SingleBalBill/Pay_SingleBalBillListCheckDetail")]
+ [HttpGet]
+ public ApiResult<DataSet> Pay_SingleBalBillListCheckDetail(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 top 1 * from h_v_Pay_SingleBalBillList where hmainid= " + HID + " ", "h_v_Pay_SingleBalBillList");
+ 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[宸ヨ祫缁撶畻涓汉鍗曠紪杈戞椂鑾峰彇琛ㄤ綋鏁版嵁]
+ [Route("Pay_SingleBalBill/Pay_SingleBalBillListProjectDetai")]
+ [HttpGet]
+ public object Pay_SingleBalBillListProjectDetai(string sqlWhere)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql1 = "SELECT HMaterID,HMaterCode,HMaterName, HDeptID,閮ㄩ棬浠g爜,閮ㄩ棬" +
+ ",HGroupID,鐝粍浠g爜,鐝粍,宸ヨ祫绫诲瀷,鎽樿,鍐呴儴鍗曟嵁鍙�,琛ㄥご澶囨敞,鍒跺崟浜�,鍒跺崟鏃ユ湡" +
+ ",瀹℃牳浜�,瀹℃牳鏃ユ湡,淇敼浜�,淇敼鏃ユ湡,鍏抽棴浜�, 鍏抽棴鏃ユ湡,HProcID,HProcNumber,HProcName" +
+ ",HEmpID,HEmpNumber,HEmpName,宸ユ椂 HTimes ,鏁伴噺 HQty,宸ヤ环 HPrice,閲戦 HMoney ,琛ㄤ綋澶囨敞 as HRemark FROM h_v_Pay_SingleBalBillList where 1 = 1 ";
+ string sql = sql1 + sqlWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Pay_SingleBalBillList");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+
+ [Route("Pay_SingleBalBill/SaveGetSingleBalBillList")]
+ [HttpPost]
+ #endregion
+ /// <summary>
+ /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+ ///鍙傛暟锛歴tring sql銆�
+ ///杩斿洖鍊硷細object銆�
+ /// </summary>
+ public object SaveGetSingleBalBillList([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 refSav = sArray[2].ToString();
+ //string msg4 = sArray[3].ToString();
+
+ string UserName = "";
+ string s = "";
+ long mouldid;
+ ListModels oListModels = new ListModels();
+ try
+ {
+ ////缂栬緫鏉冮檺
+ //if (!DBUtility.ClsPub.Security_Log_second("Pay_SingleBalBill_Edit", 1, true, msg4))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ DLL.ClsPay_SingleBalBill oBill = new DLL.ClsPay_SingleBalBill();
+ List<Models.ClsPay_SingleBalBillMain> lsmain = new List<Models.ClsPay_SingleBalBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Pay_SingleBalBillMain(msg2);
+ foreach (Models.ClsPay_SingleBalBillMain oItem in lsmain)
+ {
+ if (refSav == "Add")
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld0.omodel.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ if (refSav == "Update")
+ {
+ if (BillOld0.ShowBill(oItem.HInterID, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (BillOld0.omodel.HChecker != "" && BillOld0.omodel.HChecker != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (BillOld0.omodel.HBillStatus > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld0, ref s))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ //oItem.HMaker = "";
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HBillType = "2205";
+ oItem.HBillSubType = "2205";
+ //oItem.HBillNo = ""; //鍗曟嵁鍙�
+ //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));// --鏃ユ湡
+ //oItem.HInnerBillNo = ""; // --鍐呴儴鍗曟嵁鍙�
+ 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.HEquipID = 0; //璁惧ID(Gy_EquipMent)
+ //oItem.HPeriod = 0;
+ //oItem.HCheckBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); // --缁翠慨鏃ユ湡
+ //oItem.HCheckResult = ""; //楠屾敹缁撹--(姝e父锛屽紓甯�)
+ //oItem.HEmpID = 0; //楠屾敹浜�(Gy_Employee)
+ //oItem.HManagerID = 0; //璐熻矗浜�(Gy_Employee)
+ //oItem.HDeptID = 0; //楠屾敹閮ㄩ棬(Gy_Department)
+ //oItem.HExplanation = ""; //鎽樿(鏁呴殰鎻忚堪)
+ //oItem.HRemark = ""; //澶囨敞
+
+ //oItem.HMainSourceInterID = oItem.HInterID;
+
+ //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
+ 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<Models.ClsPay_SingleBalBillSub> ls = new List<Models.ClsPay_SingleBalBillSub>();
+ ls = oListModels.getObjectByJson_Pay_SingleBalBillSub(msg3);
+ int i = 0;
+ foreach (Models.ClsPay_SingleBalBillSub oItemSub in ls)
+ {
+
+ i++;
+ oItemSub.HEntryID = i;
+ mouldid = oItemSub.HMaterID;
+ //oItemSub.HRepairCheckID = 0; //楠屾敹椤圭洰ID
+ //oItemSub.HRepairCheckContent = ""; //楠屾敹鍐呭
+ //oItemSub.HManagerID = 0; //璐熻矗浜篒D
+ //oItemSub.HCloseMan = ""; //琛屽叧闂�
+ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
+ oItemSub.HCloseType = false; //鍏抽棴绫诲瀷
+ //oItemSub.HRemark = ""; //澶囨敞
+ oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮�
+ oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮�
+ //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿
+ //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
+ //oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺
+ //oItemSub.HRelationMoney = 0; //鍏宠仈閲戦
+ //oItemSub.HRepairID = 0; //缁翠慨椤圭洰
+ //oItemSub.HRepairExplanation =""; //缁翠慨瑕佹眰
+ //oItemSub.HMoney = 0; //缁翠慨璐圭敤
+ oBill.DetailColl.Add(oItemSub);
+
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.omodel.HInterID == 0)
+ {
+ // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ 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 = "淇濆瓨鎴愬姛锛�";
+ //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;
+ }
+ }
+
+ /// <summary>
+ ///宸ヨ祫缁撶畻涓汉鍗曞垹闄ゅ姛鑳�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Pay_SingleBalBill/DeltetSingleBalBill")]
+ [HttpGet]
+ public object Pay_SingleBalBill(string HInterID)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("Delete From Pay_SingleBalBillMain where HInterID = " + HInterID);
+ oCN.RunProc("Delete From Pay_SingleBalBillSub 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;
+ }
+ }
+
+
+ [Route("Pay_SingleBalBill/getSingleBalBillPrice")]
+ [HttpGet]
+ public object getSingleBalBillPrice(string HMaterID,string HProcID)
+ {
+ try
+ {
+ DataSet ds = oCN.RunProcReturn("select 鍗曚环 from h_v_Gy_ProcPriceList where HMaterID='" + HMaterID + "' and HProcID='" + HProcID + "'", "h_v_Gy_ProcPriceList");
+ 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;
+ }
+ }
+ //
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/DLL/ClsPay_SingleBalBill.cs b/WebAPI/DLL/ClsPay_SingleBalBill.cs
index 11c293c..d48ef6b 100644
--- a/WebAPI/DLL/ClsPay_SingleBalBill.cs
+++ b/WebAPI/DLL/ClsPay_SingleBalBill.cs
@@ -3,12 +3,12 @@
using System.Text;
using System.Data;
-namespace DAL
+namespace WebAPI.DLL
{
public class ClsPay_SingleBalBill : DBUtility.ClsXt_BaseBill
{
- public Model.ClsPay_SingleBalBillMain omodel = new Model.ClsPay_SingleBalBillMain();
- public List<Model.ClsPay_SingleBalBillSub> DetailColl = new List<Model.ClsPay_SingleBalBillSub>();
+ public Models.ClsPay_SingleBalBillMain omodel = new Models.ClsPay_SingleBalBillMain();
+ public List<Models.ClsPay_SingleBalBillSub> DetailColl = new List<Models.ClsPay_SingleBalBillSub>();
public ClsPay_SingleBalBill()
{
@@ -61,7 +61,7 @@
DeleteBillSub(lngBillKey);
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
- foreach (Model.ClsPay_SingleBalBillSub oSub in DetailColl)
+ foreach (Models.ClsPay_SingleBalBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Pay_SingleBalBillSub " +
" (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
@@ -125,7 +125,7 @@
", " + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HPayType.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
") ");
//鎻掑叆瀛愯〃
- foreach (Model.ClsPay_SingleBalBillSub oSub in DetailColl)
+ foreach (Models.ClsPay_SingleBalBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Pay_SingleBalBillSub " +
" (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
@@ -224,7 +224,7 @@
DetailColl.Clear();//娓呯┖
for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
{
- Model.ClsPay_SingleBalBillSub oSub = new Model.ClsPay_SingleBalBillSub();
+ Models.ClsPay_SingleBalBillSub oSub = new Models.ClsPay_SingleBalBillSub();
// 鍥哄畾璧嬪��===============================================
oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index d8cb399..1d03593 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -1317,31 +1317,7 @@
return list;
}
/// <summary>
- /// 澶勭悊宸ヨ祫涓汉缁撶畻鍗曚富琛ㄧ殑json
- /// </summary>
- /// <param name="jsonString"></param>
- /// <returns></returns>
- public List<Model.ClsPay_SingleBalBillMain> getObjectByJson_Pay_SingleBalBillMain(string jsonString)
- {
- jsonString = "[" + jsonString.ToString() + "]";
- List<Model.ClsPay_SingleBalBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_SingleBalBillMain>>(jsonString);
- return list;
- }
-
-
- /// <summary>
- /// 澶勭悊宸ヨ祫涓汉缁撶畻鍗曞瓙琛ㄧ殑json
- /// </summary>
- /// <param name="jsonString"></param>
- /// <returns></returns>
- public List<Model.ClsPay_SingleBalBillSub> getObjectByJson_Pay_SingleBalBillSub(string jsonString)
- {
- jsonString = "[" + jsonString.ToString() + "]";
- List<Model.ClsPay_SingleBalBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsPay_SingleBalBillSub>>(jsonString);
- return list;
- }
- /// <summary>
- /// 澶勭悊鏂板妯″叿瀵垮懡璋冩暣鍗曚富琛ㄧ殑json
+ /// 澶勭悊鏂板妯″叿瀵垮懡璋冩暣鍗曞瓙琛ㄧ殑json
/// </summary>
/// <param name="jsonString"></param>
/// <returns></returns>
@@ -1351,7 +1327,6 @@
List<Model.ClsSc_MouldLifeChangeBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldLifeChangeBillMain>>(jsonString);
return list;
}
-
/// <summary>
/// 澶勭悊鏂板妯″叿瀵垮懡璋冩暣鍗曞瓙琛ㄧ殑json
@@ -1815,5 +1790,19 @@
List<Models.ClsKf_ICStockBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsKf_ICStockBillSub>>(jsonString);
return list;
}
+
+ //宸ヨ祫绠$悊 宸ヨ祫缁撶畻鍗�
+ public List<Models.ClsPay_SingleBalBillMain> getObjectByJson_Pay_SingleBalBillMain(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Models.ClsPay_SingleBalBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_SingleBalBillMain>>(jsonString);
+ return list;
+ }
+ public List<Models.ClsPay_SingleBalBillSub> getObjectByJson_Pay_SingleBalBillSub(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Models.ClsPay_SingleBalBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_SingleBalBillSub>>(jsonString);
+ return list;
+ }
}
}
\ No newline at end of file
diff --git "a/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillMain.cs" "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillMain.cs"
new file mode 100644
index 0000000..cc236f1
--- /dev/null
+++ "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillMain.cs"
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WebAPI.Models
+{
+ public class ClsPay_SingleBalBillMain:DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HGroupID;// int //班组ID
+ public Int64 HDeptID;// int //
+ public Int64 HEmpID;// int
+ public Int64 HPayType;// int //工资类型
+ public string HExplanation;// varchar(200) --摘要
+ public string HInnerBillNo;// varchar(50) --内部单据号
+ public bool HSaveFlag;
+ }
+}
diff --git "a/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillSub.cs" "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillSub.cs"
new file mode 100644
index 0000000..e05a623
--- /dev/null
+++ "b/WebAPI/Models/\345\267\245\350\265\204\347\256\241\347\220\206/ClsPay_SingleBalBillSub.cs"
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WebAPI.Models
+{
+ public class ClsPay_SingleBalBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+ public DateTime HEntryCloseDate;// datetime --行关闭 (默认为'') new
+ public string HRemark;// varchar(200) --备注
+ public Int64 HMaterID;// int --物料ID
+ public Int64 HProcID;// int --工序ID
+ public Int64 HEmpID;// int --职员ID
+ public double HTimes;// decimal(18,8) --工时
+ public double HQty;// decimal(18,8) --数量
+ public double HPrice;// decimal(18,8) --工价
+
+ public Single HPriceRate;// money -- 定额浮动比率
+ public Single HSubsidyTotal;// money -- 补贴合计
+ public Single HDeuctTotal;// money -- 扣款小计
+
+ public double HMoney;// decimal(18,8) --金额
+ public Int64 HICMOInterID;// int --生产任务单ID
+ public string HICMOBillNo;// varchar(50) --生产任务单号
+ public Int64 HProcReportInterID;// int --工序汇报单ID
+ public Int64 HProcReportEntryID;// int --工序汇报单子ID
+ public string HProcReportBillNo;// varchar(50) --工序汇报单号
+ public Int64 HProcPlanInterID;// int --工序计划单ID
+ public Int64 HProcPlanEntryID;// int --工序计划单子ID
+ public string HProcPlanBillNo;// varchar(50) --工序计划单号
+ public Int64 HSourceID;
+ public long HSubsidyID;// money -- 补贴合计
+ public long HDeuctID;// money -- 扣款小计
+ public double HPackQty;// dec(18,8) --包装数量 --addnew
+ public double HPackPrice;// dec(18,8) --包装单价 --addnew
+ public double HPackMoney;// dec(18,8) --包装金额 --addnew
+ public Int64 HPackMaterID;// int --包装类型 --addnew
+ public double HSubsidyQty;
+ public double HSubsidyMoney;
+ public double HSqty;
+ }
+}
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index cfc3b1b..23b1502 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -352,7 +352,7 @@
<Compile Include="Controllers\PurchaseOrderController.cs" />
<Compile Include="Controllers\QC_POStockInCheckBillController.cs" />
<Compile Include="Controllers\Pay_WorkTimesBillController.cs" />
- <Compile Include="Controllers\Pay_SingleBalBillController.cs" />
+ <Compile Include="Controllers\宸ヨ祫绠$悊\Pay_SingleBalBillController.cs" />
<Compile Include="Controllers\ProductionOrderController.cs" />
<Compile Include="Controllers\PublicPageMethodController.cs" />
<Compile Include="Controllers\ReportFromController.cs" />
@@ -472,6 +472,8 @@
<Compile Include="Models\ClsKf_MateOutBillSub.cs" />
<Compile Include="Models\ClsOA_InformBillMain.cs" />
<Compile Include="Models\ClsOA_InformBillSub.cs" />
+ <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_SingleBalBillMain.cs" />
+ <Compile Include="Models\宸ヨ祫绠$悊\ClsPay_SingleBalBillSub.cs" />
<Compile Include="Models\ClsSb_EquipDotCheckRuleBillMain.cs" />
<Compile Include="Models\ClsSb_EquipDotCheckRuleBillSub.cs" />
<Compile Include="Models\ClsSb_EquipMaintainRuleBillMain.cs" />
--
Gitblit v1.9.1