| | |
| | | public ReturnDto<string> EditModel([FromBody] dynamic model) |
| | | { |
| | | Guid? guid = model.guid; //到货单主键 |
| | | string fngDesc = model.fngDesc; //备注 |
| | | string fngDesc = model.fngDesc; //异常描述 |
| | | string iqcRemark = model.iqcRemark; |
| | | string ckId=model.ckId; |
| | | var _outMsg = ""; |
| | | var _outSum = -1; |
| | |
| | | new("@inOrderGuid", UtilityHelper.CheckGuid(guid) ? guid: DBNull.Value), |
| | | new("@fngDesc", fngDesc), |
| | | new("@ckId", ckId), |
| | | new("@iqcRemark", iqcRemark), |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | |
| | | using Gs.Toolbox; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using Gs.Toolbox; |
| | | using Gs.Toolbox.ApiCore.Abstract.Mvc; |
| | | using Gs.Toolbox.ApiCore.Common.Mvc; |
| | | using Gs.Toolbox.ApiCore.Group; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using System.Text; |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | namespace Gs.Wom.Service; |
| | | namespace GS.QC.Service; |
| | | |
| | | [ApiGroup(ApiGroupNames.QC)] |
| | | public class MesQcExceptionalManager : IRomteService |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 审核 |
| | | /// |
| | | /// </summary> |
| | | /// <param name="mode"></param> |
| | | /// <returns></returns> |
| | |
| | | } |
| | | } |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 增加或编辑实体-仅处理明细数据的编辑操作 |
| | | /// </summary> |
| | | /// <param name="model">包含明细列表的模型</param> |
| | | /// <returns>处理结果</returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<ExpandoObject> EditModel([FromBody] dynamic model) |
| | | { |
| | | // 初始化字符串构建器处理明细数据 |
| | | Guid? guid = model.guid; //主键 |
| | | var _sb = new StringBuilder(); |
| | | var _split = "|"; // 字段分隔符 |
| | | var _lineSeparator = "~"; // 行分隔符 |
| | | |
| | | // 处理明细列表,转换为存储过程所需格式 |
| | | foreach (var m in model.list) |
| | | { |
| | | // 获取明细项主键(可为空,新增时为空) |
| | | string _guid = m.Guid?.ToString() ?? Guid.Empty.ToString(); |
| | | |
| | | |
| | | // 拼接单行明细数据:|申请数量|备注|明细GUID |
| | | var _line = m.BatchQty + _split + m.GfRkqty + _split + m.LfRkqtyz + _split + m.HandResult + _split |
| | | + m.ChooseType + _split + m.Process + _split |
| | | + (UtilityHelper.CheckGuid(_guid) ? _guid : Guid.Empty.ToString()); |
| | | |
| | | // 多条明细间添加分隔符 |
| | | if (_sb.Length > 0) |
| | | _sb.Append(_lineSeparator); |
| | | _sb.Append(_line); |
| | | } |
| | | |
| | | // 准备返回结果对象 |
| | | dynamic mObj = new ExpandoObject(); |
| | | mObj.outMsg = ""; // 操作消息 |
| | | mObj.outSum = -1; // 操作结果状态(-1表示失败) |
| | | mObj.outGuid = ""; // 可保留用于返回明细相关的GUID |
| | | mObj.outNo = ""; // 可保留用于返回明细相关的编号 |
| | | |
| | | // 调用存储过程处理明细数据 |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_Qcyc_edt]", conn)) // 建议修改存储过程名为明细专用 |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | |
| | | // 定义存储过程参数(仅保留与明细相关的参数) |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), // 输出:操作消息 |
| | | new("@outSum", SqlDbType.Int), // 输出:结果状态(>0表示成功) |
| | | new("@outGuid", SqlDbType.UniqueIdentifier),// 输出:可返回处理后的明细关联ID |
| | | new("@outNo", SqlDbType.NVarChar, 300), // 输出:可返回明细相关编号 |
| | | new("@inOrderGuid",UtilityHelper.CheckGuid(guid)? guid : DBNull.Value),//主表GUID |
| | | new("@inEdtUserGuid", _userGuid), // 输入:操作用户GUID |
| | | new("@inLineList", _sb.ToString()) // 输入:处理后的明细字符串 |
| | | }; |
| | | |
| | | // 设置输出参数方向 |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | parameters[2].Direction = ParameterDirection.Output; |
| | | parameters[3].Direction = ParameterDirection.Output; |
| | | |
| | | // 添加参数到命令对象 |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | |
| | | // 执行存储过程 |
| | | cmd.ExecuteNonQuery(); |
| | | |
| | | // 从输出参数获取结果 |
| | | mObj.outMsg = parameters[0].Value?.ToString() ?? "处理成功"; |
| | | mObj.outSum = int.TryParse(parameters[1].Value?.ToString(), out int sum) ? sum : -1; |
| | | mObj.outGuid = parameters[2].Value?.ToString() ?? ""; |
| | | mObj.outNo = parameters[3].Value?.ToString() ?? ""; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // 记录异常日志 |
| | | LogHelper.Debug(ToString(), $"处理明细时出错:{ex.Message}"); |
| | | mObj.outMsg = ex.Message; |
| | | mObj.outSum = -1; |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 根据处理结果返回对应状态 |
| | | if (mObj.outSum <= 0) |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Exception, mObj.outMsg); |
| | | |
| | | return ReturnDto<dynamic>.QuickReturn(mObj, ReturnCode.Success, mObj.outMsg); |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string? OrgId { get; set; } |
| | | |
| | | |
| | | } |
| | |
| | | string inKcfx = model.inKcfx;//库存方向 |
| | | string inSource = model.inSource; |
| | | string qtlx = model.qtlx;//后来增加的类型 |
| | | string wwgys = model.wwgys;//后来增加上的委外供应商 |
| | | var _sb = new StringBuilder(); |
| | | var _split = "|"; |
| | | foreach (var m in model.list) |
| | |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inLineList", _sb.ToString()), |
| | | new("@inSource", inSource), |
| | | new("@qtlx", qtlx) |
| | | new("@qtlx", qtlx), |
| | | new("@wwgys", wwgys), |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | namespace Gs.Warehouse.Services; |
| | | namespace Gs.Sales; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), ex.Message); |
| | | LogHelper.Debug(ToString(), ex.Message+ ",formPath:"+ formPath+ ",_userGuid:"+ _userGuid); |
| | | |
| | | } |
| | | return ReturnDto<string>.QuickReturn(strMsg, ReturnCode.Success, "读取成功!"); |
| | | } |
| | |
| | | } |
| | | setCellVal(sheet, _idx, 0, "生产车间:" + (row0["workShop"]?.ToString() ?? "")); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 0, 5)); |
| | | |
| | | setCellVal(sheet, _idx, 12, "室温:" + (row0["temperature"]?.ToString() ?? "")); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 12, 17)); |
| | | _idx++; |
| | | |
| | | // 第3行:产品信息 |
| | |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 6, 11)); |
| | | setCellVal(sheet, _idx, 6, row0["itemModel"]?.ToString() ?? ""); |
| | | |
| | | setCellVal(sheet, _idx, 12, "电压"); |
| | | setCellVal(sheet, _idx, 13, row0["voltage"]?.ToString() ?? ""); |
| | | |
| | | setCellVal(sheet, _idx, 14, "线号"); |
| | | setCellVal(sheet, _idx, 15, row0["lineNo"]?.ToString() ?? ""); |
| | | setCellVal(sheet, _idx, 12, "线号"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 15)); |
| | | setCellVal(sheet, _idx, 13, row0["lineNo"]?.ToString() ?? ""); |
| | | _idx++; |
| | | |
| | | // 第4行:商标等信息 |
| | |
| | | setCellVal(sheet, _idx, 11, row0["sampleSize3"]?.ToString() ?? ""); |
| | | _idx++; |
| | | |
| | | int num; |
| | | if(row0["SampleMethod"]?.ToString() == "匀速") |
| | | { |
| | | if (int.TryParse(row0["sampleSize1"]?.ToString(), out int size)) |
| | | { |
| | | num = size; |
| | | } |
| | | else |
| | | { |
| | | num = 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (int.TryParse(row0["sampleSize2"]?.ToString(), out int size)) |
| | | { |
| | | num = size; |
| | | } |
| | | else |
| | | { |
| | | num = 0; |
| | | } |
| | | } |
| | | if (num > 16) |
| | | num = 16; |
| | | |
| | | // 第7行:检验项目表头 |
| | | IRow headerRow = sheet.CreateRow(_idx); |
| | | headerRow.HeightInPoints = rowHeight; |
| | |
| | | } |
| | | setCellVal(sheet, _idx, 0, "项目"); |
| | | setCellVal(sheet, _idx, 1, "标准"); |
| | | setCellVal(sheet, _idx, 2, "1"); |
| | | setCellVal(sheet, _idx, 3, "2"); |
| | | // 根据需要继续添加更多列标题,这里简化为主要列 |
| | | for (int i = 4; i < 18; i++) |
| | | for (int i = 2; i < num+2; i++) |
| | | { |
| | | setCellVal(sheet, _idx, i, (i-1).ToString()); |
| | | } |
| | |
| | | setCellVal(sheet, _idx, 1, rrr["RPB004"]?.ToString() ?? ""); |
| | | |
| | | // 填充16个测试值 |
| | | for (int i = 0; i < 16; i++) |
| | | for (int i = 0; i < num; i++) |
| | | { |
| | | string colName = $"RPB{i + 5:D3}"; // RPB005, RPB006, ..., RPB020 |
| | | if (rrr.Table.Columns.Contains(colName)) |
| | |
| | | } |
| | | |
| | | // 检验判定区域(3行布局) |
| | | for (int judgeRowIndex = 0; judgeRowIndex < 3; judgeRowIndex++) |
| | | for (int judgeRowIndex = 0; judgeRowIndex < 2; judgeRowIndex++) |
| | | { |
| | | IRow judgmentRow = sheet.CreateRow(_idx); |
| | | judgmentRow.HeightInPoints = rowHeight; |
| | |
| | | { |
| | | // 第一行:检验判定 |
| | | setCellVal(sheet, _idx, 0, "检验判定"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 0, 0)); // 检验判定跨3行 |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 1, 0, 0)); // 修改为跨2行而不是3行 |
| | | setCellVal(sheet, _idx, 1, row0["CheckResult"]?.ToString() ?? ""); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 5)); // 只合并当前行 |
| | | |
| | | if (row0["CheckResult"]?.ToString() == "合格") |
| | | { |
| | | setCellVal(sheet, _idx, 1, "√ 合格 □ 不合格"); |
| | | } |
| | | else if(row0["CheckResult"]?.ToString() == "不合格") |
| | | { |
| | | setCellVal(sheet, _idx, 1, "□ 合格 √ 不合格"); |
| | | } |
| | | else |
| | | { |
| | | setCellVal(sheet, _idx, 1, "□ 合格 □ 不合格"); |
| | | } |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 1, 1, 5)); // 合格/不合格跨2行 |
| | | |
| | | setCellVal(sheet, _idx, 6, "审核"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 6, 6)); // 审核跨3行 |
| | | |
| | | if (row0["ProcessResults"]?.ToString() == "无") |
| | | { |
| | | setCellVal(sheet, _idx, 7, "√ 无 □ 返工"); |
| | | } |
| | | else if (row0["ProcessResults"]?.ToString() == "返工") |
| | | { |
| | | setCellVal(sheet, _idx, 7, "□ 无 √ 返工"); |
| | | } |
| | | else |
| | | { |
| | | setCellVal(sheet, _idx, 7, "□ 无 □ 返工"); |
| | | } |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 11)); |
| | | |
| | | setCellVal(sheet, _idx, 12, "审批"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx + 2, 12, 12)); // 审批跨3行 |
| | | |
| | | if (row0["ProcessResults"]?.ToString() == "无") |
| | | { |
| | | setCellVal(sheet, _idx, 13, "√ 无 □ 返工"); |
| | | } |
| | | else if (row0["ProcessResults"]?.ToString() == "返工") |
| | | { |
| | | setCellVal(sheet, _idx, 13, "□ 无 √ 返工"); |
| | | } |
| | | else |
| | | { |
| | | setCellVal(sheet, _idx, 13, "□ 无 □ 返工"); |
| | | } |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 17)); |
| | | setCellVal(sheet, _idx, 6, "检验签名"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 10)); // 只合并当前行 |
| | | setCellVal(sheet, _idx, 7, row0["JY_NAME"]?.ToString() ?? ""); |
| | | setCellVal(sheet, _idx, 11, "审核签名"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 12, 16)); // 只合并当前行 |
| | | setCellVal(sheet, _idx, 12, row0["CHECK_USER"]?.ToString() ?? ""); |
| | | } |
| | | else if (judgeRowIndex == 1) |
| | | { |
| | | if (row0["ProcessResults"]?.ToString() == "让步接收") |
| | | { |
| | | setCellVal(sheet, _idx, 7, "√ 让步接收 □ 特采"); |
| | | } |
| | | else if (row0["ProcessResults"]?.ToString() == "特采") |
| | | { |
| | | setCellVal(sheet, _idx, 7, "□ 让步接收 √ 特采"); |
| | | } |
| | | else |
| | | { |
| | | setCellVal(sheet, _idx, 7, "□ 让步接收 □ 特采"); |
| | | } |
| | | // 第二行:让步接收选项 |
| | | |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 11)); |
| | | |
| | | if (row0["ProcessResults"]?.ToString() == "让步接收") |
| | | { |
| | | setCellVal(sheet, _idx, 13, "√ 让步接收 □ 特采"); |
| | | } |
| | | else if (row0["ProcessResults"]?.ToString() == "特采") |
| | | { |
| | | setCellVal(sheet, _idx, 13, "□ 让步接收 √ 特采"); |
| | | } |
| | | else |
| | | { |
| | | setCellVal(sheet, _idx, 13, "□ 让步接收 □ 特采"); |
| | | } |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 17)); |
| | | } |
| | | else |
| | | { |
| | | // 签名行 |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 1, 2)); |
| | | setCellVal(sheet, _idx, 1, $"签名/日期:"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 3, 5)); |
| | | setCellVal(sheet, _idx, 3, $"{row0["JY_USER"]?.ToString() ?? ""}/{row0["JY_DATE"]?.ToString() ?? ""}"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 8)); |
| | | setCellVal(sheet, _idx, 7, $"签名/日期:"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 9, 11)); |
| | | setCellVal(sheet, _idx, 9, $"{row0["CHECK_USER"]?.ToString() ?? ""}/{row0["CHECK_DATE"]?.ToString() ?? ""}"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 13, 14)); |
| | | setCellVal(sheet, _idx, 13, $"签名/日期:"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 15, 17)); |
| | | setCellVal(sheet, _idx, 15, $"{row0["SP_USER"]?.ToString() ?? ""}/{row0["SP_DATE"]?.ToString() ?? ""}"); |
| | | setCellVal(sheet, _idx, 6, "检验日期"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 7, 10)); // 只合并当前行 |
| | | setCellVal(sheet, _idx, 7, row0["JY_DATE"]?.ToString() ?? ""); |
| | | setCellVal(sheet, _idx, 11, "审核日期"); |
| | | sheet.AddMergedRegion(new CellRangeAddress(_idx, _idx, 12, 16)); // 只合并当前行 |
| | | setCellVal(sheet, _idx, 12, row0["CHECK_DATE"]?.ToString() ?? ""); |
| | | } |
| | | _idx++; |
| | | } |
| | |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Dynamic; |
| | | using System.Text; |
| | | using Gs.Toolbox; |
| | | using Gs.Toolbox.ApiCore.Abstract.Mvc; |
| | | using Gs.Toolbox.ApiCore.Common.Mvc; |
| | | using Gs.Toolbox.ApiCore.Group; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json.Linq; |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | namespace Gs.Wom.WorkService |
| | | namespace Gs.Warehouse.Services |
| | | { |
| | | |
| | | [ApiGroup(ApiGroupNames.WOM)] |
| | |
| | | var sortName = string.IsNullOrEmpty(model.sortName) ? "a.PAGE_GROUP" : model.sortName; |
| | | var keyWhere = model.keyWhere; |
| | | string keyType = model.keyType; |
| | | string keyWord = model.keyWord; |
| | | var sbSql = new StringBuilder(); |
| | | sbSql.Append(" SELECT * FROM "); |
| | | sbSql.Append(" (SELECT N'(' +[Org].[FNumber] + N')' +[Org].[NAME] AS [FSubsidiary2] ,"); |
| | |
| | | sbSql.Append(" [f].[supp_name] AS [SuppLierId] , [g].[departmentname] AS [department2] ,"); |
| | | sbSql.Append(" ( CASE WHEN ( [a].[is_ng] = N'A' ) THEN N'正常' ELSE N'禁用' END ) AS [IsNg] "); |
| | | sbSql.Append(", [a].*,ROW_NUMBER() OVER(ORDER BY org.FNumber asc ,a.depot_code asc) AS RowIndex "); |
| | | if (string.IsNullOrEmpty(keyWord)) |
| | | { |
| | | sbSql.Append(",'' as kcQty"); |
| | | } |
| | | else |
| | | { |
| | | sbSql.Append(", isnull((select top 1 库存对比 from [dbo].[即时库存差异表] where 物料ID=" + keyWord + " and 仓库ID=[a].[depot_id]),'('+a.depot_name+')0/0') AS [kcQty] "); |
| | | } |
| | | if (string.IsNullOrEmpty(keyType)) |
| | | { |
| | | sbSql.Append(",cast(0 as bit) as chkInt"); |
| | |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | |
| | | namespace Gs.Warehouse.Services; |
| | | namespace Gs.Wom.Service; |
| | | |
| | | [ApiGroup(ApiGroupNames.PerMission)] |
| | | public class MesScrkDjManager :IRomteService |
| | |
| | | using static Gs.Toolbox.UtilityHelper; |
| | | |
| | | |
| | | namespace Gs.Warehouse.Services; |
| | | namespace Gs.Wom.Service; |
| | | |
| | | [ApiGroup(ApiGroupNames.PerMission)] |
| | | public class MesScrksqDjManager :IRomteService |