Bläddra i källkod

Merge branch 'master' into 'master'

药品字典维护修复

See merge request lighter/web-server!133
huangshuhua 7 månader sedan
förälder
incheckning
5baac1f147

+ 0 - 254
src/main/java/thyyxxk/webserver/dao/his/medicine/YpDictDao.java

@@ -243,260 +243,6 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
             " from yp_zd_dict where code = #{code} and serial = #{serial}")
     int insertYpBaseSync(@Param("code") String code, @Param("serial") String serial, @Param("groupNo") String groupNo);
 
-    @Update("<script> " +
-            " update yp_zd_dict " +
-            "<trim prefix=\"set\" suffixOverrides=\",\">" +
-            "<if test=\" name != null and name != '' \">" +
-            " name = #{name}, " +
-            "</if>" +
-            "<if test=\"classCode != null and classCode != '' \">" +
-            " class_code = #{classCode}, " +
-            "</if>" +
-            "<if test=\"dosage != null and dosage != '' \">" +
-            " dosage = #{dosage}, " +
-            "</if>" +
-            "<if test=\"concentration != null and concentration != '' \">" +
-            " concentration = #{concentration}, " +
-            "</if>" +
-            "<if test=\"weight != null and weight != '' \">" +
-            " weight = #{weight}, " +
-            "</if>" +
-            "<if test=\"weighUnit != null and weighUnit != '' \">" +
-            " weigh_unit = #{weighUnit}, " +
-            "</if>" +
-            "<if test=\"volum != null and volum != '' \">" +
-            " volum = #{volum}, " +
-            "</if>" +
-            "<if test=\"volUnit != null and volUnit != '' \">" +
-            " vol_unit = #{volUnit}, " +
-            "</if>" +
-            "<if test=\"miniUnit != null and miniUnit != '' \">" +
-            " mini_unit = #{miniUnit}, " +
-            "</if>" +
-            "<if test=\"packSize != null and packSize != '' \">" +
-            " pack_size = #{packSize}, " +
-            "</if>" +
-            "<if test=\"packUnit != null and packUnit != '' \">" +
-            " pack_unit = #{packUnit}, " +
-            "</if>" +
-            "<if test=\"specification != null and specification != '' \">" +
-            " specification = #{specification}, " +
-            "</if>" +
-            "<if test=\"specification2 != null and specification2 != '' \">" +
-            " specification2 = #{specification2}, " +
-            "</if>" +
-            "<if test=\"packRetprice != null and packRetprice != '' \">" +
-            " pack_retprice = #{packRetprice}, " +
-            "</if>" +
-            "<if test=\"retprice != null and retprice != '' \">" +
-            " retprice = #{retprice}, " +
-            "</if>" +
-            "<if test=\"buyPrice != null and buyPrice != '' \">" +
-            " buy_price = #{buyPrice}, " +
-            "</if>" +
-            "<if test=\"ybxjPrice != null and ybxjPrice != '' \">" +
-            " ybxj_price = #{ybxjPrice}, " +
-            "</if>" +
-            "<if test=\"percentGroupMz != null and percentGroupMz != '' \">" +
-            " percent_group_mz = #{percentGroupMz}, " +
-            "</if>" +
-            "<if test=\"percentGroupZy != null and percentGroupZy != '' \">" +
-            " percent_group_zy = #{percentGroupZy}, " +
-            "</if>" +
-            "<if test=\"selfFlag != null and selfFlag != '' \">" +
-            " self_flag = #{selfFlag}, " +
-            "</if>" +
-            "<if test=\"supriceFlag != null and supriceFlag != '' \">" +
-            " suprice_flag = #{supriceFlag}, " +
-            "</if>" +
-            "<if test=\"drugFlag != null and drugFlag != '' \">" +
-            " drug_flag = #{drugFlag}, " +
-            "</if>" +
-            "<if test=\"pyCode != null and pyCode != '' \">" +
-            " py_code = #{pyCode}, " +
-            "</if>" +
-            "<if test=\"dcode != null and dcode != '' \">" +
-            " d_code = #{dcode}, " +
-            "</if>" +
-            "<if test=\"infusionFlag != null and infusionFlag != '' \">" +
-            " infusion_flag = #{infusionFlag}, " +
-            "</if>" +
-            "<if test=\"visibleFlag != null and visibleFlag != '' \">" +
-            " visible_flag = #{visibleFlag}, " +
-            "</if>" +
-            "<if test=\"delFlag != null and delFlag != '' \">" +
-            " del_flag = #{delFlag}, " +
-            "</if>" +
-            "<if test=\"countryFlag != null and countryFlag != '' \">" +
-            " country_flag = #{countryFlag}, " +
-            "</if>" +
-            "<if test=\"manuCode != null and manuCode != '' \">" +
-            " manu_code = #{manuCode}, " +
-            "</if>" +
-            "<if test=\"coldFlag != null and coldFlag != '' \">" +
-            " cold_flag = #{coldFlag}, " +
-            "</if>" +
-            "<if test=\"chemRemark != null and chemRemark != '' \">" +
-            " chem_remark = #{chemRemark}, " +
-            "</if>" +
-            "<if test=\"drugKind != null and drugKind != '' \">" +
-            " drug_kind = #{drugKind}, " +
-            "</if>" +
-            "<if test=\"zbFlag != null and zbFlag != '' \">" +
-            " zb_flag = #{zbFlag}, " +
-            "</if>" +
-            "<if test=\"zbSupplyer != null and zbSupplyer != '' \">" +
-            " zb_supplyer = #{zbSupplyer}, " +
-            "</if>" +
-            "<if test=\"ncode != null and ncode != '' \">" +
-            " n_code = #{ncode}, " +
-            "</if>" +
-            "<if test=\"billItemMz != null and billItemMz != '' \">" +
-            " bill_item_mz = #{billItemMz}, " +
-            "</if>" +
-            "<if test=\"billItemZy != null and billItemZy != '' \">" +
-            " bill_item_zy = #{billItemZy}, " +
-            "</if>" +
-            "<if test=\"supplyType != null and supplyType != '' \">" +
-            " supply_type = #{supplyType}, " +
-            "</if>" +
-            "<if test=\"frequency != null and frequency != '' \">" +
-            " frequency = #{frequency}, " +
-            "</if>" +
-            "<if test=\"psFlag != null and psFlag != '' \">" +
-            " ps_flag = #{psFlag}, " +
-            "</if>" +
-            "<if test=\"exCode != null and exCode != '' \">" +
-            " ex_code = #{exCode}, " +
-            "</if>" +
-            "<if test=\"kssFlag != null and kssFlag != '' \">" +
-            " kss_flag = #{kssFlag}, " +
-            "</if>" +
-            "<if test=\"ypLevel != null and ypLevel != '' \">" +
-            " yp_level = #{ypLevel}, " +
-            "</if>" +
-            "<if test=\"selfFlagYb != null and selfFlagYb != '' \">" +
-            " self_flag_yb = #{selfFlagYb}, " +
-            "</if>" +
-            "<if test=\"orderDosage != null and orderDosage != '' \">" +
-            " order_dosage = #{orderDosage}, " +
-            "</if>" +
-            "<if test=\"dosageUnit != null and dosageUnit != '' \">" +
-            " dosage_unit = #{dosageUnit}, " +
-            "</if>" +
-            "<if test=\"jbFlag != null and jbFlag != '' \">" +
-            " jb_flag = #{jbFlag}, " +
-            "</if>" +
-            "<if test=\"location != null and location != '' \">" +
-            " location = #{location}, " +
-            "</if>" +
-            "<if test=\"auditCode != null and auditCode != '' \">" +
-            " audit_code = #{auditCode}, " +
-            "</if>" +
-            "<if test=\"fatherFlag != null and fatherFlag != '' \">" +
-            " father_flag = #{fatherFlag}, " +
-            "</if>" +
-            "<if test=\"ybCode2 != null and ybCode2 != '' \">" +
-            " yb_code2 = #{ybCode2}, " +
-            "</if>" +
-            "<if test=\"ybComment2 != null and ybComment2 != '' \">" +
-            " yb_comment2 = #{ybComment2}, " +
-            "</if>" +
-            "<if test=\"byjFlag != null and byjFlag != '' \">" +
-            " byj_flag = #{byjFlag}, " +
-            "</if>" +
-            "<if test=\"antitumorLevel != null and antitumorLevel != '' \">" +
-            " antitumor_level = #{antitumorLevel}, " +
-            "</if>" +
-            "<if test=\"categoriesFlag != null and categoriesFlag != '' \">" +
-            " categories_flag = #{categoriesFlag}, " +
-            "</if>" +
-            "<if test=\"purchaseCode != null and purchaseCode != '' \">" +
-            " purchase_code = #{purchaseCode}, " +
-            "</if>" +
-            "<if test=\"fzFlag != null and fzFlag != '' \">" +
-            " fz_flag = #{fzFlag}, " +
-            "</if>" +
-            "<if test=\"clFlag != null and clFlag != '' \">" +
-            " cl_flag = #{clFlag}, " +
-            "</if>" +
-            "<if test=\"jsFlag != null and jsFlag != '' \">" +
-            " js_flag = #{jsFlag}, " +
-            "</if>" +
-            "<if test=\"qjFlag != null and qjFlag != '' \">" +
-            " qj_flag = #{qjFlag}, " +
-            "</if>" +
-            "<if test=\"ymFlag != null and ymFlag != '' \">" +
-            " ym_flag = #{ymFlag}, " +
-            "</if>" +
-            "<if test=\"dpymFlag != null and dpymFlag != '' \">" +
-            " dpym_flag = #{dpymFlag}, " +
-            "</if>" +
-            "<if test=\"isCentralPurchase != null and isCentralPurchase != '' \">" +
-            " is_central_purchase = #{isCentralPurchase}, " +
-            "</if>" +
-            "<if test=\"kjywFlag != null and kjywFlag != '' \">" +
-            " kjyw_flag = #{kjywFlag}, " +
-            "</if>" +
-            "<if test=\"dddValue != null and dddValue != '' \">" +
-            " ddd_value = #{dddValue}, " +
-            "</if>" +
-            "<if test=\"dddUnit != null and dddUnit != '' \">" +
-            " ddd_unit = #{dddUnit}, " +
-            "</if>" +
-            "<if test=\"pzwh != null and pzwh != '' \">" +
-            " pzwh = #{pzwh}, " +
-            "</if>" +
-            "<if test=\"comment != null and comment != '' \">" +
-            " comment = #{comment}, " +
-            "</if>" +
-            "<if test=\"xtppName != null and xtppName != '' \">" +
-            " xtpp_name = #{xtppName}, " +
-            "</if>" +
-            "<if test=\"spName != null and spName != '' \">" +
-            " sp_name = #{spName}, " +
-            "</if>" +
-            "<if test=\"fhName != null and fhName != '' \">" +
-            " fh_name = #{fhName}, " +
-            "</if>" +
-            "<if test=\"ybFlagNew != null and ybFlagNew != '' \">" +
-            " yb_flag_new = #{ybFlagNew}, " +
-            "</if>" +
-            "<if test=\"ybBlNew != null and ybBlNew != '' \">" +
-            " yb_bl_new = #{ybBlNew}, " +
-            "</if>" +
-            "<if test=\"wgType != null and wgType != '' \">" +
-            " wg_type = #{wgType}, " +
-            "</if>" +
-            "<if test=\"ybCommentNew != null and ybCommentNew != '' \">" +
-            " yb_comment_new = #{ybCommentNew}, " +
-            "</if>" +
-            "<if test=\"wjwYpid != null and wjwYpid != '' \">" +
-            " wjw_ypid = #{wjwYpid}, " +
-            "</if>" +
-            "<if test=\"yjjYpid != null and yjjYpid != '' \">" +
-            " yjj_ypid = #{yjjYpid}, " +
-            "</if>" +
-            "<if test=\"rsbYpid != null and rsbYpid != '' \">" +
-            " rsb_ypid = #{rsbYpid}, " +
-            "</if>" +
-            "<if test=\"drugControlCode != null and drugControlCode != '' \">" +
-            " drug_control_code = #{drugControlCode}, " +
-            "</if>" +
-            "<if test=\"nationalCode != null and nationalCode != '' \">" +
-            " national_code = #{nationalCode}" +
-            "</if>" +
-            "<if test=\"operDate != null and operDate != '' \">" +
-            " oper_date = #{operDate}, " +
-            "</if>" +
-            "<if test=\"operId != null and operId != '' \">" +
-            " oper_id = #{operId}, " +
-            "</if>" +
-            "</trim>" +
-            " where code = #{code} and serial = #{serial}" +
-            "</script>")
-    int updateYpZdDictSync(YpZdDictVo ypZdDictVo);
-
     @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, " +

+ 6 - 7
src/main/java/thyyxxk/webserver/entity/medicine/YpZdDictVo.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import lombok.Data;
 
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * @ClassName YpZdDictVo
@@ -24,9 +23,9 @@ public class YpZdDictVo {
     private String classCode; // 药性
     private String dosage; // 剂型
     private String concentration; // 浓度
-    private BigDecimal weight; // 重量
+    private Double weight; // 重量
     private String weighUnit; // 重量单位
-    private BigDecimal volum; // 体积
+    private Double volum; // 体积
     private String volUnit; // 体积单位
     private String miniUnit; // 最小单位
     private BigDecimal packSize; // 包装量
@@ -69,7 +68,7 @@ public class YpZdDictVo {
     private String kssFlag; // 抗生素标志:1 抗生素
     private String ypLevel; // 药品级别
     private String selfFlagYb; // 医保自费
-    private String orderDosage; // 常用剂量
+    private Double orderDosage; // 常用剂量
     private String dosageUnit; // 常用计量单位
     private String jbFlag; // 国家基本药物
     private String location; // 货位号
@@ -89,8 +88,8 @@ public class YpZdDictVo {
     private String dpymFlag; // 搭配溶媒:1 是
     private String isCentralPurchase; // 统一采购:1 是
     private String kjywFlag; // 抗菌药物(类型)
-    private BigDecimal dddValue; // DDD值
-    private BigDecimal dddUnit; // DDD值消耗单位
+    private Double dddValue; // DDD值
+    private Double dddUnit; // DDD值消耗单位
     private String pzwh; // 批准文号
     private String comment; // 备注
     private String xtppName; // 系统匹配名
@@ -105,7 +104,7 @@ public class YpZdDictVo {
     private String rsbYpid; // 社会保险药品编码
     private String drugControlCode; // 药管平台码
     private String nationalCode; // 国家医保编码
-    private Date operDate;
+    private String operDate;
     private String operId;
     private String tempPurchaseFlag; // 临时购药标志(1:临时购药)
     @TableField(exist = false)

+ 24 - 7
src/main/java/thyyxxk/webserver/service/medicine/YpDictService.java

@@ -1,5 +1,7 @@
 package thyyxxk.webserver.service.medicine;
 
+import cn.hutool.core.convert.Convert;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import io.micrometer.core.instrument.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -779,7 +781,11 @@ public class YpDictService {
             if(null == ypDict){
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, code + "没有需要更新的药品账页字典信息!");
             }
-            num = dao.updateYpZdDictSync(ypZdDictVo);
+            YpZdDict zdDict = callYpVoChargeDict(ypZdDictVo);
+            UpdateWrapper<YpZdDict> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.eq("code",zdDict.getCode());
+            updateWrapper.eq("serial",zdDict.getSerial());
+            num = dao.update(zdDict, updateWrapper);
             if(num == 0){
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新药品账页字典失败!");
             }
@@ -806,13 +812,8 @@ public class YpDictService {
             ypZdDictVo.setCode(maxCode);
             String serial = ypZdDictVo.getMiniUnit().equals(ypZdDictVo.getPackUnit()) ? "01" : "99";
             ypZdDictVo.setSerial(serial);
-            // 根据名称生成新的拼音码和五笔码
-            ypZdDictVo.setPyCode(PingYinUtils.pyShouZiMuDaXie(ypZdDictVo.getName()));
-            ypZdDictVo.setDcode(PingYinUtils.getWBCode(ypZdDictVo.getName()));
-            ypZdDictVo.setOperDate(new Date());
             ypZdDictVo.setOperId("");
-            YpZdDict copyVo = new YpZdDict();
-            BeanUtils.copyProperties(ypZdDictVo, copyVo, YpZdDict.class);
+            YpZdDict copyVo = callYpVoChargeDict(ypZdDictVo);
             copyVo.setDrugId(copyVo.getCode());
             num = dao.insert(copyVo);
             if(num == 0){
@@ -846,6 +847,22 @@ public class YpDictService {
         return ResultVoUtil.success(resultMap);
     }
 
+    private YpZdDict callYpVoChargeDict(YpZdDictVo ypZdDictVo) {
+        YpZdDict copyVo = new YpZdDict();
+        BeanUtils.copyProperties(ypZdDictVo, copyVo, YpZdDict.class);
+        copyVo.setOperDate(new Date());
+        // 根据名称生成新的拼音码和五笔码
+        copyVo.setPyCode(PingYinUtils.pyShouZiMuDaXie(ypZdDictVo.getName()));
+        copyVo.setDCode(PingYinUtils.getWBCode(ypZdDictVo.getName()));
+        copyVo.setNCode(ypZdDictVo.getNcode());
+        copyVo.setPackSize(Convert.toDouble(ypZdDictVo.getPackSize()));
+        copyVo.setPackRetprice(Convert.toDouble(ypZdDictVo.getPackRetprice()));
+        copyVo.setRetprice(Convert.toDouble(ypZdDictVo.getRetprice()));
+        copyVo.setBuyPrice(Convert.toDouble(ypZdDictVo.getBuyPrice()));
+        copyVo.setYbxjPrice(Convert.toDouble(ypZdDictVo.getBuyPrice()));
+        return copyVo;
+    }
+
     private YpPrintName callYpPrintName(YpZdDictVo ypZdDictVo, String ypFlag) {
         YpPrintName name = new YpPrintName();
         name.setChargeCode(ypZdDictVo.getCode());