Browse Source

业务后台:1、后台设置界面新增L1链接信息
2、床垫报价-公式计算方法,非重算时,不实时计算明细成本金额和用量

chen_yjin 4 months ago
parent
commit
7c7dbb2665

+ 0 - 1
JLHHJSvr/DataStore/web_mattress.xml

@@ -123,7 +123,6 @@
 		<field field="js1_flag" datatype="checkbox">产品补充审核</field>
 		<field field="flag" datatype="checkbox">财务审核</field>
 		<field field="deptid" mapper="" ddd="ddd_mattress_dept_choose" align="left">部门</field>
-		<field field="mattresscode">报价唯一码</field>
 		<field field="mattressrelcode">床垫编码</field>
 		<field field="mattressname">床垫名称</field>
 		<field field="mattresstypeid" mapper="" ddd="ddd_mattress_type_choose">床垫类别</field>

+ 1 - 1
JLHHJSvr/DataStore/web_mattress_mx_neibutao.xml

@@ -29,7 +29,7 @@
 			u_mattress_mx_mtrl.thickness,
 			u_mattress_mx_mtrl.chastr,
 			u_mattress_mx_mtrl.xu,
-			u_mattress_mx_mtrl.costamt as useqty,
+			u_mattress_mx_mtrl.useqty,
 			u_mattress_mx_mtrl.useformula,
 			u_mattress_mx_mtrl.replace_useformula ,
 			u_mattress_mx_mtrl.gydscrp

+ 5 - 1
JLHHJSvr/DataStore/web_mattress_subspecs.xml

@@ -3,6 +3,7 @@
 	<selectstr>
 		SELECT
 		mattressid,
+		mattresscode,
 		mattress_width,
 		mattress_length,
 		mattress_height,
@@ -12,7 +13,9 @@
 	</selectstr>
 	<where>
 		<when notnull="@arg_mattressid">
-			u_mattress.parentid = @arg_mattressid
+			u_mattress.parentid = @arg_mattressid OR  parentid = (
+				SELECT parentid FROM u_mattress WHERE mattressid = @arg_mattressid and parentid > 0
+			)
 		</when>
 	</where>
 	<orderstr>
@@ -22,5 +25,6 @@
 		<field field="mattress_width" datatype="integer">床垫宽/CM</field>
 		<field field="mattress_length" datatype="integer">床垫长/CM</field>
 		<field field="mattress_height" datatype="integer">床垫高/CM</field>
+		<field field="mattresscode">报价唯一码</field>
 	</displayfields>
 </select>

+ 0 - 28
JLHHJSvr/Excutor/DelMtrlPfExcutor.cs

@@ -76,34 +76,6 @@ namespace JLHHJSvr.Excutor
 
                 var l1Rslt = l1Helper.DoExecute("DelPrdPf", l1Req);
                 rslt.ErrMsg = $"{l1Rslt.GetValue("ErrMsg")}";
-
-                //using (var erp_con = new SqlConnection(BllHelper.GetERPConnectString(cmd)))
-                //using (var erp_cmd = erp_con.CreateCommand())
-                //{
-                //    erp_con.Open();
-
-                //    try
-                //    {
-                //        //删除原来的清单主表
-                //        erp_cmd.CommandText = @"DELETE u_mtrl_pf WHERE mtrlid = @arg_mtrlid";
-                //        erp_cmd.Parameters.Clear();
-                //        erp_cmd.Parameters.AddWithValue("@arg_mtrlid", mattress.erp_mtrlid);
-                //        erp_cmd.ExecuteNonQuery();
-
-                //        //删除原来的清单明细表
-                //        erp_cmd.CommandText = @"DELETE u_PrdPF WHERE mtrlid = @arg_mtrlid";
-                //        erp_cmd.Parameters.Clear();
-                //        erp_cmd.Parameters.AddWithValue("@arg_mtrlid", mattress.erp_mtrlid);
-                //        erp_cmd.ExecuteNonQuery();
-
-                //        erp_cmd.Transaction.Commit();
-                //    }
-                //    catch (Exception e)
-                //    {
-                //        erp_cmd.Transaction.Rollback();
-                //        rslt.ErrMsg = e.ToString();
-                //    }
-                //}
             }
         }
     }

+ 10 - 4
JLHHJSvr/GlobalVar/GlobalVar.cs

@@ -27,19 +27,19 @@ namespace JLHHJSvr
         /// <summary>
         /// L1业务后台-HTTP端口(HTTP协议)
         /// </summary>
-        public const int ERP_HTTPPort = 8080;
+        public static int ERP_HTTPPort { get; set; }
         /// <summary>
         /// L1业务后台-登录账套名
         /// </summary>
-        public const string ERP_ACCOUNT_NAME = "";
+        public static string ERP_ACCOUNT_NAME { get; set; }
         /// <summary>
         /// L1业务后台-登录账号
         /// </summary>
-        public const string ERP_ACCOUNT_USERNAME = "";
+        public static string ERP_ACCOUNT_USERNAME { get; set; }
         /// <summary>
         /// L1业务后台-登录密码
         /// </summary>
-        public const string ERP_ACCOUNT_PASSWORD = "";
+        public static string ERP_ACCOUNT_PASSWORD { get; set; }
         /// <summary>
         /// L1业务后台-Token
         /// </summary>
@@ -81,6 +81,12 @@ namespace JLHHJSvr
                         XmlConfig xmlconfig = new XmlConfig();
                         string connectionString = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "ConnectionString", string.Empty);
 
+                        string L1Password = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Password", "");
+                        GlobalVar.ERP_ACCOUNT_NAME = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Server", "");
+                        GlobalVar.ERP_HTTPPort = Convert.ToInt32(xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Httpport", ""));
+                        GlobalVar.ERP_ACCOUNT_USERNAME = xmlconfig.GetXmlFileValue(xmlfile, string.Empty, "L1Usercode", "");
+                        GlobalVar.ERP_ACCOUNT_PASSWORD = DESEncrypt.Decrypt(L1Password, "4A61A8B51C3E42BCAE991F6C913A6A33");//DONE: 解密
+
                         if (string.IsNullOrEmpty(connectionString))
                         {
                             Trace.Write("未设置数据库连接");

+ 183 - 96
JLHHJSvr/Helper/MattressHelper.cs

@@ -57,136 +57,221 @@ namespace JLHHJSvr.Helper
             }
         }
 
+        /// <summary>
+        /// 公式计算
+        /// </summary>
+        /// <param name="mattress"></param>
+        /// <param name="mxlist"></param>
+        /// <param name="isCalBed">是否实时计算</param>
         public void CalCulateFormula(u_mattress mattress, List<u_mattress_mx_mtrl> mxlist,Boolean isCalBed = true)
         {
             InitMattress(mattress);
 
-            InitMattressMx(mattress,mxlist);
+            InitReplaceMents(mattress);
 
-            // 重算床网价格
-            if(isCalBed) CalCulateBedNet(mxlist);
+            // 实时计算价格
+            if (isCalBed)
+            {
+                InitMattressMx(mattress, mxlist);
 
-            InitReplaceMents(mattress);
+                CalCulateBedNet(mxlist);
 
-            var diancengList = mxlist.Where(t => t.formulatype == 1).ToList();
+                var diancengList = mxlist.Where(t => t.formulatype == 1).ToList();
 
-            var mattersstype = new u_mattress_type() { mattresstypeid = mattress.mattresstypeid };
-            DbSqlHelper.SelectOne(cmd, mattersstype, "formula_big_side,formula_small_side,formula_v_side");
+                var mattersstype = new u_mattress_type() { mattresstypeid = mattress.mattresstypeid };
+                DbSqlHelper.SelectOne(cmd, mattersstype, "formula_big_side,formula_small_side,formula_v_side");
 
-            foreach (var mx in mxlist)
-            {
-                if (mx.mtrlid == 0 && mx.formulakind != 31) continue;
+                var thicknessDict = InitMxThicknessReplaceMents(mxlist);
 
-                if (string.IsNullOrEmpty(mx.formula) && string.IsNullOrEmpty(mx.useformula)) continue;
+                foreach (var mx in mxlist)
+                {
+                    if (mx.mtrlid == 0 && mx.formulakind != 31) continue;
 
-                InitMxReplaceMents(mx);
+                    if (string.IsNullOrEmpty(mx.formula) && string.IsNullOrEmpty(mx.useformula)) continue;
 
-                string expression = ConvertToEnglishSymbols(mx.formula), use_expression = ConvertToEnglishSymbols(mx.useformula);
+                    InitMxReplaceMents(mx);
 
-                expression = InitMxSideReplaceMents(mx, diancengList, mattersstype, expression);
-                use_expression = InitMxSideReplaceMents(mx, diancengList, mattersstype,use_expression);
+                    // 顶替分组关键值:內布套、顶布裥棉
+                    if (thicknessDict.ContainsKey(mx.chastr))
+                    {
+                        foreach(var rp in thicknessDict[mx.chastr])
+                        {
+                            AddKeyValue(rp.Key, rp.Value);
+                        }
+                    }
 
-                #region 替换布料幅宽
-                //大侧
-                if (new List<int>() { 2,42,52,62,72,82 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothWidthReplaceMents(mx, mxlist,2);
-                }
-                //小侧
-                if (new List<int>() { 3, 43, 53, 63, 73, 83 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothWidthReplaceMents(mx, mxlist,3);
-                }
-                //大侧
-                if (new List<int>() { 4, 44, 54, 64, 74, 84 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothWidthReplaceMents(mx, mxlist,4);
-                }
-                //面裥绵
-                if (new List<int>() { 0, 40, 50, 60, 70, 80, 203 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothWidthReplaceMents(mx, mxlist,0);
-                }
-                //底裥绵
-                if (new List<int>() { 1, 41, 51, 61, 71, 81 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothWidthReplaceMents(mx, mxlist,1);
-                }
-                #endregion
+                    string expression = ConvertToEnglishSymbols(mx.formula), use_expression = ConvertToEnglishSymbols(mx.useformula);
 
-                #region 替换布套高
-                //内布套
-                if (new List<int>() { 101,102,103,104,105,106 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothHeightReplaceMents(mxlist, 101);
-                }
-                //外布套
-                if (new List<int>() { 111, 112, 113, 114, 115, 116 }.Contains(mx.formulakind.Value))
-                {
-                    InitMxClothHeightReplaceMents(mxlist, 111);
-                }
-                #endregion
+                    expression = InitMxSideReplaceMents(mx, diancengList, mattersstype, expression);
+                    use_expression = InitMxSideReplaceMents(mx, diancengList, mattersstype,use_expression);
 
-                #region 裥绵收缩率
-                InitMxShrinkageReplaceMents(mx,mxlist);
-                #endregion
+                    #region 替换布料幅宽
+                    //大侧
+                    if (new List<int>() { 2,42,52,62,72,82 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothWidthReplaceMents(mx, mxlist,2);
+                    }
+                    //小侧
+                    if (new List<int>() { 3, 43, 53, 63, 73, 83 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothWidthReplaceMents(mx, mxlist,3);
+                    }
+                    //大侧
+                    if (new List<int>() { 4, 44, 54, 64, 74, 84 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothWidthReplaceMents(mx, mxlist,4);
+                    }
+                    //面裥绵
+                    if (new List<int>() { 0, 40, 50, 60, 70, 80, 203 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothWidthReplaceMents(mx, mxlist,0);
+                    }
+                    //底裥绵
+                    if (new List<int>() { 1, 41, 51, 61, 71, 81 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothWidthReplaceMents(mx, mxlist,1);
+                    }
+                    #endregion
 
-                foreach (var replacement in replacements)
-                {
-                    expression = expression.Replace(replacement.Key, Convert.ToString(replacement.Value));
-                    use_expression = use_expression.Replace(replacement.Key, Convert.ToString(replacement.Value));
-                }
+                    #region 替换布套高
+                    //内布套
+                    if (new List<int>() { 101,102,103,104,105,106 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothHeightReplaceMents(mxlist, 101);
+                    }
+                    //外布套
+                    if (new List<int>() { 111, 112, 113, 114, 115, 116 }.Contains(mx.formulakind.Value))
+                    {
+                        InitMxClothHeightReplaceMents(mxlist, 111);
+                    }
+                    #endregion
 
-                #region 计算成本金额
-                // 判断expression前两个字符是否为@@
-                bool sqlCal = !string.IsNullOrEmpty(expression) && expression.Length > 2 && expression.Substring(0, 2) == "@@";
-                expression = expression.Replace("@@", "");
-                mx.replace_formula = expression;
+                    #region 裥绵收缩率
+                    InitMxShrinkageReplaceMents(mx,mxlist);
+                    #endregion
 
-                try
-                {
-                    if (sqlCal)
+                    foreach (var replacement in replacements)
                     {
-                        mx.costamt = Convert.ToDecimal(SqlCalculate(expression, "成本金额"));
+                        expression = expression.Replace(replacement.Key, Convert.ToString(replacement.Value));
+                        use_expression = use_expression.Replace(replacement.Key, Convert.ToString(replacement.Value));
                     }
-                    else
+
+                    #region 计算成本金额
+                    // 判断expression前两个字符是否为@@
+                    bool sqlCal = !string.IsNullOrEmpty(expression) && expression.Length > 2 && expression.Substring(0, 2) == "@@";
+                    expression = expression.Replace("@@", "");
+                    mx.replace_formula = expression;
+
+                    try
                     {
-                        mx.costamt = Calculate(expression, "成本金额").DecimalValue;
+                        if (sqlCal)
+                        {
+                            mx.costamt = Convert.ToDecimal(SqlCalculate(expression, "成本金额"));
+                        }
+                        else
+                        {
+                            mx.costamt = Calculate(expression, "成本金额").DecimalValue;
+                        }
                     }
-                }
-                catch (Exception e)
-                {
-                    mx.if_success = 1;
-                    mx.message = e.Message;
-                }
-                #endregion
+                    catch (Exception e)
+                    {
+                        mx.if_success = 1;
+                        mx.message = e.Message;
+                    }
+                    #endregion
 
-                #region 计算清单用量
-                sqlCal = !string.IsNullOrEmpty(use_expression) && use_expression.Length > 2 &&use_expression.Substring(0, 2) == "@@";
-                use_expression = use_expression.Replace("@@", "");
-                mx.replace_useformula = use_expression;
+                    #region 计算清单用量
+                    sqlCal = !string.IsNullOrEmpty(use_expression) && use_expression.Length > 2 &&use_expression.Substring(0, 2) == "@@";
+                    use_expression = use_expression.Replace("@@", "");
+                    mx.replace_useformula = use_expression;
 
-                try
-                {
-                    if (sqlCal)
+                    try
                     {
-                        mx.useqty = Convert.ToDecimal(SqlCalculate(use_expression, "清单用量"));
+                        if (sqlCal)
+                        {
+                            mx.useqty = Convert.ToDecimal(SqlCalculate(use_expression, "清单用量"));
+                        }
+                        else
+                        {
+                            mx.useqty = Calculate(use_expression, "清单用量").DecimalValue;
+                        }
                     }
-                    else
+                    catch (Exception e)
                     {
-                        mx.useqty = Calculate(use_expression, "清单用量").DecimalValue;
+                        mx.if_success = 1;
+                        mx.message = e.Message;
                     }
+                    #endregion
                 }
-                catch (Exception e)
+            }
+
+            InitMattressMxListReplaceMents(mattress, mxlist);
+        }
+        /// <summary>
+        /// 记录明细按分组读取厚度变量
+        /// </summary>
+        /// <param name="mxlist"></param>
+        private Dictionary<string, Dictionary<string, object>> InitMxThicknessReplaceMents(List<u_mattress_mx_mtrl> mxlist)
+        {
+            // 明细按分组读取厚度变量
+            var thicknessDict = new Dictionary<string, Dictionary<string, object>> () { };
+
+            foreach (var mx in mxlist)
+            {
+                // 只处理 内布套(101,102)、顶布裥棉(103)
+                if (!new List<int>() { 101, 102, 103 }.Contains(mx.formulatype.Value)) continue;
+
+                if (mx.chastr.Contains("顶布裥棉") || mx.chastr.Contains("内布套"))
                 {
-                    mx.if_success = 1;
-                    mx.message = e.Message;
+                    if(!thicknessDict.ContainsKey(mx.chastr))
+                    {
+                        thicknessDict.Add(mx.chastr, new Dictionary<string, object>() {});
+                    }
+                    var mxDict = thicknessDict[mx.chastr];
+                    setMxThicknessValue(mx, ref mxDict);
+                    thicknessDict[mx.chastr] = mxDict;
                 }
-                #endregion
             }
 
-            InitMattressMxListReplaceMents(mattress, mxlist);
+            return thicknessDict;
         }
+        private void setMxThicknessValue(u_mattress_mx_mtrl mx, ref Dictionary<string, object> mxDict)
+        {
+            var keyStr = "";
+            if (new List<int>() { 101, 102 }.Contains(mx.formulatype.Value))
+            {
+                switch (mx.formulakind.Value)
+                {
+                    case 0: // 面裥绵-布料
+                        keyStr = "内布套上覆";
+                        break;
+                    case 1: // 底裥绵-布料
+                        keyStr = "内布套下覆";
+                        break;
+                    case 2: // 大侧裥绵-布料
+                        keyStr = "内布套侧覆";
+                        break;
+                }
+                if (!string.IsNullOrEmpty(keyStr))
+                {
+                    mxDict.Add(keyStr, mx.thickness);
+                }
+            } 
+            else if (new List<int>() { 103 }.Contains(mx.formulatype.Value))
+            {
+                switch (mx.formulakind.Value)
+                {
+                    case 50: // 面裥绵-裥绵海绵
+                        keyStr = "物料厚度";
+                        break;
+                }
+                if (!string.IsNullOrEmpty(keyStr))
+                {
+                    mxDict.Add(keyStr, mx.thickness.Value);
+                }
+            }
+        }
+
         private void CalCulateBedNet(List<u_mattress_mx_mtrl> mxlist)
         {
             var bedNetHelper = HelperBase.GetHelper<BedNetHelper>(cmd, new HelperBase.Context() { tokendata = context.tokendata });
@@ -273,6 +358,8 @@ namespace JLHHJSvr.Helper
         {
             foreach(var mx in mxlist)
             {
+                if (!new List<int>() { 0, 1, 2, 3, 104 }.Contains(mx.formulatype.Value)) continue;
+
                 var formula = new u_mattress_formula() { formulaid = mx.formulaid, };
                 DbSqlHelper.SelectOne(cmd, formula, "formulakind,formulatype,sortcode");
 
@@ -735,7 +822,7 @@ namespace JLHHJSvr.Helper
             int diancengCount = 0;
             foreach(var dianceng in diancengList)
             {
-                if (dianceng.formulatype == 32) diancengCount++;
+                if (dianceng.formulakind == 32) diancengCount++;
             }
 
             AddKeyValue("垫层数量", diancengCount);

+ 1 - 0
JLHHJSvr/JLHHJSvr.csproj

@@ -260,6 +260,7 @@
     <Compile Include="Excutor\CommonDynamicSelectExcutor.cs" />
     <Compile Include="Excutor\CopyMattressAuditedExcutor.cs" />
     <Compile Include="Excutor\CopyMtrlDefExcutor.cs" />
+    <Compile Include="Excutor\DelMtrlPfExcutor.cs" />
     <Compile Include="Excutor\DelCarListExcutor.cs" />
     <Compile Include="Excutor\DeleteBedNetAreaExcutor.cs" />
     <Compile Include="Excutor\DeleteBedNetExcutor.cs" />

+ 153 - 51
JLHHJSvr/JLHHJSvrConfig.Designer.cs

@@ -44,87 +44,95 @@
             this.label5 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.textBox6 = new System.Windows.Forms.TextBox();
+            this.textBox7 = new System.Windows.Forms.TextBox();
+            this.label7 = new System.Windows.Forms.Label();
+            this.textBox8 = new System.Windows.Forms.TextBox();
+            this.textBox9 = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label10 = new System.Windows.Forms.Label();
+            this.textBox10 = new System.Windows.Forms.TextBox();
+            this.label11 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // textBox1
             // 
-            this.textBox1.Location = new System.Drawing.Point(87, 29);
-            this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox1.Location = new System.Drawing.Point(130, 46);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(6);
             this.textBox1.Name = "textBox1";
-            this.textBox1.Size = new System.Drawing.Size(216, 25);
+            this.textBox1.Size = new System.Drawing.Size(322, 35);
             this.textBox1.TabIndex = 0;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(24, 34);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(36, 54);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 15);
+            this.label1.Size = new System.Drawing.Size(82, 24);
             this.label1.TabIndex = 1;
             this.label1.Text = "服务器";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(24, 70);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(36, 112);
+            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(52, 15);
+            this.label2.Size = new System.Drawing.Size(82, 24);
             this.label2.TabIndex = 2;
             this.label2.Text = "数据库";
             // 
             // textBox2
             // 
-            this.textBox2.Location = new System.Drawing.Point(87, 65);
-            this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox2.Location = new System.Drawing.Point(130, 104);
+            this.textBox2.Margin = new System.Windows.Forms.Padding(6);
             this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(216, 25);
+            this.textBox2.Size = new System.Drawing.Size(322, 35);
             this.textBox2.TabIndex = 1;
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(24, 106);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(36, 170);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(52, 15);
+            this.label3.Size = new System.Drawing.Size(82, 24);
             this.label3.TabIndex = 2;
             this.label3.Text = "用户名";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(40, 142);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(60, 227);
+            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(37, 15);
+            this.label4.Size = new System.Drawing.Size(58, 24);
             this.label4.TabIndex = 2;
             this.label4.Text = "密码";
             // 
             // textBox3
             // 
-            this.textBox3.Location = new System.Drawing.Point(87, 101);
-            this.textBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox3.Location = new System.Drawing.Point(130, 162);
+            this.textBox3.Margin = new System.Windows.Forms.Padding(6);
             this.textBox3.Name = "textBox3";
-            this.textBox3.Size = new System.Drawing.Size(216, 25);
+            this.textBox3.Size = new System.Drawing.Size(322, 35);
             this.textBox3.TabIndex = 2;
             // 
             // textBox4
             // 
-            this.textBox4.Location = new System.Drawing.Point(87, 138);
-            this.textBox4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox4.Location = new System.Drawing.Point(130, 221);
+            this.textBox4.Margin = new System.Windows.Forms.Padding(6);
             this.textBox4.Name = "textBox4";
-            this.textBox4.Size = new System.Drawing.Size(216, 25);
+            this.textBox4.Size = new System.Drawing.Size(322, 35);
             this.textBox4.TabIndex = 3;
             this.textBox4.UseSystemPasswordChar = true;
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(87, 171);
-            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button1.Location = new System.Drawing.Point(870, 210);
+            this.button1.Margin = new System.Windows.Forms.Padding(6);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(100, 29);
+            this.button1.Size = new System.Drawing.Size(150, 46);
             this.button1.TabIndex = 4;
             this.button1.Text = "测试连接";
             this.button1.UseVisualStyleBackColor = true;
@@ -132,10 +140,10 @@
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(472, 215);
-            this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button2.Location = new System.Drawing.Point(708, 477);
+            this.button2.Margin = new System.Windows.Forms.Padding(6);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(100, 29);
+            this.button2.Size = new System.Drawing.Size(150, 46);
             this.button2.TabIndex = 5;
             this.button2.Text = "保存";
             this.button2.UseVisualStyleBackColor = true;
@@ -143,10 +151,10 @@
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(580, 215);
-            this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button3.Location = new System.Drawing.Point(870, 477);
+            this.button3.Margin = new System.Windows.Forms.Padding(6);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(100, 29);
+            this.button3.Size = new System.Drawing.Size(150, 46);
             this.button3.TabIndex = 6;
             this.button3.Text = "退出";
             this.button3.UseVisualStyleBackColor = true;
@@ -154,10 +162,10 @@
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(580, 28);
-            this.button4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button4.Location = new System.Drawing.Point(870, 45);
+            this.button4.Margin = new System.Windows.Forms.Padding(6);
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(100, 29);
+            this.button4.Size = new System.Drawing.Size(150, 46);
             this.button4.TabIndex = 7;
             this.button4.Text = "安装服务";
             this.button4.UseVisualStyleBackColor = true;
@@ -165,47 +173,132 @@
             // 
             // textBox5
             // 
-            this.textBox5.Location = new System.Drawing.Point(391, 101);
-            this.textBox5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox5.Location = new System.Drawing.Point(586, 162);
+            this.textBox5.Margin = new System.Windows.Forms.Padding(6);
             this.textBox5.Name = "textBox5";
-            this.textBox5.Size = new System.Drawing.Size(103, 25);
+            this.textBox5.Size = new System.Drawing.Size(152, 35);
             this.textBox5.TabIndex = 3;
             this.textBox5.Text = "9075";
             // 
             // label5
             // 
             this.label5.AutoSize = true;
-            this.label5.Location = new System.Drawing.Point(322, 106);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Location = new System.Drawing.Point(483, 170);
+            this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(61, 15);
+            this.label5.Size = new System.Drawing.Size(94, 24);
             this.label5.TabIndex = 2;
             this.label5.Text = "TCP端口";
             // 
             // label6
             // 
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(314, 141);
-            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Location = new System.Drawing.Point(471, 226);
+            this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(69, 15);
+            this.label6.Size = new System.Drawing.Size(106, 24);
             this.label6.TabIndex = 8;
             this.label6.Text = "HTTP端口";
             // 
             // textBox6
             // 
-            this.textBox6.Location = new System.Drawing.Point(391, 137);
-            this.textBox6.Margin = new System.Windows.Forms.Padding(4);
+            this.textBox6.Location = new System.Drawing.Point(586, 219);
+            this.textBox6.Margin = new System.Windows.Forms.Padding(6);
             this.textBox6.Name = "textBox6";
-            this.textBox6.Size = new System.Drawing.Size(103, 25);
+            this.textBox6.Size = new System.Drawing.Size(152, 35);
             this.textBox6.TabIndex = 9;
             this.textBox6.Text = "9076";
             // 
+            // textBox7
+            // 
+            this.textBox7.Location = new System.Drawing.Point(134, 302);
+            this.textBox7.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox7.Name = "textBox7";
+            this.textBox7.Size = new System.Drawing.Size(322, 35);
+            this.textBox7.TabIndex = 10;
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(40, 305);
+            this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label7.Name = "label7";
+            this.label7.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+            this.label7.Size = new System.Drawing.Size(82, 24);
+            this.label7.TabIndex = 11;
+            this.label7.Text = "L1账套";
+            // 
+            // textBox8
+            // 
+            this.textBox8.Location = new System.Drawing.Point(134, 359);
+            this.textBox8.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox8.Name = "textBox8";
+            this.textBox8.Size = new System.Drawing.Size(322, 35);
+            this.textBox8.TabIndex = 12;
+            // 
+            // textBox9
+            // 
+            this.textBox9.Location = new System.Drawing.Point(134, 418);
+            this.textBox9.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox9.Name = "textBox9";
+            this.textBox9.Size = new System.Drawing.Size(322, 35);
+            this.textBox9.TabIndex = 13;
+            this.textBox9.UseSystemPasswordChar = true;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(20, 362);
+            this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label9.Name = "label9";
+            this.label9.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+            this.label9.Size = new System.Drawing.Size(106, 24);
+            this.label9.TabIndex = 14;
+            this.label9.Text = "账号名称";
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(20, 423);
+            this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label10.Name = "label10";
+            this.label10.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+            this.label10.Size = new System.Drawing.Size(106, 24);
+            this.label10.TabIndex = 15;
+            this.label10.Text = "账号密码";
+            // 
+            // textBox10
+            // 
+            this.textBox10.Location = new System.Drawing.Point(590, 302);
+            this.textBox10.Margin = new System.Windows.Forms.Padding(6);
+            this.textBox10.Name = "textBox10";
+            this.textBox10.Size = new System.Drawing.Size(152, 35);
+            this.textBox10.TabIndex = 16;
+            this.textBox10.Text = "8080";
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(475, 305);
+            this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(106, 24);
+            this.label11.TabIndex = 17;
+            this.label11.Text = "HTTP端口";
+            // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(720, 259);
+            this.ClientSize = new System.Drawing.Size(1080, 552);
+            this.Controls.Add(this.label11);
+            this.Controls.Add(this.textBox10);
+            this.Controls.Add(this.label10);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.textBox9);
+            this.Controls.Add(this.textBox8);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.textBox7);
             this.Controls.Add(this.label6);
             this.Controls.Add(this.textBox6);
             this.Controls.Add(this.button4);
@@ -222,7 +315,7 @@
             this.Controls.Add(this.textBox3);
             this.Controls.Add(this.textBox2);
             this.Controls.Add(this.textBox1);
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "Form1";
             this.Text = "数据库连接设置";
             this.ResumeLayout(false);
@@ -248,6 +341,15 @@
         private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.TextBox textBox6;
+        private System.Windows.Forms.TextBox textBox7;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.TextBox textBox8;
+        private System.Windows.Forms.TextBox textBox9;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.TextBox textBox10;
+        private System.Windows.Forms.Label label11;
     }
 }
 

+ 4 - 1
JLHHJSvr/JLHHJSvrConfig.cs

@@ -84,6 +84,10 @@ namespace JLHHJSvr
 
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "port", textBox5.Text);
                 xmlconfig.SetXmlFileValue(configFile, string.Empty, "httpport", textBox6.Text);
+                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Server", textBox7.Text);
+                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Httpport", textBox10.Text);
+                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Usercode", textBox8.Text);
+                xmlconfig.SetXmlFileValue(configFile, string.Empty, "L1Password", DESEncrypt.Encrypt(textBox9.Text, "4A61A8B51C3E42BCAE991F6C913A6A33"));
 
                 MessageBox.Show("保存成功");
             }
@@ -110,6 +114,5 @@ namespace JLHHJSvr
             }
             button4.Text = LJInstallHelper.Exitst(servername) ? "卸载服务" : "安装服务";
         }
-
     }
 }

+ 2 - 2
JLHHJSvr/JLHHJSvrConfig.resx

@@ -112,9 +112,9 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
 </root>