瀏覽代碼

后台限制重复入库

hsh 2 年之前
父節點
當前提交
efe6e96f1f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpInDetlServiceImpl.java

+ 7 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpInDetlServiceImpl.java

@@ -224,6 +224,13 @@ public class YpInDetlServiceImpl implements YpInDetlService {
         inDetl.setConfirmFlag("1");
         inDetl.setConfirmId(userId);
         inDetl.setConfirmDate(new Date());
+        YpInDetlVo vo = new YpInDetlVo();
+        BeanUtils.copyProperties(inDetl, vo);
+        vo.setConfirmFlag("0");
+        int num = ypInDetlMapper.selectYpInDetlCount(vo);
+        if(num == 0){
+            throw new MzException("药库入库药品异常,入库单号:" + vo.getInDocuNo() + "没有可入库的药品,请检查! ");
+        }
         ypInDetlMapper.updateYpInDetl(inDetl);
         List<YpInDetl> ypInDetls = ypInDetlMapper.selectYpInDetl(inDetl);
         for (int i = 0; i < ypInDetls.size(); i++) {