Browse Source

新增口服药退药设置功能

hsh 8 months ago
parent
commit
f48713dc58

+ 6 - 1
src/main/java/thyyxxk/webserver/controller/medicine/YpDictController.java

@@ -246,4 +246,9 @@ public class YpDictController {
         return service.updateYpFocusMonitor(code, serial, flag);
     }
 
-}
+    @GetMapping("/updateYpReturnFlag")
+    public ResultVo<Map<String, Object>> updateYpReturnFlag(@RequestParam("code") String code, @RequestParam("serial") String serial, @RequestParam("flag") String flag){
+        return service.updateYpReturnFlag(code, serial, flag);
+    }
+
+}

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

@@ -53,8 +53,10 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
             " isnull(zd.high_warning_flag, '0') as highWarningFlag,  " +
             " isnull(zd.winning_bidder_flag, '0') as winningBidderFlag,  " +
             " isnull(zd.focus_monitor_flag, '0') as focusMonitorFlag,  " +
+            " isnull(zd.return_flag, '0') as returnFlag,  " +
             " rtrim(isnull(zd.jb_flag, '0')) as jbFlag,  " +
             " isnull(zd.del_flag, '0') as delFlag,  " +
+            " zd.categories_flag as categoriesFlag,  " +
             " isnull(yc.name, '') as manuFactory, " +
             "<if test=\" groupNo != null and groupNo != '' \">" +
             " isnull(base.del_flag, '0') as ykFlag,  " +
@@ -589,4 +591,7 @@ public interface YpDictDao extends BaseMapper<YpZdDict> {
     @Update(" update yp_zd_dict set focus_monitor_flag = #{flag} where code = #{code} ")
     int updateYpFocusMonitorByCode(@Param("code") String code, @Param("flag") String flag);
 
+    @Update(" update yp_zd_dict set return_flag = #{flag} where code = #{code} ")
+    int updateYpReturnFlagByCode(@Param("code") String code, @Param("flag") String flag);
+
 }

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

@@ -895,4 +895,10 @@ public class YpZdDict implements Serializable {
     @TableField(value = "focus_monitor_flag")
     private String focusMonitorFlag;
 
+    /**
+     * 口服药品是否允许退药标志(1:允许退药)
+     */
+    @TableField(value = "return_flag")
+    private String returnFlag;
+
 }

+ 31 - 0
src/main/java/thyyxxk/webserver/service/medicine/YpDictService.java

@@ -1213,4 +1213,35 @@ public class YpDictService {
 
     }
 
+    /**
+     * @Description 更新口服药品是否允许退药标志(1:允许退药)
+     * @Author hsh
+     * @param code 药品编码 serial 序号 flag 口服药品是否允许退药标志
+     * @return map
+     * @Date 2024/12/24 15:41
+     */
+    public ResultVo<Map<String, Object>> updateYpReturnFlag(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.updateYpReturnFlagByCode(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, "更新口服药品是否允许退药标志失败!");
+        }
+
+    }
+
 }