Browse Source

后台限制重复入库

hsh 2 years ago
parent
commit
efe6e96f1f

+ 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++) {