Преглед изворни кода

Merge branch 'dev-1.1.4' into 'dev-1.1.4'

新增药品临购长购设置

See merge request lihong/thmz_system!99
huangshuhua пре 6 месеци
родитељ
комит
896215b54b

+ 24 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/YpZdDictController.java

@@ -280,4 +280,28 @@ public class YpZdDictController {
         return R.error();
         return R.error();
     }
     }
 
 
+    @UserLoginToken
+    @RequestMapping(value = "/saveDrugBuyOptions", method = {RequestMethod.GET})
+    public R saveDrugBuyOptions(@RequestParam("chargeCode") String chargeCode, @RequestParam("buyFlag") String buyFlag){
+        if(null == chargeCode || StringUtils.isBlank(chargeCode)){
+            R.error().put("code", -1);
+            R.error().put("message", "保存药品临购/长购失败, 药品编码缺失!");
+            return R.error();
+        }
+        if(null == buyFlag || StringUtils.isBlank(buyFlag)){
+            R.error().put("code", -1);
+            R.error().put("message", "保存药品药品临购/长购失败, 药品药品临购/长购缺失!");
+            return R.error();
+        }
+        int count = ypZdDictService.saveDrugBuyOptions(chargeCode, buyFlag);
+        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

@@ -294,4 +294,6 @@ public class YpZdDict {
     private String groupNo;
     private String groupNo;
     // 药品商品码
     // 药品商品码
     private String barCode;
     private String barCode;
+    // 药品临购/长购 1:临购  2:长购
+    private String buyFlag;
 }
 }

+ 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," +
             "       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," +
             "       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," +
             "       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" +
+            "       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" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
     YpZdDict selectYpZdDictByCodeAndSerial(@Param("code") String code, @Param("serial") String 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," +
                     "       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," +
                     "       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," +
                     "       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" +
+                    "       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" +
                     " from yp_zd_dict WITH(NOLOCK)",
                     " from yp_zd_dict WITH(NOLOCK)",
             "<when test='codes!=null'>",
             "<when test='codes!=null'>",
             " where code in",
             " 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," +
             "       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," +
             "       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," +
             "       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" +
+            "       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" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} ")
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} ")
     List<YpZdDict> selectYpZdDictByCode(@Param("code") String code);
     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," +
             "       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," +
             "       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," +
             "       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 " +
+            "       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 " +
             " from " +
             " from " +
             " (select a.code, max(a.serial)serial" +
             " (select a.code, max(a.serial)serial" +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) " +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) " +
@@ -320,4 +320,7 @@ public interface YpZdDictMapper {
     @Select(" select * from yp_zd_dict where bar_code = #{barCode} ")
     @Select(" select * from yp_zd_dict where bar_code = #{barCode} ")
     List<YpZdDictVo> selectYpZdDictListByBarCode(@Param("barCode") String barCode);
     List<YpZdDictVo> selectYpZdDictListByBarCode(@Param("barCode") String barCode);
 
 
+    @Update(" update yp_zd_dict set buy_flag = #{buyFlag} where code = #{code} ")
+    int updateYpBuyFlag(@Param("code") String code, @Param("buyFlag") String buyFlag);
+
 }
 }

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

@@ -98,4 +98,13 @@ public interface YpZdDictService {
      */
      */
     int saveDrugBarCodeByBarCode(String code, String drugBarCode);
     int saveDrugBarCodeByBarCode(String code, String drugBarCode);
 
 
+    /**
+     * @Description 保存药品临购/长购
+     * @Author hsh
+     * @param buyFlag 1:临购  2:长购
+     * @return
+     * @Date 2025/2/17 15:20
+     */
+    int saveDrugBuyOptions(String code, String buyFlag);
+
 }
 }

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

@@ -253,4 +253,9 @@ public class YpZdDictServiceImpl implements YpZdDictService {
         }
         }
         return ypZdDictMapper.updateYpZdDictByBarCode(chargeCode, barCode);
         return ypZdDictMapper.updateYpZdDictByBarCode(chargeCode, barCode);
     }
     }
+
+    @Override
+    public int saveDrugBuyOptions(String code, String buyFlag) {
+        return ypZdDictMapper.updateYpBuyFlag(code, buyFlag);
+    }
 }
 }

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

@@ -221,4 +221,6 @@ public class YpZdDictVo {
     private Integer antitumorLevel;
     private Integer antitumorLevel;
     // 药品商品码
     // 药品商品码
     private String barCode;
     private String barCode;
+    // 药品临购/长购 1:临购  2:长购
+    private String buyFlag;
 }
 }

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

@@ -35,6 +35,14 @@ $(function () {
         }
         }
         saveDrugBarCode();
         saveDrugBarCode();
     });
     });
+    //药品临购/长购维护点击事件
+    $("#btn_buy").click(function (t) {
+        if(isEmpty($("#code").val())){
+            warningMesageSimaple("请先选择药品!");
+            return;
+        }
+        saveDrugBuyOptions();
+    });
     $('#editModal').on('shown.bs.modal', function () {
     $('#editModal').on('shown.bs.modal', function () {
         initTable();
         initTable();
     });
     });
@@ -440,4 +448,19 @@ function saveDrugBarCode(){
         initTable();
         initTable();
         successMesage(res);
         successMesage(res);
     })
     })
+}
+
+function saveDrugBuyOptions(){
+    let buyFlag = $("#buyFlag").val();
+    request({
+        method:'GET',
+        url: '/saveDrugBuyOptions',
+        data: {
+            chargeCode: $("#code").val(),
+            buyFlag: buyFlag,
+        },
+    }).then((res) =>{
+        initTable();
+        successMesage(res);
+    })
 }
 }

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

@@ -71,6 +71,9 @@
                         <button type="button" style="margin-left:3px" id="btn_bar" class="btn btn-primary"
                         <button type="button" style="margin-left:3px" id="btn_bar" class="btn btn-primary"
                                 title="商品码维护">商品码维护
                                 title="商品码维护">商品码维护
                         </button>
                         </button>
+                        <button type="button" style="margin-left:3px" id="btn_buy" class="btn btn-primary"
+                                title="临购/长购维护">临购/长购维护
+                        </button>
                     </div>
                     </div>
                 </div>
                 </div>
             </form>
             </form>
@@ -112,6 +115,17 @@
                                 <input id="barCode" name="barCode" class="form-control col-md-7 col-xs-12" type="text">
                                 <input id="barCode" name="barCode" class="form-control col-md-7 col-xs-12" type="text">
                             </div>
                             </div>
                         </div>
                         </div>
+                        <div class="col-md-2 col-sm-2 col-xs-12 item">
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
+                                   for="buyFlag">临购/长购</label>
+                            <div class="col-md-8 col-sm-8 col-xs-12">
+                                <select class="form-control selectpicker show-tick"  title="请选择"
+                                        id="buyFlag" name="buyFlag">
+                                    <option value="1">临购</option>
+                                    <option value="2">长购</option>
+                                </select>
+                            </div>
+                        </div>
                     </div>
                     </div>
                 </div>
                 </div>
                 <div class="item form-group thmz_alert">
                 <div class="item form-group thmz_alert">