zgq
2021-08-12 b99276556da4de24bddaeb8452d466008da63bb5
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
1个文件已删除
24个文件已修改
2个文件已添加
1167 ■■■■■ 已修改文件
MES/bin/Debug/AxInterop.gregn6Lib.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/BLL.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/BLL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/DAL.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/Interop.VBIDE.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/Interop.gregn6Lib.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/MES.exe 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/MES.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/Model.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/WarM.dll 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/WarM.pdb 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/stdole.dll 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/bin/Debug/Pub_Class.dll 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/bin/Debug/Pub_Class.pdb 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs 419 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/PublicPageMethodController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs 200 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESEndWorkBillController.cs 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESProductReportBillController.cs 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_MESBeginWorkBill.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web References/WebS/Reference.cs 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web References/WebS/WebService1.wsdl 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES/bin/Debug/AxInterop.gregn6Lib.dll
Binary files differ
MES/bin/Debug/BLL.dll
Binary files differ
MES/bin/Debug/BLL.pdb
Binary files differ
MES/bin/Debug/DAL.dll
Binary files differ
MES/bin/Debug/DAL.pdb
Binary files differ
MES/bin/Debug/Interop.VBIDE.dll
Binary files differ
MES/bin/Debug/Interop.gregn6Lib.dll
Binary files differ
MES/bin/Debug/MES.exe
Binary files differ
MES/bin/Debug/MES.pdb
Binary files differ
MES/bin/Debug/Model.dll
Binary files differ
MES/bin/Debug/Model.pdb
Binary files differ
MES/bin/Debug/WarM.dll
Binary files differ
MES/bin/Debug/WarM.pdb
Binary files differ
MES/bin/Debug/stdole.dll
Binary files differ
Pub_Class/bin/Debug/Pub_Class.dll
Binary files differ
Pub_Class/bin/Debug/Pub_Class.pdb
Binary files differ
WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs
New file
@@ -0,0 +1,419 @@
using DBUtility;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.BaseSet
{
    public class Gy_ModelTypeController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        DAL.ClsGy_MouldType_Ctl oDept = new DAL.ClsGy_MouldType_Ctl();
        DAL.ClsGy_MouldType_View oDeptHlp = new DAL.ClsGy_MouldType_View();
        #region 模治具分类列表数据
        /// <summary>
        /// 返回模治具分类列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/list")]
        [HttpGet]
        public object list(string sWhere)
        {
            try
            {
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere, "Gy_MouldType");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无模治具分类数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查找成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 模治具分类根据树型ID查询所有层级列表数据
        /// <summary>
        /// 根据树型ID 查找记录
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/cx")]
        [HttpGet]
        public object cx(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (
                                       SELECT HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,
                                       case when HStopFlag<>0 then 'Y'else ' 'end HStopFlag,HRemark,HUseFlag from Gy_MouldType
                                       WHERE HitemID="+ HInterID + " UNION ALL  SELECT s.HItemID,s.HParentID,s.HNumber,s.HName,s.HLevel, case when s.HEndFlag<>0 then 'Y'else ' 'end HEndFlag, case when s.HStopFlag<>0 then 'Y'else ' 'end HStopFlag,s.HRemark,s.HUseFlag FROM dbo.Gy_MouldType AS s,a WHERE s.HParentID=a.HitemID) SELECT * FROM a"), "h_v_IF_QCCheckItemList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "false!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    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;
            }
        }
        #endregion
        #region 删除模治具分类列表
        /// <summary>
        /// 模治具分类列表删除按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/Delete_Json")]
        [HttpGet]
        public object Delete_Json(long HItemID, string User, string ModRightNameDelete)
        {
            try
            {
                //if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "没有删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (oDeptHlp.GetInfoByID(HItemID))
                {
                    if (oDept.HavChildCodes(HItemID))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "此项目存在子项目,不能删除!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //删除前判断是否 已使用 20141020
                    if (oDeptHlp.omodel.HUseFlag != "未使用")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "此项目已使用或者未检测,不能删除!请重新检测再删除!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //
                    if (oDept.DeleteByID(HItemID))
                    {
                        //写入日志
                        ClsPub.Add_Log("", "删除项目,代码:" + oDeptHlp.omodel.HNumber + ",名称:" + oDeptHlp.omodel.HName, ClsPub.CurUserName);
                        //更新上级为 末级
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                //ds = oCN.RunProcReturn("delete from Gy_MouldType where HItemID =  " + HItemID, "Gy_MouldType");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 模治具分类新增保存
        /// <summary>
        /// 模治具分类-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/AddBill")]
        [HttpPost]
        public object AddBill([FromBody] JObject oMain)
        {
            try
            {
                var _value = oMain["oMain"].ToString();
                string msg1 = _value.ToString();
                //反序列化
                msg1 = "[" + msg1.ToString() + "]";
                List<Model.ClsGy_MouldType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldType_Model>>(msg1);
                string HNumber = list[0].HNumber;
                string HName = list[0].HName;
                string HShortNumber = list[0].HNumber;
                long HParentID = list[0].HParentID;
                long HLevel = list[0].HLevel;
                string HHelpCode = list[0].HHelpCode;
                string HRemark = list[0].HRemark;
                bool HStopflag = list[0].HStopflag;
                string HUseFlag = list[0].HUseFlag;
                bool HEndFlag = list[0].HEndFlag;
                if (!DBUtility.ClsPub.AllowNumber(HNumber))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //若MAINDI重复则重新获取
                oCN.BeginTran();
                //主表
                oCN.RunProc("Insert into Gy_MouldType " +
                   " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                   ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " +
                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID +
                   "," + HLevel+ "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                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.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 模治具分类修改保存
        /// <summary>
        /// 修改单据-保存按钮
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/EditBill")]
        [HttpPost]
        public object EditBill([FromBody] JObject oMain)
        {
            try
            {
                var _value = oMain["oMain"].ToString();
                string msg1 = _value.ToString();
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string msg2 = sArray[0].ToString();
                string msg3 = sArray[1].ToString();
                string msg4 = sArray[2].ToString();
                string msg5 = sArray[3].ToString();
                //反序列化
                msg2 = "[" + msg2.ToString() + "]";
                List<Model.ClsGy_MouldType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MouldType_Model>>(msg2);
                long HItemID = int.Parse(msg3);
                string HNumber = list[0].HNumber;
                string HName = list[0].HName;
                string HShortNumber = list[0].HNumber;
                long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID;
                string HHelpCode = list[0].HHelpCode;
                string HRemark = list[0].HRemark;
                bool HStopflag = list[0].HStopflag;
                string HUseFlag = list[0].HUseFlag;
                //判断权限
                //if (!ClsPub.Security_Log(msg5, 1, true, msg4))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "没有找到该功能模块!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.AllowNumber(HNumber))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oDept.HavSameNumber(HItemID, HNumber))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "代码重复!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //若MAINDI重复则重新获取
                oCN.BeginTran();
                //主表
                oCN.RunProc("Update Gy_MouldType set " +
                    " HNumber='" + HNumber + "'" +
                    ",HName='" + HName + "'" +
                    ",HShortNumber='" + HShortNumber + "'" +
                    ",HHelpCode='" + HHelpCode + "'" +
                    ",HParentID=" + HParentID +
                    ",HStopflag='" + HStopflag + "'" +
                    ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 为非末级
                oCN.RunProc("Update Gy_QCCheckItem set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                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.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 模治具分类修改获取绑定数据
        /// <summary>
        /// 维修列表修改按钮方法
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_ModelType/xg")]
        [HttpGet]
        public object xg(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from Gy_MouldType where HItemID=" + HInterID, "Gy_MouldType");
                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;
            }
        }
        #endregion
        #region 模治具分类获取树型列表数据
        [Route("Gy_ModelType/LoadTree")]
        [HttpGet]
        public object LoadTree_Json(string sWhere)
        {
            SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
            //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
            ds = oCN.RunProcReturn("select HItemID id, HNumber, HName title, HParentID ParentID, HLevel from Gy_MouldType", "Gy_MouldType");
            if (ds == null || ds.Tables[0].Rows.Count == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "false!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            else
            {
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/PublicPageMethodController.cs
@@ -2007,5 +2007,7 @@
        #endregion
    }
}
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -18,6 +18,7 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        private WebS.WebService1 oWebs = new WebS.WebService1();
        #region 开工单
        #region 开工单列表
@@ -263,6 +264,145 @@
        }
        #endregion
        #region [开工单审核、反审核]
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Sc_MESBeginWorkBill/AuditProcessReportList")]
        [HttpGet]
        public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESBeginWorkBill_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DLL.ClsSc_MESBeginWorkBill oBill = new DLL.ClsSc_MESBeginWorkBill();
                //查看是否已审核,关闭,作废
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
@@ -316,14 +456,32 @@
        [HttpPost]
        public object SaveGetMESBeginWorkFrom([FromBody] JObject msg)
        {
            //保存权限
            if (!DBUtility.ClsPub.Security_Log("MES_MESBeginWorkBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            //判断会计期是否合理
            string s = "";
            int sYear = 0;
            int sPeriod = 0;
            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = s;
                objJsonResult.data = null;
                return objJsonResult;
            }
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            ListModels oListModels = new ListModels();
            try
            {
@@ -634,24 +792,24 @@
                 long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //oCN.BeginTran();
                //根据单号、资源ID、订单主ID、订单子ID、制单人过滤产量汇报报检申请提交数据
                string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set
                                 HICMOReportInterID ='"+HInterID+"', HICMOReportBillNo='"+ ScMaxWork + "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + workcode+ "' and a.HSourceID='" + HSourceID + "' and  HICMOInterID='" + HICMOInterID+ "' and a.HICMOEntryID='"+ HICMOEntryID + "' and a.HMaker='"+HMaker+"'  and HRelationInterID='0'");
                oCN.RunProc(sql);
                //string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set
                //                 HICMOReportInterID ='"+HInterID+"', HICMOReportBillNo='"+ ScMaxWork + "' from Sc_ICMOBillWorkQtyStatus_Tmp a where a.HICMOBillNo='" + workcode+ "' and a.HSourceID='" + HSourceID + "' and  HICMOInterID='" + HICMOInterID+ "' and a.HICMOEntryID='"+ HICMOEntryID + "' and a.HMaker='"+HMaker+"'  and HRelationInterID='0'");
                //oCN.RunProc(sql);
                //oCN.Commit();
                //根据生产订单号查询生产订单表,拿到组织、车间
                DataSet ds0 = oCN.RunProcReturn("select HPRDORGID,HDeptID from Sc_ICMOBillMain where HBillNo='"+ workcode + "'", "Sc_ICMOBillMain");
                //DataSet ds0 = oCN.RunProcReturn("select HPRDORGID,HDeptID from Sc_ICMOBillMain where HBillNo='"+ workcode + "'", "Sc_ICMOBillMain");
                //查询产量汇报临时表
                ds = oCN.RunProcReturn("select top 1 * from  Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
                if (ds.Tables[0].Rows.Count <= 0)
                {
                //ds = oCN.RunProcReturn("select top 1 * from  Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
                //if (ds.Tables[0].Rows.Count <= 0)
                //{
                    //oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "当前单据无产量汇报记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "当前单据无产量汇报记录!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
               
                WebS.ClsSc_ICMOReportBillMain model = new WebS.ClsSc_ICMOReportBillMain();
                model.HInterID = HInterID;
@@ -662,13 +820,13 @@
                model.HRemark = "";
                model.HMaker = HMaker;
                model.HEmpID = 0;
                model.HGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HGroupID"]);
                model.HDeptID= DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HDeptID"]);
                model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]);
                //model.HGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HGroupID"]);
                //model.HDeptID= DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HDeptID"]);
                //model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]);
                model.HMainSourceInterID = HICMOInterID;
                model.HMainSourceEntryID = HICMOEntryID;
                //oWebs.Timeout = 30000;
                bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
                bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model,workcode,HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
                if (flag)
                {
                    //oCN.Commit();
WebAPI/Controllers/SCGL/Sc_MESEndWorkBillController.cs
@@ -261,6 +261,145 @@
        }
        #endregion
        #region [完工单审核、反审核]
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Sc_MESEndWorkBill/AuditProcessReportList")]
        [HttpGet]
        public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESEndWorkBill_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DLL.ClsSc_MESEndWorkBill oBill = new DLL.ClsSc_MESEndWorkBill();
                //查看是否已审核,关闭,作废
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/Controllers/SCGL/Sc_MESProductReportBillController.cs
New file
@@ -0,0 +1,105 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.SCGL
{
    public class Sc_MESProductReportBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        private WebS.WebService1 oWebs = new WebS.WebService1();
        #region  产量汇报列表
        [Route("Sc_MESProductReportBill/Get_Sc_MESProductReportBillList")]
        [HttpGet]
        public object Get_Sc_MESProductReportBillList(string sWhere)
        {
            try
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp " + sWhere, "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                }
                else
                {
                    string sql1 = "select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂无数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "查询数据成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  产量汇报编辑获取数据
        [Route("Sc_MESProductReportBill/Get_Sc_MESProductReportEditBillList")]
        [HttpGet]
        public object Get_Sc_MESProductReportEditBillList(string linterid, string HICMOInID, string HICMOEnID)
        {
            try
            {
                //根据选择资源ID获取当前生产工单、责任人
                ds=oCN.RunProcReturn("select * from h_v_IF_ICMOBillWorkQtyStatus_Tmp  where HInterID='" + linterid + "' and HICMOInterID='" + HICMOInID + "' and HICMOEntryID='" + HICMOEnID + "'", "h_v_IF_ICMOBillWorkQtyStatus_Tmp");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取资源绑定数据成功!";
                    objJsonResult.data = ds;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂无资源绑定!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = e.Message.ToString();
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
    }
}
WebAPI/Controllers/SCGL/Sc_MESStopWorkBillController.cs
@@ -256,6 +256,145 @@
        #endregion
        #region [停工单审核、反审核]
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Sc_MESStopWorkBill/AuditProcessReportList")]
        [HttpGet]
        public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESStopWorkBill_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DLL.ClsSc_MESStopWorkBill oBill = new DLL.ClsSc_MESStopWorkBill();
                //查看是否已审核,关闭,作废
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
@@ -53,6 +53,10 @@
                ",HRelationEntryID=" + omodel.HRelationEntryID.ToString() +
                ",HRelationBillNo='" + omodel.HRelationBillNo + "'" +
                ",HReportEntryID=" + omodel.HReportEntryID.ToString() +
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HWorkManID=" + omodel.HWorkManID.ToString() +
                ",HBadQty=" + omodel.HBadQty.ToString() +
                ",HWasterQty=" + omodel.HWasterQty.ToString() +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -10,6 +10,8 @@
        public Models.ClsSc_MESBeginWorkBillMain omodel = new Models.ClsSc_MESBeginWorkBillMain();
        public List<Models.ClsSc_MESBeginWorkBillSub> DetailColl = new List<Models.ClsSc_MESBeginWorkBillSub>();
        //public List<Model.ClsSc_MESBeginWorkBillSub_Item> DetailColl1 = new List<Model.ClsSc_MESBeginWorkBillSub_Item>();
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        public ClsSc_MESBeginWorkBill()
        {
            base.MvarItemKeySub = "Sc_MESBeginWorkBillSub";
@@ -53,7 +55,7 @@
                //",HCheckDate='" + omodel.HCheckDate + "'" +
                //",HMaker='" + omodel.HMaker + "'" +
                //",HMakeDate='" + omodel.HMakeDate + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDater='" +omodel.HMaker + "'" +
                ",HUpDateDate=getdate()" +
                //",HCloseMan='" + omodel.HCloseMan + "'" +
                //",HCloseDate='" + omodel.HCloseDate + "'" +
@@ -166,7 +168,7 @@
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
                 ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + omodel.HMaker+ "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOEntryID + "','" + omodel.HICMOBillNo + "'," + omodel.HProcPlanInterID.ToString() + "," + omodel.HProcPlanEntryID.ToString() + ",'" + omodel.HProcPlanBillNo + "'," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
                ",'" + omodel.HProcExchBillNo + "'," + omodel.HMaterID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HICMOQty.ToString() + "," + omodel.HPlanQty.ToString() + ",getdate()," + omodel.HSourceID.ToString() +
@@ -178,6 +180,14 @@
                //根据开工单内码 设置 生产状态表 开工状态(先把 本资源全部工单 设置为非开工状态,再设置本单对应得源单 为开工状态)
                oCn.RunProcReturn("exec h_p_JIT_MESBeginWorkBill_BeginWork @HInterId=" + omodel.HInterID + ",@flag='开工'", "h_p_JIT_MESBeginWorkBill_BeginWork");
                sReturn = "新增单据成功!";
                //系统参数  自动审核
                string AutoCheck = oSystemParameter.GetSingleSystemParameter("Sc_MESBeginWorkBill_AutoCheck",ref sReturn);
                if (AutoCheck=="Y")
                {
                    //审核单据
                    oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2', HChecker='" + omodel.HMaker + "',HCheckDate=getdate() Where HInterID=" + omodel.HInterID.ToString());
                }
                oCn.Commit();
                return true;
            }
@@ -391,7 +401,7 @@
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                //生成调拨单
                //得到调拨单 mainid 单据号
                //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo);
WebAPI/Web References/WebS/Reference.cs
@@ -61,6 +61,8 @@
        
        private System.Threading.SendOrPostCallback get_SaveCLOUDUseNameandPsdOperationCompleted;
        
        private System.Threading.SendOrPostCallback get_SaveMESCLOUDUseNamePsdOperationCompleted;
        private System.Threading.SendOrPostCallback CheckAllowBeforeSaveOperationCompleted;
        
        private System.Threading.SendOrPostCallback get_SystemParameterOperationCompleted;
@@ -973,6 +975,9 @@
        
        /// <remarks/>
        public event get_SaveCLOUDUseNameandPsdCompletedEventHandler get_SaveCLOUDUseNameandPsdCompleted;
        /// <remarks/>
        public event get_SaveMESCLOUDUseNamePsdCompletedEventHandler get_SaveMESCLOUDUseNamePsdCompleted;
        
        /// <remarks/>
        public event CheckAllowBeforeSaveCompletedEventHandler CheckAllowBeforeSaveCompleted;
@@ -2605,6 +2610,35 @@
            if ((this.get_SaveCLOUDUseNameandPsdCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.get_SaveCLOUDUseNameandPsdCompleted(this, new get_SaveCLOUDUseNameandPsdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/get_SaveMESCLOUDUseNamePsd", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public System.Data.DataSet get_SaveMESCLOUDUseNamePsd(string HMaker) {
            object[] results = this.Invoke("get_SaveMESCLOUDUseNamePsd", new object[] {
                        HMaker});
            return ((System.Data.DataSet)(results[0]));
        }
        /// <remarks/>
        public void get_SaveMESCLOUDUseNamePsdAsync(string HMaker) {
            this.get_SaveMESCLOUDUseNamePsdAsync(HMaker, null);
        }
        /// <remarks/>
        public void get_SaveMESCLOUDUseNamePsdAsync(string HMaker, object userState) {
            if ((this.get_SaveMESCLOUDUseNamePsdOperationCompleted == null)) {
                this.get_SaveMESCLOUDUseNamePsdOperationCompleted = new System.Threading.SendOrPostCallback(this.Onget_SaveMESCLOUDUseNamePsdOperationCompleted);
            }
            this.InvokeAsync("get_SaveMESCLOUDUseNamePsd", new object[] {
                        HMaker}, this.get_SaveMESCLOUDUseNamePsdOperationCompleted, userState);
        }
        private void Onget_SaveMESCLOUDUseNamePsdOperationCompleted(object arg) {
            if ((this.get_SaveMESCLOUDUseNamePsdCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.get_SaveMESCLOUDUseNamePsdCompleted(this, new get_SaveMESCLOUDUseNamePsdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
@@ -10958,9 +10992,11 @@
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/set_SaveICMOProductReportBill_Layui", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public bool set_SaveICMOProductReportBill_Layui(ClsSc_ICMOReportBillMain oMain, string sHSourceType, ref string sErrMsg) {
        public bool set_SaveICMOProductReportBill_Layui(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, ref string sErrMsg) {
            object[] results = this.Invoke("set_SaveICMOProductReportBill_Layui", new object[] {
                        oMain,
                        workcode,
                        HSourceID,
                        sHSourceType,
                        sErrMsg});
            sErrMsg = ((string)(results[1]));
@@ -10968,17 +11004,19 @@
        }
        
        /// <remarks/>
        public void set_SaveICMOProductReportBill_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string sHSourceType, string sErrMsg) {
            this.set_SaveICMOProductReportBill_LayuiAsync(oMain, sHSourceType, sErrMsg, null);
        public void set_SaveICMOProductReportBill_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, string sErrMsg) {
            this.set_SaveICMOProductReportBill_LayuiAsync(oMain, workcode, HSourceID, sHSourceType, sErrMsg, null);
        }
        
        /// <remarks/>
        public void set_SaveICMOProductReportBill_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string sHSourceType, string sErrMsg, object userState) {
        public void set_SaveICMOProductReportBill_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, string sErrMsg, object userState) {
            if ((this.set_SaveICMOProductReportBill_LayuiOperationCompleted == null)) {
                this.set_SaveICMOProductReportBill_LayuiOperationCompleted = new System.Threading.SendOrPostCallback(this.Onset_SaveICMOProductReportBill_LayuiOperationCompleted);
            }
            this.InvokeAsync("set_SaveICMOProductReportBill_Layui", new object[] {
                        oMain,
                        workcode,
                        HSourceID,
                        sHSourceType,
                        sErrMsg}, this.set_SaveICMOProductReportBill_LayuiOperationCompleted, userState);
        }
@@ -10992,9 +11030,11 @@
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/set_SaveICMOProductReportBill_CLD_Layui", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public bool set_SaveICMOProductReportBill_CLD_Layui(ClsSc_ICMOReportBillMain oMain, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) {
        public bool set_SaveICMOProductReportBill_CLD_Layui(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg) {
            object[] results = this.Invoke("set_SaveICMOProductReportBill_CLD_Layui", new object[] {
                        oMain,
                        workcode,
                        HSourceID,
                        sHSourceType,
                        oSystemParameterMain,
                        sErrMsg});
@@ -11003,17 +11043,19 @@
        }
        
        /// <remarks/>
        public void set_SaveICMOProductReportBill_CLD_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, string sErrMsg) {
            this.set_SaveICMOProductReportBill_CLD_LayuiAsync(oMain, sHSourceType, oSystemParameterMain, sErrMsg, null);
        public void set_SaveICMOProductReportBill_CLD_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, string sErrMsg) {
            this.set_SaveICMOProductReportBill_CLD_LayuiAsync(oMain, workcode, HSourceID, sHSourceType, oSystemParameterMain, sErrMsg, null);
        }
        
        /// <remarks/>
        public void set_SaveICMOProductReportBill_CLD_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, string sErrMsg, object userState) {
        public void set_SaveICMOProductReportBill_CLD_LayuiAsync(ClsSc_ICMOReportBillMain oMain, string workcode, int HSourceID, string sHSourceType, ClsXt_SystemParameterMain oSystemParameterMain, string sErrMsg, object userState) {
            if ((this.set_SaveICMOProductReportBill_CLD_LayuiOperationCompleted == null)) {
                this.set_SaveICMOProductReportBill_CLD_LayuiOperationCompleted = new System.Threading.SendOrPostCallback(this.Onset_SaveICMOProductReportBill_CLD_LayuiOperationCompleted);
            }
            this.InvokeAsync("set_SaveICMOProductReportBill_CLD_Layui", new object[] {
                        oMain,
                        workcode,
                        HSourceID,
                        sHSourceType,
                        oSystemParameterMain,
                        sErrMsg}, this.set_SaveICMOProductReportBill_CLD_LayuiOperationCompleted, userState);
@@ -37444,6 +37486,32 @@
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    public delegate void get_SaveMESCLOUDUseNamePsdCompletedEventHandler(object sender, get_SaveMESCLOUDUseNamePsdCompletedEventArgs e);
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class get_SaveMESCLOUDUseNamePsdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        private object[] results;
        internal get_SaveMESCLOUDUseNamePsdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
                base(exception, cancelled, userState) {
            this.results = results;
        }
        /// <remarks/>
        public System.Data.DataSet Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataSet)(this.results[0]));
            }
        }
    }
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.8.4084.0")]
    public delegate void CheckAllowBeforeSaveCompletedEventHandler(object sender, CheckAllowBeforeSaveCompletedEventArgs e);
    
    /// <remarks/>
WebAPI/Web References/WebS/WebService1.wsdl
@@ -229,6 +229,27 @@
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="get_SaveMESCLOUDUseNamePsd">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="HMaker" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="get_SaveMESCLOUDUseNamePsdResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="get_SaveMESCLOUDUseNamePsdResult">
              <s:complexType>
                <s:sequence>
                  <s:element ref="s:schema" />
                  <s:any />
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="CheckAllowBeforeSave">
        <s:complexType>
          <s:sequence>
@@ -5727,6 +5748,8 @@
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="oMain" type="tns:ClsSc_ICMOReportBillMain" />
            <s:element minOccurs="0" maxOccurs="1" name="workcode" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="HSourceID" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="sHSourceType" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="sErrMsg" type="s:string" />
          </s:sequence>
@@ -5744,6 +5767,8 @@
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="oMain" type="tns:ClsSc_ICMOReportBillMain" />
            <s:element minOccurs="0" maxOccurs="1" name="workcode" type="s:string" />
            <s:element minOccurs="1" maxOccurs="1" name="HSourceID" type="s:int" />
            <s:element minOccurs="0" maxOccurs="1" name="sHSourceType" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="oSystemParameterMain" type="tns:ClsXt_SystemParameterMain" />
            <s:element minOccurs="0" maxOccurs="1" name="sErrMsg" type="s:string" />
@@ -10538,6 +10563,12 @@
  <wsdl:message name="get_SaveCLOUDUseNameandPsdSoapOut">
    <wsdl:part name="parameters" element="tns:get_SaveCLOUDUseNameandPsdResponse" />
  </wsdl:message>
  <wsdl:message name="get_SaveMESCLOUDUseNamePsdSoapIn">
    <wsdl:part name="parameters" element="tns:get_SaveMESCLOUDUseNamePsd" />
  </wsdl:message>
  <wsdl:message name="get_SaveMESCLOUDUseNamePsdSoapOut">
    <wsdl:part name="parameters" element="tns:get_SaveMESCLOUDUseNamePsdResponse" />
  </wsdl:message>
  <wsdl:message name="CheckAllowBeforeSaveSoapIn">
    <wsdl:part name="parameters" element="tns:CheckAllowBeforeSave" />
  </wsdl:message>
@@ -13099,6 +13130,10 @@
      <wsdl:input message="tns:get_SaveCLOUDUseNameandPsdSoapIn" />
      <wsdl:output message="tns:get_SaveCLOUDUseNameandPsdSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="get_SaveMESCLOUDUseNamePsd">
      <wsdl:input message="tns:get_SaveMESCLOUDUseNamePsdSoapIn" />
      <wsdl:output message="tns:get_SaveMESCLOUDUseNamePsdSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="CheckAllowBeforeSave">
      <wsdl:input message="tns:CheckAllowBeforeSaveSoapIn" />
      <wsdl:output message="tns:CheckAllowBeforeSaveSoapOut" />
@@ -14884,6 +14919,15 @@
    </wsdl:operation>
    <wsdl:operation name="get_SaveCLOUDUseNameandPsd">
      <soap:operation soapAction="http://tempuri.org/get_SaveCLOUDUseNameandPsd" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="get_SaveMESCLOUDUseNamePsd">
      <soap:operation soapAction="http://tempuri.org/get_SaveMESCLOUDUseNamePsd" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
@@ -18773,6 +18817,15 @@
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="get_SaveMESCLOUDUseNamePsd">
      <soap12:operation soapAction="http://tempuri.org/get_SaveMESCLOUDUseNamePsd" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CheckAllowBeforeSave">
      <soap12:operation soapAction="http://tempuri.org/CheckAllowBeforeSave" style="document" />
      <wsdl:input>
WebAPI/WebAPI.csproj
@@ -263,10 +263,10 @@
    <Content Include="Web References\WebS\ClsKf_ICStockBill_WMS.datasource">
      <DependentUpon>Reference.map</DependentUpon>
    </Content>
    <Content Include="Web References\WebS\Reference.map">
    <None Include="Web References\WebS\Reference.map">
      <Generator>MSDiscoCodeGenerator</Generator>
      <LastGenOutput>Reference.cs</LastGenOutput>
    </Content>
    </None>
    <None Include="Web References\WebS\WebService1.disco" />
    <Content Include="Web.config">
      <SubType>Designer</SubType>
@@ -278,6 +278,7 @@
    <Compile Include="App_Start\RouteConfig.cs" />
    <Compile Include="App_Start\SwaggerConfig.cs" />
    <Compile Include="App_Start\WebApiConfig.cs" />
    <Compile Include="Controllers\BaseSet\Gy_ModelTypeController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_QCCheckClassController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_CheckItemController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_MaintenanceAcceptItemController.cs" />
@@ -325,6 +326,7 @@
    <Compile Include="Controllers\PublicPageMethodController.cs" />
    <Compile Include="Controllers\ReportFromController.cs" />
    <Compile Include="Controllers\ReportPlatFormController.cs" />
    <Compile Include="Controllers\SCGL\Sc_MESProductReportBillController.cs" />
    <Compile Include="Controllers\Sc_MouldController.cs" />
    <Compile Include="Controllers\Sc_GroupOrderBillController.cs" />
    <Compile Include="Controllers\QC_ManagementController.cs" />