From af141f4039f0484697f54a15c402915b19cdaa7c Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 02 四月 2024 14:43:34 +0800
Subject: [PATCH] 网页版: 增加 岗位技能清单 的单据编辑模块 以及 单据列表 模块;
---
DAL/工资管理/ClsHR_PostSkillBill.cs | 216 +++++++++++
WebAPI/ListModels.cs | 25 +
DAL/DAL.csproj | 1
WebAPI/Controllers/工资管理/HR_PostSkillBillController.cs | 817 +++++++++++++++++++++++++++++++++++++++++++
Model/Model.csproj | 2
Model/工资管理/ClsHR_PostSkillBillMain.cs | 13
Model/工资管理/ClsHR_PostSkillBillSub.cs | 13
WebAPI/WebAPI.csproj | 1
8 files changed, 1,088 insertions(+), 0 deletions(-)
diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index f9bbc8e..2997a73 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -126,6 +126,7 @@
<Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_QCCheckProject_View.cs" />
<Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_StdWorkTimes_Ctl.cs" />
<Compile Include="鍩虹璧勬枡\鍏朵粬鍩虹璧勬枡\ClsGy_SupMaterial_Ctl.cs" />
+ <Compile Include="宸ヨ祫绠$悊\ClsHR_PostSkillBill.cs" />
<Compile Include="婧愬崟\ERP婧愬崟\Cls_S_Sc_ABJJD.cs" />
<Compile Include="婧愬崟\InterFace婧愬崟\Cls_S_IF_ICMOBillList.cs" />
<Compile Include="婧愬崟\InterFace婧愬崟\Cls_S_IF_ProcessReportBillList.cs" />
diff --git "a/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBill.cs" "b/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBill.cs"
new file mode 100644
index 0000000..7401cd1
--- /dev/null
+++ "b/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBill.cs"
@@ -0,0 +1,216 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+ public class ClsHR_PostSkillBill : DBUtility.ClsXt_BaseBill
+ {
+ public Model.ClsHR_PostSkillBillMain omodel = new Model.ClsHR_PostSkillBillMain();
+ public List<Model.ClsHR_PostSkillBillSub> DetailColl = new List<Model.ClsHR_PostSkillBillSub>();
+
+ public ClsHR_PostSkillBill()
+ {
+ base.MvarItemKeySub = "HR_PostSkillBillSub";
+ base.MvarItemKeySub2 = "";
+ base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub4 = "";
+ base.MvarItemKey="HR_PostSkillBillMain";
+ base.MvarReportTitle="宀椾綅鎶�鑳芥竻鍗�";
+ base.BillType="2331";
+ base.HBillSubType = "2331";
+
+ }
+
+ #region 鍥哄畾浠g爜
+
+ ~ClsHR_PostSkillBill()
+ {
+ DetailColl = null;
+ }
+
+ #endregion 鑷畾涔夋柟娉�
+ //淇敼鍗曟嵁
+ public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ //
+ oCn.BeginTran();
+ //鏇存柊涓昏〃
+ oCn.RunProc("UpDate HR_PostSkillBillMain set " +
+ " HBillNo='" + omodel.HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + omodel.HDate + "'" +
+ ",HYear='" + omodel.HYear.ToString() + "'" +
+ ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
+ ",HRemark='" + omodel.HRemark + "'" +
+ ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HDeptID='" + omodel.HDeptID.ToString() +
+ "',HPostID='" + omodel.HPostID.ToString() +
+ "',HOrgID='" + omodel.HOrgID.ToString() + "'" +
+ " where HInterID=" + lngBillKey.ToString());
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎瀛愯〃
+ DeleteBillSub(lngBillKey);
+ //鎻掑叆瀛愯〃
+ omodel.HInterID = lngBillKey;
+ foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into HR_PostSkillBillSub " +
+ " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HPostSkillid,HSkillLev" +
+
+ ") 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() +
+ "," + oSub.HPostSkillid.ToString() + "," + oSub.HSkillLev.ToString() +
+ ") ");
+ }
+
+ sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+ //鏂板鍗曟嵁
+ public override bool AddBill(ref string sReturn)
+ {
+ try
+ {
+
+ //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+ oCn.BeginTran();
+ //涓昏〃
+ oCn.RunProc("Insert Into HR_PostSkillBillMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HDeptID,HPostID,HOrgID" +
+
+ ") " +
+ " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
+ ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
+ ",'" + omodel.HDeptID.ToString() + "'," + omodel.HPostID.ToString() + "," + omodel.HOrgID.ToString() +
+
+ ") ");
+ //鎻掑叆瀛愯〃
+ foreach (Model.ClsHR_PostSkillBillSub oSub in DetailColl)
+ {
+ oCn.RunProc("Insert into HR_PostSkillBillSub " +
+ " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+ ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+ ",HPostSkillid,HSkillLev" +
+
+ ") 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() +
+ "," + oSub.HPostSkillid.ToString() + ",'" + oSub.HSkillLev.ToString() +
+ "') ");
+ }
+
+ 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 HR_PostSkillBillMain Where HInterID=" + lngBillKey.ToString(), "HR_PostSkillBillMain");
+ 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.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
+ omodel.HPostID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPostID"]);
+ omodel.HOrgID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"]);
+
+ //
+
+ //寰幆
+ DataSet DsSub ;
+ DsSub = oCn.RunProcReturn("Select * from HR_PostSkillBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "HR_PostSkillBillSub");
+ DetailColl.Clear();//娓呯┖
+ for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
+ {
+ Model.ClsHR_PostSkillBillSub oSub = new Model.ClsHR_PostSkillBillSub();
+ // 鍥哄畾璧嬪��===============================================
+ 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();
+ //===================================================
+ oSub.HPostSkillid = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPostSkillid"]);
+ oSub.HSkillLev = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSkillLev"]);
+ 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 541e715..30b87d6 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -478,6 +478,8 @@
<Compile Include="宸ヨ祫绠$悊\ClsPay_SubsidyChangeBillSub.cs" />
<Compile Include="宸ヨ祫绠$悊\ClsPay_SumBalBillMain .cs" />
<Compile Include="宸ヨ祫绠$悊\ClsPay_SumBalBillSub.cs" />
+ <Compile Include="宸ヨ祫绠$悊\ClsHR_PostSkillBillMain.cs" />
+ <Compile Include="宸ヨ祫绠$悊\ClsHR_PostSkillBillSub.cs" />
<Compile Include="搴旀敹绠$悊\ClsYS_ReceiveOtherBillSub.cs" />
<Compile Include="鎴愭湰绠$悊\ClsCB_ChangeMoneyBillMain.cs" />
<Compile Include="鎴愭湰绠$悊\ClsCB_ChangeMoneyBillSub.cs" />
diff --git "a/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillMain.cs" "b/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillMain.cs"
new file mode 100644
index 0000000..b9c6669
--- /dev/null
+++ "b/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillMain.cs"
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsHR_PostSkillBillMain : DBUtility.ClsXt_BaseBillMain
+ {
+ public Int64 HDeptID;// 部门
+ public Int64 HPostID;// 岗位
+ public Int64 HOrgID; //组织
+ }
+}
diff --git "a/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillSub.cs" "b/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillSub.cs"
new file mode 100644
index 0000000..7a1d23f
--- /dev/null
+++ "b/Model/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_PostSkillBillSub.cs"
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+ public class ClsHR_PostSkillBillSub : DBUtility.ClsXt_BaseBillSub
+ {
+
+ public Int64 HPostSkillid;// int 岗位技能编码
+ public Int64 HSkillLev;// int 能力等级需求
+ }
+}
diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/HR_PostSkillBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/HR_PostSkillBillController.cs"
new file mode 100644
index 0000000..e9b2561
--- /dev/null
+++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/HR_PostSkillBillController.cs"
@@ -0,0 +1,817 @@
+锘縰sing Newtonsoft.Json;
+using 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 HR_PostSkillBillController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ public const string ModName = "2331"; //鍗曟嵁绫诲瀷
+ public const string ModCaption = "宀椾綅鎶�鑳芥竻鍗�"; //鍗曟嵁鍚嶇О
+ public const string ModRightName = "HR_PostSkillBillMain";
+ public const string ModRightNameQuery = ModRightName + "_Query"; //鏌ヨ
+ public const string ModRightNameEdit = ModRightName + "_Edit"; //缂栬緫
+ public const string ModRightNameCheck = ModRightName + "_Check"; //瀹℃牳
+ public const string ModRightNameClose = ModRightName + "_Close"; //鍏抽棴
+ public const string ModRightNameDelete = ModRightName + "_Delete"; //浣滃簾
+ public const string ModRightNameDrop = ModRightName + "_Drop"; //鍒犻櫎
+ public DataSet ds = new DataSet();
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ public DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill();
+ public DAL.ClsHR_PostSkillBill BillNew = new DAL.ClsHR_PostSkillBill(); //瀵瑰簲鍗曟嵁绫�
+ public DAL.ClsHR_PostSkillBill BillOld = new DAL.ClsHR_PostSkillBill(); //瀵瑰簲鍗曟嵁绫�
+
+ // HR_PostSkillBill HR_PostSkillBillMain
+ #region 宀椾綅鎶�鑳芥竻鍗曞垪琛�
+ /// <summary>
+ /// 鑾峰彇宀椾綅鎶�鑳芥竻鍗曞垪琛ㄤ俊鎭�
+ /// </summary>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/GetHR_PostSkillBillList")]
+ [HttpGet]
+ public object GetHR_PostSkillBillList(string sWhere, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameQuery, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩斿洖鍒楄〃淇℃伅
+ ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 " + sWhere + " order by hmainid desc", "h_v_HR_PostSkillBillMainList");
+ List<object> columnNameList = new List<object>();
+ //娣诲姞鍒楀悕
+ 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 = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗曞垹闄�
+ /// <summary>
+ /// 鍒犻櫎宀椾綅鎶�鑳芥竻鍗�
+ /// </summary>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/DeleteHR_PostSkillBill")]
+ [HttpGet]
+ public object DeleteHR_PostSkillBill(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDrop, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍒犻櫎鍔熻兘鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_HR_PostSkillBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + HMaker + "'";
+ ds = oCn.RunProcReturn(sql1, "h_p_YS_ReceiveOtherBill_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 (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterDelCtrl", HMaker, 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;
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ矖浣嶆妧鑳芥竻鍗曪紝璇峰埛鏂版暟鎹悗閲嶆柊閫夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗曞鏍�/鍙嶅鏍�
+ /// <summary>
+ /// 瀹℃牳/鍙嶅鏍稿矖浣嶆妧鑳芥竻鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">瀹℃牳(1),鍙嶅鏍�(2)</param>
+ /// <param name="HMaker">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/AuditHR_PostSkillBill")]
+ [HttpGet]
+ public object AuditHR_PostSkillBill(Int64 HInterID, int IsAudit, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡瀹℃牳/鍙嶅鏍稿姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+ DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill(); //瀹炰緥鍖栧崟鎹搷浣滅被锛岀敤浜庤繘琛岀浉鍏虫搷浣�
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (IsAudit == 1)
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍革紝涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (IsAudit == 1) //瀹℃牳鍒ゆ柇
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsAudit == 2) //鍙嶅鏍稿垽鏂�
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ string sql1 = "exec h_p_HR_PostSkillBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
+ ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ oCn.RollBack();
+ 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;
+ oCn.RollBack();
+ return objJsonResult;
+ }
+ //==================================================================================
+
+ //瀹℃牳鍗曟嵁
+ if (!oBill.CheckBill(HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterCheckCtrl", HMaker, 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 = "鍗曟嵁鍙凤細"+ oBill.omodel.HBillNo+ " 瀹℃牳鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍革紝涓嶉渶瑕佸弽瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ string sql1 = "exec h_p_HR_PostSkillBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + HMaker + "'";
+ ds = oCn.RunProcReturn(sql1, "h_p_HR_PostSkillBill_BeforeUnCheckCtrl");
+ 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 (!oBill.AbandonCheck(HInterID, oBill.omodel.HBillNo, "h_p_HR_PostSkillBill_AfterUnCheckCtrl", HMaker, 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 = "鍗曟嵁鍙凤細" + oBill.omodel.HBillNo + " 鍙嶅鏍告垚鍔燂紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ矖浣嶆妧鑳芥竻鍗曪紝璇峰埛鏂版暟鎹悗閲嶆柊閫夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鎴栧弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗曞叧闂�/鍙嶅叧闂�
+ /// <summary>
+ /// 鍏抽棴/鍙嶅叧闂矖浣嶆妧鑳芥竻鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">鍏抽棴(1),鍙嶅叧闂�(2)</param>
+ /// <param name="HMaker">鍏抽棴浜�</param>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/CloseHR_PostSkillBill")]
+ [HttpGet]
+ public object CloseHR_PostSkillBill(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameClose, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鍏抽棴/鍙嶅叧闂姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘杩涜鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HChecker.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶈兘杩涜鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (oBill.omodel.HCloseMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插叧闂紝涓嶈兘鍐嶆鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍏抽棴鍗曟嵁
+ if (!oBill.CloseBill(HInterID, oBill.omodel.HBillNo, HMaker, 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; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HCloseMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈叧闂紝涓嶉渶瑕佸弽鍏抽棴锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶅叧闂崟鎹�
+ if (!oBill.CancelClose(HInterID, oBill.omodel.HBillNo, HMaker, 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; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ矖浣嶆妧鑳芥竻鍗曪紝璇峰埛鏂版暟鎹悗閲嶆柊閫夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍏抽棴鎴栧弽鍏抽棴澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗曚綔搴�/鍙嶄綔搴�
+ /// <summary>
+ /// 浣滃簾/鍙嶄綔搴熷矖浣嶆妧鑳芥竻鍗�
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="Type">浣滃簾(1),鍙嶄綔搴�(2)</param>
+ /// <param name="HMaker">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/DropHR_PostSkillBill")]
+ [HttpGet]
+ public object DropHR_PostSkillBill(Int64 HInterID, int Type, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡浣滃簾/鍙嶄綔搴熷姛鑳芥潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍒ゆ柇瀛樺湪鎬�
+ if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+ {
+ //Type 1 浣滃簾 2 鍙嶄綔搴�
+ if (Type == 1)
+ {
+ if (oBill.omodel.HChecker.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (oBill.omodel.HDeleteMan.Trim() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶄綔搴燂紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //浣滃簾鍗曟嵁
+ if (!oBill.Cancelltion(HInterID, oBill.omodel.HBillNo, HMaker, 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; ;
+ }
+ }
+ else
+ {
+ if (oBill.omodel.HDeleteMan.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈綔搴燂紝涓嶉渶瑕佸弽浣滃簾锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鍙嶄綔搴熷崟鎹�
+ if (!oBill.AbandonCancelltion(HInterID, oBill.omodel.HBillNo, HMaker, 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; ;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ矖浣嶆妧鑳芥竻鍗曪紝璇峰埛鏂版暟鎹悗閲嶆柊閫夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾鎴栧弽浣滃簾澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗曠紪杈�
+ /// <summary>
+ /// 宀椾綅鎶�鑳芥竻鍗曠紪杈戞椂锛屾牴鎹崟鎹甀D鑾峰彇鍗曟嵁淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("HR_PostSkillBill/EditHR_PostSkillBill")]
+ [HttpGet]
+ public object EditHR_PostSkillBill(Int64 HInterID, string HMaker)
+ {
+ try
+ {
+ //鍒ゆ柇鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log(ModRightNameEdit, 3, false, HMaker))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡缂栬緫鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //杩斿洖鍒楄〃淇℃伅
+ ds = oCn.RunProcReturn("select * from h_v_HR_PostSkillBillMainList where 1=1 and hmainid=" + HInterID + " order by hmainid desc", "h_v_HR_PostSkillBillMainList");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈煡璇㈠埌璇ュ矖浣嶆妧鑳芥竻鍗曪紝璇峰埛鏂版暟鎹悗閲嶆柊閫夋嫨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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 = "杩斿洖宀椾綅鎶�鑳芥竻鍗曚俊鎭け璐ワ紒" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宀椾綅鎶�鑳芥竻鍗� 鏂板/缂栬緫
+ [Route("HR_PostSkillBill/SaveHR_PostSkillBill")]
+ [HttpPost]
+ public object SaveHR_PostSkillBill([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();//鎿嶄綔鏂瑰紡鏁版嵁绫诲瀷 1娣诲姞 3淇敼 2 澶嶅埗
+ string msg4 = sArray[3].ToString();//鐢ㄦ埛鍚�
+
+ DBUtility.ClsPub.CurUserName = msg4;
+
+ string UserName = "";
+ string s = "";
+ ListModels oListModels = new ListModels();
+ try
+ {
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("HR_PostSkillBillMain_Edit", 1, false, msg4))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ DAL.ClsHR_PostSkillBill oBill = new DAL.ClsHR_PostSkillBill();
+ List<Model.ClsHR_PostSkillBillMain> lsmain = new List<Model.ClsHR_PostSkillBillMain>();
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_HR_PostSkillBillMain(msg2);
+ foreach (Model.ClsHR_PostSkillBillMain oItem in lsmain)
+ {
+ if (refSav == "Add")
+ {
+ //鍗曟嵁鍙锋槸鍚﹂噸澶�
+ if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鍙烽噸澶嶏紒涓嶅厑璁镐繚瀛橈紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ if (refSav == "Update")
+ {
+ if (BillOld.ShowBill(oItem.HInterID, ref s) == false)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹湁璇紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹凡缁忚瀹℃牳锛屼笉鍏佽淇敼锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (BillOld.omodel.HBillStatus > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹浜庝笉鍙紪杈戠姸鎬侊紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(BillOld, ref s))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = s + "锛屼笉鍏佽淇敼";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ UserName = oItem.HMaker; //鍒跺崟浜�
+ oItem.HBillType = "2002";
+ oItem.HBillSubType = "2002";
+
+ 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"));
+
+ 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.ClsHR_PostSkillBillSub> ls = new List<Model.ClsHR_PostSkillBillSub>();
+ ls = oListModels.getObjectByJson_HR_PostSkillBillSub(msg3);
+ int i = 0;
+ foreach (Model.ClsHR_PostSkillBillSub 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 bd1edac..2d02066 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -1156,6 +1156,31 @@
List<Models.ClsGy_StockCheckItemBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_StockCheckItemBill>>(jsonString);
return list;
}
+
+ /// <summary>
+ /// 澶勭悊鏂板矖浣嶆妧鑳芥竻鍗曚富琛ㄧ殑json
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsHR_PostSkillBillMain> getObjectByJson_HR_PostSkillBillMain(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsHR_PostSkillBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillMain>>(jsonString);
+ return list;
+ }
+
+ /// <summary>
+ /// 澶勭悊鏂板矖浣嶆妧鑳芥竻鍗曞瓙琛ㄧ殑json
+ /// </summary>
+ /// <param name="jsonString"></param>
+ /// <returns></returns>
+ public List<Model.ClsHR_PostSkillBillSub> getObjectByJson_HR_PostSkillBillSub(string jsonString)
+ {
+ jsonString = "[" + jsonString.ToString() + "]";
+ List<Model.ClsHR_PostSkillBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsHR_PostSkillBillSub>>(jsonString);
+ return list;
+ }
+
/// <summary>
/// 澶勭悊鏂板鍛ㄦ�荤粨琛ㄧ殑json
/// </summary>
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 68038bc..2602e40 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -570,6 +570,7 @@
<Compile Include="Controllers\QC_POStockInCheckBillController.cs" />
<Compile Include="Controllers\宸ヨ祫绠$悊\Gy_GroupEmpBillController.cs" />
<Compile Include="Controllers\宸ヨ祫绠$悊\Pay_PurchaseWallclothBillController.cs" />
+ <Compile Include="Controllers\宸ヨ祫绠$悊\HR_PostSkillBillController.cs" />
<Compile Include="Controllers\宸ヨ祫绠$悊\Pay_WorkTimesBillController.cs" />
<Compile Include="Controllers\宸ヨ祫绠$悊\Pay_SingleBalBillController.cs" />
<Compile Include="Controllers\ProductionOrderController.cs" />
--
Gitblit v1.9.1