| | |
| | | #region 物料校验 |
| | | [Route("MaterialHandingController/CheckMaterial")] |
| | | [HttpGet] |
| | | public object CheckMaterial(string HMaterID, string user, int param,string OrganizationID) |
| | | public object CheckMaterial(string HMaterID, string user, int param,string OrganizationID,string SupID) |
| | | { |
| | | try |
| | | { |
| | | //ds1获取的sql后期记得改回供应商,修改人->供应商 |
| | | var ds1 = oCN.RunProcReturn("select * from h_v_Gy_UserMaterRelationEdit where 物料代码='" + HMaterID + "'" + "and 创建人='" + user + "'", "h_v_Gy_UserMaterRelationEdit"); |
| | | var ds1 = oCN.RunProcReturn("select * from h_v_Gy_UserMaterRelationEdit where 物料代码='" + HMaterID + "'" + "and 供应商代码='" + SupID + "'", "h_v_Gy_UserMaterRelationEdit"); |
| | | var ds = oCN.RunProcReturn("select * from Gy_Material where HNumber='" + HMaterID+ "'"+ " and HUSEORGID="+"'"+ OrganizationID+"'", "Gy_Material"); |
| | | if(ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | string HKFDate= ls[0].HKFDQDate==null? DateTime.Now.ToString("yyyy/MM/dd"): ls[0].HKFDQDate;//生产日期 |
| | | string HKFDate_1 = string.Join("", HKFDate.Split('/').Select(x => x.PadLeft(2, '0'))); |
| | | double HMinQty= ls[0].HMinQty;//标准包装数 |
| | | string HStatusMan = ls[0].HStatusMan;//工号 |
| | | //string HBarCodeDate = ls[0].HBarCodeDate;//工号 |
| | | string HBarCodeDate = ls[0].HBarCodeDate == null ? DateTime.Now.ToString("yyyy/MM/dd") : ls[0].HBarCodeDate;//条码日期 |
| | | string HBarCodeDate_1 = string.Join("", HBarCodeDate.Split('-').Select(x => x.PadLeft(2, '0'))); |
| | | |
| | | double HBQty= ls[0].HBQty;//最小包装数 |
| | | double HBQty = ls[0].HBQty;//最小包装数 |
| | | long HISKFPERIOD= ls[0].HISKFPERIOD;//是否启用保质期 |
| | | long HBatchManager= ls[0].HBatchManager;//是否启用批号 |
| | | |
| | |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.BeginTran(); |
| | | //Ds = oCn.RunProcReturn("exec GetLSH '" + DateTime.Today + "'", "GetLSH"); |
| | | Ds = oCn.RunProcReturn("exec GetLSH '" + HSupID+"_"+ HMaterID+"_" + DateTime.Today+ "'", "GetLSH"); |
| | | Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HSupID+"_"+ HMaterID+"_" + HBarCodeDate + "'", "GetLSH"); |
| | | LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); |
| | | #endregion |
| | | |
| | |
| | | : HMinQty; |
| | | ///供应商名称+@+物料代码+@+物料简称+@+数量+@条码数+@+日期+@+流水号 |
| | | LSH += 1; |
| | | TM = $"{oItemSub.HSupName}@{oItemSub.HMaterID}@{oItemSub.HMaterName}@{currentQty}@{HKFDate_1}@{LSH}"; |
| | | TM = $"{oItemSub.HSupName}@{oItemSub.HMaterID}@{oItemSub.HMaterName}@{currentQty}@{HBarCodeDate_1}@{LSH}"; |
| | | //TM = $"{oItemSub.HSupName}@{oItemSub.HMaterID}@{oItemSub.HMaterName}@{oItemSub.biaoqianzhangshu}@{HKFDate_1}@{LSH}"; |
| | | // 添加到生成的条码列表 |
| | | generatedBarcodes.Add(TM); |
| | |
| | | // + HKFDate + "','" + HKFDQDate + "'," + HISKFPERIOD + ")"; |
| | | sql = "INSERT INTO Gy_BarCodeBill (HInterID, HBarCode, HBarCodeType, HMaterID, HUnitID, HQty, HKFDate, HKFPeriod, HKFDQDate, " + |
| | | "HBatchNo, HBarcodeQtys, HBarcodeNo, HSupID, HGroupID, HMaker, HMakeDate, HPrintQty, HEndQty, HSupflag, " + |
| | | "HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HMTONO, HProduceDate, HExpiryDate, HISKFPERIOD) " + |
| | | "HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType, HMTONO, HProduceDate, HExpiryDate, HISKFPERIOD,HStatusMan,HBarCodeDate,HinitQty) " + |
| | | "VALUES (" + |
| | | linterid.ToString() + ", '" + TM + "', '" + HBarCodeType + "', " + HMaterID + ", " + "0" + ", " + currentQty + ", '" + HKFDate + "', " + HKFPeriod + ", '" + HKFDQDate + "', " + |
| | | "'" + HBatchNo + "', " + get_BarCodecount + ", '" + virtualCount + "', " + HSupID + ", " + "0" + ", '" + ClsPub.CurUserName + "', '" + DateTime.Today.ToString("yyyy-MM-dd") + "', " + "1" + ", " + "0" + ", 1, " + |
| | | "1, 1, '1', '" + HSourceBillType + "', '1', '" + |
| | | HKFDate + "', '" + HKFDQDate + "', " + HISKFPERIOD + ")"; |
| | | HKFDate + "', '" + HKFDQDate + "', " + HISKFPERIOD + ",'" + HStatusMan + "','" + HBarCodeDate + "','" + currentQty + "'" + ")"; |
| | | LogService.Write("生成条码: " + sql); |
| | | oCn.RunProc(sql); |
| | | oCn.RunProc("exec setLSH '" + HSupID + "_" + HMaterID + "_" + DateTime.Today + "'"); |
| | | oCn.RunProc("exec h_p_WMS_SetMaxNo '" + HSupID + "_" + HMaterID + "_" + HBarCodeDate + "'"); |
| | | virtualCount++; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | string inClause = string.Join(",", inValues); |
| | | string sql = $"SELECT * FROM h_v_Gy_UserMaterRelationPrint WHERE HBarCode IN ({inClause})"; |
| | | string sql = $"SELECT * FROM h_v_Gy_UserMaterRelationPrint WHERE HBarCode IN ({inClause})" + " order by 物料代码,cast(流水号 as int)"; |
| | | |
| | | // 直接执行SQL查询 |
| | | DataSet ds = oCn.RunProcReturn(sql, "h_v_Gy_UserMaterRelationPrint"); |
| | |
| | | public string HBarCodeType; |
| | | public long HGroupID; |
| | | public string HRemark; |
| | | public string HStatusMan; //惠康工号 |
| | | public string HBarCodeDate; //条码日期 |
| | | // public ClsGy_MaterialBarCodeBillModel(); |
| | | } |
| | | } |