瑞琪添加删除汇报单控制;报工台合并产量汇报单生成生产汇报单;新增报表:生产订单领料状态报表;库存库龄分析报表;生产不良原因统计分析报表;不良原因总体统计分析报表;质量追溯报表;质量预警报表;直通率报表;直通率周报表;
| | |
| | | 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)) |
| | | { |
| | |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | } |
| | | } |
| | | |
| | | #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è¯å¥ |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #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è¯å¥ |
| | | |
| | | |
| | |
| | | } |
| | | #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 |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | #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) |
| | | { |
| | |
| | | } |
| | | #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) |
| | | { |
New file |
| | |
| | | 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 |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | 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 |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Text; |
| | | using System.Data; |
| | | using DBUtility; |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.DLL |
| | | { |
| | |
| | | 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() |
| | | { |
| | |
| | | { |
| | | 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" + |
| | |
| | | ",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() + |
| | |
| | | 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(); |
| | | |
| | |
| | | <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" /> |
| | |
| | | <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" /> |