llj
3 天以前 1c90213ebd42e2d00324a71a67a60d07e4c8a7da
WebAPI/Controllers/³É±¾¹ÜÀí/CB_ItemMoneyBillController.cs
@@ -1190,8 +1190,8 @@
                }
                // 3. æ‰¹é‡æŸ¥è¯¢chengbenxiangmu信息
                string CostQuery = $"SELECT HItemID, HNumber, HName FROM Gy_ItemMoney_1 WHERE HNumber IN ({string.Join(",", CostNumbers.Select(m => $"'{m.Replace("'", "''")}'"))}) AND HName IN ({string.Join(",", CostNames.Select(m => $"'{m.Replace("'", "''")}'"))}) and HUSEORGID ={organ}";
                DataSet CostData = oCN.RunProcReturn(CostQuery, "Gy_ItemMoney_1");
                string CostQuery = $"SELECT HItemID, HNumber, HName FROM Gy_CostItem WHERE HNumber IN ({string.Join(",", CostNumbers.Select(m => $"'{m.Replace("'", "''")}'"))}) AND HName IN ({string.Join(",", CostNames.Select(m => $"'{m.Replace("'", "''")}'"))}) and HUSEORGID ={organ}";
                DataSet CostData = oCN.RunProcReturn(CostQuery, "Gy_CostItem");
                Dictionary<string, int> CostDict = new Dictionary<string, int>();
                foreach (DataRow row in CostData.Tables[0].Rows)
                {
@@ -1262,7 +1262,7 @@
                        missingMaterialMessages.Add($"第{lineNumber}行的生产订单【{ICMOcheck}】");
                    }
                    // æ£€æŸ¥é¡¹ç›®æˆæœ¬
                    if (CostDict.Count == 0)
                    if (CostDict.Count == 0|| !CostDict.ContainsKey(Costcheck))
                    {
                        missingCostMessages.Add($"第{lineNumber}行的项目成本【{Costcheck}】");
                    }
@@ -1357,12 +1357,12 @@
                    long HInterID = DBUtility.ClsPub.CreateBillID("1802", ref DBUtility.ClsPub.sExeReturnInfo);
                        // æ’入主表(每组插入一次)
                        insertSql.AppendLine($"INSERT INTO CB_ItemMoneyBillMain  ([HInterID], [HBillNo], [HDate], [HYear], [HPeriod], [HBillType], [HBillSubType], [HBillStatus], [HCheckItemNowID], [HCheckItemNextID], [HCheckFlowID], [HRemark], [HBacker], [HBackDate], [HBackRemark], [HChecker], [HCheckDate], [HMaker], [HMakeDate], [HUpDater], [HUpDateDate], [HCloseMan], [HCloseDate], [HCloseType], [HDeleteMan], [HDeleteDate], [HMainSourceBillType], [HMainSourceInterID], [HMainSourceEntryID], [HMainSourceBillNo], [HPrintQty],  [HEmpID], [HDeptID], [HICMOInterID], [HMaterID], [HICMOBillNo], [HExplanation], [HInnerBillNo], [HBeginDate], [HEndDate], [HOrgID]) VALUES (");
                        insertSql.AppendLine($"'{HInterID}', '{HBillNo}', '{DateTime.Now}', {list[0]["年份"]}, {list[0]["月份"]}, {"1802"}, '{"1802"}', '{"1"}',  '{"0"}', '{"0"}', '{"0"}', '{"excel导入"}', '{""}', '{DateTime.Now}', '{""}', '{""}', '{DateTime.Now}', '{""}', '{DateTime.Now}', '{""}', '{DateTime.Now}', '{""}', '{DateTime.Now}', '{"0"}', '{""}', '{DateTime.Now}', '{""}', '{"0"}', '{"0"}', '{""}', '{"0"}', '{EmpID}', '{HSupplierID}', '{ICMOInterID}','{0}','{ICMO}','{""}','{"0"}','{DateTime.Now}','{DateTime.Now}','{"100038"}');");
                    DateTime firstDayWithTime = new DateTime(Convert.ToInt32(list[0]["年份"]), Convert.ToInt32(list[0]["月份"]), 1);
                    // æ’入主表(每组插入一次)
                    insertSql.AppendLine($"INSERT INTO CB_ItemMoneyBillMain  ([HInterID], [HBillNo], [HDate], [HYear], [HPeriod], [HBillType], [HBillSubType], [HBillStatus], [HCheckItemNowID], [HCheckItemNextID], [HCheckFlowID], [HRemark], [HBacker], [HBackDate], [HBackRemark], [HChecker], [HCheckDate], [HMaker], [HMakeDate], [HUpDater], [HUpDateDate], [HCloseMan], [HCloseDate], [HCloseType], [HDeleteMan], [HDeleteDate], [HMainSourceBillType], [HMainSourceInterID], [HMainSourceEntryID], [HMainSourceBillNo], [HPrintQty],  [HEmpID], [HDeptID], [HICMOInterID], [HMaterID], [HICMOBillNo], [HExplanation], [HInnerBillNo], [HBeginDate], [HEndDate], [HOrgID]) VALUES (");
                        insertSql.AppendLine($"'{HInterID}', '{HBillNo}', '{firstDayWithTime}', {list[0]["年份"]}, {list[0]["月份"]}, {"1802"}, '{"1802"}', '{"1"}',  '{"0"}', '{"0"}', '{"0"}', '{"excel导入"}', '{""}', '{DateTime.Now}', '{""}', '{""}', '{DateTime.Now}', '{user}', '{DateTime.Now}', '{""}', '{DateTime.Now}', '{""}', '{DateTime.Now}', '{"0"}', '{""}', '{DateTime.Now}', '{""}', '{"0"}', '{"0"}', '{""}', '{"0"}', '{EmpID}', '{HSupplierID}', '{ICMOInterID}','{0}','{ICMO}','{""}','{"0"}','{DateTime.Now}','{DateTime.Now}','{"100038"}');");
                        // æ’入子表(组内每个物料插入一次)
                        int HEntryID = 1;