|
@@ -766,52 +766,58 @@ namespace PTMedicalInsurance.Forms
|
|
|
input["ver"] = ver;
|
|
|
|
|
|
// 目录查询
|
|
|
- if (rbgDirecType.SelectedIndex == 15)
|
|
|
+ switch(rbgDirecType.SelectedIndex)
|
|
|
{
|
|
|
- //CallResult cr = download.QueryDepartment();
|
|
|
- //if (cr.Success)
|
|
|
- //{
|
|
|
- // Global.writeLog(cr.Data);
|
|
|
- //}
|
|
|
- }
|
|
|
- // 医保字典数据下载
|
|
|
- else if (rbgDirecType.SelectedIndex == 8)
|
|
|
- {
|
|
|
- if (tbDicDate.Text == "")
|
|
|
- {
|
|
|
- MessageBox.Show("请输入查询日期!");
|
|
|
- return;
|
|
|
- }
|
|
|
- // 支持批量
|
|
|
- string[] dictText = tbDicType.Text.Trim().Split(",".ToCharArray());
|
|
|
- dictText.ToList().ForEach((dict) =>
|
|
|
- {
|
|
|
- this.downloadDict(dict);
|
|
|
- });
|
|
|
- }
|
|
|
- else if (rbgDirecType.SelectedIndex <= 10)
|
|
|
- {
|
|
|
- MedDirDownloadProcess mp = new MedDirDownloadProcess();
|
|
|
- if (rbSingleDown.Checked)
|
|
|
- {
|
|
|
- if (mp.SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
|
|
|
+ case 15:
|
|
|
+ break;
|
|
|
+ case 8: //字典
|
|
|
{
|
|
|
- MessageBox.Show("医保目录下载失败:" + errorMessage);
|
|
|
- return;
|
|
|
+ if (tbDicDate.Text == "")
|
|
|
+ {
|
|
|
+ MessageBox.Show("请输入查询日期!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 支持批量
|
|
|
+ string[] dictText = tbDicType.Text.Trim().Split(",".ToCharArray());
|
|
|
+ dictText.ToList().ForEach((dict) =>
|
|
|
+ {
|
|
|
+ this.downloadDict(dict);
|
|
|
+ });
|
|
|
+ break;
|
|
|
}
|
|
|
- }
|
|
|
- if (rbAutoDown.Checked)
|
|
|
- {
|
|
|
- if (mp.AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
|
|
|
+ case 12:
|
|
|
{
|
|
|
- MessageBox.Show("医保目录下载失败:" + errorMessage);
|
|
|
- return;
|
|
|
+ downloadMedData(TradeEnum.ICPC3AdmReason, ver, uiProcessBar1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 13:
|
|
|
+ {
|
|
|
+ downloadMedData(TradeEnum.ICPC3Treatment, ver, uiProcessBar1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ MedDirDownloadProcess mp = new MedDirDownloadProcess();
|
|
|
+ if (rbSingleDown.Checked)
|
|
|
+ {
|
|
|
+ if (mp.SingleDownload(ver, rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
|
|
|
+ {
|
|
|
+ MessageBox.Show("医保目录下载失败:" + errorMessage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (rbAutoDown.Checked)
|
|
|
+ {
|
|
|
+ if (mp.AutoDownload(rbgDirecType.SelectedIndex, uiProcessBar1, out errorMessage) != 0)
|
|
|
+ {
|
|
|
+ MessageBox.Show("医保目录下载失败:" + errorMessage);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
btnQuery_Click(sender, e);
|
|
|
}
|
|
|
|
|
@@ -838,6 +844,24 @@ namespace PTMedicalInsurance.Forms
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private int downloadMedData(TradeEnum trade,string version,Sunny.UI.UIProcessBar uiProcessBar)
|
|
|
+ {
|
|
|
+ string errorMessage = "";
|
|
|
+ JObject joRtn = cBus.DownDirecotry(trade, version);
|
|
|
+ if (JsonHelper.parseCenterRtnValue(joRtn, out errorMessage) == 0)
|
|
|
+ {
|
|
|
+ //解析
|
|
|
+ DataImoport DI = new DataImoport();
|
|
|
+ JObject joImportRtn = DI.importMedDataToIris(trade,joRtn,uiProcessBar);
|
|
|
+ if (JsonHelper.parseIrisRtnValue(joImportRtn, out errorMessage) == 0)
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MessageBox.Show(errorMessage);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
private void btnQuery_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
#region 校验查询条件
|