| | |
| | | string OperationType = sArray[2].ToString().Trim(); |
| | | string user = sArray[3].ToString(); |
| | | string Value = sArray[4].ToString(); |
| | | string BadReason = null; |
| | | if (sArray.Length > 4) |
| | | { |
| | | BadReason = sArray[5].ToString(); |
| | | } |
| | | if (String.IsNullOrWhiteSpace(BadReason) == true) |
| | | { |
| | | BadReason = "[]"; |
| | | } |
| | | bool bResult; |
| | | try |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | // 判断单据是否重复 |
| | | DataSet ds2 = oCN.RunProcReturn("select top 1 HInterID from QC_LastPieceCheckBillMain where HInterID=" + mainList[0].HInterID, "QC_LastPieceCheckBillMain"); |
| | | if (ds2.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此单据有误!单据重复提交!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | | //固定赋值================================= |
| | |
| | | BillNew.omodel.HBatchNo = ClsPub.isStrNull(mainList[0].HBatchNo); |
| | | BillNew.omodel.HTakeSampleCheckBillID = ClsPub.isLong(mainList[0].HTakeSampleCheckBillID); |
| | | BillNew.omodel.HTakeSampleCheckBillNo = ClsPub.isStrNull(mainList[0].HTakeSampleCheckBillNo); |
| | | BillNew.omodel.HRemarkSN = ClsPub.isStrNull(mainList[0].HRemarkSN); |
| | | BillNew.omodel.HCheckQty = mainList[0].HCheckQty; |
| | | |
| | | List<Model.ClsQC_LastPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_LastPieceCheckBillSub>>(msg3); |
| | | List<Model.ClsQC_LastPieceCheckBillSub_BadReason> badReasonList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_LastPieceCheckBillSub_BadReason>>(BadReason); |
| | | |
| | | BillNew.DetailColl = new List<Model.ClsQC_LastPieceCheckBillSub>(); |
| | | |
| | | for (int i = 0; i < subList.ToArray().Length; i++) |
| | |
| | | oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect); |
| | | oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID); |
| | | oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult); |
| | | oSub.HInspectValQ = subList[i].HInspectValQ; |
| | | |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | else |
| | |
| | | objJsonResult.Message = "无明细行信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < badReasonList.ToArray().Length; i++) |
| | | { |
| | | if (i >= 0)//HQty |
| | | { |
| | | Model.ClsQC_LastPieceCheckBillSub_BadReason oSub = new Model.ClsQC_LastPieceCheckBillSub_BadReason(); |
| | | oSub.HInterID = mainList[0].HInterID; |
| | | oSub.HEntryID = i + 1; |
| | | oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark); |
| | | oSub.HCloseMan = DBUtility.ClsPub.isStrNull(badReasonList[i].HCloseMan); |
| | | oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(badReasonList[i].HEntryCloseDate); |
| | | oSub.HCloseType = DBUtility.ClsPub.isBool(badReasonList[i].HCloseType); |
| | | oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo); |
| | | oSub.HQty = badReasonList[i].HQty; |
| | | oSub.HBadReasonID = badReasonList[i].HBadReasonID; |
| | | |
| | | BillNew.DetailCol1_BadReason.Add(oSub); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [检验单获取 不良原因] |
| | | [Route("QC_LastPieceCheckBill_BadReason/getBadReasonList")] |
| | | [HttpGet] |
| | | public object getBadReasonList(Int64 HInterID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from QC_LastPieceCheckBillSub_BadReason where HInterID=" + HInterID, "QC_LastPieceCheckBillSub_BadReason"); |
| | | |
| | | //添加列名 |
| | | 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) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无不良原因数据!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何不良原因记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 生产入库检验单根据源单获取信通过单据号滴入-源单为生产汇报单(3711) |
| | | /// <summary> |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("QC_LastPieceCheckBill/get_ICMOReportBill_Tmp_getByBillNo")] |
| | | [HttpGet] |
| | | public object get_ICMOReportBill_Tmp_getByBillNo(string HBillNo, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if ( HBillNo.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "参数不全,获取源单信息失败!HInterID:" + HBillNo +""; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sReturn = ""; |
| | | string sql = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn)) |
| | | { |
| | | switch (oSystemParameter.omodel.QC_LastPieceCheckBill_QCSchemeSource) |
| | | { |
| | | case "物料": |
| | | sql = "exec h_p_QC_GetInfoByICMOReportBill_getByBillNo " + "'物料'" + ",'" + HBillNo + "'" ; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOReportBill_getByBillNo"); |
| | | |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没查询到数据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | //添加列名 |
| | | 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 = "返回记录成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询数据异常,请与管理员联系!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [已废弃] |
| | | |
| | | #region[编辑时获取表头数据] |