| | |
| | | import com.ycl.platform.service.ICheckIndexVideoService; |
| | | import com.ycl.platform.service.ICheckScoreService; |
| | | import com.ycl.system.entity.SysRole; |
| | | import com.ycl.system.entity.SysUser; |
| | | import com.ycl.system.service.ISysDeptService; |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.SecurityUtils; |
| | |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class CheckScoreServiceImpl extends ServiceImpl<CheckScoreMapper, CheckScore> implements ICheckScoreService |
| | | { |
| | | public class CheckScoreServiceImpl extends ServiceImpl<CheckScoreMapper, CheckScore> implements ICheckScoreService { |
| | | @Autowired |
| | | private CheckScoreMapper scoreMapper; |
| | | @Autowired |
| | |
| | | private ICheckIndexVideoService indexVideoService; |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * 查询考核积分指标 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public CheckScoreDetailVO selectCheckScoreById(CheckScoreIndexDTO checkScoreIndexDTO) |
| | | { |
| | | public CheckScoreDetailVO selectCheckScoreById(CheckScoreIndexDTO checkScoreIndexDTO) { |
| | | Long checkScoreId = checkScoreIndexDTO.getId(); |
| | | |
| | | CheckScoreDetailVO checkScoreDetailVO = new CheckScoreDetailVO(); |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore) |
| | | { |
| | | public Map<Long, List<CheckScore>> selectCheckScoreList(CheckScore checkScore) { |
| | | //区县只能看已发布 |
| | | roleControl(checkScore); |
| | | |
| | |
| | | getCheckScore(checkScore, calendar); |
| | | |
| | | // 一号查询之前的数据 |
| | | if (LocalDateTime.now().getDayOfMonth() == 1) { calendar.add(Calendar.DAY_OF_MONTH, -1); } |
| | | if (LocalDateTime.now().getDayOfMonth() == 1) { |
| | | calendar.add(Calendar.DAY_OF_MONTH, -1); |
| | | } |
| | | |
| | | List<CheckScore> checkScores = scoreMapper.selectCheckScoreMap(checkScore); |
| | | |
| | |
| | | return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId)); |
| | | } |
| | | |
| | | private void getCheckScore(CheckScore checkScore, Calendar calendar) |
| | | { |
| | | private void getCheckScore(CheckScore checkScore, Calendar calendar) { |
| | | // 0 省厅月度 1 市局月度 2 省厅季度 3 市局季度 |
| | | switch (checkScore.getExamineTag()) { |
| | | case 0, 1: |
| | |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d",userAlias = "u") |
| | | public Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore) |
| | | { |
| | | public Map<Long, List<CheckScore>> selectCheckScoreChart(CheckScore checkScore) { |
| | | //区县只能看已发布 |
| | | roleControl(checkScore); |
| | | |
| | |
| | | |
| | | private void roleControl(CheckScore checkScore) { |
| | | List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles(); |
| | | SysRole sysRole = roles.get(0); |
| | | if("zg_province".equals(sysRole.getRoleKey())){ |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | if (!user.isAdmin()) { |
| | | for (SysRole role : roles) { |
| | | if (role.getPermissions().contains("check:score:publish")) { |
| | | Map<String, Object> params = checkScore.getParams(); |
| | | params.put("publish",PublishType.PUBLISHED.getCode()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> home() { |