Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | public Int64 HDeptID;// int --é¨é¨ (Gy_Employee) |
| | | public string HExplanation;// varchar(200) --ÕªÒª |
| | | public string HInnerBillNo;// varchar(50) --å
é¨åæ®å· |
| | | |
| | | public long HAPPORGID { get; set; } |
| | | public long HPURCHASEORGIDD { get; set; } |
| | | public long HREQUIREORGID { get; set; } |
| | | public long HSETTLEORGID { get; set; } |
| | | public long HOWNERTYPEID { get; set; } |
| | | public long HOWNERID { get; set; } |
| | | public long HERPInterID { get; set; } |
| | | public long HStatus { get; set; } |
| | | public string HERPBillType { get; set; } |
| | | public string HConfirmMan { get; set; } |
| | | public string HConfirmDate { get; set; } |
| | | } |
| | | } |
| | |
| | | public Int64 HPOOrderInterID;// |
| | | public Int64 HPOOrderEntryID;// |
| | | public string HPOOrderBillNo;// |
| | | |
| | | public object HSPID { get; set; } |
| | | public object HConfirmMan { get; set; } |
| | | public object HConfirmDate { get; set; } |
| | | public object HStatus { get; set; } |
| | | public object HBacker { get; set; } |
| | | public object HBackDate { get; set; } |
| | | public object HBackRemark { get; set; } |
| | | public object HWWOrderInterID { get; set; } |
| | | public object HWWOrderEntryID { get; set; } |
| | | public object HWWOrderDetaiLID { get; set; } |
| | | public object HWWOrderBillNo { get; set; } |
| | | public object HPropertyID { get; set; } |
| | | public object HSecUnitID { get; set; } |
| | | public object HSecUnitRate { get; set; } |
| | | public object HTaxRate { get; set; } |
| | | public object HBatChNo { get; set; } |
| | | public object HAuxPropID { get; set; } |
| | | public object HERPInterID { get; set; } |
| | | public object HERPEntryID { get; set; } |
| | | public object HERPDetailID { get; set; } |
| | | public object HMTONo { get; set; } |
| | | public object HPlanMode { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | public string HAddress;// varchar(200) --交货å°ç¹ |
| | | public Int64 HSupID;// int --ä¾åºå ï¼Gy_Supplierï¼ |
| | | public Int64 HSupDealerID;// int --ç»éå |
| | | public Int64 HCurID;// int --å¸å« (Gy_Currency) |
| | | public Int64 HWHID;// int --ä»åº |
| | | public Single HExRate;// money --æ±ç (éæ©å®å¸å«å¸¦åº) |
| | |
| | | public Int64 HSSID;// int //ç»ç®æ¹å¼ (Gy_SettleStyle) |
| | | public Int64 HPSStyleID;// int //éè´æ¹å¼ (Gy_PoStockStyle) new |
| | | public Int64 HSupID;// int //ä¾åºå ï¼Gy_Supplierï¼ |
| | | public Int64 HSupDealerID;// int //ç»éå |
| | | public Int64 HCurID;// int //å¸å« (Gy_Currency) |
| | | public Single HExRate;// money //æ±ç (éæ©å®å¸å«å¸¦åº) |
| | | public Int64 HEmpID;// int //ä¸å¡å (Gy_Employee) |
| | |
| | | public Int64 HSourceEntryID = 0; |
| | | public string HSourceBillNo = ""; |
| | | public string HSourceBillType = ""; |
| | | public Int64 ProcessExchangeInterID = 0; |
| | | public Int64 HProcessExchangeInterID = 0; |
| | | public Int64 HSupID = 0; |
| | | public double HSourceQty = 0; |
| | | public double HMaterWeight = 0; //ç©æå
é |
| | |
| | | { |
| | | if (MessageBox.Show("ç©æç»´æ¤å
é为ï¼"+HMaterWeight.ToString()+ "ï¼å®é
å
é为ï¼" + sQty.ToString() + "ï¼æè¾å
¥å®é
å
éè¶
åºç©æç»´æ¤å
éçç¾åä¹äºåæä¸è¶³ç©æç»´æ¤å
éçç¾åä¹å
«åï¼è¯·æ£æ¥è¾å
¥çæ°æ®æ¯å¦æ£ç¡®ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | //return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //æ¡ç çæåæ§å¶å¤æ |
| | | double HNowQty = 0; //ç±³æ° |
| | | double HWeightQyt = 0; //éé |
| | | double HKDQty = 0; //æ£ç¹æ° |
| | | HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text); |
| | | HWeightQyt = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text); |
| | | HKDQty = DBUtility.ClsPub.isDoule(txtHKDQty.Text); |
| | | |
| | | DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Kf_WeighToBarCode_AddBarCodeCheck " + HInterID.ToString() + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + "," + HProcessExchangeInterID.ToString() + "," + HSourceQty.ToString() + "," + HNowQty.ToString() + "," + HWeightQyt.ToString() + "," + HKDQty.ToString(), "h_p_Kf_WeighToBarCode_AddBarCodeCheck"); |
| | | // |
| | | if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("æ¡ç çæå夿é误ï¼"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "2") |
| | | { |
| | | if (MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | else |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //çææ¡ç |
| | |
| | | string HRemark = ""; |
| | | string HMaterName = ""; |
| | | string HMaterModel = ""; |
| | | string ProcessExchangeBillNo = ""; |
| | | string HProcessExchangeBillNo = ""; |
| | | Int64 HBarcodeNo = 0; //å
æ° |
| | | Int64 HBadReasonID = 0; //ä¸è¯åå ID |
| | | string HCusMaterName = ""; //客æ·ç©æåç§° |
| | |
| | | HRemark = DBUtility.ClsPub.isStrNull(txtHRemark.Text); |
| | | HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text); |
| | | HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text); |
| | | ProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text); |
| | | HProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text); |
| | | HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text); |
| | | HBadReasonID = DBUtility.ClsPub.isLong(txtHRemark.Tag); |
| | | HCusMaterName = DBUtility.ClsPub.isStrNull(txtHCusMaterName.Text); |
| | |
| | | + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + "," + HMaterialMQty.ToString() + "," + HNowQty.ToString() |
| | | + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0" |
| | | + ", " + ProcessExchangeInterID.ToString() + ",0,'" + ProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'" |
| | | + ", " + HProcessExchangeInterID.ToString() + ",0,'" + HProcessExchangeBillNo + "'," + HBadReasonID.ToString() + ",'" + HCusMaterName + "','" + HCusModel + "'" |
| | | + ",'" + HMaterName + "','" + HMaterModel + "',''," + HAuxPropID.ToString() + ",'','','1')"); |
| | | |
| | | //åå¡«æå¤§æµæ°´å· |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "',1 "); |
| | | |
| | | //åå¡«æºå临æ¶è¡¨HInterID |
| | | oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + ProcessExchangeBillNo + "'"); |
| | | oCn.RunProc("update a set a.HInterID=" + HInterID.ToString() + ",a.HBillNo='" + HBillNo +"',a.HRelationInterID= 0 from KF_WeighSource_Temp a where a.HInterID<>" + HInterID.ToString() + " and a.HMaker='" + HMaker + "' and a.HSourceBillNo='" + HProcessExchangeBillNo + "'"); |
| | | |
| | | //åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | | oCn.RunProc("Insert into KF_PonderationBillMain_Temp " + |
| | |
| | | HSourceBillNo = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ç产订å")].Value); |
| | | HSourceBillType = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSourceBillType")].Value); |
| | | HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("æ°é")].Value); |
| | | ProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value); |
| | | HProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("ProcessExchangeInterID")].Value); |
| | | HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value); |
| | | HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value); |
| | | } |
| | |
| | | { |
| | | if (MessageBox.Show("ç©æç»´æ¤å
é为ï¼" + HMaterWeight.ToString() + "ï¼å®é
å
é为ï¼" + sQty.ToString() + "ï¼æè¾å
¥å®é
å
éè¶
åºç©æç»´æ¤å
éçç¾åä¹äºåæä¸è¶³ç©æç»´æ¤å
éçç¾åä¹å
«åï¼è¯·æ£æ¥è¾å
¥çæ°æ®æ¯å¦æ£ç¡®ï¼", "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | //return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //æ¡ç çæåæ§å¶å¤æ |
| | | double HNowQty = 0; //ç±³æ° |
| | | double HWeightQyt = 0; //éé |
| | | HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text); |
| | | HWeightQyt = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text); |
| | | |
| | | DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck " + HInterID.ToString() + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + "," + HProcessExchangeInterID.ToString() + "," + HProcessExchangeEntryID.ToString() + "," + HSourceQty.ToString() + "," + HNowQty.ToString() + "," + HWeightQyt.ToString(), "h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck"); |
| | | // |
| | | if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("æ¡ç çæå夿é误ï¼"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1") |
| | | { |
| | | MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "æç¤º"); |
| | | return false; |
| | | } |
| | | else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "2") |
| | | { |
| | | if (MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "æç¤º", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) |
| | | { |
| | | return true; |
| | | } |
| | | else |
| | |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | else |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | //çææ¡ç |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #region é¨é¨ æ å½¢å¾ |
| | | public class TreeModel |
| | | { |
| | | public string id { get; set; } |
| | | public string title { get; set; } |
| | | public List<TreeModel> children = new List<TreeModel>(); |
| | | } |
| | | [Route("Gy_Department/Gy_DepartmentTreeList")] |
| | | [HttpGet] |
| | | public object Gy_DepartmentTreeList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Department where 1=1 " + sWhere + " order by hnumber"); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "Gy_Department"); |
| | | |
| | | List<TreeModel> treeModels = new List<TreeModel>(); |
| | | TreeModel first = new TreeModel(); |
| | | first.id = "0"; |
| | | first.title = "é¨é¨è®¾ç½®"; |
| | | treeModels.Add(first); |
| | | |
| | | foreach (DataRow row in ds.Tables[0].Rows) |
| | | { |
| | | var strLen = row["hitemid"].ToString().Split('.'); |
| | | if (strLen.Length == 1) |
| | | { |
| | | TreeModel tree = new TreeModel(); |
| | | tree.id = row["hitemid"].ToString(); |
| | | tree.title = row["hname"].ToString(); |
| | | treeModels[0].children.Add(tree); |
| | | } |
| | | } |
| | | digui(ds.Tables[0], treeModels[0].children, 2); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels); |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éå½å½æ° |
| | | /// </summary> |
| | | public void digui(DataTable dt, List<TreeModel> tree, int num) |
| | | { |
| | | for (int m = 0; m < tree.Count; m++) |
| | | { |
| | | tree[m].children = new List<TreeModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++)//ç¬¬ä¸æ¬¡å¾ªç¯ï¼å¾å°æææ ¹èç¹çåé |
| | | { |
| | | var strLen = dt.Rows[i]["hnumber"].ToString().Split('.'); |
| | | if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + ".")) |
| | | { |
| | | TreeModel tbjson = new TreeModel(); |
| | | tbjson.id = dt.Rows[i]["hitemid"].ToString(); |
| | | tbjson.title = dt.Rows[i]["hname"].ToString(); |
| | | tree[m].children.Add(tbjson); |
| | | } |
| | | } |
| | | var strLens = tree[m].id.Split('.'); |
| | | for (int i = 0; i < tree[m].children.Count; i++) |
| | | { |
| | | digui(dt, tree[m].children, strLens.Length + 2);//忬¡ç¨åéå»å¾ªç¯ï¼æ¿åºåéçåé |
| | | } |
| | | } |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 设å¤åå¸ çäº§èµæºå¯¹åºç订å |
| | | |
| | | [Route("Sc_OrderStateDistribution/Sc_OrderStateDistribution_Souce")] |
| | | [HttpGet] |
| | | public object Sc_OrderStateDistribution_Souce(string sWhere,string user,int OrganizationID) |
| | | { |
| | | try |
| | | { |
| | | string sql1 = string.Format("exec h_p_sc_HDeptSouceMOList {0},{1}", sWhere, OrganizationID); |
| | | |
| | | ds = oCN.RunProcReturn(sql1, "h_p_sc_HDeptSouceMOList"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Model; |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Pub_Class; |
| | | using System; |
| | |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¿åéæéç¥åå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Cg_POInStockBackBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere,string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBackBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥è¯¢æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList order by hmainid desc", "h_v_IF_POInStockBackBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_IF_POInStockBackBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere+ " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_POInStockBackBillList"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region éæéç¥å ä¿å/ç¼è¾åè½ |
| | | [Route("Cg_POInStockBackBill/POInStockBackBillEdit")] |
| | | [HttpPost] |
| | | public object POInStockBackBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsCg_POInStockBackBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBackBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç产ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HEmpID = mainList[0].HEmpID;//ä¸å¡å |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HSupID = mainList[0].HSupID;//ä¾åºå |
| | | long HWHID = mainList[0].HWHID;//ä»åº |
| | | long HCurID = mainList[0].HCurID;//å¸å« |
| | | Single HExRate = mainList[0].HExRate;//æ±ç |
| | | long HManagerID = mainList[0].HManagerID;//主管 |
| | | long HAPPORGID = mainList[0].HAPPORGID;//ç³è¯·ç»ç» |
| | | long HPURCHASEORGID = mainList[0].HPURCHASEORGIDD;//éè´ç»ç» |
| | | long HREQUIREORGID = mainList[0].HREQUIREORGID;//éæ±ç»ç» |
| | | long HSETTLEORGID = mainList[0].HSETTLEORGID;//ç»ç®ç»ç» |
| | | long HOWNERTYPEID = mainList[0].HOWNERTYPEID;//货主类å |
| | | long HOWNERID = mainList[0].HOWNERID;//货主 |
| | | long HERPInterID = mainList[0].HERPInterID;//ERP忮䏻å
ç |
| | | long HStatus = mainList[0].HStatus;//ç¶æ |
| | | |
| | | |
| | | string HMaker = user;//å¶å人 |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HInnerBillNo = mainList[0].HInnerBillNo;//å
é¨åæ®å· |
| | | |
| | | string HAddress = mainList[0].HAddress;//å°å |
| | | string HBillType = mainList[0].HBillType; |
| | | string HBillSubType = mainList[0].HBillSubType; |
| | | long HBillStatus = mainList[0].HBillStatus; |
| | | string HERPBillType = mainList[0].HERPBillType; |
| | | string HConfirmMan = mainList[0].HConfirmMan; |
| | | string HConfirmDate = mainList[0].HConfirmDate; |
| | | string HMakeDate = mainList[0].HMakeDate; |
| | | string HChecker = mainList[0].HChecker; |
| | | string HCheckDate = mainList[0].HCheckDate; |
| | | string HUpDater = mainList[0].HUpDater; |
| | | string HUpDateDate = mainList[0].HUpDateDate; |
| | | string HDeleteMan = mainList[0].HDeleteMan; |
| | | string HDeleteDate = mainList[0].HDeleteDate; |
| | | string HCloseMan = mainList[0].HCloseMan; |
| | | string HCloseDate = mainList[0].HCloseDate; |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_IF_POInStockBackBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | String sql = $@"Insert Into Cg_POInStockBackBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSupID,HCurID,HWHID,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HRemark |
| | | ,HInnerBillNo,HAPPORGID,HPURCHASEORGID,HREQUIREORGID,HSETTLEORGID,HOWNERTYPEID |
| | | ,HOWNERID,HERPInterID,HERPBillType,HConfirmMan,HConfirmDate,HStatus |
| | | ,HChecker,HCheckDate,HMaker,HMakeDate) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1105 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + |
| | | "'," + HSupID + "," + HCurID + "," + HWHID + "," + HExRate + "," + HEmpID + "," + HManagerID + "," + HDeptID + ",'" + HExplanation + "','" + HRemark |
| | | + "','" + HInnerBillNo + "'," + HAPPORGID + "," + HPURCHASEORGID + "," + HREQUIREORGID + "," |
| | | + HSETTLEORGID + "," + HOWNERTYPEID + "," + HOWNERID + "," + HERPInterID + ",'" + HERPBillType + "','" + HConfirmMan |
| | | + "','" + HConfirmDate + "'," + HStatus + ",'" + HChecker + "',getdate()" + ",'" + HMaker + "',getdate()" + ")"; |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | String sql=$@"update Cg_POInStockBackBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ",HSupID=" + HSupID + ",HCurID=" + HCurID+", HWHID = " + HWHID |
| | | + ",HExRate=" + HExRate + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID+ ",HOWNERID=" + HOWNERID |
| | | + ",HAddress='" + HAddress + "'where HInterID=" + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Cg_POInStockBackBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType) |
| | | { |
| | | List<ClsCg_POInStockBackBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsCg_POInStockBackBillSub>>(msg3); |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | IList list = DetailColl; |
| | | for (int i1 = 0; i1 < list.Count; i1++) |
| | | { |
| | | ClsCg_POInStockBackBillSub oSub = (ClsCg_POInStockBackBillSub)list[i1]; |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Cg_POInStockBackBillSub", "Cg_POInStockBackBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | string sql = $@"Insert into Cg_POInStockBackBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQty,HPrice |
| | | ,HMoney,HWHID,HSPID,HConfirmMan,HConfirmDate,HRelationQty |
| | | ,HStatus,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HPOOrderInterID,HPOOrderEntryID ,HPOOrderBillNo,HWWOrderInterID |
| | | ,HWWOrderEntryID,HWWOrderDetaiLID,HWWOrderBillNo |
| | | ,HPropertyID,HSecUnitID,HSecUnitRate,HTaxRate |
| | | ,HTaxMoney,HBatChNo,HAuxPropID,HERPInterID,HERPEntryID |
| | | ,HMTONo,HPlanMode,HRemark) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HPrice} |
| | | ,{oSub.HMoney},{oSub.HWHID},{oSub.HSPID},'{(oSub.HConfirmMan==null ? 0 : oSub.HConfirmMan)}','{oSub.HConfirmDate}',{oSub.HRelationQty} |
| | | ,{(oSub.HStatus == null ? 0 : oSub.HStatus)},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}' |
| | | ,{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}','{(oSub.HWWOrderInterID == null ? 0 : oSub.HWWOrderInterID)}' |
| | | ,{(oSub.HWWOrderEntryID==null ?0:oSub.HWWOrderEntryID)},{(oSub.HWWOrderDetaiLID == null ? 0 : oSub.HWWOrderDetaiLID)},'{(oSub.HWWOrderBillNo == null ? 0 : oSub.HWWOrderBillNo)}' |
| | | ,{(oSub.HPropertyID == null ? 0 : oSub.HPropertyID)},{(oSub.HSecUnitID == null ? 0 : oSub.HSecUnitID)},{(oSub.HSecUnitRate == null ? 0 : oSub.HSecUnitRate)},{(oSub.HTaxRate==null?0:oSub.HTaxRate)} |
| | | ,{oSub.HTaxMoney},'{oSub.HBatChNo}',{(oSub.HAuxPropID==null?0:oSub.HAuxPropID)},{(oSub.HERPInterID==null ? 0 :oSub.HERPInterID)},{(oSub.HERPEntryID == null ? 0 : oSub.HERPEntryID)} |
| | | ,'{(oSub.HMTONo==null?0:oSub.HMTONo)}',{(oSub.HPlanMode==null?0:oSub.HPlanMode)},'{oSub.HRemark}')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Cg_POInStockBackBill/DeltetCg_POInStockBackBill")] |
| | | [HttpGet] |
| | | public object DeltetCg_POInStockBackBill(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Cg_POInStockBackBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Cg_POInStockBackBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where HitemID=" + HInterID, "h_v_IF_POInStockBackBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList where hmainid =" + HInterID, "h_v_IF_POInStockBackBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è¿åéæéç¥åå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Cg_POInStockBackBill/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere,string user) |
| | | |
| | | private json DeleteKingDee(string hInterID) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦ææ¥è¯¢æé |
| | | if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBackBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥è¯¢æé!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_POInStockBackBillList order by hmainid desc", "h_v_IF_POInStockBackBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_IF_POInStockBackBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere+ " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_POInStockBackBillList"); |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | Qty = ClsPub.isDoule(Cs.Tables[0].Rows[i]["HQty"].ToString()); |
| | | Money = ClsPub.isDoule(Cs.Tables[0].Rows[i]["HMoney"].ToString()); |
| | | WHID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HWHID"].ToString()); |
| | | SPID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HSPID"].ToString()); |
| | | SourceBillType = ClsPub.isLong(Cs.Tables[0].Rows[i]["HSourceBillType"].ToString()); |
| | | POOrderInterID = ClsPub.isLong(Cs.Tables[0].Rows[i]["HPOOrderInterID"].ToString()); |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®ç©æå
ç è·åç©æä¿¡æ¯ |
| | | [Route("Cg_POInStockBackBill/getMaterialByMaterID")] |
| | | [HttpGet] |
| | | public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" + |
| | | " from Gy_Material AS a " + |
| | | " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + |
| | | " where a.HItemID =" + HMaterID; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; |
| | | |
| | | return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | } |
| | | |
| | | #region æ ¹æ®ç©æå
ç è·åç©æä¿¡æ¯ |
| | | [Route("Cg_POInStockBill/getMaterialByMaterID")] |
| | | [HttpGet] |
| | | public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" + |
| | | " from Gy_Material AS a " + |
| | | " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + |
| | | " where a.HItemID =" + HMaterID; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; |
| | | |
| | | return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// åå®¡æ ¸ |
| | | /// </summary> |
| | |
| | | sql = @" |
| | | Insert Into Cg_POInStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate |
| | | ,HBillNo,HBillStatus,HSupID,HManagerID,HEmpID,HDeptID,HRemark |
| | | ,HBillNo,HBillStatus,HSupID,HSupDealerID,HManagerID,HEmpID,HDeptID,HRemark |
| | | ,HMaker,HMakeDate,HChecker,HCheckDate,HOWNERTYPEID,HOWNERID |
| | | ,HERPInterID,HERPBillType,HPURCHASEORGID,HSTOCKORGID,HREQUIREORGID |
| | | ,HSTOCKGROUPID,HSENDBILLNO,HLADBILLNO,HPURDEPTID,HPURGROUPID,HSUPPLYID |
| | | ,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HSUPPLYADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID,HCurID,HExRate,HAddress,HWHID,HInnerBillNo) |
| | | values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1103 + "','" + |
| | | mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "'," + mainList[0].HBillStatus + "," + mainList[0].HSupID + |
| | | mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "'," + mainList[0].HBillStatus + "," + mainList[0].HSupDealerID + "," + mainList[0].HSupID + |
| | | "," + mainList[0].HManagerID + "," + mainList[0].HEmpID + "," + mainList[0].HDeptID + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + |
| | | "','" + mainList[0].HMakeDate + "','" + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HOWNERTYPEID + "'," + mainList[0].HOWNERID + "," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "'," + mainList[0].HPURCHASEORGID + "," + mainList[0].HSTOCKORGID + "," + mainList[0].HREQUIREORGID + "," + |
| | | mainList[0].HSTOCKGROUPID + ",'" + mainList[0].HSENDBILLNO + "','" + mainList[0].HLADBILLNO + "'," + mainList[0].HPURDEPTID + "," + mainList[0].HPURGROUPID + "," + mainList[0].HSUPPLYID + "," + |
| | |
| | | //主表 |
| | | oCN.RunProc(@"Insert Into Cg_POOrderBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSSID,HSSDate,HPSStyleID,HSupID,HCurID |
| | | ,HAddress,HSSID,HSSDate,HPSStyleID,HSupID,HSupDealerID,HCurID |
| | | ,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HRemark,HInnerBillNo |
| | | ,HChecker,HCheckDate,HMaker,HMakeDate |
| | | ,HERPInterID,HERPBillType,HPURCHASEORGID |
| | | ,HPURCHASERGROUPID,HPROVIDERID,HSETTLEID,HCHARGEID,HBUSINESSTYPE,HPROVIDERADDRESS,HCORRESPONDORGID,HPROVIDERCONTACTID) |
| | | values(" + mainList[0].HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1102 + "','" + |
| | | mainList[0].HBillSubType + "','" + mainList[0].HDate + "','" + mainList[0].HBillNo + "','" + mainList[0].HBillStatus + "','" + mainList[0].HAddress + |
| | | "'," + mainList[0].HSSID + ",'" + mainList[0].HSSDate + "'," + mainList[0].HPSStyleID + "," + mainList[0].HSupID + "," + mainList[0].HCurID + |
| | | "'," + mainList[0].HSSID + ",'" + mainList[0].HSSDate + "'," + mainList[0].HPSStyleID + "," + mainList[0].HSupDealerID + "," + mainList[0].HSupID + "," + mainList[0].HCurID + |
| | | "," + mainList[0].HExRate + "," + mainList[0].HEmpID + "," + mainList[0].HManagerID + "," + mainList[0].HDeptID + ",'" + mainList[0].HExplanation + "','" + mainList[0].HRemark + "','" + mainList[0].HInnerBillNo + "','" + mainList[0].HChecker + "','" + mainList[0].HCheckDate + "','" + mainList[0].HMaker + "','" + |
| | | mainList[0].HMakeDate + "'," + mainList[0].HERPInterID + ",'" + mainList[0].HERPBillType + "'," + mainList[0].HPURCHASEORGID + "," + mainList[0].HPURCHASERGROUPID + "," |
| | | + mainList[0].HPROVIDERID + "," + mainList[0].HSETTLEID + "," + mainList[0].HCHARGEID + ",'" + mainList[0].HBUSINESSTYPE + "','" + mainList[0].HPROVIDERADDRESS + "'," |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | #region æ ¹æ®ç©æå
ç è·åç©æä¿¡æ¯ |
| | | [Route("Cg_POOrderBill/getMaterialByMaterID")] |
| | | [HttpGet] |
| | | public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" + |
| | | " from Gy_Material AS a " + |
| | | " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + |
| | | " where a.HItemID =" + HMaterID; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; |
| | | |
| | | return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; |
| | | } |
| | | #endregion |
| | | |
| | | #region éè´è®¢å å®¡æ ¸/åå®¡æ ¸ |
| | | /// <summary> |
| | | /// |
| | |
| | | public DAL.ClsCg_POInStockBill BillOld = new DAL.ClsCg_POInStockBill(); |
| | | private json objJsonResult = new json(); |
| | | public SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DataSet ds = new DataSet(); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Kf_POStockInBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | public object HRemark { get; private set; } |
| | | public object HSourceBillNo { get; private set; } |
| | | public object HSourceBillType { get; private set; } |
| | | public object HPOOrderBillNo { get; private set; } |
| | | public object HAuxPropID { get; private set; } |
| | | public object HBatchNO { get; private set; } |
| | | public object HRelationQty { get; private set; } |
| | | public object sql { get; private set; } |
| | | public object oCn { get; private set; } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where HitemID=" + HInterID, "h_v_Kf_POStockInBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// --è¿åæ¶æéç¥åå表 |
| | | /// å¤è´å
¥åºå 1201 |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region éè´å
¥åºå ä¿å/ç¼è¾åè½ |
| | | [Route("Kf_POStockInBill/POStockInBillEdit")] |
| | | [HttpPost] |
| | | public object POStockInBillEdit([FromBody] JObject sMainSub) |
| | | { |
| | | try |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | oCN.BeginTran(); |
| | | //ä¿å主表 |
| | | objJsonResult = AddBillMain(msg1); |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillMain(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ä¸»è¡¨æ°æ® |
| | | string msg3 = sArray[1].ToString(); //åè¡¨æ°æ® |
| | | int OperationType = int.Parse(sArray[2].ToString()); // æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ |
| | | string user = sArray[3].ToString(); |
| | | string msg_allVal = sArray[4].ToString(); //主表+åè¡¨æææ°æ® |
| | | |
| | | try |
| | | { |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<ClsKf_ICStockBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillMain>>(msg2); |
| | | |
| | | long HInterID = mainList[0].HInterID;//éå
¥typeå¾å°çåæ®ID |
| | | string HBillNo = mainList[0].HBillNo;//éå
¥typeå¾å°çåæ®å· |
| | | long HPRDORGID = mainList[0].HPRDORGID;//ç产ç»ç» |
| | | DateTime HDate = mainList[0].HDate;//æ¥æ |
| | | string HRemark = mainList[0].HRemark;//夿³¨ |
| | | long HEmpID = mainList[0].HEmpID;//ä¸å¡å |
| | | long HDeptID = mainList[0].HDeptID;//é¨é¨ |
| | | long HSupID = mainList[0].HSupID;//ä¾åºå |
| | | long HWHID = mainList[0].HWHID;//ä»åº |
| | | long HCurID = mainList[0].HCurID;//å¸å« |
| | | long HManagerID = mainList[0].HManagerID;//主管 |
| | | long HSTOCKORGID = mainList[0].HSTOCKORGID;//åºåç»ç» |
| | | long HOWNERID = mainList[0].HOWNERID;//货主 |
| | | long HSCWHID = mainList[0].HSCWHID;//è°åºä»åº |
| | | long HSecManagerID = mainList[0].HSecManagerID;//éªæ¶ |
| | | long HKeeperID = mainList[0].HKeeperID;//ä¿ç®¡å |
| | | |
| | | |
| | | |
| | | |
| | | string HExplanation = mainList[0].HExplanation;//æè¦ |
| | | string HInnerBillNo = mainList[0].HInnerBillNo;//å
é¨åæ®å· |
| | | |
| | | string HAddress = mainList[0].HAddress;//å°å |
| | | string HBillType = mainList[0].HBillType; |
| | | string HBillSubType = mainList[0].HBillSubType; |
| | | long HBillStatus = mainList[0].HBillStatus; |
| | | string HMaker = user;//å¶å人 |
| | | string HMakeDate = mainList[0].HMakeDate; |
| | | string HChecker = mainList[0].HChecker; |
| | | string HCheckDate = mainList[0].HCheckDate; |
| | | string HUpDater = mainList[0].HUpDater; |
| | | string HUpDateDate = mainList[0].HUpDateDate; |
| | | string HDeleteMan = mainList[0].HDeleteMan; |
| | | string HDeleteDate = mainList[0].HDeleteDate; |
| | | string HCloseMan = mainList[0].HCloseMan; |
| | | string HCloseDate = mainList[0].HCloseDate; |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and åæ®å·='" + HBillNo + "'", "h_v_Kf_POStockInBillList"); |
| | | |
| | | if ((OperationType == 1 || OperationType == 2) && ds.Tables[0].Rows.Count == 0)//æ°å¢ |
| | | { |
| | | //主表 |
| | | String sql=$@"Insert Into Kf_ICStockBillMain |
| | | (HInterID,HYear,HPeriod,HBillType,HBillSubType,HDate,HBillNo,HBillStatus |
| | | ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark |
| | | ,HInnerBillNo,HSTOCKORGID,HOWNERID ,HChecker,HCheckDate,HMaker,HMakeDate) |
| | | values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" + |
| | | HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + |
| | | "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + |
| | | HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark |
| | | + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HChecker + "',getdate()" + ",'" + HMaker + "',getdate()" +")"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0) |
| | | { //ä¿®æ¹ |
| | | String sql = $@"update Kf_ICStockBillMain set " + |
| | | "HRemark='" + HRemark + "', HChecker='" + HMaker + "', HCheckDate=getdate()" + |
| | | ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID |
| | | + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID |
| | | + ",HAddress='" + HAddress + "'where HInterID=" + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'"); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub(msg3, HInterID, OperationType); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = objJsonResult.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string msg3, long HInterID, int OperationType) |
| | | { |
| | | List<ClsKf_ICStockBillSub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillSub>>(msg3); |
| | | |
| | | List<ClsKf_ICStockBillSub> DetailColl2 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsKf_ICStockBillSub>>(msg3); |
| | | |
| | | |
| | | string HSourceBillNo = DetailColl2[0].HSourceBillNo == null ? "''" : DetailColl2[0].HSourceBillNo; |
| | | string HSourceBillType = DetailColl2[0].HSourceBillType == null ? "''" : DetailColl2[0].HSourceBillType; |
| | | double HRelationQty = DetailColl2[0].HRelationQty == null ? 0 : DetailColl2[0].HRelationQty; |
| | | long HPropertyID = DetailColl2[0].HPropertyID == null ? 0 : DetailColl2[0].HPropertyID; |
| | | long HAuxPropID = DetailColl2[0].HAuxPropID == null ? 0 : DetailColl2[0].HAuxPropID; |
| | | string HMTONo = DetailColl2[0].HMTONo == null ? "''" : DetailColl2[0].HMTONo; |
| | | |
| | | string HSeOrderBillNo = DetailColl2[0].HSeOrderBillNo == null ? "''" : DetailColl2[0].HSeOrderBillNo; |
| | | string HRemark = DetailColl2[0].HRemark == null ? "''" : DetailColl2[0].HRemark; |
| | | |
| | | |
| | | |
| | | int i = 0; |
| | | IList list = DetailColl; |
| | | for (int i1 = 0; i1 < list.Count; i1++) |
| | | { |
| | | ClsKf_ICStockBillSub oSub = (ClsKf_ICStockBillSub)list[i1]; |
| | | i++; |
| | | if (oSub.HQty <= 0 || oSub.HQty == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼æ°éä¸è½ä¸º0æè
å°äº0"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oSub.HMaterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼ç©æä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oSub.HSourceID == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "第" + i + "è¡ï¼çäº§èµæºä¸è½ä¸ºç©º"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (oSub.HUnitID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + i + "è¡ï¼è®¡éåä½ä¸è½ä¸ºç©º"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet Cs; |
| | | Int64 NewHEntryID = 1; |
| | | Cs = oCN.RunProcReturn("select MAX(HEntryID)HEntryID from Kf_ICStockBillSub", "Kf_ICStockBillSub"); |
| | | if (Cs.Tables[0].Rows.Count != 0 && ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()) != 0) |
| | | { |
| | | NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString()); |
| | | NewHEntryID += 1; |
| | | } |
| | | |
| | | string sql = $@"Insert into Kf_ICStockBillSub |
| | | (HInterID,HEntryID,HMaterID,HUnitID,HQtyMust,HQty,HPrice |
| | | ,HMoney,HOrderPrice,HWHID,HSPID,HRelationQty,HBatchNo |
| | | ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType |
| | | ,HPOOrderInterID,HPOOrderEntryID ,HPOOrderBillNo |
| | | ,HPropertyID,HSecUnitID,HSecUnitRate,HPlanMode,HRemark,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo) |
| | | values({HInterID},{NewHEntryID},{oSub.HMaterID},{oSub.HUnitID} |
| | | ,{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HPrice},{oSub.HMoney},{oSub.HOrderPrice},{oSub.HWHID},{oSub.HSPID},{oSub.HRelationQty} |
| | | ,'{oSub.HBatchNo}',{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}' |
| | | ,{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}' |
| | | ,{(oSub.HPropertyID == null ? 0 : oSub.HPropertyID)},{(oSub.HSecUnitID == null ? 0 : oSub.HSecUnitID)},{(oSub.HSecUnitRate == null ? 0 : oSub.HSecUnitRate)} |
| | | ,{(oSub.HPlanMode == null ? 0 : oSub.HPlanMode)},'{oSub.HRemark}',{oSub.HSeOrderInterID},{oSub.HSeOrderEntryID},'{oSub.HSeOrderBillNo}')"; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | ///å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Kf_POStockInBill/DeltetKf_POStockInBill")] |
| | | [HttpGet] |
| | | public object DeltetKf_POStockInBill(string HInterID) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Kf_POStockInBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid =" + HInterID, "h_v_Kf_POStockInBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #region æ ¹æ®ç©æå
ç è·åç©æä¿¡æ¯ |
| | | [Route("Kf_POStockInBill/getMaterialByMaterID")] |
| | | [HttpGet] |
| | | public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" + |
| | | " from Gy_Material AS a " + |
| | | " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + |
| | | " where a.HItemID =" + HMaterID; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; |
| | | |
| | | return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; |
| | | } |
| | | #endregion |
| | | |
| | | #region éè´å
¥åºå å®¡æ ¸/åå®¡æ ¸ |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | DataSet ds; |
| | | |
| | | #region é½å¥åæä¿¡æ¯æç»å表 |
| | |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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 é½å¥ç©æä¿¡æ¯æç»å表 |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sWhere">æ¥è¯¢æ¡ä»¶</param> |
| | | /// <param name="HMainICMOEntryID">ç产订åæç»è¡¨id</param> |
| | | /// <returns></returns> |
| | | [Route("JIT_Complete/JIT_CompleteMaterlDetailList")] |
| | | [HttpGet] |
| | | public object JIT_CompleteMaterlDetailList(string sWhere ) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_MaterDetailList " + sWhere, "h_p_JIT_MaterDetailList"); |
| | | |
| | | |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | 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 = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | |
| | | string Ret = ""; |
| | | oSystemParameter.ShowBill(ref Ret); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "å¯è´å¥ç¹") |
| | | { |
| | | ds = oCN.RunProcReturn("select top 1000 * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_STK_Inventory where 1=1 " + sWhere + "", "h_v_STK_Inventory"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | var HOrderNeedQty = list[i]["订åéæ±æ°é"].ToString(); |
| | | var HOrderCommitDate = list[i]["订å交货æ"].ToString(); |
| | | var HPlanEndDate = list[i]["计åç»ææ¥æ"].ToString(); |
| | | var HSplitQty = list[i]["æåæ°é"].ToString(); |
| | | |
| | | if (HSourceID == "" || HSourceID == "0") |
| | | { |
| | |
| | | |
| | | oCN.RunProc($"update Sc_WorkBillSortBillMain set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" + |
| | | $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}'" + |
| | | $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty}" + |
| | | $" where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["åæ®å·"].ToString()}'"); |
| | | } |
| | | |
| | |
| | | objJsonResult = AddBillSub(HInterID == 0 ? list[i]["hmainid"].ToString() : HInterID.ToString() |
| | | , HBillNo == "" ? list[i]["åæ®å·"].ToString() : HBillNo |
| | | , DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString()) |
| | | , int.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()) |
| | | , Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()),1) |
| | | , list[i]); |
| | | if (objJsonResult.count == 1) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public json AddBillSub(string HInterID, string HBillNo, DateTime date, int HQTY, Dictionary<string, string> dic) |
| | | public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic) |
| | | { |
| | | //è·åè¡¨æ ¼æ°æ® |
| | | ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBillList where åæ®å·='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList"); |
| | |
| | | #region ç产æ¥è®¡åå¹³å° æ°æ®åå¤ è®¾ç½®ä»»å¡åç¸å
³ä¿¡æ¯ |
| | | [Route("JIT_DayPlanPlatFormBill/ReadyData")] |
| | | [HttpGet] |
| | | public object ReadyData(string HICOMNum) |
| | | public object ReadyData(string SWhere) |
| | | { |
| | | try |
| | | { |
| | | var list = HICOMNum.Split(','); |
| | | var list = SWhere.Split(','); |
| | | DataTable dt = new DataTable("date"); |
| | | dt.Columns.Add("HICMOInterID", typeof(string)); |
| | | dt.Columns.Add("HICMOEntryID", typeof(string)); |
| | |
| | | { |
| | | string HICMOInterID = list[i].Split(';')[0].ToString(); |
| | | string HICMOEntryID = list[i].Split(';')[1].ToString(); |
| | | string HSourceID = list[i].Split(';')[2].ToString(); |
| | | |
| | | Thread.Sleep(100); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID, "h_p_Sc_GetInfoByICMOBillNo"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_GetInfoByICMOBillNo " + HICMOInterID+","+ HICMOEntryID+","+ HSourceID, "h_p_Sc_GetInfoByICMOBillNo"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | |
| | | } |
| | | |
| | | string sql = $@"Insert into Kf_MateOutRequestBillSub |
| | | (HInterID,HEntryID,HDate,HRemark,HMTONo,HMaterID,HUnitID,HBatchNO,HWHID,HSPID,HQtyMust,HQty,HRelationQty,HRelationMoney,HPrice,HMoney,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID,HICMOBillNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo) |
| | | values({HInterID},{NewHEntryID},getdate(),'{oSub.HRemark}','{oSub.HMTONo}',{oSub.HMaterID},{oSub.HUnitID},'{oSub.HBatchNO}',{oSub.HWHID},{oSub.HSPID},{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HRelationQty},{oSub.HRelationMoney},{oSub.HPrice},{oSub.HMoney},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HICMOInterID},{oSub.HICMOEntryID},'{oSub.HICMOBillNo}',{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}')"; |
| | | (HInterID,HEntryID,HDate,HRemark,HMTONo,HMaterID,HUnitID,HBatchNO,HWHID,HSPID,HQtyMust,HQty,HRelationQty, |
| | | HRelationMoney,HPrice,HMoney,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HICMOInterID,HICMOEntryID, |
| | | HICMOBillNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo) |
| | | values({HInterID},{NewHEntryID},getdate(),'{oSub.HRemark}','{oSub.HMTONo}',{oSub.HMaterID},{oSub.HUnitID}, |
| | | '{oSub.HBatchNO}',{oSub.HWHID},{oSub.HSPID},{oSub.HQtyMust},{(oSub.HQty == null ? 0 : oSub.HQty)},{oSub.HRelationQty},{oSub.HRelationMoney}, |
| | | {oSub.HPrice},{oSub.HMoney},{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HICMOInterID}, |
| | | {oSub.HICMOEntryID},'{oSub.HICMOBillNo}',{oSub.HPOOrderInterID},{oSub.HPOOrderEntryID},'{oSub.HPOOrderBillNo}')"; |
| | | |
| | | oCn.RunProc(sql); |
| | | } |
| | |
| | | public string HSourceBillType; |
| | | public Int64 HSourceInterID; |
| | | public Int64 HSourceEntryID; |
| | | |
| | | |
| | | public long HPSStyleID { get; internal set; } |
| | | } |
| | | } |
| | |
| | | public Single HTaxRate; // money --ç¨ç |
| | | public Int64 HSTOCKORGID; // int --åºåç»ç» |
| | | |
| | | public int HAuxPropID { get; internal set; } |
| | | public string HBatchNO { get; internal set; } |
| | | public object HContainerNum { get; internal set; } |
| | | public object HPVC { get; internal set; } |
| | | public object HViscosity { get; internal set; } |
| | | public object HImpurity { get; internal set; } |
| | | public object HIron { get; internal set; } |
| | | public object HGrossQty { get; internal set; } |
| | | public object HMembrane { get; internal set; } |
| | | public object HAluminum { get; internal set; } |
| | | public object HPackWeight { get; internal set; } |
| | | public object HPaper { get; internal set; } |
| | | public object HLoss { get; internal set; } |
| | | public object HWater { get; internal set; } |
| | | public object HPowder { get; internal set; } |
| | | public object HCap { get; internal set; } |
| | | public object HNetQty { get; internal set; } |
| | | } |
| | | } |
| | |
| | | <!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>--> |
| | | <!--<add key="FileIP" value="http://localhost:8080/" />--> |
| | | <!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/> --> |
| | | <!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/> é¢å°å¼æº--> |
| | | <add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/> <!--é¢å°å¼æº--> |
| | | <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> å¤å®--> |
| | | <!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> --> |
| | | <!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/> åæ¥ç§æ--> |
| | |
| | | <!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/> å®çæå¡å¨--> |
| | | <!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> --> <!--æµè¯æå¡å¨--> |
| | | <!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/> æ¬å°--> |
| | | <add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/><!--éé¯éæ¬å°é
ç½®--> |
| | | <!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/> éé¯éæ¬å°é
ç½®--> |
| | | <add key="webpages:Version" value="3.0.0.0" /> |
| | | <add key="webpages:Enabled" value="false" /> |
| | | <add key="ClientValidationEnabled" value="true" /> |
| | |
| | | <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected> |
| | | <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\ç½ç«åå¸\å端代ç \MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>E:\æºäºmes\mes\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> |
| | | <UseIISExpress>false</UseIISExpress> |
| | | <Use64BitIISExpress /> |