Sfoglia il codice sorgente

feat: 增加科室查询及核心优化

zhengjie 1 anno fa
parent
commit
8dbdd14d5e

+ 2 - 1
Business/HisMainBusiness.cs

@@ -72,7 +72,8 @@ namespace PTMedicalInsurance.Business
             Global.curEvt.ext.isOpenAnalysis = (ini.ReadValue("PreAndInProcessAnalysis", "isOpenAnalysis") == "1");
             Global.curEvt.ext.centerMode = ini.ReadValue("YB", "mode");
             Global.curEvt.ext.BaseLineMode = ("1".Equals(ini.ReadValue("YB", "base")));
-            Global.curEvt.enabledDebug = ("1".Equals(ini.ReadValue("YB", "mock")));
+            Global.curEvt.enabledDebug = ("1".Equals(ini.ReadValue("YB", "debug")));
+            Global.curEvt.showJson = ("1".Equals(ini.ReadValue("YB", "mock")));
         }
 
         /// <summary>

+ 18 - 0
Business/Local/LocalMedDirDownloadProcess.cs

@@ -153,6 +153,24 @@ namespace PTMedicalInsurance.Business
             return IrisReturn("下载成功",null);
         }
 
+        /// <summary>
+        /// 科室查询
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        public CallResult QueryDepartment()
+        {
+            JObject joInput = new JObject();
+            joInput["p_ksbm"] = ""; //全量下载
+            Global.pat.insuplc_admdvs = "370100";
+            JObject joRtn = invoker.invokeCenterService(TradeEnum.DepartmentQuery, joInput);
+            if ("0".Equals(JsonHelper.getDestValue(joRtn, "resultcode")))
+            {
+                // 是否还有数据
+                outParam = JsonHelper.getDestValue(joRtn, "dept_ds");
+            }
+            return Success();
+        }
         private HBMedInsuDirectory NewDiagnosis(JObject obj)
         {
             HBMedInsuDirectory jsonTemp = new HBMedInsuDirectory();

+ 11 - 0
Common/ExpressionEvaluator.cs

@@ -10,6 +10,17 @@ namespace PTMedicalInsurance.Common
 {
     class ExpressionEvaluator
     {
+
+        /// <summary>
+        /// 转字符串
+        /// </summary>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public static string ConvertToString(object value)
+        {
+            return string.Format("{0}", value);
+        }
+
         /// <summary>
         /// 将long转为yyyy-MM-dd
         /// </summary>

+ 6 - 6
Common/Utils.cs

@@ -245,11 +245,11 @@ namespace PTMedicalInsurance.Common
             if (!Global.curEvt.ext.BaseLineMode)
             {
                 // 调试模式,可手动配置转换规则
-                //if (Global.curEvt.enabledDebug)
-                //{
+                if (Global.curEvt.showJson)
+                {
                     JsonMappingForm form = new JsonMappingForm(request.ToString(),mapper.GetInputJson(),trade.GetCode());
                     form.ShowDialog();
-                //}
+                }
                 joOutput = mapper.MapRequest<JObject, T>(request);
             }
             // 日志
@@ -272,11 +272,11 @@ namespace PTMedicalInsurance.Common
             if (!Global.curEvt.ext.BaseLineMode)
             {
                 //如果没有配置转换规则,调试模式,可手动配置
-                //if (Global.curEvt.enabledDebug)
-                //{
+                if (Global.curEvt.showJson)
+                {
                     JsonMappingForm form = new JsonMappingForm(response.ToString(), mapper.GetOutputJson(), trade.GetCode(),false);
                     form.ShowDialog();
-                //}
+                }
 
                 joOutput = mapper.MapResponse<JObject, T>(response);
             }

+ 11 - 2
Forms/BasicData.cs

@@ -766,8 +766,17 @@ namespace PTMedicalInsurance.Forms
             input["ver"] = ver;
             LocalMedDirDownloadProcess download = new LocalMedDirDownloadProcess();
 
-            //医保字典数据下载
-            if (rbgDirecType.SelectedIndex == 8)
+            // 目录查询
+            if (rbgDirecType.SelectedIndex == 15)
+            {
+                CallResult cr = download.QueryDepartment();
+                if (cr.Success)
+                {
+                    Global.writeLog(cr.Data);
+                }
+            }
+            // 医保字典数据下载
+            else if (rbgDirecType.SelectedIndex == 8)
             {
                 if (tbDicDate.Text == "")
                 {

+ 95 - 88
Forms/JsonMappingForm.Designer.cs

@@ -45,6 +45,7 @@ namespace PTMedicalInsurance.Forms
             this.insutype = new System.Windows.Forms.ToolStripMenuItem();
             this.medtype = new System.Windows.Forms.ToolStripMenuItem();
             this.ecToken = new System.Windows.Forms.ToolStripMenuItem();
+            this.clearway = new System.Windows.Forms.ToolStripMenuItem();
             this.saveToExpand = new System.Windows.Forms.ToolStripMenuItem();
             this.label1 = new System.Windows.Forms.Label();
             this.lstLocal = new System.Windows.Forms.ListBox();
@@ -73,7 +74,7 @@ namespace PTMedicalInsurance.Forms
             this.btnChange = new System.Windows.Forms.Button();
             this.txtLocalName = new System.Windows.Forms.TextBox();
             this.txtBaseName = new System.Windows.Forms.TextBox();
-            this.clearway = new System.Windows.Forms.ToolStripMenuItem();
+            this.ToString = new System.Windows.Forms.ToolStripMenuItem();
             this.localContextMenu.SuspendLayout();
             this.mapContextMenu.SuspendLayout();
             this.panel1.SuspendLayout();
@@ -86,11 +87,11 @@ namespace PTMedicalInsurance.Forms
             | System.Windows.Forms.AnchorStyles.Left)));
             this.lstBase.FormattingEnabled = true;
             this.lstBase.HorizontalScrollbar = true;
-            this.lstBase.ItemHeight = 18;
-            this.lstBase.Location = new System.Drawing.Point(12, 48);
+            this.lstBase.ItemHeight = 15;
+            this.lstBase.Location = new System.Drawing.Point(11, 40);
             this.lstBase.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.lstBase.Name = "lstBase";
-            this.lstBase.Size = new System.Drawing.Size(374, 346);
+            this.lstBase.Size = new System.Drawing.Size(333, 289);
             this.lstBase.TabIndex = 0;
             // 
             // localContextMenu
@@ -101,12 +102,12 @@ namespace PTMedicalInsurance.Forms
             this.globalVar,
             this.saveToExpand});
             this.localContextMenu.Name = "localContextMenu";
-            this.localContextMenu.Size = new System.Drawing.Size(241, 127);
+            this.localContextMenu.Size = new System.Drawing.Size(184, 76);
             // 
             // fixValue
             // 
             this.fixValue.Name = "fixValue";
-            this.fixValue.Size = new System.Drawing.Size(240, 30);
+            this.fixValue.Size = new System.Drawing.Size(183, 24);
             this.fixValue.Text = "设定固定值";
             this.fixValue.Click += new System.EventHandler(this.fixValue_Click);
             // 
@@ -126,99 +127,106 @@ namespace PTMedicalInsurance.Forms
             this.ecToken,
             this.clearway});
             this.globalVar.Name = "globalVar";
-            this.globalVar.Size = new System.Drawing.Size(240, 30);
+            this.globalVar.Size = new System.Drawing.Size(183, 24);
             this.globalVar.Text = "设置全局变量";
             // 
             // medtrt_id
             // 
             this.medtrt_id.Name = "medtrt_id";
-            this.medtrt_id.Size = new System.Drawing.Size(270, 34);
+            this.medtrt_id.Size = new System.Drawing.Size(224, 26);
             this.medtrt_id.Text = "医保就诊ID";
             this.medtrt_id.Click += new System.EventHandler(this.medtrt_id_Click);
             // 
             // insuplc_admvs
             // 
             this.insuplc_admvs.Name = "insuplc_admvs";
-            this.insuplc_admvs.Size = new System.Drawing.Size(270, 34);
+            this.insuplc_admvs.Size = new System.Drawing.Size(224, 26);
             this.insuplc_admvs.Text = "就医地";
             this.insuplc_admvs.Click += new System.EventHandler(this.insuplc_admvs_Click);
             // 
             // insuadm_admvs
             // 
             this.insuadm_admvs.Name = "insuadm_admvs";
-            this.insuadm_admvs.Size = new System.Drawing.Size(270, 34);
+            this.insuadm_admvs.Size = new System.Drawing.Size(224, 26);
             this.insuadm_admvs.Text = "参保地";
             this.insuadm_admvs.Click += new System.EventHandler(this.insuadm_admvs_Click);
             // 
             // pns_no
             // 
             this.pns_no.Name = "pns_no";
-            this.pns_no.Size = new System.Drawing.Size(270, 34);
+            this.pns_no.Size = new System.Drawing.Size(224, 26);
             this.pns_no.Text = "个人编号";
             this.pns_no.Click += new System.EventHandler(this.pns_no_Click);
             // 
             // psn_name
             // 
             this.psn_name.Name = "psn_name";
-            this.psn_name.Size = new System.Drawing.Size(270, 34);
+            this.psn_name.Size = new System.Drawing.Size(224, 26);
             this.psn_name.Text = "姓名";
             this.psn_name.Click += new System.EventHandler(this.psn_name_Click);
             // 
             // gender
             // 
             this.gender.Name = "gender";
-            this.gender.Size = new System.Drawing.Size(270, 34);
+            this.gender.Size = new System.Drawing.Size(224, 26);
             this.gender.Text = "性别";
             this.gender.Click += new System.EventHandler(this.gender_Click);
             // 
             // age
             // 
             this.age.Name = "age";
-            this.age.Size = new System.Drawing.Size(270, 34);
+            this.age.Size = new System.Drawing.Size(224, 26);
             this.age.Text = "年龄";
             this.age.Click += new System.EventHandler(this.age_Click);
             // 
             // birthday
             // 
             this.birthday.Name = "birthday";
-            this.birthday.Size = new System.Drawing.Size(270, 34);
+            this.birthday.Size = new System.Drawing.Size(224, 26);
             this.birthday.Text = "出生日期";
             this.birthday.Click += new System.EventHandler(this.birthday_Click);
             // 
             // insutype
             // 
             this.insutype.Name = "insutype";
-            this.insutype.Size = new System.Drawing.Size(270, 34);
+            this.insutype.Size = new System.Drawing.Size(224, 26);
             this.insutype.Text = "险种类型";
             this.insutype.Click += new System.EventHandler(this.insutype_Click);
             // 
             // medtype
             // 
             this.medtype.Name = "medtype";
-            this.medtype.Size = new System.Drawing.Size(270, 34);
+            this.medtype.Size = new System.Drawing.Size(224, 26);
             this.medtype.Text = "医疗类别";
             this.medtype.Click += new System.EventHandler(this.medtype_Click);
             // 
             // ecToken
             // 
             this.ecToken.Name = "ecToken";
-            this.ecToken.Size = new System.Drawing.Size(270, 34);
+            this.ecToken.Size = new System.Drawing.Size(224, 26);
             this.ecToken.Text = "电子凭证码";
             this.ecToken.Click += new System.EventHandler(this.ecToken_Click);
             // 
+            // clearway
+            // 
+            this.clearway.Name = "clearway";
+            this.clearway.Size = new System.Drawing.Size(224, 26);
+            this.clearway.Text = "清算方式";
+            this.clearway.Click += new System.EventHandler(this.clearway_Click);
+            // 
             // saveToExpand
             // 
             this.saveToExpand.Name = "saveToExpand";
-            this.saveToExpand.Size = new System.Drawing.Size(240, 30);
+            this.saveToExpand.Size = new System.Drawing.Size(183, 24);
             this.saveToExpand.Text = "保存到扩展节点";
             this.saveToExpand.Click += new System.EventHandler(this.saveToExpand_Click);
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(12, 18);
+            this.label1.Location = new System.Drawing.Point(11, 15);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(62, 18);
+            this.label1.Size = new System.Drawing.Size(52, 15);
             this.label1.TabIndex = 1;
             this.label1.Text = "基线版";
             // 
@@ -228,20 +236,20 @@ namespace PTMedicalInsurance.Forms
             | System.Windows.Forms.AnchorStyles.Right)));
             this.lstLocal.ContextMenuStrip = this.localContextMenu;
             this.lstLocal.FormattingEnabled = true;
-            this.lstLocal.ItemHeight = 18;
-            this.lstLocal.Location = new System.Drawing.Point(654, 46);
+            this.lstLocal.ItemHeight = 15;
+            this.lstLocal.Location = new System.Drawing.Point(581, 38);
             this.lstLocal.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.lstLocal.Name = "lstLocal";
-            this.lstLocal.Size = new System.Drawing.Size(360, 346);
+            this.lstLocal.Size = new System.Drawing.Size(320, 289);
             this.lstLocal.TabIndex = 0;
             // 
             // label2
             // 
             this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(651, 18);
+            this.label2.Location = new System.Drawing.Point(579, 15);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(62, 18);
+            this.label2.Size = new System.Drawing.Size(52, 15);
             this.label2.TabIndex = 1;
             this.label2.Text = "地方版";
             // 
@@ -249,10 +257,10 @@ namespace PTMedicalInsurance.Forms
             // 
             this.txtBase.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Left)));
-            this.txtBase.Location = new System.Drawing.Point(3, 28);
+            this.txtBase.Location = new System.Drawing.Point(3, 23);
             this.txtBase.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtBase.Name = "txtBase";
-            this.txtBase.Size = new System.Drawing.Size(644, 297);
+            this.txtBase.Size = new System.Drawing.Size(573, 248);
             this.txtBase.TabIndex = 3;
             this.txtBase.Text = "";
             // 
@@ -260,37 +268,37 @@ namespace PTMedicalInsurance.Forms
             // 
             this.txtLocal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.txtLocal.Location = new System.Drawing.Point(654, 28);
+            this.txtLocal.Location = new System.Drawing.Point(581, 23);
             this.txtLocal.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtLocal.Name = "txtLocal";
-            this.txtLocal.Size = new System.Drawing.Size(741, 297);
+            this.txtLocal.Size = new System.Drawing.Size(659, 248);
             this.txtLocal.TabIndex = 3;
             this.txtLocal.Text = "";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(12, 7);
+            this.label3.Location = new System.Drawing.Point(11, 6);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(134, 18);
+            this.label3.Size = new System.Drawing.Size(114, 15);
             this.label3.TabIndex = 1;
             this.label3.Text = "基线版JSON数据";
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(651, 0);
+            this.label4.Location = new System.Drawing.Point(579, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(134, 18);
+            this.label4.Size = new System.Drawing.Size(114, 15);
             this.label4.TabIndex = 1;
             this.label4.Text = "地方版JSON数据";
             // 
             // btnLoad
             // 
-            this.btnLoad.Location = new System.Drawing.Point(443, 232);
+            this.btnLoad.Location = new System.Drawing.Point(394, 193);
             this.btnLoad.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnLoad.Name = "btnLoad";
-            this.btnLoad.Size = new System.Drawing.Size(145, 43);
+            this.btnLoad.Size = new System.Drawing.Size(129, 36);
             this.btnLoad.TabIndex = 2;
             this.btnLoad.Text = "加载属性";
             this.btnLoad.UseVisualStyleBackColor = true;
@@ -301,11 +309,11 @@ namespace PTMedicalInsurance.Forms
             this.lstMap.ContextMenuStrip = this.mapContextMenu;
             this.lstMap.FormattingEnabled = true;
             this.lstMap.HorizontalScrollbar = true;
-            this.lstMap.ItemHeight = 18;
-            this.lstMap.Location = new System.Drawing.Point(1020, 46);
+            this.lstMap.ItemHeight = 15;
+            this.lstMap.Location = new System.Drawing.Point(907, 38);
             this.lstMap.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.lstMap.Name = "lstMap";
-            this.lstMap.Size = new System.Drawing.Size(368, 346);
+            this.lstMap.Size = new System.Drawing.Size(328, 289);
             this.lstMap.TabIndex = 0;
             this.lstMap.DoubleClick += new System.EventHandler(this.lstMap_DoubleClick);
             // 
@@ -314,38 +322,38 @@ namespace PTMedicalInsurance.Forms
             this.mapContextMenu.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.mapContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.numToDate,
-            this.stringToDate});
+            this.stringToDate,
+            this.ToString});
             this.mapContextMenu.Name = "mapContextMenu";
-            this.mapContextMenu.Size = new System.Drawing.Size(299, 64);
+            this.mapContextMenu.Size = new System.Drawing.Size(258, 104);
             // 
             // numToDate
             // 
             this.numToDate.Name = "numToDate";
-            this.numToDate.Size = new System.Drawing.Size(298, 30);
+            this.numToDate.Size = new System.Drawing.Size(257, 24);
             this.numToDate.Text = "数字转日期(yyyy-MM-dd)";
             this.numToDate.Click += new System.EventHandler(this.numToDate_Click);
             // 
             // stringToDate
             // 
             this.stringToDate.Name = "stringToDate";
-            this.stringToDate.Size = new System.Drawing.Size(298, 30);
+            this.stringToDate.Size = new System.Drawing.Size(257, 24);
             this.stringToDate.Text = "日期格式(yyyy-MM-dd)";
             this.stringToDate.Click += new System.EventHandler(this.stringToDate_Click);
             // 
             // txtName
             // 
-            this.txtName.Location = new System.Drawing.Point(408, 54);
-            this.txtName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.txtName.Location = new System.Drawing.Point(363, 45);
             this.txtName.Name = "txtName";
-            this.txtName.Size = new System.Drawing.Size(224, 28);
+            this.txtName.Size = new System.Drawing.Size(200, 25);
             this.txtName.TabIndex = 4;
             // 
             // btnMap
             // 
-            this.btnMap.Location = new System.Drawing.Point(443, 291);
+            this.btnMap.Location = new System.Drawing.Point(394, 242);
             this.btnMap.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnMap.Name = "btnMap";
-            this.btnMap.Size = new System.Drawing.Size(145, 44);
+            this.btnMap.Size = new System.Drawing.Size(129, 37);
             this.btnMap.TabIndex = 2;
             this.btnMap.Text = "映射属性>>";
             this.btnMap.UseVisualStyleBackColor = true;
@@ -360,17 +368,17 @@ namespace PTMedicalInsurance.Forms
             this.panel1.Controls.Add(this.txtLocal);
             this.panel1.Controls.Add(this.label4);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panel1.Location = new System.Drawing.Point(0, 403);
-            this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.panel1.Location = new System.Drawing.Point(0, 336);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1400, 334);
+            this.panel1.Size = new System.Drawing.Size(1244, 278);
             this.panel1.TabIndex = 5;
             // 
             // btnExchange
             // 
-            this.btnExchange.Location = new System.Drawing.Point(978, -3);
+            this.btnExchange.Location = new System.Drawing.Point(869, -2);
+            this.btnExchange.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnExchange.Name = "btnExchange";
-            this.btnExchange.Size = new System.Drawing.Size(108, 28);
+            this.btnExchange.Size = new System.Drawing.Size(96, 23);
             this.btnExchange.TabIndex = 5;
             this.btnExchange.Text = "对换JSON";
             this.btnExchange.UseVisualStyleBackColor = true;
@@ -378,9 +386,10 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnMockLocal
             // 
-            this.btnMockLocal.Location = new System.Drawing.Point(842, -5);
+            this.btnMockLocal.Location = new System.Drawing.Point(748, -4);
+            this.btnMockLocal.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnMockLocal.Name = "btnMockLocal";
-            this.btnMockLocal.Size = new System.Drawing.Size(102, 28);
+            this.btnMockLocal.Size = new System.Drawing.Size(91, 23);
             this.btnMockLocal.TabIndex = 4;
             this.btnMockLocal.Text = "Mock数据";
             this.btnMockLocal.UseVisualStyleBackColor = true;
@@ -390,9 +399,9 @@ namespace PTMedicalInsurance.Forms
             // 
             this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.label6.AutoSize = true;
-            this.label6.Location = new System.Drawing.Point(1017, 18);
+            this.label6.Location = new System.Drawing.Point(904, 15);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(80, 18);
+            this.label6.Size = new System.Drawing.Size(67, 15);
             this.label6.TabIndex = 1;
             this.label6.Text = "映射结果";
             // 
@@ -400,11 +409,9 @@ namespace PTMedicalInsurance.Forms
             // 
             this.groupBox1.Controls.Add(this.radioInput);
             this.groupBox1.Controls.Add(this.radioOutput);
-            this.groupBox1.Location = new System.Drawing.Point(407, 88);
-            this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.groupBox1.Location = new System.Drawing.Point(362, 73);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
-            this.groupBox1.Size = new System.Drawing.Size(225, 127);
+            this.groupBox1.Size = new System.Drawing.Size(200, 106);
             this.groupBox1.TabIndex = 6;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "转换方向";
@@ -413,10 +420,9 @@ namespace PTMedicalInsurance.Forms
             // 
             this.radioInput.AutoSize = true;
             this.radioInput.Checked = true;
-            this.radioInput.Location = new System.Drawing.Point(54, 35);
-            this.radioInput.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.radioInput.Location = new System.Drawing.Point(48, 29);
             this.radioInput.Name = "radioInput";
-            this.radioInput.Size = new System.Drawing.Size(105, 22);
+            this.radioInput.Size = new System.Drawing.Size(88, 19);
             this.radioInput.TabIndex = 0;
             this.radioInput.TabStop = true;
             this.radioInput.Text = "入参映射";
@@ -426,10 +432,9 @@ namespace PTMedicalInsurance.Forms
             // radioOutput
             // 
             this.radioOutput.AutoSize = true;
-            this.radioOutput.Location = new System.Drawing.Point(54, 78);
-            this.radioOutput.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.radioOutput.Location = new System.Drawing.Point(48, 65);
             this.radioOutput.Name = "radioOutput";
-            this.radioOutput.Size = new System.Drawing.Size(105, 22);
+            this.radioOutput.Size = new System.Drawing.Size(88, 19);
             this.radioOutput.TabIndex = 0;
             this.radioOutput.TabStop = true;
             this.radioOutput.Text = "出参映射";
@@ -437,10 +442,9 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnSave
             // 
-            this.btnSave.Location = new System.Drawing.Point(499, 11);
-            this.btnSave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.btnSave.Location = new System.Drawing.Point(444, 9);
             this.btnSave.Name = "btnSave";
-            this.btnSave.Size = new System.Drawing.Size(107, 28);
+            this.btnSave.Size = new System.Drawing.Size(95, 23);
             this.btnSave.TabIndex = 7;
             this.btnSave.Text = "保存映射";
             this.btnSave.UseVisualStyleBackColor = true;
@@ -448,10 +452,9 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnConfig
             // 
-            this.btnConfig.Location = new System.Drawing.Point(408, 11);
-            this.btnConfig.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.btnConfig.Location = new System.Drawing.Point(363, 9);
             this.btnConfig.Name = "btnConfig";
-            this.btnConfig.Size = new System.Drawing.Size(84, 28);
+            this.btnConfig.Size = new System.Drawing.Size(75, 23);
             this.btnConfig.TabIndex = 7;
             this.btnConfig.Text = "加载配置";
             this.btnConfig.UseVisualStyleBackColor = true;
@@ -459,10 +462,10 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnTest
             // 
-            this.btnTest.Location = new System.Drawing.Point(443, 351);
+            this.btnTest.Location = new System.Drawing.Point(394, 292);
             this.btnTest.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnTest.Name = "btnTest";
-            this.btnTest.Size = new System.Drawing.Size(145, 43);
+            this.btnTest.Size = new System.Drawing.Size(129, 36);
             this.btnTest.TabIndex = 2;
             this.btnTest.Text = "测试转换>>";
             this.btnTest.UseVisualStyleBackColor = true;
@@ -470,9 +473,10 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnChange
             // 
-            this.btnChange.Location = new System.Drawing.Point(1104, 16);
+            this.btnChange.Location = new System.Drawing.Point(981, 13);
+            this.btnChange.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.btnChange.Name = "btnChange";
-            this.btnChange.Size = new System.Drawing.Size(75, 23);
+            this.btnChange.Size = new System.Drawing.Size(67, 19);
             this.btnChange.TabIndex = 8;
             this.btnChange.Text = "交换";
             this.btnChange.UseVisualStyleBackColor = true;
@@ -480,32 +484,34 @@ namespace PTMedicalInsurance.Forms
             // 
             // txtLocalName
             // 
-            this.txtLocalName.Location = new System.Drawing.Point(719, 13);
+            this.txtLocalName.Location = new System.Drawing.Point(639, 11);
+            this.txtLocalName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtLocalName.Name = "txtLocalName";
-            this.txtLocalName.Size = new System.Drawing.Size(225, 28);
+            this.txtLocalName.Size = new System.Drawing.Size(200, 25);
             this.txtLocalName.TabIndex = 9;
             this.txtLocalName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtLocalName_KeyDown);
             // 
             // txtBaseName
             // 
-            this.txtBaseName.Location = new System.Drawing.Point(96, 11);
+            this.txtBaseName.Location = new System.Drawing.Point(85, 9);
+            this.txtBaseName.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.txtBaseName.Name = "txtBaseName";
-            this.txtBaseName.Size = new System.Drawing.Size(220, 28);
+            this.txtBaseName.Size = new System.Drawing.Size(196, 25);
             this.txtBaseName.TabIndex = 9;
             this.txtBaseName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtBaseName_KeyDown);
             // 
-            // clearway
+            // ToString
             // 
-            this.clearway.Name = "clearway";
-            this.clearway.Size = new System.Drawing.Size(270, 34);
-            this.clearway.Text = "清算方式";
-            this.clearway.Click += new System.EventHandler(this.clearway_Click);
+            this.ToString.Name = "ToString";
+            this.ToString.Size = new System.Drawing.Size(257, 24);
+            this.ToString.Text = "字符串格式";
+            this.ToString.Click += new System.EventHandler(this.ToString_Click);
             // 
             // JsonMappingForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1400, 737);
+            this.ClientSize = new System.Drawing.Size(1244, 614);
             this.Controls.Add(this.txtBaseName);
             this.Controls.Add(this.txtLocalName);
             this.Controls.Add(this.btnChange);
@@ -587,5 +593,6 @@ namespace PTMedicalInsurance.Forms
         private System.Windows.Forms.ToolStripMenuItem ecToken;
         private System.Windows.Forms.ToolStripMenuItem saveToExpand;
         private System.Windows.Forms.ToolStripMenuItem clearway;
+        private System.Windows.Forms.ToolStripMenuItem ToString;
     }
 }

+ 9 - 0
Forms/JsonMappingForm.cs

@@ -560,5 +560,14 @@ namespace PTMedicalInsurance.Forms
         {
             AddGlobalVar("clearway");
         }
+
+        private void ToString_Click(object sender, EventArgs e)
+        {
+            FieldMapping mapping = QuerySelectedField();
+            if (mapping != null)
+            {
+                mapping.Expression = "ConvertToString";
+            }
+        }
     }
 }

+ 9 - 1
Helper/InvokeHelper.cs

@@ -187,7 +187,15 @@ namespace PTMedicalInsurance.Helper
                 iInt = center.Business(data, ref outputData, ref errMsg);
                 if (iInt == 0 && !string.IsNullOrEmpty(outputData))
                 {
-                    joRtn = JObject.Parse(outputData);
+                    try
+                    {
+                        joRtn = JObject.Parse(outputData);
+                    }
+                    catch (Exception ex)
+                    {
+                        joRtn.Add("infcode", iInt);
+                        joRtn.Add("err_msg", ex.Message);
+                    }
                 }
                 else
                 {

+ 6 - 0
Helper/JsonMapper.cs

@@ -206,6 +206,12 @@ namespace PTMedicalInsurance.Helper
                         continue;
                     }
 
+                    if ((expression ?? "").Equals("ConvertToString"))
+                    {
+                        value = GetExpressionValue(expression,value);
+                        expression = null;
+                    }
+
                     // 普通转换
                     if (value != null)
                     {

+ 3 - 0
Variables/Struct.cs

@@ -253,6 +253,9 @@ namespace PTMedicalInsurance.Variables
         /// </summary>
         public bool enabledDebug;
 
+
+        public bool showJson;
+
         public CurEvtExtend ext;
 
     }

+ 4 - 1
Variables/TradeEnum.cs

@@ -436,8 +436,11 @@ namespace PTMedicalInsurance
         [Trade("query_ys","查询医生",ModeEnum.DLL)]
         DoctorQuery,
 
+        [Trade("query_hosp_dept", "查询科室", ModeEnum.DLL)]
+        DepartmentQuery,
+
         #endregion
-    
+
         /// <summary>
         /// 默认属性,无意义
         /// </summary>