Browse Source

出库查询总数优化

guarantee-lsq 2 years ago
parent
commit
4d52be8a47

+ 8 - 2
platform-service/src/main/java/com/platform/service/store/impl/OutStoreFormServiceImpl.java

@@ -242,9 +242,15 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
     @Override
     public OutStoreForm saveModelByDTOYY(OutStoreFormDTO model) {
         UserInfo userInfo = SecurityUtils.getUserInfo();
-        Weekend<OutStoreForm> weekend = new Weekend<>(OutStoreForm.class);
+        // selectCount会有分页参数,偶尔会出现bug,修复
+        BigDecimal countNum = mapper.getOutStoreFormCount1(new OutStoreFormDTO());
+        Integer count = 0;
+        if(countNum != null){
+            count = countNum.intValue();
+        }
+        /*Weekend<OutStoreForm> weekend = new Weekend<>(OutStoreForm.class);
         weekend.weekendCriteria().andIsNotNull(OutStoreForm::getId);
-        Integer count = mapper.selectCountByExample(weekend);
+        Integer count = mapper.selectCountByExample(weekend);*/
         model.setOutNo(IdGeneratorUtils.getOutStoreNo(++count));
         model.setDelFlag(false);
         model.setUserInfo(userInfo);