Bläddra i källkod

优化耗材匹配

lighter 3 år sedan
förälder
incheckning
48aacf23d0

+ 1 - 1
pom.xml

@@ -10,7 +10,7 @@
     </parent>
     <groupId>thyyxxk</groupId>
     <artifactId>web-server</artifactId>
-    <version>1</version>
+    <version>2</version>
     <name>web-server</name>
     <description>server for yibao-web</description>
     <properties>

+ 17 - 10
src/main/java/thyyxxk/webserver/dao/his/dictionary/NationalMatchDao.java

@@ -20,8 +20,8 @@ public interface NationalMatchDao {
 
     @Select("select a.code,a.serial,a.new_name as name,type=#{type}," +
             "a.national_code,a.national_name,a.uploaded_flag, " +
-            "startTime=(select start_time from t_si_dl_ptnt_wstn_mdcn where code=a.national_code)," +
-            "endTime=(select end_time from t_si_dl_ptnt_wstn_mdcn where code=a.national_code)," +
+//            "startTime=(select start_time from t_si_dl_ptnt_wstn_mdcn where code=a.national_code)," +
+//            "endTime=(select end_time from t_si_dl_ptnt_wstn_mdcn where code=a.national_code)," +
             "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, " +
@@ -40,8 +40,8 @@ public interface NationalMatchDao {
 
     @Select("select a.code,a.serial,a.new_name as name,type=#{type}," +
             "a.national_code,a.national_name,a.uploaded_flag, " +
-            "startTime=(select start_time from t_si_dl_chns_hbl where code=a.national_code)," +
-            "endTime=(select end_time from t_si_dl_chns_hbl where code=a.national_code)," +
+//            "startTime=(select start_time from t_si_dl_chns_hbl where code=a.national_code)," +
+//            "endTime=(select end_time from t_si_dl_chns_hbl where code=a.national_code)," +
             "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, " +
@@ -59,8 +59,8 @@ public interface NationalMatchDao {
                                                   @Param("status") int status);
 
     @Select("select code,new_name as name,charge_unit as unit,type=#{type},discription,descriptions as specification," +
-            "startTime=(select start_time from t_si_dl_mdcn_sply where code=national_code)," +
-            "endTime=(select end_time from t_si_dl_mdcn_sply where code=national_code)," +
+//            "startTime=(select start_time from t_si_dl_mdcn_sply where code=national_code)," +
+//            "endTime=(select end_time from t_si_dl_mdcn_sply where code=national_code)," +
             "national_code,uploaded_flag,national_name,yb_comment as factory from zd_charge_item " +
             "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
             "class_code='J' and code like #{code} and name like #{name}")
@@ -73,8 +73,8 @@ public interface NationalMatchDao {
 
     @Select("select code,new_name as name,charge_unit as unit,type=#{type}, discription,specification,uploaded_flag," +
             "national_code,national_name,s_code as standardCode, charge_amount as price, " +
-            "startTime=(select start_date from t_si_dl_mdcn_srvc where code=a.national_code)," +
-            "endTime=(select end_date from t_si_dl_mdcn_srvc where code=a.national_code)," +
+//            "startTime=(select start_date from t_si_dl_mdcn_srvc where code=a.national_code)," +
+//            "endTime=(select end_date from t_si_dl_mdcn_srvc where code=a.national_code)," +
             "localName=(select b.local_medical_service_name from si_central_services b where b.national_code=a.national_code) " +
             "from zd_charge_item a " +
             "where isnull(national_status,0)=#{status} and isnull(del_flag,0)=#{delFlag} and " +
@@ -92,8 +92,9 @@ public interface NationalMatchDao {
     @Select("select code as nationalCode,registration_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,start_time,end_time from t_si_dl_ptnt_wstn_mdcn " +
-            "where registration_name like #{name} and license_number like #{approve}")
+            "drug_supervision_local_code as drugStandardCode,start_time,end_time, " +
+            "matchedCount=(select count(1) from yp_zd_dict t where t.national_code=a.code) " +
+            "from t_si_dl_ptnt_wstn_mdcn a where registration_name like #{name} and license_number like #{approve}")
     List<SiCentralMedicine> selectNationalMedicines(@Param("name") String name, @Param("approve") String approve);
 
     @Select("select code as nationalCode,monoo_name as nationalName,start_time,end_time " +
@@ -110,6 +111,12 @@ public interface NationalMatchDao {
             "from t_si_dl_mdcn_sply where supplies_name like #{name} or si_universal_name like #{name}")
     List<SiCentralSuppliesMini> selectNationalSupplies(@Param("name") String 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 ${column}=#{value}")
+    List<SiCentralSuppliesMini> selectNationalSuppliesByCondition(@Param("column") String column, @Param("value") String value);
+
+
     @Update("update yp_zd_dict set national_status=1,national_code=#{nationalCode}," +
             "national_name=#{nationalName},match_oper=#{staffId}, match_date=getdate() " +
             "where code=#{code}")

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

@@ -24,4 +24,6 @@ public class SiCentralMedicine {
     private String startTime;
 
     private String endTime;
+
+    private Integer matchedCount;
 }

+ 9 - 2
src/main/java/thyyxxk/webserver/service/dictionary/NationalMatchService.java

@@ -107,8 +107,15 @@ public class NationalMatchService {
             }
             return ResultVoUtil.success(list);
         } else {
-            String name = "%" + param.getFuzzyName() + "%";
-            List<SiCentralSuppliesMini> list = dao.selectNationalSupplies(name);
+            List<SiCentralSuppliesMini> list;
+            if (StringUtil.notBlank(param.getNationalCode())) {
+                list = dao.selectNationalSuppliesByCondition("code", param.getNationalCode().trim());
+            } else if (StringUtil.notBlank(param.getApprovalNumber())) {
+                list = dao.selectNationalSuppliesByCondition("registration_record_no", param.getApprovalNumber().trim());
+            } else {
+                String name = "%" + param.getFuzzyName() + "%";
+                list = dao.selectNationalSupplies(name);
+            }
             if (null == list || list.isEmpty()) {
                 return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "没有符合条件的国家目录。");
             }