王 垚
2021-12-06 d5ca00ae21018adf8987bde8b2ab4dc7c9a3fc7f
工资结算单(其他)
4个文件已添加
4个文件已修改
1个文件已删除
2 文件已重命名
1325 ■■■■■ 已修改文件
WebAPI/Controllers/Pay_GroupBalBillController.cs 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Pay_OtherBalBillController.cs 337 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/工资管理/Pay_OtherBalBillController.cs 369 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/工资管理/Pay_SingleBalBillController.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/工资管理/ClsPay_GroupBalBill.cs 356 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/工资管理/ClsPay_OtherBalBill.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/工资管理/ClsPay_SingleBalBill.cs 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/工资管理/ClsPay_OtherBalBillMain.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/工资管理/ClsPay_OtherBalBillSub.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Pay_GroupBalBillController.cs
@@ -113,164 +113,7 @@
            return objJsonResult;
        }
        #endregion
        /// <summary>
        /// æ–°å¢žå•据-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Pay_GroupBalBill/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_GroupBalBill> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_GroupBalBill>>(msg2);
                string HBillType = "2202";
                long HInterID = mainList[0].HInterID;//递入type得到的单据ID
                string HBillNo = mainList[0].HBillNo;//递入type得到的单据号
                DateTime HDate = mainList[0].HDate;//日期
                int HYear = 2021;
                double HPeriod = 1;
                string HRemark = mainList[0].HRemark;//备注
                string HBillSubType = "2202";
                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;
                decimal HOtherSubsidy = mainList[0].HOtherSubsidy;
                decimal HOtherDeduct = mainList[0].HOtherDeduct;
                decimal HSumMoney = mainList[0].HSumMoney;
                decimal HPayMoney = mainList[0].HPayMoney;
                long HEmpID = mainList[0].HEmpID;
                long HPayType = mainList[0].HPayType;
                //long HMaterTypeID = 0;
                int HPRDORGID = mainList[0].HPRDORGID;  //组织
                //主表
                oCN.RunProc("Insert Into Pay_GroupBalBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HGroupID,HDeptID,HPayType,HOtherSubsidy" +
                ",HOtherDeduct,HSumMoney,HPayMoney" +
                ",HExplanation,HInnerBillNo" +
                ") " +
                " values('" + HBillType + "','" + HBillSubType + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HDate + "'" +
                ", " + HYear.ToString() + "," + HPeriod.ToString() + ",'" + HRemark + "','" + HMaker + "',getdate()" +
                ", " + HGroupID.ToString() + "," + HDeptID.ToString() + "," + HPayType.ToString() + "," + HOtherSubsidy.ToString() +
                "," + HOtherDeduct.ToString() + "," + HSumMoney.ToString() + "," + HPayMoney.ToString() +
                ",'" + HExplanation + "','" + HInnerBillNo + "'" +
                ") ");
                //保存子表
                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_GroupBalBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pay_GroupBalBillSub>>(msg3);
            for (int i = 0; i < subList.ToArray().Length; i++)
            {
                long HEntryID = subList[0].HEntryID;//工段ID
                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 HMaterID = subList[0].HMaterID;
                long HProcID = subList[0].HProcID;
                long HUnitID = subList[0].HUnitID;
                decimal HTimes = subList[0].HTimes;
                decimal HQty = subList[0].HQty;
                decimal HPrice = subList[0].HPrice;
                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_GroupBalBillSub " +
                      " (HInterID,HEntryID,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HUnitID,HProcID,HTimes,HQty,HPrice,HSourceID" +
                      ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" +
                      ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSqty" +
                      ") values("
                      + HInterID.ToString() + "," + HEntryID.ToString() + ",'" + HRemark + "'" +
                      "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "'," + HRelationQty.ToString() + "," + HRelationMoney.ToString() +
                      "," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HProcID.ToString() + "," + HTimes.ToString() + "," + HQty.ToString() + "," + HPrice.ToString() + "," + HSourceID.ToString() +
                      "," + HMoney.ToString() + "," + HICMOInterID.ToString() + ",'" + HICMOBillNo + "'," + HProcReportInterID.ToString() + "," + HProcReportEntryID.ToString() + ",'" + HProcReportBillNo + "'" +
                      "," + HProcPlanInterID.ToString() + "," + HProcPlanEntryID.ToString() + ",'" + HProcPlanBillNo + "'," + HSqty.ToString() +
                      ") ";
            oCN.RunProc(sql);
            }
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = null;
            objJsonResult.data = null;
            return objJsonResult;
        }
        /// <summary>
        ///工资结算个人单删除功能
        /// </summary>
WebAPI/Controllers/Pay_OtherBalBillController.cs
File was deleted
WebAPI/Controllers/¹¤×ʹÜÀí/Pay_OtherBalBillController.cs
New file
@@ -0,0 +1,369 @@
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 Pay_OtherBalBillController : 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;
        public DLL.ClsPay_OtherBalBill BillNew0 = new DLL.ClsPay_OtherBalBill();   //
        public DLL.ClsPay_OtherBalBill BillOld0 = new DLL.ClsPay_OtherBalBill();   //
        /// <summary>
        /// è¿”回工资结算个人列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Pay_OtherBalBill/GetOtherBalBill")]
        [HttpGet]
        public object GetOtherBalBill(string sWhere)
        {
            try
            {
                ds = Sc_GetOtherBalBill(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_GetOtherBalBill(string sWhere)
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_OtherBalBillList order by æ—¥æœŸ desc", "h_v_Pay_OtherBalBillList");
            }
            else
            {
                string sql1 = "select * from h_v_Pay_OtherBalBillList where 1 = 1 ";
                string sql = sql1 + sWhere + "order by æ—¥æœŸ desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_OtherBalBillList");
            }
        }
        #region[工资结算个人单编辑时获取表头数据]
        [Route("Pay_OtherBalBill/Pay_OtherBalBillListCheckDetail")]
        [HttpGet]
        public ApiResult<DataSet> Pay_OtherBalBillListCheckDetail(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_OtherBalBillList  where hmainid= " + HID + " ", "h_v_Pay_OtherBalBillList");
            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_OtherBalBill/Pay_OtherBalBillListProjectDetai")]
        [HttpGet]
        public object Pay_OtherBalBillListProjectDetai(string sqlWhere)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql1 = "SELECT HMaterID,HMaterCode,HMaterName, HDeptID,部门代码,部门" +
                    ",HGroupID,班组代码,班组,工资类型,摘要,内部单据号,表头备注,制单人,制单日期" +
                    ",审核人,审核日期,修改人,修改日期,关闭人, å…³é—­æ—¥æœŸ,HProcID,HProcNumber,HProcName" +
                    ",HEmpID,HEmpNumber,HEmpName,工时 HTimes ,数量 HQty,工价 HPrice,金额 HMoney ,表体备注 as HRemark FROM h_v_Pay_OtherBalBillList where 1 = 1 ";
                string sql = sql1 + sqlWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Pay_OtherBalBillList");
                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
        [Route("Pay_OtherBalBill/SaveGetOtherBalBillList")]
        [HttpPost]
        /// <summary>
        /// æ–°å¢žå•据-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        public object SaveGetOtherBalBillList([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_OtherBalBill oBill = new DLL.ClsPay_OtherBalBill();
                List<Models.ClsPay_OtherBalBillMain> lsmain = new List<Models.ClsPay_OtherBalBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Pay_OtherBalBillMain(msg2);
                foreach (Models.ClsPay_OtherBalBillMain 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 = "2206";
                    oItem.HBillSubType = "2206";
                    //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 = "";     //验收结论--(正常,异常)
                    //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_OtherBalBillSub> ls = new List<Models.ClsPay_OtherBalBillSub>();
                ls = oListModels.getObjectByJson_Pay_OtherBalBillSub(msg3);
                int i = 0;
                foreach (Models.ClsPay_OtherBalBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    mouldid = oItemSub.HMaterID;
                    //oItemSub.HRepairCheckID = 0;   //验收项目ID
                    //oItemSub.HRepairCheckContent = ""; //验收内容
                    //oItemSub.HManagerID = 0;   //负责人ID
                    //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_OtherBalBill/DeltetOtherBalBill")]
        [HttpGet]
        public object Pay_OtherBalBill(string HInterID)
        {
            try
            {
                oCN.BeginTran();
                oCN.RunProc("Delete From Pay_OtherBalBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Pay_OtherBalBillSub 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_OtherBalBill/getOtherBalBillPrice")]
        [HttpGet]
        public object getOtherBalBillPrice(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;
            }
        }
        //
    }
}
WebAPI/Controllers/¹¤×ʹÜÀí/Pay_SingleBalBillController.cs
@@ -113,10 +113,11 @@
            }
            return objJsonResult;
        }
        #endregion
        [Route("Pay_SingleBalBill/SaveGetSingleBalBillList")]
        [HttpPost]
        #endregion
        /// <summary>
        /// æ–°å¢žå•据-保存按钮
        ///参数:string sql。
WebAPI/DLL/¹¤×ʹÜÀí/ClsPay_GroupBalBill.cs
New file
@@ -0,0 +1,356 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsPay_GroupBalBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsPay_GroupBalBillMain omodel = new Model.ClsPay_GroupBalBillMain();
        public List<Model.ClsPay_GroupBalBillSub> DetailColl = new List<Model.ClsPay_GroupBalBillSub>();
        public List<Model.ClsPay_GroupBalBillEmp> DetailEmpColl = new List<Model.ClsPay_GroupBalBillEmp>();
        public ClsPay_GroupBalBill()
        {
            base.MvarItemKeySub = "Pay_GroupBalBillSub";
            base.MvarItemKeySub2 = "Pay_GroupBalBillEmp";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey = "Pay_GroupBalBillMain";
            base.MvarReportTitle = "工资结算单(班组)";
            base.BillType = "2202";
            base.HBillSubType = "2202";
        }
        #region å›ºå®šä»£ç 
        ~ClsPay_GroupBalBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Pay_GroupBalBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HDeptID=" + omodel.HDeptID.ToString() +
                ",HOtherSubsidy=" + omodel.HOtherSubsidy.ToString() +
                ",HOtherDeduct=" + omodel.HOtherDeduct.ToString() +
                ",HSumMoney=" + omodel.HSumMoney.ToString() +
                ",HPayMoney=" + omodel.HPayMoney.ToString() +
                ",HPayType=" + omodel.HPayType.ToString() +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                DeleteBillSub2(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsPay_GroupBalBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Pay_GroupBalBillSub " +
                      " (HInterID,HEntryID,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HUnitID,HProcID,HTimes,HQty,HPrice,HSourceID" +
                      ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" +
                      ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSqty" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HSourceID.ToString() +
                      "," + oSub.HMoney.ToString() + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HProcReportInterID.ToString() + "," + oSub.HProcReportEntryID.ToString() + ",'" + oSub.HProcReportBillNo + "'" +
                      "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'," + oSub.HSqty.ToString() +
                      ") ");
                }
                //
                //插入子表2
                foreach (Model.ClsPay_GroupBalBillEmp oSubSec in DetailEmpColl)
                {
                    oCn.RunProc("Insert into Pay_GroupBalBillEmp " +
                      " (HInterID,HEntryID,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                        ",HEmpID,HEmpRate" +
                        ",HBaseTimes,HOverTimes,HLeaveTimes,HCTPrjID" +
                        ",HBaseDays,HOverDays,HLeaveDays,HYf" +
                        ",HMoney,HOtherSubsidy,HOtherDeduct,HIsPay,HAvgFlag" +
                        ")" +
                        " values("
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" +
                      "," + oSubSec.HSourceInterID.ToString() + "," + oSubSec.HSourceEntryID.ToString() + ",'" + oSubSec.HSourceBillNo + "','" + oSubSec.HSourceBillType + "'," + oSubSec.HRelationQty.ToString() + "," + oSubSec.HRelationMoney.ToString() +
                        "," + oSubSec.HEmpID.ToString() + "," + oSubSec.HEmpRate.ToString() +
                        "," + oSubSec.HBaseTimes.ToString() + "," + oSubSec.HOverTimes.ToString() + "," + oSubSec.HLeaveTimes.ToString() + "," + oSubSec.HCTPrjID.ToString() +
                        "," + oSubSec.HBaseDays.ToString() + "," + oSubSec.HOverDays.ToString() + "," + oSubSec.HLeaveDays.ToString() + "," + oSubSec.HYf.ToString() +
                        "," + oSubSec.HMoney.ToString() + "," + oSubSec.HOtherSubsidy.ToString() + "," + oSubSec.HOtherDeduct.ToString() + "," + Convert.ToString(oSubSec.HIsPay ? 1 : 0) + "," + Convert.ToString(oSubSec.HAvgFlag ? 1 : 0) + ") ");
                }
                //foreach (Model.ClsPay_GroupBalBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        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);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Pay_GroupBalBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HGroupID,HDeptID,HPayType,HOtherSubsidy" +
                ",HOtherDeduct,HSumMoney,HPayMoney" +
                ",HExplanation,HInnerBillNo" +
                ") " +
                " 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.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HPayType.ToString() + "," + omodel.HOtherSubsidy.ToString() +
                "," + omodel.HOtherDeduct.ToString() + "," + omodel.HSumMoney.ToString() + "," + omodel.HPayMoney.ToString() +
                ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
                ") ");
                //
                //插入子表
                foreach (Model.ClsPay_GroupBalBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Pay_GroupBalBillSub " +
                      " (HInterID,HEntryID,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HMaterID,HUnitID,HProcID,HTimes,HQty,HPrice,HSourceID" +
                      ",HMoney,HICMOInterID,HICMOBillNo,HProcReportInterID,HProcReportEntryID,HProcReportBillNo" +
                      ",HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HSqty" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HTimes.ToString() + "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HSourceID.ToString() +
                      "," + oSub.HMoney.ToString() + "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HProcReportInterID.ToString() + "," + oSub.HProcReportEntryID.ToString() + ",'" + oSub.HProcReportBillNo + "'" +
                      "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'," + oSub.HSqty.ToString() +
                      ") ");
                }
                //
                //插入子表2
                foreach (Model.ClsPay_GroupBalBillEmp oSubSec in DetailEmpColl)
                {
                    oCn.RunProc("Insert into Pay_GroupBalBillEmp " +
                      " (HInterID,HEntryID,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                        ",HEmpID,HEmpRate" +
                        ",HBaseTimes,HOverTimes,HLeaveTimes,HCTPrjID" +
                        ",HBaseDays,HOverDays,HLeaveDays,HYf" +
                        ",HMoney,HOtherSubsidy,HOtherDeduct,HIsPay,HAvgFlag" +
                        ")" +
                        " values("
                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" +
                      "," + oSubSec.HSourceInterID.ToString() + "," + oSubSec.HSourceEntryID.ToString() + ",'" + oSubSec.HSourceBillNo + "','" + oSubSec.HSourceBillType + "'," + oSubSec.HRelationQty.ToString() + "," + oSubSec.HRelationMoney.ToString() +
                        "," + oSubSec.HEmpID.ToString() + "," + oSubSec.HEmpRate.ToString() +
                        "," + oSubSec.HBaseTimes.ToString() + "," + oSubSec.HOverTimes.ToString() + "," + oSubSec.HLeaveTimes.ToString() + "," + oSubSec.HCTPrjID.ToString() +
                        "," + oSubSec.HBaseDays.ToString() + "," + oSubSec.HOverDays.ToString() + "," + oSubSec.HLeaveDays.ToString() + "," + oSubSec.HYf.ToString() +
                        "," + oSubSec.HMoney.ToString() + "," + oSubSec.HOtherSubsidy.ToString() + "," + oSubSec.HOtherDeduct.ToString() + "," + Convert.ToString(oSubSec.HIsPay ? 1 : 0) + "," + Convert.ToString(oSubSec.HAvgFlag ? 1 : 0) + ") ");
                }
                //
                //foreach (Model.ClsPay_GroupBalBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_GroupBalBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        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 Pay_GroupBalBillMain Where HInterID=" + lngBillKey.ToString(), "Pay_GroupBalBillMain");
                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.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                omodel.HPayType = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPayType"]);
                omodel.HOtherSubsidy = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HOtherSubsidy"]);
                omodel.HOtherDeduct = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HOtherDeduct"]);
                omodel.HSumMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSumMoney"]);
                omodel.HPayMoney = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HPayMoney"]);
                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
                omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
                //
                //循环
                DataSet DsSub;
                DsSub = oCn.RunProcReturn("Select * from Pay_GroupBalBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Pay_GroupBalBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsPay_GroupBalBillSub oSub = new Model.ClsPay_GroupBalBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    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.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
                    oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
                    oSub.HProcID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcID"]);
                    oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
                    oSub.HTimes = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HTimes"]);
                    oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
                    oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]);
                    oSub.HMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HMoney"]);
                    oSub.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]);
                    oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]);
                    oSub.HProcReportInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcReportInterID"]);
                    oSub.HProcReportEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcReportEntryID"]);
                    oSub.HProcReportBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcReportBillNo"]);
                    oSub.HProcPlanInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanInterID"]);
                    oSub.HProcPlanEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcPlanEntryID"]);
                    oSub.HProcPlanBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcPlanBillNo"]);
                    oSub.HSqty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSqty"]);
                    DetailColl.Add(oSub);
                }
                //循环子表2
                DataSet DsSubSec = new DataSet();
                DsSubSec = oCn.RunProcReturn("Select * from Pay_GroupBalBillEmp Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Pay_GroupBalBillMain");
                DetailEmpColl.Clear();//清空
                for (int i = 0; i < DsSubSec.Tables[0].Rows.Count; i++)
                {
                    Model.ClsPay_GroupBalBillEmp oSubSec = new Model.ClsPay_GroupBalBillEmp();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSubSec.HInterID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HInterID"]);
                    oSubSec.HEntryID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HEntryID"]);
                    oSubSec.HSourceInterID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HSourceInterID"]);
                    oSubSec.HSourceEntryID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSubSec.HSourceBillType = DsSubSec.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                    oSubSec.HSourceBillNo = DsSubSec.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                    oSubSec.HRelationQty = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HRelationQty"]);
                    oSubSec.HRelationMoney = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HRelationMoney"]);
                    oSubSec.HCloseMan = DBUtility.ClsPub.isStrNull(DsSubSec.Tables[0].Rows[i]["HCloseMan"]);
                    oSubSec.HCloseType = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HCloseType"]);
                    oSubSec.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSubSec.Tables[0].Rows[i]["HEntryCloseDate"]);
                    oSubSec.HRemark = DsSubSec.Tables[0].Rows[i]["HRemark"].ToString().Trim();
                    //===================================================
                    oSubSec.HEmpID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HEmpID"]);
                    oSubSec.HCTPrjID = DBUtility.ClsPub.isLong(DsSubSec.Tables[0].Rows[i]["HCTPrjID"]);
                    oSubSec.HEmpRate = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HEmpRate"]);
                    oSubSec.HBaseTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HBaseTimes"]);
                    oSubSec.HOverTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOverTimes"]);
                    oSubSec.HLeaveTimes = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HLeaveTimes"]);
                    oSubSec.HBaseDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HBaseDays"]);
                    oSubSec.HOverDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOverDays"]);
                    oSubSec.HLeaveDays = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HLeaveDays"]);
                    oSubSec.HMoney = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HMoney"]);
                    oSubSec.HOtherSubsidy = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOtherSubsidy"]);
                    oSubSec.HOtherDeduct = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HOtherDeduct"]);
                    oSubSec.HYf = DBUtility.ClsPub.isDoule(DsSubSec.Tables[0].Rows[i]["HYf"]);
                    oSubSec.HIsPay = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HIsPay"]);
                    oSubSec.HAvgFlag = DBUtility.ClsPub.isBool(DsSubSec.Tables[0].Rows[i]["HAvgFlag"]);
                    //
                    DetailEmpColl.Add(oSubSec);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
WebAPI/DLL/¹¤×ʹÜÀí/ClsPay_OtherBalBill.cs
File was renamed from WebAPI/DLL/ClsPay_OtherBalBill.cs
@@ -3,12 +3,12 @@
using System.Text;
using System.Data;
namespace DAL
namespace WebAPI.DLL
{
    public class ClsPay_OtherBalBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsPay_OtherBalBillMain omodel = new Model.ClsPay_OtherBalBillMain();
        public List<Model.ClsPay_OtherBalBillSub> DetailColl = new List<Model.ClsPay_OtherBalBillSub>();
        public Models.ClsPay_OtherBalBillMain omodel = new Models.ClsPay_OtherBalBillMain();
        public List<Models.ClsPay_OtherBalBillSub> DetailColl = new List<Models.ClsPay_OtherBalBillSub>();
        public ClsPay_OtherBalBill()
        {
@@ -61,7 +61,7 @@
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsPay_OtherBalBillSub oSub in DetailColl)
                foreach (Models.ClsPay_OtherBalBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Pay_OtherBalBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
@@ -83,7 +83,7 @@
                      ") ");
                }
                //
                //foreach (Model.ClsPay_SingleBalBillSub oSub in DetailColl)
                //foreach (Models.ClsPay_SingleBalBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_SingleBalBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
@@ -117,15 +117,15 @@
                //主表
                oCn.RunProc("Insert Into Pay_OtherBalBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HSaveFlag" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HGroupID,HDeptID,HEmpID,HPayType,HExplanation,HInnerBillNo" +
                ") " +
                " 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.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ", " + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HPayType.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsPay_OtherBalBillSub oSub in DetailColl)
                foreach (Models.ClsPay_OtherBalBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Pay_OtherBalBillSub " +
                      " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
@@ -147,7 +147,7 @@
                      ") ");
                }
                //
                //foreach (Model.ClsPay_SingleBalBillSub oSub in DetailColl)
                //foreach (Models.ClsPay_SingleBalBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Pay_SingleBalBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
@@ -224,7 +224,7 @@
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsPay_OtherBalBillSub oSub = new Model.ClsPay_OtherBalBillSub();
                    Models.ClsPay_OtherBalBillSub oSub = new Models.ClsPay_OtherBalBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
WebAPI/DLL/¹¤×ʹÜÀí/ClsPay_SingleBalBill.cs
WebAPI/ListModels.cs
@@ -1791,7 +1791,7 @@
            return list;
        }
        //工资管理 å·¥èµ„结算单
        //工资管理 å·¥èµ„结算单(个人)
        public List<Models.ClsPay_SingleBalBillMain> getObjectByJson_Pay_SingleBalBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
@@ -1804,5 +1804,19 @@
            List<Models.ClsPay_SingleBalBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_SingleBalBillSub>>(jsonString);
            return list;
        }
        //工资管理 å·¥èµ„结算单(其它)
        public List<Models.ClsPay_OtherBalBillMain> getObjectByJson_Pay_OtherBalBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Models.ClsPay_OtherBalBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_OtherBalBillMain>>(jsonString);
            return list;
        }
        public List<Models.ClsPay_OtherBalBillSub> getObjectByJson_Pay_OtherBalBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Models.ClsPay_OtherBalBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsPay_OtherBalBillSub>>(jsonString);
            return list;
        }
    }
WebAPI/Models/¹¤×ʹÜÀí/ClsPay_OtherBalBillMain.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WebAPI.Models
{
    public class ClsPay_OtherBalBillMain: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)         --内部单据号
    }
}
WebAPI/Models/¹¤×ʹÜÀí/ClsPay_OtherBalBillSub.cs
New file
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WebAPI.Models
{
    public class ClsPay_OtherBalBillSub: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 double HMoney;//        decimal(18,8)        --金额
        public Single HPriceRate;//         money      -- å®šé¢æµ®åŠ¨æ¯”çŽ‡
        public Single HSubsidyTotal;//         money      -- è¡¥è´´åˆè®¡
        public Single HDeuctTotal;//         money      -- æ‰£æ¬¾å°è®¡
        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;
    }
}
WebAPI/WebAPI.csproj
@@ -347,7 +347,7 @@
    <Compile Include="Controllers\MJJY\Mj_PDA_MoudlCheckController.cs" />
    <Compile Include="Controllers\MoveStockBillController.cs" />
    <Compile Include="Controllers\Open_PrintTemController.cs" />
    <Compile Include="Controllers\Pay_OtherBalBillController.cs" />
    <Compile Include="Controllers\工资管理\Pay_OtherBalBillController.cs" />
    <Compile Include="Controllers\Pay_GroupBalBillController.cs" />
    <Compile Include="Controllers\PurchaseOrderController.cs" />
    <Compile Include="Controllers\QC_POStockInCheckBillController.cs" />
@@ -437,9 +437,10 @@
    <Compile Include="DLL\ClsSc_MouldOtherOutBill.cs" />
    <Compile Include="DLL\ClsSc_MouldOtherInBill.cs" />
    <Compile Include="DLL\ClsSc_MouldMoveStockStepOutBill.cs" />
    <Compile Include="DLL\ClsPay_SingleBalBill.cs" />
    <Compile Include="DLL\工资管理\ClsPay_GroupBalBill.cs" />
    <Compile Include="DLL\工资管理\ClsPay_SingleBalBill.cs" />
    <Compile Include="DLL\ClsSc_MouldProdBackBill.cs" />
    <Compile Include="DLL\ClsPay_OtherBalBill.cs" />
    <Compile Include="DLL\工资管理\ClsPay_OtherBalBill.cs" />
    <Compile Include="DLL\ClsSc_MouldProdInBill.cs" />
    <Compile Include="DLL\ClsSc_MouldMoveStockStepInBill.cs" />
    <Compile Include="DLL\ClsSc_MouldProdMoveBill.cs" />
@@ -472,6 +473,8 @@
    <Compile Include="Models\ClsKf_MateOutBillSub.cs" />
    <Compile Include="Models\ClsOA_InformBillMain.cs" />
    <Compile Include="Models\ClsOA_InformBillSub.cs" />
    <Compile Include="Models\工资管理\ClsPay_OtherBalBillMain.cs" />
    <Compile Include="Models\工资管理\ClsPay_OtherBalBillSub.cs" />
    <Compile Include="Models\工资管理\ClsPay_SingleBalBillMain.cs" />
    <Compile Include="Models\工资管理\ClsPay_SingleBalBillSub.cs" />
    <Compile Include="Models\ClsSb_EquipDotCheckRuleBillMain.cs" />