ahai
2024-08-09 4cd540820590f7fe435057915dd2a7037bfd085e
Merge branch 'master' of http://121.37.232.241:10101/r/DIXWeb
7个文件已修改
294 ■■■■ 已修改文件
src/DIXPad.DAL/SQLDataProvider.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXPad.DAS/Web.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXPadWPF/App.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXPadWPF/DIXPadInspectItemPage.xaml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXPadWPF/DixPadUpLoad.xaml.cs 255 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXWeb.Business/MySQLBiz/MySQLInspectBaseBiz.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXWeb.Web/Areas/GlobalM/Views/InspectObjectType/Item.cshtml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/DIXPad.DAL/SQLDataProvider.cs
@@ -230,7 +230,8 @@
                }
                transaction = connection.BeginTransaction();
                bcp = new SqlBulkCopy(connection, SqlBulkCopyOptions.Default, transaction);
                bcp.BatchSize = 500;
                bcp.BatchSize = 10000;
                bcp.BulkCopyTimeout = 60;
                //依次使用数据库连接导入数据
                foreach (KeyValuePair<string, string> kv in sourceToDestinationFieldsMapping)
                {
src/DIXPad.DAS/Web.config
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="DIX" connectionString="data source=121.37.232.241;initial catalog=DIX;Pooling=true;Max Pool Size=100;Min Pool Size=0;integrated security=false;persist security info=True;User ID=developer;Password=p@d2010"/>
    <add name="DIXLOG" connectionString="data source=121.37.232.241;initial catalog=DIXLog;Pooling=true;Max Pool Size=100;Min Pool Size=0;integrated security=false;persist security info=True;User ID=developer;Password=p@d2010"/>
    <add name="DIX" connectionString="data source=43.98.47.159;initial catalog=DIX;Pooling=true;Max Pool Size=100;Min Pool Size=0;integrated security=false;persist security info=True;User ID=developer;Password=p@d201908"/>
    <add name="DIXLOG" connectionString="data source=43.98.47.159;initial catalog=DIXLog;Pooling=true;Max Pool Size=100;Min Pool Size=0;integrated security=false;persist security info=True;User ID=developer;Password=p@d201908"/>
  </connectionStrings>
  <appSettings>
    <add key="logfolder" value="c:\Lotlog\"/>
src/DIXPadWPF/App.config
@@ -17,7 +17,7 @@
  </appSettings>
  <connectionStrings>
    <add name="DIX" connectionString="data source=43.98.48.159;initial catalog=DIX;Pooling=true;Max Pool Size=100;Min Pool Size=0;integrated security=false;persist security info=True;User ID=developer;Password=p@d201908" providerName="System.Data.EntityClient"/>
    <add name="MySQLDIX" connectionString="Host=43.98.47.105;Port=3306;Database=DIX;Protocol=TCP;Compress=false;Pooling=true;
    <add name="MySQLDIX" connectionString="Host=43.98.47.84;Port=3306;Database=DIX;Protocol=TCP;Compress=false;Pooling=true;
                                                                         AllowLoadLocalInfile=true;ConnectionLifetime=0;UserID=root;Password=p@ssw0rd;" providerName="MySql.Data.MySqlClient"/>
  </connectionStrings>
  <entityFramework>
src/DIXPadWPF/DIXPadInspectItemPage.xaml
@@ -146,7 +146,7 @@
                                <RadioButton Grid.Column="1"  Content="{Binding NoRadioContent}" FontSize="20"  IsChecked="{Binding NoIsChecked}" Checked="NoRadioButtonChecked" Foreground="{Binding NoForeColor}"  FontWeight="Bold" HorizontalContentAlignment="Center"/>
                                <ser:NumInputButton x:Name="C2" DockPanel.Dock="Top" MinHeight="20"  Grid.Column="2" Background="{Binding txtbackcolor}" IsEnabled="{Binding IsEnabled}" 
                                         BorderBrush="Transparent" FontSize="25"
                              DecimalPlaces="3"  BorderThickness="0"  Margin="4"
                              DecimalPlaces="6"  BorderThickness="0"  Margin="4"
                                                  EnterClick="OnNumINputBtn_EnterClick"
                                                  CancelClick="OnBtnNputBtn_CancelClick"
                                                  PopupClosed="OnPopupCloseEvent"/>
src/DIXPadWPF/DixPadUpLoad.xaml.cs
@@ -99,148 +99,155 @@
        }
        private void btnUpLoad_Click(object sender, RoutedEventArgs e)
        {
            ResultMessage r = NetWorkCheck.NetWorkCheckResult();
            if (r.Count < 0)
            try
            {
                MessageBox.Show(r.Msg, "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            else
            {
                DataTable dtinfo = BBIZ.GetInspectedItems();
                if (dtinfo.Rows.Count > 0)
                ResultMessage r = NetWorkCheck.NetWorkCheckResult();
                if (r.Count < 0)
                {
                    string sn = Guid.NewGuid().ToString();
                    DIXPad.RSLC.BizServiceProxy localProxy = new DIXPad.RSLC.BizServiceProxy(_ServiceUrl);
                    DataTable table = new DataTable(Guid.NewGuid().ToString());
                    table.Columns.Add("sn", typeof(string));
                    table.Columns.Add("InspectObjectId", typeof(int));
                    table.Columns.Add("InspectItemId", typeof(int));
                    table.Columns.Add("CheckType", typeof(string));
                    table.Columns.Add("InspectLimit", typeof(double));
                    table.Columns.Add("NGReason", typeof(string));
                    table.Columns.Add("TotalJudge", typeof(bool));
                    table.Columns.Add("InspectTimes", typeof(int));
                    table.Columns.Add("CreateTime", typeof(DateTime));
                    table.Columns.Add("InspectOperator", typeof(string));
                    table.Columns.Add("IsImprovedOnSite", typeof(bool));
                    table.Columns.Add("DealDetial", typeof(string));
                    table.Columns.Add("ReInspectTimes", typeof(int));
                    table.Columns.Add("ImgString", typeof(string));
                    table.Columns.Add("IsBackup", typeof(int));
                    for (int i = 0; i < dtinfo.Rows.Count; i++)
                    MessageBox.Show(r.Msg, "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
                else
                {
                    DataTable dtinfo = BBIZ.GetInspectedItems();
                    if (dtinfo.Rows.Count > 0)
                    {
                        DataRow dr = table.NewRow();
                        dr["sn"] = sn;
                        dr["InspectObjectId"] = Convert.ToInt32(dtinfo.Rows[i]["InspectObjectId"].ToString());
                        dr["InspectItemId"] = Convert.ToInt32(dtinfo.Rows[i]["InspectItemId"].ToString());
                        dr["CheckType"] = dtinfo.Rows[i]["CheckType"].ToString();
                        dr["InspectLimit"] = double.Parse(dtinfo.Rows[i]["InspectLimit"].ToString());
                        dr["NGReason"] = dtinfo.Rows[i]["NGReason"].ToString();
                        string judge = dtinfo.Rows[i]["TotalJudge"].ToString();
                        if (judge == "True")
                        string sn = Guid.NewGuid().ToString();
                        DIXPad.RSLC.BizServiceProxy localProxy = new DIXPad.RSLC.BizServiceProxy(_ServiceUrl);
                        DataTable table = new DataTable(Guid.NewGuid().ToString());
                        table.Columns.Add("sn", typeof(string));
                        table.Columns.Add("InspectObjectId", typeof(int));
                        table.Columns.Add("InspectItemId", typeof(int));
                        table.Columns.Add("CheckType", typeof(string));
                        table.Columns.Add("InspectLimit", typeof(double));
                        table.Columns.Add("NGReason", typeof(string));
                        table.Columns.Add("TotalJudge", typeof(bool));
                        table.Columns.Add("InspectTimes", typeof(int));
                        table.Columns.Add("CreateTime", typeof(DateTime));
                        table.Columns.Add("InspectOperator", typeof(string));
                        table.Columns.Add("IsImprovedOnSite", typeof(bool));
                        table.Columns.Add("DealDetial", typeof(string));
                        table.Columns.Add("ReInspectTimes", typeof(int));
                        table.Columns.Add("ImgString", typeof(string));
                        table.Columns.Add("IsBackup", typeof(int));
                        for (int i = 0; i < dtinfo.Rows.Count; i++)
                        {
                            dr["TotalJudge"] = true;
                            DataRow dr = table.NewRow();
                            dr["sn"] = sn;
                            dr["InspectObjectId"] = Convert.ToInt32(dtinfo.Rows[i]["InspectObjectId"].ToString());
                            dr["InspectItemId"] = Convert.ToInt32(dtinfo.Rows[i]["InspectItemId"].ToString());
                            dr["CheckType"] = dtinfo.Rows[i]["CheckType"].ToString();
                            dr["InspectLimit"] = double.Parse(dtinfo.Rows[i]["InspectLimit"].ToString());
                            dr["NGReason"] = dtinfo.Rows[i]["NGReason"].ToString();
                            string judge = dtinfo.Rows[i]["TotalJudge"].ToString();
                            if (judge == "True")
                            {
                                dr["TotalJudge"] = true;
                            }
                            else
                            {
                                dr["TotalJudge"] = false;
                            }
                            dr["InspectTimes"] = Convert.ToInt32(dtinfo.Rows[i]["InspectTimes"].ToString());
                            dr["CreateTime"] = Convert.ToDateTime(dtinfo.Rows[i]["CreateTime"].ToString());
                            dr["InspectOperator"] = dtinfo.Rows[i]["InspectOperator"];
                            string improved = dtinfo.Rows[i]["IsImprovedOnSite"].ToString();
                            if (improved == "1")
                            {
                                dr["IsImprovedOnSite"] = true;
                            }
                            else
                            {
                                dr["IsImprovedOnSite"] = false;
                            }
                            dr["DealDetial"] = dtinfo.Rows[i]["DealDetial"];
                            dr["ReInspectTimes"] = Convert.ToInt32(dtinfo.Rows[i]["ReInspectTimes"]);
                            if (dtinfo.Rows[i]["ImgString"].ToString() == "")
                            {
                                dr["ImgString"] = "";
                            }
                            else
                            {
                                dr["ImgString"] = dtinfo.Rows[i]["ImgString"].ToString();
                            }
                            dr["IsBackup"] = Convert.ToInt32(dtinfo.Rows[i]["isbackup"].ToString());
                            table.Rows.Add(dr);
                        }
                        else
                        {
                            dr["TotalJudge"] = false;
                        }
                        dr["InspectTimes"] = Convert.ToInt32(dtinfo.Rows[i]["InspectTimes"].ToString());
                        dr["CreateTime"] = Convert.ToDateTime(dtinfo.Rows[i]["CreateTime"].ToString());
                        dr["InspectOperator"] = dtinfo.Rows[i]["InspectOperator"];
                        string improved = dtinfo.Rows[i]["IsImprovedOnSite"].ToString();
                        if (improved == "1")
                        {
                            dr["IsImprovedOnSite"] = true;
                        }
                        else
                        {
                            dr["IsImprovedOnSite"] = false;
                        }
                        dr["DealDetial"] = dtinfo.Rows[i]["DealDetial"];
                        dr["ReInspectTimes"] = Convert.ToInt32(dtinfo.Rows[i]["ReInspectTimes"]);
                        if (dtinfo.Rows[i]["ImgString"].ToString() == "")
                        {
                            dr["ImgString"] = "";
                        }
                        else
                        {
                            dr["ImgString"] = dtinfo.Rows[i]["ImgString"].ToString();
                        }
                        dr["IsBackup"] = Convert.ToInt32(dtinfo.Rows[i]["isbackup"].ToString());
                        table.Rows.Add(dr);
                    }
                    Dictionary<string, string> dir = new Dictionary<string, string>();
                    dir.Add("sn", "sn");
                    dir.Add("InspectObjectId", "InspectObjectId");
                    dir.Add("InspectItemId", "InspectItemId");
                    dir.Add("CheckType", "CheckType");
                    dir.Add("InspectLimit", "InspectLimit");
                    dir.Add("NGReason", "NGReason");
                    dir.Add("TotalJudge", "TotalJudge");
                    dir.Add("InspectTimes", "InspectTimes");
                    dir.Add("CreateTime", "CreateTime");
                    dir.Add("InspectOperator", "InspectOperator");
                    dir.Add("IsImprovedOnSite", "IsImprovedOnSite");
                    dir.Add("DealDetial", "DealDetial");
                    dir.Add("ReInspectTimes", "ReInspectTimes");
                    dir.Add("ImgString", "ImgString");
                    dir.Add("IsBackup", "IsBackup");
                    Dictionary<string, object> pdir = new Dictionary<string, object>();
                    pdir.Add("@sn", sn);
                        Dictionary<string, string> dir = new Dictionary<string, string>();
                        dir.Add("sn", "sn");
                        dir.Add("InspectObjectId", "InspectObjectId");
                        dir.Add("InspectItemId", "InspectItemId");
                        dir.Add("CheckType", "CheckType");
                        dir.Add("InspectLimit", "InspectLimit");
                        dir.Add("NGReason", "NGReason");
                        dir.Add("TotalJudge", "TotalJudge");
                        dir.Add("InspectTimes", "InspectTimes");
                        dir.Add("CreateTime", "CreateTime");
                        dir.Add("InspectOperator", "InspectOperator");
                        dir.Add("IsImprovedOnSite", "IsImprovedOnSite");
                        dir.Add("DealDetial", "DealDetial");
                        dir.Add("ReInspectTimes", "ReInspectTimes");
                        dir.Add("ImgString", "ImgString");
                        dir.Add("IsBackup", "IsBackup");
                        Dictionary<string, object> pdir = new Dictionary<string, object>();
                        pdir.Add("@sn", sn);
                    string imgsn = Guid.NewGuid().ToString();
                    DataTable dtimg = BBIZ.GetImageItems();
                    DataTable imgtable = new DataTable(Guid.NewGuid().ToString());
                    imgtable.Columns.Add("TableSN", typeof(string));
                    imgtable.Columns.Add("SN", typeof(string));
                    imgtable.Columns.Add("ImgId", typeof(int));
                    imgtable.Columns.Add("ImgString", typeof(string));
                    for (int i = 0; i < dtimg.Rows.Count; i++)
                    {
                        DataRow dr = imgtable.NewRow();
                        dr["TableSN"] = imgsn;
                        dr["SN"] = dtimg.Rows[i]["SN"].ToString();
                        dr["ImgId"] = Convert.ToInt32(dtimg.Rows[i]["ImgId"].ToString());
                        dr["ImgString"] = dtimg.Rows[i]["ImgString"].ToString();
                        imgtable.Rows.Add(dr);
                    }
                    Dictionary<string, string> imgdir = new Dictionary<string, string>();
                    imgdir.Add("TableSN", "TableSN");
                    imgdir.Add("SN", "SN");
                    imgdir.Add("ImgId", "ImgId");
                    imgdir.Add("ImgString", "ImgString");
                    Dictionary<string, object> idir = new Dictionary<string, object>();
                    idir.Add("@sn", imgsn);
                    MsgObject msg = localProxy.WSBulkCopyDataToDBWithHook(table, "InspectItemInfoDetial", dir, pdir, "yp_InspectItemInfo_bk2", DIXPad.RSLC.DBKeys.DIX);
                    if (msg.Count > 0)
                    {
                        MsgObject msg1 = localProxy.WSBulkCopyDataToDBWithHook(imgtable, "ItemImgDetial", imgdir, idir, "yp_GetImageList", DIXPad.RSLC.DBKeys.DIX);
                        if (msg1.Count > 0)
                        string imgsn = Guid.NewGuid().ToString();
                        DataTable dtimg = BBIZ.GetImageItems();
                        DataTable imgtable = new DataTable(Guid.NewGuid().ToString());
                        imgtable.Columns.Add("TableSN", typeof(string));
                        imgtable.Columns.Add("SN", typeof(string));
                        imgtable.Columns.Add("ImgId", typeof(int));
                        imgtable.Columns.Add("ImgString", typeof(string));
                        for (int i = 0; i < dtimg.Rows.Count; i++)
                        {
                            BBIZ.UpdateInspectedItems();
                            MessageBox.Show("点检数据上传至服务端成功!", "上传成功", MessageBoxButton.OK, MessageBoxImage.Information);
                            DataTable dt = OBIZ.GetAllInspectedItem("", "", "");
                            UploadDataGrid.ItemsSource = dt.DefaultView;
                            DataRow dr = imgtable.NewRow();
                            dr["TableSN"] = imgsn;
                            dr["SN"] = dtimg.Rows[i]["SN"].ToString();
                            dr["ImgId"] = Convert.ToInt32(dtimg.Rows[i]["ImgId"].ToString());
                            dr["ImgString"] = dtimg.Rows[i]["ImgString"].ToString();
                            imgtable.Rows.Add(dr);
                        }
                        Dictionary<string, string> imgdir = new Dictionary<string, string>();
                        imgdir.Add("TableSN", "TableSN");
                        imgdir.Add("SN", "SN");
                        imgdir.Add("ImgId", "ImgId");
                        imgdir.Add("ImgString", "ImgString");
                        Dictionary<string, object> idir = new Dictionary<string, object>();
                        idir.Add("@sn", imgsn);
                        MsgObject msg = localProxy.WSBulkCopyDataToDBWithHook(table, "InspectItemInfoDetial", dir, pdir, "yp_InspectItemInfo_bk2", DIXPad.RSLC.DBKeys.DIX);
                        if (msg.Count > 0)
                        {
                            MsgObject msg1 = localProxy.WSBulkCopyDataToDBWithHook(imgtable, "ItemImgDetial", imgdir, idir, "yp_GetImageList", DIXPad.RSLC.DBKeys.DIX);
                            if (msg1.Count > 0)
                            {
                                BBIZ.UpdateInspectedItems();
                                MessageBox.Show("点检数据上传至服务端成功!", "上传成功", MessageBoxButton.OK, MessageBoxImage.Information);
                                DataTable dt = OBIZ.GetAllInspectedItem("", "", "");
                                UploadDataGrid.ItemsSource = dt.DefaultView;
                            }
                            else
                            {
                                MessageBox.Show("点检数据上传至服务端失败!" + msg1.Msg, "上传失败", MessageBoxButton.OK, MessageBoxImage.Error);
                            }
                        }
                        else
                        {
                            MessageBox.Show("点检数据上传至服务端失败!" + msg1.Msg, "上传失败", MessageBoxButton.OK, MessageBoxImage.Error);
                            MessageBox.Show("点检数据上传至服务端失败!" + msg.Msg, "上传失败", MessageBoxButton.OK, MessageBoxImage.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show("点检数据上传至服务端失败!" + msg.Msg, "上传失败", MessageBoxButton.OK, MessageBoxImage.Error);
                        MessageBox.Show("当前无可上传的点检数据!请点检其他设备后再进行上传!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
                else
                {
                    MessageBox.Show("当前无可上传的点检数据!请点检其他设备后再进行上传!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
        }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
         }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
src/DIXWeb.Business/MySQLBiz/MySQLInspectBaseBiz.cs
@@ -36,14 +36,28 @@
        public void UpdateInspectedItems()
        {
            string sql = "update dix.inspectiteminfo set IsInspected=1 where IsInspected=0;";
            Service.ExecuteSql(sql);
            UpdateInspectedjudge();
            try
            {
                string sql = "update dix.inspectiteminfo set IsInspected=1 where IsInspected=0;";
                Service.ExecuteSql(sql);
                UpdateInspectedjudge();
            }
            catch (Exception)
            {
                throw new Exception();
            }
        }
        public void UpdateInspectedjudge()
        {
            string sql = "update dix.inspectjudge set IsInspected=1 where IsInspected=0;";
            Service.ExecuteSql(sql);
            try
            {
                string sql = "update dix.inspectjudge set IsInspected=1 where IsInspected=0;";
                Service.ExecuteSql(sql);
            }
            catch (Exception)
            {
                throw new Exception();
            }
        }
        public ResultMessage CompareFreqLimit(int objectid, int freqid)
        {
src/DIXWeb.Web/Areas/GlobalM/Views/InspectObjectType/Item.cshtml
@@ -50,13 +50,13 @@
            <tr>
                <th>下限</th>
                <td>
                    <input id="UpdateLimit" value="@obj.LowLimit" class="easyui-combobox" data-options="width:'200px',required:true,align:'center'">
                    <input id="UpdateLimit" value="@obj.LowLimit" class="easyui-textbox" data-options="width:'200px',required:true,align:'center'">
                </td>
            </tr>
            <tr>
                <th>上限</th>
                <td>
                    <input id="UpdateLimit" value="@obj.TopLimit" class="easyui-combobox" data-options="width:'200px',required:true,align:'center'">
                    <input id="UpdateLimit" value="@obj.TopLimit" class="easyui-textbox" data-options="width:'200px',required:true,align:'center'">
                </td>
            </tr>
        </tbody>