|
|
@@ -48,11 +48,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 打样申请单
|
|
|
@@ -565,4 +561,54 @@ public class PurchaseProofingServiceImpl implements PurchaseProofingService {
|
|
|
purchaseProofingItemDao.save(saveItems);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取待送样单据数量
|
|
|
+ *
|
|
|
+ * @param vendUU
|
|
|
+ * @param enUUs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int countTodoProofing(Long vendUU, Collection enUUs) {
|
|
|
+ return getCountByVenduuAndEnuuAndStatus(vendUU, enUUs, (short) Status.UNSEND.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取已送样单据数量
|
|
|
+ *
|
|
|
+ * @param vendUU
|
|
|
+ * @param enUUs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int countDoneProofing(Long vendUU, Collection enUUs) {
|
|
|
+ return getCountByVenduuAndEnuuAndStatus(vendUU, enUUs, (short) Status.SEND.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取已作废单据数量
|
|
|
+ *
|
|
|
+ * @param vendUU
|
|
|
+ * @param enUUs
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int countInvalidProofing(Long vendUU, Collection enUUs) {
|
|
|
+ return getCountByVenduuAndEnuuAndStatus(vendUU, enUUs, (short) Status.CANCELLED.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据供应商UU号和买方UU号、状态来获取统计数量
|
|
|
+ * @param vendUU
|
|
|
+ * @param enUUs
|
|
|
+ * @param status
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private int getCountByVenduuAndEnuuAndStatus(Long vendUU, Collection enUUs, short status) {
|
|
|
+ if (CollectionUtils.isEmpty(enUUs)) {
|
|
|
+ return purchaseProofingItemDao.countByVendUUAndStatus(vendUU, status);
|
|
|
+ }
|
|
|
+ return purchaseProofingItemDao.countByVendUUAndEnUUsAndStatus(vendUU, enUUs, status);
|
|
|
+ }
|
|
|
+
|
|
|
}
|