瑞琪添加删除汇报单控制;报工台合并产量汇报单生成生产汇报单;新增报表:生产订单领料状态报表;库存库龄分析报表;生产不良原因统计分析报表;不良原因总体统计分析报表;质量追溯报表;质量预警报表;直通率报表;直通率周报表;
7个文件已修改
2个文件已添加
1099 ■■■■■ 已修改文件
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/质量报表/QC_QualityReportsController.cs 461 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/生产报表/Sc_ProductReportController.cs 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOReportBill.cs 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2060,6 +2060,27 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //删除前判断有没有生成金蝶单据(生产汇报单,生产入库单)
                    ds = oCn.RunProcReturn($"exec h_p_Cj_StationOutBill_BeforeDelCtrl {HInterID}", "h_p_Cj_StationOutBill_BeforeDelCtrl");
                    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]["HBackCount"].ToString() == "1")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = ds.Tables[0].Rows[0]["HRemarkBack"].ToString();
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -73,6 +74,58 @@
            }
        }
        #region è®¾å¤‡ç‚¹æ£€è®°å½•统计分析
        /// <summary>
        /// è¿”回设备点检记录统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_EquipDotCheckReport/Statistics")]
        [HttpGet]
        public object Statistics(string DateYear, string HType, string 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_EquipDotCheckBillReport '" + DateYear + "','" + HType + "'", "h_p_Sb_EquipDotCheckBillReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region sql语句
WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs
@@ -87,6 +87,59 @@
            }
        }
        #region è®¾å¤‡ä¿å…»è®°å½•统计分析
        /// <summary>
        /// è¿”回设备保养记录统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_EquipMaintainReport/Statistics")]
        [HttpGet]
        public object Statistics(string DateYear, string HType, string 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_EquipMaintainBillReport '" + DateYear + "','" + HType + "'", "h_p_Sb_EquipMaintainBillReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region sql语句
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
@@ -1103,5 +1103,70 @@
        }
        #endregion
        #region  ç”Ÿäº§æ±‡æŠ¥å•获取源单产量汇报单临时表信息
        /// <summary>
        /// ç”Ÿäº§æ±‡æŠ¥å•获取源单产量汇报单临时表信息
        /// </summary>
        /// <returns></returns>
        [Route("Sc_ICMOReportBill/GetProdReportBillList")]
        [HttpGet]
        public object GetProdReportBillList(string HInterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HInterID == null || HInterID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "产量汇报单内码为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    string sql = "exec h_p_Sc_ICMOBillWorkQtyStatus_TmpList '" + HInterID + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOBillWorkQtyStatus_TmpList");
                }
                //添加列名
                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列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds;
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -77,6 +77,58 @@
        }
        #endregion
        #region è®¾å¤‡ç»´ä¿®è®°å½•统计分析
        /// <summary>
        /// è¿”回设备维修记录统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_EquipRepairWorkReport/Statistics")]
        [HttpGet]
        public object Statistics(string DateYear, string HType, string 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_EquipRepairWorkBillReport '" + DateYear + "','" + HType + "'", "h_p_Sb_EquipRepairWorkBillReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è®¾å¤‡ç»´ä¿®å·¥å•列表sql语句
        public static DataSet Sb_EquipRepairWorkBill_s(string sWhere)
        {
@@ -204,6 +256,59 @@
        }
        #endregion
        #region è®¾å¤‡æ•…障记录统计分析
        /// <summary>
        /// è¿”回设备故障记录统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_EquipConkBookReport/Statistics")]
        [HttpGet]
        public object Statistics_Conk(string DateYear, string HType, string 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_EquipConkBookBillReport '" + DateYear + "','" + HType + "'", "h_p_Sb_EquipConkBookBillReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è®¾å¤‡æ•…障登记单列表sql语句
        public static DataSet Sb_EqpConkBookBillList_s(string sWhere)
        {
WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
New file
@@ -0,0 +1,461 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web.Http;
using WebAPI.DLL;
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
namespace WebAPI.Controllers
{
    public class QC_QualityReportsController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        #region è´¨é‡æ¨¡å— ç›´é€šçŽ‡æŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回直通率报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/FirstPassRate")]
        [HttpGet]
        public object FirstPassRate(string Year,string DeptName, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (Year == null || Year.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateReport '" + Year + "','" + DeptName + "'", "h_p_QC_FirstPassRateReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— ç”Ÿäº§ä¸è‰¯åŽŸå› ç»Ÿè®¡åˆ†æžæŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回生产不良原因统计分析报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/ProdBadReason")]
        [HttpGet]
        public object ProdBadReason(string BeginDate, string EndDate, string DeptName,string ICMOBillNo, string SourceName, string DeptType, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (BeginDate == null || BeginDate.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonByProcReport '" + BeginDate + "','" + EndDate + "','" + DeptName + "','" + ICMOBillNo + "','"
                        + SourceName + "','" + DeptType + "'", "h_p_Sc_BadReasonByProcReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— ç›´é€šçŽ‡å‘¨æŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回直通率周报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/FirstPassRateWeek")]
        [HttpGet]
        public object FirstPassRateWeek(string Year, string DeptName, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (Year == null || Year.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateWeekReport '" + Year + "','" + DeptName + "'", "h_p_QC_FirstPassRateWeekReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— ä¸è‰¯åŽŸå› æ€»ä½“ç»Ÿè®¡åˆ†æžæŠ¥è¡¨æŸ¥è¯¢
        /// <summary>
        /// è¿”回不良原因总体统计分析报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/ProdBadReason_Sum")]
        [HttpGet]
        public object ProdBadReason_Sum(string BeginDate, string EndDate, string DeptName, string ICMOBillNo, string SourceName, string DeptType, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (BeginDate == null || BeginDate.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_BadReasonByProcReport_Sum '" + BeginDate + "','" + EndDate + "','" + DeptName + "','" + ICMOBillNo + "','"
                        + SourceName + "','" + DeptType + "'", "h_p_Sc_BadReasonByProcReport_Sum");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— è´¨é‡é¢„警报表查询
        /// <summary>
        /// è¿”回质量预警报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/ProductQtyWarning")]
        [HttpGet]
        public object ProductQtyWarning(DateTime HBeginDate, DateTime HEndDate, string DeptName)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HBeginDate == null || HBeginDate.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有时间";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_FirstPassRateICMOReport '" + HBeginDate + "','" + HEndDate + "','" + DeptName + "'", "h_p_QC_FirstPassRateICMOReport");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— è´¨é‡è¿½æº¯æŠ¥è¡¨æŠ¥è¡¨æŸ¥è¯¢(首件检验)
        /// <summary>
        /// è¿”回质量追溯报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/QualityTraceability1")]
        [HttpGet]
        public object QualityTraceability1(string HICMOBillNo, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[2].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[2];
                objJsonResult.list = columnNameList;
                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("QC_Report/QualityTraceability2")]
        [HttpGet]
        public object QualityTraceability2(string HICMOBillNo, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[3].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[3];
                objJsonResult.list = columnNameList;
                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("QC_Report/QualityTraceability3")]
        [HttpGet]
        public object QualityTraceability3(string HICMOBillNo, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
                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;
            }
        }
        #endregion
        #region è´¨é‡æ¨¡å— è´¨é‡è¿½æº¯æŠ¥è¡¨æŠ¥è¡¨æŸ¥è¯¢ï¼ˆè´¨é‡æ±‡æŠ¥ï¼‰
        /// <summary>
        /// è¿”回质量追溯报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("QC_Report/QualityTraceability4")]
        [HttpGet]
        public object QualityTraceability4(string HICMOBillNo, string HType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_QueryQualityByICMOBill '" + HType + "','" + HICMOBillNo + "'", "h_p_Sc_QueryQualityByICMOBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[1].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[1];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²ú±¨±í/Sc_ProductReportController.cs
New file
@@ -0,0 +1,119 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web.Http;
using WebAPI.DLL;
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
namespace WebAPI.Controllers
{
    public class Sc_ProductReportController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        #region ç”Ÿäº§æ¨¡å— ç”Ÿäº§è®¢å•领料状态报表查询
        /// <summary>
        /// è¿”回生产订单领料状态报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_Report/ProdOrderPickingStatus")]
        [HttpGet]
        public object ProdOrderPickingStatus(DateTime HBeginDate, DateTime HEndDate, string HICMOBillNo, string HDeptName, string HMaterNumber, string HMaterName, string HMaterModel)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HBeginDate == null || HBeginDate.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择开始时间";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ICMOBillPlanList '" + HBeginDate + "','" + HEndDate + "','" + HICMOBillNo + "','" + HMaterNumber + "','" + HMaterName + "','" + HMaterModel + "','" + HDeptName + "'", "h_p_Sc_ICMOBillPlanList");
                }
                //添加列名
                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;
            }
        }
        #endregion
        #region ç”Ÿäº§æ¨¡å— åº“存库龄分析报表查询
        /// <summary>
        /// è¿”回库存库龄分析报表列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_Report/InventoryAge")]
        [HttpGet]
        public object InventoryAge(string HWhName, string HLot, string HMaterNumber, string HMaterName)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Kf_StockQtyDateTimesReport '" + HWhName + "','" + HLot + "','" + HMaterNumber + "','" + HMaterName +  "'", "h_p_Kf_StockQtyDateTimesReport");
                //添加列名
                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;
            }
        }
        #endregion
    }
}
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -3,6 +3,9 @@
using System.Text;
using System.Data;
using DBUtility;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using WebAPI.Models;
namespace WebAPI.DLL
{
@@ -11,6 +14,8 @@
        public Models.ClsSc_ICMOReportBillMain omodel = new Models.ClsSc_ICMOReportBillMain();
        public Models.ClsSc_ICMOReportBillSub oSub = new Models.ClsSc_ICMOReportBillSub();
        public List<Models.ClsSc_ICMOReportBillSub> DetailColl = new List<Models.ClsSc_ICMOReportBillSub>();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        private json objJsonResult = new json();
        public ClsSc_ICMOReportBill()
        {
@@ -171,7 +176,7 @@
                {
                    oCn.RunProc("Insert into Sc_ICMOReportBillSub " +
                      " (HInterID,HEntryID,HMaterID,HMaterNumber" +
                      ",HQty,HUnitID,HUnitNumber,HTimes,HSourceID" +
                      ",HQty,HBadQty,HUnitID,HUnitNumber,HTimes,HSourceID" +
                      ",HQtyMust,HWorkerID,HWorkerNumber,HBadCount,HWasterQty," +
                      "HCloseMan,HCloseType,HRemark," +
                      "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
@@ -185,7 +190,7 @@
                      ",HWhID,HSPID,HBatChNo,HAuxPropID,HMTONo,HPlanMode,HERPInterID,HERPEntryID" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber + "'" +
                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() +
                      "," + oSub.HQty.ToString() + "," + oSub.HBadQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() +
                      "," + oSub.HQtyMust.ToString() + "," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HBadCount.ToString() + "," + oSub.HWasterQty.ToString() +
                      ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
@@ -331,6 +336,217 @@
                oCn.BeginTran();
                oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                DataSet ds,Ds;
                ds = oCn.RunProcReturn("select * from  Sc_ICMOReportBillMain where HInterID = " + lngBillKey, "Sc_ICMOReportBillMain");
                string HBillNo = "";
                if (ds.Tables[0].Rows.Count > 0)
                {
                    HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                }
                Ds = oCn.RunProcReturn("exec h_p_Kf_GetICMOReportBill_ICMO_CLD_WorkQty " + lngBillKey.ToString() + ",'" + HBillNo + "'", "h_p_Kf_GetICMOReportBill_ICMO_CLD_WorkQty");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0 || Ds.Tables[1].Rows.Count == 0)
                {
                    LogService.Write("生产汇报单审核,获取json子表信息失败");
                    oCn.RollBack();
                    return false;
                }
                else
                {
                    LogService.Write("获取json子表信息成功");
                    string sJson_ZYMESFLAG = "";    //生产汇报单同步MES标记
                    sJson_ZYMESFLAG = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FHZYMESFLAG"]);
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," +
                        "\"IsEntryBatchFill\":\"false\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," +
                        "\"Model\": { \"FBILLNO\":\"" + HBillNo + "\"," +
                        //"\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                        "\"FBillType\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\"}," +
                        //\"FDocumentStatus\":\"\",
                        "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
                        "\"FPRDORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPRDORGID"]) + "\"}," +
                        //\"FWorkshipIdH\":{\"FNumber\":\"\"},
                        //\"FDescription\":\"\",
                        sJson_ZYMESFLAG +
                        "\"FEntity\": [   ";
                    string sJson_Entry = "";
                    for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
                    {
                        if (sJson_Entry != "")
                        {
                            sJson_Entry = sJson_Entry + " , ";
                        }
                        string sJson_BatchNo = "";
                        string sJson_StockPlace = "";
                        string sJson_EntryCustom = "";
                        if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HISBATCHMANAGE"]) == "1") //是否启用批次管理
                        {
                            sJson_BatchNo = "  \"FLOT\": {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"},    \"FLOT_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\"  , ";
                        }
                        else
                        {
                            sJson_BatchNo = "";
                        }
                        //仓位
                        if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKLOCID"]) == "")
                        {
                            sJson_StockPlace = "";
                        }
                        else
                        {
                            sJson_StockPlace = Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKLOCID"]) + "\"}},";
                        }
                        //自定义字段处理
                        if (oSystemParameter.omodel.WMS_CampanyName == "四维尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                        {
                            sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\"," +         //单据状态
                                                "\"F_abcd_Datetime\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_abcd_Datetime"]) + "\","; //计划开工日期
                        }
                        //
                        sJson_Entry = sJson_Entry + " {" +
                        //" \"FEntryID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HEntryID"]) + "," +
                        " \"FSRCENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + "," +
                        " \"FIsNew\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsNew"]) + "," +
                        " \"FMATERIALID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMATERIALID"]) + "\"}," +
                        " \"FPRODUCTTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPRODUCTTYPE"]) + "\"," +
                        " \"FREPORTTYPE\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREPORTTYPE"]) + "\"}," +
                        " \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}," +
                        " \"FWORKSHIPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID"]) + "\"}," +
                        //\"FShiftGroupId\":{\"FNumber\":\"\"},
                        sJson_BatchNo +
                        //\"FDeptId\":{\"FNumber\":\"\"},
                        sJson_StockPlace +
                        " \"FMTONO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMTONO"]) + "\"," +
                        " \"FCHECKPRODUCT\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCHECKPRODUCT"]) + "," +
                        " \"FISENTRUST\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISENTRUST"]) + "," +
                        " \"FSRCBILLTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\"," +
                        " \"FMOBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\"," +
                        " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," +
                        //\"FHumanQty\":\"0\",
                        " \"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
                        //\"FMachineQty\":\"0\",
                        //\"FMaterialUnitID\":{\"FNumber\":\"\"},
                        //\"FStartTime\":\"1900-01-01\",
                        //\"FEndTime\":\"1900-01-01\",
                        //\"FTimeUnitId\":\"\",
                        " \"FMOENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "," +
                        //" \"FSTANDHOURUNITID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTANDHOURUNITID"]) + "\"," +
                        " \"FPROJECTNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPROJECTNO"]) + "\"," +
                        " \"FSTDMANHOUR\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTDMANHOUR"]) + "," +
                        " \"FHRPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FHRPREPARETIME"]) + "," +
                        //\"FHrWorkTime\":\"0\",
                        " \"FMACPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMACPREPARETIME"]) + "," +
                        //\"FMacWorkTime\":\"0\",
                        //\"FDescriptionE\":\"\",
                        " \"FSRCINTERID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "," +
                        " \"FSRCENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYSEQ"]) + "," +
                        " \"FMOID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "," +
                        " \"FMOENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + "," +
                        " \"FBASEUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITID"]) + "\"}," +
                        " \"FSTOCKINORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKINORGID"]) + "\"}," +
                        " \"FBOMID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBOMID"]) + "\"}," +
                        " \"FOWNERTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERTYPEID"]) + "\"," +
                        " \"FOWNERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERID"]) + "\"}," +
                        " \"FSTOCKID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}," +
                        " \"FCOSTRATE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "," +
                        " \"FSNUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUNITID"]) + "\"}," +
                        //\"FSNQty\":\"0\",
                        //\"FProduceDate\":\"1900-01-01\",
                        //\"FExpiryDate\":\"1900-01-01\",
                        " \"FISBACKFLUSH\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISBACKFLUSH"]) + "," +
                        " \"FMOMAINENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "," +
                        " \"FQAIP\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQAIP"]) + "\"," +
                        " \"FREQSRC\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQSRC"]) + "\"," +
                        " \"FREQBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLNO"]) + "\"," +
                        " \"FREQBILLID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLID"]) + "," +
                        " \"FREQENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQENTRYSEQ"]) + "," +
                        " \"FREQENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQENTRYID"]) + "," +
                        " \"FBASEQUAQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEQUAQTY"]) + "," +
                        " \"FQUAQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQUAQTY"]) + "," +
                        " \"FBASEFINISHQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEFINISHQTY"]) + "," +
                        " \"FFINISHQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FFINISHQTY"]) + "," +
                        sJson_EntryCustom +
                        //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
                        //\"FQCMaterialId\":{\"FNUMBER\":\"\"},
                        //\"FInspectResult\":\"\",
                        //\"FQcAuxPropId\":{\"FQCAUXPROPID__FF100002\":{\"FNumber\":\"\"}},
                        //\"FQCQty\":\"0\",
                        //\"FSerialNo\":\"\",
                        //\"FSerialId\":{\"FNUMBER\":\"\"},
                        //\"FQCStockInSelQty\":\"0\",
                        //\"FSerialNote\":\"\",
                        //\"FBaseQCQty\":\"0\",
                        //\"FBaseQCStockInSelQty\":\"0\"}]
                        " \"FEntity_Link\": [{" +
                            " \"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," +
                            " \"FEntity_Link_FFlowLineId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowLineId"]) + "\"," +
                            " \"FEntity_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," +
                            " \"FEntity_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSTableName"]) + "\"," +
                            " \"FEntity_Link_FSBillId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSBillId"]) + "\"," +
                            " \"FEntity_Link_FSId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FSId"]) + "\"" +
                        " } ]," +
                        " \"FBFLOWID\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLOWID"]) + "\"}}";
                    }
                    string sJson_End = "  ]  }}";
                    string sJson = sJson_Main + sJson_Entry + sJson_End;
                    //从配置文件获取 CLOUD网址、账套信息、登录用户、登录密码
                    if (!Pub_Class.ClsPub.GetCLOUDLoginInfo(ref Pub_Class.ClsPub.sExeReturnInfo))
                    {
                        LogService.Write("生产汇报单审核,同步获取登录账号密码失败");
                        return false;
                    }
                    var loginRet = InvokeHelper.Login();
                    var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                    if (isSuccess == 0)
                    {
                        oCn.RollBack();
                        return false;
                    }
                    else
                    {
                        LogService.Write("开始调用保存方法");
                        string result = InvokeHelper.Save("PRD_MORPT", JsonConvert.SerializeObject(sJson));//保存
                        if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                        {
                            LogService.Write("生产汇报错误jsonRoot:" + sJson);
                            oCn.RollBack();
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"生产汇报单同步金蝶云失败!单号:{HBillNo.ToString()}" + result + sJson;
                            objJsonResult.data = null;
                            return false;
                        }
                        //提交审核
                        string result1 = string.Empty;
                        string result2 = string.Empty;
                        if (oSystemParameter.omodel.Sc_ICMOReportBill_AutoCheck == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸
                        {
                            result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(sJson));//提交
                            result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(sJson));//审核
                            if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                            {
                                oCn.RollBack();
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = $"生产汇报单单号:{HBillNo},提交失败" + result;
                                objJsonResult.data = null;
                                return false;
                            }
                        }
                    }
                }
                sReturn = "审核单据成功!";
                oCn.Commit();
WebAPI/WebAPI.csproj
@@ -499,6 +499,7 @@
    <Compile Include="Controllers\品质管理\客诉处理单\Crm_CustomerAppealBillController.cs" />
    <Compile Include="Controllers\品质管理\巡检单\QC_PatrolProcCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\工序检验单\MES_ProcessCheckBill_PDAController.cs" />
    <Compile Include="Controllers\品质管理\质量报表\QC_QualityReportsController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_COMMONCONTACTBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_CustLocationController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DutyBillController.cs" />
@@ -605,6 +606,7 @@
    <Compile Include="Controllers\生产管理\报工台工序\Sc_MESStopStepWorkBillController.cs" />
    <Compile Include="Controllers\生产管理\报工台工序\Sc_QualityReportStepBillController.cs" />
    <Compile Include="Controllers\生产管理\生产任务单\Sc_ICMOBillController.cs" />
    <Compile Include="Controllers\生产管理\生产报表\Sc_ProductReportController.cs" />
    <Compile Include="Controllers\生产管理\质量汇报单\Sc_QualityReportBillController.cs" />
    <Compile Include="Controllers\项目管理\业绩指标\PM_YearEmployeeMoneyBillController.cs" />
    <Compile Include="Controllers\项目管理\工作任务\PM_WorkTaskBillController.cs" />