1
duhe
2024-01-08 2b340d4f5a850ce29f030aae74a186b3771428b0
1
5个文件已修改
154 ■■■■ 已修改文件
DAL/基础资料/公用基础资料/ClsUser.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsUser.cs
@@ -72,7 +72,7 @@
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("select * from Gy_Czygl where Czybm='" + MainID + "' and Czmm='" + sPsd + "' ", "Gy_Czygl");
                DS = oCn.RunProcReturn("select * from h_v_Gy_Czygl_Login where Czybm='" + MainID + "' and Czmm='" + sPsd + "' ", "Gy_Czygl");
                if (DS.Tables[0].Rows.Count == 0)
                    return null;
                else
WebAPI/Controllers/SCGL/Sc_ICMOReportBillController.cs
@@ -118,7 +118,9 @@
                {
                    ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,物料代码 HMaterCode,物料名称 HMaterName,规格型号 HMaterSpec,
                                            HUnitID, è®¡é‡å•位代码 HUnitCode, è®¡é‡å•位 HUnitName,HSourceID,生产资源代码 HSourceCode,生产资源 HSourceName,
                                            HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark,HICMOInterID,HICMOEntryID,HICMOBillNo
                                            HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark,
                                            HICMOInterID,HICMOEntryID,HICMOBillNo,HICMOInterID as HSourceInterID,HICMOEntryID as HSourceEntryID,
                                            HICMOBillNo as HSourceBillNo,3710 as HSourceBillType
                                            FROM h_v_IF_ICMOReportBillList_Edit"), "h_v_IF_ICMOReportBillList_Edit");
                    objJsonResult.code = "0";
@@ -132,7 +134,10 @@
                    //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 ";
                    string sql1 = string.Format(@"SELECT HMaterID,物料代码 HMaterCode,物料名称 HMaterName,规格型号 HMaterSpec,
                                            HUnitID, è®¡é‡å•位代码 HUnitCode, è®¡é‡å•位 HUnitName,HSourceID,生产资源代码 HSourceCode,生产资源 HSourceName,
                                            HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark,HICMOInterID,HICMOEntryID,HICMOBillNo
                                            HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注
                                            HRemark,HICMOInterID,HICMOEntryID,HICMOBillNo,
                                            HICMOInterID as HSourceInterID,HICMOEntryID as HSourceEntryID,
                                            HICMOBillNo as HSourceBillNo,3710 as HSourceBillType
                                            FROM h_v_IF_ICMOReportBillList_Edit where 1 = 1 ");
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOReportBillList_Edit");
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -160,7 +160,7 @@
                LogService.CustomWriteLog("2:", DateTime.Now.ToString("yyyy-MM-dd"));
                int TrueCount = 0, SumCount = 0;
                LogService.CustomWriteLog("list.Count:"+ list.Count, DateTime.Now.ToString("yyyy-MM-dd"));
                for (int i = 0; i < list.Count; i++)
                {
                    TrueCount = 0;
@@ -204,7 +204,7 @@
                            return objJsonResult;
                        }
                        ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain a inner join Sc_WorkBillSortBillSub b on a.HInterID = b.HInterID where HMainSourceInterID={HMainSourceInterID}" +
                        ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" +
                            $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
@@ -283,6 +283,9 @@
                        if (ds.Tables[0].Rows.Count > 1)
                        {
                            LogService.CustomWriteLog("第" + i + 1 + "行生产资源有重复,请修改", DateTime.Now.ToString("yyyy-MM-dd"));
                            LogService.CustomWriteLog($"select * from  Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" +
                              $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", DateTime.Now.ToString("yyyy-MM-dd"));
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源有重复,请修改!";
@@ -355,7 +358,7 @@
        }
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic)
        {
        {
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where å•据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
            int count = 0;
@@ -372,14 +375,14 @@
                    }
                }
            }
            if (count != 1)
            {
                //插入子表
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
                    "HMasterDate,HQty,HUseTimes)" +
                            $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
                            $" '{date}', {HQTY},{(dic["小时产能"] == "0" ? 0 : HQTY / float.Parse(dic["小时产能"].ToString()))})");
                            $" '{date}', {HQTY},{(dic["小时产能"] == "0" ? 0 : HQTY / float.Parse(dic["小时产能"].ToString()))})");
            }
            objJsonResult.code = "1";
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkBillSortBillController.cs
@@ -35,7 +35,7 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList where 1=1" + sWhere + " order by å•据号 desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList_Left where 1=1" + sWhere + " order by å•据号 desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -264,7 +264,7 @@
                    {
                        var NumData_T = NumData[i].Split('_');
                        ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList where 1=1 and hmainid=" + NumData_T[0], "h_v_JIT_Sc_WorkBillSortBillList");
                        ds = oCN.RunProcReturn("select * from h_v_JIT_Sc_WorkBillSortBillList_Left where 1=1 and hmainid=" + NumData_T[0], "h_v_JIT_Sc_WorkBillSortBillList");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -37,6 +37,78 @@
        #region å…¬ç”¨æ–¹æ³•
        #region è´¦å·ç™»å…¥
        /// <summary>
        /// è´¦å·ç™»å…¥æ—¶éªŒè¯è´¦å·ã€å¯†ç ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetUser_Json")]
        [HttpGet]
        public object GetUser_Json(string HUserNumber, string HPassWord, Int64 HStockOrgID, string HStockOrgName)
        {
            try
            {
                HPassWord = DBUtility.ClsPub.StrToPsd(HPassWord.Trim());
                ds = oCn.RunProcReturn("exec h_p_Gy_User '" + HUserNumber + "','" + HPassWord + "'," + HStockOrgID.ToString(), "h_p_Gy_User");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "输入的用户名或密码错误!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //判断用户对应组织权限,得到登入组织信息(ID、代码、名称)
                    DataSet ds2 = oWebs.get_ORGANIZATIONS_UserByOrgRelation(HUserNumber, HStockOrgName);
                    if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "判断用户对应组织权限错误!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0]["HBack"])==1)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //判断用户账号密码(WISE、CLOUD)是否正确
                    if (!oWebs.CheckUser(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["Czymc"]), ref DBUtility.ClsPub.sErrInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = DBUtility.ClsPub.sErrInfo;  //失败!
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "登录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "登录异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region èŽ·å–æœ€å¤§å•æ®ID、单据号
        /// <summary>
@@ -465,16 +537,56 @@
        /// <returns></returns>
        [Route("WEBSController/GetSupplier_Json")]
        [HttpGet]
        public object GetSupplier_Json(Int64 HSupID)
        public object GetSupplier_Json(string HBarCode, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString(), "Gy_Supplier");
                Int64 HSupID = 0;
                HSupID = DBUtility.ClsPub.isLong(HBarCode);
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HItemID=" + HSupID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Supplier");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录,请确认所扫供应商条码是否正确,且为非禁用状态!";
                    objJsonResult.Message = "没有返回任何记录,请确认所扫供应商条码是否属于该组织,且为非禁用状态!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回供应商信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// èŽ·å–ä¾›åº”å•†åˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetSupplierList_Json")]
        [HttpGet]
        public object GetSupplierList_Json(string Supplier, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Supplier with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%')", "Gy_Supplier");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何供应商记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -507,16 +619,18 @@
        /// <returns></returns>
        [Route("WEBSController/GetCustomer_Json")]
        [HttpGet]
        public object GetCustomer_Json(Int64 HCusID)
        public object GetCustomer_Json(string HBarCode, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString(), "Gy_Customer");
                Int64 HCusID = 0;
                HCusID = DBUtility.ClsPub.isLong(HBarCode);
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Customer with(nolock) where HStopflag=0 and HItemID=" + HCusID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Customer");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录,请确认所扫客户条码是否正确,且为非禁用状态!";
                    objJsonResult.Message = "没有返回任何记录,请确认所扫客户条码是否属于该组织,且为非禁用状态!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }