|
|
@@ -691,6 +691,8 @@ public class YpDictService {
|
|
|
if(num == 0){
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新药品账页字典停用或启用失败!");
|
|
|
}
|
|
|
+ // 更新药房对应药品的状态
|
|
|
+ dao.updateYpBaseYfDelFlagByCode(code, delFlag);
|
|
|
resultMap.put("cg", "更新药品账页字典停用或启用成功!");
|
|
|
return ResultVoUtil.success(resultMap);
|
|
|
} catch(Exception e){
|
|
|
@@ -758,8 +760,8 @@ public class YpDictService {
|
|
|
/**
|
|
|
* @Description 药品账页信息保存
|
|
|
* @Author hsh
|
|
|
- * @param
|
|
|
- * @return
|
|
|
+ * @param ypZdDictVo 药品账页信息
|
|
|
+ * @return map
|
|
|
* @Date 2024/2/17 9:33
|
|
|
*/
|
|
|
public ResultVo<Map<String, Object>> saveYpDict(YpZdDictVo ypZdDictVo){
|
|
|
@@ -1039,6 +1041,8 @@ public class YpDictService {
|
|
|
if(num == 0){
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "更新药库药品停用或启用失败!");
|
|
|
}
|
|
|
+ // 更新药库药品的状态
|
|
|
+ dao.updateYpBaseNoDelFlagByCode(code, delFlag, groupNo);
|
|
|
resultMap.put("cg", "更新药库药品停用或启用成功!");
|
|
|
return ResultVoUtil.success(resultMap);
|
|
|
} catch(Exception e){
|
|
|
@@ -1078,4 +1082,42 @@ public class YpDictService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<Map<String, Object>> selectYpStorageInfo(String code, String groupNo){
|
|
|
+ if(StringUtil.isBlank(code)) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到药品编码,请检查!");
|
|
|
+ }
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ StringBuilder msg = new StringBuilder();
|
|
|
+ if(StringUtil.isBlank(groupNo)){
|
|
|
+ List<Map<String, Object>> msgYf = dao.selectYpStorageBaseYf(code);
|
|
|
+ if(!msgYf.isEmpty()){
|
|
|
+ for(Map<String, Object> yfMap : msgYf){
|
|
|
+ String groupName = (String) yfMap.get("groupName");
|
|
|
+ Double stockAmount = (Double) yfMap.get("stockAmount");
|
|
|
+ msg.append(groupName).append("剩余库存:").append(stockAmount).append("。 ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(msg.length() > 0){
|
|
|
+ resultMap.put("msg", msg);
|
|
|
+ } else {
|
|
|
+ resultMap.put("msg", "各药房无库存。");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<Map<String, Object>> msgYk = dao.selectYpStorageBase(code, groupNo);
|
|
|
+ if(!msgYk.isEmpty()){
|
|
|
+ for(Map<String, Object> ykMap : msgYk){
|
|
|
+ String groupName = (String) ykMap.get("groupName");
|
|
|
+ Double stockAmount = (Double) ykMap.get("stockAmount");
|
|
|
+ msg.append(groupName).append("剩余库存:").append(stockAmount).append("。 ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(msg.length() > 0){
|
|
|
+ resultMap.put("msg", msg);
|
|
|
+ } else {
|
|
|
+ resultMap.put("msg", "各药库无库存。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultVoUtil.success(resultMap);
|
|
|
+ }
|
|
|
+
|
|
|
}
|