| | |
| | | public string Sc_MouldProdOutBill_MouldLifeCtrlType; //ä¿åæ¶å¨å
·å¯¿å½æ§å¶ç±»å ï¼Y å¼ºå¶æ§å¶ï¼ N ä»
æç¤ºï¼ |
| | | |
| | | |
| | | //å·¥èºè·¯çº¿ |
| | | public string Gy_RoutingBill_SaveAutoLastProc; //ä¿åå°æ°æ®åºæ¶èªå¨å ä¸è½¬å·¥åº |
| | | |
| | | } |
| | | |
| | |
| | | { //ä¿®æ¹ |
| | | oCN.RunProc("update Gy_RoutingBillMain set " + |
| | | "HDate='" + HDate + |
| | | "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',HMaker='" + HMaker + |
| | | "',Hmakedate=getdate(),HMaterID='" + HMaterID + "',HName='" + HName + "',HMaterTypeID='" + HMaterTypeID + |
| | | "',HYear='" + HYear + "',HPeriod='" + HPeriod + "',HRemark='" + HRemark + "',hupdater='" + HMaker + |
| | | "',hupdatedate=getdate(),HMaterID='" + HMaterID + "',HName='" + HName + "',HMaterTypeID='" + HMaterTypeID + |
| | | "',HRoutingGroupID='" + HRoutingGroupID + "',HUnitID='" + HUnitID + "',HMaterNumber='" + HMaterNumber + "',HUnitNumber='" + HUnitNumber + |
| | | "',HStandard='" + Convert.ToString(HStandard ? 1 : 0) + "',HMainGroupID='" + HMainGroupID + "',HMainProcID='" + HMainProcID + "',HMainCenterID='" + HMainCenterID + |
| | | "',HMainTimeUnit='" + HMainTimeUnit + "',HMainUnitTime='" + HMainUnitTime + "',HMainWorkQty='" + HMainWorkQty + "',HMainPrice='" + HMainPrice + |
| | |
| | | oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID); |
| | | } |
| | | |
| | | //设置é»è®¤å·¥èºè·¯çº¿ |
| | | oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID); //设置é»è®¤å·¥èºè·¯çº¿ |
| | | //æ¯å¦å¾éé»è®¤å·¥èºè·¯çº¿ |
| | | if (HStandard) |
| | | { |
| | | //设置é»è®¤å·¥èºè·¯çº¿ |
| | | oCN.RunProc("exec h_p_Gy_RoutingBillCheck " + HInterID); //设置é»è®¤å·¥èºè·¯çº¿ |
| | | } |
| | | |
| | | //夿æ¯å¦éå¤å·¥åºå· |
| | | ds = oCN.RunProcReturn("exec h_p_Gy_RoutingCtrl " + HInterID, "h_p_Gy_RoutingCtrl"); |
| | | |
| | |
| | | #region ç产æ¥è®¡åå¹³å° çäº§è®¢åæ¥è¯¢ |
| | | [Route("JIT_DayPlanPlatFormBill/JIT_ICMOBillList")] |
| | | [HttpGet] |
| | | public object JIT_ICMOBillList(string hmainid, string HEntryID) |
| | | public object JIT_ICMOBillList(string hmainid) |
| | | { |
| | | try |
| | | { |
| | | DataSet dt = new DataSet(); |
| | | ds = oCN.RunProcReturn($"exec h_p_ICMOBillList_PrimarySubTable '{hmainid}','{HEntryID}'", "h_p_ICMOBillList_PrimarySubTable"); |
| | | |
| | | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | var list = hmainid.Split(','); |
| | | List<DataTable> listdt = new List<DataTable>(); |
| | | DataTable dtable = new DataTable("dt"); |
| | | for (int i = 0; i < list.Length; i++) |
| | | { |
| | | dt = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where æºå主å
ç in({ds.Tables[0].Rows[i]["æºå主å
ç "].ToString()}) and æºååå
ç in({ds.Tables[0].Rows[i]["æºååå
ç "].ToString()})", "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | var listEvery = list[i].Split('_'); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_ICMOBillList_PrimarySubTable '{listEvery[0]}','{listEvery[1]}'", "h_p_ICMOBillList_PrimarySubTable"); |
| | | |
| | | var dt = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where æºå主å
ç in({ds.Tables[0].Rows[0]["æºå主å
ç "].ToString()}) and æºååå
ç in({ds.Tables[0].Rows[0]["æºååå
ç "].ToString()})", "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | if (dt.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç产æç»è¡éå¤,éå¤çç产订åå·:"+ ds.Tables[0].Rows[i]["ç产订åå·"].ToString()+",æç»è¡å·:"+ ds.Tables[0].Rows[i]["ç产订åæç»è¡å·"].ToString(); |
| | | objJsonResult.Message = "ç产æç»è¡éå¤,éå¤çç产订åå·:" + ds.Tables[0].Rows[i]["ç产订åå·"].ToString() + ",æç»è¡å·:" + ds.Tables[0].Rows[i]["ç产订åæç»è¡å·"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (i == 0) |
| | | { |
| | | //æ·»å åå |
| | | for (int j = 0; j < ds.Tables[0].Columns.Count; j++) |
| | | { |
| | | dtable.Columns.Add(ds.Tables[0].Columns[j].ToString()); |
| | | } |
| | | } |
| | | listdt.Add(ds.Tables[0]); |
| | | } |
| | | |
| | | |
| | | //è·åéåæ°æ® |
| | | for (int i = 0; i < listdt.Count; i++) |
| | | { |
| | | DataRow row = dtable.NewRow(); |
| | | for (int j = 0; j < listdt[i].Columns.Count; j++) |
| | | { |
| | | if (listdt[i].Columns[j].ColumnName == "è®¡åæ°é") |
| | | { |
| | | row[j] = double.Parse(listdt[i].Rows[0][j].ToString()).ToString(); |
| | | } |
| | | else |
| | | { |
| | | row[j] = listdt[i].Rows[0][j].ToString(); |
| | | } |
| | | } |
| | | dtable.Rows.Add(row); |
| | | } |
| | | |
| | | //æ·»å å¨ææ¥æ |
| | | for (int j = 1; j <= 31; j++) |
| | | { |
| | | dtable.Columns.Add(DateTime.Now.AddDays(j - 1).ToString("yyyy-MM-dd"), typeof(Int32)); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = dtable; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | tb2.Columns.Add("HSourceID", typeof(Int32));//çäº§èµæºid |
| | | tb2.Columns.Add("ICMOBillHInterID", typeof(Int32));//ç产订å主id |
| | | tb2.Columns.Add("ICMOBillHEntryID", typeof(Int32));//ç产订ååid |
| | | tb2.Columns.Add("HProdORGID", typeof(Int32));//ç»ç»id |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++) |
| | |
| | | { |
| | | //åå·¥ |
| | | ds = oCN.RunProcReturn($"select * from Gy_Employee where HNumber='{tb2.Rows[i]["åå·¥ç¼ç "].ToString()}'", "Gy_Employee"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | if (ds.Tables[0].Rows.Count > 0) { |
| | | tb2.Rows[i]["åå·¥ç¼ç "] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,åå·¥æ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //计éåä½ |
| | | ds = oCN.RunProcReturn($"select * from Gy_Unit where HNumber='{tb2.Rows[i]["计éåä½"].ToString()}'", "Gy_Unit"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,计éå使¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //çäº§èµæº |
| | | ds = oCN.RunProcReturn($"select * from Gy_Source where HNumber='{tb2.Rows[i]["çäº§èµæºç¼ç *"].ToString()}'", "Gy_Source"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HSourceID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i+1}è¡,çäº§èµæºæ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //ç»ç» |
| | | ds = oCN.RunProcReturn($"select * from Xt_ORGANIZATIONS where HNumber='{tb2.Rows[i]["ç»ç»ç¼ç *"].ToString()}'", "Xt_ORGANIZATIONS"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | tb2.Rows[i]["HProdORGID"] = ds.Tables[0].Rows[0]["HItemID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{i + 1}è¡,ç»ç»æ¥æ æ°æ®!"; |
| | | objJsonResult.data = tb2; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//è·å¾ä¸ä¸ªæ°çid |
| | | var HICMOBillNo = list[i]["ç产订åå·*"].ToString(); |
| | | var HICMOEntrySEQ = list[i]["ç产订åæç»è¡å·*"].ToString(); |
| | | var HProdORGID = list[i]["ç»ç»ç¼ç *"].ToString(); |
| | | var HProdORGID = list[i]["HProdORGID"].ToString(); |
| | | var HWorkShopID = list[i]["HWorkShopID"].ToString(); |
| | | var HSourceID = list[i]["HSourceID"].ToString(); |
| | | var HYX = list[i]["ä¼å
级"].ToString(); |
| | |
| | | #region æ¥è®¡åå·¥å å é¤ |
| | | [Route("Sc_WorkBillSortBill/DelWorkBillSortBillList")] |
| | | [HttpGet] |
| | | public object DelWorkBillSortBillList(string HInterID, string HEntryID, string User) |
| | | public object DelWorkBillSortBillList(string HInterID,int DataType, string User) |
| | | { |
| | | try |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList where 1=1 and hmainid=" + HInterID, "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | //DataType 1=æ¥è®¡åå·¥å å¤éå é¤ 2=æ¥è®¡åå¹³å°å¤éå é¤ |
| | | if (DataType == 1) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["åæ®ç¶æ"].ToString() != "1") |
| | | var NumData = HInterID.Split(','); |
| | | |
| | | for (int i = 0; i < NumData.Length; i++) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½ååæ®ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | var NumData_T = NumData[i].Split('_'); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList where 1=1 and hmainid=" + NumData_T[0], "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["åæ®ç¶æ"].ToString() != "1") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½ååæ®ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran();//å¼å¯äºå¡ |
| | | |
| | | if (ds.Tables[0].Rows.Count == 1) |
| | | { |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillMain where HInterID={ NumData_T[0]}"); |
| | | } |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillSub where HInterID={ NumData_T[0]} and HEntryID={ NumData_T[1]}"); |
| | | |
| | | oCN.Commit();//ç»æäºå¡ |
| | | } |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if (DataType == 2) |
| | | { |
| | | var NumData = HInterID.Split(','); |
| | | |
| | | oCN.BeginTran();//å¼å¯äºå¡ |
| | | |
| | | if (ds.Tables[0].Rows.Count == 1) |
| | | for (int i = 0; i < NumData.Length; i++) |
| | | { |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillMain where HInterID={HInterID}"); |
| | | ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList where 1=1 and hmainid=" + NumData[i], "h_v_JIT_Sc_WorkBillSortBillList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["åæ®ç¶æ"].ToString() != "1") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½ååæ®ä¸è½å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran();//å¼å¯äºå¡ |
| | | |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillSub where HInterID={ NumData[i]}"); |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillMain where HInterID={ NumData[i]}"); |
| | | |
| | | oCN.Commit();//ç»æäºå¡ |
| | | } |
| | | } |
| | | oCN.RunProc($"delete from Sc_WorkBillSortBillSub where HInterID={HInterID} and HEntryID={HEntryID}"); |
| | | |
| | | oCN.Commit();//ç»æäºå¡ |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |