| | |
| | | /// </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="workOrderNo">工单号</param> |
| | | /// <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), // string 类型 |
| | | new SugarParameter("V_USE_LIMIT", useLimit ?? (object)DBNull.Value) |
| | | }; |
| | | try |
| | | { |
| | | var result = Db.Ado.SqlQuery<object>( |
| | | "EXEC PROC_TOOL_ACTION @V_WORK_ORDER_NO, @V_MACHINE_NO, @V_TOOL_NO, @V_TYPE, @V_USE_LIMIT", parameters); |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw new Exception($"{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | } |