Przeglądaj źródła

fix:单条目录维护界面初始化时,增加grdSetterBase.SetCombox方法的异常展示。当查询字典返回结果为空时,会提示找不到绑定的字段。

zhanfei 2 miesięcy temu
rodzic
commit
8cd556e863

+ 10 - 3
FormSetter/GridViewSetterBase.cs

@@ -100,9 +100,16 @@ namespace PTMedicalInsurance.FormSetter
 
         public void SetCombox(ref System.Windows.Forms.ComboBox cbx, string sqlStr, string displayMember = "Name", string valueMember = "Code")
         {
-            cbx.DataSource = GetDBLKComboxTable(sqlStr);
-            cbx.DisplayMember = displayMember;
-            cbx.ValueMember = valueMember;
+            try
+            {
+                cbx.DataSource = GetDBLKComboxTable(sqlStr);
+                cbx.DisplayMember = displayMember;
+                cbx.ValueMember = valueMember;
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show($"SetCombox控件{cbx.Name}设置异常:{ex.Message}");
+            }
         }
     }
 }

+ 17 - 15
Forms/BasicDatas/DataDownload.Designer.cs

@@ -63,6 +63,7 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.label5 = new System.Windows.Forms.Label();
             this.tbCode = new System.Windows.Forms.TextBox();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.btnGetMaxVersion = new System.Windows.Forms.Button();
             this.rbLoopDownload = new System.Windows.Forms.RadioButton();
             this.rbSingleDownload = new System.Windows.Forms.RadioButton();
             this.label1 = new System.Windows.Forms.Label();
@@ -91,7 +92,6 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.rbDrug = new System.Windows.Forms.RadioButton();
             this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components);
             this.helpProvider1 = new System.Windows.Forms.HelpProvider();
-            this.btnGetMaxVersion = new System.Windows.Forms.Button();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dgvDirectory)).BeginInit();
             this.panel2.SuspendLayout();
@@ -284,6 +284,7 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.btModify.TabIndex = 33;
             this.btModify.Text = "修改";
             this.btModify.UseVisualStyleBackColor = true;
+            this.btModify.Click += new System.EventHandler(this.btModify_Click);
             // 
             // btAdd
             // 
@@ -295,6 +296,7 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.btAdd.TabIndex = 32;
             this.btAdd.Text = "新增";
             this.btAdd.UseVisualStyleBackColor = false;
+            this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
             // 
             // btDownload
             // 
@@ -456,12 +458,24 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "下载条件";
             // 
+            // btnGetMaxVersion
+            // 
+            this.btnGetMaxVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnGetMaxVersion.Location = new System.Drawing.Point(9, 52);
+            this.btnGetMaxVersion.Name = "btnGetMaxVersion";
+            this.btnGetMaxVersion.Size = new System.Drawing.Size(170, 22);
+            this.btnGetMaxVersion.TabIndex = 43;
+            this.btnGetMaxVersion.Text = "获取最大版本号";
+            this.btnGetMaxVersion.UseVisualStyleBackColor = true;
+            this.btnGetMaxVersion.Click += new System.EventHandler(this.btnGetMaxVersion_Click);
+            // 
             // rbLoopDownload
             // 
             this.rbLoopDownload.AutoSize = true;
             this.rbLoopDownload.Location = new System.Drawing.Point(19, 125);
             this.rbLoopDownload.Name = "rbLoopDownload";
-            this.rbLoopDownload.Size = new System.Drawing.Size(57, 13);
+            this.rbLoopDownload.Size = new System.Drawing.Size(85, 20);
             this.rbLoopDownload.TabIndex = 42;
             this.rbLoopDownload.TabStop = true;
             this.rbLoopDownload.Text = "循环下载";
@@ -472,7 +486,7 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             this.rbSingleDownload.AutoSize = true;
             this.rbSingleDownload.Location = new System.Drawing.Point(19, 90);
             this.rbSingleDownload.Name = "rbSingleDownload";
-            this.rbSingleDownload.Size = new System.Drawing.Size(67, 13);
+            this.rbSingleDownload.Size = new System.Drawing.Size(100, 20);
             this.rbSingleDownload.TabIndex = 41;
             this.rbSingleDownload.TabStop = true;
             this.rbSingleDownload.Text = "单版本下载";
@@ -782,18 +796,6 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             // 
             this.errorProvider1.ContainerControl = this;
             // 
-            // btnGetMaxVersion
-            // 
-            this.btnGetMaxVersion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnGetMaxVersion.Location = new System.Drawing.Point(9, 52);
-            this.btnGetMaxVersion.Name = "btnGetMaxVersion";
-            this.btnGetMaxVersion.Size = new System.Drawing.Size(170, 22);
-            this.btnGetMaxVersion.TabIndex = 43;
-            this.btnGetMaxVersion.Text = "获取最大版本号";
-            this.btnGetMaxVersion.UseVisualStyleBackColor = true;
-            this.btnGetMaxVersion.Click += new System.EventHandler(this.btnGetMaxVersion_Click);
-            // 
             // DataDownload
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 51 - 3
Forms/BasicDatas/DataDownload.cs

@@ -22,6 +22,7 @@ namespace PTMedicalInsurance.Forms.BasicDatas
         private DirectroyQueryService queryService = new DirectroyQueryService();
         private DirectoryDownloadService downloadService = new DirectoryDownloadService();
         private DirectoryManualMaintainService maintainService = new DirectoryManualMaintainService();
+        private HandMaintainedDirectoryService handMaintainService = new HandMaintainedDirectoryService();
         private MIIrisServices mIS = new MIIrisServices();
         private GridViewSetter gvdSetter = new GridViewSetter();
         private DataTable dtDir = new DataTable();
@@ -619,16 +620,39 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             {
                 return -1;
             }
-            JObject input = new JObject();
             if (rbDictionary.Checked)
             {
+
                 //// 支持批量
                 //string[] dictText = tbCode.Text.Trim().Split(",".ToCharArray());
                 //dictText.ToList().ForEach((dict) =>
                 //{
-                //     downloadService.DownloadDictionary(input, dict, out errMsg);
+                //    dynamic joData = new JObject();
+                //    joData.type = dict;   //字典类型
+                //    joData.parentValue = "";        //父字典键值 
+                //    joData.admdvs = Global.inf.areaCode;        //行政区划  就医地
+                //    joData.date = tbUpdateTime.Text;  //查询日期 
+                //    joData.vali_flag = "1";   //有效标志 
+                //    return downloadService.DownloadDictionary(input, "", out errMsg);
                 //});
-                return downloadService.DownloadDictionary(input, "", out errMsg);
+
+                dynamic joData = new JObject();
+                joData.type = tbCode.Text;   //字典类型
+                joData.parentValue = "";        //父字典键值 
+                joData.admdvs = Global.inf.areaCode;        //行政区划  就医地
+                joData.date = tbUpdateTime.Text;  //查询日期 
+                joData.vali_flag = "1";   //有效标志 
+                if (downloadService.DownloadDictionary(joData, tbCode.Text, out errMsg) == 0)
+                {
+                    MessageBox.Show($"{tbCode.Text}下载成功!");
+                    return 0;
+                }
+                else
+                {
+                    MessageBox.Show($"{tbCode.Text}下载失败!{errMsg}");
+                    return -1;  
+                }
+
             }
             else
             {
@@ -693,5 +717,29 @@ namespace PTMedicalInsurance.Forms.BasicDatas
             string ver = joMaxVerNO["result"]["MaxVersionNO"].ToString();
             tbVersionNO.Text = ver;
         }
+
+        private void btModify_Click(object sender, EventArgs e)
+        {
+            if (handMaintainService.Update(directoryType, dgvDirectory, out errMsg) != 0)
+            {
+                MessageBox.Show(errMsg);
+            }
+            else
+            {
+                MessageBox.Show("修改成功!");
+            }
+        }
+
+        private void btAdd_Click(object sender, EventArgs e)
+        {
+            if (handMaintainService.Add(directoryType, out errMsg) != 0)
+            {
+                MessageBox.Show(errMsg);
+            }
+            else
+            {
+                MessageBox.Show("新增成功!");
+            }
+        }
     }
 }

+ 2 - 3
Forms/BasicDatas/DirectoryMap.cs

@@ -781,12 +781,11 @@ namespace PTMedicalInsurance.Forms.BasicDatas
 
         private void SingleUpdateInsuInfo(int index, UpdateInsuInfoHandler handler)
         {
-            if ((dgvHISDirectory.CurrentRow == null) || (rbMaped.Checked != true))
+            if (dgvHISDirectory.CurrentRow == null)
             {
-                MessageBox.Show("请查询HIS目录对照关系,注意选择已对照!");
+                MessageBox.Show("请查询HIS目录对照关系!");
                 return;
             }
-
             int iMapped = dgvHISDirectory.CurrentRow.Index;
 
             string insuCode = dgvHISDirectory.Rows[iMapped].Cells["insuCode"].Value.ToString();

+ 181 - 0
Forms/BasicDatas/services/HandMaintainedDirectoryService.cs

@@ -0,0 +1,181 @@
+using Newtonsoft.Json.Linq;
+using PTMedicalInsurance.Business;
+using PTMedicalInsurance.Helper;
+using Sunny.UI.Win32;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace PTMedicalInsurance.Forms.BasicDatas.services
+{
+    /// <summary>
+    /// 手工维护目录服务类
+    /// 提供新增,修改等目录操作
+    /// </summary>
+    class HandMaintainedDirectoryService
+    {
+        MIIrisServices mIS = new MIIrisServices();
+        public int Add(DirectoryTypeEnum category, out string errMsg)
+        {
+            if ((int)category > 9)
+            {
+                errMsg = "当前类别不支持新增!";
+                return -1;
+            }
+
+            if ((int)category == 9)
+            {
+                AddSingleDictionary addDictionary = new AddSingleDictionary();
+                if (addDictionary.ShowDialog() == DialogResult.OK)
+                {
+                    if (UpdateDictionaryBySelf(addDictionary, out errMsg) != 0)
+                    {
+                        return -1;
+                    }
+                    else
+                    {
+                        return 0;
+                    }
+                }
+                else
+                {
+                    errMsg = "取消操作";
+                    return -1;
+                }
+            }
+            else
+            {
+                AddSingleDirectory addDirectory = new AddSingleDirectory((int)category - 1);
+                addDirectory.StartPosition = FormStartPosition.CenterParent;
+                if (addDirectory.ShowDialog() == DialogResult.OK)
+                {
+                    JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
+                    return JsonHelper.parseIrisRtnValue(joRtn, out errMsg);
+                }
+                else
+                {
+                    errMsg = "取消目录新增操作!";
+                    return -1;
+                }
+            } 
+        }
+
+        public int Update(DirectoryTypeEnum category, DataGridView dgvDirectoy, out string errMsg)
+        {
+            if ((int)category > 9)
+            {
+                errMsg = "当前类别不支持修改!";
+                return -1;
+            }
+            DataTable dt = (DataTable)dgvDirectoy.DataSource;
+            if ((dt == null) || (dt.Rows.Count < 1))
+            {
+                errMsg = "表中无数据,请检查!";
+                return -1;
+            }
+            DataRow dr = dt.Rows[dgvDirectoy.CurrentRow.Index];
+
+            if ((int)category == 9)
+            {
+                AddSingleDictionary addDictionary = new AddSingleDictionary(dr);
+                if (addDictionary.ShowDialog() == DialogResult.OK)
+                {
+                    if (UpdateDictionaryBySelf(addDictionary, out errMsg) != 0)
+                    {
+                        return -1;
+                    }
+                    else
+                    {
+                        return 0;
+                    }
+                }
+                else
+                {
+                    errMsg = "取消操作";
+                    return -1;
+                }
+            }
+            else
+            {
+                AddSingleDirectory addDirectory = new AddSingleDirectory((int)category - 1, dr);
+                addDirectory.StartPosition = FormStartPosition.CenterParent;
+                if (addDirectory.ShowDialog() == DialogResult.OK)
+                {
+
+                    JObject joRtn = mIS.UpdateDirectoryBySelf(addDirectory.joPamam);
+                    return JsonHelper.parseIrisRtnValue(joRtn, out errMsg);
+                }
+                else
+                {
+                    errMsg = "取消目录修改操作!";
+                    return -1;
+                }
+            }  
+        }
+
+        public int UpdateDictionaryBySelf(AddSingleDictionary addDic, out string errMsg)
+        {
+            string outParam = "", HBDictionaryDr = "";
+            JObject joRtn;
+            JObject jo = addDic.joPamam;
+            try
+            {
+                //if (JsonHelper.getDestValue(jo, "operateType") == "0")
+                //{
+                //插入并获取字典主表的DR
+                JObject joDic = JObject.FromObject(jo["dicObj"]);
+                joRtn = mIS.insertDictionary(joDic);
+                if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
+                {
+                    return -1;
+                }
+                else
+                {
+                    HBDictionaryDr = JsonHelper.getDestValue(joRtn, "data.HBDictionaryDr");
+                    if (HBDictionaryDr == "")
+                    {
+                        errMsg = "HBDictionaryDr返回值为空";
+                        return -1;
+                    }
+                }
+                //}
+                //else
+                //{
+                //    if (addDic.dr != null)
+                //    {
+                //        HBDictionaryDr = addDic.dr["hBDictionaryID"].ToString();
+                //    }
+                //    else
+                //    {
+                //        errMsg = "修改状态下未获得字典主表ID!请联系管理员";
+                //        return -1;
+                //    }
+                //}
+
+                //插入明细表
+                JObject joDicDetail = JObject.FromObject(jo["detailObj"]);
+                joDicDetail.Add("HBDictionaryDr", HBDictionaryDr);
+                JArray jaParams = new JArray();
+                jaParams.Add(joDicDetail);
+                joRtn = mIS.insertDictionaryDataDetail(jaParams);
+                if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
+                {
+                    return -1;
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            catch (Exception ex)
+            {
+                errMsg = ex.Message;
+                return -1;
+            }
+        }
+    }
+}

+ 1 - 1
NanChangMI.csproj

@@ -364,6 +364,7 @@
     <Compile Include="Forms\BasicDatas\services\DirectoryMapService.cs" />
     <Compile Include="Forms\BasicDatas\services\DirectoryTypeEnum.cs" />
     <Compile Include="Forms\BasicDatas\services\DirectroyQueryService.cs" />
+    <Compile Include="Forms\BasicDatas\services\HandMaintainedDirectoryService.cs" />
     <Compile Include="Forms\BasicDatas\UpdateDirecotryCondition.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -732,7 +733,6 @@
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
-    <None Include="Readme.md" />
   </ItemGroup>
   <ItemGroup>
     <COMReference Include="stdole">

+ 1 - 1
Properties/AssemblyInfo.cs

@@ -33,4 +33,4 @@ using System.Runtime.InteropServices;
 //通过使用 "*",如下所示:
 // [assembly: AssemblyVersion("1.0.*")]
 [assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.1")]
+[assembly: AssemblyFileVersion("1.0.0.3")]

+ 38 - 31
Readme_南昌基线版.md

@@ -1,31 +1,38 @@
-## 医保业务DLL库使用说明:
-  该项目遵循以下原则:
-
-  1. Master为空项目,仅保留说明文件,便于其他新分支的建立
-
-  2. 按市+医保类型建立代码分支,如“安徽基线版”,分支名为:AnHui_Base,医保类型包括:Base(基线版)、工伤(Injury)、异地(Offsite)、其它(Other),如果没有可适当增加
-
-  3. 每个分支下存放每个省的业务逻辑代码项目,项目名应遵循与分支名保持一致,如AnHui_Base
-
-  4. 每个分支的根目录应保留本Readme.md文档,同时应将各个分支的特殊业务场景或版本更新日志放到此文档
-
-  5. 使用手册见文档:https://dqqslxaq2y.feishu.cn/docx/VxZhdSrFDonnwTxxTPZctr7onSb?from=from_copylink
- 
-
-## 业务分支说明(分支特性,请做相应调整)
- 名称:重庆医保
-	接口开发:东软
-	上线范围:结算(社保、身份证、电子医保卡)、进销存、事前事中、Lis项目、清单上传
-
-### 版本特性:
-  - 住院结算,默认不采用个人账户支付(结算界面默认不选中)
-
-  - 本地和异地结算单打印样式不同
-
-  - 对码界面增加了“价格”显示
-
-  - 只有省外异地(直辖市)
-
-  版本 1.0.0.1
-	对账界面增加 “过滤总金额与现金支付相等的数据” 
-  
+# 医保业务DLL库使用说明
+
+该项目遵循以下原则:
+
+1. **Master分支**:为空项目,仅保留说明文件,便于其他新分支的建立。
+2. **分支命名规则**:按市+医保类型建立代码分支,如“安徽基线版”,分支名为:AnHui_Base。医保类型包括:Base(基线版)、工伤(Injury)、异地(Offsite)、其它(Other)。可以根据需要适当增加新的医保类型。
+3. **项目命名规则**:每个分支下存放每个省的业务逻辑代码项目,项目名应与分支名保持一致,例如AnHui_Base。
+4. **文档维护**:每个分支的根目录应保留本Readme.md文档,并且将各个分支的特殊业务场景或版本更新日志放置在此文档中。
+5. **使用手册**:详细的手册见文档[这里](https://dqqslxaq2y.feishu.cn/docx/VxZhdSrFDonnwTxxTPZctr7onSb?from=from_copylink)。
+
+## Git提交说明
+	init:初始化,
+	fix:bug修复,
+	feat:增加特性(功能),
+	perf:优化,
+	chroe:代码重构
+	merge: 合并
+	revert:回滚
+
+## 业务分支说明
+
+### 名称:重庆医保
+
+- **接口开发**:东软
+- **上线范围**:结算(社保、身份证、电子医保卡)、进销存、事前事中、Lis项目、清单上传
+
+### 版本特性
+
+#### 版本 1.0.0.2  
+- **时间**:2025年10月21日
+- **改进点**:
+  - **性能优化**:优化单条目录维护,新增目录类别,最小包装数量等属性的维护。
+  - **界面优化**:优化事前事中反馈界面,去除保存按钮,增加确定后安全性检查功能。
+	-
+#### 版本 1.0.0.3 
+- **时间**:2025年10月21日
+- **改进点**:
+  - **Bug修复**:单条目录维护界面初始化时,增加grdSetterBase.SetCombox方法的异常展示。当查询字典返回结果为空时,会提示找不到绑定的字段。