|
@@ -39,6 +39,7 @@ public class SiDownloadService {
|
|
|
private static final String RESULT_CODE = "infcode";
|
|
|
private static final String ERROR_MESSAGE = "err_msg";
|
|
|
private static final String OUTPUT = "output";
|
|
|
+ private static final String BEGIN_VERSION = "V00";
|
|
|
private final ExecService exec;
|
|
|
private final SiDownloadDao dnlddao;
|
|
|
private final SiExecSrvc execSrvc;
|
|
@@ -54,36 +55,36 @@ public class SiDownloadService {
|
|
|
public ResultVo<Map<String, Object>> executeDownload(DwnldPrm prm) {
|
|
|
String version = prm.getVersion();
|
|
|
switch (prm.getCode()) {
|
|
|
- case "1301": // TODO: 2022/1/15 版本号从V00开始
|
|
|
- return downloadPatentAndWesternMedicineCatalogue(version);
|
|
|
- case "1302": // TODO: 2022/1/15 版本号从V00开始
|
|
|
- return downloadChineseHerbalCatalogue(version);
|
|
|
- case "1303": // TODO: 2022/1/15 版本号从V00开始
|
|
|
- return downloadInstitutionsPreparationsCatalogue(version);
|
|
|
+ case "1301":
|
|
|
+ return downloadPatentAndWesternMedicineCatalogue();
|
|
|
+ case "1302":
|
|
|
+ return downloadChineseHerbalCatalogue();
|
|
|
+ case "1303":
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "我院没有医院制剂");
|
|
|
case "1304":
|
|
|
return downloadEthnicMedicine(prm);
|
|
|
- case "1305": // TODO: 2022/1/15 版本号从V00开始
|
|
|
- return downloadMedicalServiceItemsCatalogue(version);
|
|
|
- case "1306": // TODO: 2022/1/15 版本号从V00开始
|
|
|
- return downloadMedicalSuppliesCatalogue(version);
|
|
|
+ case "1305":
|
|
|
+ return downloadMedicalServiceItemsCatalogue();
|
|
|
+ case "1306":
|
|
|
+ return downloadMedicalSuppliesCatalogue();
|
|
|
case "1307":
|
|
|
- return downloadDiseasesAndDiagnosisCatalogue(version);
|
|
|
+ return downloadDiseasesAndDiagnosisCatalogue();
|
|
|
case "1308":
|
|
|
- return downloadOperationCatalogue(version);
|
|
|
+ return downloadOperationCatalogue();
|
|
|
case "1309":
|
|
|
- return downloadOutpatientSpecialChronicDiseasesCatalogue(version);
|
|
|
+ return downloadOutpatientSpecialChronicDiseasesCatalogue();
|
|
|
case "1310":
|
|
|
- return downloadPayByDiseaseCatalogue(version);
|
|
|
+ return downloadPayByDiseaseCatalogue();
|
|
|
case "1311":
|
|
|
- return downloadDaytimeSurgeryDiseasesCatalogue(version);
|
|
|
+ return downloadDaytimeSurgeryDiseasesCatalogue();
|
|
|
case "1312":
|
|
|
return downloadMedicalInsuranceCatalogue(prm);
|
|
|
case "1313":
|
|
|
- return downloadTumorMorphologyCatalogue(version);
|
|
|
+ return downloadTumorMorphologyCatalogue();
|
|
|
case "1314":
|
|
|
- return downloadTraditionalChineseDiseasesCatalogue(version);
|
|
|
+ return downloadTraditionalChineseDiseasesCatalogue();
|
|
|
case "1315":
|
|
|
- return downloadTcmSyndromeCatalogue(version);
|
|
|
+ return downloadTcmSyndromeCatalogue();
|
|
|
case "1316":
|
|
|
return downloadMedicalInsuranceMatchCatalogue(prm);
|
|
|
case "1317":
|
|
@@ -184,7 +185,15 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此目录下载的功能号。");
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadPatentAndWesternMedicineCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadPatentAndWesternMedicineCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = dwnldPtntWstnMdcnCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = dwnldPtntWstnMdcnCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> dwnldPtntWstnMdcnCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_PATENT_AND_WESTERN_MEDICINE_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,西药中成药目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -193,6 +202,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -202,11 +212,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncatePtntWstnMdcnTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncatePtntWstnMdcnTable();
|
|
|
+ }
|
|
|
List<SiDlPtntWstnMdcn> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlPtntWstnMdcn(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertPtntWstnMdcnBatch(list);
|
|
|
list.clear();
|
|
@@ -215,12 +230,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertPtntWstnMdcnBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadChineseHerbalCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadChineseHerbalCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldChnsHrblCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldChnsHrblCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldChnsHrblCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_CHINESE_HERBAL_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,中药饮片目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -229,6 +254,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -238,11 +264,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateChnsHblTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateChnsHblTable();
|
|
|
+ }
|
|
|
List<SiDlChnsHbl> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlChnsHbl(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertChnsHblBatch(list);
|
|
|
list.clear();
|
|
@@ -251,23 +282,9 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertChnsHblBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
- }
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
- }
|
|
|
-
|
|
|
- public ResultVo<Map<String, Object>> downloadInstitutionsPreparationsCatalogue(String version) {
|
|
|
- // todo 我院没有医院制剂
|
|
|
- JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_INSTITUTIONS_PREPARATIONS_CATALOGUE, version);
|
|
|
- log.info("【操作员:{}】,医疗机构制剂目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
- if (null == result) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
|
- }
|
|
|
- if (null == result.getInteger(RESULT_CODE)) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
- }
|
|
|
- if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
@@ -284,7 +301,15 @@ public class SiDownloadService {
|
|
|
return getMapResultVo(result);
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadMedicalServiceItemsCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadMedicalServiceItemsCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldMdclSrvcItmsCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldMdclSrvcItmsCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldMdclSrvcItmsCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_MEDICAL_SERVICE_ITEMS_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,医疗服务项目目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -293,6 +318,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -302,25 +328,42 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateMdcnSrvcTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateMdcnSrvcTable();
|
|
|
+ }
|
|
|
List<SiDlMdcnSrvc> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlMdcnSrvc(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
+ log.info("{}", JSONObject.toJSONString(list));
|
|
|
dnlddao.insertMdcnSrvcBatch(list);
|
|
|
list.clear();
|
|
|
}
|
|
|
}
|
|
|
if (list.size() > 0) {
|
|
|
+ log.info("{}", JSONObject.toJSONString(list));
|
|
|
dnlddao.insertMdcnSrvcBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadMedicalSuppliesCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadMedicalSuppliesCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldMdclSpplsCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldMdclSpplsCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldMdclSpplsCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_MEDICAL_SUPPLIES_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,医用耗材目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -338,11 +381,17 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateMdcnSplyTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateMdcnSplyTable();
|
|
|
+ }
|
|
|
List<SiDlMdcnSply> list = new ArrayList<>();
|
|
|
+ String versionName = null;
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlMdcnSply(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertMdcnSplyBatch(list);
|
|
|
list.clear();
|
|
@@ -351,12 +400,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertMdcnSplyBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadDiseasesAndDiagnosisCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadDiseasesAndDiagnosisCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldDssDgnssCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldDssDgnssCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldDssDgnssCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_DISEASES_AND_DIAGNOSIS_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,疾病与诊断目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -365,6 +424,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -374,12 +434,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateDssDnsTable();
|
|
|
- log.info("疾病与诊断目录解析完成,共 {} 条,入库中...", queue.size());
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateDssDnsTable();
|
|
|
+ }
|
|
|
List<SiDlDssDns> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlDssDns(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertDssDnsBatch(list);
|
|
|
list.clear();
|
|
@@ -388,12 +452,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertDssDnsBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadOperationCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadOperationCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldOprtnCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldOprtnCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldOprtnCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_OPERATION_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,手术操作目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -402,6 +476,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -411,7 +486,9 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateOprtnTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateOprtnTable();
|
|
|
+ }
|
|
|
List<SiDlOprtn> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
@@ -420,6 +497,9 @@ public class SiDownloadService {
|
|
|
continue;
|
|
|
}
|
|
|
list.add(new SiDlOprtn(arr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertOprtnBatch(list);
|
|
|
list.clear();
|
|
@@ -428,12 +508,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertOprtnBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadOutpatientSpecialChronicDiseasesCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadOutpatientSpecialChronicDiseasesCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldOutptntSpclChrncDssCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldOutptntSpclChrncDssCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldOutptntSpclChrncDssCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_OUTPATIENT_SPECIAL_CHRONIC_DISEASES_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,门诊慢特病种目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -442,6 +532,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -451,11 +542,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateSlwSpcChrTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateSlwSpcChrTable();
|
|
|
+ }
|
|
|
List<SiDlSlwSpcChr> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlSlwSpcChr(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertSlwSpcChrBatch(list);
|
|
|
list.clear();
|
|
@@ -464,12 +560,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertSlwSpcChrBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadPayByDiseaseCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadPayByDiseaseCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldPayByDssCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldPayByDssCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldPayByDssCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_PAY_BY_DISEASE_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,按病种付费病种目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -478,6 +584,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -487,11 +594,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncatePayByDssTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncatePayByDssTable();
|
|
|
+ }
|
|
|
List<SiDlPayByDss> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlPayByDss(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertPayByDssBatch(list);
|
|
|
list.clear();
|
|
@@ -500,12 +612,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertPayByDssBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadDaytimeSurgeryDiseasesCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadDaytimeSurgeryDiseasesCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldDytmSrgryDssCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldDytmSrgryDssCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldDytmSrgryDssCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_DAYTIME_SURGERY_DISEASES_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,日间手术治疗病种目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -514,6 +636,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -523,11 +646,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateDytmSrgyDssTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateDytmSrgyDssTable();
|
|
|
+ }
|
|
|
List<SiDlDytmSrgyDss> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlDytmSrgyDss(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertDytmSrgyDssBatch(list);
|
|
|
list.clear();
|
|
@@ -536,7 +664,9 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertDytmSrgyDssBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
@@ -570,7 +700,15 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadTumorMorphologyCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadTumorMorphologyCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldTmrMrphlgyCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldTmrMrphlgyCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldTmrMrphlgyCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_TUMOR_MORPHOLOGY_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,肿瘤形态学目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -579,6 +717,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -588,11 +727,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateTmrMrphlgyTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateTmrMrphlgyTable();
|
|
|
+ }
|
|
|
List<SiDlTmrMrphlgy> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlTmrMrphlgy(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertTmrMrphlgyBatch(list);
|
|
|
list.clear();
|
|
@@ -601,12 +745,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertTmrMrphlgyBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadTraditionalChineseDiseasesCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadTraditionalChineseDiseasesCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldTrdtnlChnDssCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldTrdtnlChnDssCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldTrdtnlChnDssCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_TRADITIONAL_CHINESE_DISEASES_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,中医疾病目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -615,6 +769,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -624,11 +779,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateTrdtnlChnsDssTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateTrdtnlChnsDssTable();
|
|
|
+ }
|
|
|
List<SiDlTrdtnlChnsDss> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlTrdtnlChnsDss(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertTrdtnlChnsDssBatch(list);
|
|
|
list.clear();
|
|
@@ -637,12 +797,22 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertTrdtnlChnsDssBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|
|
|
|
|
|
- public ResultVo<Map<String, Object>> downloadTcmSyndromeCatalogue(String version) {
|
|
|
+ public ResultVo<Map<String, Object>> downloadTcmSyndromeCatalogue() {
|
|
|
+ ResultVo<String> dwnldrslt = execDwnldTcmSyndrmCtlg(BEGIN_VERSION);
|
|
|
+ while (dwnldrslt.getCode() == ExceptionEnum.SUCCESS.getCode()) {
|
|
|
+ dwnldrslt = execDwnldTcmSyndrmCtlg(dwnldrslt.getData());
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<String> execDwnldTcmSyndrmCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_TCM_SYNDROME_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,中医证候目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|
|
|
if (null == result) {
|
|
@@ -651,6 +821,7 @@ public class SiDownloadService {
|
|
|
if (null == result.getInteger(RESULT_CODE)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
|
|
|
}
|
|
|
+ String versionName = null;
|
|
|
if (result.getIntValue(RESULT_CODE) == 0) {
|
|
|
JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
String fileQuryNo = output.getString("file_qury_no");
|
|
@@ -660,11 +831,16 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
}
|
|
|
Queue<String> queue = SiUtil.readTxtFile(filePath);
|
|
|
- dnlddao.truncateTcmSyndrTable();
|
|
|
+ if (version.equals(BEGIN_VERSION)) {
|
|
|
+ dnlddao.truncateTcmSyndrTable();
|
|
|
+ }
|
|
|
List<SiDlTcmSyndr> list = new ArrayList<>();
|
|
|
while (!queue.isEmpty()) {
|
|
|
String tempstr = queue.poll();
|
|
|
list.add(new SiDlTcmSyndr(tempstr));
|
|
|
+ if (null == versionName) {
|
|
|
+ versionName = list.get(0).getVersionName();
|
|
|
+ }
|
|
|
if (list.size() == 20) {
|
|
|
dnlddao.insertTcmSyndrBatch(list);
|
|
|
list.clear();
|
|
@@ -673,7 +849,9 @@ public class SiDownloadService {
|
|
|
if (list.size() > 0) {
|
|
|
dnlddao.insertTcmSyndrBatch(list);
|
|
|
}
|
|
|
- return ResultVoUtil.success();
|
|
|
+ if (StringUtil.notBlank(versionName)) {
|
|
|
+ return ResultVoUtil.success(versionName);
|
|
|
+ }
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
}
|