| | |
| | | bool HLastResult = list[0].HLastResult;//试样结论 |
| | | long HProcExchInterID = list[0].HProcExchInterID;//流转卡ID |
| | | long HProcExchEntryID = list[0].HProcExchEntryID;//流转卡子ID |
| | | long HMainSourceInterID = list[0].HMainSourceInterID;//源单ID |
| | | long HMainSourceEntryID = list[0].HMainSourceEntryID;//源单子ID |
| | | string HMainSourceBillNo = list[0].HMainSourceBillNo;//流转卡子ID |
| | | |
| | | //表体数据 |
| | | List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg_entry); |
| | |
| | | } |
| | | |
| | | //单据完整性判断 |
| | | if (HProcExchBillNo == "") |
| | | if (HProcExchBillNo == "" && HMainSourceBillNo.Substring(0, Math.Min(2, HMainSourceBillNo.Length)) != "MO" ) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | oCN.RunProc("Insert Into QC_FirstPieceCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HMaterID,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchBillNo" + |
| | | ",HPRDORGID,HLastResult,HProcExchInterID,HProcExchEntryID)" + |
| | | ",HPRDORGID,HLastResult,HProcExchInterID,HProcExchEntryID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)" + |
| | | " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" + |
| | | "," + HYear + "," + HPeriod + ",'" + HMaterID + "','" + HSourceID + "'," + HICMOInterID + "," + HICMOEntryID + ",'" + HICMOBillNo + "','" + HProcExchBillNo + "'" + |
| | | "," + HPRDORGID + ",'" + HLastResult + "'," + HProcExchInterID + "," + HProcExchEntryID + ") "); |
| | | "," + HPRDORGID + ",'" + HLastResult + "'," + HProcExchInterID + "," + HProcExchEntryID + "," + HMainSourceInterID + "," + HMainSourceEntryID + ",'" + HMainSourceBillNo + "'" + ") "); |
| | | |
| | | //插入子表 |
| | | foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in BillNew.DetailColl) |
| | |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | //oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | //oItemSub.HRelationQty = 0; //关联数量 |
| | |
| | | item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | item.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | item.HSourceInterID = 0; // 源单主内码 |
| | | item.HSourceEntryID = 0; //源单子内码 |
| | | //item.HSourceInterID = 0; // 源单主内码 |
| | | //item.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | item.HRelationQty = 0; //关联数量 |
| | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | string msg4 = sArray[2].ToString(); |
| | | |
| | | //string UserName = ""; |
| | |
| | | return objJsonResult; |
| | | } |
| | | //得到信息 |
| | | ds = oCN.RunProcReturn("select top 1 * from Gy_EquipFileBillMain where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain"); |
| | | ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileBillList where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain"); |
| | | //写入信息 |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "未查询到设备信息!"; |
| | | objJsonResult.Message = "1.未查询到设备信息! 2.设备没有维护故障登记单"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | string UserName = ""; |
| | | |
| | |
| | | oBill.omodel = oItem; |
| | | } |
| | | //子表体数据 |
| | | |
| | | //按 },{来拆分数组 //去掉【和】 |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | List<Models.ClsSb_EquipRepairWorkBillSub> ls = new List<Models.ClsSb_EquipRepairWorkBillSub>(); |
| | | ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg2); |
| | | ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg3); |
| | | int i = 0; |
| | | foreach (Models.ClsSb_EquipRepairWorkBillSub oItemSub in ls) |
| | | { |
| | |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //关闭类型 |
| | | //oItemSub.HRemark = ""; //备注 |
| | | oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceInterID = 0; // 源单主内码 |
| | | //oItemSub.HSourceEntryID = 0; //源单子内码 |
| | | //oItemSub.HSourceBillNo = ""; //源单单号 |
| | | //oItemSub.HSourceBillType = ""; //源单类型 |
| | | //oItemSub.HRelationQty = 0; //关联数量 |
| | |
| | | /// <returns></returns> |
| | | [Route("Web/GetItemByEquipFile")] |
| | | [HttpGet] |
| | | public object GetItemByEquipFile(int EquipProjectID,string Type) |
| | | public object GetItemByEquipFile(int EquipProjectID,string Type,string HDate) |
| | | { |
| | | if (EquipProjectID <= 0) |
| | | { |
| | |
| | | } |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID); |
| | | //string sql = string.Format(@"select * from " + HView + " where HInterID = " + EquipProjectID); |
| | | string sql = string.Format(@"Exec h_p_Sb_GetCheckItem_PDA '" + EquipProjectID + "','" + Type + "','" + HDate + "'"); |
| | | ds = oCN.RunProcReturn(sql, HView); |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + |
| | | ",HYear,HPeriod,HRemark,HEquipID" + |
| | | ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo" + |
| | | ",HDeptID,HQty" + |
| | | ",HDeptID,HQty,HEquipDotCheckRuleInterID" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" + |
| | | "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() + |
| | | ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" + |
| | | ",'" + omodel.HDeptID + "'," + omodel.HQty + |
| | | ",'" + omodel.HDeptID + "'," + omodel.HQty + "," + omodel.HEquipDotCheckRuleInterID + |
| | | ") "); |
| | | //插入子表 |
| | | foreach (Models.ClsSb_EquipDotCheckBillSub oSub in DetailColl) |
| | |
| | | "HCloseMan,HEntryCloseDate,HCloseType,HRemark," + |
| | | "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," + |
| | | "HDotCheckItem,HDotCheckPart,HClaim," + |
| | | "HManagerID,HManagerNumber,HDotCheckResult " + |
| | | "HManagerID,HManagerNumber,HDotCheckResult,HDotCheckItemID " + |
| | | ") values(" |
| | | + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + |
| | | ",'" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim + |
| | | "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "','" + oSub.HDotCheckResult + "'" + |
| | | "'," + oSub.HManagerID.ToString() + ",'" + oSub.HManagerNumber + "','" + oSub.HDotCheckResult + "'," + oSub.HDotCheckItemID + |
| | | ") "); |
| | | } |
| | | //更新点检计划子表关联标记 |
| | | oCn.RunProc("update Sb_EquipDotCheckPlanBillSub_Plan set HRelationFlag = 1 where HInterID = " + omodel.HPlanInterID + " and HEntryID = " + omodel.HPlanEntryID); |
| | | // |
| | | //foreach (Model.ClsSb_EquipDotCheckBillSub oSub in DetailColl) |
| | | //{ |
| | |
| | | |
| | | //反写产量汇报单,质量汇报单关联字段,生产订单关联数量 |
| | | ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," + |
| | | DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + "," + DetailColl[0].HICMOBillNo + ",'" + DetailColl[0].HSourceID + "','" + |
| | | DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" + |
| | | "Add" + "'," + 0 |
| | | , "h_p_Sc_ICMOReportBill_ReverseWriteQty"); |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1") |
| | |
| | | // |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "九菱") //系统参数 客户定制化名称 空白为通用 |
| | | { |
| | | FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组 |
| | | FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员 |
| | | |
| | | } |
| | | |
| | | FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组 |
| | | FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// 操作员 |
| | | |
| | | FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM版本 |
| | | |
| | | //sJson_BatchNo + |
| | |
| | | public DateTime HBeginDate; |
| | | public DateTime HEndDate; |
| | | public string HPlanNo; |
| | | public Int64 HPlanInterID; |
| | | public Int64 HPlanEntryID; |
| | | public string HExplanation; |
| | | public string HInnerBillNo; |
| | | public long HDeptID;// int --部门ID |
| | | public decimal HQty; //数量 |
| | | public Int64 HEquipDotCheckRuleInterID; //点检规程 |
| | | } |
| | | } |