WYB
2021-04-09 598b30271d6cf3a01621310e55296c1f61f0baf7
PDA工序汇报单保存逻辑实现以及普通工序汇报单保存逻辑编写
2个文件已添加
6个文件已修改
1147 ■■■■■ 已修改文件
WebAPI/Controllers/Sc_ProcessMangementController.cs 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ProcessReport.cs 445 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/Sc_ProcessPlanViewModel.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/Sc_ProcessReportViewModel.cs 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/Sc_ProcessSendWorkViewModel.cs 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/API.pubxml.user 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -458,25 +458,50 @@
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsSc_ProcessReport ReportModel = new DAL.ClsSc_ProcessReport();
                WebAPI.DLL.ClsSc_ProcessReport ReportModel = new WebAPI.DLL.ClsSc_ProcessReport();
                List<WebAPI.Models.Sc_ProcessReportViewModel> ls = new List<WebAPI.Models.Sc_ProcessReportViewModel>();
                ls = oListModels.getObjectByJson_Report(msg1);
                int i = 0;
                Model.ClsSc_ProcessReportMain ReportMain = new Model.ClsSc_ProcessReportMain();
                Model.ClsSc_ProcessReportSub ReportSub = new Model.ClsSc_ProcessReportSub();
                foreach (Models.Sc_ProcessReportViewModel ItemView in ls)
                {
                    i++;
                    Model.ClsSc_ProcessReportMain ReportMain = new Model.ClsSc_ProcessReportMain();
                    Model.ClsSc_ProcessReportSub ReportSub = new Model.ClsSc_ProcessReportSub();
                    //工序汇报单主表保存
                    ReportMain.HBillType = "3714";
                    ReportMain.HBillNo = ItemView.HBillNo;
                    ReportMain.HMakeDate=DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    ReportMain.HYear=DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    ReportMain.HDate = DateTime.Now;
                    ReportMain.HInterID = ItemView.HInterID;
                    ReportMain.HMaker = ItemView.HEmp;
                    ReportMain.HCloseType = false;
                    ReportMain.HPlanQty = (double)ItemView.HQty;
                    ReportMain.HMainSourceInterID = ItemView.HInterID;
                    ReportMain.HInterID =0;
                    ReportMain.HPeriod = 1;
                    ReportMain.HBillSubType = "3714";
                    ReportMain.HBillStatus = 0;
                    ReportMain.HCheckItemNowID = 0;
                    ReportMain.HCheckItemNextID = 0;
                    ReportMain.HICMOInterID= (long)ItemView.HICMOInterID;
                    ReportMain.HICMOBillNo=ItemView.HICMOBillNo;
                    ReportMain.HDeptID = (long)ItemView.HDeptID;
                    ReportMain.HDeptNumber =ItemView.HDeptNumber;
                    ReportMain.HGroupID = (long)ItemView.HGroupID;
                    ReportMain.HGroupNumber = ItemView.HGroupNumber;
                    ReportMain.HMaterID = (long)ItemView.HMaterID;
                    ReportMain.HMaterNumber = ItemView.HMaterNumber;
                    ReportMain.HUnitID = ItemView.HUnitID;
                    ReportMain.HUnitNumber = ItemView.HUnitNumber;
                    ReportMain.HInStockQty = 0;
                    ReportMain.HSumTimes = 0;
                    ReportMain.HExplanation = "";
                    ReportMain.HInnerBillNo = "";
                    ReportMain.HSupID = 0;
                    //保存到汇报单主表
                    ReportModel.omodel = ReportMain;
@@ -491,6 +516,64 @@
                    ReportSub.HCloseType = false;
                    ReportSub.HSourceBillType = "3712";
                    ReportSub.HQty = (double)ItemView.HQty;
                    ReportSub.HProcID = ItemView.HProcID;
                    ReportSub.HProcNumber = ItemView.HProcNumber;
                    ReportSub.HOutPrice =0;
                    ReportSub.HOutMoney = 0;
                    ReportSub.HSourceID = (long)ItemView.HSourceID;
                    ReportSub.HEmpNumber = "";
                    ReportSub.HRelBeginDate = DateTime.Now;
                    ReportSub.HRelEndDate = DateTime.Now;
                    ReportSub.HTimes =3;
                    ReportSub.HSeOrderInterID = 0;
                    ReportSub.HSeOrderEntryID =0;
                    ReportSub.HSeOrderBillNo = "";
                    ReportSub.HProcPlanInterID = 0;
                    ReportSub.HProcPlanBillNo = "";
                    ReportSub.HSourceInterID = 0;
                    ReportSub.HSourceBillNo = "";
                    ReportSub.HRelationQty = 0;
                    ReportSub.HRelationMoney = 0;
                    ReportSub.HMaterID = (long)ItemView.HMaterID;
                    ReportSub.HMaterNumber = ItemView.HMaterNumber;
                    ReportSub.HCheckQty =0;
                    ReportSub.HBadCount =0;
                    ReportSub.HWasterQty =0;
                    ReportSub.HWasterQty2 =0;
                    ReportSub.HPrice =0;
                    ReportSub.HMoney =0;
                    ReportSub.HProcPlanInterID =0;
                    ReportSub.HProcPlanEntryID =0;
                    ReportSub.HProcPlanBillNo ="";
                    ReportSub.HSourceEntryID =0;
                    ReportSub.HSourceBillType ="";
                    ReportSub.HRelationQty =0;
                    ReportSub.HRelationMoney =0;
                    ReportSub.HBadPrirce =0;
                    ReportSub.HBadMoney =0;
                    ReportSub.HWasterPrice =0;
                    ReportSub.HWasterMoney =0;
                    ReportSub.HQualityRate =0;
                    ReportSub.HSecUnitQty1 =0;
                    ReportSub.HSecUnitRate1=0;
                    ReportSub.HSecUnitQty2=0;
                    ReportSub.HSecUnitRate2=0;
                    ReportSub.HUsingQty=0;
                    ReportSub.HSelfBadCount=0;
                    ReportSub.HPreBadCount=0;
                    ReportSub.HPayMentQty=0;
                    ReportSub.HOtherDeduct=0;
                    ReportSub.HRelPay=0;
                    ReportSub.HOtherItem1="";
                    ReportSub.HOtherItem2="";
                    ReportSub.HOtherItem3="";
                    ReportSub.HOtherItem4="";
                    ReportSub.HOtherItem5="";
                    ReportSub.HPackType="";
                    ReportSub.HCheckEmpID=0;
                    ReportSub.HWeight=0;
                    ReportSub.HBatchNo="";
                    //保存到汇报单子表
                    ReportModel.DetailColl.Add(ReportSub);
                }
@@ -559,7 +642,142 @@
            return model;
        }
        /// <summary>
        /// 保存工序汇报单信息
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveProcessReportList")]
        [HttpPost]
        public object SaveProcessReportList([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();
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsSc_ProcessReport ReportModel = new WebAPI.DLL.ClsSc_ProcessReport();
                List<Model.ClsSc_ProcessReportMain> lsmain = new List<Model.ClsSc_ProcessReportMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Reportlist(msg2);
                foreach (Model.ClsSc_ProcessReportMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    //UserName = oItem.HMaker;
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HBillType = "3714";
                    //oItem.HExRate = 1;
                    oItem.HMainSourceInterID = oItem.HInterID;
                    oItem.HInterID = 0;
                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DBUtility.ClsPub.isStrNull(oItem.HPlanQty) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有填写派工数量,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    ReportModel.omodel = oItem;
                }
        //
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                //List<Model.ClsCg_POInStockBillSub> ls = new List<Model.ClsCg_POInStockBillSub>();
                //ls = oListModels.getObjectByJson_POInStockSub(msg3);
                //int i = 0;
                //foreach (Model.ClsCg_POInStockBillSub oItemSub in ls)
                //{
                //    i++;
                //    if (oItemSub.HQty <= 0)
                //    {
                //        objJsonResult.code = "0";
                //        objJsonResult.count = 0;
                //        objJsonResult.Message = "保存失败!第" + i.ToString() + "行数量不大于0无法保存!";
                //        objJsonResult.data = 1;
                //        return objJsonResult;
                //    }
                //    if (oItemSub.HQty > oItemSub.HRQty)
                //    {
                //        objJsonResult.code = "0";
                //        objJsonResult.count = 0;
                //        objJsonResult.Message = "保存失败!第" + i.ToString() + "行数量不能大于未关联数量!";
                //        objJsonResult.data = 1;
                //        return objJsonResult;
                //    }
                //    if (DBUtility.ClsPub.isStrNull(oItemSub.HBatChNo) == "")
                //    {
                //        objJsonResult.code = "0";
                //        objJsonResult.count = 0;
                //        objJsonResult.Message = "保存失败!第" + i.ToString() + "行未填写批号!";
                //        objJsonResult.data = 1;
                //        return objJsonResult;
                //    }
                //    oItemSub.HEntryID = i;
                //    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                //    oItemSub.HRemark = "";
                //    oItemSub.HCloseMan = "";
                //    oItemSub.HCloseType = false;
                //    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;
            }
        }
    }
}
WebAPI/DLL/ClsSc_ProcessReport.cs
New file
@@ -0,0 +1,445 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public  class ClsSc_ProcessReport:DBUtility.ClsXt_BaseBill
    {
        public Model.ClsSc_ProcessReportMain omodel = new Model.ClsSc_ProcessReportMain();
        public List<Model.ClsSc_ProcessReportSub> DetailColl = new List<Model.ClsSc_ProcessReportSub>();
        public ClsSc_ProcessReport()
        {
            base.MvarItemKeySub = "Sc_ProcessReportSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_ProcessReportMain";
            base.MvarReportTitle="工序汇报单";
            base.BillType="3714";
        }
        #region 固定代码
        ~ClsSc_ProcessReport()
        {
            DetailColl = null;
        }
        #endregion   自定义方法
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Sc_ProcessReportMain set  " +
                " HYear=" + omodel.HYear.ToString() +
                ",HPeriod=" + omodel.HPeriod.ToString() +
                ",HDate='" + omodel.HDate.ToShortDateString() + "'" +
                ",HBillStatus=" + omodel.HBillStatus.ToString() +
                ",HCheckItemNowID=" + omodel.HCheckItemNowID.ToString() +
                ",HCheckItemNextID=" + omodel.HCheckItemNextID.ToString() +
                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
                ",HMarker='" + omodel.HMarker + "'" +
                ",HSupID=" + omodel.HSupID.ToString() +
                ",HDeptID=" + omodel.HDeptID.ToString() +
                ",HDeptNumber='" + omodel.HDeptNumber + "'" +
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HGroupNumber='" + omodel.HGroupNumber + "'" +
                ",HMaterID=" + omodel.HMaterID.ToString() +
                ",HMaterNumber='" + omodel.HMaterNumber + "'" +
                ",HUnitID=" + omodel.HUnitID.ToString() +
                ",HUnitNumber='" + omodel.HUnitNumber + "'" +
                ",HPlanQty=" + omodel.HPlanQty.ToString() +
                ",HInStockQty=" + omodel.HInStockQty.ToString() +
                ",HSumTimes=" + omodel.HSumTimes.ToString() +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsSc_ProcessReportSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_ProcessReportSub " +
                  " (HInterID,HEntryID,HProcID,HProcNumber,HEmpID" +
                  ",HMaterID,HMaterNumber,HOutPrice,HOutMoney" +
                  ",HEmpNumber,HSourceID,HRelBeginDate,HRelEndDate,HTimes" +
                  ",HQty,HCheckQty,HBadCount,HWasterQty,HWasterQty2" +
                  ",HPrice,HMoney,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo" +
                  ",HICMOInterID,HICMOBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                  ",HCloseMan,HCloseType,HRemark" +
                  ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                  ",HBadPrirce,HBadMoney,HWasterPrice,HWasterMoney,HQualityRate," +
                  "HSecUnitQty1,HSecUnitRate1,HSecUnitQty2,HSecUnitRate2,HUsingQty," +
                  "HSelfBadCount,HPreBadCount,HPayMentQty,HOtherDeduct,HRelPay," +
                  "HOtherItem1,HOtherItem2,HOtherItem3,HOtherItem4,HOtherItem5," +
                  "HPackType,HCheckEmpID,HBatchNo" +
                  ") values("
                  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNumber + "'," + oSub.HEmpID.ToString() +
                  "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'," + oSub.HOutPrice.ToString() + "," + oSub.HOutMoney.ToString() +
                  ",'" + oSub.HEmpNumber + "'," + oSub.HSourceID.ToString() + ",'" + oSub.HRelBeginDate.ToShortDateString() + "','" + oSub.HRelEndDate.ToShortDateString() + "'," + oSub.HTimes.ToString() +
                  "," + oSub.HQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() +"," + oSub.HWasterQty2.ToString() +
                  "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'" +
                  "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                  ",'" + oSub.HCloseMan + "'," + 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.HBadPrirce.ToString() + "," + oSub.HBadMoney.ToString() + "," + oSub.HWasterPrice.ToString() + "," + oSub.HWasterMoney.ToString() + "," + oSub.HQualityRate.ToString() +
                  "," + oSub.HSecUnitQty1.ToString() + "," + oSub.HSecUnitRate1.ToString() + "," + oSub.HSecUnitQty2.ToString() + "," + oSub.HSecUnitRate2.ToString() + "," + oSub.HUsingQty.ToString() +
                  "," + oSub.HSelfBadCount.ToString() + "," + oSub.HPreBadCount.ToString() + "," + oSub.HPayMentQty.ToString() + "," + oSub.HOtherDeduct.ToString() + "," + oSub.HRelPay.ToString() +
                  ",'" + oSub.HOtherItem1.ToString() + "','" + oSub.HOtherItem2.ToString() + "','" + oSub.HOtherItem3.ToString() + "','" + oSub.HOtherItem4.ToString() + "','" + oSub.HOtherItem5.ToString() +
                  "','" + oSub.HPackType.ToString() + "'," + oSub.HCheckEmpID.ToString() + ",'" + oSub.HBatchNo + "'" +
                  ") ");
                }
                //更新关联数量
                AddNewRelation(ref sReturn, omodel.HInterID);
                //
                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 Sc_ProcessReportMain   " +
                "(HYear,HPeriod,HBillType,HBillSubType,HInterID" +
                ",HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID" +
                ",HICMOInterID,HICMOBillNo ,HDeptID ,HDeptNumber,HGroupID" +
                ",HGroupNumber,HMaterID,HMaterNumber,HUnitID,HUnitNumber" +
                ",HPlanQty,HInStockQty,HSumTimes,HExplanation,HRemark" +
                ",HInnerBillNo,HMaker,HMakeDate,HSupID,HMarker" +
                ") " +
                " values(" + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + this.BillType +"','"+ omodel.HBillSubType + "'," + omodel.HInterID.ToString() +
                ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
                "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber + "'," + omodel.HGroupID.ToString() +
                ",'" + omodel.HGroupNumber + "'," + omodel.HMaterID.ToString() + ",'" + omodel.HMaterNumber + "'," + omodel.HUnitID.ToString() + ",'" + omodel.HUnitNumber + "'" +
                ", " + omodel.HPlanQty.ToString() + "," + omodel.HInStockQty.ToString() + "," + omodel.HSumTimes.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HRemark + "'" +
                ",'" + omodel.HInnerBillNo  + "','" + DBUtility.ClsPub.CurUserName + "',getdate()," + omodel.HSupID.ToString() + ",'" + omodel.HMarker + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsSc_ProcessReportSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sc_ProcessReportSub " +
                  " (HInterID,HEntryID,HProcID,HProcNumber,HEmpID" +
                  ",HMaterID,HMaterNumber,HOutPrice,HOutMoney" +
                  ",HEmpNumber,HSourceID,HRelBeginDate,HRelEndDate,HTimes" +
                  ",HQty,HCheckQty,HBadCount,HWasterQty,HWasterQty2" +
                  ",HPrice,HMoney,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo" +
                  ",HICMOInterID,HICMOBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
                  ",HCloseMan,HCloseType,HRemark" +
                  ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                  ",HBadPrirce,HBadMoney,HWasterPrice,HWasterMoney,HQualityRate,"+
                  "HSecUnitQty1,HSecUnitRate1,HSecUnitQty2,HSecUnitRate2,HUsingQty,"+
                  "HSelfBadCount,HPreBadCount,HPayMentQty,HOtherDeduct,HRelPay,"+
                  "HOtherItem1,HOtherItem2,HOtherItem3,HOtherItem4,HOtherItem5,"+
                  "HPackType,HCheckEmpID,HWeight,HBatchNo" +
                  ") values("
                  + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNumber + "'," + oSub.HEmpID.ToString() +
                  "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'," + oSub.HOutPrice.ToString() + "," + oSub.HOutMoney.ToString() +
                  ",'" + oSub.HEmpNumber + "'," + oSub.HSourceID.ToString() + ",'" + oSub.HRelBeginDate.ToShortDateString() + "','" + oSub.HRelEndDate.ToShortDateString() + "'," + oSub.HTimes.ToString() +
                  "," + oSub.HQty.ToString() + "," + oSub.HCheckQty.ToString() + "," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() + "," + oSub.HWasterQty2.ToString() +
                  "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HProcPlanInterID.ToString() + "," + oSub.HProcPlanEntryID.ToString() + ",'" + oSub.HProcPlanBillNo + "'" +
                  "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "'," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
                  ",'" + oSub.HCloseMan + "'," + 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.HBadPrirce.ToString() + "," + oSub.HBadMoney.ToString() + "," + oSub.HWasterPrice.ToString() + "," + oSub.HWasterMoney.ToString() + "," + oSub.HQualityRate.ToString() +
                  "," + oSub.HSecUnitQty1.ToString() + "," + oSub.HSecUnitRate1.ToString() + "," + oSub.HSecUnitQty2.ToString() + "," + oSub.HSecUnitRate2.ToString() + "," + oSub.HUsingQty.ToString() +
                  "," + oSub.HSelfBadCount.ToString() + "," + oSub.HPreBadCount.ToString() + "," + oSub.HPayMentQty.ToString() + "," + oSub.HOtherDeduct.ToString() + "," + oSub.HRelPay.ToString() +
                  ",'" + oSub.HOtherItem1.ToString() + "','" + oSub.HOtherItem2.ToString() + "','" + oSub.HOtherItem3.ToString() + "','" + oSub.HOtherItem4.ToString() + "','" + oSub.HOtherItem5.ToString() +
                  "','" + oSub.HPackType.ToString() + "'," + oSub.HCheckEmpID.ToString() + "," + oSub.HWeight.ToString() + ",'" + oSub.HBatchNo + "'" +
                  ") ");
                }
                //更新关联数量
                AddNewRelation(ref sReturn, omodel.HInterID);
                //回填 生产状态表  日计划  为 已完工 状态
                oCn.RunProc("exec h_p_Sc_UpDateICMOBillQualityStatus " + omodel.HICMOStatusInterID.ToString() + ",3");
                //默认变为 申请检验状态
                oCn.RunProc("exec h_p_Sc_UpDateProcessReportStatus " + omodel.HInterID.ToString() + ",15");
                //
                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 Sc_ProcessReportMain Where HInterID=" + lngBillKey.ToString(), "Sc_ProcessReportMain");
                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 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"]);
                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.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
                omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                omodel.HDeptNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeptNumber"]);
                omodel.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                omodel.HGroupNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HGroupNumber"]);
                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                omodel.HMaterNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterNumber"]);
                omodel.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"]);
                omodel.HUnitNumber = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUnitNumber"]);
                omodel.HPlanQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HPlanQty"]);
                omodel.HInStockQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInStockQty"]);
                omodel.HSumTimes = DBUtility.ClsPub.isSingle(Ds.Tables[0].Rows[0]["HSumTimes"]);
                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
                omodel.HRemark = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
                omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]);
                omodel.HMarker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMarker"]);
                //
                 omodel.HBacker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBacker"]);
                omodel.HBackDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBackDate"]);
                omodel.HChecker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HChecker"]);
                omodel.HCheckDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCheckDate"]);
                omodel.HMaker = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaker"]);
                omodel.HMakeDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMakeDate"]);
                omodel.HUpDater = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDater"]);
                omodel.HUpDateDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUpDateDate"]);
                omodel.HCloseMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseMan"]);
                omodel.HCloseDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCloseDate"]);
                omodel.HCloseType = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HCloseType"]);
                omodel.HDeleteMan = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteMan"]);
                omodel.HDeleteDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDeleteDate"]);
                //循环
                DataSet DsSub ;
                DsSub = oCn.RunProcReturn("Select * from Sc_ProcessReportSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "Sc_ProcessReportSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsSc_ProcessReportSub oSub = new Model.ClsSc_ProcessReportSub();
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    //
                    oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
                    oSub.HMaterNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMaterNumber"]);
                    oSub.HProcID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HProcID"]);
                    oSub.HProcNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HProcNumber"]);
                    oSub.HEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEmpID"]);
                    oSub.HEmpNumber = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HEmpNumber"]);
                    oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
                    oSub.HRelBeginDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HRelBeginDate"]);
                    oSub.HRelEndDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HRelEndDate"]);
                    oSub.HTimes = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HTimes"]);
                    oSub.HQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQty"]);
                    oSub.HCheckQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HCheckQty"]);
                    oSub.HBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadCount"]);
                    oSub.HWasterQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterQty"]);
                    oSub.HWasterQty2 = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterQty2"]);
                    oSub.HPrice = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HPrice"]);
                    oSub.HMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HMoney"]);
                    oSub.HOutMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOutMoney"]);
                    oSub.HOutPrice = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOutPrice"]);
                    //addnew
                    oSub.HBadPrirce = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadPrirce"]);
                    oSub.HBadMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HBadMoney"]);
                    oSub.HWasterPrice = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterPrice"]);
                    oSub.HWasterMoney = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HWasterMoney"]);
                    oSub.HQualityRate = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HQualityRate"]);
                    oSub.HSecUnitQty1 = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSecUnitQty1"]);
                    oSub.HSecUnitRate1 = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate1"]);
                    oSub.HSecUnitQty2 = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HSecUnitQty2"]);
                    oSub.HSecUnitRate2 = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSecUnitRate2"]);
                    oSub.HUsingQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HUsingQty"]);
                    oSub.HSelfBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HSelfBadCount"]);
                    oSub.HPreBadCount = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPreBadCount"]);
                    oSub.HPayMentQty = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HPayMentQty"]);
                    oSub.HOtherDeduct = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HOtherDeduct"]);
                    oSub.HRelPay = DBUtility.ClsPub.isSingle(DsSub.Tables[0].Rows[i]["HRelPay"]);
                    oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
                    oSub.HOtherItem1 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOtherItem1"]);
                    oSub.HOtherItem2 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOtherItem2"]);
                    oSub.HOtherItem3 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOtherItem3"]);
                    oSub.HOtherItem4 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOtherItem4"]);
                    oSub.HOtherItem5 = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HOtherItem5"]);
                    oSub.HPackType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HPackType"]);
                    oSub.HCheckEmpID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HCheckEmpID"]);
                    //
                    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.HICMOInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HICMOInterID"]);
                    oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HICMOBillNo"]);
                    oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
                    oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
                    oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]);
                    //
                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
                    oSub.HRemark = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HRemark"]);
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillNo"]);
                    oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSourceBillType"]);
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                    DetailColl.Add(oSub);
                }
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        {
            DataSet oDs = new DataSet();
            string sBillName = "";
            sReturn = "";
            try
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                //
                oDs = oCn.RunProcReturn("select * from Sc_ProcessReportSub where HInterID=" + lngBillKey.ToString(), "Sc_ProcessReportSub");
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    return false;
                }
                for (int i = 0; i <= oDs.Tables[0].Rows.Count - 1; i++)
                {
                    long ProdMoveInterID = DBUtility.ClsPub.CreateBillID("3771", ref DBUtility.ClsPub.sExeReturnInfo);
                    string ProdMoveBillNo = DBUtility.ClsPub.CreateBillCode("3771", ref DBUtility.ClsPub.sExeReturnInfo, true);
                    //oCn.RunProc("exec h_p_Sc_ProcProdMoveBill_Add " + lngBillKey.ToString() + "," + DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[i]["HEntryID"]).ToString() + "," + ProdMoveInterID.ToString() + ",'" + ProdMoveBillNo + "','" + HChecker + "'");
                    sBillName = sBillName + ProdMoveBillNo + ",";
                }
                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                sReturn = sBillName;
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        //删除关联
        public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
        {
            //增加
            try
            {
                if (omodel.HMainSourceBillType == "工序计划单")
                {
                    oCn.RunProc("exec h_p_Sc_UpDateProcessPlanRelation_Del " + lngBillKey.ToString());
                }
                else
                {
                    oCn.RunProc("exec h_p_Sc_UpDateICMOBillStatusRelation_Del " + lngBillKey.ToString());
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //新增关联
        public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
        {
            //增加
            try
            {
                if (omodel.HMainSourceBillType == "工序计划单")
                {
                    oCn.RunProc("exec h_p_Sc_UpDateProcessPlanRelation_Add " + lngBillKey.ToString());
                }
                else
                {
                    oCn.RunProc("exec h_p_Sc_UpDateICMOBillStatusRelation_Add " + lngBillKey.ToString());
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        public bool CheckStatus(long HMainID, long HSubID, ref string sReturn)
        {
            DataSet oDs = new DataSet();
            oDs = oCn.RunProcReturn("exec h_p_Sc_CheckProcessReportStatus " + HMainID.ToString() + "," + HSubID.ToString(), "h_p_Sc_CheckProcessReportStatus");
            if (oDs == null || oDs.Tables[0].Rows.Count == 0)
            {
                sReturn = "未查询到记录!";
                return false;
            }
            if (DBUtility.ClsPub.isLong(oDs.Tables[0].Rows[0][0]) != 99)
            {
                sReturn = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][1]);
                return false;
            }
            else
            {
                sReturn = "正常";
                return true;
            }
        }
        //
    }
}
WebAPI/ListModels.cs
@@ -162,5 +162,12 @@
            List<WebAPI.Models.Sc_ProcessReportViewModel> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<WebAPI.Models.Sc_ProcessReportViewModel>>(jsonString);
            return list;
        }
        public List<Model.ClsSc_ProcessReportMain> getObjectByJson_Reportlist(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSc_ProcessReportMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ProcessReportMain>>(jsonString);
            return list;
        }
    }
}
WebAPI/Models/Sc_ProcessPlanViewModel.cs
@@ -5,6 +5,9 @@
namespace WebAPI.Models
{
    /// <summary>
    /// 工序计划单视图模型
    /// </summary>
    public class Sc_ProcessPlanViewModel
    {
        public Int64? hmainid;  //      [hmainid], 
WebAPI/Models/Sc_ProcessReportViewModel.cs
@@ -5,32 +5,156 @@
namespace WebAPI.Models
{
    /// <summary>
    /// 工序汇报单模型
    /// </summary>
    public class Sc_ProcessReportViewModel
    {
        /// <summary>
        /// 条形码编码
        /// </summary>
        public string HBarCode;
        public string HBarCode; //条形码编码
        public string HSendWorkBillNo; //派工单据号
        public string HBillNo;//汇报单据号
        public Int64 HInterID; //主键id
        public string HProcNo; //工序号
        public string HProcName; //工序名称
        public Int64 HProcID; //工序id
        public string HProc;//
        public string HMaterModel;//规格型号
        public Int64? HEmpID; //创建人id
        public decimal HQty; //数量
        public string HSource; //生产资源
        public Int64?  HSourceID; //生产资源id
        public string HGroup; //班组
        public Int64? HGroupID;//班组id
        public string HICMOBillNo;//任务单号
        public DateTime? HReportTime; //创建时间
        public Int64? HMaterID;//产品id
        public string HMaterName;//产品名称
        public decimal HICMOQty;//
        public Int64? HICMOInterID;//任务单id
        public Int64? HDeptID;//部门id
        public string HEmp;//创建人
        /// <summary>
        /// 派工单据号
        /// </summary>
        public string HSendWorkBillNo;
        /// <summary>
        /// 汇报单据号
        /// </summary>
        public string HBillNo;
        /// <summary>
        /// 主键id
        /// </summary>
        public Int64 HInterID;
        /// <summary>
        /// 工序号
        /// </summary>
        public string HProcNo;
        /// <summary>
        /// 工序名称
        /// </summary>
        public string HProcName;
        /// <summary>
        /// 工序id
        /// </summary>
        public Int64 HProcID;
        /// <summary>
        ///
        /// </summary>
        public string HProc;
        /// <summary>
        /// 规格型号
        /// </summary>
        public string HMaterModel;
        /// <summary>
        /// 创建人id
        /// </summary>
        public Int64? HEmpID;
        /// <summary>
        /// 数量
        /// </summary>
        public decimal HQty;
        /// <summary>
        /// 生产资源
        /// </summary>
        public string HSource;
        /// <summary>
        /// 生产资源id
        /// </summary>
        public Int64?  HSourceID;
        /// <summary>
        /// 班组
        /// </summary>
        public string HGroup;
        /// <summary>
        /// 班组id
        /// </summary>
        public Int64? HGroupID;
        /// <summary>
        /// 班组代码
        /// </summary>
        public string HGroupNumber;
        /// <summary>
        /// 任务单号
        /// </summary>
        public string HICMOBillNo;
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? HReportTime;
        /// <summary>
        /// 产品id
        /// </summary>
        public Int64? HMaterID;
        /// <summary>
        /// 产品名称
        /// </summary>
        public string HMaterName;
        /// <summary>
        ///
        /// </summary>
        public decimal HICMOQty;
        /// <summary>
        /// 任务单id
        /// </summary>
        public Int64? HICMOInterID;
        /// <summary>
        /// 部门id
        /// </summary>
        public Int64? HDeptID;
        /// <summary>
        /// 部门代码
        /// </summary>
        public string HDeptNumber;
        /// <summary>
        /// 创建人
        /// </summary>
        public string HEmp;
        /// <summary>
        /// 单位id
        /// </summary>
        public Int64 HUnitID;
        /// <summary>
        /// 计量单位代码
        /// </summary>
        public string HUnitNumber;
        /// <summary>
        /// 产品代码
        /// </summary>
        public string HMaterNumber;
        /// <summary>
        /// 工序代码
        /// </summary>
        public string HProcNumber;
       
    }
}
WebAPI/Models/Sc_ProcessSendWorkViewModel.cs
New file
@@ -0,0 +1,286 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    /// <summary>
    /// 工序派工单视图模型
    /// </summary>
    public class Sc_ProcessSendWorkViewModel
    {
        /// <summary>
        ///
        /// </summary>
        public Int64? hmainid { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 单据号 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HDeptID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 部门代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 部门 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HMaterID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 物料代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 物料名称 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 规格型号 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HUnitID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 计量单位代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 计量单位 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HprocID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 工序代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 工序 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HGroupID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 班组代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 班组名称 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HSourceID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 资源代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 生产资源 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HWorkerID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 职员代码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 职员 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? hsubid { get; set; }
        /// <summary>
        ///
        /// </summary>
        public decimal? 数量 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 计划开工日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 计划完工日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public decimal? 计划工时 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 表体备注 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HICMOInterID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 生产任务单号 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HSeOrderInterID { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 销售订单号 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 表头备注 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 制单人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 制单日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 审核人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 审核日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 修改人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 修改日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 关闭人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 关闭日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 作废人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public DateTime? 作废日期 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? 源单主内码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? 源单子内码 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 源单单号 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 源单类型 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string 行关闭人 { get; set; }
        /// <summary>
        ///
        /// </summary>
        public string HBillType { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HQtyDecimal { get; set; }
        /// <summary>
        ///
        /// </summary>
        public Int64? HPriceDecimal { get; set; }
    }
}
WebAPI/Properties/PublishProfiles/API.pubxml.user
@@ -163,10 +163,10 @@
      <publishTime>11/24/2014 11:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>04/08/2021 15:31:05</publishTime>
      <publishTime>04/09/2021 19:13:23</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>04/08/2021 15:31:05</publishTime>
      <publishTime>04/09/2021 19:13:23</publishTime>
    </File>
    <File Include="bin/WebAPI.XmlSerializers.dll">
      <publishTime>02/04/2021 21:35:21</publishTime>
@@ -340,7 +340,7 @@
      <publishTime>03/26/2021 14:35:48</publishTime>
    </File>
    <File Include="Web.config">
      <publishTime>04/08/2021 15:31:28</publishTime>
      <publishTime>04/09/2021 19:13:32</publishTime>
    </File>
  </ItemGroup>
</Project>
WebAPI/WebAPI.csproj
@@ -338,6 +338,7 @@
    <Compile Include="Dapper\SqlHelper.cs" />
    <Compile Include="Dapper\SqlPools.cs" />
    <Compile Include="DbUntil\DataFormatUntil.cs" />
    <Compile Include="DLL\ClsSc_ProcessReport.cs" />
    <Compile Include="Models\ApiConfig.cs" />
    <Compile Include="Models\ApiResult.cs" />
    <Compile Include="Models\DocumentsView.cs" />
@@ -348,6 +349,7 @@
    <Compile Include="Models\M_Process.cs" />
    <Compile Include="Models\Sc_ProcessPlanViewModel.cs" />
    <Compile Include="Models\Sc_ProcessReportViewModel.cs" />
    <Compile Include="Models\Sc_ProcessSendWorkViewModel.cs" />
    <Compile Include="Models\StationEntrustInBill.cs" />
    <Compile Include="Models\StationOutBillView.cs" />
    <Compile Include="Properties\Resources.Designer.cs">