llj
1 天以前 1c90213ebd42e2d00324a71a67a60d07e4c8a7da
修复接口签名,新增抽样方案
9个文件已修改
3个文件已添加
1013 ■■■■■ 已修改文件
DAL/DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_SampleScheme_Ctl.cs 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_SampleSchemeSub_Model.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_SampleScheme_Model.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/App_Start/WebApiConfig.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_SampleSchemeController.cs 715 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Service/SignatureVerifyAttribute.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Web.config 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -99,6 +99,7 @@
    <Compile Include="基础资料\公用基础资料\ClsGy_RepairClass_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_RepairCheckClass_Ctl.cs" />
    <Compile Include="仓库管理\ClsKf_ProductReceiveMaterialBill.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_SampleScheme_Ctl.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_MatePrice_Ctl.cs" />
    <Compile Include="工资管理\ClsGy_SteppedPriceCoefficientBill .cs" />
    <Compile Include="成本管理\ClsCB_ItemMoneyBillMain  .cs" />
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_SampleScheme_Ctl.cs
New file
@@ -0,0 +1,154 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsGy_SampleScheme_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_SampleScheme_Model oModel = new Model.ClsGy_SampleScheme_Model();
        //public Model.ClsGy_SampleSchemeSub_Model osub = new Model.ClsGy_SampleSchemeSub_Model();
        public List<Model.ClsGy_SampleSchemeSub_Model> DetailColl = new List<Model.ClsGy_SampleSchemeSub_Model>();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                string sql = $@"INSERT INTO [Gy_SampleScheme] ([HName], [HShortNumber], [HParentID], [HLevel], [HEndFlag], [HStopflag], [HRemark], [HHelpCode], [HUseFlag], [HMakeTime], [HMakeEmp], [HCheckEmp], [HCheckTime], [HModifyEmp], [HModifyTime], [HStopEmp], [HStopTime], [HUSEORGID], [HCREATEORGID], [HInterID], [HSampleTimes], [HSampleType], [HSampleLevel], [HStrictLevel], [HAQL], [HEffectDate], [HExpireDate], [HIsSystemSet], [HERPItemID], [HNumber])
                VALUES (
                '{oModel.HName}', '{oModel.HShortNumber}',  '{oModel.HParentID}',  '{oModel.HLevel}',  '{oModel.HEndFlag}',  '{oModel.HStopflag}',  '{oModel.HRemark}',  '{oModel.HHelpCode}',  '{oModel.HUseFlag}',  '{oModel.HMakeTime}',  '{oModel.HMakeEmp}',  '{oModel.HCheckEmp}','{oModel.HCheckTime}','{oModel.HModifyEmp}',  '{oModel.HModifyTime}',  '{oModel.HStopEmp}','{oModel.HStopTime}','{oModel.HUSEORGID}','{oModel.HCREATEORGID}','{oModel.HInterID}','{oModel.HSampleTimes}','{oModel.HSampleType}','{oModel.HSampleLevel}','{oModel.HStrictLevel}','{oModel.HAQL}','{oModel.HEffectDate}','{oModel.HExpireDate}','{oModel.HIsSystemSet}','{0}','{oModel.HNumber}'
                ); ";
                oCn.RunProc(sql);
                // æ’入子表
                if (DetailColl != null && DetailColl.Count > 0)
                {
                    foreach (Model.ClsGy_SampleSchemeSub_Model osub in DetailColl)
                    {
                        if (osub == null)
                            continue;
                        string sql1 = $@"INSERT INTO [Gy_SampleSchemeSub] ([HInterID], [HEntryID], [HBatch], [HSampleCode], [HSampleRate], [HExpression], [HRejectQty], [HAcceptQty], [HSampleQty], [HSampleLow], [HSampleUp]) VALUES(
                        '{oModel.HInterID}', '{osub.HEntryID}',  '{osub.HBatch}',  '{osub.HSampleCode}',  '{osub.HSampleRate}',  '{osub.HExpression}',  '{osub.HRejectQty}',  '{osub.HAcceptQty}',  '{osub.HSampleQty}',  '{osub.HSampleLow}',  '{osub.HSampleUp}''
                        ); ";
                        oCn.RunProc(sql1);
                    }
                }
                ////修改上级为非末级代码
                //oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 lngBillKey)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                " HName='" + oModel.HName + "'" +
                ",HShortNumber='" + oModel.HShortNumber + "'" +
                ",HParentID=" + oModel.HParentID +
                ",HLevel=" + oModel.HLevel +
                ",HEndFlag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                ",HRemark='" + oModel.HRemark + "'" +
                ",HHelpCode='" + oModel.HHelpCode + "'" +
                ",HUseFlag=" +oModel.HUseFlag  +
                ",HMakeTime='" + oModel.HMakeTime + "'" +
                ",HMakeEmp='" + oModel.HMakeEmp + "'" +
                ",HCheckEmp='" + oModel.HCheckEmp + "'" +
                ",HCheckTime='" + oModel.HCheckTime + "'" +
                ",HModifyEmp='" + oModel.HModifyEmp + "'" +
                ",HModifyTime='" + oModel.HModifyTime + "'" +
                ",HStopEmp='" + oModel.HStopEmp + "'" +
                ",HStopTime='" + oModel.HStopTime + "'" +
                ",HUSEORGID=" + oModel.HUSEORGID +
                ",HCREATEORGID=" + oModel.HCREATEORGID +
                ",HInterID=" + oModel.HInterID +
                ",HSampleTimes=" + oModel.HSampleTimes +
                ",HSampleType=" + oModel.HSampleType +
                ",HSampleLevel=" + oModel.HSampleLevel +
                ",HStrictLevel=" + oModel.HStrictLevel +
                ",HAQL=" + oModel.HAQL +
                ",HEffectDate='" + oModel.HEffectDate + "'" +
                ",HExpireDate='" + oModel.HExpireDate + "'" +
                ",HIsSystemSet=" + Convert.ToString(oModel.HIsSystemSet ? 1 : 0) +
                ",HERPItemID=" + 0 +
                ",HNumber='" + oModel.HNumber + "'" +
                " Where HItemID=" + lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.RunProc("delete Gy_SampleSchemeSub where  HInterID='" + oModel.HInterID + "'");
                // æ’入子表
                if (DetailColl != null && DetailColl.Count > 0)
                {
                    foreach (Model.ClsGy_SampleSchemeSub_Model osub in DetailColl)
                    {
                        if (osub == null)
                            continue;
                        string sql1 = $@"INSERT INTO [Gy_SampleSchemeSub] ([HInterID], [HEntryID], [HBatch], [HSampleCode], [HSampleRate], [HExpression], [HRejectQty], [HAcceptQty], [HSampleQty], [HSampleLow], [HSampleUp]) VALUES(
                        '{oModel.HInterID}', '{osub.HEntryID}',  '{osub.HBatch}',  '{osub.HSampleCode}',  '{osub.HSampleRate}',  '{osub.HExpression}',  '{osub.HRejectQty}',  '{osub.HAcceptQty}',  '{osub.HSampleQty}',  '{osub.HSampleLow}',  '{osub.HSampleUp}''
                        ); ";
                        oCn.RunProc(sql1);
                    }
                }
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_SampleScheme_Ctl()
        {
            MvarItemKey = "Gy_SampleScheme";
            MvarReportTitle = "抽样方案设置";
            oModel = new Model.ClsGy_SampleScheme_Model();
        }
    }
}
Model/Model.csproj
@@ -119,6 +119,8 @@
    <Compile Include="基础资料\基础资料\ClsGy_DiscountList.cs" />
    <Compile Include="基础资料\基础资料\ClsCg_ContractTransportBillMain.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_OperatorGroup.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_SampleSchemeSub_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_SampleScheme_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsSc_PackUnionBillBarCode_temp_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_PatrolCheckItemClass_Model.cs" />
    <Compile Include="仓库管理\ClsKf_WorkShopICStockBillMain.cs" />
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SampleSchemeSub_Model.cs
New file
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
    public class ClsGy_SampleSchemeSub_Model : DBUtility.ClsGy_Base_Model
    {
        public int HInterID;
        public int HEntryID;
        public int HBatch;
        public string HSampleCode;
        public string HSampleRate;
        public string HExpression;
        public int HRejectQty;
        public int HAcceptQty;
        public int HSampleQty;
        public int HBaHSampleUptch;
        public int HSampleLow;
        public int HSampleUp;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SampleScheme_Model.cs
New file
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
    public class ClsGy_SampleScheme_Model : DBUtility.ClsGy_Base_Model
    {
        public int HInterID;
        public int HSampleTimes;
        public string HSampleType;
        public string HSampleLevel;
        public string HStrictLevel;
        public string HAQL;
        public string HEffectDate;
        public bool HIsSystemSet;
        public string HExpireDate;
    }
}
WebAPI/App_Start/WebApiConfig.cs
@@ -30,7 +30,7 @@
                routeTemplate: "actionapi/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
            //注册签名
            // æ³¨å†Œç­¾å
            config.Filters.Add(new SignatureVerifyAttribute());
            //// å…¨å±€å¯ç”¨ JWT è®¤è¯
            //config.Filters.Add(new JwtAuthorizeAttribute());
WebAPI/Controllers/BaseSet/Gy_SampleSchemeController.cs
@@ -33,7 +33,7 @@
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_WorkCenter_Query", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log("Gy_SampleScheme_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -68,5 +68,718 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// ä¿å­˜æŒ‰é’®
        /// </summary>
        [Route("Gy_SampleScheme/ModifyByID")]
        [HttpPost]
        public object ModifyByID([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();
                //判断权限
                if (!ClsPub.Security_Log("Gy_SampleScheme_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //反序列化
                msg2 = "[" + msg2.ToString() + "]";
                List<ClsGy_SampleScheme_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_SampleScheme_Model>>(msg2);
                List<ClsGy_SampleSchemeSub_Model> list1 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_SampleSchemeSub_Model>>(msg3);
                long HItemID = list[0].HItemID;
                string HNumber = list[0].HNumber;
                string HName = list[0].HName;
                string HShortNumber = list[0].HShortNumber;
                long HParentID = list[0].HParentID;
                long HLevel = list[0].HLevel;
                bool HEndFlag = list[0].HEndFlag;
                bool HStopflag = list[0].HStopflag;
                string HRemark = list[0].HRemark;
                string HHelpCode = list[0].HHelpCode;
                string HUseFlag = list[0].HUseFlag;
                string HMakeTime = list[0].HMakeTime;
                string HMakeEmp = msg4;
                long HUSEORGID = list[0].HUSEORGID;
                long HCREATEORGID = list[0].HCREATEORGID;
                long HUnitID = list[0].HUnitID;
                if (!DBUtility.ClsPub.AllowNumber(HNumber))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //保存完毕后处理
                if (HItemID == 0)
                {
                    oCN.BeginTran();
                    //保存前控制=========================================
                    string sql1 = "exec h_p_Gy_SampleScheme_BeforeSaveCtrl " + HMakeEmp + ",'" + 1 + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_SampleScheme_BeforeSaveCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    string _sql = "select HItemID from Gy_SampleScheme where HNumber = N'" + HNumber + "'";
                    DataSet _ds = oCN.RunProcReturn(_sql, "Gy_SampleScheme");
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败: ä»£ç é‡å¤!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    string sql = $@"INSERT INTO [Gy_SampleScheme] ([HName], [HShortNumber], [HParentID], [HLevel], [HEndFlag], [HStopflag], [HRemark], [HHelpCode], [HUseFlag], [HMakeTime], [HMakeEmp], [HCheckEmp], [HCheckTime], [HModifyEmp], [HModifyTime], [HStopEmp], [HStopTime], [HUSEORGID], [HCREATEORGID], [HInterID], [HSampleTimes], [HSampleType], [HSampleLevel], [HStrictLevel], [HAQL], [HEffectDate], [HExpireDate], [HIsSystemSet], [HERPItemID], [HNumber])
                VALUES (
                '{list[0].HName}', '{list[0].HShortNumber}',  '{list[0].HParentID}',  '{list[0].HLevel}',  '{list[0].HEndFlag}',  '{list[0].HStopflag}',  '{list[0].HRemark}',  '{list[0].HHelpCode}',  '{list[0].HUseFlag}',  '{list[0].HMakeTime}',  '{HMakeEmp}',  '{list[0].HCheckEmp}','{list[0].HCheckTime}','{list[0].HModifyEmp}',  '{list[0].HModifyTime}',  '{list[0].HStopEmp}','{list[0].HStopTime}','{list[0].HUSEORGID}','{list[0].HCREATEORGID}','{list[0].HInterID}','{list[0].HSampleTimes}','{list[0].HSampleType}','{list[0].HSampleLevel}','{list[0].HStrictLevel}','{list[0].HAQL}','{list[0].HEffectDate}','{list[0].HExpireDate}','{list[0].HIsSystemSet}','{0}','{list[0].HNumber}'
                ); ";
                    oCN.RunProc(sql);
                    //修改上级为非末级代码
                    oCN.RunProc("Update Gy_SampleScheme set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    // æ‰§è¡ŒæŸ¥è¯¢èŽ·å–HItemID
                    DataSet temp_ds = oCN.RunProcReturn("select top 1 HItemID from Gy_SampleScheme where HNumber = N'" + HNumber + "'", "Gy_SampleScheme");
                    if (temp_ds.Tables[0].Rows.Count < 1)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:插入主表数据失败";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    int itemID = int.Parse(temp_ds.Tables[0].Rows[0]["HItemID"].ToString());
                    string sql3 = "";
                    // æ”¹ä¸ºfor循环,HEntryID从1开始递增
                    for (int i = 0; i < list1.Count; i++)
                    {
                        // èŽ·å–å½“å‰å¾ªçŽ¯çš„å®žä½“å¯¹è±¡
                        ClsGy_SampleSchemeSub_Model listOne = list1[i];
                        int entryID = i + 1;
                        sql3 = $@"INSERT INTO [Gy_SampleSchemeSub] ([HInterID], [HEntryID], [HBatch], [HSampleCode], [HSampleRate], [HExpression], [HRejectQty], [HAcceptQty], [HSampleQty], [HSampleLow], [HSampleUp]) VALUES(
                        '{itemID}', '{entryID}',  '{listOne.HBatch}',  '{listOne.HSampleCode}',  '{listOne.HSampleRate}',  '{listOne.HExpression}',  '{listOne.HRejectQty}',  '{listOne.HAcceptQty}',  '{listOne.HSampleQty}',  '{listOne.HSampleLow}',  '{listOne.HSampleUp}'
                        ); ";
                        oCN.RunProc(sql3);
                    }
                    //保存后控制=========================================
                    string sql2 = "exec h_p_Gy_SampleScheme_AfterSaveCtrl " + HMakeEmp + ",'" + 1 + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_SampleScheme_AfterSaveCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:保存后判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.Commit();
                }
                else
                {
                    //若MAINDI重复则重新获取
                    oCN.BeginTran();
                    //保存前控制=========================================
                    string sql1 = "exec h_p_Gy_SampleScheme_BeforeSaveCtrl " + HMakeEmp + ",'" + 2 + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_SampleScheme_BeforeSaveCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:保存前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //主表
                    oCN.RunProc("Update Gy_SampleScheme" + " set " +
                " HName='" + list[0].HName + "'" +
                ",HShortNumber='" + list[0].HShortNumber + "'" +
                ",HParentID=" + list[0].HParentID +
                ",HLevel=" + list[0].HLevel +
                ",HEndFlag=" + Convert.ToString(list[0].HEndFlag ? 1 : 0) +
                ",HStopflag=" + Convert.ToString(list[0].HStopflag ? 1 : 0) +
                ",HRemark='" + list[0].HRemark + "'" +
                ",HHelpCode='" + list[0].HHelpCode + "'" +
                ",HUseFlag='" + list[0].HUseFlag + "'" +
                ",HMakeTime='" + list[0].HMakeTime + "'" +
                ",HMakeEmp='" + HMakeEmp + "'" +
                ",HCheckEmp='" + list[0].HCheckEmp + "'" +
                ",HCheckTime='" + list[0].HCheckTime + "'" +
                ",HModifyEmp='" + list[0].HModifyEmp + "'" +
                ",HModifyTime='" + list[0].HModifyTime + "'" +
                ",HStopEmp='" + list[0].HStopEmp + "'" +
                ",HStopTime='" + list[0].HStopTime + "'" +
                ",HUSEORGID=" + list[0].HUSEORGID +
                ",HCREATEORGID=" + list[0].HCREATEORGID +
                ",HInterID=" + list[0].HInterID +
                ",HSampleTimes='" + list[0].HSampleTimes + "'" +
                ",HSampleType='" + list[0].HSampleType + "'" +
                ",HSampleLevel='" + list[0].HSampleLevel + "'" +
                ",HStrictLevel='" + list[0].HStrictLevel +"'"+
                ",HAQL=" + list[0].HAQL +
                ",HEffectDate='" + list[0].HEffectDate + "'" +
                ",HExpireDate='" + list[0].HExpireDate + "'" +
                ",HIsSystemSet=" + Convert.ToString(list[0].HIsSystemSet ? 1 : 0) +
                ",HERPItemID=" + 0 +
                ",HNumber='" + list[0].HNumber + "'" +
                " Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改子项目代码
                    //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                    //将上级 ä¸ºéžæœ«çº§
                    oCN.RunProc("Update Gy_SampleScheme set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.RunProcReturn("delete from Gy_SampleSchemeSub where HInterID = " + HItemID, "Gy_SampleSchemeSub");
                    string sql3 = "";
                    // æ”¹ä¸ºfor循环,HEntryID从1开始递增
                    for (int i = 0; i < list1.Count; i++)
                    {
                        // èŽ·å–å½“å‰å¾ªçŽ¯çš„å®žä½“å¯¹è±¡
                        ClsGy_SampleSchemeSub_Model listOne = list1[i];
                        int entryID = i + 1;
                        sql3 = $@"INSERT INTO [Gy_SampleSchemeSub] ([HInterID], [HEntryID], [HBatch], [HSampleCode], [HSampleRate], [HExpression], [HRejectQty], [HAcceptQty], [HSampleQty], [HSampleLow], [HSampleUp]) VALUES(
                        '{HItemID}', '{entryID}',  '{listOne.HBatch}',  '{listOne.HSampleCode}',  '{listOne.HSampleRate}',  '{listOne.HExpression}',  '{listOne.HRejectQty}',  '{listOne.HAcceptQty}',  '{listOne.HSampleQty}',  '{listOne.HSampleLow}',  '{listOne.HSampleUp}'
                        ); ";
                        oCN.RunProc(sql3);
                    }
                    //保存后控制=========================================
                    string sql2 = "exec h_p_Gy_SampleScheme_AfterSaveCtrl " + HMakeEmp + ",'" + 2 + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_SampleScheme_AfterSaveCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:保存后判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "保存失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.Commit();
                }
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                //oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ä¿®æ”¹æŒ‰é’®æ–¹æ³•
        /// </summary>
        [Route("Gy_SampleScheme/xg")]
        [HttpGet]
        public object xg(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from Gy_SampleScheme where HItemID=" + HInterID, "Gy_SampleScheme");
                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;
            }
        }
        /// <summary>
        /// æŸ¥è¯¢å­è¡¨æ–¹æ³•
        /// </summary>
        [Route("Gy_SampleScheme/listSub")]
        [HttpGet]
        public object listSub(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SampleScheme_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from Gy_SampleSchemeSub where 1 = 1 " + sWhere  , "Gy_SampleSchemeSub");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// åˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("Gy_SampleScheme/deletesam")]
        [HttpGet]
        public object deletesam(string HItemID, string user)
        {
            DataSet ds;
            DataSet ds1;
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SampleScheme_Delete", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (string.IsNullOrWhiteSpace(HItemID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HItemID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_SampleScheme where HItemID=" + HItemID, "Gy_SampleScheme");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                else if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "已经审核不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                ds1 = oCN.RunProcReturn("Select HItemID from  Gy_SampleScheme  Where HParentID='" + HItemID + "'", " Gy_SampleScheme");
                if (ds1.Tables[0].Rows.Count != 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此项目存在子项目,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
                if (HUseFlag == "已使用")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此项目已使用,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //删除前控制=========================================
                string sql1 = "exec h_p_Gy_SampleScheme_BeforeDelCtrl " + HItemID + ",'" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_Gy_SampleScheme_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("delete from Gy_SampleScheme  where HItemID=" + HItemID);
                oCN.RunProc("delete from Gy_SampleSchemeSub  where HInterID=" + HItemID);
                //删除后控制=========================================
                string sql2 = "exec h_p_Gy_SampleScheme_AfterDelCtrl " + HItemID + ",'" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_Gy_SampleScheme_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==================================================================================
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "* æ•°æ®åˆ é™¤æˆåŠŸï¼";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #region å®¡æ ¸ã€åå®¡æ ¸
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_SampleScheme/AuditGy_SampleScheme")]
        [HttpGet]
        public object AuditGy_SampleScheme(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SampleScheme_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_SampleScheme where HItemID=" + HInterID, "Gy_SampleScheme");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Gy_SampleScheme_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_SampleScheme_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.RunProc("update Gy_SampleScheme set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    //审核后控制=========================================
                    string sql2 = "exec h_p_Gy_SampleScheme_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_SampleScheme_AfterCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核后判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Gy_SampleScheme_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Gy_SampleScheme_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    oCN.RunProc("update Gy_SampleScheme set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    //反审核后控制=========================================
                    string sql2 = "exec h_p_Gy_SampleScheme_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Gy_SampleScheme_AfterUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核后判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
@@ -11,6 +11,7 @@
using WebAPI.Models;
using SyntacticSugar.constant;
using WebAPI.Utility;
using WebAPI.Service;
namespace WebAPI.Controllers
{
@@ -105,6 +106,7 @@
        #region æ”¶æ–™é€šçŸ¥å•分页列表
        [Route("Cg_POInStockBill/page")]
        [HttpGet]
        [RequireSignature]
        public object Cg_POInStockBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -4550,7 +4550,7 @@
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairWorkBillList_Edit  where hmainid= " + HID + " ", "h_v_Sc_MouldRepairWorkBillList_Edit");
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldRepairWorkBillList_Edit where hmainid= " + HID + " ", "h_v_Sc_MouldRepairWorkBillList_Edit");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在维修单号" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
@@ -5365,12 +5365,66 @@
        #region å™¨å…·ç»´ä¿®è®°å½•统计分析 
        /// <summary>
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表 (年月)
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBill")]
        [HttpGet]
        public object Sb_MouldRepairWorkBill_Expand1(string DateYear,string HType, string user ,string DateMonth = "-1")
        {
            if(DateMonth == "-1" || DateMonth == "" || DateMonth == null)
            {
                return Sb_MouldRepairWorkBill(DateYear, HType, user);
            }
            try
            {
                List<object> columnNameList = new List<object>();
                if (DateYear == null || DateYear.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_MouldRepairWorkBill_ExpendMonth'" + DateYear + "','" + HType + "'", "h_p_Sb_MouldRepairWorkBill");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表 (年份)
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        public object Sb_MouldRepairWorkBill(string DateYear, string HType, string user)
        {
            try
WebAPI/Controllers/WebAPIController.cs
@@ -20968,7 +20968,18 @@
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败,明细查无数据";
                    if(Type == "DJ")
                    {
                        objjson.Message = "获取失败,模具无绑定的点检规程";
                    }
                    else if (Type == "BY")
                    {
                        objjson.Message = "获取失败,模具无绑定的保养规程";
                    }
                    else
                    {
                        objjson.Message = "获取失败,明细查无数据";
                    }
                    objjson.data = null;
                    return objjson;
                }
WebAPI/Service/SignatureVerifyAttribute.cs
@@ -69,6 +69,7 @@
                if (!string.IsNullOrEmpty(query) && query.StartsWith("?"))
                {
                    rawData = query.Substring(1); 
                }
            }
            else
@@ -84,6 +85,7 @@
                            actionContext.Request.Content.Headers.ContentType.MediaType);
                }
            }
            rawData = rawData.Replace("'", "%27");
            var signStr = rawData + "&timestamp=" + timestamp + "&nonce=" + nonce + "&key=" + SecretKey;
            var serverSign = ComputeHmacSha256(signStr, SecretKey);
WebAPI/Web.config
@@ -142,13 +142,15 @@
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://47.96.97.237/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding" bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap" name="WebService1Soap" />
            <!-- <endpoint address="http://47.96.97.237/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding" bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap" name="WebService1Soap" /> -->
            <endpoint address="http://localhost:81/MESWMS-WEBS/webservice1.asmx" binding="basicHttpBinding" bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap" name="WebService1Soap" />
        </client>
    </system.serviceModel>
 <applicationSettings>
  <WebAPI.Properties.Settings>
   <setting name="WebAPI_WebS_WebService1" serializeAs="String">
    <value>http://47.96.97.237/WEBS-WMS/WebService1.asmx</value>
    <!-- <value>http://47.96.97.237/WEBS-WMS/WebService1.asmx</value> -->
    <value>http://localhost:81/MESWMS-WEBS/webservice1.asmx</value>
   </setting>
  </WebAPI.Properties.Settings>
 </applicationSettings>