| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç产任å¡åè·åè½¦é´ |
| | | [Route("Sc_ICMOBill/GetHDeptList")] |
| | | [HttpGet] |
| | | public object GetHDeptList() |
| | | { |
| | | try |
| | | { |
| | | DataSet oDs = new DataSet(); |
| | | //========== |
| | | oDs = oCN.RunProcReturn("select HItemID,HName from Gy_Department", "Gy_Department"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åæåï¼"; |
| | | objJsonResult.data = oDs.Tables[0]; |
| | | return objJsonResult; ; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å¢åè£
ç®±åå车äºä»¶ |
| | | [Route("Sc_ICMOBill/QK_PackingBillByXSBill")] |
| | | [HttpGet] |
| | |
| | | { |
| | | try |
| | | { |
| | | string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty |
| | | //string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo |
| | | // from Sc_ICMOBillMain a |
| | | // left join Sc_ICMOBillSub b on a.HInterID=b.HInterID |
| | | // left join Gy_Material m on b.HMaterID=m.HItemID |
| | | // left join Gy_Unit u on b.HUnitID=u.HItemID |
| | | // left join Gy_Customer c on a.HCusID=c.HItemID |
| | | // left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | // left join Gy_Department d on a.HDeptID=d.HItemID |
| | | // where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')"); |
| | | string sql = string.Format(@" select a.HInterID,a.HBillNo,a.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, a.HUnitID,u.HName HUnitName,b.HQty HPlanQty,a.HCusID, |
| | | c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty,a.HSeOrderBillNo |
| | | ,fo.FBILLNO FBillNo,fo.F_ZZZZ_TEXT7 FLXName,fo.FRECEIVEADDRESS FInAddress,fm1.FOLDNUMBER FMaterName,fo.F_ZZZZ_TEXT FBZFS,fu.FDATAVALUE FHX, |
| | | fu1.FDATAVALUE FQK,fo.F_ZZZZ_WBBZ FWBBZ |
| | | from Sc_ICMOBillMain a |
| | | left join Sc_ICMOBillSub b on a.HInterID=b.HInterID |
| | | left join Gy_Material m on b.HMaterID=m.HItemID |
| | |
| | | left join Gy_Customer c on a.HCusID=c.HItemID |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Gy_Department d on a.HDeptID=d.HItemID |
| | | where b.HDEPTID='113546' and b.HSeOrderInterID=(select HSeOrderInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')"); |
| | | left join AIS20200908101915zs..T_PRD_MOENTRY f1 on b.HERPEntryID=f1.FENTRYID |
| | | left join AIS20200908101915zs..T_SAL_ORDER fo on f1.FSaleOrderId =fo.FID |
| | | left join AIS20200908101915zs..T_SAL_ORDERENTRY fo1 on fo.FID=fo1.FID |
| | | left join AIS20200908101915zs..T_BD_MATERIAL fm1 on fo1.FSUBMATERIALNUMBER=fm1.FMATERIALID |
| | | LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu1 on fo1.F_ZZZZ_ASSISTANT1=fu1.FENTRYID |
| | | LEFT JOIN AIS20200908101915zs..T_BAS_ASSISTANTDATAENTRY_L fu on fo1.F_ZZZZ_ASSISTANT2=fu.FENTRYID |
| | | where b.HInterID=(select HICMOInterID from Sc_PPBomBillMain where HBillNo='" + HBillNo + "')"); |
| | | |
| | | ds = oCN.RunProcReturn(sql, "Sc_ICMOBillMain"); |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | |
| | | string day = DateTime.Now.Day.ToString(); |
| | | string nowDate = year + month + day; |
| | | string materid = ""; |
| | | int LSH; |
| | | string LSH2; |
| | | string TM = ""; |
| | | long sum = 0; |
| | | if (msg4=="ZZ") |
| | | { |
| | | string FID = ""; |
| | | oCN.BeginTran(); |
| | | foreach (Models.ClsQK_PackingBill oItemSub in ls) |
| | | { |
| | |
| | | { |
| | | //çæå¯ä¸æ¡ç æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate; |
| | | |
| | | Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | LSH = LSH + 1; |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length<6) |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | TM = sTMNumber + LSH2; |
| | | //è·åå
ç |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | string str = string.Format(@"insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + LSH + "','å¯ä¸æ¡ç '," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString() |
| | | + "'" + TM + "','å¯ä¸æ¡ç '," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString() |
| | | + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString() |
| | | + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''" |
| | | + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''" |
| | | + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()" |
| | | + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID.ToString() |
| | | + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",'" + oItemSub.HSeOrderBillNo.ToString() + "'," + HInterID.ToString() |
| | | + ",0" |
| | | + ",'" + oItemSub.HMaterName + "','','',0,'','')"); |
| | | |
| | | oCN.RunProc(str); |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillSub set HQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | oCN.RunProc(sql1); |
| | | FID = FID + HInterID + ","; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.code = FID; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ´è£
çææåï¼"; |
| | | objJsonResult.data = 1; |
| | |
| | | //çæå¯ä¸æ¡ç æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate; |
| | | Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | //æå
¥æ¡ç æ¡£æ¡ |
| | | oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Gy_Department d on a.HDeptID=d.HItemID |
| | | left join Sc_PackUnionBillMain p on a.HSourceInterID=p.HInterID |
| | | where a.HBarCode=(select HBarCode from Sc_PackUnionBillSub where HInterID= |
| | | (select HBarcodeNo from Gy_BarCodeBill where HBarCode='" + HInterID + "'))"); |
| | | where a.HBarCode in(select HBarCode from Sc_PackUnionBillSub where HInterID= |
| | | (select HBarcodeNo from Gy_BarCodeBill where HItemID='" + HInterID + "'))"); |
| | | ds = oCN.RunProcReturn(sql, "Sc_PackUnionBillSub"); |
| | | |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |