| | |
| | | |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | | { |
| | | if (oBill.CheckBarCode(oItemSub.HSourceInterID, oItemSub.HSourceEntryID) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "已存在条码,不允许重复生成!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //if (oBill.CheckBarCode(oItemSub.HSourceInterID, oItemSub.HSourceEntryID) == false) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "已存在条码,不允许重复生成!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | if (msg2 != string.Empty) |
| | | { |
| | | if (oItemSub.HBQty == 0 || oItemSub.HMinQty == 0) |
| | |
| | | HSumQty = ClsPub.isDoule(oItemSub.HQty); //HWXQtyCol |
| | | for (int i = 0; i < HBQty; i++) |
| | | { |
| | | LSH = LSH + 1; |
| | | LSH2 = LSH.ToString(); |
| | | while (LSH2.Length < LSHlen) //如果流水号小于6位数前面补0 |
| | | { |
| | | LSH2 = "0" + LSH2; |
| | | } |
| | | sDate = ClsPub.GetServerDate(0); |
| | | sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2); |
| | | sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString(); |
| | | sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2); |
| | | sDay = "0" + ClsPub.isDate(sDate).Day.ToString(); |
| | | sDay = sDay.Substring(sDay.Length - 2, 2); |
| | | //================================== |
| | | TM = HNumber + sYear + sPeriod + sDay + LSH2; |
| | | while (TM.Length < SumLen) //如果条码小于12位数前面补0 |
| | | { |
| | | TM = "0" + TM; |
| | | } |
| | | //TM = "B" + TM; |
| | | TM = "SRM" + "B" + TM; |
| | | |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | | WeiShu = ""; |
| | |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | TM = $"{oItemSub.HMaterID}#{HMinQty}"; |
| | | |
| | | Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model(); |
| | | bar.HBarCode = TM; |
| | | bar.HMaterID = oItemSub.HMaterID; |
| | |
| | | TM2 = "0" + TM2; |
| | | } |
| | | bar2.HMaterID = oItemSub2.HMaterID; |
| | | bar2.HBarCode = oItemSub2.HBarCode.Split('#')[0] + "#" + HWXQty.ToString(); |
| | | bar2.HBarCode = oItemSub2.HBarCode + "-" + TM2; |
| | | bar2.HUnitID = oItemSub2.HUnitID; |
| | | bar2.HQty = HWXQty; |
| | | bar2.HBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HBatchNo); |
| | |
| | | |
| | | List<Model.ClsGy_MaterialList_WMS_Model> ls = new List<Model.ClsGy_MaterialList_WMS_Model>(); |
| | | List<Model.ClsGy_BarCodeBill_WMS_Model> ls2 = new List<Model.ClsGy_BarCodeBill_WMS_Model>(); |
| | | List<Model.ClsGy_BarCodeBill_WMS_Model> ls3 = new List<Model.ClsGy_BarCodeBill_WMS_Model>(); |
| | | ls = oListModels.getObjectByJson_MaterialList(msg3); |
| | | |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oItemSub.HBQty > oItemSub.HBQty) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "内箱包装数不能为0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | } |
| | | long linterid = Pub_Class.ClsPub.CreateBillID_SRMProd("8888", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | WeiShu = "尾数"; |
| | | HMinQty = HSumQty - (HBQty - 1) * HMinQty; |
| | | } |
| | | TM = $"{oItemSub.HMaterID}#{HMinQty}"; |
| | | //TM = $"{oItemSub.HMaterID}#{HMinQty}"; |
| | | TM = $"{oItemSub.HMaterID}"; |
| | | Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model(); |
| | | bar.HBarCode = TM; |
| | | bar.HMaterID = oItemSub.HMaterID; |
| | |
| | | { |
| | | HBarCode = oItemSub.HBarCode.ToString(); |
| | | HMTONO = ClsPub.isStrNull(oItemSub.HMTONO); |
| | | HBarCodeType = "箱号内条码"; |
| | | HBarCodeType = "品种码"; |
| | | HMaterID = ClsPub.isLong(oItemSub.HMaterID); |
| | | HUnitID = ClsPub.isLong(oItemSub.HUnitID); |
| | | HQty2 = ClsPub.isDoule(oItemSub.HQty); |
| | |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; |
| | | oCn.RunProc(sql); |
| | | sql = "exec setLSH '" + DateTime.Today + "'"; |
| | | oCn.RunProc(sql); |
| | | } |
| | | } |
| | | foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub in ls3) |
| | | { |
| | | //LogService.Write("循环第三次:" + oItemSub.HSupID); |
| | | if (ClsPub.isLong(oItemSub.HMaterID) != 0) |
| | | { |
| | | HBarCode = oItemSub.HBarCode.ToString(); |
| | | HMTONO = ClsPub.isStrNull(oItemSub.HMTONO); |
| | | HBarCodeType = "箱号内条码"; |
| | | HMaterID = ClsPub.isLong(oItemSub.HMaterID); |
| | | HUnitID = ClsPub.isLong(oItemSub.HUnitID); |
| | | HQty2 = ClsPub.isDoule(oItemSub.HQty); |
| | | HBatchNo = ClsPub.isStrNull(oItemSub.HBatchNo); |
| | | HSupID = oItemSub.HSupID; |
| | | HKFPeriod = ClsPub.isInt(oItemSub.HKFPeriod); |
| | | HKFDate = ClsPub.isStrNull(oItemSub.HKFDate); |
| | | HKFDQDate = ClsPub.isStrNull(oItemSub.HKFDQDate); |
| | | HSourceInterID = ClsPub.isLong(oItemSub.HSourceInterID); |
| | | HSourceEntryID = ClsPub.isLong(oItemSub.HSourceEntryID); |
| | | HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo); |
| | | HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType); |
| | | HWei = ClsPub.isStrNull(oItemSub.HEndQty); |
| | | string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " + |
| | | ") values (" |
| | | + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate |
| | | + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; |
| | | oCn.RunProc(sql); |
| | | } |
| | | } |
| | |
| | | return objjson; |
| | | } |
| | | DAL.ClsWeb_BarCodeBill oClsWeb_BarCodeBill = new DAL.ClsWeb_BarCodeBill(); |
| | | ds = oClsWeb_BarCodeBill.ShowBillSub6(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | ds = ShowBillSub6(DBUtility.ClsPub.isLong(sMsg), ShowItem, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objjson.code = "0"; |
| | |
| | | objjson.Message = "获取单据表体失败:" + e.Message; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | public DataSet ShowBillSub6(long lngBillKey, string sShowItem, ref string sReturn) |
| | | { |
| | | string str = ""; |
| | | try |
| | | { |
| | | string MvarItemKeySubForWeb4 = "h_v_Web_BarCodeBill_ForWeb2"; |
| | | str = string.Concat(new object[] { "Select ", sShowItem, " from ", MvarItemKeySubForWeb4, " Where HInterID=", lngBillKey.ToString(), " order by HEntryID " }); |
| | | DataSet set = oCn.RunProcReturn(string.Concat(new object[] { "Select ", sShowItem, " from ", MvarItemKeySubForWeb4, " Where HInterID=", lngBillKey.ToString(), " order by HEntryID " }), MvarItemKeySubForWeb4); |
| | | if ((set == null) || (set.Tables[0].Rows.Count == 0)) |
| | | { |
| | | sReturn = "单据体未找到!"; |
| | | return null; |
| | | } |
| | | sReturn = "显示单据体成功!"; |
| | | return set; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | sReturn = exception.Message + str; |
| | | return null; |
| | | } |
| | | } |
| | | [Route("GetHBarCodeShowBillMain")] |
| | |
| | | /// <param name="OnePage"></param> |
| | | /// <returns></returns> |
| | | [Route("GetBarCodeShowList")] |
| | | [HttpGet] |
| | | public object GetBarCodeShowList(string HSupNo, string sqlWhere) |
| | | [HttpPost] |
| | | public object GetBarCodeShowList([FromBody] JObject msg) |
| | | { |
| | | string msg = ""; |
| | | string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString(); |
| | | try |
| | | { |
| | | string VsWhere = ""; |
| | | string PcWhere = ""; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | DataSet ds; |
| | | //其他过滤 |
| | | if (msg.Trim() == "") |
| | | { |
| | | msg = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=''" + HSupNo.Trim() + "'') " + sqlWhere; |
| | | // msg = " Where hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)"; |
| | | } |
| | | else |
| | | { |
| | | msg = msg + " and hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=''" + HSupNo.Trim() + "'') " + sqlWhere; |
| | | // msg = msg + " Where hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)"; |
| | | } |
| | | //转换特殊字符 |
| | | if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false) |
| | | string sql = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=''" + HSupNo.Trim() + "'') " + sqlWhere; |
| | | |
| | | if (Common.SQLtoChange(sql, ref VsWhere, ref PcWhere) == false) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |