New file |
| | |
| | | using DBUtility; |
| | | using Model; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Converters; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers.ä»å管ç.æ¡ç çæ |
| | | { |
| | | public class Gy_BarCodeBill_OutController : ApiController |
| | | { |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | #region [æ¡ç 彿¡£å表] |
| | | [Route("Gy_BarCodeBill_Out/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_BarCodeBill_OutList order by HMainID asc", "h_v_Gy_BarCodeBill_OutList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Gy_BarCodeBill_OutList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by HMainID asc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_BarCodeBill_OutList"); |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ ¹æ®IDæ¥æ¾è®°å½] |
| | | [Route("Gy_BarCodeBill_Out/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_BarCodeBill_OutList where HMainID =" + HInterID, "h_v_Gy_BarCodeBill_OutList"); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [æ¡ç 彿¡£ä¿å/ç¼è¾] |
| | | [Route("Gy_BarCodeBill_Out/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_Employee_Ctl oDept = new DAL.ClsGy_Employee_Ctl(); |
| | | DAL.ClsGy_Employee_View oDeptHlp = new DAL.ClsGy_Employee_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | //string msg3 = sArray[1].ToString(); |
| | | //string msg4 = sArray[2].ToString(); |
| | | //string msg5 = sArray[3].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<Gy_BarCodeBill_Out> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_BarCodeBill_Out>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = 1; |
| | | string HHelpCode = list[0].HHelpCode ?? ""; |
| | | bool HEndFlag = list[0].HEndFlag; |
| | | long HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HUseFlag = list[0].HUseFlag ?? ""; |
| | | |
| | | long HInterID = list[0].HInterID; //主å
ç |
| | | long HEntryID = list[0].HEntryID; //åå
ç |
| | | string HBillType = list[0].HBillType; //ç±»å |
| | | long HProcID = list[0].HProcID; //å·¥åº |
| | | string HBarCode = list[0].HBarCode;//ï¼èéç´¢å¼ï¼ //æ¡å½¢ç |
| | | string HBarCodeType = list[0].HBarCodeType; //æ¡ç ç±»åï¼ç©ææ¡ç ï¼ç®±å·æ¡ç ï¼æå·æ¡ç ï¼ |
| | | long HItemSubID = list[0].HItemSubID; //å¯¹åºæ ¸ç®é¡¹ç® |
| | | long HMaterID = list[0].HMaterID; //对åºç©æå
ç |
| | | long HUnitID = list[0].HUnitID; //计éåä½ |
| | | long HPieceQty = list[0].HPieceQty; //ä»¶æ° |
| | | decimal HQty = list[0].HQty; //æ°é |
| | | string HBatchNo = list[0].HBatchNo; //æ¹æ¬¡å· |
| | | long HSupID = list[0].HSupID; //徿¥åä½ |
| | | long HGroupID = list[0].HGroupID; //ç产çç»ï¼Gy_Groupï¼ |
| | | long HDeptID = list[0].HDeptID; //é¨é¨ |
| | | long HEmpID = list[0].HEmpID; //ä¸å¡å |
| | | string HMaker = list[0].HMaker; //å¶ä½äºº |
| | | string HMakeDate = list[0].HMakeDate; // å¶ä½æ¥æ |
| | | long HPrintQty = list[0].HPrintQty; //æå°æ¬¡æ° |
| | | long HSourceInterID = list[0].HSourceInterID; //æºåID |
| | | long HSourceEntryID = list[0].HSourceEntryID; //æºååID ï¼å¦ææDETAILID åå¡«DETAILIDï¼ |
| | | string HSourceBillNo = list[0].HSourceBillNo; //æºååå· |
| | | string HSourceBillType = list[0].HSourceBillType; //æºåç±»å |
| | | string HEndQty = list[0].HEndQty; //尾箱æ°é |
| | | string HWei = list[0].HWei; //尾箱æ è®° |
| | | string HBarCodeStatus = list[0].HBarCodeStatus; //æ¡ç ç¶æ |
| | | decimal HReadyQty = list[0].HReadyQty; // |
| | | decimal HInitQty = list[0].HInitQty; //åå§åæ°é |
| | | long HBarcodeQtys = list[0].HBarcodeQtys; //æ»ææ° |
| | | long HBarcodeNo = list[0].HBarcodeNo; //å½åæå· |
| | | long HInstructID = list[0].HBarcodeNo; // |
| | | string HInstructNo = list[0].HInstructNo; // |
| | | long HSeOrderBillID = list[0].HSeOrderBillID; //éå®è®¢åå
ç |
| | | string HSeOrderBillNo = list[0].HSeOrderBillNo; //客æ·è®¢åå· |
| | | long HWhID = list[0].HWhID; //é»è®¤ä»åº |
| | | long HSPID = list[0].HSPID; //é»è®¤ä»ä½ |
| | | long HAuxPropID = list[0].HAuxPropID; //ç©æè¾
å©å±æ§ |
| | | string HMaterName = list[0].HMaterName; //产åè§æ ¼åç§° |
| | | string HMaterModel = list[0].HMaterModel; //产åè§æ ¼åå· |
| | | string HPinfan = list[0].HPinfan; //åçª |
| | | string HMTONo = list[0].HMTONo; //MTOå· |
| | | long HSupflag = list[0].HSupflag; //ä¾åºåæ ç¾æ è®° |
| | | DateTime HBeginDate = list[0].HBeginDate; //å¼å§æ¥æ |
| | | DateTime HEndDate = list[0].HEndDate; //ç»ææ¥æ |
| | | long HExpirationDateFlag = list[0].HExpirationDateFlag; //ä¿è´¨ææ è®° |
| | | long HSourceID = list[0].HSourceID; //çäº§èµæº |
| | | string HCusType = list[0].HCusType; // |
| | | string HWorkLineName = list[0].HWorkLineName; //ç产线 |
| | | long HCusID = list[0].HCusID; //客æ·å
ç |
| | | long HSTOCKORGID = list[0].HSTOCKORGID; //åºåç»ç» |
| | | long HOWNERID = list[0].HOWNERID; //货主 |
| | | string HJiaYe = list[0].HJiaYe; //å æ¶²ä»£ç |
| | | string HPressModel = list[0].HPressModel; //åå·ï¼é©çµï¼ |
| | | string HCusModel = list[0].HCusModel; //客æ·åå· |
| | | string HMaterialModel = list[0].HMaterialModel; //产åè§æ ¼ |
| | | string HColor = list[0].HColor; //é¢è² |
| | | string HLogo = list[0].HLogo; //åç |
| | | string HPackageSize = list[0].HPackageSize; //å
è£
尺寸 |
| | | decimal HMaterialJQty = list[0].HMaterialJQty; //åé |
| | | decimal HMaterialMQty = list[0].HMaterialMQty; //æ¯é |
| | | string HCustomBatchNo = list[0].HCustomBatchNo; //å®¢æ·æ¹æ¬¡å· |
| | | DateTime HBarCodeDate = list[0].HBarCodeDate; //æ¡ç æ ç¾æ¥æ |
| | | string HGBBarCode = list[0].HGBBarCode; //彿 ç |
| | | long HOldBarCodeFlag = list[0].HOldBarCodeFlag; //æ§æ¡ç æ è®° |
| | | long HOldSourceInterID = list[0].HOldSourceInterID; //èæºåå
ç |
| | | long HOldSourceEntryID = list[0].HOldSourceEntryID; //èæºååå
ç |
| | | string HOldSourceBillNo = list[0].HOldSourceBillNo; //èæºååå· |
| | | long HOrderInterID = list[0].HOrderInterID; //订åå
ç |
| | | long HOrderEntryID = list[0].HOrderEntryID; //订ååå
ç ï¼å¦ææDETAILID åå¡«DETAILIDï¼ |
| | | string HOrderBillNo = list[0].HOrderBillNo; //订ååå· |
| | | string HOrderBillType = list[0].HOrderBillType; //订ååæ®ç±»å |
| | | string HRelationNum = list[0].HRelationNum;//对åºç¼å· |
| | | decimal HLabelQty = list[0].HLabelQty; //æå°æ ç¾æ°é |
| | | decimal HMinQty = list[0].HMinQty; //æå°å
è£
æ°é |
| | | decimal HNowQty = list[0].HNowQty; //å½åæ°é |
| | | string HStopMan = list[0].HStopMan; //ç¦ç¨äºº |
| | | string HStopManDate = list[0].HStopManDate; //ç¦ç¨æ¥æ |
| | | DateTime HInStockDate = list[0].HInStockDate; |
| | | DateTime HOutStockDate = list[0].HOutStockDate; |
| | | string HInStockDate_XF = list[0].HInStockDate_XF; |
| | | string HExpressNumber = list[0].HExpressNumber; |
| | | string POOrderBillNo = list[0].POOrderBillNo; |
| | | string HICMOReportBillNo = list[0].HICMOReportBillNo; |
| | | DateTime HICMOReportDate = list[0].HICMOReportDate; |
| | | long HInStockCounts = list[0].HInStockCounts; |
| | | long HReportCounts = list[0].HReportCounts; |
| | | long HOutStockCounts = list[0].HOutStockCounts; |
| | | string HInStockBillNo = list[0].HInStockBillNo; |
| | | string HOutStockBillNo = list[0].HOutStockBillNo; |
| | | string HSendGoodsBillNo = list[0].HSendGoodsBillNo; |
| | | string HKFDate = list[0].HKFDate; |
| | | long HKFPeriod = list[0].HKFPeriod; |
| | | string HKFDQDate = list[0].HKFDQDate; |
| | | long HServerItemID = list[0].HServerItemID; |
| | | string HBadReasonList = list[0].HBadReasonList; |
| | | string HProdLev = list[0].HProdLev; |
| | | long HSeOrderInterID = list[0].HSeOrderInterID; |
| | | long HSeOrderEntryID = list[0].HSeOrderEntryID; |
| | | string HInnerBillNo = list[0].HInnerBillNo; |
| | | string HCusBarCode = list[0].HCusBarCode; |
| | | string HStatus = list[0].HStatus; |
| | | long HInitSourceEntryID = list[0].HInitSourceEntryID; |
| | | string HOldSourceBillType = list[0].HOldSourceBillType; |
| | | decimal HMZ = list[0].HMZ; |
| | | long HGiveAwayFlag = list[0].HGiveAwayFlag; //èµ åæ è®° |
| | | long HSeOrderSEQ = list[0].HSeOrderSEQ; |
| | | long HMaterID_OLD = list[0].HMaterID_OLD; |
| | | string HDeleteMan = list[0].HDeleteMan; |
| | | DateTime HDeleteDate = list[0].HDeleteDate; |
| | | string HBarCode_Pack = list[0].HBarCode_Pack; |
| | | long HCustomQty1 = list[0].HCustomQty1; |
| | | DateTime HProduceDate = list[0].HProduceDate; //çäº§æ¥æï¼ä¿è´¨æç¨ï¼ |
| | | DateTime HExpiryDate = list[0].HExpiryDate; //ä¿è´¨æè³ï¼ä¿è´¨æç¨ï¼ |
| | | |
| | | |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log(msg5, 1, false, msg4)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | DateTime dt = DateTime.Now; |
| | | //42 |
| | | oCN.RunProc(@"Insert into Gy_BarCodeBill_Out |
| | | (HInterID, HEntryID, HBillType, HProcID, HBarCode, HBarCodeType, HItemSubID, HMaterID, HUnitID, |
| | | HPieceQty, HQty, HBatchNo, HSupID, HGroupID, HDeptID, HEmpID, HMaker, HPrintQty, HSourceInterID, HSourceEntryID, |
| | | HSourceBillNo, HSourceBillType, HRemark, HUseFlag, HEndQty, HWei, HStopflag, HBarCodeStatus, HReadyQty, HInitQty, |
| | | HWhID, HSPID, HAuxPropID, HMTONo, HSupflag, HBeginDate, HEndDate, HExpirationDateFlag, HSourceID, HCusType, |
| | | HWorkLineName, HCusID, HSTOCKORGID, HOWNERID, HJiaYe, HPressModel, HCusModel, HMaterialModel, HColor, HLogo, |
| | | HPackageSize, HMaterialJQty, HMaterialMQty, HCustomBatchNo, HBarCodeDate, HGBBarCode, HOldBarCodeFlag, HOldSourceInterID, |
| | | HOldSourceEntryID, HOldSourceBillNo, HOrderInterID, HOrderEntryID, HOrderBillNo, HOrderBillType, HRelationNum, |
| | | HLabelQty, HMinQty, HNowQty, HStopMan, HInStockDate_XF, HExpressNumber, POOrderBillNo, HICMOReportBillNo, HInStockCounts, |
| | | HReportCounts, HOutStockCounts, HInStockBillNo, HOutStockBillNo, HSendGoodsBillNo, HServerItemID, HBadReasonList, HProdLev, |
| | | HInnerBillNo, HCusBarCode, HStatus, HInitSourceEntryID, HOldSourceBillType, HMZ, HGiveAwayFlag, HSeOrderSEQ, HMaterID_OLD, |
| | | HDeleteMan, HBarCode_Pack, HCustomQty1) |
| | | Values(" + 0 + "," + 0 + "," + 3330 + "," + HProcID + ",'" + HBarCode + |
| | | "','" + HBarCodeType + "'," + 0 + "," + HMaterID + "," + HUnitID + "," + HPieceQty + |
| | | "," + HQty + ",'" + HBatchNo + "'" + "," + HSupID + "," + HGroupID + |
| | | "," + HDeptID + "," + HEmpID + ",'" + HMaker + "'," + HPrintQty + "," + 0 + |
| | | "," + 0 + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HRemark + "'" + |
| | | ",'" + HUseFlag + "','" + HEndQty + "','" + HWei + "'," + HStopflag + ",'" + HBarCodeStatus + |
| | | "'," + HReadyQty + "," + HInitQty + "," + HWhID + "," + HSPID + "," + HAuxPropID + |
| | | ",'" + HMTONo + "'," + HSupflag + ",'" + dt + "','" + dt + "'," + HExpirationDateFlag + |
| | | "," + HSourceID + ",'" + HCusType + "','" + HWorkLineName + "'," + HCusID + "," + HSTOCKORGID + |
| | | "," + HOWNERID + ",'" + HJiaYe + "','" + HPressModel + "','" + HCusModel + "','" + HMaterialModel + "','" + HColor + "','" + HLogo + "'" + |
| | | ",'" + HPackageSize + "'," + HMaterialJQty + "," + HMaterialMQty + ",'" + HCustomBatchNo + "','" + dt + "','" + HGBBarCode + "'" + |
| | | "," + HOldBarCodeFlag + "," + HOldSourceInterID + "," + HOldSourceEntryID + ",'" + HOldSourceBillNo + "'" + |
| | | "," + HOrderInterID + "," + HOrderEntryID + ",'" + HOrderBillNo + "','" + HOrderBillType + |
| | | "','" + HRelationNum + "'" + "," + HLabelQty + "," + HMinQty + "," + HNowQty + ",'" + HStopMan + "','" + dt + |
| | | "','" + HExpressNumber + "','" + POOrderBillNo + "','" + HICMOReportBillNo + "'," + HInStockCounts + "," + HReportCounts + |
| | | "," + HOutStockCounts + ",'" + HInStockBillNo + "','" + HOutStockBillNo + "','" + HSendGoodsBillNo + |
| | | "'," + HServerItemID + ",'" + HBadReasonList + "','" + HProdLev + "','" + HInnerBillNo + "','" + HCusBarCode + "','" + HStatus + "'," + HInitSourceEntryID + ",'" + HOldSourceBillType + "','" + HMZ + "'," + HGiveAwayFlag + "," + HSeOrderSEQ + |
| | | "," + HMaterID_OLD + ",'" + HDeleteMan + "','" + HBarCode_Pack + "'," + HCustomQty1 + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_BarCodeBill_Out set HStopflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Update Gy_BarCodeBill_Out set " + |
| | | " HBarCode='" + HBarCode + "'" + |
| | | ",HProcID=" + HProcID + |
| | | ",HBarCodeType='" + HBarCodeType + "'" + |
| | | ",HMaterID=" + HMaterID + |
| | | ",HUnitID=" + HUnitID + |
| | | |
| | | ",HPieceQty=" + HPieceQty + |
| | | ",HQty=" + HQty + |
| | | ",HBatchNo='" + HBatchNo + "'" + |
| | | ",HSupID=" + HSupID + |
| | | ",HGroupID=" + HGroupID + |
| | | ",HDeptID=" + HDeptID + |
| | | ",HEmpID=" + HEmpID + |
| | | ",HEndQty=" + HEndQty + |
| | | ",HWhID=" + HWhID + |
| | | ",HSPID=" + HSPID + |
| | | ",HAuxPropID=" + HAuxPropID + |
| | | ",HCusID=" + HCusID + |
| | | ",HSTOCKORGID=" + HSTOCKORGID + |
| | | //",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + |
| | | ",HRemark= '" + HRemark.ToString() + "' Where HItemID=" + HItemID); |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [å é¤] |
| | | [Route("Gy_BarCodeBill_Out/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemID, string user) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Gy_BarCodeBill_Out where HItemID = " + HItemID); |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |