| | |
| | | using System.Text; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Data; |
| | | |
| | | namespace PadApplication.Services; |
| | | |
| | |
| | | /// </summary> |
| | | public class MesCutterLedgerManager : Repository<MesCutterLedger> |
| | | { |
| | | private readonly MesQaItemsDetect02Manager |
| | | mesQaItemsDetect02Manager = new(); |
| | | //private readonly MesQaItemsDetect02Manager |
| | | //mesQaItemsDetect02Manager = new(); |
| | | |
| | | /// <summary> |
| | | /// 刀具查询(支持编号或名称模糊查询) |
| | |
| | | total = total |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上下刀操作(上刀type=0,下刀type=1) |
| | | /// 仅负责参数转发,所有数据写入由存储过程完成。 |
| | | /// </summary> |
| | | /// <param name="machineNo">机台编号</param> |
| | | /// <param name="toolNo">刀具编号</param> |
| | | /// <param name="type">操作类型(上刀、下刀)</param> |
| | | /// <param name="useLimit">使用上限</param> |
| | | /// <returns>存储过程执行结果</returns> |
| | | public object SubmitToolAction(string workOrderNo, string machineNo, string toolNo, string type, int? useLimit) |
| | | { |
| | | var parameters = new[] |
| | | { |
| | | new SugarParameter("V_WORK_ORDER_NO", workOrderNo), |
| | | new SugarParameter("V_MACHINE_NO", machineNo), |
| | | new SugarParameter("V_TOOL_NO", toolNo), |
| | | new SugarParameter("V_TYPE", type), |
| | | new SugarParameter("V_USE_LIMIT", useLimit ?? (object)DBNull.Value), |
| | | new SugarParameter("PO_OUTMSG", null) { Direction = ParameterDirection.Output, DbType = System.Data.DbType.String, Size = 200 }, |
| | | new SugarParameter("PO_OUTSUM", null) { Direction = ParameterDirection.Output, DbType = System.Data.DbType.Int32 } |
| | | }; |
| | | try |
| | | { |
| | | Db.Ado.UseStoredProcedure().SqlQuery<object>( |
| | | "PROC_TOOL_ACTION", parameters); |
| | | var outMsg = parameters[5].Value?.ToString(); |
| | | var outSum = parameters[6].Value; |
| | | return new { outMsg, outSum }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | } |