File tree Expand file tree Collapse file tree
pegr/grails-app/services/pegr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class QfileUploadService {
2525 def warnings = []
2626 def newProjectCount = 0
2727 def MAX_NEW_PROJECT_COUNT = 10
28+ def projectNames = []
2829
2930 while ((rawdata = reader. readNext()) != null ) {
3031 ++ lineNo
@@ -36,9 +37,13 @@ class QfileUploadService {
3637 cleanRawData(rawdata)
3738 def data = getNamedData(rawdata)
3839 def projectName = getProjectName(data. projectName, data. service, data. invoice)
39- def project = Project . findByName(projectName)
40- if (! project) {
41- newProjectCount++
40+ if (! projectNames. contains(projectName)) {
41+ projectNames. push(projectName)
42+
43+ def project = Project . findByName(projectName)
44+ if (! project) {
45+ newProjectCount++
46+ }
4247 }
4348 }
4449 if (newProjectCount > MAX_NEW_PROJECT_COUNT ) {
You can’t perform that action at this time.
0 commit comments