Browse Source

Merge branch 'master' into 'master'

新增药品高警示和带量中选设置

See merge request lighter/web-server!106
huangshuhua 1 year ago
parent
commit
341c3dfc10

+ 10 - 0
src/main/java/thyyxxk/webserver/controller/yp/YpDictController.java

@@ -231,4 +231,14 @@ public class YpDictController {
         return service.selectYpStorageInfo(code, groupNo);
     }
 
+    @GetMapping("/updateYpHighWarning")
+    public ResultVo<Map<String, Object>> updateYpHighWarning(@RequestParam("code") String code, @RequestParam("serial") String serial, @RequestParam("flag") String flag){
+        return service.updateYpHighWarning(code, serial, flag);
+    }
+
+    @GetMapping("/updateYpWinningBidder")
+    public ResultVo<Map<String, Object>> updateYpWinningBidder(@RequestParam("code") String code, @RequestParam("serial") String serial, @RequestParam("flag") String flag){
+        return service.updateYpWinningBidder(code, serial, flag);
+    }
+
 }

+ 9 - 1
src/main/java/thyyxxk/webserver/dao/his/yp/YpDictDao.java

@@ -49,7 +49,9 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
             " rtrim(zd.name) as name,  " +
             " zd.specification,  " +
             " zd.pack_retprice as packRetprice,  " +
-            " zd.temp_purchase_flag as tempPurchaseFlag,  " +
+            " isnull(zd.temp_purchase_flag, '0') as tempPurchaseFlag,  " +
+            " isnull(zd.high_warning_flag, '0') as highWarningFlag,  " +
+            " isnull(zd.winning_bidder_flag, '0') as winningBidderFlag,  " +
             " rtrim(isnull(zd.jb_flag, '0')) as jbFlag,  " +
             " isnull(zd.del_flag, '0') as delFlag,  " +
             " isnull(yc.name, '') as manuFactory, " +
@@ -577,4 +579,10 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
     @Update(" update yp_base_yf set visible_flag_mz = #{delFlag}, visible_flag_zy = #{delFlag} where charge_code = #{code} ")
     void updateYpBaseYfDelFlagByCode(@Param("code") String code, @Param("delFlag") String delFlag);
 
+    @Update(" update yp_zd_dict set high_warning_flag = #{flag} where code = #{code} ")
+    int updateYpHighWarningByCode(@Param("code") String code, @Param("flag") String flag);
+
+    @Update(" update yp_zd_dict set winning_bidder_flag = #{flag} where code = #{code} ")
+    int updateYpWinningBidderByCode(@Param("code") String code, @Param("flag") String flag);
+
 }

+ 12 - 0
src/main/java/thyyxxk/webserver/entity/inpatient/YpZdDict.java

@@ -877,4 +877,16 @@ public class YpZdDict implements Serializable {
     @TableField(value = "temp_purchase_flag")
     private String tempPurchaseFlag;
 
+    /**
+     * 高警示药品标志(1:高警示药品)
+     */
+    @TableField(value = "high_warning_flag")
+    private String highWarningFlag;
+
+    /**
+     * 国家组织药品集中采购中标药品标志(1:国家组织药品集中采购中标药品) --- 带量中选
+     */
+    @TableField(value = "winning_bidder_flag")
+    private String winningBidderFlag;
+
 }

+ 62 - 0
src/main/java/thyyxxk/webserver/service/yp/YpDictService.java

@@ -1120,4 +1120,66 @@ public class YpDictService {
         return ResultVoUtil.success(resultMap);
     }
 
+    /**
+     * @Description 更新高警示药品标志
+     * @Author hsh
+     * @param code 药品编码 serial 序号 flag 高警示药品标志
+     * @return map
+     * @Date 2024/9/2 16:32
+     */
+    public ResultVo<Map<String, Object>> updateYpHighWarning(String code, String serial, String flag){
+        if(StringUtil.isBlank(code)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到药品编码,请检查!");
+        }
+
+        YpZdDict yp = dao.selectYpDictByCode(code, serial);
+        if(null == yp){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "药品编码(" + code + ")的药品账页字典信息不存在,请检查!");
+        }
+
+        Map<String, Object> resultMap = new HashMap<>();
+        try{
+            int num = dao.updateYpHighWarningByCode(code, flag);
+            if(num == 0){
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新高警示药品标志失败!");
+            }
+            resultMap.put("cg", "更新高警示药品标志成功!");
+            return ResultVoUtil.success(resultMap);
+        } catch(Exception e){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新高警示药品标志失败!");
+        }
+
+    }
+
+    /**
+     * @Description 更新国家组织药品集中采购中标药品标志
+     * @Author hsh
+     * @param code 药品编码 serial 序号 flag 国家组织药品集中采购中标药品标志
+     * @return map
+     * @Date 2024/9/2 17:15
+     */
+    public ResultVo<Map<String, Object>> updateYpWinningBidder(String code, String serial, String flag){
+        if(StringUtil.isBlank(code)) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到药品编码,请检查!");
+        }
+
+        YpZdDict yp = dao.selectYpDictByCode(code, serial);
+        if(null == yp){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "药品编码(" + code + ")的药品账页字典信息不存在,请检查!");
+        }
+
+        Map<String, Object> resultMap = new HashMap<>();
+        try{
+            int num = dao.updateYpWinningBidderByCode(code, flag);
+            if(num == 0){
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新国家组织药品集中采购中标药品标志失败!");
+            }
+            resultMap.put("cg", "更新国家组织药品集中采购中标药品标志成功!");
+            return ResultVoUtil.success(resultMap);
+        } catch(Exception e){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新国家组织药品集中采购中标药品标志失败!");
+        }
+
+    }
+
 }