| | |
| | | using System; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.IO; |
| | |
| | | |
| | | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | ds1 = oCn.RunProcReturn($"exec h_p_POOrderBill_Excel {ds.Tables[0].Rows[i]["HQty"].ToString()},'{ds.Tables[0].Rows[i]["MaterialNum"].ToString()}'", "POOrderBill_Excel"); |
| | | ds1 = oCn.RunProcReturn($"exec h_p_POOrderBill_Excel {ds.Tables[0].Rows[i]["HQty"].ToString()},'{ds.Tables[0].Rows[i]["MaterialNum"].ToString()}','1'", "POOrderBill_Excel"); |
| | | |
| | | if (i == 0) |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | |
| | | file.SaveAs(ExcelPath); |
| | | |
| | | NpoiHelper np = new NpoiHelper(); |
| | | DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "2"); |
| | | DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0"); |
| | | |
| | | //删除文件 |
| | | File.Delete(ExcelPath); |
| | |
| | | { |
| | | for (int j = 0; j < tb2.Columns.Count; j++) |
| | | { |
| | | if (tb2.Rows[i][j].ToString() == "") |
| | | if (tb2.Rows[i][j].ToString() == ""&& tb2.Columns[i].ToString()!= "包装标识") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | ds = oCn.RunProcReturn("select * from h_v_POOrderBill_Excel " + |
| | | $"where 采购组织='{dt.Rows[i]["组织"].ToString()}' and 供应商='{dt.Rows[i]["供应商"].ToString()}' " + |
| | | $"and 包装标识='{dt.Rows[i]["包装标识"].ToString()}'" + |
| | | $"and 物料编码='{dt.Rows[i]["物料编码"].ToString()}' and 关闭状态='未关闭' and 审核状态='已审核' ", "h_v_POOrderBill_Excel"); |
| | | $"and 物料编码='{dt.Rows[i]["物料编码"].ToString()}' and 关闭状态='未关闭' ", "h_v_POOrderBill_Excel"); |
| | | if (ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | double NumCount = 0;//总数量 |
| | | foreach (DataRow item in ds.Tables[0].Rows) |
| | | { |
| | | NumCount += double.Parse(item["剩余收料数量"].ToString()); |
| | | NumCount += double.Parse(item["未关联数量"].ToString()); |
| | | } |
| | | |
| | | if (NumCount < double.Parse(dt.Rows[i]["数量"].ToString())) |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"第{(i + 1)}行,匹配不到物料信息!"; |
| | | objJsonResult.Message = $"第{(i + 1)}行,匹配不到数据信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |