|
@@ -60,7 +60,7 @@ public class SiDownloadService {
|
|
|
case "1302":
|
|
|
return downloadChineseHerbalCatalogue();
|
|
|
case "1303":
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "我院没有医院制剂");
|
|
|
+ return downloadHospitalDosage();
|
|
|
case "1304":
|
|
|
return downloadEthnicMedicine(prm);
|
|
|
case "1305":
|
|
@@ -245,6 +245,31 @@ public class SiDownloadService {
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<Map<String, Object>> downloadHospitalDosage() {
|
|
|
+ JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_INSTITUTIONS_PREPARATIONS_CATALOGUE, BEGIN_VERSION);
|
|
|
+ log.info("【操作员:{}】,医院制剂目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), BEGIN_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) {
|
|
|
+ JSONObject output = result.getJSONObject(OUTPUT);
|
|
|
+ String fileQuryNo = output.getString("file_qury_no");
|
|
|
+ String filename = output.getString("filename");
|
|
|
+ String filePath = downloadFile(fileQuryNo, filename);
|
|
|
+ if (null == filePath) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR, "网络异常,下载失败!");
|
|
|
+ }
|
|
|
+ Map<String, Object> obj = new HashMap<>();
|
|
|
+ obj.put("message", "下载成功");
|
|
|
+ obj.put("path", filePath);
|
|
|
+ return ResultVoUtil.success(obj);
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
|
|
|
+ }
|
|
|
+
|
|
|
public ResultVo<String> execDwnldChnsHrblCtlg(String version) {
|
|
|
JSONObject result = getOrdinaryDownloadResult(SiFunction.DOWNLOAD_CHINESE_HERBAL_CATALOGUE, version);
|
|
|
log.info("【操作员:{}】,中药饮片目录下载:版本号:{},结果:{}", TokenUtil.getTokenUserId(), version, result);
|