lighter 3 rokov pred
rodič
commit
0af6137ca6

+ 0 - 6
src/main/java/thyyxxk/webserver/controller/nationalmatch/NationalMatchController.java

@@ -2,7 +2,6 @@ package thyyxxk.webserver.controller.nationalmatch;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.nationalmatch.QueryParam;
 import thyyxxk.webserver.entity.nationalmatch.StandardLocalItem;
@@ -56,9 +55,4 @@ public class NationalMatchController {
         return service.updateLocalItem(param);
     }
 
-    @PassToken
-    @GetMapping("/dealMisMatchedItems")
-    public ResultVo<String> dealMisMatchedItems() {
-        return service.dealMisMatchedItems();
-    }
 }

+ 13 - 57
src/main/java/thyyxxk/webserver/dao/his/nationalmatch/NationalMatchDao.java

@@ -80,22 +80,26 @@ public interface NationalMatchDao {
     @Update("update zd_charge_item set new_name=name where new_name is null")
     void asyncNewNameForServices();
 
-    @Select("select * from si_central_medicine where national_name=#{name} and approval_number like #{approve}")
+    @Select("select code as nationalCode,drug_trade_name as nationalName,drug_dosage_forms as actualDosage, " +
+            "specifications=(drug_specifications+' x'+minimum_packing_quantity+minimum_preparation_unit+'/'+minimum_packing_unit), " +
+            "packaging_material as packingMaterial,production_name as factory,license_number as approvalNumber, " +
+            "drug_supervision_local_code as drugStandardCode from t_si_dl_ptnt_wstn_mdcn " +
+            "where drug_trade_name=#{name} and license_number like #{approve}")
     List<SiCentralMedicine> selectNationalMedicines(@Param("name") String name,
                                                     @Param("approve") String approve);
 
-    @Select("select national_code,national_name,mlms_name as medicinalMaterialsName, " +
-            "efcc_atc as efficacyClass,psdg_mtd as medicinalMaterialsFamily, " +
-            "mlms_cat_souc as medicinalMaterialsSpecies,medicinal_parts,properties, " +
-            "usage_dosage,pocily_type as siPolicy " +
-            "from si_central_herbal_new where national_name like #{name}")
+    @Select("select code as nationalCode,monoo_name as nationalName,start_time,end_time " +
+            "from t_si_dl_chns_hbl where monoo_name like #{name}")
     List<SiCentralHerbal> selectNationalHerbals(@Param("name") String name);
 
-    @Select("select *,isnull(project_connotation,'') as projectConnotation from si_central_services where national_name=#{name} " +
-            "or local_medical_service_name like #{name}")
+    @Select("select code as nationalCode,service_name as nationalName,isnull(connotation,'') as projectConnotation, " +
+            "exclude_content as exclusions,charge_unit as valuationUnit,entry_specification as projectDescription, " +
+            "start_date,end_date from t_si_dl_mdcn_srvc where service_name like #{name}")
     List<SiCentralServices> selectNationalServices(@Param("name") String name);
 
-    @Select("select * from si_central_supplies_mini where national_name like #{name}")
+    @Select("select code as nationalCode,supplies_name as nationalName,si_universal_name as siName, " +
+            "consumable_material as material,isnull(production_name,'') as factory,start_time,end_time " +
+            "from t_si_dl_mdcn_sply where supplies_name like #{name} or si_universal_name like #{name}")
     List<SiCentralSuppliesMini> selectNationalSupplies(@Param("name") String name);
 
     @Update("update yp_zd_dict set national_status=1,national_code=#{nationalCode}," +
@@ -149,52 +153,4 @@ public interface NationalMatchDao {
                       @Param("specification") String specification,
                       @Param("code") String code);
 
-
-
-    @Select("select a.code,a.serial,a.new_name as name," +
-            "a.national_code,a.national_name,a.uploaded_flag, " +
-            "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
-            "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
-            "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
-            "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
-            "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=0 " +
-            "and isnull(del_flag,0)=0 group by code) b,yp_base c " +
-            "where isnull(national_status,0)=1 and a.code=b.code and a.serial=b.serial " +
-            "and c.group_no=11 and a.code=c.charge_code and a.drug_kind in " +
-            "(select code from yp_zd_drug_kind where yp_type in (1,2)) ")
-    List<StandardLocalItem> selectAllLocalMedicines();
-
-    @Select("select a.code,a.serial,a.new_name as name," +
-            "a.national_code,a.national_name,a.uploaded_flag, " +
-            "unit=(select name from yp_zd_unit where yp_zd_unit.code=a.dosage_unit), " +
-            "dosage=(select name from yp_zd_dosage where yp_zd_dosage.code=a.dosage), " +
-            "ltrim(a.specification) as specification,rtrim(a.pzwh) as approvalNumber, " +
-            "factory=(select name from yp_zd_manufactory where yp_zd_manufactory.code=a.manu_code) " +
-            "from yp_zd_dict a, (select max(serial) as serial,code from yp_zd_dict where isnull(visible_flag,0)=0 " +
-            "and isnull(del_flag,0)=0 group by code) b,yp_base c " +
-            "where isnull(national_status,0)=1 and a.code=b.code and a.serial=b.serial " +
-            "and c.group_no=22 and a.code=c.charge_code and a.drug_kind in ('0007','0003') ")
-    List<StandardLocalItem> selectAllLocalHerbals();
-
-    @Select("select code,new_name as name,charge_unit as unit,discription,specification," +
-            "national_code,uploaded_flag,national_name,yb_comment as factory from zd_charge_item " +
-            "where isnull(national_status,0)=1 and isnull(del_flag,0)=0 and class_code='J' ")
-    List<StandardLocalItem> selectAllLocalSupplies();
-
-    @Select("select code,new_name as name,charge_unit as unit, discription,specification,uploaded_flag," +
-            "national_code,national_name,s_code as standardCode, charge_amount as price from zd_charge_item " +
-            "where isnull(national_status,0)=1 and isnull(del_flag,0)=0 and class_code!='J'")
-    List<StandardLocalItem> selectAllLocalServices();
-
-    @Select("select * from si_central_medicine where national_code=#{code}")
-    List<SiCentralMedicine> selectNationalMedicinesByCode(@Param("code") String code);
-
-    @Select("select * from si_central_herbal_new where national_code=#{code}")
-    List<SiCentralHerbal> selectNationalHerbalsByCode(@Param("code") String code);
-
-    @Select("select * from si_central_services where national_code=#{code}")
-    List<SiCentralServices> selectNationalServicesByCode(@Param("code") String code);
-
-    @Select("select * from si_central_supplies_mini where national_code=#{code}")
-    List<SiCentralSuppliesMini> selectNationalSuppliesByCode(@Param("code") String code);
 }

+ 1 - 4
src/main/java/thyyxxk/webserver/entity/medicalinsurance/download/SiDlTcmSyndr.java

@@ -104,10 +104,7 @@ public class SiDlTcmSyndr implements Serializable {
 		dataCreationTime = arr[10];
 		dataUpdateTime = arr[11];
 		if (arr.length > 12) {
-			version = arr[12];
-		}
-		if (arr.length > 13) {
-			versionName = arr[13];
+			versionName = arr[12];
 		}
 	}
 }

+ 3 - 18
src/main/java/thyyxxk/webserver/entity/nationalmatch/SiCentralHerbal.java

@@ -1,31 +1,16 @@
 package thyyxxk.webserver.entity.nationalmatch;
 
-import java.io.Serializable;
 import lombok.Data;
 
 @Data
-public class SiCentralHerbal  implements Serializable {
-
-	private static final long serialVersionUID =  7501324178638823432L;
+public class SiCentralHerbal {
 
 	private String nationalCode;
 
 	private String nationalName;
 
-	private String medicinalMaterialsName;
-
-	private String efficacyClass;
-
-	private String medicinalMaterialsFamily;
-
-	private String medicinalMaterialsSpecies;
-
-	private String medicinalParts;
-
-	private String properties;
-
-	private String usageDosage;
+	private String startTime;
 
-	private String siPolicy;
+	private String endTime;
 
 }

+ 2 - 136
src/main/java/thyyxxk/webserver/entity/nationalmatch/SiCentralMedicine.java

@@ -1,157 +1,23 @@
 package thyyxxk.webserver.entity.nationalmatch;
 
-import java.io.Serializable;
-
 import lombok.Data;
 
 @Data
-public class SiCentralMedicine implements Serializable {
-
-    private static final long serialVersionUID = 1731317857334895794L;
+public class SiCentralMedicine {
 
-    /**
-     * medicineCode
-     */
     private String nationalCode;
 
-    /**
-     * registeredName
-     */
     private String nationalName;
 
-    /**
-     * goodsName
-     */
-    private String goodsName;
-
-    /**
-     * registeredDosage
-     */
-    private String registeredDosage;
-
-    /**
-     * actualDosage
-     */
     private String actualDosage;
 
-    /**
-     * registeredSpecifications
-     */
-    private String registeredSpecifications;
-
-    /**
-     * actualSpecifications
-     */
-    private String actualSpecifications;
+    private String specifications;
 
-    /**
-     * packingMaterial
-     */
     private String packingMaterial;
 
-    /**
-     * minPackageNum
-     */
-    private Double minPackageNum;
-
-    /**
-     * minPackageUnit
-     */
-    private String minPackageUnit;
-
-    /**
-     * minPreparationUnit
-     */
-    private String minPreparationUnit;
-
-    /**
-     * pharmaceuticalEnterprises
-     */
     private String factory;
 
-    /**
-     * approvalNumber
-     */
     private String approvalNumber;
 
-    /**
-     * drugStandardCode
-     */
     private Double drugStandardCode;
-
-    /**
-     * subPackagingEnterprises
-     */
-    private String subPackagingEnterprises;
-
-    /**
-     * listStatus
-     */
-    private String listStatus;
-
-    /**
-     * siDrugName
-     */
-    private String siDrugName;
-
-    /**
-     * classIn2020
-     */
-    private String classIn2020;
-
-    /**
-     * siDosage
-     */
-    private String siDosage;
-
-    /**
-     * serialNo
-     */
-    private String serialNo;
-
-    /**
-     * remark
-     */
-    private String remark;
-
-    /**
-     * outpatientSelfPayPercentage
-     */
-    private Double outpatientSelfPayPercentage;
-
-    /**
-     * inpatientSelfPayPercentage
-     */
-    private Double inpatientSelfPayPercentage;
-
-    /**
-     * classificationMark
-     */
-    private String classificationMark;
-
-    /**
-     * specialDrugsMark
-     */
-    private String specialDrugsMark;
-
-    /**
-     * siSpecialDrugsPaymentStandard
-     */
-    private String siSpecialDrugsPaymentStandard;
-
-    /**
-     * nationalSiPaymentStandard
-     */
-    private String nationalSiPaymentStandard;
-
-    private String makeRegisteredSpecification;
-    private String makeActualSpecification;
-
-    public String getMakeRegisteredSpecification() {
-        return registeredSpecifications + " x" + minPackageNum + minPreparationUnit + "/" + minPackageUnit;
-    }
-
-    public String getMakeActualSpecification() {
-        return actualSpecifications + " x" + minPackageNum + minPreparationUnit + "/" + minPackageUnit;
-    }
 }

+ 3 - 23
src/main/java/thyyxxk/webserver/entity/nationalmatch/SiCentralServices.java

@@ -1,26 +1,14 @@
 package thyyxxk.webserver.entity.nationalmatch;
 
-import java.io.Serializable;
-
-import com.baomidou.mybatisplus.annotation.TableId;
 import lombok.Data;
 
 @Data
-public class SiCentralServices implements Serializable {
-
-	private static final long serialVersionUID =  7867062654238773122L;
+public class SiCentralServices {
 
-	@TableId
 	private String nationalCode;
 
 	private String nationalName;
 
-	private String localMedicalServiceCode;
-
-	private String localMedicalServiceName;
-
-	private String dictionaryValueCode;
-
 	private String projectConnotation;
 
 	private String exclusions;
@@ -29,16 +17,8 @@ public class SiCentralServices implements Serializable {
 
 	private String projectDescription;
 
-	private String remark;
-
-	private String firstClassPrice;
-
-	private String nineBitCode;
-
-	private String reimbursementFlag;
-
-	private String siReimbursementClass;
+	private String startDate;
 
-	private String selfpayPercentage;
+	private String endDate;
 
 }

+ 5 - 17
src/main/java/thyyxxk/webserver/entity/nationalmatch/SiCentralSuppliesMini.java

@@ -1,34 +1,22 @@
 package thyyxxk.webserver.entity.nationalmatch;
 
-import java.io.Serializable;
 import lombok.Data;
 
 @Data
-public class SiCentralSuppliesMini  implements Serializable {
-
-	private static final long serialVersionUID =  7728350900892531939L;
+public class SiCentralSuppliesMini {
 
 	private String nationalCode;
 
-	private String firstClass;
-
-	private String secondClass;
-
-	private String thirdClass;
+	private String nationalName;
 
 	private String siName;
 
 	private String material;
 
-	private String fetures;
-
-	private String registrationCertificateNo;
-
-	private String nationalName;
-
 	private String factory;
 
-	private String specificationNum;
+	private String startTime;
+
+	private String endTime;
 
-	private String registrationOpter;
 }

+ 249 - 71
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiDownloadService.java

@@ -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));
     }

+ 0 - 47
src/main/java/thyyxxk/webserver/service/nationalmatch/NationalMatchService.java

@@ -18,7 +18,6 @@ import thyyxxk.webserver.utils.TokenUtil;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * @description: 新医保国家目录匹配Service
@@ -150,50 +149,4 @@ public class NationalMatchService {
         return ResultVoUtil.success("修改成功。");
     }
 
-    public ResultVo<String> dealMisMatchedItems() {
-        AtomicInteger count = new AtomicInteger();
-        log.info("获取HIS西药药品中...");
-        List<StandardLocalItem> localItems = dao.selectAllLocalMedicines();
-        localItems.forEach(itm -> {
-            List<SiCentralMedicine> nationItems = dao.selectNationalMedicinesByCode(itm.getNationalCode());
-            log.info("处理:【{}】【{}】【{}】 结果:{}", itm.getCode(), itm.getNationalCode(), itm.getName(), nationItems.size());
-            if (nationItems.isEmpty()) {
-                dao.cancelMatchYp(itm.getCode(), itm.getSerial(), "99999");
-                count.getAndIncrement();
-            }
-        });
-        log.info("获取HIS中药药品中...");
-        localItems = dao.selectAllLocalHerbals();
-        localItems.forEach(itm -> {
-            List<SiCentralHerbal> nationItems = dao.selectNationalHerbalsByCode(itm.getNationalCode());
-            log.info("处理:【{}】【{}】【{}】 结果:{}", itm.getCode(), itm.getNationalCode(), itm.getName(), nationItems.size());
-            if (nationItems.isEmpty()) {
-                dao.cancelMatchYp(itm.getCode(), itm.getSerial(), "99999");
-                count.getAndIncrement();
-            }
-        });
-        log.info("获取HIS医疗项目中...");
-        localItems = dao.selectAllLocalServices();
-        localItems.forEach(itm -> {
-            List<SiCentralServices> nationItems = dao.selectNationalServicesByCode(itm.getNationalCode());
-            log.info("处理:【{}】【{}】【{}】 结果:{}", itm.getCode(), itm.getNationalCode(), itm.getName(), nationItems.size());
-            if (nationItems.isEmpty()) {
-                dao.cancelMatchXm(itm.getCode(),"99999");
-                count.getAndIncrement();
-            }
-        });
-        log.info("获取HIS医用耗材中...");
-        localItems = dao.selectAllLocalSupplies();
-        localItems.forEach(itm -> {
-            List<SiCentralSuppliesMini> nationItems = dao.selectNationalSuppliesByCode(itm.getNationalCode());
-            log.info("处理:【{}】【{}】【{}】 结果:{}", itm.getCode(), itm.getNationalCode(), itm.getName(), nationItems.size());
-            if (nationItems.isEmpty()) {
-                dao.cancelMatchXm(itm.getCode(),"99999");
-                count.getAndIncrement();
-            }
-        });
-        String message = "清理完成,已清理数据条目:" + count.get();
-        log.info(message);
-        return ResultVoUtil.success(message);
-    }
 }

+ 0 - 10
src/main/java/thyyxxk/webserver/utils/ExcelUtil.java

@@ -2,9 +2,7 @@ package thyyxxk.webserver.utils;
 
 import java.io.*;
 import java.util.ArrayList;
-import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Map;
 
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.hssf.usermodel.*;
@@ -16,7 +14,6 @@ import org.apache.poi.ss.usermodel.DateUtil;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
-import thyyxxk.webserver.entity.nationalmatch.SiCentralServices;
 import thyyxxk.webserver.entity.nationalmatch.SiCentralSuppliesMini;
 
 import java.io.FileInputStream;
@@ -52,17 +49,10 @@ public class ExcelUtil {
                 if (StringUtil.notBlank(code)) {
                     SiCentralSuppliesMini item = new SiCentralSuppliesMini();
                     item.setNationalCode(code);
-                    item.setFirstClass(getCellFormatValue(row.getCell(1)));
-                    item.setSecondClass(getCellFormatValue(row.getCell(2)));
-                    item.setThirdClass(getCellFormatValue(row.getCell(3)));
                     item.setSiName(getCellFormatValue(row.getCell(4)));
                     item.setMaterial(getCellFormatValue(row.getCell(5)));
-                    item.setFetures(getCellFormatValue(row.getCell(6)));
-                    item.setRegistrationCertificateNo(getCellFormatValue(row.getCell(7)));
                     item.setNationalName(getCellFormatValue(row.getCell(8)));
                     item.setFactory(getCellFormatValue(row.getCell(9)));
-                    item.setSpecificationNum(getCellFormatValue(row.getCell(10)));
-                    item.setRegistrationOpter(getCellFormatValue(row.getCell(11)));
                     list.add(item);
                 }
             }