|
@@ -1,16 +1,21 @@
|
|
|
package com.hssx.pcbms.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.hssx.pcbms.constant.Constant;
|
|
|
+import com.hssx.pcbms.entity.Idea;
|
|
|
import com.hssx.pcbms.entity.Parameter;
|
|
|
import com.hssx.pcbms.entity.Score;
|
|
|
import com.hssx.pcbms.entity.User;
|
|
|
-import com.hssx.pcbms.mapper.ParameterMapper;
|
|
|
-import com.hssx.pcbms.mapper.ScoreMapper;
|
|
|
-import com.hssx.pcbms.mapper.UserMapper;
|
|
|
+import com.hssx.pcbms.entity.vo.IdeaVO;
|
|
|
+import com.hssx.pcbms.entity.vo.ScoreVO;
|
|
|
+import com.hssx.pcbms.mapper.*;
|
|
|
import com.hssx.pcbms.service.ScoreService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.hssx.pcbms.util.HttpRespMsg;
|
|
|
+import com.hssx.pcbms.util.PageUtil;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
@@ -20,6 +25,7 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author 吴涛涛
|
|
@@ -33,6 +39,10 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
|
|
|
private ParameterMapper parameterMapper;
|
|
|
@Resource
|
|
|
private UserMapper userMapper;
|
|
|
+ @Resource
|
|
|
+ private IdeaMapper ideaMapper;
|
|
|
+ @Resource
|
|
|
+ private IdeaCommentMapper ideaCommentMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg add(Score score) throws ParseException {
|
|
@@ -75,6 +85,30 @@ public class ScoreServiceImpl extends ServiceImpl<ScoreMapper, Score> implements
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg getList(Score score,PageUtil page) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ PageHelper.startPage(page.getPageNum(),page.getPageSize());
|
|
|
+ List<Score> scores = scoreMapper.selectList(new QueryWrapper<Score>().eq("uid",score.getUid()).orderByDesc("score_id"));
|
|
|
+ PageInfo<Score> info = new PageInfo<>(scores);
|
|
|
+ msg.data = info;
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpRespMsg detail(Score score) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ ScoreVO vo = new ScoreVO();
|
|
|
+ Score oldScore = scoreMapper.selectById(score.getScoreId());
|
|
|
+ BeanUtils.copyProperties(oldScore,vo);
|
|
|
+ Idea idea = new Idea();
|
|
|
+ idea.setScoreId(score.getScoreId());
|
|
|
+ List<IdeaVO> ideaVos = ideaMapper.getIdeaListByUid(idea, null);
|
|
|
+ vo.setIdeaVO(ideaVos);
|
|
|
+ msg.data = vo;
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
private HttpRespMsg addScore(Date yearMonth, Date nowDate, Integer type, Score score,Score oldScore) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
//评分上个月
|