| | |
| | | { |
| | | if (string.IsNullOrEmpty(query.billNo)) throw new Exception("申请单号为空"); |
| | | |
| | | var mesInvItemOuts = base.GetSingle(it => it.BillNo == query.billNo); |
| | | if (mesInvItemOuts == null) throw new Exception("采购退货申请单不存在"); |
| | | var mesInvItemOuts = base.GetSingle(it => it.BillNo == query.billNo && it.Status == true); |
| | | if (mesInvItemOuts == null) throw new Exception("采购退货申请单不存在或未审核"); |
| | | |
| | | var sql = string.Format(@"SELECT c.item_no ItemNo,c.item_name ItemName,c.item_model ItemModel,A.SQ_NUM FQty,A.YS_NUM SQty,A.SQ_NUM - A.YS_NUM DSQty, |
| | | dbo.F_QX_GETRECODEPOTSE(A.ITEM_ID,'','','') as RecoKw |
| | |
| | | WHERE B.BILL_NO = '{0}'", query.billNo); |
| | | |
| | | var womdabs = Db.Ado.SqlQuery<ItemDetailModel>(sql); |
| | | |
| | | if(womdabs.Count < 1) |
| | | { |
| | | throw new Exception("该采购退货申请单明细不存在"); |
| | | } |
| | | |
| | | |
| | | var DS_list = womdabs.Where(s => s.DSQty > 0).ToList(); |
| | |
| | | daa001 = query.daa001, |
| | | barcodeNum = barcodeNum, |
| | | splitNum = splitNum, |
| | | barcode = query.barcode |
| | | barcode = query.barcode, |
| | | result = result.ToString() |
| | | }; |
| | | |
| | | return dto; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public ProductionPickDto ScanCodeCF(WarehouseQuery query) |
| | | { |
| | | if (query.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空"); |
| | | if (query.daa001.IsNullOrEmpty()) throw new Exception("领料单号不允许为空"); |
| | | if (query.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空"); |
| | | |
| | | if (query.Num is null or 0) throw new Exception("条码拆分数不允许为空或者为0"); |
| | | |
| | | var _strMsg = ""; |
| | | var _intSum = ""; |
| | | var _cfBar = "";//拆分后条码 |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_pda_CGTH_CF]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 2000), |
| | | new("@outSum", SqlDbType.NVarChar, 300), |
| | | new("@outCfBar", SqlDbType.NVarChar, 300), |
| | | new("@c_User", query.userName), |
| | | new("@p_biLL_no", query.daa001), |
| | | new("@p_item_barcode", query.barcode), |
| | | new("@num", query.Num) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | parameters[2].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | _strMsg = parameters[0].Value.ToString(); |
| | | _intSum = parameters[1].Value.ToString(); |
| | | _cfBar = parameters[2].Value.ToString(); |
| | | |
| | | |
| | | var result = Convert.ToInt32(_intSum); |
| | | if (result <= 0) throw new Exception(_strMsg); |
| | | |
| | | var dto = new ProductionPickDto |
| | | { |
| | | daa001 = query.daa001, |
| | | barcode = query.barcode,//原条码 |
| | | cfBarcode = _cfBar//拆分后条码 |
| | | }; |
| | | |
| | | return dto; |