Pārlūkot izejas kodu

套餐上架优化,添加限定条件提示

lighter 5 mēneši atpakaļ
vecāks
revīzija
0e87124090

+ 1 - 1
src/main/java/thyyxxk/webserver/controller/outpatient/wxmall/WxmallPackageController.java

@@ -36,7 +36,7 @@ public class WxmallPackageController {
 
     @GetMapping("/getOriginPrice")
     public ResultVo<BigDecimal> getOriginPrice(@RequestParam("type") Type type,
-                                                 @RequestParam("code") String code) {
+                                               @RequestParam("code") String code) {
         return ResultVoUtil.success(service.getOriginPrice(type, code));
     }
 

+ 4 - 2
src/main/java/thyyxxk/webserver/dao/his/outpatient/WxmallPackageDao.java

@@ -33,11 +33,13 @@ public interface WxmallPackageDao {
 
     @Insert("<script>" +
             "insert into t_wxmall_package_item " +
-            "(package_id,his_code,his_name,type,origin_price,discount_price,quantity,cost_amt) " +
+            "(package_id,his_code,his_name,type,origin_price,discount_price,quantity,cost_amt," +
+            "gender_restriction,min_age_restriction,max_age_restriction) " +
             "values " +
             "<foreach collection='list' item='item' separator=','>" +
             "(#{item.packageId},#{item.hisCode},#{item.hisName},#{item.type}," +
-            "#{item.originPrice},#{item.discountPrice},#{item.quantity},#{item.costAmt})" +
+            "#{item.originPrice},#{item.discountPrice},#{item.quantity},#{item.costAmt}," +
+            "#{item.genderRestriction},#{item.minAgeRestriction},#{item.maxAgeRestriction})" +
             "</foreach>" +
             "</script>")
     void insertPackageItem(List<WxmallPackageItem> list);

+ 5 - 0
src/main/java/thyyxxk/webserver/dao/his/search/SearchDao.java

@@ -32,6 +32,11 @@ public interface SearchDao {
             "isnull(del_flag,0)!=1 and ${method} like #{content}")
     IPage<CodeName> searchMedicalTechnology(IPage<CodeName> iPage, String method, String content, String table);
 
+    @Select("SELECT RTRIM(code) as code,rtrim(name) as name," +
+            "gender_restriction,min_age_restriction,max_age_restriction " +
+            "from ${table} where isnull(del_flag,0)!=1 and ${method} like #{content}")
+    IPage<CodeName> searchJcJyItem(IPage<CodeName> iPage, String method, String content, String table);
+
     @Select("select code,name,charge_amount as price from zd_charge_item " +
             "where del_flag=0 and class_code in ('B','C','E','G','F','I','J') " +
             "and isnull(group_no,'00')!='91' and ${method} like #{content}")

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/dictionary/CodeName.java

@@ -21,6 +21,9 @@ public class CodeName {
     private BigDecimal price;
     private Integer statusFlag;
     private boolean disabled;
+    private Integer genderRestriction;
+    private Integer minAgeRestriction;
+    private Integer maxAgeRestriction;
 
     public CodeName() {
     }

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/outpatient/wxmall/WxmallPackageItem.java

@@ -14,4 +14,7 @@ public class WxmallPackageItem {
     private BigDecimal discountPrice;
     private Integer quantity;
     private BigDecimal costAmt;
+    private Integer genderRestriction;
+    private Integer minAgeRestriction;
+    private Integer maxAgeRestriction;
 }

+ 11 - 8
src/main/java/thyyxxk/webserver/service/search/SearchService.java

@@ -45,13 +45,13 @@ public class SearchService {
                 iPage = deepinInjuryDiag(params.getMethod(), params.getContent(), iPage);
                 break;
             case "SSCZ":
-                iPage = deepinMedicalTechnology(params.getMethod(), params.getContent(), "zd_icd9_cm3", iPage);
+                iPage = deepinMedicalTechnology(params.getMethod(), params.getContent(), iPage);
                 break;
             case "JY":
-                iPage = deepinMedicalTechnology(params.getMethod(), params.getContent(), "jy_zd_item", iPage);
+                iPage = deepinJcJy(params.getMethod(), params.getContent(), "jy_zd_item", iPage);
                 break;
             case "JC":
-                iPage = deepinMedicalTechnology(params.getMethod(), params.getContent(), "jc_zd_item", iPage);
+                iPage = deepinJcJy(params.getMethod(), params.getContent(), "jc_zd_item", iPage);
                 break;
             case "ZL":
                 iPage = deepinZlItems(params.getMethod(), params.getContent(), iPage);
@@ -72,13 +72,16 @@ public class SearchService {
         return dao.searchPhysician(iPage, column, content);
     }
 
-    private IPage<CodeName> deepinMedicalTechnology(String method, String content, String table, IPage<CodeName> iPage) {
+    private IPage<CodeName> deepinMedicalTechnology(String method, String content, IPage<CodeName> iPage) {
         content = '%' + content.toUpperCase() + '%';
         String column = filterCommonColumn(method);
-        if (table.equals("zd_icd9_cm3")) {
-            return dao.searchIcd9Cm3(iPage, column, content);
-        }
-        return dao.searchMedicalTechnology(iPage, column, content, table);
+        return dao.searchIcd9Cm3(iPage, column, content);
+    }
+
+    private IPage<CodeName> deepinJcJy(String method, String content, String table, IPage<CodeName> iPage) {
+        content = '%' + content.toUpperCase() + '%';
+        String column = filterCommonColumn(method);
+        return dao.searchJcJyItem(iPage, column, content, table);
     }
 
     private IPage<CodeName> deepinZlItems(String method, String content, IPage<CodeName> iPage) {