Sfoglia il codice sorgente

Merge branch 'master' into 'master'

解决药品账页维护编辑问题

See merge request lighter/web-server!154
huangshuhua 2 settimane fa
parent
commit
6b42e4d82a

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/medicine/YpDictController.java

@@ -173,6 +173,11 @@ public class YpDictController {
         return service.selectYpDictByCode(code, serial);
     }
 
+    @GetMapping("/selectYpDictByCodeNoSerial")
+    public ResultVo<List<YpZdDict>> selectYpDictByCodeNoSerial(@RequestParam("code") String code){
+        return service.selectYpDictByCodeNoSerial(code);
+    }
+
     @GetMapping("/selectYpDictData")
     public ResultVo<Map<String, List<CodeName>>> selectYpDictData(){
         return service.selectYpDictData();

+ 13 - 10
src/main/java/thyyxxk/webserver/dao/his/medicine/YpDictDao.java

@@ -85,6 +85,9 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
     @Select(" select * from yp_zd_dict where code = #{code} and serial = #{serial} ")
     YpZdDict selectYpDictByCode(@Param("code") String code, @Param("serial") String serial);
 
+    @Select(" select * from yp_zd_dict where code = #{code} ")
+    List<YpZdDict> selectYpDictByCodeNoSerial(@Param("code") String code);
+
     @Update(" update yp_zd_dict set del_flag = #{delFlag} where code = #{code} ")
     int updateYpDictDelFlagByCode(@Param("code") String code, @Param("delFlag") String delFlag);
 
@@ -245,18 +248,18 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
 
     @Update({"<script>" +
             "update yp_zd_dict set" +
-            "  yp_zd_dict.name =b.name, py_code =b.py_code, d_code =b.d_code, specification =b.specification2, specification2 =b.specification2, " +
-            "  class_code =b.class_code, dosage =b.dosage, concentration =b.concentration, weight =b.weight, weigh_unit =b.weigh_unit, " +
-            "  volum =b.volum, vol_unit =b.vol_unit, mini_unit =b.mini_unit, pack_unit =b.mini_unit, self_flag =b.self_flag, " +
-            "  separate_flag =b.separate_flag, suprice_flag =b.suprice_flag, drug_flag =b.drug_flag, infusion_flag =b.infusion_flag, " +
-            "  country_flag =b.country_flag, manu_code =b.manu_code, drug_kind =b.drug_kind, gmp_flag =b.gmp_flag, cold_flag =b.cold_flag, " +
-            "  chem_remark =b.chem_remark, bill_item_mz =b.bill_item_mz, bill_item_zy =b.bill_item_zy, percent_group_mz =b.percent_group_mz, " +
+            "  yp_zd_dict.name =b.name, py_code =b.py_code, d_code =b.d_code, specification =b.specification2, specification2 =b.specification2, location =b.location, " +
+            "  class_code =b.class_code, dosage =b.dosage, concentration =b.concentration, weight =b.weight, weigh_unit =b.weigh_unit, fh_name = b.fh_name, " +
+            "  volum =b.volum, vol_unit =b.vol_unit, mini_unit =b.mini_unit, pack_unit =b.mini_unit, self_flag =b.self_flag, js_flag = b.js_flag, order_dosage =b.order_dosage, " +
+            "  separate_flag =b.separate_flag, suprice_flag =b.suprice_flag, drug_flag =b.drug_flag, infusion_flag =b.infusion_flag, pzwh =b.pzwh, dosage_unit =b.dosage_unit, " +
+            "  country_flag =b.country_flag, manu_code =b.manu_code, drug_kind =b.drug_kind, gmp_flag =b.gmp_flag, cold_flag =b.cold_flag, visible_flag =b.visible_flag, " +
+            "  chem_remark =b.chem_remark, bill_item_mz =b.bill_item_mz, bill_item_zy =b.bill_item_zy, percent_group_mz =b.percent_group_mz, fz_flag =b.fz_flag, " +
             "  percent_group_zy =b.percent_group_zy, del_flag =b.del_flag, yb_flag =b.yb_flag, self_flag_yb =b.self_flag_yb, n_code =b.n_code, zb_flag =b.zb_flag, " +
-            "  zb_supplyer =b.zb_supplyer, ps_flag =b.ps_flag, ex_code =b.ex_code, supply_type =b.supply_type, frequency =rtrim(b.frequency), " +
+            "  zb_supplyer =b.zb_supplyer, ps_flag =b.ps_flag, qj_flag = b.qj_flag, ex_code =b.ex_code, supply_type =b.supply_type, frequency =rtrim(b.frequency), " +
             "  kss_flag =b.kss_flag, yp_level =b.yp_level, drug_id =b.drug_id, yb_code =b.yb_code, yb_comment =b.yb_comment, xnh_flag =b.xnh_flag, jb_flag =b.jb_flag, " +
-            "  audit_code =b.audit_code, comment =b.comment, categories_flag =b.categories_flag, ym_flag =b.ym_flag, dpym_flag =b.dpym_flag, " +
-            "  father_flag =b.father_flag, yb_code2 =b.yb_code2, yb_comment2 =b.yb_comment2, kjyw_flag =rtrim(b.kjyw_flag), ygyyjc_type =b.ygyyjc_type, " +
-            "  ddd_value =b.ddd_value, yp_id =b.yp_id, xtpp_name =b.xtpp_name, sp_name =b.sp_name, yb_comment_new =b.yb_comment_new, " +
+            "  audit_code =b.audit_code, comment =b.comment, categories_flag =b.categories_flag, ym_flag =b.ym_flag, dpym_flag =b.dpym_flag, wg_type =b.wg_type, " +
+            "  father_flag =b.father_flag, yb_code2 =b.yb_code2, yb_comment2 =b.yb_comment2, kjyw_flag =rtrim(b.kjyw_flag), ygyyjc_type =b.ygyyjc_type, cl_flag =b.cl_flag, " +
+            "  ddd_value =b.ddd_value, yp_id =b.yp_id, xtpp_name =b.xtpp_name, sp_name =b.sp_name, yb_comment_new =b.yb_comment_new, is_central_purchase =b.is_central_purchase,  " +
             "  yb_bl_new =b.yb_bl_new, yb_flag_new =b.yb_flag_new, byj_flag =b.byj_flag, drug_control_code =b.drug_control_code, antitumor_level=b.antitumor_level " +
             " from ( select * from yp_zd_dict ) as b " +
             " where yp_zd_dict.code = #{code} and yp_zd_dict.serial != #{serial} and yp_zd_dict.code = b.code and b.serial = #{serial}" +

+ 16 - 5
src/main/java/thyyxxk/webserver/service/medicine/YpDictService.java

@@ -20,6 +20,7 @@ import thyyxxk.webserver.dao.his.medicine.YpZdUnitDao;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.inpatient.YpZdDict;
+import thyyxxk.webserver.entity.medicine.YpDictConstant;
 import thyyxxk.webserver.entity.medicine.YpPrintName;
 import thyyxxk.webserver.entity.medicine.YpTypeNumberEnum;
 import thyyxxk.webserver.entity.medicine.YpZdChargeGroup;
@@ -704,7 +705,7 @@ public class YpDictService {
     }
 
     /**
-     * @Description 根据药品编码查询药品账页信息
+     * @Description 根据药品编码和包装规格查询药品账页信息
      * @Author hsh
      * @param code 药品编码, serial 药品包装规格
      * @return YpZdDict 药品账页信息
@@ -714,6 +715,17 @@ public class YpDictService {
         return ResultVoUtil.success(dao.selectYpDictByCode(code, serial));
     }
 
+    /**
+     * @Description 根据药品编码查询药品账页信息
+     * @Author hsh
+     * @param code 药品编码
+     * @return list 药品账页信息
+     * @Date 2025/8/3 0003 15:25
+     */
+    public ResultVo<List<YpZdDict>> selectYpDictByCodeNoSerial(String code){
+        return ResultVoUtil.success(dao.selectYpDictByCodeNoSerial(code));
+    }
+
     /**
      * @Description 查询需要的药品字典集合
      * @Author hsh
@@ -810,7 +822,6 @@ public class YpDictService {
                 initNum = Convert.toInt(ypTypeNumber.minNum, 0);
             }
             int code = Convert.toInt(maxCode,initNum) + 1;
-//            int code = Integer.parseInt(maxCode)+1;
             maxCode = callYpCodeFormat(code);
             // 药品编码与医嘱编码冲突重置编码
             int cs = dao.selectYzOrderItemByCode(maxCode);
@@ -820,7 +831,7 @@ public class YpDictService {
                 cs = dao.selectYzOrderItemByCode(maxCode);
             }
             ypZdDictVo.setCode(maxCode);
-            String serial = ypZdDictVo.getMiniUnit().equals(ypZdDictVo.getPackUnit()) ? "01" : "99";
+            String serial = ypZdDictVo.getMiniUnit().equals(ypZdDictVo.getPackUnit()) ? YpDictConstant.SERIAL_01 : YpDictConstant.SERIAL_99;
             ypZdDictVo.setSerial(serial);
             ypZdDictVo.setOperId("");
             YpZdDict copyVo = callYpVoChargeDict(ypZdDictVo);
@@ -830,10 +841,10 @@ public class YpDictService {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "保存药品账页字典失败!");
             }
 
-            if(copyVo.getSerial().equals("99")){
+            if(copyVo.getSerial().equals(YpDictConstant.SERIAL_99)){
                 YpZdDict minYp = new YpZdDict();
                 BeanUtils.copyProperties(copyVo, minYp, YpZdDict.class);
-                minYp.setSerial("01");
+                minYp.setSerial(YpDictConstant.SERIAL_01);
                 BigDecimal minPackPrice = DecimalUtil.divide(ypZdDictVo.getPackRetprice(), ypZdDictVo.getPackSize(), 3);
                 minYp.setPackRetprice(minPackPrice.doubleValue());
                 BigDecimal minBuyPrice = DecimalUtil.divide(ypZdDictVo.getBuyPrice(), ypZdDictVo.getPackSize(), 3);