Browse Source

增加药品健康宣教维护

hsh 6 months ago
parent
commit
cd3e1db0f8

+ 26 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/YpZdDictController.java

@@ -280,6 +280,9 @@ public class YpZdDictController {
         return R.error();
     }
 
+    /**
+     * 保存药品临购/长购
+     */
     @UserLoginToken
     @RequestMapping(value = "/saveDrugBuyOptions", method = {RequestMethod.GET})
     public R saveDrugBuyOptions(@RequestParam("chargeCode") String chargeCode, @RequestParam("buyFlag") String buyFlag){
@@ -290,7 +293,7 @@ public class YpZdDictController {
         }
         if(null == buyFlag || StringUtils.isBlank(buyFlag)){
             R.error().put("code", -1);
-            R.error().put("message", "保存药品药品临购/长购失败, 药品药品临购/长购缺失!");
+            R.error().put("message", "保存药品临购/长购失败, 药品临购/长购缺失!");
             return R.error();
         }
         int count = ypZdDictService.saveDrugBuyOptions(chargeCode, buyFlag);
@@ -304,4 +307,26 @@ public class YpZdDictController {
         return R.error();
     }
 
+    /**
+     * 保存药品健康宣教
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/saveDrugHealthFlag", method = {RequestMethod.GET})
+    public R saveDrugHealthFlag(@RequestParam("chargeCode") String chargeCode, @RequestParam("healthFlag") String healthFlag){
+        if(null == chargeCode || StringUtils.isBlank(chargeCode)){
+            R.error().put("code", -1);
+            R.error().put("message", "保存药品健康宣教失败, 药品编码缺失!");
+            return R.error();
+        }
+        int count = ypZdDictService.saveDrugHealthFlag(chargeCode, healthFlag);
+        if(count > 0){
+            R.ok().put("code", "0");
+            R.ok().put("message", "保存药品健康宣教成功!");
+            return R.ok();
+        }
+        R.error().put("code", -1);
+        R.error().put("message", "保存药品健康宣教失败!");
+        return R.error();
+    }
+
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpZdDict.java

@@ -296,4 +296,6 @@ public class YpZdDict {
     private String barCode;
     // 药品临购/长购 1:临购  2:长购
     private String buyFlag;
+    // 药品健康宣教 1: 是健康宣教
+    private String healthFlag;
 }

+ 7 - 4
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDictMapper.java

@@ -30,7 +30,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
             "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
             "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
     YpZdDict selectYpZdDictByCodeAndSerial(@Param("code") String code, @Param("serial") String serial);
 
@@ -54,7 +54,7 @@ public interface YpZdDictMapper {
                     "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
                     "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
                     "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-                    "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag" +
+                    "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
                     " from yp_zd_dict WITH(NOLOCK)",
             "<when test='codes!=null'>",
             " where code in",
@@ -85,7 +85,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
             "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
             "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} ")
     List<YpZdDict> selectYpZdDictByCode(@Param("code") String code);
 
@@ -138,7 +138,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, d.yb_comment_city, d.yb_comment_xnh, d.ddd_unit, d.wg_type, d.fh_name, d.yb_flag_new, d.yb_comment_new, rtrim(d.yb_bl_new)yb_bl_new," +
             "       wjw_ypid, d.yjj_ypid, d.rsb_ypid, d.mz_restrict, isnull(byj_flag,0) byj_flag, d.national_code, d.national_name, d.national_status, d.match_oper," +
             "       match_date, d.cancel_match_oper, d.cancel_match_date, d.new_name, d.oper_id, d.oper_date, d.uploaded_flag, d.prescription_limit_days,d.antitumor_level," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,d.bar_code,d.buy_flag " +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,d.bar_code,d.buy_flag,d.health_flag " +
             " from " +
             " (select a.code, max(a.serial)serial" +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) " +
@@ -323,4 +323,7 @@ public interface YpZdDictMapper {
     @Update(" update yp_zd_dict set buy_flag = #{buyFlag} where code = #{code} ")
     int updateYpBuyFlag(@Param("code") String code, @Param("buyFlag") String buyFlag);
 
+    @Update(" update yp_zd_dict set health_flag = #{healthFlag} where code = #{code} ")
+    int saveDrugHealthFlag(@Param("code") String code, @Param("healthFlag") String healthFlag);
+
 }

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/yp/YpZdDictService.java

@@ -107,4 +107,13 @@ public interface YpZdDictService {
      */
     int saveDrugBuyOptions(String code, String buyFlag);
 
+    /**
+     * @Description 保存药品健康宣教
+     * @Author hsh
+     * @param healthFlag 1:是健康宣教特殊药品
+     * @return
+     * @Date 2025/2/18 10:50
+     */
+    int saveDrugHealthFlag(String code, String healthFlag);
+
 }

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpZdDictServiceImpl.java

@@ -258,4 +258,9 @@ public class YpZdDictServiceImpl implements YpZdDictService {
     public int saveDrugBuyOptions(String code, String buyFlag) {
         return ypZdDictMapper.updateYpBuyFlag(code, buyFlag);
     }
+
+    @Override
+    public int saveDrugHealthFlag(String code, String healthFlag) {
+        return ypZdDictMapper.saveDrugHealthFlag(code, healthFlag);
+    }
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/YpZdDictVo.java

@@ -223,4 +223,6 @@ public class YpZdDictVo {
     private String barCode;
     // 药品临购/长购 1:临购  2:长购
     private String buyFlag;
+    // 药品健康宣教 1: 是健康宣教
+    private String healthFlag;
 }

+ 26 - 0
src/main/resources/static/js/yk/drug_info.js

@@ -43,6 +43,14 @@ $(function () {
         }
         saveDrugBuyOptions();
     });
+    //健康宣教维护点击事件
+    $("#btn_health").click(function (t) {
+        if(isEmpty($("#code").val())){
+            warningMesageSimaple("请先选择药品!");
+            return;
+        }
+        saveDrugHealthFlag();
+    });
     $('#editModal').on('shown.bs.modal', function () {
         initTable();
     });
@@ -463,4 +471,22 @@ function saveDrugBuyOptions(){
         initTable();
         successMesage(res);
     })
+}
+
+function saveDrugHealthFlag(){
+    let healthFlag = ''
+    $('input[name="healthFlag"]:checked').each(function (i) {
+        healthFlag = $(this).val()
+    })
+    request({
+        method:'GET',
+        url: '/saveDrugHealthFlag',
+        data: {
+            chargeCode: $("#code").val(),
+            healthFlag: healthFlag,
+        },
+    }).then((res) =>{
+        initTable();
+        successMesage(res);
+    })
 }

+ 7 - 0
src/main/resources/templates/yk/drug_info.html

@@ -74,6 +74,9 @@
                         <button type="button" style="margin-left:3px" id="btn_buy" class="btn btn-primary"
                                 title="临购/长购维护">临购/长购维护
                         </button>
+                        <button type="button" style="margin-left:3px" id="btn_health" class="btn btn-primary"
+                                title="健康宣教维护">健康宣教维护
+                        </button>
                     </div>
                 </div>
             </form>
@@ -646,6 +649,10 @@
                             <input id="spName" name="spName" class="form-control col-md-7 col-xs-12" type="text" data-validate-length-range="1,30">
                         </div>
                     </div>
+                    <div class="col-md-1 col-sm-1 col-xs-12">
+                        <input class="form-check-input" type="checkbox" id="healthFlag" name="healthFlag" value="1" >
+                        <label class="form-check-label" for="healthFlag">健康宣教</label>
+                    </div>
                 </div>
 
                 <div class="item form-group thmz_alert">