| | |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using Masuit.Tools; |
| | | using Masuit.Tools; |
| | | using NewPdaSqlServer.DB; |
| | | using NewPdaSqlServer.Dto.service; |
| | | using NewPdaSqlServer.entity; |
| | | using NewPdaSqlServer.entity.Base; |
| | | using NewPdaSqlServer.util; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Security.Cryptography; |
| | | using DbHelperSQL = NewPdaSqlServer.DB.DbHelperSQL; |
| | | |
| | | namespace NewPdaSqlServer.service.Warehouse; |
| | | |
| | |
| | | // 获取未完成的退料单号列表 |
| | | var parameters = new[] |
| | | { |
| | | new SugarParameter("@pi_orgId", orgId), |
| | | new SugarParameter("@type", query.Type), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | new SugarParameter("@pi_orgId", orgId), |
| | | new SugarParameter("@type", query.Type), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | }; |
| | | try |
| | | { |
| | | // 返回单号字符串列表 |
| | | var blDetails = Db.Ado.SqlQuery<string>( |
| | | "EXEC prc_pda_sctl_list @pi_orgId,@type,@inP1,@inP2,@inP3,@inP4", |
| | | parameters); |
| | | "EXEC prc_pda_sctl_list @pi_orgId,@type,@inP1,@inP2,@inP3,@inP4", parameters); |
| | | return blDetails; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | /// </summary> |
| | | /// <param name="query">仓库查询参数</param> |
| | | /// <returns>物料明细列表</returns> |
| | | public dynamic GetMesItemTblDetailByBillNo(dynamic query, |
| | | dynamic RequestInfo) |
| | | public dynamic GetMesItemTblDetailByBillNo(dynamic query, dynamic RequestInfo) |
| | | { |
| | | if (string.IsNullOrEmpty(query.billNo)) |
| | | throw new Exception("请选单据号!"); |
| | |
| | | |
| | | // 获取未完成的销售退货明细 |
| | | var parameters = new[] |
| | | { |
| | | new SugarParameter("@billNo", query.billNo), |
| | | new SugarParameter("@pi_orgId", orgId), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | }; |
| | | { |
| | | new SugarParameter("@billNo", query.billNo), |
| | | new SugarParameter("@pi_orgId",orgId), |
| | | new SugarParameter("@inP1", null), |
| | | new SugarParameter("@inP2", null), |
| | | new SugarParameter("@inP3", null), |
| | | new SugarParameter("@inP4", null) |
| | | }; |
| | | try |
| | | { |
| | | var blDetails = Db.Ado.SqlQuery<dynamic>( |
| | | "EXEC prc_pda_sctl_detailList @billNo,@pi_orgId,@inP1,@inP2,@inP3,@inP4", |
| | | parameters); |
| | | var items = blDetails.Where(x => x.DSQty > 0).ToList(); // 待扫物料 |
| | | var ysitems = blDetails.Where(x => x.SQty > 0).ToList(); // 已扫物料 |
| | | List<dynamic>? blDetails = Db.Ado.SqlQuery<dynamic>( |
| | | "EXEC prc_pda_sctl_detailList @billNo,@pi_orgId,@inP1,@inP2,@inP3,@inP4", parameters); |
| | | var items = blDetails.Where(x => x.DSQty > 0).ToList(); // 待扫物料 |
| | | var ysitems = blDetails.Where(x => x.SQty > 0).ToList(); // 已扫物料 |
| | | return new |
| | | { |
| | | items, |
| | | ysitems, |
| | | items = items, |
| | | ysitems = ysitems, |
| | | Count = items.Count + ysitems.Count |
| | | }; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="query">仓库查询参数</param> |
| | | /// <returns>处理结果</returns> |
| | | public dynamic SctlScanBarcode(WarehouseQuery query, dynamic RequestInfo) |
| | | public dynamic SctlScanBarcode(WarehouseQuery query,dynamic RequestInfo) |
| | | { |
| | | // 验证条码信息 |
| | | var barcode = Db.Queryable<MesInvItemBarcodes>() |
| | |
| | | new SqlParameter("@pi_orgId", orgId), |
| | | new SqlParameter("@PI_INP1", DBNull.Value), |
| | | new SqlParameter("@PI_INP2", DBNull.Value), |
| | | new SqlParameter("@PO_OUT_MSG", SqlDbType.NVarChar) |
| | | { Direction = ParameterDirection.Output, Size = 2000 }, |
| | | new SqlParameter("@PO_OUT_SUM", SqlDbType.Int) |
| | | { Direction = ParameterDirection.Output }, |
| | | new SqlParameter("@PO_ITEM_NO", SqlDbType.NVarChar) |
| | | { Direction = ParameterDirection.Output, Size = 100 }, |
| | | new SqlParameter("@PO_OUT_MSG", SqlDbType.NVarChar) { Direction = ParameterDirection.Output, Size = 2000 }, |
| | | new SqlParameter("@PO_OUT_SUM", SqlDbType.Int) { Direction = ParameterDirection.Output }, |
| | | new SqlParameter("@PO_ITEM_NO", SqlDbType.NVarChar) { Direction = ParameterDirection.Output, Size = 100 }, |
| | | new SqlParameter("@PO_QUANTITY", SqlDbType.Decimal) |
| | | { |
| | | Direction = ParameterDirection.Output, |
| | | Precision = 18, // 根据实际数据库精度调整 |
| | | Scale = 10 // 根据实际数据库小数位调整 |
| | | Precision = 18, // 根据实际数据库精度调整 |
| | | Scale = 10 // 根据实际数据库小数位调整 |
| | | } |
| | | }; |
| | | |
| | |
| | | cmd.ExecuteNonQuery(); |
| | | |
| | | var outMsg = parameters[7].Value?.ToString() ?? string.Empty; |
| | | var outSum = parameters[8].Value != DBNull.Value |
| | | ? Convert.ToInt32(parameters[8].Value) |
| | | : -1; |
| | | var outSum = parameters[8].Value != DBNull.Value ? Convert.ToInt32(parameters[8].Value) : -1; |
| | | var itemNo = parameters[9].Value?.ToString() ?? string.Empty; |
| | | var quantity = parameters[10].Value != DBNull.Value |
| | | ? Convert.ToDecimal(parameters[10].Value) |
| | | : 0m; |
| | | var quantity = parameters[10].Value != DBNull.Value ? Convert.ToDecimal(parameters[10].Value) : 0m; |
| | | |
| | | if (outSum == -1) throw new Exception(outMsg); |
| | | |
| | |
| | | return query; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | } |