diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/ManufactureOrderPick.cs b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/ManufactureOrderPick.cs index aa126f7..005bf22 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/ManufactureOrderPick.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/ManufactureOrderPick.cs @@ -29,6 +29,7 @@ namespace ICSSoft.DataProject { string msg = ""; string connS = ""; + DataSet ds = null; if (Bills.Count <= 0) { throw new Exception("传送数据为空!"); @@ -58,18 +59,20 @@ namespace ICSSoft.DataProject ERPDB = ss[1]; Dictionary dic; string sql = ""; + List ids = new List(); #region 备料表 foreach (ICSManufactureOrderPicks body in head.details) { dic = DBHelper.GetAllCode(ERPDB, "mom_moallocate", "1", head.WorkPoint); int iFatherId = Convert.ToInt32(dic["iFatherId"].ToString()); int iChildId = Convert.ToInt32(dic["iChildId"].ToString()); + ids.Add(iChildId); #region 生产备料表 sql = @"SELECT '{6}' AS AllocateId,d.MoDId,'{2}' AS SortSeq,ISNULL(a.OpSeq, '0000') AS OpSeq,ISNULL(a.ComponentId,c.PartId) AS ComponentId, ISNULL(a.FVFlag,'1') AS FVFlag,'{3}' AS BaseQtyN,'{4}' AS BaseQtyD,'0' AS ParentScrap,ISNULL(a.CompScrap,'0') AS CompScrap, '{5}' AS Qty,'0' AS IssQty,'0' AS DeclaredQty, GETDATE() AS StartDemDate, GETDATE() AS EndDemDate, '{7}' AS WhCode,NULL AS LotNo,'{8}' AS WIPType,ISNULL(a.ByproductFlag,'0') AS ByproductFlag,'0' AS QcFlag, - '0' AS Offset,ISNULL(a.Free1,'') AS Free1,ISNULL(a.Free2,'') AS Free2,ISNULL(a.Free3,'') AS Free3 + '0' AS Offset,c.InvCode,ISNULL(a.Free1,'') AS Free1,ISNULL(a.Free2,'') AS Free2,ISNULL(a.Free3,'') AS Free3 ,ISNULL(a.Free4,'') AS Free4,ISNULL(a.Free5,'') AS Free5,ISNULL(a.Free6,'') AS Free6,ISNULL(a.Free7,'') AS Free7,ISNULL(a.Free8,'') AS Free8 ,ISNULL(a.Free9,'') AS Free9,ISNULL(a.Free10,'') AS Free10,ISNULL(a.OpComponentId,'0') AS OpComponentId,a.Define22,a.Define23, a.Define24,a.Define25,a.Define26,a.Define27,a.Define28, @@ -80,11 +83,11 @@ namespace ICSSoft.DataProject '0' AS OrgAuxQty,NULL AS CostItemCode,NULL AS CostItemName,'0' AS RequisitionFlag,'0' AS RequisitionQty, '0' AS RequisitionIssQty,'0' AS CostWIPRel,NULL AS MoallocateSubId,NULL AS cSubSysBarCode,'0' AS PickingQty, '0' AS PickingAuxQty,'0' AS UpperMoQty,'0' AS InvAlloeFlag,NULL AS FactoryCode - INTO #TempBOMP + INTO #TempMOAll FROM mom_orderdetail d INNER JOIN bas_part p on d.InvCode = p.InvCode LEFT JOIN bom_parent q on q.ParentId = p.PartId - LEFT JOIN bom_bom b ON q.BomId=b.BomId AND a.VersionEndDate>=CONVERT(VARCHAR(10),GETDATE(),23) + LEFT JOIN bom_bom b ON q.BomId=b.BomId AND b.VersionEndDate>=CONVERT(VARCHAR(10),GETDATE(),23) --子料 INNER JOIN bas_part c ON c.InvCode='{1}' LEFT JOIN bom_opcomponent a ON a.ComponentId = c.PartId AND a.BomId=b.BomId @@ -125,7 +128,7 @@ namespace ICSSoft.DataProject PickingAuxQty,UpperMoQty,InvAlloeFlag,FactoryCode FROM #TempMOAll"; - sql += @" DROP TABLE #TempMOAll" + iFatherId + Environment.NewLine; + sql += @" DROP TABLE #TempMOAll" + Environment.NewLine; cmd.CommandText = sql; try { @@ -143,12 +146,43 @@ namespace ICSSoft.DataProject #endregion } #endregion + + #region 查询 + sql = @" SELECT DISTINCT a.MoDId AS IDs,a.MoDId AS DetailID,a.SortSeq AS DetailSequence,a.InvCode AS DetailInvCode,a.Qty AS DetailQuantity + FROM mom_orderdetail a + INNER JOIN mom_moallocate b ON a.MoDId=b.MoDId + WHERE b.AllocateId in ({0}) + + SELECT DISTINCT a.MoDId as IDs, AllocateId as PickID,SortSeq as Sequence, + InvCode,Qty as Quantity,0 as Amount,a.WhCode,b.cWhName AS WHName,WIPType AS SupplyType, + '' ProjectCode,'' cBatch,'' version ,'' brand, + isnull(a.Free1,'') as cFree1, + isnull(a.Free2,'') as cFree2, + isnull(a.Free3,'') as cFree3, + isnull(a.Free4,'') as cFree4, + isnull(a.Free5,'') as cFree5, + isnull(a.Free6,'') as cFree6, + isnull(a.Free7,'') as cFree7, + isnull(a.Free8,'') as cFree8, + isnull(a.Free9,'') as cFree9, + isnull(a.Free10,'') as cFree10 + FROM mom_moallocate a + LEFT JOIN Warehouse b on a.WhCode=b.cWhCode + WHERE a.AllocateId in ({0}) "; + sql = string.Format(sql, "'" + string.Join("','", ids) + "'"); + if (ds != null) + ds.Merge(DBHelper.SQlReturnDataSet(sql, cmd)); + else + ds = DBHelper.SQlReturnDataSet(sql, cmd); + #endregion + } cmd.Transaction.Commit(); } catch (Exception ex) { - cmd.Transaction.Rollback(); + if(cmd.Transaction!=null) + cmd.Transaction.Rollback(); log.Error(ex.Message); throw new Exception(ex.Message); } @@ -161,6 +195,7 @@ namespace ICSSoft.DataProject conn.Dispose(); } } + msg = JSON.DataSetToJson(ds, "details", "IDs"); return msg; } diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OtherOutDoc.cs b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OtherOutDoc.cs index 9a823f8..8a60475 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OtherOutDoc.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/OtherOutDoc.cs @@ -16,12 +16,230 @@ namespace ICSSoft.DataProject private static string connString = System.Configuration.ConfigurationManager.AppSettings["ERPConnStr"]; private static string ERPDB = System.Configuration.ConfigurationManager.AppSettings["ERPDB"]; private static string Type = System.Configuration.ConfigurationManager.AppSettings["Type"]; + private static string CRNALL = System.Configuration.ConfigurationManager.AppSettings["OtherOutCRDNAME"]; + + /// + /// 生成其他出库单 + /// + /// + /// + public string CreateRd09(List Bills) + { + string msg = string.Empty; + string connS = ""; + string sql = string.Empty; + SqlConnection conn = new SqlConnection(); + DataSet ds = null; + int num = 0; + SqlCommand cmd = new SqlCommand(); + string iFatherIdTwo = ""; + + if (Bills.Count <= 0) + { + throw new Exception("传送数据为空!"); + } + List result = Bills.Select(t => t.WorkPoint).Distinct().ToList(); + foreach (string WorkPoint in result) + { + try + { + connS = string.Format(connString, WorkPoint); + conn = new System.Data.SqlClient.SqlConnection(connS); + conn.Open(); + SqlTransaction sqlTran = conn.BeginTransaction(); + cmd = new SqlCommand(); + cmd.Transaction = sqlTran; + cmd.Connection = conn; + + foreach (ICSOtherOutCreateDoc head in Bills) + { + iFatherIdTwo = ""; + if (WorkPoint != head.WorkPoint) + { + continue; + } + if (!DBHelper.IsInventoryConsolidation(cmd, head.WorkPoint)) + throw new Exception("U8正在整理现存量,请稍后再试"); + + + string[] ss = head.WorkPoint.Split('_'); + ERPDB = ss[1]; + + string[] dd = CRNALL.Split('~'); + string crdname = dd[0]; + string carname = dd[1]; + string surface = dd[2]; + + num = head.details.Count(); + string cardnewcode = DBHelper.GetCardNumber(carname, cmd); + Dictionary dic = DBHelper.GetAllCode("" + ERPDB + "", surface, "" + num + "", head.WorkPoint); + int iFatherId = Convert.ToInt32(dic["iFatherId"].ToString()); + int iChildId = Convert.ToInt32(dic["iChildId"].ToString()); + DateTime date = DateTime.Now; + string cRDcode = DBHelper.GetRDCode(crdname, cmd); + string iBaseCodeLen = DBHelper.GetAllRDCode(cardnewcode, "" + date + "", "admin", cRDcode, head.WorkPoint); + + ICSUserInfo userInfo = new ICSUserInfo(); + userInfo = DBHelper.GetPersonInfo(head.User, cmd); + //取得out库单的默认显示模版 + string DEF_ID09 = DBHelper.GetDefaultTemplate(cardnewcode, cmd); + //取得其他出库单单据 表头ID,表体DID + VouchKey key09 = new VouchKey(); + #region 其他出库单表头 + key09.ID += 1; + sql = @"INSERT INTO dbo.RdRecord09 + ( ID ,bRdFlag ,cVouchType ,cBusType ,cSource ,cWhCode ,dDate ,cCode , + cRdCode ,cDepCode ,cHandler ,bTransFlag ,cMaker ,dVeriDate ,bpufirst , + biafirst ,VT_ID ,bIsSTQc ,bFromPreYear ,bIsComplement ,iDiscountTaxType , + iBG_OverFlag ,cBG_Auditor ,cBG_AuditTime ,ControlResult ,ireturncount , + iverifystate ,iswfcontrolled ,cModifyPerson ,dnmaketime ,dnverifytime , + iPrintCount) + VALUES(@ID,0,'09','其他出库','库存',@cWhCode,CONVERT(NVARCHAR(15),GETDATE(),23),@cCode, + @cRdCode,@cDepCode,@cHandler,0,@cMaker,CONVERT(NVARCHAR(15),GETDATE(),23),0, + 0,@VT_ID,0,0,0,0, + 0,'','',-1,0, + 0,0,'',GETDATE(),GETDATE(),0) "; + + cmd.Parameters.Clear(); + cmd.Parameters.Add(new SqlParameter("@ID", iFatherId)); + cmd.Parameters.Add(new SqlParameter("@cWhCode", head.WHCode)); + cmd.Parameters.Add(new SqlParameter("@cCode", iBaseCodeLen)); + cmd.Parameters.Add(new SqlParameter("@cRdCode", cRDcode)); + cmd.Parameters.Add(new SqlParameter("@cDepCode", head.DepCode)); + cmd.Parameters.Add(new SqlParameter("@cHandler", userInfo.UserName)); + cmd.Parameters.Add(new SqlParameter("@cMaker", userInfo.UserName)); + cmd.Parameters.Add(new SqlParameter("@VT_ID", DEF_ID09)); + cmd.CommandText = sql; + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception) + { + log.Error("生成其他出库单失败!SQL:\r\n" + sql); + throw new Exception("程序异常,请联系开发人员!"); + } + #endregion + foreach (ICSOtherOutCreateDocs body in head.details) + { + #region 3.5.1 表体 + sql = @"INSERT INTO dbo.rdrecords09 + ( AutoID ,ID ,cInvCode ,iQuantity ,iFlag ,bLPUseFree ,iRSRowNO ,iOriTrackID ,cBatch,iNNum,cItemCode, + bCosting ,bVMIUsed ,iExpiratDateCalcu ,iordertype ,isotype ,irowno ,iposflag,cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10) + VALUES(@AutoID,@ID,@cInvCode,@iQuantity,0,0,0,0,@cBatch,@iNNum,@cItemCode, + 1,0,0,0,0,@irowno,1,@cFree1,@cFree2,@cFree3,@cFree4,@cFree5,@cFree6,@cFree7,@cFree8,@cFree9,@cFree10)"; + + cmd.Parameters.Clear(); + cmd.Parameters.Add(new SqlParameter("@AutoID", iChildId)); + cmd.Parameters.Add(new SqlParameter("@ID", iFatherId)); + cmd.Parameters.Add(new SqlParameter("@cInvCode", body.InvCode)); + cmd.Parameters.Add(new SqlParameter("@iQuantity", body.Quantity)); + cmd.Parameters.Add(new SqlParameter("@iNNum", body.Amount.ToString("0.00"))); + cmd.Parameters.Add(new SqlParameter("@irowno", body.Sequence)); + cmd.Parameters.Add(new SqlParameter("@cBatch", body.BatchCode)); + cmd.Parameters.Add(new SqlParameter("@cItemCode", body.ProjectCode)); + cmd.Parameters.Add(new SqlParameter("@cFree1", body.cFree1)); + cmd.Parameters.Add(new SqlParameter("@cFree2", body.cFree2)); + cmd.Parameters.Add(new SqlParameter("@cFree3", body.cFree3)); + cmd.Parameters.Add(new SqlParameter("@cFree4", body.cFree4)); + cmd.Parameters.Add(new SqlParameter("@cFree5", body.cFree5)); + cmd.Parameters.Add(new SqlParameter("@cFree6", body.cFree6)); + cmd.Parameters.Add(new SqlParameter("@cFree7", body.cFree7)); + cmd.Parameters.Add(new SqlParameter("@cFree8", body.cFree8)); + cmd.Parameters.Add(new SqlParameter("@cFree9", body.cFree9)); + cmd.Parameters.Add(new SqlParameter("@cFree10", body.cFree10)); + cmd.CommandText = sql; + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception) + { + log.Error("生成其他出库单表体失败!SQL:\r\n" + sql); + throw new Exception("程序异常,请联系开发人员!"); + } + #endregion + + //更新现存量 + key09.cBustypeUN = "其他出库"; + key09.cVouchTypeUN = "09"; + key09.TableName = "IA_ST_UnAccountVouch09"; + + //DBHelper.UpdateCurrentStock(cmd, body.InvCode, head.WHCode, "", -body.Quantity, key09); + //DBHelper.UpdateCurrentStockNEW(cmd, body.InvCode, head.WHCode, body.BatchCode, -body.Quantity, body.cFree1, body.cFree2, body.cFree3, body.cFree4, body.cFree5, body.cFree6, body.cFree7, body.cFree8, body.cFree9, body.cFree10, key09); + DBHelper.UpdateCurrentStockCCGC(cmd, body.InvCode, head.WHCode, body.BatchCode, -body.Quantity, -body.Amount, body.cFree1, + body.cFree2, body.cFree3, body.cFree4, body.cFree5, body.cFree6, body.cFree7, body.cFree8, body.cFree9, body.cFree10, + "", key09, "", "", "", "", 0, 0, 0, 0, 0, 0, 0, 0, iFatherId, iChildId); + + iFatherIdTwo = "'" + iFatherId + "',"; + iChildId--; + } + + #region 查询 + sql = @" + select DISTINCT a.ID as ID,a.ID as IDs,cBusCode as SourceCode , + cCode as OtherOutCode,a.cDepCode,c.cDepName,a.cWhCode,d.cWhName, + cSource as SourceType,cMaker as CreateUser,dnmaketime as CreateDateTime, + cHandler as Checker,dnverifytime as CheckDateTime + from rdrecord09 a + left join Department c on a.cDepCode=c.cDepCode + left join Warehouse d on a.cWhCode=d.cWhCode + WHERE a.ID in ({0}) + + select DISTINCT a.ID as IDs,b.AutoID as DetailID,irowno as Sequence,b.cInvCode as InvCode + ,iQuantity as Quantity,b.iDebitIDs as SourceDetailID,iNum as Amount + ,isnull(b.cItemCode,'') ProjectCode, + isnull(b.cbatch,'') cBatch, + '' version ,'' brand, + isnull(b.cFree1,'') as cFree1, + isnull(b.cFree2,'') as cFree2, + isnull(b.cFree3,'') as cFree3, + isnull(b.cFree4,'') as cFree4, + isnull(b.cFree5,'') as cFree5, + isnull(b.cFree6,'') as cFree6, + isnull(b.cFree7,'') as cFree7, + isnull(b.cFree8,'') as cFree8, + isnull(b.cFree9,'') as cFree9, + isnull(b.cFree10,'') as cFree10 + from rdrecord09 a + left join rdrecords09 b on a.ID=b.ID + left join Department c on a.cDepCode=c.cDepCode + left join Warehouse d on a.cWhCode=d.cWhCode + WHERE a.ID in ({0})"; + sql = string.Format(sql, iFatherIdTwo.TrimEnd(',')); + + if (ds != null) + ds.Merge(DBHelper.SQlReturnDataSet(sql, cmd)); + else + ds = DBHelper.SQlReturnDataSet(sql, cmd); + #endregion + } + cmd.Transaction.Commit(); + } + catch (Exception ex) + { + cmd.Transaction.Rollback(); + log.Error(ex.Message); + throw new Exception(ex.Message); + } + finally + { + if (conn.State == ConnectionState.Open) + { + conn.Close(); + } + conn.Dispose(); + } + } + msg = JSON.DataSetToJson(ds, "details", "IDs"); + return msg; + } /// /// 审核其他出库单 /// /// /// - public bool ConfirmRd09(List Bills) + public bool ConfirmRd09(List Bills) { bool ResultFlag = false; string connS = ""; diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs index c74a6c6..c48e54d 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.DataProject/PurchaseReceiveDoc.cs @@ -113,14 +113,11 @@ namespace ICSSoft.DataProject string connS = ""; string sql = ""; string iFatherIdTwo = ""; - DataSet ds = null; decimal iTaxRate = 0; DateTime time = DateTime.Now; int num = 0; VouchKey key = new VouchKey(); - //int iBaseCodeLen = Convert.ToInt32(dic["iBaseCodeLen"].ToString()); - //int cVouchCodeBase = Convert.ToInt32(dic["cVouchCodeBase"].ToString()); List datas = new List(); if (Bills.Count <= 0) { @@ -269,9 +266,9 @@ namespace ICSSoft.DataProject #region 采购入库单表头 string BusType = "";//业务类型 sql = @"select a.POID,a.cPOID,a.cVenCode,a.cDepCode,a.cexch_name,a.iTaxRate,a.cMaker, - a.nflat,a.cPersonCode,a.cptcode ,b.ID,b.cCode,a.cBusType + a.nflat,a.cPersonCode,a.cptcode,a.cBusType FROM dbo.PO_Pomain a - LEFT JOIN PU_ArrivalVouch b ON a.cPOID=b.cpocode + WHERE a.cPOID ='" + head.POCode + "'"; cmd.CommandText = sql; DataTable dtPOMain = DBHelper.SQlReturnData(sql, cmd); @@ -304,8 +301,8 @@ namespace ICSSoft.DataProject WHCode = head.WHCode; } - cSource = "采购到货单"; - cCode = dtPOMain.Rows[0]["cCode"].ToString(); + cSource = "普通采购"; + cCode = dtPOMain.Rows[0]["cPOID"].ToString(); bredvouch = 0; @@ -328,7 +325,7 @@ namespace ICSSoft.DataProject DataTable dtDisCheck1 = DBHelper.SQlReturnData(sql, cmd); if (dtDisCheck1 != null && dtDisCheck1.Rows.Count > 0) { - foreach (DataRow item in dtDisCheck1.Rows) + foreach (DataRow item in dtDisCheck1.Rows) { if (item["iLZYJ"].ToString() == "10" & (item["iLZFS"].ToString() == "0" | item["iLZFS"].ToString() == "1")) { @@ -431,11 +428,9 @@ namespace ICSSoft.DataProject sql = @"SELECT a.id,a.cInvCode,a.iUnitPrice ,a.iMoney AS 原币无税金额 ,a.ivouchrowno, a.iTax AS 原币税额 ,a.iSum AS 原币价税合计 ,a.iNatUnitPrice , a.iNatMoney AS 本币无税金额 ,a.iNatTax AS 本币税额 ,a.iNatSum AS 本币价税合计 , - a.iTaxPrice ,a.freceivedqty AS 合格品入库数量 ,a.iPerTaxRate,c.Autoid,d.cCode,d.dDate + a.iTaxPrice ,a.freceivedqty AS 合格品入库数量 ,a.iPerTaxRate FROM dbo.PO_Podetails a INNER JOIN dbo.PO_Pomain b ON a.POID=b.POID - LEFT JOIN dbo.PU_ArrivalVouchs c ON a.ID=c.iPOsID - LEFT JOIN dbo.PU_ArrivalVouch d ON c.ID=d.ID WHERE b.cPOID ='" + head.POCode + "'"; cmd.CommandText = sql; DataTable dtPODetails = DBHelper.SQlReturnData(sql, cmd); @@ -472,12 +467,7 @@ namespace ICSSoft.DataProject if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["iTaxPrice"].ToString())) iTaxPrice = decimal.Parse(dtPODetails.Rows[0]["iTaxPrice"].ToString());//原币含税单价 iTaxRate = Convert.ToDecimal(dtPODetails.Rows[0]["iPerTaxRate"]); - if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["Autoid"].ToString()))//采购退货单字体标识 - id = dtPODetails.Rows[0]["Autoid"].ToString(); - if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["cCode"].ToString()))//采购退货单号 - code = dtPODetails.Rows[0]["cCode"].ToString(); - if (!string.IsNullOrEmpty(dtPODetails.Rows[0]["dDate"].ToString()))//采购退货单日期 - dates = dtPODetails.Rows[0]["dDate"].ToString(); + sql = @"INSERT INTO dbo.rdrecords01 ( AutoID ,ID ,cInvCode ,iNum ,iQuantity ,cItemCode, diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Controllers/ValuesController.cs b/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Controllers/ValuesController.cs index 8ea8906..ae90b3d 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Controllers/ValuesController.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Controllers/ValuesController.cs @@ -6595,6 +6595,79 @@ namespace ICSSoft.WebAPI.Controllers #endregion #region 审核其他出库单(杂发) /// + /// 生成其他出库单 + /// + /// + /// + [Route("api/OtherOutDoc/Create")] + [HttpPost] + public HttpResponseMessage OtherOutDocCreate([FromBody]object JsonData) + { + log.Info("接口:api/OtherOutDoc/Create"); + log.Info("生成其他出库传入值:" + JsonData); + HttpResponseMessage result = new HttpResponseMessage(); + Result res = new Result(); + string str = string.Empty; + try + { + if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]") + { + try + { + List infos = new List(); + try + { + infos = JsonConvert.DeserializeObject>(JsonData.ToString()); + } + catch (Exception ex) + { + log.Error("转换失败:" + ex.ToString()); + res.Success = false; + res.Message = "JSON格式不正确!"; + } + OtherOutDoc action = new OtherOutDoc(); + string resultStr = action.CreateRd09(infos); + if (!string.IsNullOrWhiteSpace(resultStr)) + { + res.Success = true; + res.Message = "接口调用成功!"; + res.Data = resultStr; + } + else + { + res.Success = false; + res.Data = resultStr; + } + } + catch (Exception ex) + { + log.Error("调用后台失败:" + ex.ToString()); + res.Success = false; + res.Message = ex.Message; + } + } + else + { + res.Success = false; + res.Message = "请传入参数"; + } + str = JsonConvert.SerializeObject(res); + result.Content = new StringContent(str.ToString(), Encoding.GetEncoding("UTF-8"), "application/json"); + log.Debug("生成其他出库返回值:" + str); + return result; + } + catch (Exception ex) + { + log.Error("参数检验失败:" + ex.ToString()); + res.Success = false; + res.Message = ex.Message; + str = JsonConvert.SerializeObject(res); + result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json"); + log.Debug("生成其他出库返回值:" + str); + return result; + } + } + /// /// 审核其他出库单 /// /// diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Web.config b/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Web.config index b35beeb..5068918 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Web.config +++ b/ICSSoft.ERP.WebAPI/ICSSoft.ERP.WebAPI/Web.config @@ -39,6 +39,8 @@ + + diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSManufactureOrderPick.cs b/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSManufactureOrderPick.cs index d6c4960..e4b29ad 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSManufactureOrderPick.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSManufactureOrderPick.cs @@ -15,7 +15,7 @@ namespace ICSSoft.Entity } public class ICSManufactureOrderPicks { - public string Sequence; + public int Sequence; public string InvCode; public decimal Quantity; public decimal Amount; diff --git a/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSOtherOutDoc.cs b/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSOtherOutDoc.cs index b3ae866..27b5df0 100644 --- a/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSOtherOutDoc.cs +++ b/ICSSoft.ERP.WebAPI/ICSSoft.Entity/ICSOtherOutDoc.cs @@ -15,4 +15,38 @@ namespace ICSSoft.Entity public bool UpdateTodoQuantity { get; set; } } + + public class ICSOtherOutCreateDoc + { + public string DepCode; + public string WHCode; + public string User; + public string WorkPoint; + public bool UpdateStock; + //public string SourceCode; + public DateTime MTime; + public List details = new List(); + } + public class ICSOtherOutCreateDocs + { + public string Sequence; + public string InvCode; + public decimal Quantity; + public decimal Amount; + //public string SourceDetailID; + public string ProjectCode;//项目号 + public string Version;//版本 + public string Brand;//厂牌 + public string BatchCode;//批次号 + public string cFree1;//自由项1 + public string cFree2;//自由项2 + public string cFree3;//自由项3 + public string cFree4;//自由项4 + public string cFree5;//自由项5 + public string cFree6;//自由项6 + public string cFree7;//自由项7 + public string cFree8;//自由项8 + public string cFree9;//自由项9 + public string cFree10;//自由项10 + } }