Forráskód Böngészése

定时任务处理维护资产(0)

5 éve
szülő
commit
f3357e0afa

+ 1 - 0
pcbms/src/main/java/com/hssx/pcbms/controller/IdeaController.java

@@ -84,6 +84,7 @@ public class IdeaController {
         HttpRespMsg msg = ideaService.ideaList(idea,page);
         HttpRespMsg msg = ideaService.ideaList(idea,page);
         return msg;
         return msg;
     }
     }
+
     /**
     /**
      * 打分根据年月去获取他的建议列表
      * 打分根据年月去获取他的建议列表
      * 参数:
      * 参数:

+ 4 - 1
pcbms/src/main/java/com/hssx/pcbms/service/impl/ScoreServiceImpl.java

@@ -121,8 +121,11 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
             idea.setUid(score.getUid());
             idea.setUid(score.getUid());
             List<IdeaVO> ideaVos = ideaMapper.getIdeaListByUid(idea, time);
             List<IdeaVO> ideaVos = ideaMapper.getIdeaListByUid(idea, time);
             if(ideaVos.size()>0){
             if(ideaVos.size()>0){
+                double sum = 0.0;
 //                vo.setIdeaVO(ideaVos);
 //                vo.setIdeaVO(ideaVos);
-                double sum = ideaVos.stream().filter(x -> x.getScore() != null).mapToDouble(Idea::getScore).sum();
+                for (IdeaVO ideaVo : ideaVos) {
+                    sum+=ideaVo.getScore();
+                }
                 vo.setIdeaScoreSum(sum);
                 vo.setIdeaScoreSum(sum);
             }
             }
         }
         }

+ 8 - 8
pcbms/src/main/resources/mapper/IdeaMapper.xml

@@ -38,13 +38,13 @@
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
         id, uid, indate, content, score, is_draft, is_evaluated, score_id
         id, uid, indate, content, score, is_draft, is_evaluated, score_id
     </sql>
     </sql>
-    
+
     <select id="getIdeaListByUid" resultMap="BaseResultMapVO">
     <select id="getIdeaListByUid" resultMap="BaseResultMapVO">
         select
         select
-            i.id, i.uid, i.indate idea_indate, i.content idea_content, i.score, i.is_draft, i.is_evaluated, i.score_id,
-            ic.id cid,ic.idea_id, ic.content, ic.responder_id, ic.responder, ic.indate
+        i.id, i.uid, i.indate idea_indate, i.content idea_content, i.score, i.is_draft, i.is_evaluated, i.score_id,
+        ic.id cid,ic.idea_id, ic.content, ic.responder_id, ic.responder, ic.indate
         from
         from
-            idea i
+        idea i
         left join idea_comment ic
         left join idea_comment ic
         on i.id = ic.idea_id
         on i.id = ic.idea_id
         <where>
         <where>
@@ -52,7 +52,7 @@
                 i.uid = #{idea.uid,jdbcType=INTEGER}
                 i.uid = #{idea.uid,jdbcType=INTEGER}
             </if>
             </if>
             <if test="time != null">
             <if test="time != null">
-               and date_format(i.indate,'%Y-%m') = #{time}
+                and date_format(i.indate,'%Y-%m') = #{time}
             </if>
             </if>
             <if test="idea.scoreId != null">
             <if test="idea.scoreId != null">
                 and score_id = #{idea.scoreId}
                 and score_id = #{idea.scoreId}
@@ -64,15 +64,15 @@
         select
         select
         id, uid, indate, score, is_draft, is_evaluated, score_id
         id, uid, indate, score, is_draft, is_evaluated, score_id
         from
         from
-            idea i
+        idea i
         <where>
         <where>
             i.uid = #{ideaVO.uid,jdbcType=INTEGER}
             i.uid = #{ideaVO.uid,jdbcType=INTEGER}
             and is_evaluated = 1
             and is_evaluated = 1
             <if test="ideaVO.time != null">
             <if test="ideaVO.time != null">
-               and date_format(i.indate,'%Y-%m') = #{time}
+                and date_format(i.indate,'%Y-%m') = #{time}
             </if>
             </if>
             <if test="ideaVO.scoreId != null">
             <if test="ideaVO.scoreId != null">
-               and score_id = #{ideaVO.scoreId}
+                and score_id = #{ideaVO.scoreId}
             </if>
             </if>
         </where>
         </where>
         order by i.indate desc
         order by i.indate desc