Commit cb21dce8 authored by 王国存's avatar 王国存

Merge branch 'master' into 'test'

审批-通过/驳回修改

See merge request !13
parents 418765fb d718fd87
...@@ -81,4 +81,6 @@ public interface QuestionnaireDao { ...@@ -81,4 +81,6 @@ public interface QuestionnaireDao {
List<PerformanceSummaryTotal> queryGuideAndRewardIndexList(); List<PerformanceSummaryTotal> queryGuideAndRewardIndexList();
Integer updateAnswerScore(Answer answer); Integer updateAnswerScore(Answer answer);
List<Answer> selectAnswerByStatus(@Param("recordId") Long recordId);
} }
...@@ -15,6 +15,7 @@ import com.tiptimes.model.Record; ...@@ -15,6 +15,7 @@ import com.tiptimes.model.Record;
import com.tiptimes.model.Review; import com.tiptimes.model.Review;
import com.tiptimes.model.exportDTO.*; import com.tiptimes.model.exportDTO.*;
import com.tiptimes.service.QuestionnaireService; import com.tiptimes.service.QuestionnaireService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment;
...@@ -86,7 +87,17 @@ public class QuestionnaireServiceImpl implements QuestionnaireService { ...@@ -86,7 +87,17 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
@Override @Override
@Transactional @Transactional
public Integer updateRecord(Record record) { public Integer updateRecord(Record record) {
//先去查询 t_review 表里的审批状态是否为通过,都是通过的状态,更新列表的审批状态为已审批=3 //先去查询 t_review 表里的审批状态是否全部为通过,都是通过的状态,更新列表的审批状态为已审批=3
Integer processStatus;
List<Answer> answerList = questionnaireDao.selectAnswerByStatus(record.getReviews().get(0).getRecordId());
if(CollectionUtils.isNotEmpty(answerList)){
if(answerList.size() > 0){
processStatus = record.getProcessStatus();
record.setProcessStatus(processStatus);
}else{
record.setProcessStatus(3);
}
}
return questionnaireDao.updateRecord(record); return questionnaireDao.updateRecord(record);
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</insert> </insert>
<insert id="insertReview"> <insert id="insertReview">
INSERT INTO t_review (`questions_id`, `remark`,'score','approval_status', `record_id`) VALUES INSERT INTO t_review (`questions_id`, `remark`,`score`,`approval_status`, `record_id`) VALUES
<foreach collection="list" item="list" separator=","> <foreach collection="list" item="list" separator=",">
( #{list.questionsId}, #{list.remark},#{list.score}, #{list.approvalStatus} #{recordId}) ( #{list.questionsId}, #{list.remark},#{list.score}, #{list.approvalStatus} #{recordId})
</foreach> </foreach>
...@@ -577,6 +577,7 @@ ...@@ -577,6 +577,7 @@
WHERE queation.isWhetherSpace IS NOT NULL; WHERE queation.isWhetherSpace IS NOT NULL;
</select> </select>
<!--更新问题表的分数,汇总统计使用-->
<update id="updateAnswerScore"> <update id="updateAnswerScore">
UPDATE t_answer UPDATE t_answer
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
...@@ -584,4 +585,16 @@ ...@@ -584,4 +585,16 @@
</trim> </trim>
WHERE record_id = #{recordId} and options_id = #{optionsId} WHERE record_id = #{recordId} and options_id = #{optionsId}
</update> </update>
<!--查询审批页面各个问题是否都是通过状态,封信列表的审批状态使用-->
<select id="selectAnswerByStatus" resultType="com.tiptimes.model.Answer">
SELECT
approval_status
FROM
t_answer
WHERE
approval_status != 1
and
<if test="recordId != null and recordId != ''">record_id = #{recordId}</if>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment