Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
王琮
platform
Commits
c640a644
Commit
c640a644
authored
Oct 23, 2023
by
刘鑫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改BUG
parent
ffacb08d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
25 deletions
+62
-25
QuestionnaireDao.java
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
+6
-0
QuestionnaireServiceImpl.java
...a/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
+42
-25
Questionnaire.xml
src/main/resources/mapper/Questionnaire.xml
+14
-0
No files found.
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
View file @
c640a644
...
...
@@ -3,6 +3,7 @@ package com.tiptimes.dao;
import
com.tiptimes.ctrl.QuestionnaireVo
;
import
com.tiptimes.model.*
;
import
com.tiptimes.model.QuestionnaireDTO.AnswerDTO
;
import
com.tiptimes.model.QuestionnaireDTO.SaveQuestionByGroup
;
import
com.tiptimes.model.exportDTO.*
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -402,6 +403,11 @@ public interface QuestionnaireDao {
@Param
(
"questionnaireUuid"
)
Long
questionnaireUuid
);
List
<
SaveQuestionByGroup
>
queryReviewList
(
@Param
(
"createId"
)
String
createId
,
@Param
(
"questionnaireUuid"
)
Long
questionnaireUuid
);
Integer
updateReportStatus
(
@Param
(
"aId"
)
Integer
aId
);
int
saveQuestionByGroup
(
@Param
(
"questionsId"
)
int
questionsId
,
...
...
src/main/java/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
View file @
c640a644
...
...
@@ -2932,28 +2932,29 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
@Override
public
List
<
SaveQuestionByGroup
>
queryReview
(
Long
uid
,
String
createId
,
int
year
)
{
// 查询上报记录id
try
{
Integer
aId
=
questionnaireDao
.
queryReport
(
createId
,
uid
);
ArrayList
<
SaveQuestionByGroup
>
saveQuestionByGroups
=
new
ArrayList
<>();
for
(
FormGroup
formGroup
:
questionnaireDao
.
queryGroup
(
Integer
.
parseInt
(
uid
.
toString
())))
{
String
questionsId
=
formGroup
.
getQuestionId
();
int
questionId
=
Integer
.
parseInt
(
questionsId
.
split
(
","
)[
0
]);
SaveQuestionByGroup
saveQuestionByGroup
=
new
SaveQuestionByGroup
();
Review
review
=
questionnaireDao
.
selectReview
(
questionId
,
aId
,
formGroup
.
getGroupId
());
if
(
review
==
null
)
{
saveQuestionByGroups
.
add
(
null
);
continue
;
}
saveQuestionByGroup
.
setGroupId
(
formGroup
.
getGroupId
());
saveQuestionByGroup
.
setStatus
(
review
.
getApprovalStatus
());
saveQuestionByGroup
.
setScore
(
review
.
getScore
());
saveQuestionByGroup
.
setRemark
(
review
.
getRemark
());
saveQuestionByGroups
.
add
(
saveQuestionByGroup
);
}
return
saveQuestionByGroups
;
}
catch
(
Exception
e
)
{
return
null
;
}
// try {
// Integer aId = questionnaireDao.queryReport(createId, uid);
// ArrayList<SaveQuestionByGroup> saveQuestionByGroups = new ArrayList<>();
// for (FormGroup formGroup : questionnaireDao.queryGroup(Integer.parseInt(uid.toString()))) {
// String questionsId = formGroup.getQuestionId();
// int questionId = Integer.parseInt(questionsId.split(",")[0]);
// SaveQuestionByGroup saveQuestionByGroup = new SaveQuestionByGroup();
// Review review = questionnaireDao.selectReview(questionId, aId, formGroup.getGroupId());
// if (review == null) {
// saveQuestionByGroups.add(null);
// continue;
// }
// saveQuestionByGroup.setGroupId(formGroup.getGroupId());
// saveQuestionByGroup.setStatus(review.getApprovalStatus());
// saveQuestionByGroup.setScore(review.getScore());
// saveQuestionByGroup.setRemark(review.getRemark());
// saveQuestionByGroups.add(saveQuestionByGroup);
// }
// return saveQuestionByGroups;
// } catch (Exception e) {
// return null;
// }
return
questionnaireDao
.
queryReviewList
(
createId
,
uid
);
}
@Override
...
...
@@ -3031,7 +3032,8 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 按照,分割
for
(
String
str
:
list
)
{
if
(
str
==
null
)
{
if
(
str
==
null
||
str
.
trim
().
equals
(
","
))
{
rows
.
add
(
new
String
[
0
]);
continue
;
}
rows
.
add
(
str
.
split
(
","
));
...
...
@@ -3068,6 +3070,13 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
if
(
resultArray
.
length
==
0
)
{
return
new
ArrayList
<>();
}
for
(
String
[]
row
:
resultArray
)
{
for
(
int
j
=
0
;
j
<
row
.
length
;
j
++)
{
if
(
row
[
j
]
==
null
)
{
row
[
j
]
=
""
;
// 将null替换为""
}
}
}
for
(
int
i
=
0
;
i
<
resultArray
[
0
].
length
;
i
++)
{
StringBuilder
s
=
new
StringBuilder
();
...
...
@@ -3088,7 +3097,8 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 按照,分割
for
(
String
str
:
list
)
{
if
(
str
==
null
)
{
if
(
str
==
null
||
str
.
trim
().
equals
(
","
))
{
rows
.
add
(
new
String
[
0
]);
continue
;
}
rows
.
add
(
str
.
split
(
","
));
...
...
@@ -3111,6 +3121,7 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
// 判断条件
List
<
String
[]>
resultList
=
new
ArrayList
<>();
for
(
String
[]
row
:
result
)
{
if
(
"是"
.
equals
(
row
[
15
])
||
"是"
.
equals
(
row
[
11
]))
{
resultList
.
add
(
row
);
}
...
...
@@ -3123,7 +3134,13 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
if
(
resultArray
.
length
==
0
)
{
return
new
ArrayList
<>();
}
for
(
String
[]
row
:
resultArray
)
{
for
(
int
j
=
0
;
j
<
row
.
length
;
j
++)
{
if
(
row
[
j
]
==
null
)
{
row
[
j
]
=
""
;
// 将null替换为""
}
}
}
List
<
String
>
str
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
resultArray
[
0
].
length
;
i
++)
{
...
...
src/main/resources/mapper/Questionnaire.xml
View file @
c640a644
...
...
@@ -2066,6 +2066,20 @@
ORDER BY spaceName
</select>
<select
id=
"queryReviewList"
resultType=
"com.tiptimes.model.QuestionnaireDTO.SaveQuestionByGroup"
>
SELECT tre.approval_status as status,
tre.group_id as groupId,
tre.score as score,
tre.remark as remark
FROM t_record tr
LEFT JOIN t_review tre on tre.record_id = tr.id
WHERE tr.create_id = #{createId}
AND tr.questionnaire_uuid = #{questionnaireUuid}
ORDER BY tre.group_id
</select>
<!-- <select id="queryArray" resultType="java.lang.Integer">-->
<!-- SELECT t_options.id FROM t_options-->
<!-- WHERE t_options.question_id IN-->
...
...
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