| | |
| | | { |
| | | private JsonResult objJsonResult = new JsonResult(); |
| | | private json objjson = new json(); |
| | | public new ClsCNSRM oCn = new ClsCNSRM(); |
| | | public new ClsCN oCn = new ClsCN(); |
| | | //获取系统参数 |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | public T ScriptDeserialize<T>(string strJson) |
| | |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.RunProc("exec H_p_SRM_BarCodeBill_PrintQty '" + msg1 + "'"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | string WeiShu = ""; //尾数 |
| | | //string sKFDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | DataSet Ds; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | | { |
| | | if (ClsPub.isLong(oItemSub.HMaterID) != 0) |
| | |
| | | string WeiShu = ""; //尾数 |
| | | //string sKFDate = DateTime.Now.ToString("yyyy-MM-dd"); |
| | | DataSet Ds; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | |
| | | string sDay = ""; //日 |
| | | string WeiShu = ""; //尾数 |
| | | DataSet Ds; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | |
| | | TM = "0" + TM; |
| | | } |
| | | //TM = "B" + TM; |
| | | TM = "SRM" + "B" + TM; |
| | | TM = "SRM" + "B" + TM; |
| | | |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | |
| | | if (FCusName.Contains("添康科技")) |
| | | { |
| | | //外箱批次条码规则:SRMB+组织+料号+批次+;+数量 |
| | | TM = "SRMB" + "100" + oItemSub.HMaterNumber + oItemSub.HBatchNo + ";" + HMinQty; |
| | | } |
| | | |
| | | Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model(); |
| | | bar.HBarCode = TM; |
| | | bar.HMaterID = oItemSub.HMaterID; |
| | |
| | | bar.HSupBatchNo = oItemSub.HSupBatchNo; |
| | | bar.HSupMaterNumber = oItemSub.HSupMaterNumber; |
| | | bar.HISKFPERIOD = oItemSub.HISKFPERIOD; |
| | | bar.HMaterNumber = oItemSub.HMaterNumber; |
| | | ls2.Add(bar); |
| | | } |
| | | } |
| | |
| | | { |
| | | TM2 = "0" + TM2; |
| | | } |
| | | bar2.HMaterID = oItemSub2.HMaterID; |
| | | bar2.HBarCode = oItemSub2.HBarCode + "-" + TM2; |
| | | |
| | | if (FCusName.Contains("添康科技")) |
| | | { |
| | | //内箱批次条码规则:SRM+组织+料号+批次+;+数量 |
| | | TM2 = "SRM" + "100" + oItemSub2.HMaterNumber + oItemSub2.HBatchNo + ";" + HWXQty; |
| | | bar2.HBarCode = TM2; |
| | | } |
| | | else |
| | | { |
| | | bar2.HBarCode = oItemSub2.HBarCode + "-" + TM2; |
| | | } |
| | | |
| | | bar2.HMaterID = oItemSub2.HMaterID; |
| | | bar2.HUnitID = oItemSub2.HUnitID; |
| | | bar2.HQty = HWXQty; |
| | | bar2.HBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HBatchNo); |
| | |
| | | HBarCode = $"{oItemSub.HMaterID}"; |
| | | HBarCodeType = "品种码_外箱"; |
| | | } |
| | | |
| | | if (FCusName.Contains("添康科技")) |
| | | { |
| | | //HBarCodeType = "批次条码"; |
| | | } |
| | | |
| | | 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,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD " + |
| | |
| | | HBarCode = $"{oItemSub.HMaterID}"; |
| | | HBarCodeType = "品种码"; |
| | | } |
| | | |
| | | if (FCusName.Contains("添康科技")) |
| | | { |
| | | //HBarCodeType = "批次条码"; |
| | | } |
| | | |
| | | 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 ,HSupBatchNo,HSupMaterNumber,HProduceDate,HExpiryDate,HISKFPERIOD" + |
| | |
| | | string sPeriod = ""; //月 |
| | | string sDay = ""; //日 |
| | | DataSet Ds; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls) |
| | |
| | | { |
| | | string VsWhere = ""; |
| | | string PcWhere = ""; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | string sql = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=''" + HSupNo.Trim() + "'') " + sqlWhere; |
| | | |
| | |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败"; |
| | | objjson.Message = "无相关条码信息!"; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | |
| | | string sDay = ""; //日 |
| | | string WeiShu = ""; //尾数 |
| | | DataSet Ds; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.BeginTran(); |
| | | Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | |
| | | + "','" + HBatchNo + "','" + SubModel.Count + "','" + count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" |
| | | + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; |
| | | LogService.Write("生成外箱条码: " + sql); |
| | | oCn.RunProc(sql); |
| | | oCn.RunProc("exec setLSH '" + DateTime.Today + "'"); |
| | | count++; |
| | |
| | | + "','" + HBatchNo + "','" + SubModel.Count + "','" + _count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" |
| | | + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; |
| | | LogService.Write("生成内箱条码: "+ sql); |
| | | oCn.RunProc(sql); |
| | | _count++; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | LogService.Write("生成条码发生错误: " + e); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "" + e.Message + DBUtility.ClsPub.sExeReturnInfo; |
| | |
| | | oCN.RunProc($"update Cg_POOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | //反写打印数量到委外订单 |
| | | if (dr["HBarCodeType"].ToString() == "箱号内条码" && dr["HSourceBillType"].ToString() == "1601") |
| | | oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | //反写打印数量到送货单 (不需要反写 送货单直接是关联查询取的数量 没有在源单上做保存) |
| | | if (dr["HSourceBillType"].ToString() == "1103") |
| | | oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + dr["HItemID"] + ") "); |
| | | //oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | if (FCusName.Contains("添康科技")) |
| | | { |
| | | _HBarCodeType = "箱号内条码"; |
| | | if (dr["HSourceBillType"].ToString() == "1103" && dr["HBarCodeType"].ToString() == _HBarCodeType) |
| | | oCN.RunProc($"update Cg_POInStockBillSub set HRelationBarCodeQty -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | } |
| | | else |
| | | { |
| | | //反写打印数量到送货单 (不需要反写 送货单直接是关联查询取的数量 没有在源单上做保存) |
| | | if (dr["HSourceBillType"].ToString() == "1103") |
| | | oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + dr["HItemID"] + ") "); |
| | | //oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | } |
| | | } |
| | | } |
| | | oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + HInterID + ") "); |