Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
3e4142d8
Unverified
Commit
3e4142d8
authored
Nov 11, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
修复 v3.6.7 升级程序问题
parent
ca2eedbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/main/java/org/b3log/solo/upgrade/V366_367.java
src/main/java/org/b3log/solo/upgrade/V366_367.java
+6
-6
No files found.
src/main/java/org/b3log/solo/upgrade/V366_367.java
View file @
3e4142d8
...
...
@@ -24,7 +24,6 @@ import org.b3log.latke.logging.Logger;
import
org.b3log.latke.repository.*
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.repository.ArchiveDateArticleRepository
;
import
org.b3log.solo.repository.ArchiveDateRepository
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.json.JSONObject
;
...
...
@@ -34,7 +33,7 @@ import java.util.List;
* Upgrade script from v3.6.6 to v3.6.7.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.
0
.0, Nov 11, 2019
* @version 1.0.
1
.0, Nov 11, 2019
* @since 3.6.7
*/
public
final
class
V366_367
{
...
...
@@ -57,7 +56,6 @@ public final class V366_367 {
final
BeanManager
beanManager
=
BeanManager
.
getInstance
();
final
OptionRepository
optionRepository
=
beanManager
.
getReference
(
OptionRepository
.
class
);
final
ArchiveDateRepository
archiveDateRepository
=
beanManager
.
getReference
(
ArchiveDateRepository
.
class
);
final
ArchiveDateArticleRepository
archiveDateArticleRepository
=
beanManager
.
getReference
(
ArchiveDateArticleRepository
.
class
);
try
{
final
Transaction
transaction
=
optionRepository
.
beginTransaction
();
...
...
@@ -78,16 +76,18 @@ public final class V366_367 {
"\t\t\tarticle_oId\n"
+
"\t\tHAVING\n"
+
"\t\t\tcount(*) > 1\n"
+
"\t) ORDER BY archiveDate_oId DESC"
);
"\t) ORDER BY archiveDate_oId
, article_oId
DESC"
);
for
(
int
i
=
0
;
i
<
archiveDateArticles
.
size
();
i
++)
{
final
JSONObject
archiveDateArticle
=
archiveDateArticles
.
get
(
i
);
final
String
archiveDateId
=
archiveDateArticle
.
optString
(
"archiveDate_oId"
);
final
String
articleId
=
archiveDateArticle
.
optString
(
"article_oId"
);
archiveDateArticleRepository
.
remove
(
new
Query
().
setFilter
(
CompositeFilterOperator
.
and
(
new
PropertyFilter
(
"archiveDate_oId"
,
FilterOperator
.
EQUAL
,
archiveDateId
),
new
PropertyFilter
(
"article_oId"
,
FilterOperator
.
EQUAL
,
ar
chiveDateArticle
.
optString
(
"article_oId"
)
),
new
PropertyFilter
(
"article_oId"
,
FilterOperator
.
EQUAL
,
ar
ticleId
),
new
PropertyFilter
(
"oId"
,
FilterOperator
.
NOT_EQUAL
,
archiveDateArticle
.
optString
(
"oId"
)))));
while
(
i
<
archiveDateArticles
.
size
()
-
1
)
{
if
(!
archiveDateId
.
equalsIgnoreCase
(
archiveDateArticles
.
get
(
i
+
1
).
optString
(
"archiveDate_oId"
)))
{
if
(!
archiveDateId
.
equalsIgnoreCase
(
archiveDateArticles
.
get
(
i
+
1
).
optString
(
"archiveDate_oId"
))
||
!
articleId
.
equalsIgnoreCase
(
archiveDateArticles
.
get
(
i
+
1
).
optString
(
"article_oId"
)))
{
break
;
}
i
++;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment