Merge remote-tracking branch 'origin/master'
| | |
| | | import com.ycl.system.AjaxResult; |
| | | import com.ycl.system.controller.BaseController; |
| | | import com.ycl.system.page.TableDataInfo; |
| | | import com.ycl.utils.poi.ExcelUtil; |
| | | import enumeration.BusinessType; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询考核积分折线图 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('check:score:chart')") |
| | | @GetMapping("/chart") |
| | | public AjaxResult selectCheckScoreChart(CheckScore checkScore) |
| | | { |
| | | Map<Long, List<CheckScore>> deptMap = checkScoreService.selectCheckScoreChart(checkScore); |
| | | return success(deptMap); |
| | | } |
| | | |
| | | /** |
| | | * 区县详情列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('check:score:list')") |
| | |
| | | */ |
| | | public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore); |
| | | |
| | | /** |
| | | * 查询考核积分折线图数据 |
| | | * |
| | | * @param checkScore 考核积分参数 |
| | | * @return 考核积分折线图 |
| | | */ |
| | | Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore); |
| | | |
| | | |
| | | int publishCheckScore(CheckScoreDTO checkScoreDTO); |
| | | |
| | |
| | | return scoreMapper.selectCheckScoreMap(checkScore).stream().collect(Collectors.groupingBy(CheckScore::getDeptId)); |
| | | } |
| | | |
| | | /** |
| | | * 查询考核积分卡片列表 |
| | | * |
| | | * @param checkScore 考核积分 |
| | | * @return 考核积分 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore) |
| | | { |
| | | //区县只能看已发布 |
| | | roleControl(checkScore); |
| | | |
| | | //查询成绩 |
| | | String date = checkScore.getDate(); |
| | | if(StringUtils.isEmpty(date)){ |
| | | //如果为空查本月的数据 |
| | | Calendar now = Calendar.getInstance(); |
| | | //取昨天 |
| | | now.add(Calendar.DATE, -1); |
| | | Date yesterday = now.getTime(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); |
| | | date = simpleDateFormat.format(yesterday); |
| | | checkScore.setDate(date); |
| | | } |
| | | List<CheckScore> checkScores = scoreMapper.selectCheckScoreList(checkScore); |
| | | return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId)); |
| | | } |
| | | |
| | | /** |
| | | * 区县详情 |
| | |
| | | SELECT |
| | | tcs.dept_id, |
| | | examine_category, |
| | | AVG(score) AS score, |
| | | ROUND(AVG(score), 2) AS score, |
| | | #{startDate} AS startDate, |
| | | #{endDate} AS endDate |
| | | #{endDate} AS endDate, |
| | | ANY_VALUE(tcs.create_time) AS createTime |
| | | FROM |
| | | t_check_score tcs |
| | | LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id |